With the study of renewable energy power generation for microgrid becoming more and more significant, the microgrid's safe and economic operation has been paid more and more attention to. The microgrid economic operation cannot go well without perfect energy optimization scheduling, and making full use of energy storage units, coordinate microgrid internal power supply, storage and load, and the power/energy flow between the microgrid and the large power grid. Maximizing the microgrid operation efficiency under the premise of keeping balance between the supply and demand has become an urgent problem needing solution. Aiming at the problems in current literature, the dynamic optimization and static optimization models can't combine the day-ahead scheduling with real-time scheduling and fail to make full use of the storage and removal effect of energy storage units. In this paper, firstly, a multiple-time scale optimization scheduling scheme is put forward using the state of charge of energy storage unit as the bond between day-ahead scheduling and real-time scheduling. In day-ahead scheduling stage, a scheduling cycle is divided into 24 hours. In state of charge planning, the controllable micro power on-off plan and power generation plan are made based on the short power generation/consumption prediction data. In real-time scheduling stage, following the controllable micro power on-off planning and the state of charge of day-ahead scheduling, the future 5-15 minutes state of charge, charge and discharge power and the micro power supply power output planning is developed based on the real-time super short power generation/consumption prediction data. The day-ahead optimization model for the microgrid is also put forward, using the state of charge of energy storage units, controlled micro power supply power, and on-off state as control variables. The model puts four parts as constraint conditions within 24 hours, the controllable micro powers output, state of charge of energy storage unit, the interaction power between microgrid and power grid, and the power balance of microgrid. It takes the maximum utilization rate of renewable power generation, with minimum power supply cost of day as the goal. Then it takes the maximum utilization of renewable power, with minimum power supply cost of a day as the goal. It achieves the goal of maximum utilization of renewable energy power through meeting the demand of equivalent load, which simplifies the elements of the goal. To solve the multiple constraints, nonlinear, and mixed integer dynamic optimization models, it uses a genetic algorithm based on matrix real-coded which has strong global optimization ability, suited for parallel processing. Finally, an example of microgrid is given using the optimization model and algorithm which are proposed in this paper. The optimization scheduling results of parallel bidirectional power flow model and parallel unidirectional power flow model show that by reasonable control of state of charge in each period, the given optimization scheme can maximize utilization of renewable energy power and minimize power supply cost of microgrid whi.e at the same time achieving peak sharpening effect for the grid. [ABSTRACT FROM AUTHOR]