The maritime industry, a major contributor to carbon emissions, is under increasing environmental pressure due to global climate change. This study presents an innovative energy management strategy for hybrid power systems in ocean engineering vessels, based on an improved particle swarm optimisation algorithm. We convert the traditional powered vessel Marine Oil 257 to a hybrid model, and explore the energy storage requirements, system configurations, and control methods for a practical implementation. Post-conversion, the main diesel engine drives the propeller, and is supported by a lithium iron phosphate battery energy storage system in conjunction with the diesel engine and shaft generators to achieve certain energy efficiency and emission reduction goals. In our strategy, the shaft power of the main engine and the active power of the shaft generator are employed as decision variables, and the ship power balance, operational speed limits, generator output constraints, and system reliability are taken into consideration. Real-time optimisation of energy allocation is performed using an improved particle swarm optimisation algorithm in MATLAB. The effectiveness of this approach is validated through a comparative analysis with full-scale experimental data, and it is shown to be a practical pathway for retrofitting traditional power vessels to enhance the energy efficiency and for providing valuable insights for technological advancement.