The battery energy storage system can effectively compensate the wind power prediction error by controlling the emission and absorption of energy. In this paper, when establishing the charging and discharging control strategy of the energy storage system to compensate the prediction error, the limitation of the extreme change of the state of charge of the energy storage system is taken into account, and the correction formula of the control strategy is proposed. The change of the state of charge is adjusted in advance to avoid overcharging. The phenomenon of over-discharging achieves the purpose of protecting the life of the battery energy storage and enhancing the effect of compensation error. On the basis of this, aiming at compensating the optimal effect of prediction error, the optimal capacity allocation method of energy storage system is proposed. The simulation results show that the control strategy has better compensation error and can greatly reduce the capacity configuration of the energy storage system.