In a 100% clean energy town, to meet the energy balance and reduce the impact of power fluctuations on the main grid, in this paper, a hierarchical optimal energy management strategy (EMS) for a hybrid energy storage system (HESS) is proposed. The EMS consists of three layers. To meet the requirement of 100% clean energy, in the upper layer, a HESS economic operation model based on the mixed integer non-linear programming (MINLP) is presented. Then, considering the uncertainty of renewable energy and load, a power prediction model is presented in the middle layer. In addition, to reduce the power disturbance on the main grid caused by the stochastic power, a stochastic model predictive control (SMPC) strategy is implemented to optimize the power allocation of a HESS. In the lower layer, to reduce the power fluctuations of the lithium-ion battery (LiB) when mitigating minute-scale power fluctuations, a HESS optimal power allocation strategy based on Pontryagin's minimum principle (PMP) is proposed. In every control period, each layer is optimized based on the results of the previous layer. Finally, a simulation study is provided to validate the effectiveness of the proposed EMS. The results show that the proposed strategy has good performance in typical scenarios.