With the rapid development of renewable energy,the role of energy storage has become increasingly prominent. In terms of sizing problems of shared energy storage to provide primary frequency regulation for multiple renewable energy stations,an optimal energy storage configuration method is proposed aiming to minimize the total cost of shared energy storage investors. Firstly,the empirical distribution of historical frequency data is fitted,and the result is used to generate frequency data to further configure the energy storage. Then,based on the frequency data,an optimal configuration model of energy storage is developed which meets the requirements of primary frequency regulation. The primary frequency regulation constraints,energy storage rate characteristics constraints,and primary frequency regulation participation rate constraints and so on are considered in the optimal configuration model. The model is a mixed-integer linear programming model which can be solved by mature solvers. Finally,the proposed method is simulated and analyzed according to the actual frequency data,and the configuration results of the lithium-ion battery and flywheel are compared. The results show that the total cost can be reduced by installing shared energy storage compared with independent energy storage. Although the capacity of the lithium-ion battery energy storage systems is significantly greater than that of flywheel energy storage systems,the total cost of lithium-ion battery energy storage systems is lower.