In order to apply the battery energy storage system in the peak load shifting in power grid effectively, the power optimization model in peak load shifting of the battery energy storage system is put forward in this paper as well as the practical algorithm solving the model. The practical constraints of the battery energy storage system are fully considered in this practical algorithm. Through this practical algorithm, the charging and discharging periods and power of the battery energy storage system can be effectively planned. Through an example analysis, the algorithm is simple, practical and feasible.