Direct yaw moment control (DYC) can effectively improve the yaw stability of four-wheel distributed drive electric vehicles (4W-DDEVs) under extreme conditions, which has become an indispensable part of active safety control for 4W-DDEVs. This study proposes a novel hierarchical DYC architecture for 4W-DDEVs to enhance vehicle stability during ever-changing road conditions. Firstly, a vehicle dynamics model is established, including a two-degree-of-freedom (2DOF) vehicle model for calculating the desired yaw rate and sideslip angle as the control target of the upper layer controller, a DDEV model composed of a seven-degree-of-freedom (7DOF) vehicle model, a tire model, a motor model and a driver model. Secondly, a hierarchical DYC is designed combining the upper layer yaw moment calculation and low layer torque distribution. Specifically, based on Matlab/Simulink, improved linear quadratic regulator (LQR) with weight matrix optimization based on inertia weight cosine-adjustment particle swarm optimization (IWCPSO) is employed to compute the required additional yaw moment in the upper-layer controller, while quadratic programming (QP) is used to allocate four motors’ torque with the optimization objective of minimizing the tire utilization rate. Finally, a comparative test with double-lane-change and sinusoidal conditions under a low and high adhesion road surface is conducted on Carsim and Matlab/Simulink joint simulation platform. With IWCPSO-LQR under double-lane-change (DLC) condition on a low adhesion road surface, the yaw rate and sideslip angle of the DDEV exhibits improvements of 95.2%, 96.8% in the integral sum of errors, 94.9%, 95.1% in the root mean squared error, and 78.8%, 98.5% in the peak value compared to those without control. Simulation results indicate the proposed hierarchical control method has a remarkable control effect on the yaw rate and sideslip angle, which effectively strengthens the driving stability of 4W-DDEVs.