According to the characteristics of microgrid in both grid-connected and islanding operation modes, control strategies are proposed to achieve smooth transition between these two modes. Under grid-connected mode, the fluctuation of power in microgrid is balanced by utility power grid. while DGs are adopting the PQ control to ensure the balance of power and realize energy management when the energy storage is in the state of charge standby; When microgrid transits to islanding mode, the droop V/f control strategy is employed to energy storage to support the voltage and frequency of the microgrid system and the power shortage of the whole system will be compensated. When microgrid reconnect to utility power grid, a three phase software phase-locked loop (SPLL) based pre-synchronizing unit is designed to track the utility grid voltage, which makes the process of reconnecting to grid stable and safe. In the whole process, the optimal distribution and reliable protection of the energy storage is well considered to meet control targets of smaller capacity and high efficiency, which can reduce the pollution and emissions levels. Simulations are carried out by MATLAB/SIMULINK. Simulation results confirm that the smooth switch of the control system is effective and stable.