In view of optimizing the configuration of each unit’s capacity for energy storage in the microgrid system, in order to ensure that the planned energy storage capacity can meet the reasonable operation of the microgrid’s control strategy, the power fluctuations during the grid-connected operation of the microgrid are considered in the planning and The economic benefit of hybrid energy storage is quantified. A multi-objective function aiming at minimizing the power fluctuation on the DC bus in the microgrid and optimizing the capacity ratio of each energy storage system in the hybrid energy storage system (HESS) is established. The improved particle swarm algorithm (PSO) is used to solve the objective function, and the solution is applied to the microgrid experimental platform. By comparing the power fluctuations of the battery and the supercapacitor in the HESS, the power distribution is directly reflected. Comparing with the traditional mixed energy storage control strategy, it shows that the optimized hybrid energy storage control strategy can save 4.3% of the cost compared with the traditional hybrid energy storage control strategy, and the performance of the power fluctuation of the renewable energy is also improved. It proves that the proposed capacity configuration of the HESS has certain theoretical significance and practical application value.