Renewable distributed power sources such as wind power and photovoltaic power generation are connected to the power grid, which will bring problems such as increased network loss and reduced power quality. In this paper, a two-layer optimization model for energy storage systems is proposed under large-scale new energy access, and the coupling effects of energy storage planning and operation are considered comprehensively. In the upper layer model, energy storage planning is considered, with the location and capacity of energy storage configuration being the decision variables and the planning cost of the energy storage system being the objective function. The lower layer considers the economy and stability of the grid when the energy storage system is operating, with the output of the energy storage system at each moment as the decision variable and the grid vulnerability, active network loss, and power purchase cost as the objective function. The improved IEEE33 node system has been selected for simulation verification. The results show that the proposed model calculates the optimal capacity configurations of wind power combined energy storage as 0.919 and 0.820 MWh, respectively, and the model can obtain a reasonable energy storage configuration scheme and, in comparing the economic indicators under different scenarios, can obtain the dual storage configuration as the best scheme for the simulation system.