The invention discloses a method for improving power grid frequency stability based on sliding mode control. The frequency of the power grid can be controlled more quickly. The method comprises the following steps: 1, building a single-region off-grid generator set mathematical model, and constructing a system state equation; 2, designing a sliding mode surface function of the system, and judgingconvergence of the sliding mode surface function through the Lyapunov criterion; and 3, designing the control rate u of the system, and judging convergence of the system through the Lyapunov criterion. Compared with a traditional PID control method, a sliding mode control method is adopted for frequency control, the main innovation of the sliding mode control strategy is that the sliding mode surface function adopts a proportional-integral (PI) function, the control rate is high, and the anti-interference capability of the system is high.