In this paper, a kind of lateral stability control strategy is put forward about the four wheel independent drive electric vehicle. The design of control system adopts hierarchical structure. Unlike the previous control strategy, this paper introduces a method which is the combination of sliding mode control and optimal allocation algorithm. According to the driver's operation commands(steering angle and speed), the steady state responses of the sideslip angle and yaw rate are obtained. Based on this, the reference model is built. Upper controller adopts the sliding mode control principle to obtain the desired yawing moment demand. Lower controller is designed to satisfy the desired yawing moment demand by optimal allocation of the tire longitudinal forces. Firstly, the optimization goal is built to minimize the actuator cost. Secondly, the weighted least-square method is used to design the tire longitudinal forces optimization distribution strategy under the constraint conditions of actuator and the friction oval. Beyond that, when the optimal allocation algorithm is not applied, a method of axial load ratio distribution is adopted. Finally, Car Sim associated with Simulink simulation experiments are designed under the conditions of different velocities and different pavements. The simulation results show that the control strategy designed in this paper has a good following effect comparing with the reference model and the sideslip angle is controlled within a small rang at the same time.Beyond that, based on the optimal distribution mode, the electromagnetic torque phase of each wheel can follow the trend of the vertical force of the tire, which shows the effectiveness of the optimal distribution algorithm.