Sea wave height prediction method and device, storage medium and electronic device
The integration of short-term and long-term prediction models with residual distribution analysis enhances sea wave height monitoring, addressing calculation complexity and accuracy issues in existing technologies, providing improved real-time and precise predictions.
Patent Information
- Application Number
- CN202510314594.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-17
- Publication Date
- 2025-07-15
AI Technical Summary
In the prior art, wave height monitoring that relies on physical models and a single sensor has problems such as complex calculations, poor real-time performance and limited accuracy.
A method combining short-term prediction model and long-term prediction model is adopted to obtain real-time wave height data and environmental data, use short-term prediction models for preliminary prediction, and optimize the long-term prediction model and residual distribution to finally determine the final prediction result of wave height.
It improves the real-time and accuracy of wave height prediction, breaks through the limitations of traditional methods, and achieves more efficient wave monitoring.
Smart Images

Figure CN120316701A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of ocean engineering, and in particular, to a method and device for predicting wave height, a storage medium, and an electronic device. Background Art
[0002] With the booming development of the global ocean economy, the demand for marine environmental monitoring has surged in activities such as offshore wind farms, port construction, and marine resource development. As a key parameter for measuring the ocean dynamics, accurate monitoring of wave height is crucial for ensuring the safety and efficiency of offshore operations. The ability to monitor waves in real time and with high precision can not only optimize the operation strategy of wind farms but also provide early warnings for shipping safety, effectively respond to extreme weather events, and reduce losses of life and property.
[0003] Among them, the development of wave monitoring technology has undergone a transformation from single-sensor measurement to complex physical model prediction. The sensor measurement method can directly obtain on-site data, but its accuracy fluctuates due to environmental factors. Physical model prediction is based on the principles of ocean dynamics and predicts future wave height through numerical simulation, with relatively high theoretical prediction ability. However, in practical applications, physical models often require accurate environmental parameter inputs, have high requirements for computing resources, and in complex and variable ocean environments, the adaptability and prediction accuracy of the models are limited.
[0004] In view of the problems in the related art, such as relying on physical models and single sensors, being computationally complex, having poor real-time performance, and limited accuracy, no effective solution has been proposed yet.
[0005] Therefore, it is necessary to improve the related technology to overcome the defects in the related technology. Summary of the Invention
[0006] The embodiments of the present application provide a method and device for predicting wave height, a storage medium, and an electronic device, so as to at least solve the problems in the related technology, such as relying on physical models and single sensors, being computationally complex, having poor real-time performance, and limited accuracy.
[0007] According to one aspect of the embodiments of the present application, a method for predicting the sea wave height is provided, including: obtaining real-time wave height data of sea waves in a target area and environmental data of the target area, where the real-time wave height data is used to indicate the sea wave height at different times; processing the real-time wave height data through a short-term prediction model to obtain a first prediction result of the sea wave height within a first time period, and determining a residual distribution corresponding to the first prediction result, where the residual distribution is used to indicate the difference value between the first prediction result and the actual observation result of the sea wave within the first time period; processing the environmental data and the residual distribution through a long-term prediction model to obtain a second prediction result of the sea wave height within a second time period, where the second time period includes the first time period; determining a final prediction result of the sea wave height according to the first prediction result and the second prediction result.
[0008] In an exemplary embodiment, before processing the real-time wave height data through the short-term prediction model, the method further includes: fitting a short-term prediction model to historical wave height data by the maximum likelihood method to obtain multiple sets of model parameters, where each set of model parameters includes: the order p of the autoregressive term, the order d of the differencing term, and the order q of the moving average term; performing parameter evaluation on the multiple sets of model parameters, and determining a target set of model parameters from the multiple sets of model parameters according to the parameter evaluation result; determining the target set of model parameters as the model parameters of the short-term prediction model.
[0009] In an exemplary embodiment, before fitting a short-term prediction model to historical wave height data by the maximum likelihood method, the method further includes: decomposing the time series of the historical wave height data to extract characteristic components of the historical wave height data, where the characteristic components include: a trend component, a periodic component, and a random component; performing feature extraction on the historical wave height data according to the characteristic components to obtain feature data, where the feature data includes: wave period, wave height; fitting a short-term prediction model according to the feature data by the maximum likelihood method.
[0010] In an exemplary embodiment, before processing the real-time wave height data through the short-term prediction model, the method further includes: detecting outliers in the real-time wave height data through an outlier detection algorithm, and removing the detected outliers to obtain the real-time wave height data after removal, and filling data points of the real-time wave height data after removal through linear interpolation to obtain the processed real-time wave height data; processing the processed real-time wave height data through the short-term prediction model.
[0011] In an exemplary embodiment, determining the final prediction result of the sea wave height according to the first prediction result and the second prediction result includes: determining a third prediction result corresponding to the first time period and a fourth prediction result corresponding to the third time period in the second prediction result, where the second time period includes the first time period and the third time period; performing a weighting process on the first prediction result and the third prediction result to obtain a first final prediction result corresponding to the first time period, and determining the fourth prediction result as a second final prediction result corresponding to the third time period; determining the final prediction result according to the first final prediction result and the second final prediction result.
[0012] In an exemplary embodiment, after determining the final prediction result of the sea wave height according to the first prediction result and the second prediction result, the method further includes: in a case where it is determined that the predicted value of the sea wave height at a target time in the final prediction result is greater than a preset threshold, determining that there is an extreme wave event at the target time, where the final prediction result includes predicted values of the sea wave height at multiple times; performing an alarm according to the danger level of the extreme wave event, integrating data and models into a cloud platform to achieve remote access and real-time visualization.
[0013] According to another aspect of the embodiments of the present application, there is also provided a prediction device for sea wave height, including: an acquisition module, configured to acquire real-time wave height data of sea waves in a target area and environmental data of the target area, where the real-time wave height data is used to indicate the sea wave height at different times; a first processing module, configured to process the real-time wave height data through a short-term prediction model to obtain a first prediction result of the sea wave height in a first time period, and determine a residual distribution corresponding to the first prediction result, where the residual distribution is used to indicate the difference value between the first prediction result and the actual observation result of the sea wave in the first time period; a second processing module, configured to process the environmental data and the residual distribution through a long-term prediction model to obtain a second prediction result of the sea wave height in a second time period, where the second time period includes the first time period; a determination module, configured to determine the final prediction result of the sea wave height according to the first prediction result and the second prediction result.
[0014] According to still another aspect of the embodiments of the present application, there is also provided a computer-readable storage medium, in which a computer program is stored, where the computer program is configured to execute the above-mentioned prediction method for sea wave height when running.
[0015] According to another aspect of the embodiments of the present application, an electronic device is further provided, including a memory, a processor, and a computer program stored on the memory and executable on the processor. Wherein, the processor executes the above-mentioned method for predicting the sea wave height through the computer program.
[0016] According to another aspect of the embodiments of the present application, a computer program product is further provided, including a computer program, and when the computer program is executed by a processor, the steps of the methods in the various embodiments of the present application are implemented.
[0017] Through the present application, first, real-time wave height data of sea waves in a target area and environmental data of the target area are obtained. Among them, the real-time wave height data is used to indicate the sea wave height at different times; then the real-time wave height data is processed through a short-term prediction model to obtain a first prediction result of the sea wave height within a first time period, and a residual distribution is determined to indicate the difference value between the first prediction result and the actual observation result of the sea wave within the first time period; then the environmental data and the residual distribution are processed through a long-term prediction model to obtain a second prediction result of the sea wave height within a second time period, where the second time period includes the first time period; finally, a final prediction result of the sea wave height is determined according to the first prediction result and the second prediction result; by adopting the above solution, by combining the short-term dynamic prediction ability of the time series model (short-term prediction model) and the non-linear fitting ability of the random forest regression model (long-term prediction model), the limitations of traditional single methods are broken through, thereby improving the real-time performance and prediction accuracy of the sea wave height prediction; furthermore, the problems of complex calculation, poor real-time performance, and limited accuracy in the related art, which rely on physical models and single sensors, are solved. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] The drawings here are incorporated into the specification and constitute a part of this specification, showing the embodiments in line with the present application, and are used together with the specification to explain the principles of the present application.
[0019] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the following will briefly introduce the drawings required for use in the description of the embodiments or the prior art. Obviously, for those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.
[0020] Figure 1 It is a hardware structure block diagram of a computer terminal for a method of predicting the sea wave height according to an embodiment of the present application;
[0021] Figure 2 It is a flowchart of a method for predicting the sea wave height according to an embodiment of the present application;
[0022] Figure 3It is a flowchart of an optional random forest model optimization method according to an embodiment of the present application;
[0023] Figure 4 It is a flowchart of the basic steps of a maximum likelihood method according to an embodiment of the present application;
[0024] Figure 5 It is a structural block diagram of a device for predicting sea wave height according to an embodiment of the present application. Specific implementation manners
[0025] In order to enable those skilled in the art to better understand the solutions of the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present application.
[0026] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and do not have to be used to describe a specific order or sequence. It should be understood that such data can be interchanged under appropriate circumstances so that the embodiments of the present application described here can be implemented in an order different from those illustrated or described here. In addition, the terms "comprising" and "having" and any variations thereof are intended to cover non-exclusive inclusion. For example, a process, method, system, product or device comprising a series of steps or units does not necessarily have to be limited to those steps or units clearly listed, but may include other steps or units not clearly listed or inherent to these processes, methods, products or devices.
[0027] The method embodiments provided in the embodiments of the present application can be executed on a computer terminal or a similar computing device. Taking running on a computer terminal as an example, Figure 1 It is a hardware structural block diagram of a computer terminal of a method for predicting sea wave height according to an embodiment of the present application. As Figure 1 shown, the computer terminal may include one or more ( Figure 1 only one is shown in Figure 1The structure shown is only illustrative and does not limit the structure of the above computer terminal. For example, the computer terminal may further include more or fewer components than those shown in Figure 1 or have a different configuration from that shown in Figure 1 .
[0028] The memory 104 can be used to store computer programs, for example, software programs and modules of application software, such as the computer program corresponding to the method for predicting the sea wave height in the embodiments of the present application. The processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, that is, implements the above method. The memory 104 may include a high-speed random access memory and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memories, or other non-volatile solid-state memories. In some instances, the memory 104 may further include a memory remotely provided with respect to the processor 102, and these remote memories can be connected to the computer terminal through a network. Examples of the above network include but are not limited to the Internet, enterprise intranets, local area networks, mobile communication networks, and combinations thereof.
[0029] The wireless network provided by the communication provider of the computer terminal. In one instance, the transmission device 106 includes a network adapter (abbreviated as NIC), which can be connected to other network devices through a base station and thus can communicate with the Internet. In one instance, the transmission device 106 can be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.
[0030] In this embodiment, a method for predicting the sea wave height is provided. Figure 2 is a flowchart of a method for predicting the sea wave height according to an embodiment of the present application, as shown in Figure 2 , and the process includes the following steps S202 - S208:
[0031] Step S202: Obtain the real-time wave height data of the sea waves in the target area and the environmental data of the target area, where the real-time wave height data is used to indicate the sea wave height at different times;
[0032] Step S204: Process the real-time wave height data through a short-term prediction model to obtain a first prediction result of the sea wave height in the first time period, and determine the residual distribution corresponding to the first prediction result, where the residual distribution is used to indicate the difference value between the first prediction result and the actual observation result of the sea wave in the first time period;
[0033] Step S206: Process the environmental data and the residual distribution through a long-term prediction model to obtain a second prediction result of the wave height of the sea wave within a second time period, where the second time period includes the first time period;
[0034] Model training: Use the residuals of the time series and environmental variables as the input of the random forest model, and the actual value of the wave height as the output. The random forest model performs non-linear fitting on the time series residuals and environmental variables to optimize the prediction result of the wave height. The basic form of the random forest model is: N is the number of decision trees in the random forest, T i (x) is the predicted output of the i-th decision tree, is the final prediction result of the random forest.
[0035] Step S208: Determine the final prediction result of the wave height according to the first prediction result and the second prediction result.
[0036] Through the above steps, first, obtain the real-time wave height data of the sea wave in the target area and the environmental data of the target area. The real-time wave height data is used to indicate the wave height of the sea wave at different times. Then, process the real-time wave height data through a short-term prediction model to obtain a first prediction result of the wave height of the sea wave within a first time period, and determine the residual distribution to indicate the difference value between the first prediction result and the actual observation result of the sea wave within the first time period. Then, process the environmental data and the residual distribution through a long-term prediction model to obtain a second prediction result of the wave height of the sea wave within a second time period, where the second time period includes the first time period. Finally, determine the final prediction result of the wave height according to the first prediction result and the second prediction result. By adopting the above solution, by combining the short-term dynamic prediction ability of the time series model (short-term prediction model) and the non-linear fitting ability of the random forest regression model (long-term prediction model), the limitations of traditional single methods are broken through, thereby improving the prediction real-time performance and prediction accuracy of the wave height. Furthermore, it solves the problems in the related technology, such as relying on physical models and single sensors, with complex calculations, poor real-time performance, and limited accuracy.
[0037] In an exemplary embodiment, before processing the real-time wave height data through the short-term prediction model, the method further includes: performing short-term prediction model fitting on the historical wave height data through the maximum likelihood method to obtain multiple groups of model parameters, where each group of model parameters includes: the order p of the autoregressive term, the order d of the differencing term, and the order q of the moving average term; performing parameter evaluation on the multiple groups of model parameters, and determining the target group of model parameters from the multiple groups of model parameters according to the parameter evaluation result; and determining the target group of model parameters as the model parameters of the short-term prediction model.
[0038] It should be noted that the Maximum Likelihood Estimation (MLE) is a fundamental statistical method used to estimate model parameters. Its core lies in finding a set of parameter values based on the observed dataset that maximizes the probability (i.e., likelihood) of the data occurring under the model. Simply put, the maximum likelihood method assumes that the data follows a certain probability distribution and estimates the unknown parameters by calculating and optimizing the likelihood function (i.e., the function of the data occurrence probability), ensuring that the selected parameters can best explain the observed data. This method is intuitive and effective mathematically and is widely used in parameter estimation of various statistical models, including time series analysis, regression models, and mixture models, etc. It is a bridge connecting theoretical models and actual observed data.
[0039] In the example of this application, first, the maximum likelihood method is used to fit the short-term prediction model (i.e., the ARIMA model) to the historical wave height data, learning from the historical data and determining the best parameters of the model, that is, the optimal combination of the order p of the autoregressive (AR) term, the order d of the differencing (I) term, and the order q of the moving average (MA) term. After fitting multiple sets of model parameters, these parameters need to be evaluated. Usually, this step is carried out through information criteria (such as AIC or BIC) to measure the trade-off between the complexity of the model and the degree of data fitting, and select the most appropriate model parameters. AIC (Akaike Information Criterion) and BIC (Bayesian Information Criterion) are two commonly used model selection criteria, which can help us avoid overfitting of the model (i.e., the phenomenon that the model performs well on the training data but poorly on new data). Through parameter evaluation, we can screen out the best parameter combination from multiple sets of model parameters to construct the optimal short-term prediction model. After parameter evaluation, the target set of model parameters is determined as the final parameter setting of the short-term prediction model. This process ensures that the model has the best prediction performance when processing real-time wave height data. The short-term prediction model (ARIMA) can capture the short-term trends, seasonal variations, and random fluctuations in the time series of wave heights, making accurate predictions for the changes in wave heights in the short term in the future. It is the first line of defense against wave dynamics.
[0040] Optionally, before fitting the short-term prediction model to the historical wave height data by the maximum likelihood method, the method further includes: decomposing the time series of the historical wave height data to extract the characteristic components of the historical wave height data, where the characteristic components include: trend component, periodic component, random component; extracting features from the historical wave height data according to the characteristic components to obtain feature data, where the feature data includes: wave period, wave height; fitting the short-term prediction model according to the feature data by the maximum likelihood method.
[0041] Time series decomposition: The process of decomposing complex time series data into three components: trend, periodicity, and random fluctuations. This method helps us distinguish the long-term trend, seasonal fluctuations, and short-term random noise in the data, thus enabling a more accurate understanding of the data structure. In wave height monitoring, the trend component reflects the long-term change pattern of waves, the periodic component captures the seasonal and periodic patterns of sea conditions, and the random component reveals unpredictable random fluctuations.
[0042] Feature component extraction: Through time series decomposition, historical wave height data can be analyzed in more detail to extract key feature components. Among them, the trend component is usually determined by the moving average method or exponential smoothing technique; the periodic component can be identified through spectral analysis, such as the fast Fourier transform (FFT); the random component is evaluated through residual analysis. The extraction of these components not only helps to understand the internal structure of wave data but also provides an important basis for model selection and parameter optimization.
[0043] Feature dataset: Contains information crucial for model training, such as wave period, wave height, frequency, etc. These feature data not only reflect the dynamic characteristics of waves but also help the model better capture the correlation with environmental variables (such as wind speed, air pressure, etc.), thus providing more comprehensive and detailed data support during model fitting.
[0044] In the example of this application, first, through time series decomposition technology, historical wave height data is refined into three key components: trend, periodicity, and random fluctuations, clearly revealing the long-term trend, seasonal changes, and non-predictable noise of the data. Subsequently, feature extraction is performed on the decomposed data, focusing on wave period, wave height, and the correlation with environmental factors, to construct a feature dataset containing the dynamic characteristics of waves, providing high-quality input for model training. Finally, the maximum likelihood method is used to fit the model parameters for the feature data. By calculating and optimizing the parameters, it is ensured that the model can best explain the observed data, thus providing an accurate theoretical framework for subsequent short-term wave prediction.
[0045] Optionally, before processing the real-time wave height data through the short-term prediction model, the method further includes: detecting outliers in the real-time wave height data through an outlier detection algorithm and removing the detected outliers to obtain the real-time wave height data after removal, and filling in data points for the real-time wave height data after removal through linear interpolation to obtain the processed real-time wave height data; processing the processed real-time wave height data through the short-term prediction model.
[0046] Outlier Detection Algorithm: Outliers, or anomalies, may be caused by measurement errors, equipment failures, or extreme weather events, which can significantly affect the training and prediction performance of models. By using outlier detection algorithms, such as the method based on IQR (Interquartile Range), these outliers can be identified and removed to avoid bias in subsequent analyses. This not only improves data quality but also ensures the authenticity of the basic data for model training, contributing to the construction of a more reliable and accurate prediction model.
[0047] Linear Interpolation Method: Linear interpolation is a commonly used data imputation technique. It estimates the missing values by linearly interpolating between the two known data points before and after the missing data point in a time series. This method is simple and intuitive and can effectively handle short-term data missing due to transmission interruptions, equipment maintenance, or other reasons, ensuring the continuity and integrity of the time series and providing a continuous data stream for subsequent short-term prediction models.
[0048] In the example of this application, first, the outlier detection algorithm is used to carefully screen and remove outliers in the real-time wave height data to ensure the accuracy and representativeness of the data and avoid interference from abnormal measurements or equipment failures on the prediction results. Subsequently, for the possible missing points in the data, the linear interpolation method is used for imputation to restore the continuity of the time series, making the data complete and suitable for subsequent analyses and modeling. Finally, the processed real and continuous real-time wave height data is analyzed through a short-term prediction model (such as ARIMA) to capture the immediate change trend of the wave height and achieve accurate short-term prediction.
[0049] Optionally, determining the final prediction result of the wave height according to the first prediction result and the second prediction result includes: determining the third prediction result corresponding to the first time period and the fourth prediction result corresponding to the third time period in the second prediction result, where the second time period includes the first time period and the third time period; performing weighted processing on the first prediction result and the third prediction result to obtain the first final prediction result corresponding to the first time period, and determining the fourth prediction result as the second final prediction result corresponding to the third time period; determining the final prediction result according to the first final prediction result and the second final prediction result.
[0050] Precisely extract the prediction data for the same time period as the short-term prediction model and the prediction information for a longer subsequent time period from the results of the long-term prediction model to ensure the temporal correspondence and continuity of the prediction results. Subsequently, perform weighted fusion on the short-term prediction (the first prediction result) and the long-term prediction for the same time period (the third prediction result) to generate a more stable and accurate first final prediction result. At the same time, directly determine the predicted values for the future time period of the long-term prediction (the fourth prediction result) as the corresponding second final prediction result, which reflects the unique value of the long-term prediction in capturing long-term trends. Finally, integrate the final prediction results of these two time windows to form a complete sea wave height prediction covering the short term to the long term.
[0051] Optionally, after determining the final prediction result of the sea wave height according to the first prediction result and the second prediction result, the method further includes: when it is determined that the predicted value of the sea wave height at the target moment in the final prediction result is greater than the preset threshold, determining that there is an extreme wave event at the target moment, where the final prediction result includes the predicted values of the sea wave height at multiple moments; performing an alarm according to the danger level of the extreme wave event, integrating the data and the model into the cloud platform to achieve remote access and real-time visualization.
[0052] Optionally, the above preset threshold is usually set based on historical data, statistical analysis of sea conditions, and safety standards, and it defines the boundary between normal sea wave height and potential dangerous events. In the fields of marine scientific research and offshore operations, the setting of the preset threshold is a key link, which needs to consider various factors, including the average wave height of the sea area, seasonal changes, records of past extreme events, and differences in safety requirements for different activities. When the predicted value crosses this threshold, the system immediately determines that there is an extreme wave event at the target moment, which is the trigger point of the system's safety warning mechanism.
[0053] In the example of this application, first through the analysis of the final prediction result, the system can identify whether the predicted value of the sea wave height exceeds the preset safety threshold at a specific target moment, so as to determine whether there is a potential extreme wave event. Subsequently, after confirming the extreme wave event, the system performs an intelligent alarm according to the danger level of the event, that is, the amplitude of the wave height exceeding the threshold and the possible duration, and quickly transmits the warning information to relevant operators or management departments. Ensure seamless connection from prediction to warning, and be able to initiate response measures in a timely manner when extreme sea wave conditions are predicted, reducing potential threats to offshore operations and personnel safety.
[0054] It should be noted that the devices used for multi-source data collection include but are not limited to a wave height sensor (using ultrasonic or laser ranging equipment of a buoy system to collect real-time wave height data, which serves as the core input variable of the time series) and an environmental variable sensor (obtaining relevant environmental variables such as wind speed, wind direction, air pressure, and sea temperature through a weather station to assist in describing the external factors affecting wave changes) to collect data in real time. For the data transmission and storage part, wireless transmission or satellite communication can be used to transmit the data to a central server, and a distributed database is constructed on the server side to store historical time series data, facilitating subsequent modeling and analysis.
[0055] In an optional embodiment, the present application provides an optional method for optimizing a random forest model, and its process is as Figure 3 shown, specifically including:
[0056] 1. Feature importance analysis: Calculate the contribution degree of input variables according to Gini impurity or information gain;
[0057] When training a random forest model, each decision tree calculates the reduction of Gini impurity or information gain of features when splitting nodes. After the model training is completed, summarize the calculation results of all decision trees to obtain the average importance score of each feature. Sort the features according to the importance score, and select the features with the highest contribution degree for model prediction, thereby reducing the interference of redundant features and improving the prediction performance of the model.
[0058] 2. Hyperparameter tuning: Optimize parameters such as the number of decision trees, maximum depth, and minimum splitting nodes through grid search;
[0059] Preset a search range and combination of hyperparameters. For example, the number of decision trees ranges from 100 to 1000, and the maximum depth ranges from 10 to 50, etc. Use cross-validation (such as k-fold cross-validation) to evaluate the prediction performance of the model under each hyperparameter combination, such as accuracy, AUC value, or mean absolute error (MAE). Select the hyperparameter combination with the best prediction performance for the final random forest model training to ensure the stability and accuracy of the model in practical applications.
[0060] 3. Online update: Use the latest data to adjust the random forest model in real time to ensure adaptability to dynamic sea conditions;
[0061] Set an update frequency or data threshold. When the preset condition is reached, the model starts to perform partial updates using the new data. During online update, retain the patterns and rules learned by the model before, and only fit and adjust the latest data. The adjustments include recalculating feature importance, fine-tuning hyperparameters, and possibly updating the decision tree structure, so as to ensure that the model can accurately reflect the current marine environmental state.
[0062] Through the above steps, the random forest model can continuously optimize itself, improve the accuracy of predicting wave height, and at the same time have good robustness and adaptability.
[0063] In another optional embodiment, the present application provides the basic steps of a maximum likelihood method, and its process is as Figure 4 shown, including:
[0064] 1. Define the likelihood function: According to the data model (such as normal distribution, Poisson distribution, etc.), define a likelihood function L(θ|x), where θ is the unknown parameter and x is the observed data. The likelihood function measures the probability of the observed data x appearing given the parameter θ.
[0065] 2. Construct the log-likelihood function: To simplify the calculation, the log-likelihood function log L(θ|x) is usually used because the logarithm can convert multiplication into addition, which is convenient for mathematical processing. Especially when dealing with large datasets, directly calculating the product may lead to numerical underflow.
[0066] 3. Take the derivative: Take the derivative of the log-likelihood function with respect to the parameter θ to obtain the gradient or derivative function of the likelihood function, and find the parameter value θ that maximizes the likelihood function.
[0067] 4. Solve the equation where the derivative is equal to zero: Find the points where the derivative is equal to zero, that is, the critical points of the likelihood function. These points may be the maximum points of the likelihood function, so that the probability of the observed data x appearing under the parameter θ is the largest.
[0068] 5. Determine the maximum point: Conduct a second derivative test on the found critical points or use other methods (such as the graphical method) to determine whether it is the maximum point of the likelihood function. If the second derivative is less than zero at this point, it indicates that this point is the local maximum of the likelihood function and may be the maximum likelihood estimate value.
[0069] 6. Parameter estimation: Take the value of θ that maximizes the likelihood function (or maximizes the log-likelihood function) as the estimated value of the unknown parameter. Usually, it is the optimal estimate of the parameter θ given the observed data x.
[0070] 7. Evaluate the estimated value: Evaluate the performance of the maximum likelihood estimate, such as calculating the standard error of the estimated value, constructing a confidence interval, or conducting a hypothesis test, to judge the reliability and confidence level of the estimated value.
[0071] Through the above steps, the optimal estimate of the unknown parameter can be obtained, thereby improving the prediction accuracy of the model and the reliability of statistical inference.
[0072] In another alternative embodiment, statistical feature extraction may extract the following features from the original time series: mean, variance, kurtosis, skewness, wave period, significant wave height, wave crest and wave trough distribution, and change rates of local maxima and minima.
[0073] Through the description of the above embodiments, those skilled in the art can clearly understand that the method according to the above embodiments can be implemented by means of software plus a necessary general hardware platform. Of course, it can also be implemented by hardware, but in many cases, the former is a better implementation method. Based on such an understanding, the technical solution of the present application, in essence, or the part that contributes to the prior art can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disc) and includes several instructions to enable a terminal device (which can be a mobile phone, computer, server, or network device, etc.) to execute the methods of various embodiments of the present application.
[0074] In this embodiment, a device for predicting the sea wave height is also provided. This device is used to implement the above embodiments and preferred implementation manners, and those that have been described will not be repeated. As used hereinafter, the term "module" can be a combination of software and / or hardware that can achieve a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, implementation in hardware, or a combination of software and hardware is also possible and contemplated.
[0075] Figure 5 is a structural block diagram of a device for predicting the sea wave height according to an embodiment of the present application. The device includes:
[0076] An acquisition module 32, configured to acquire real-time wave height data of sea waves in a target area and environmental data of the target area, where the real-time wave height data is used to indicate the sea wave height at different times;
[0077] A first processing module 34, configured to process the real-time wave height data through a short-term prediction model to obtain a first prediction result of the sea wave height in a first time period, and determine a residual distribution corresponding to the first prediction result, where the residual distribution is used to indicate the difference value between the first prediction result and the actual observation result of the sea wave in the first time period;
[0078] A second processing module 36, configured to process the environmental data and the residual distribution through a long-term prediction model to obtain a second prediction result of the sea wave height in a second time period, where the second time period includes the first time period;
[0079] A determination module 38, configured to determine a final prediction result of the sea wave height according to the first prediction result and the second prediction result.
[0080] Through the above device, first obtain the real-time wave height data of the sea waves in the target area and the environmental data of the target area, where the real-time wave height data is used to indicate the wave heights of the sea waves at different times; then process the real-time wave height data through a short-term prediction model to obtain a first prediction result of the wave height of the sea waves in the first time period, and determine the residual distribution for indicating the difference value between the first prediction result and the actual observation result of the sea waves in the first time period; then process the environmental data and the residual distribution through a long-term prediction model to obtain a second prediction result of the wave height of the sea waves in the second time period, where the second time period includes the first time period; finally, determine the final prediction result of the wave height according to the first prediction result and the second prediction result; adopting the above solution, by combining the short-term dynamic prediction ability of the time series model (short-term prediction model) and the non-linear fitting ability of the random forest regression model (long-term prediction model), the limitation of the traditional single method is broken through, so as to improve the prediction real-time performance and prediction accuracy of the wave height; furthermore, the problems of complex calculation, poor real-time performance and limited accuracy in the related technology, which rely on physical models and single sensors, are solved.
[0081] In an exemplary embodiment, the above first processing module 34 is further configured to fit a short-term prediction model to the historical wave height data by the maximum likelihood method to obtain multiple groups of model parameters, where each group of model parameters includes: the autoregressive term order p, the differencing term order d, and the moving average term order q; perform parameter evaluation on the multiple groups of model parameters, and determine the target group of model parameters from the multiple groups of model parameters according to the parameter evaluation result; and determine the target group of model parameters as the model parameters of the short-term prediction model.
[0082] It should be noted that the maximum likelihood method (Maximum Likelihood Estimation, MLE) is a basic statistical method used to estimate model parameters. Its core lies in finding a set of parameter values based on the observed data set, so that the probability (i.e., likelihood) of these data appearing under this model reaches the maximum. Simply put, the maximum likelihood method assumes that the data follows a certain probability distribution, and estimates the unknown parameters by calculating and optimizing the likelihood function (i.e., the function of the data appearance probability), ensuring that the selected parameters can best explain the observed data. This method is intuitive and effective in mathematics and is widely used in the parameter estimation of various statistical models, including time series analysis, regression models, and mixture models, etc. It is a bridge connecting the theoretical model and the actual observed data.
[0083] In the example of this application, first, the maximum likelihood method is used to fit a short-term prediction model (i.e., the ARIMA model) to the historical wave height data. The best parameters of the model are learned and determined from the historical data, that is, the optimal combination of the autoregressive (AR) term order p, the differencing (I) term order d, and the moving average (MA) term order q. After fitting multiple sets of model parameters, these parameters need to be evaluated. Usually, this step is carried out through information criteria (such as AIC or BIC) to measure the trade-off between the complexity of the model and the degree of data fitting, and to select the most appropriate model parameters. AIC (Akaike Information Criterion) and BIC (Bayesian Information Criterion) are two commonly used model selection criteria, which can help us avoid overfitting of the model (that is, the phenomenon that the model performs well on the training data but poorly on the new data). Through parameter evaluation, we can screen out the best parameter combination from multiple sets of model parameters to construct an optimal short-term prediction model. After parameter evaluation, the target set of model parameters is determined as the final parameter setting of the short-term prediction model. This process ensures that the model has the best prediction performance when processing real-time wave height data. The short-term prediction model (ARIMA) can capture the short-term trends, seasonal variations, and random fluctuations in the time series of wave heights, and make accurate predictions for the changes in wave heights in the near future, which is the first line of defense against wave dynamics.
[0084] In an exemplary embodiment, the above-mentioned first processing module 34 is further configured to decompose the time series of the historical wave height data to extract the characteristic components of the historical wave height data, where the characteristic components include: a trend component, a periodic component, and a random component; extract features from the historical wave height data according to the characteristic components to obtain feature data, where the feature data includes: wave period, wave height; perform short-term prediction model fitting according to the feature data by the maximum likelihood method.
[0085] Time series decomposition: The process of decomposing complex time series data into three components: trend, periodicity, and random fluctuations. This method can help us distinguish the long-term trends, seasonal fluctuations, and short-term random noises in the data, so as to understand the structure of the data more accurately. In wave height monitoring, the trend component reflects the long-term change pattern of waves, the periodic component captures the seasonal and periodic laws of sea conditions, and the random component reveals unpredictable random fluctuations.
[0086] Feature component extraction: Through time series decomposition, the historical wave height data can be analyzed in more detail to extract key feature components. Among them, the trend component is usually determined by the moving average method or exponential smoothing technique; the periodic component can be identified through spectral analysis, such as the fast Fourier transform (FFT); the random component is evaluated through residual analysis. The extraction of these components not only helps to understand the internal structure of the wave data but also provides an important basis for model selection and parameter optimization.
[0087] Feature dataset: It contains information crucial for model training, such as the period, wave height, frequency of the waves, etc. These feature data not only reflect the dynamic characteristics of the waves but also help the model better capture the correlation with environmental variables (such as wind speed, air pressure, etc.), thus providing more comprehensive and detailed data support during model fitting.
[0088] In the example of this application, first, through time series decomposition technology, the historical wave height data is refined into three key components: trend, periodicity, and random fluctuations, clearly revealing the long-term trend, seasonal changes, and non-predictable noise of the data. Subsequently, feature extraction is performed on the decomposed data, focusing on the wave period, wave height, and the correlation with environmental factors, to construct a feature dataset containing the dynamic characteristics of the waves, providing high-quality input for model training. Finally, the maximum likelihood method is used to fit the model parameters of the feature data. By calculating and optimizing the parameters, it is ensured that the model can explain the observed data to the greatest extent, thus providing an accurate theoretical framework for subsequent short-term wave prediction.
[0089] In an exemplary embodiment, the above-mentioned first processing module 34 is further configured to detect outliers in the real-time wave height data through an outlier detection algorithm, and remove the detected outliers to obtain the real-time wave height data after cleaning, and, fill in data points for the real-time wave height data after cleaning through linear interpolation to obtain the processed real-time wave height data; process the processed real-time wave height data through the short-term prediction model.
[0090] Outlier detection algorithm: Outliers, or anomalies, may be caused by measurement errors, equipment failures, or extreme weather events, and they can significantly affect the training and prediction performance of the model. By using an outlier detection algorithm, such as the method based on IQR (interquartile range), these outliers can be identified and removed to avoid bias in subsequent analysis. This not only improves the data quality but also ensures the authenticity of the basic data for model training, contributing to the construction of a more reliable and accurate prediction model.
[0091] Linear Interpolation Method: Linear interpolation is a commonly used data filling technique. It estimates the missing values by linearly interpolating between the two known data points before and after the missing data point in the time series. This method is simple and intuitive, and can effectively handle short-term data missing caused by transmission interruptions, equipment maintenance, or other reasons, ensuring the continuity and integrity of the time series, and providing a continuous data stream for subsequent short-term prediction models.
[0092] In the example of this application, first, an outlier detection algorithm is used to carefully screen and remove the outliers in the real-time wave height data to ensure the accuracy and representativeness of the data, and to avoid interference of abnormal measurements or equipment failures on the prediction results. Subsequently, for the possible missing points in the data, the linear interpolation method is used to fill them, restoring the continuity of the time series, making the data complete, and adapting it to subsequent analysis and modeling. Finally, using the processed real and continuous real-time wave height data, analysis is carried out through a short-term prediction model (such as ARIMA) to capture the immediate change trend of the wave height and achieve accurate short-term prediction.
[0093] In an exemplary embodiment, the above-mentioned determination module 38 is further configured to determine a third prediction result corresponding to the first time period and a fourth prediction result corresponding to the third time period in the second prediction result, where the second time period includes the first time period and the third time period; perform weighted processing on the first prediction result and the third prediction result to obtain a first final prediction result corresponding to the first time period, and determine the fourth prediction result as a second final prediction result corresponding to the third time period; determine the final prediction result according to the first final prediction result and the second final prediction result.
[0094] Precisely extract the prediction data corresponding to the same time period as the short-term prediction model and the prediction information for a subsequent longer time period from the results of the long-term prediction model to ensure the temporal correspondence and continuity of the prediction results. Subsequently, perform weighted fusion on the short-term prediction (the first prediction result) and the long-term prediction (the third prediction result) for the same time period to generate a more stable and accurate first final prediction result. At the same time, directly determine the predicted value of the future time period of the long-term prediction (the fourth prediction result) as the corresponding second final prediction result, which reflects the unique value of the long-term prediction in capturing long-term trends. Finally, integrate the final prediction results of these two time windows to form a complete wave height prediction covering the short term to the long term.
[0095] In an exemplary embodiment, the above-mentioned determination module 38 is further configured to determine that there is an extreme wave event at the target moment when it is determined that the predicted wave height value at the target moment in the final prediction result is greater than a preset threshold, where the final prediction result includes predicted wave height values at multiple moments; and issue an alarm according to the danger level of the extreme wave event.
[0096] Optionally, the above-mentioned preset threshold is usually set based on historical data, sea condition statistical analysis, and safety standards. It defines the boundary between normal wave height and potential dangerous events. In the fields of marine scientific research and offshore operations, the setting of the preset threshold is a key link, which needs to consider various factors, including the average wave height of the sea area, seasonal changes, records of past extreme events, and differences in safety requirements for different activities. When the predicted value crosses this threshold, the system immediately determines that there is an extreme wave event at the target moment, which is the trigger point of the system's safety warning mechanism.
[0097] In the example of this application, first, through the analysis of the final prediction result, the system can identify whether the predicted wave height value exceeds the preset safety threshold at a specific target moment, so as to determine whether there is a potential extreme wave event. Subsequently, after confirming the extreme wave event, the system issues an intelligent alarm according to the danger level of the event, that is, the amplitude of the wave height exceeding the threshold and the possible duration, and quickly transmits the warning information to relevant operators or management departments. Ensure seamless connection from prediction to warning, and be able to initiate response measures in a timely manner when extreme sea conditions are predicted, reducing potential threats to offshore operations and personnel safety.
[0098] It should be noted that the devices used for multi-source data acquisition include but are not limited to wave height sensors (using ultrasonic or laser ranging devices of the buoy system to collect real-time wave height data as the core input variable of the time series) and environmental variable sensors (obtaining relevant environmental variables such as wind speed, wind direction, air pressure, and sea temperature through a weather station to assist in describing external factors affecting wave changes) to collect data in real time. The data transmission and storage part can use wireless transmission or satellite communication to transmit the data to the central server, and build a distributed database at the server end to store historical time series data for subsequent modeling and analysis.
[0099] The embodiment of the present application also provides a computer-readable storage medium, in which a computer program is stored, and the computer program is configured to execute the steps in any one of the above method embodiments when running.
[0100] Optionally, in this embodiment, the above storage medium can be set to store a computer program for executing the following steps:
[0101] S1. Obtain the real-time wave height data of the sea waves in the target area and the environmental data of the target area, where the real-time wave height data is used to indicate the sea wave heights at different times;
[0102] S2. Process the real-time wave height data through a short-term prediction model to obtain a first prediction result of the sea wave height within a first time period, and determine the residual distribution corresponding to the first prediction result, where the residual distribution is used to indicate the difference value between the first prediction result and the actual observation result of the sea waves within the first time period;
[0103] S3. Process the environmental data and the residual distribution through a long-term prediction model to obtain a second prediction result of the sea wave height within a second time period, where the second time period includes the first time period;
[0104] S4. Determine the final prediction result of the sea wave height according to the first prediction result and the second prediction result.
[0105] In an exemplary embodiment, the above computer-readable storage medium may include, but is not limited to: USB flash drive, read-only memory (ROM for short), random access memory (RAM for short), mobile hard disk, magnetic disk or optical disc, etc., various media that can store computer programs.
[0106] The specific examples in this embodiment may refer to the examples described in the above embodiments and exemplary embodiments, and will not be repeated here.
[0107] The embodiment of the present application also provides an electronic device, including a memory and a processor. A computer program is stored in the memory, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.
[0108] Optionally, in this embodiment, the above processor may be configured to execute the following steps through the computer program:
[0109] S1. Obtain the real-time wave height data of the sea waves in the target area and the environmental data of the target area, where the real-time wave height data is used to indicate the sea wave heights at different times;
[0110] S2. Process the real-time wave height data through a short-term prediction model to obtain a first prediction result of the sea wave height within a first time period, and determine the residual distribution corresponding to the first prediction result, where the residual distribution is used to indicate the difference value between the first prediction result and the actual observation result of the sea waves within the first time period;
[0111] S3. Process the environmental data and the residual distribution through a long-term prediction model to obtain a second prediction result of the wave height of the sea wave within a second time period, where the second time period includes the first time period;
[0112] S4. Determine a final prediction result of the wave height according to the first prediction result and the second prediction result.
[0113] In an exemplary embodiment, the above electronic device may further include a transmission device and an input / output device, where the transmission device is connected to the above processor, and the input / output device is connected to the above processor.
[0114] An embodiment of the present application also provides a computer program product, including a non-volatile computer-readable storage medium. The non-volatile computer-readable storage medium stores a computer program product, and when the computer program is executed by a processor, the steps of the methods in various embodiments of the present application are implemented.
[0115] Optionally, in this embodiment, the above computer program may be set to implement the following steps when executed by a processor:
[0116] S1. Obtain real-time wave height data of the sea wave in a target area and environmental data of the target area, where the real-time wave height data is used to indicate the wave height of the sea wave at different times;
[0117] S2. Process the real-time wave height data through a short-term prediction model to obtain a first prediction result of the wave height of the sea wave within a first time period, and determine a residual distribution corresponding to the first prediction result, where the residual distribution is used to indicate a difference value between the first prediction result and an actual observation result of the sea wave within the first time period;
[0118] S3. Process the environmental data and the residual distribution through a long-term prediction model to obtain a second prediction result of the wave height of the sea wave within a second time period, where the second time period includes the first time period;
[0119] S4. Determine a final prediction result of the wave height according to the first prediction result and the second prediction result.
[0120] Specific examples in this embodiment may refer to the examples described in the above embodiments and exemplary embodiments, and will not be repeated here.
[0121] Obviously, those skilled in the art should understand that the above-mentioned modules or steps of the present application can be implemented by a general-purpose computing device. They can be centralized on a single computing device or distributed on a network composed of multiple computing devices. They can be implemented by program codes executable by the computing device. Thus, they can be stored in a storage device and executed by the computing device. And in some cases, the steps shown or described can be executed in a different order from here, or they can be separately fabricated into individual integrated circuit modules, or multiple modules or steps among them can be fabricated into a single integrated circuit module to implement. In this way, the present application is not limited to any specific combination of hardware and software.
[0122] The above are only the preferred embodiments of the present application. It should be noted that for those of ordinary skill in the art, without departing from the principle of the present application, several improvements and refinements can still be made, and these improvements and refinements should also be regarded as the protection scope of the present application.
Claims
1. A method for predicting the wave height, characterized in that, Including: Obtaining real-time wave height data of sea waves in a target area and environmental data of the target area, where the real-time wave height data is used to indicate the sea wave heights at different times; Processing the real-time wave height data through a short-term prediction model to obtain a first prediction result of the sea wave height within a first time period, and determining a residual distribution corresponding to the first prediction result, where the residual distribution is used to indicate the difference value between the first prediction result and the actual observation result of the sea wave within the first time period; Processing the environmental data and the residual distribution through a long-term prediction model to obtain a second prediction result of the sea wave height within a second time period, where the second time period includes the first time period; Determining a final prediction result of the sea wave height according to the first prediction result and the second prediction result.
2. The method according to claim 1, characterized in that Before processing the real-time wave height data through the short-term prediction model, the method further includes: Fitting a short-term prediction model to historical wave height data through the maximum likelihood method to obtain multiple sets of model parameters, where each set of model parameters includes: the autoregressive term order p, the differencing term order d, and the moving average term order q; Evaluating the multiple sets of model parameters, and determining a target set of model parameters from the multiple sets of model parameters according to the parameter evaluation result; Determining the target set of model parameters as the model parameters of the short-term prediction model.
3. The method according to claim 2, wherein Before fitting a short-term prediction model to historical wave height data through the maximum likelihood method, the method further includes: Decomposing the time series of the historical wave height data to extract characteristic components of the historical wave height data, where the characteristic components include: a trend component, a periodic component, and a random component; Performing feature extraction on the historical wave height data according to the characteristic components to obtain feature data, where the feature data includes: a wave period and a wave height; Fitting a short-term prediction model according to the feature data through the maximum likelihood method.
4. The method according to claim 1, characterized in that Before processing the real-time wave height data through the short-term prediction model, the method further includes: Detecting outliers in the real-time wave height data through an outlier detection algorithm, clearing the detected outliers to obtain cleared real-time wave height data, and filling data points of the cleared real-time wave height data through linear interpolation to obtain processed real-time wave height data; Processing the processed real-time wave height data through the short-term prediction model.
5. The method according to claim 1, wherein Determining the final prediction result of the sea wave height according to the first prediction result and the second prediction result includes: Determining a third prediction result corresponding to the first time period and a fourth prediction result corresponding to a third time period in the second prediction result, where the second time period includes the first time period and the third time period; Performing weighted processing on the first prediction result and the third prediction result to obtain a first final prediction result corresponding to the first time period, and determining the fourth prediction result as a second final prediction result corresponding to the third time period; Determine the final prediction result according to the first final prediction result and the second final prediction result.
6. The method according to claim 5, characterized in that, After determining the final prediction result of the sea wave height according to the first prediction result and the second prediction result, the method further includes: When it is determined that the predicted value of the sea wave height at the target moment in the final prediction result is greater than a preset threshold, determine that there is an extreme wave event at the target moment, where the final prediction result includes the predicted values of the sea wave height at multiple moments; Give an alarm according to the danger level of the extreme wave event.
7. A prediction device for wave height, characterized in that It includes: An acquisition module, configured to acquire real-time wave height data of sea waves in the target area and environmental data of the target area, where the real-time wave height data is used to indicate the sea wave height at different moments; A first processing module, configured to process the real-time wave height data through a short-term prediction model to obtain a first prediction result of the sea wave height in a first time period, and determine the residual distribution corresponding to the first prediction result, where the residual distribution is used to indicate the difference value between the first prediction result and the actual observation result of the sea wave in the first time period; A second processing module, configured to process the environmental data and the residual distribution through a long-term prediction model to obtain a second prediction result of the sea wave height in a second time period, where the second time period includes the first time period; A determination module, configured to determine the final prediction result of the sea wave height according to the first prediction result and the second prediction result.
8. A computer-readable storage medium, characterized in that, The computer-readable storage medium includes a stored program, where the program, when running, executes the method according to any one of claims 1 to 6.
9. An electronic device, comprising a memory and a processor, characterized in that, A computer program is stored in the memory, and the processor is configured to execute the method according to any one of claims 1 to 6 through the computer program.
10. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by the processor, the steps of the method according to any one of claims 1 to 6 are implemented.