In view of the modeling difficulties due to the nonlinear, time-varying and distributed generation uncertainty of intelligent building micro grid system, a scheduling algorithm for energy storage system based on heuristic dynamic programming (HDP) is proposed. According to weather classification, two neural networks are used to train the HDP model, so that it can adapt itself to the environment and self update considering the service life of the energy storage system and the real-time price of users.Compared with differential evolution algorithm, the results show that the proposed energy storage optimization scheduling algorithm can effectively save electricity costs and avoid deep charge and discharge of energy storage systems, and has good economic benefits.In the process of learning from the environment, the characteristics of the optimal solution are gradually sought to make the algorithm less dependent on the model and effectively alleviate the difficulty of modeling.Besides,it also has a good effect in balancing load, cutting peak and filling valley.