According to the large fluctuations and strong randomness of the output power of renewable energy, taking into account the constraints such as battery life cycle, an energy storage control method based on real-time state of charge and variable filter time constant is presented. This method can compensate the fluctuation composition of a particular frequency band in the output power of renewable energy by real-time regulating the output power of energy storage system. At the same time, filter time constant is adjusted according to the state of charge in order to stabilize the value of batterys state of charge in a certain range, while the over-charging and over-discharging of the battery is avoided. A photovoltaic and battery storage system simulation model built in PSCAD shows the effectiveness of the proposed method.