Efficient use of renewable energy is one of the critical measures to achieve carbon neutrality. Countries have introduced policies to put carbon neutrality on the agenda to achieve relatively zero emissions of greenhouse gases and to cope with the crisis brought about by global warming. This work analyzes the wave energy with high energy density and wide distribution based on understanding of various renewable energy sources. This study provides a wave energy prediction model for energy harvesting. At the same time, the Gated Recurrent Unit network (GRU), Bayesian optimization algorithm, and attention mechanism are introduced to improve the model's performance. Bayesian optimization methods are used to optimize hyperparameters throughout the model training, and attention mechanisms are used to assign different weights to features to increase the prediction accuracy. Finally, the 1-hour and 6-hour forecasts are made using the data from China's NJI and BSG observatories, and the system performance is analyzed. The results show that, compared with mainstream prediction algorithms, GRU based on Bayesian optimization and attention mechanism has the highest prediction accuracy, with the lowest MAE of 0.3686 and 0.8204, and the highest R2 of 0.9127 and 0.6436, respectively. Therefore, the prediction model proposed here can provide support and reference for the navigation of ships powered by wave energy. Export Date: 29 December 2022; Article; CODEN: APEND; 通讯地址: Lv, Z.; Extended Energy Big Data and Strategy Research Center, China; 电子邮件: lvzhihan@gmail.com; 基金资助详情: SKLMCPTS202103011; 基金资助详情: National Natural Science Foundation of China, NSFC, 61902203; 基金资助文本 1: Funding: This work was supported by the National Natural Science Foundation of China [grant number 61902203 ]; the open project of the Xinhua News Agency State Key Laboratory of Media Convergence Production Technology and System [grant number SKLMCPTS202103011 ].; 参考文献: Zhou, J., Zhang, Y., Zhang, Y., Parameters identification of photovoltaic models using a differential evolution algorithm based on elite and obsolete dynamic learning[J] (2022) Appl Energy, 314; Bi, H., Shang, W.L., Chen, Y., GIS aided sustainable urban road management with a unifying queueing and neural network model[J] (2021) Appl Energy, 291; Von Wald, G., Sundar, K., Sherwin, E., Optimal gas-electric energy system decarbonization planning[J] (2022) Adv Appl Energy, 6; He, W., King, M., Luo, X., Technologies and economics of electric energy storages in power systems: review and perspective[J] (2021) Adv Appl Energy, 4; Zhao, X., Ma, X., Chen, B., Challenges toward carbon neutrality in China: Strategies and countermeasures[J] (2022) Resour Conserv Recycl, 176; Martínez-Gordón, R., Sánchez-Diéguez, M., Fattahi, A., Modelling a highly decarbonised North Sea energy system in 2050: A multinational approach[J] (2022) Adv Appl Energy, 5; Zhao, F., Liu, X., Zhang, H., Automobile Industry under China's Carbon Peaking and Carbon Neutrality Goals: Challenges, Opportunities, and Coping Strategies[J] (2022) J Adv Transp; Weng, Y., Cai, W., Wang, C., Evaluating the use of BECCS and afforestation under China's carbon-neutral target for 2060[J] (2021) Appl Energy, 299; Gray, N., McDonagh, S., O'Shea, R., Decarbonising ships, planes and trucks: An analysis of suitable low-carbon fuels for the maritime, aviation and haulage sectors[J] (2021) Adv Appl Energy, 1; Lira-Loarca, A., Ferrari, F., Mazzino, A., Future wind and wave energy resources and exploitability in the Mediterranean Sea by 2100[J] (2021) Appl Energy, 302; Melikoglu, M., Current status and future of ocean energy sources: A global review[J] (2018) Ocean Eng, 148, pp. 563-573; Choupin, O., Têtu, A., Del Río-Gamero, B., Premises for an annual energy production and capacity factor improvement towards a few optimised wave energy converters configurations and resources pairs[J] (2022) Appl Energy, 312; Akpınar, A., Kömürcü, M.İ., Assessment of wave energy resource of the Black Sea based on 15-year numerical hindcast data[J] (2013) Appl Energy, 101, pp. 502-512; Blackledge, J., Coyle, E., Kearney, D., Estimation of wave energy from wind velocity[J] (2013) Eng Lett, 21 (4), pp. 158-170; López, I., Andreu, J., Ceballos, S., Review of wave energy technologies and the necessary power-equipment[J] (2013) Renew Sustain Energy Rev, 27, pp. 413-434; Pan, P., Sun, Y., Yuan, C., Research progress on ship power systems integrated with new energy sources: a review[J] (2021) Renew Sustain Energy Rev, 144; Leung, S.F., Fu, H.C., Zhang, M., Blue energy fuels: converting ocean wave energy to carbon-based liquid fuels via CO 2 reduction[J] (2020) Energ Environ Sci, 13 (5), pp. 1300-1308; Cotorcea, A., Özkaynak, S., Nicolae, F., Present and future of renewable energy sources onboard ships. case study: solar-thermal systems[J] (2014) Scientific Bulletin“ Mircea cel Batran” Naval Academy, 17 (1), p. 35; L, Robotics Energy harvesting ocean robot[J]. 2017-12-04)[2018-01-20]. https://www. liquid-robotics. com/platform/how-it-works; Xu, X., Robertson, B., Buckham, B., A techno-economic approach to wave energy resource assessment and development site identification[J] (2020) Appl Energy, 260; Lou, R., Lv, Z., Dang, S., Application of machine learning in ocean data[J] (2021) Multimedia Syst, pp. 1-10; James, S.C., Zhang, Y., O'Donncha, F., A machine learning framework to forecast wave conditions[J] (2018) Coast Eng, 137, pp. 1-10; Mahjoobi, J., Mosabbeb, E.A., Prediction of significant wave height using regressive support vector machines[J] (2009) Ocean Eng, 36 (5), pp. 339-347; Mahjoobi, J., Etemad-Shahidi, A., An alternative approach for the prediction of significant wave heights based on classification and regression trees[J] (2008) Appl Ocean Res, 30 (3), pp. 172-177; Gao, S., Huang, J., Li, Y., A forecasting model for wave heights based on a long short-term memory neural network[J] (2021) Acta Oceanol Sin, 40 (1), pp. 62-69; Fan, S., Xiao, N., Dong, S., A novel model to predict significant wave height based on long short-term memory network[J] (2020) Ocean Eng, 205; Ni, C., Ma, X., An integrated long-short term memory algorithm for predicting polar westerlies wave height[J] (2020) Ocean Eng, 215; Xiang, L., Yang, X., Hu, A., Condition monitoring and anomaly detection of wind turbine based on cascaded and bidirectional deep learning networks[J] (2022) Appl Energy, 305; Tuttle, J.F., Blackburn, L.D., Andersson, K., A systematic comparison of machine learning methods for modeling of dynamic processes applied to combustion emission rate modeling[J] (2021) Appl Energy, 292; Li, X., Cao, J., Guo, J., Multi-step forecasting of ocean wave height using gate recurrent unit networks with multivariate time series[J] (2022) Ocean Eng, 248; Niu, D., Yu, M., Sun, L., Short-term multi-energy load forecasting for integrated energy systems based on CNN-BiGRU optimized by attention mechanism[J] (2022) Appl Energy, 313; Yang, D., Guo, J., Sun, S., An interval decomposition-ensemble approach with data-characteristic-driven reconstruction for short-term load forecasting[J] (2022) Appl Energy, 306; He, F., Zhou, J., Feng, Z., A hybrid short-term load forecasting model based on variational mode decomposition and long short-term memory networks considering relevant factors with Bayesian optimization algorithm[J] (2019) Appl Energy, 237, pp. 103-116; Fernández, J.C., Salcedo-Sanz, S., Gutiérrez, P.A., Significant wave height and energy flux range forecast with machine learning classifiers[J] (2015) Eng Appl Artif Intel, 43, pp. 44-53; Hochreiter, S., Untersuchungen zu dynamischen neuronalen Netzen[J] (1991) Diploma, Technische Universität München, 91 (1); Hochreiter, S., Schmidhuber, J., Long short-term memory[J] (1997) Neural Comput, 9 (8), pp. 1735-1780; Zhang, A., C, Z., (2021), Lipton M, Li Dive into deep learning[J]. arXiv preprint arXiv:2106.11342; Sundermeyer, M., (2012), R, Schlüter Ney H. LSTM neural networks for language modeling[C]//Thirteenth annual conference of the international speech communication association; Cho, K., (2014), B, Van Merriënboer, C, Gulcehre Learning phrase representations using RNN encoder-decoder for statistical machine translation[J]. arXiv preprint arXiv:1406.1078; Bergstra, J., Bengio, Y., Random search for hyper-parameter optimization[J] (2012) J Mach Learn Res, 13 (2); Snoek, J., Larochelle, H., Adams mation pR P. Practical bayesian optimization of machine learning algorithms[J] (2012) Adv neural inforrocessing systems, p. 25; Zhu, X., Guo, K., Ren, S., Lightweight image super-resolution with expectation-maximization attention mechanism[J] (2021) IEEE Trans Circuits Syst Video Technol, 32 (3), pp. 1273-1284; Duan, Y., Li, H., He, M., Zhao, D., A BiGRU autoencoder remaining useful life prediction scheme with attention mechanism and skip connection (2021) IEEE Sens J, 21 (9), pp. 10905-10914; Hao, S., Lee, D.H., Zhao, D., Sequence to sequence learning with attention mechanism for short-term passenger flow prediction in large-scale metro system[J] (2019) Trans Res Part C: Emerging Technol, 107, pp. 287-300; Mahjoobi, J., Etemad-Shahidi, A., Kazeminezhad, M.H., Hindcasting of wave parameters using different soft computing methods (2008) Appl Ocean Res, 30 (1), pp. 28-36; Nikoo, M.R., Kerachian, R., Alizadeh, M.R., A fuzzy KNN-based model for significant wave height prediction in large lakes[J] (2018) Oceanologia, 60 (2), pp. 153-168; Zeng, L., Ren, W., Shan, L., Well logging prediction and uncertainty analysis based on recurrent neural network with attention mechanism and Bayesian theory[J] (2022) J Pet Sci Eng, 208