The hybrid ship has multiple power sources and integrates the power characteristics of multiple energy sources, and different power sources need to be involved according to different sailing conditions. In order to take into account the system stability, economy, environmental protection and other objectives, it is necessary to develop a suitable energy management strategy to allocate torque or power to the output of each power source, so as to ensure the safe and stable operation of the system power to meet the sailing requirements and enhance the Hybrid power system efficiency, improve energy saving and emission reduction performance. In this paper, we use dynamic planning algorithm to allocate energy to typical power demand and obtain the energy allocation strategy of gas-electric hybrid power system under global optimization.