The invention discloses a pure electric vehicle frame lightweight method based on nonlinear programming. The method comprises the following steps of S1, establishing a finite element model of a frame;S2, determining an optimized objective function and an optimized design variable, and solving a mathematical expression of the objective function by means of the Hypermesh software; S3, determining an optimized constraint condition, and collecting the sample data of each constraint response; S4, processing the sample data, performing function fitting on each constraint response by using a second-order response surface model, and solving an approximate agent model of each constraint; and S5, constructing a nonlinear programming model by using the agent model of each constraint and the mathematical expression of the objective function, and solving the optimization model. According to the method, by adopting the nonlinear programming model, and using the Lingo software for solving and optimizing, the optimal solution can be obtained within the extremely short time, and the optimization efficiency is greatly improved. The optimization method has the characteristics of simple principle, high solution rate, high optimization precision and the like.