The function of energy storage BMS is