A real-time prediction method and system for ship maneuvering motion based on fusion technology

By using the Transformer model and physical information fusion method in ship manipulation motion prediction, combined with sliding time window technology and online gradient update, the problem of insufficient real-time and accuracy of ship manipulation motion models in the existing technology in complex environments is solved, and high-precision, real-time and physical consistency prediction effect is achieved.

CN119416665BActive Publication Date: 2025-04-18QINGDAO INNOVATION & DEV CENT OF HARBIN ENG UNIV +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510018370.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-01-07
Publication Date
2025-04-18
Estimated Expiration
2045-01-07

AI Technical Summary

Technical Problem

The existing ship handling motion models lack real-time and accuracy in complex environments, making it difficult to meet the needs of modern marine transportation for high precision, real-time and adaptability.

Method used

Using a method based on the fusion of Transformer model and physical information, time sequence features are extracted through the self-attention mechanism, combined with sliding time window technology and online gradient update, high-precision real-time forecast of ship manipulation movement is achieved, and the physical consistency of the model is ensured by the introduction of physical loss terms.

Benefits of technology

It significantly improves the accuracy and real-time response capabilities of ship maneuvering motion prediction, especially in complex sea conditions and extreme operating conditions, which can provide stable and efficient maneuvering motion prediction, enhancing the physical consistency and generalization capabilities of the model.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119416665B_ABST
    Figure CN119416665B_ABST
Patent Text Reader

Abstract

The present invention belongs to the technical field of ship maneuvering motion prediction, and discloses a real-time prediction method and system for ship maneuvering motion based on fusion technology. The method performs standardized processing on ship motion data and marine environment data, so that the marine environment data and the ship motion data are input into the constructed ship motion prediction model based on the Transformer architecture within the same numerical range, and uses the sliding time window technology to perform online gradient updates to adapt to new data features; introduces physical loss terms to obtain an improved ship motion prediction model based on the Transformer architecture; performs optimization verification to complete the prediction of nonlinear ship maneuvering motion. The present invention can not only solve the shortcomings of traditional models in nonlinear processing, but also improve the reliability of data-driven models through physical constraints, and provide strong technical support for the manipulation control and safe navigation of future intelligent ships.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of ship maneuvering motion prediction, and in particular relates to a real-time prediction method and system for ship maneuvering motion based on fusion technology. Background Art

[0002] In modern marine transportation and marine operations, with the development of global marine resources and the growth of marine traffic, ships frequently sail in complex and changeable sea conditions. Especially in severe sea conditions and extreme operating conditions (such as large rudder angle steering and collision avoidance), precise maneuvering has become one of the key issues affecting navigation safety and efficiency. The maneuvering movement of ships becomes extremely complex under these conditions, involving not only a variety of dynamic factors, but also the influence of environmental disturbances such as wind, waves, and currents. Accurately predicting the ship's maneuvering response under these conditions is the basis for improving ship maneuverability and navigation safety.

[0003] 1) Limitations of traditional physical modeling.

[0004] The traditional modeling methods of ship maneuvering motion are mainly based on classical fluid mechanics theory. Common models include the MMG (Maneuvering Modeling Group) model and the KT response model. These models describe the motion state of the ship through control equations and make corrections based on external environmental factors. However, traditional physical models often show defects of insufficient accuracy and poor adaptability when faced with severe sea conditions and extreme rudder angle conditions. Traditional models have high computational complexity and poor real-time performance, making it difficult to adapt to the high-frequency requirements of modern ship maneuvering motion forecasts, especially when real-time decision-making is required, and they cannot respond quickly to sudden environmental changes.

[0005] In addition, traditional physical models usually require a large amount of experimental data and model calibration, which leads to significant limitations in the generalization ability of these models under changing environmental conditions. They have difficulty capturing complex, nonlinear and dynamic characteristics, especially under extreme conditions, and the models often cannot accurately reflect the actual maneuvering behavior of ships. These limitations make it difficult for traditional models to meet the needs of modern marine transportation for high accuracy, real-time and adaptability.

[0006] 2) The rise and shortcomings of data-driven models.

[0007] With the rapid development of artificial intelligence and machine learning technologies, data-driven prediction models have gradually been applied in the study of ship maneuvering motion. Deep learning models, especially recurrent neural networks (RNN) and long short-term memory networks (LSTM), have been applied to the prediction of ship motion trajectories due to their ability to process time series data. However, although these models have better prediction performance than traditional physical models in complex dynamic environments, they are overly dependent on training data, prone to overfitting problems when data is insufficient or of poor quality, and lack generalization ability, especially showing instability in the face of extreme sea conditions.

[0008] In addition, although data-driven models have made breakthroughs in accuracy and adaptability, they lack physical constraints and are prone to give prediction results that do not conform to actual physical laws in maneuvering motion prediction. This lack of control over physical consistency limits the widespread application of data-driven models in actual ship maneuvering motion prediction. How to ensure the physical rationality of the model while efficiently processing data has become an urgent problem to be solved.

[0009] 3) Introduction and advantages of the Transformer model.

[0010] In recent years, the Transformer model has shown strong modeling capabilities in the fields of natural language processing and time series data processing, and has gradually been applied to complex system modeling, including ship motion prediction. Unlike traditional RNN and LSTM models, the Transformer model implements global dependency modeling of input data through the Self-Attention Mechanism, can process sequence data in parallel, and greatly improves the modeling capabilities of long sequence data.

[0011] In the prediction of ship maneuvering motion, the attention mechanism of Transformer can effectively extract the multi-dimensional features of the input (such as ship speed, rudder angle, environmental data, etc.), and assign different weights according to the impact of different features on the maneuvering motion, thereby improving the model's attention to key features. Its parallel computing advantage makes Transformer more efficient in processing real-time data, and is particularly suitable for rapid prediction of ship motion in complex dynamic environments. However, the Transformer model that relies solely on data-driven still cannot completely solve the physical consistency problem in ship maneuvering motion, so it is necessary to further integrate physical information to improve the prediction performance of the model.

[0012] 4) The necessity of physical information fusion.

[0013] In order to make up for the lack of physical consistency of data-driven models, combining physical information with data-driven models has become the focus of current research. By introducing physical equations as constraints in deep learning models, such as the KT response model of ships, the adaptability of the model to the actual physical environment can be effectively enhanced, ensuring that its prediction results conform to the basic physical laws of ship maneuvering motion. This method is called physical information neural networks (PINNs), which combines the rigor of physical models with the powerful nonlinear fitting capabilities of deep learning.

[0014] Through the above analysis, the problems and defects of the existing technology are as follows: the existing technology lacks real-time and accuracy for the existing ship maneuvering motion model in complex environments, and the effect of providing strong technical support for the maneuvering control and safe navigation of future intelligent ships is poor. Summary of the invention

[0015] In order to overcome the problems existing in the related art, the disclosed embodiments of the present invention provide a method and system for real-time prediction of ship maneuvering motion based on fusion technology, and more particularly, relate to a method for real-time prediction of ship maneuvering motion based on the fusion of Transformer model and physical information. Special attention is paid to the motion prediction of ships under complex sea conditions and large rudder angle steering conditions. Specifically, the present invention belongs to the cross-technical field of combining deep learning, time series modeling and ship maneuvering hydrodynamics, and aims to improve the prediction accuracy and real-time response capability of ship maneuvering motion, so as to assist in the control optimization and navigation safety of intelligent ships.

[0016] The technical solution is as follows: A real-time prediction method for ship maneuvering motion based on fusion technology includes:

[0017] S1. Standardize the ship motion data and the ocean environment data so that the ocean environment data and the ship motion data are in the same numerical range, and input them into the constructed ship motion prediction model based on the Transformer architecture;

[0018] S2. Non-parametric ship maneuvering motion based on Transformer. A ship motion prediction model based on Transformer architecture is constructed. The model is used to input the input layer of ship motion state, rudder angle, and propeller speed parameters, and the temporal feature extraction layer based on the self-attention mechanism outputs the acceleration of the ship.

[0019] S3, using sliding time window technology, continuously input the latest collected ship motion and environmental data into the ship motion prediction model based on the Transformer architecture, and use real-time data to perform online gradient updates to adapt to new data features;

[0020] S4. On the basis of the ship motion prediction model based on the Transformer architecture that adapts to the new data characteristics, the physical information is integrated and the physical loss term is introduced to obtain the improved ship motion prediction model based on the Transformer architecture, which satisfies the physical consistency of the ship motion while being data-driven;

[0021] S5. Use historical data to train the improved ship motion prediction model based on the Transformer architecture, and perform optimization verification to complete the prediction of nonlinear ship maneuvering motion.

[0022] In step S1, the ship motion data and the ocean environment data are standardized so that the ocean environment data and the ship motion data are within the same numerical range, including:

[0023] Clean the collected ship motion parameters including speed, acceleration, and rudder angle, and environmental parameters including wind speed, wave height, and wave period, delete outliers, and interpolate missing data;

[0024] The processed data are standardized, and the Min-Max normalization method is used for the ship motion parameters, which are scaled to the interval [0,1] to eliminate the dimensional differences between the parameters;

[0025] For marine environmental parameters, the Z-score standardization method was used to convert them into a standard distribution with a mean of 0 and a variance of 1.

[0026] In step S2, a ship motion prediction model based on the Transformer architecture is constructed, including: the input data includes the ship's motion state variables , manipulation parameters And environmental parameters ;

[0027] The motion state variable Includes: Speed , acceleration , heading angle ;

[0028] The manipulation parameters Includes: rudder angle , propeller speed ;

[0029] The environmental parameters Including: wind speed, wave height , Wave cycle ;

[0030] The above input data is input into the Transformer model in the form of time steps.

[0031] In step S2, the temporal feature extraction layer adopts a multi-head attention mechanism to learn temporal features in multiple feature subspaces, identify and extract key features that have a great impact on ship acceleration;

[0032] The ship motion prediction model based on the Transformer architecture includes a position encoding module, which learns the temporal dependency of ship motion when processing disordered input data by embedding temporal position information in the input data;

[0033] The ship motion prediction model based on the Transformer architecture is configured with a weight adaptive adjustment module, which dynamically adjusts the weights of the ship motion state, rudder angle, and propeller speed parameters based on the self-attention mechanism, and automatically focuses on the key parameters that have a great impact on acceleration prediction;

[0034] The ship motion prediction model structure based on the Transformer architecture includes residual connection and layer normalization modules to avoid gradient disappearance.

[0035] In step S3, the sliding time window technology is used to continuously input the latest collected ship motion and environmental data into the ship motion prediction model based on the Transformer architecture, including: setting the size of the sliding window to , indicating the use of the most recent The manipulated motion state data of time steps As input, predict the next moment Movement status The window is updated through real-time sliding, new data points are added, and the earliest data are discarded, forming a dynamically updated data stream.

[0036] In step S3, the online gradient update is performed using real-time data to adapt to the new data features, including:

[0037] S301, data window definition: at time step ,use The manipulation motion state data of time steps is defined as the sliding window:

[0038] ;

[0039] These input features include the ship's speed, acceleration, heading angle, rudder angle, and environmental characteristics, forming a time series feature matrix ;

[0040] S302, predicting the motion state at the next moment: using the input data in the window to predict the ship's maneuvering motion, and obtaining the predicted value of the motion state at the next moment through the Transformer time series model ,in Indicates that the ship is The speed and attitude angle at each moment control the motion state;

[0041] ;

[0042] In the formula, The prediction function of the ship motion prediction model based on the Transformer architecture after encoding the ship motion data in the current time window; Indicates the ship's motion status at the past moment;

[0043] S303, Data Correction and Model Update: At time step , the actual control motion state After being collected, it will be compared with the predicted value Compare and calculate the error using the loss function , the expression is:

[0044] ;

[0045] The error is used to adjust the model's parameter $\theta$ through an online learning algorithm, and the weight update formula is:

[0046] ;

[0047] In the formula, is the learning rate, is the gradient of the loss function, For The updated ship motion prediction model parameters based on the Transformer architecture at time instant, For The updated ship motion prediction model parameters based on the Transformer architecture at each moment;

[0048] S304, sliding window update: for time step The sliding window moves forward one position and discards the earliest time step data. , add a new time step , forming a new data window , for the next moment prediction and correction.

[0049] In step S4, an improved ship motion prediction model based on the Transformer architecture is obtained, including:

[0050] S401, introduction of physical constraints: using the KT response equation based on the ship's speed, acceleration, and rudder angle parameters to describe the dynamic characteristics of the ship's maneuvering motion;

[0051] S402, total loss function construction: the integration of physical information and data-driven model is realized by constructing the total loss function;

[0052] S403, dynamic adjustment and optimization.

[0053] In step S401, the expression of the KT response equation is:

[0054] ;

[0055] In the formula, is the mass matrix of the ship, is the rate of change of the ship's speed, is the damping coefficient matrix, is the ship's velocity vector, Manipulative force caused by external control force;

[0056] In step S402, the total loss function The expression is:

[0057] ;

[0058] In the formula, is the error loss term between the ship motion prediction model based on the Transformer architecture and the actual data, expressed by the least squares error; is the weight coefficient of the physical constraint term, which is used to control the proportion of physical constraint loss in the total loss; is the constraint loss term based on the physical equation, which is used to describe the error between the model prediction result and the solution of the KT response equation;

[0059] In step S403, dynamic adjustment and optimization include: during the training process, the ship motion prediction model based on the Transformer architecture is trained by minimizing the total loss function , dynamically adjust network weights while obeying physical constraints.

[0060] Another object of the present invention is to provide a real-time prediction system for ship maneuvering motion based on fusion technology, the system implements the real-time prediction method for ship maneuvering motion based on fusion technology, and the system comprises:

[0061] The data standardization processing module is used to standardize the ship motion data and the ocean environment data so that the ocean environment data and the ship motion data are within the same numerical range and input into the constructed ship motion prediction model based on the Transformer architecture;

[0062] The ship motion prediction model building module based on the Transformer architecture is used for the non-parametric ship maneuvering motion based on the Transformer. The ship motion prediction model based on the Transformer architecture is built. The model is used to input the input layer of the ship motion state, rudder angle, and propeller speed parameters, and the temporal feature extraction layer based on the self-attention mechanism to output the acceleration of the ship;

[0063] The online gradient update module is used to continuously input the latest collected ship motion and environmental data into the ship motion prediction model based on the Transformer architecture using the sliding time window technology, and use the real-time data to perform online gradient updates to adapt to the new data characteristics;

[0064] The module for obtaining the improved ship motion prediction model based on the Transformer architecture is used to integrate physical information on the basis of the ship motion prediction model based on the Transformer architecture that adapts to the new data characteristics. By introducing physical loss terms, the improved ship motion prediction model based on the Transformer architecture is obtained, which satisfies the physical consistency of the ship motion while being data-driven;

[0065] The verification and optimization module is used to train the improved ship motion prediction model based on the Transformer architecture with historical data, and to perform optimization verification to complete the prediction of nonlinear ship maneuvering motion.

[0066] Furthermore, the real-time prediction system for ship maneuvering movements based on fusion technology is carried on a computer-readable storage medium, and the computer-readable storage medium stores a computer program. When the computer program is executed by a processor, it can realize the functions of the real-time prediction system for ship maneuvering movements based on fusion technology.

[0067] Combining all the above-mentioned technical solutions, the beneficial effects of the present invention are as follows: the present invention develops a non-parametric modeling method by integrating the time series model and physical information, and improves the real-time response and iterative update capabilities of the model through online learning and sliding time window technology, thereby achieving high-precision prediction of ship maneuvering motions.

[0068] In the PINNs framework, the present invention can ensure that the model considers both data-driven learning and physical constraints during training by defining physical loss terms. The fusion of physical information can help the model overcome the difficulty of data scarcity, while reducing the demand for training data and improving the prediction accuracy and generalization ability of the model under complex working conditions. The combination of physical information and the Transformer model can provide high-precision and physically consistent ship maneuvering motion forecasts under complex sea conditions.

[0069] In view of the limitations of the existing ship maneuvering motion model in real-time and precision in complex environments, the feature extraction capability of the Transformer model and the physical constraints of the physical information model can effectively improve the accuracy and physical consistency of the real-time prediction of ship maneuvering motion. This innovative method can not only solve the shortcomings of traditional models in nonlinear processing, but also improve the reliability of data-driven models through physical constraints, providing strong technical support for the maneuvering control and safe navigation of future intelligent ships.

[0070] The present invention provides a significant technological breakthrough in the prediction of ship maneuvering motions by integrating time series modeling with physical information. By adopting an innovative method that combines the Transformer architecture with physical constraints, the prediction accuracy and real-time response capability of ship maneuvering motions can be significantly improved, especially in applications under complex sea conditions and extreme working conditions. The transformed technology can be widely used in the fields of intelligent ships, automated navigation systems, and ship maneuvering optimization, providing accurate ship maneuvering forecasts for shipping companies and marine operations, reducing human intervention, and improving navigation safety and efficiency. After commercialization, this technology can not only improve the maneuverability of ships and reduce the risk of accidents, but also promote the intelligent development of ship design optimization and port management systems, and has great market prospects and economic value.

[0071] At present, although there are some ship maneuvering motion prediction methods at home and abroad, most of them rely on traditional physical modeling or data-driven models, which cannot effectively predict ship motion under extreme sea conditions and complex control conditions, and generally lack physical consistency. The present invention fills this gap in the prediction of ship maneuvering motion by combining the self-attention mechanism of the Transformer model with the fusion of physical information. Especially in special situations such as large rudder angle steering and complex sea conditions, the present invention can provide higher accuracy and real-time forecasts, breaking the limitations of existing technologies on traditional modeling methods and data-driven models. This technical solution not only has important value in the academic field, but also fills key technical gaps in industrial applications and promotes the development of intelligent ship technology.

[0072] The present invention successfully solves several core problems in the prediction of ship maneuvering motion, especially the high-precision prediction problems under complex sea conditions and extreme maneuvering conditions. Traditional ship maneuvering motion models are often difficult to adapt to changes in the dynamic environment and lack effective capture of nonlinear and time-varying characteristics. By introducing Transformer-based time series modeling and physical information fusion, the present invention breaks through the bottleneck of the prior art and achieves more accurate, real-time and physically consistent ship maneuvering predictions, especially under complex working conditions, with higher reliability and accuracy than traditional methods. This innovative solution not only meets the industry's demand for ship maneuvering safety and efficiency, but also makes a key step forward in the research and development of intelligent navigation and automated ships.

[0073] The present invention overcomes the limitations of both data-driven models and physical modeling methods. Traditional technologies tend to rely heavily on physical modeling (such as the MMG model) or over-rely on data-driven methods (such as neural networks) in ship maneuvering prediction, while ignoring the effective combination of the two. By integrating the self-attention mechanism of the Transformer model with physical information, the present invention breaks the prejudice against a single modeling method, successfully combines the advantages of data-driven with the rigor of physical constraints, and provides a more accurate and comprehensive solution. This has a wide range of application value not only in the field of ship maneuvering prediction, but also in other dynamic system modeling that requires physical constraints. BRIEF DESCRIPTION OF THE DRAWINGS

[0074] The accompanying drawings herein are incorporated in and constitute a part of the specification, illustrate embodiments consistent with the present disclosure, and together with the description, serve to explain the principles of the present disclosure;

[0075] Figure 1 is a flow chart of a method for real-time prediction of ship maneuvering motion based on fusion technology provided by an embodiment of the present invention;

[0076] Figure 2 is a schematic diagram of a real-time prediction system for ship maneuvering motion based on fusion technology provided by an embodiment of the present invention;

[0077] In the figure: 1. Data standardization processing module; 2. Ship motion prediction model construction module based on Transformer architecture; 3. Online gradient update module; 4. Improved ship motion prediction model acquisition module based on Transformer architecture; 5. Verification and optimization module. DETAILED DESCRIPTION

[0078] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, the specific embodiments of the present invention are described in detail below in conjunction with the accompanying drawings. In the following description, many specific details are set forth to facilitate a full understanding of the present invention. However, the present invention can be implemented in many other ways different from those described herein, and those skilled in the art can make similar improvements without violating the connotation of the present invention, so the present invention is not limited by the specific implementation disclosed below.

[0079] The innovation of the present invention is that: by combining the data-driven capability of the Transformer architecture with the introduction of physical constraints, the present invention proposes a method that integrates sliding time window technology and dynamic online gradient updating to achieve high-precision real-time prediction of ship maneuvering movements. This method extracts time series features through a self-attention mechanism, automatically identifies key influencing factors, and combines physical loss terms to ensure the consistency of model prediction results with physical laws, overcoming the limitations of the lack of adaptability of traditional physical models and the weak generalization ability of data-driven models. The system can provide stable and efficient maneuvering motion forecasts under complex sea conditions and extreme operating conditions, providing technical support for the control and safe navigation of intelligent ships.

[0080] Embodiment 1, as Figure 1 As shown, the real-time prediction method for ship maneuvering motion based on fusion technology provided by an embodiment of the present invention includes:

[0081] S1. Standardize the ship motion data and the ocean environment data so that the ocean environment data and the ship motion data are in the same numerical range, and input them into the constructed ship motion prediction model based on the Transformer architecture;

[0082] Exemplarily, in order to ensure the quality and consistency of the model input data, the present invention performs standardized processing on the ship motion data and the marine environment data. Since the two types of data differ greatly in dimension and numerical range, if they are not processed, direct input may lead to unbalanced weight updates during the model training process, affecting the prediction accuracy of the model. Therefore, the present invention first cleans the collected ship motion parameters (such as speed, acceleration, rudder angle) and environmental parameters (such as wind speed, wave height, wave period), deletes outliers and interpolates missing data to ensure the integrity and reliability of the data. Subsequently, the processed data is standardized. For the ship motion parameters, the Min-Max normalization method is used to scale them to the [0,1] interval to eliminate the dimensional differences between the parameters; for the marine environment parameters, the Z-score normalization method is used to convert them into a standard distribution with a mean of 0 and a variance of 1, thereby ensuring that the environmental data can be input into the model within the same numerical range as the ship motion data. Through this standardization and normalization processing, the error accumulation caused by different data scales during model training is avoided, and the stability and training effect of the ship motion prediction model based on the Transformer architecture are effectively improved.

[0083] S2. Non-parametric ship maneuvering motion based on Transformer. A ship motion prediction model based on Transformer architecture is constructed. The model is used to input the input layer of ship motion state, rudder angle, and propeller speed parameters, and the temporal feature extraction layer based on the self-attention mechanism outputs the acceleration of the ship.

[0084] The temporal feature extraction layer adopts a multi-head attention mechanism, which can simultaneously learn temporal features in multiple feature subspaces, identify and extract key features that have a greater impact on ship acceleration; the ship motion prediction model based on the Transformer architecture includes a position encoding module, which embeds temporal position information in the input data to ensure that the ship motion prediction model based on the Transformer architecture can accurately learn the temporal dependency of ship motion when processing disordered input data; learning the temporal dependency of ship motion means that the ship motion prediction model based on the Transformer architecture analyzes the temporal variation of data such as ship motion state, rudder angle, propeller speed, etc., identifies the mutual influence between these parameters, and thus predicts the future motion state. By embedding time and position information, the model can understand the temporal order of the data, and use the self-attention mechanism to dynamically adjust the weight of each parameter, focusing on the key features that have a greater impact on acceleration prediction. This method enables the model to effectively capture the dynamic changes and laws of ship motion.

[0085] The ship motion prediction model based on the Transformer architecture is configured with a weight adaptive adjustment module, and the weights of parameters such as the ship motion state, rudder angle, and propeller speed are dynamically adjusted based on the self-attention mechanism. In the dynamic adjustment process of the weights of parameters such as the ship motion state, rudder angle, and propeller speed based on the self-attention mechanism, the correlation between each input feature at different time steps is first calculated through the self-attention mechanism. For each time point, the model calculates a weight value based on the relationship between the current input feature and other time points, reflecting the importance of the feature to the current prediction task (such as acceleration prediction). The self-attention mechanism automatically adjusts the influence of each parameter according to these weight values, so that the model can pay more attention to those key parameters that have a greater impact on acceleration prediction, while ignoring less relevant features. This adjustment process is gradually optimized through training to ensure that the model can accurately identify and utilize the most predictive features. The ship motion prediction model based on the Transformer architecture automatically focuses on the key parameters that have a greater impact on acceleration prediction; the process of automatically focusing on the key parameters that have a greater impact on acceleration prediction first calculates the correlation between each input parameter (such as ship motion state, rudder angle, propeller speed, etc.) and acceleration through the self-attention mechanism. The ship motion prediction model based on the Transformer architecture dynamically adjusts the weights of each parameter according to these correlations, focusing on those features that have a greater impact on acceleration changes and reducing attention to irrelevant or less influential features. As training progresses, the ship motion prediction model based on the Transformer architecture will gradually learn which parameters contribute more to acceleration prediction at different time steps, thereby automatically focusing on these key features and improving the accuracy of the prediction. The structure of the ship motion prediction model based on the Transformer architecture includes residual connections and layer normalization modules to maintain the stability of the training process, avoid gradient vanishing, and improve the accuracy and robustness of the prediction of the ship motion prediction model based on the Transformer architecture.

[0086] S3, using sliding time window technology, continuously input the latest collected ship motion and environmental data into the ship motion prediction model based on the Transformer architecture, and use real-time data to perform online gradient updates to adapt to new data features;

[0087] Through the mini-batch gradient descent algorithm, each new data input will fine-tune the model parameters to make it more sensitive to the current environment. The ship motion prediction model based on the Transformer architecture provides feedback by calculating the prediction mean square error MSE after each prediction, and uses the error to optimize the model parameters. The optimal model structure (Transformer models with different numbers of layers, different numbers of attention heads, different residual connection layer configurations, etc.) is dynamically selected through time series cross-validation to ensure that the ship motion prediction model based on the Transformer architecture can be continuously optimized and improve the accuracy of real-time forecasts.

[0088] S4. On the basis of the ship motion prediction model based on the Transformer architecture that adapts to the new data characteristics, the physical information is integrated and the physical loss term is introduced to obtain the improved ship motion prediction model based on the Transformer architecture, which satisfies the physical consistency of the ship motion while being data-driven;

[0089] Physical information fusion and loss function improvement: Based on the ship motion prediction model based on the Transformer architecture (non-parametric model of ship maneuvering motion based on Transformer), physical information is further integrated, and the physical loss term (based on the physical constraints of ship maneuvering motion) is introduced to ensure that the improved ship motion prediction model based on the Transformer architecture meets the physical consistency of ship motion while being data-driven. Among them, the physical loss term ensures the physical rationality of the improved ship motion prediction model based on the Transformer architecture by minimizing the error between the prediction results of the ship motion prediction model based on the Transformer architecture and the physical information neural network (PINNs) model.

[0090] S5. Use historical data to train the improved ship motion prediction model based on the Transformer architecture, and perform optimization verification to complete the prediction of nonlinear ship maneuvering motion;

[0091] Model training and verification: The improved ship motion prediction model based on the Transformer architecture is trained using historical data, optimized using the AdamW optimizer and the least squares error loss function, and evaluated and hyperparameters adjusted using the cross-validation method. Finally, the prediction accuracy and generalization ability of the improved ship motion prediction model based on the Transformer architecture are verified using real ship test data.

[0092] Exemplarily, in step S2, constructing a ship motion prediction model based on the Transformer architecture (a method for non-parametric modeling of ship maneuvering motion based on Transformer) is specifically as follows:

[0093] In this step, a ship motion prediction model based on the Transformer architecture (a deep learning model based on Transformer) is constructed to realize the non-parametric modeling of ship maneuvering motion. First, the input data includes the ship's motion state variables , manipulation parameters And environmental parameters ;

[0094] The motion state variable Includes: Speed , acceleration , heading angle ;

[0095] The manipulation parameters Includes: rudder angle , propeller speed ;

[0096] The environmental parameters Including: wind speed, wave height , Wave cycle ;

[0097] The above input data is input into the Transformer model in the form of time steps.

[0098] In another exemplary embodiment, the method of online learning and real-time updating of the sliding time window in step S3 is specifically as follows:

[0099] In this step, in order to better adapt to the dynamic characteristics of the ship's maneuvering motion, the present invention uses the sliding window technology to process the real-time data. Specifically, by selecting the ship's maneuvering motion state data in the previous period of time, the motion state in the future period of time is predicted, and the prediction result of the model is corrected in real time after receiving the actual data.

[0100] Set the sliding window size to , indicating the use of the most recent The manipulated motion state data of time steps As input, predict the next moment Movement status The window is updated through real-time sliding, new data points are added, and the earliest data are discarded, forming a dynamically updated data stream.

[0101] The core method of sliding window is as follows:

[0102] S301, data window definition: at time step ,use The manipulation motion state data of time steps is defined as the sliding window:

[0103] ;

[0104] These input features include the ship's speed, acceleration, heading angle, rudder angle, and environmental characteristics, forming a time series feature matrix ;

[0105] S302, predicting the motion state at the next moment: using the input data in the window to predict the ship's maneuvering motion, and obtaining the predicted value of the motion state at the next moment through the Transformer time series model ,in Indicates that the ship is The speed and attitude angle at each moment control the motion state;

[0106] ;

[0107] In the formula, The prediction function of the ship motion prediction model based on the Transformer architecture after encoding the ship motion data in the current time window; Indicates the ship's motion status at the past moment;

[0108] S303, Data Correction and Model Update: At time step , the actual control motion state After being collected, it will be compared with the predicted value Compare and calculate the error using the loss function , the expression is:

[0109] ;

[0110] The error is used to adjust the model's parameter $\theta$ through an online learning algorithm, and the weight update formula is:

[0111] ;

[0112] In the formula, is the learning rate, is the gradient of the loss function, For The updated ship motion prediction model parameters based on the Transformer architecture at time instant, For The updated ship motion prediction model parameters based on the Transformer architecture at each moment;

[0113] S304, sliding window update: for time step The sliding window moves forward one position and discards the earliest time step data. , add a new time step , forming a new data window , for the next moment This process is ongoing, ensuring that the ship motion prediction model based on the Transformer architecture is constantly adjusted and optimized based on the latest data.

[0114] Through the above sliding window technology, the improved ship motion prediction model based on Transformer architecture can make full use of the past The future is predicted based on the data of each time step, and the prediction accuracy is gradually improved in real time according to the actual data. This method not only performs well in real-time dynamic environments, but also adapts to the nonlinear changes of ship maneuvering motion, especially for complex ship motion behaviors under different maneuvering conditions.

[0115] In another exemplary embodiment, in step S4, the method of physical information fusion and loss function improvement is specifically as follows:

[0116] In this step, the present invention further optimizes the non-parametric model of ship maneuvering motion through the method of physical information fusion. The KT response equation based on ship motion is introduced, that is, a new loss function is constructed by combining the physical constraint model with the traditional data-driven model. This loss function not only takes into account the error of data fitting, but also adds the influence of physical constraints, thereby improving the prediction accuracy and physical consistency of the improved ship motion prediction model based on the Transformer architecture. Specifically including:

[0117] S401, introduction of physical constraints: using the KT response equation based on the ship's speed, acceleration, and rudder angle parameters to describe the dynamic characteristics of the ship's maneuvering motion;

[0118] The KT response equation is a classic physical model that describes the ship's maneuvering motion. It is usually used to characterize the motion response of the ship under different maneuvering conditions. The equation describes the dynamic characteristics of the ship's maneuvering motion based on the ship's speed, acceleration, rudder angle and other parameters. Its basic form can be expressed as:

[0119] ;

[0120] In the formula, is the mass matrix of the ship, is the speed change rate of the ship, is the damping coefficient matrix, is the ship's velocity vector, Manipulative force caused by external control force;

[0121] S402, total loss function construction: the integration of physical information and data-driven model is realized by constructing the total loss function;

[0122] Total loss function The expression is:

[0123] ;

[0124] In the formula, is the error loss term between the ship motion prediction model based on the Transformer architecture and the actual data, expressed by the least squares error; is the weight coefficient of the physical constraint term, which is used to control the proportion of physical constraint loss in the total loss; is the constraint loss term based on the physical equation, which is used to describe the error between the model prediction result and the solution of the KT response equation;

[0125] S403, dynamic adjustment and optimization.

[0126] Including: During the training process, the ship motion prediction model based on the Transformer architecture minimizes the above total loss function , dynamically adjust the network weights while following physical constraints. This ensures that the ship motion prediction model based on the Transformer architecture can not only fit the actual data well, but also follow physical constraints. By adding physical constraints, the improved ship motion prediction model based on the Transformer architecture can not only improve the accuracy of the prediction, but also ensure that the prediction results are consistent with the physical laws of ship maneuvering motion.

[0127] By introducing the KT response equation of ship motion, the present invention realizes the integration of physical information and data-driven models, so that the improved ship motion prediction model based on the Transformer architecture can take into account both the accuracy of data and the rationality of physical constraints when dealing with complex nonlinear ship motion. This not only improves the prediction accuracy of the improved ship motion prediction model based on the Transformer architecture, but also enhances its generalization ability, making it more reliable in practical applications.

[0128] It can be understood that the present invention provides a real-time prediction method for ship maneuvering motion based on the fusion of Transformer model and physical information, which is specifically used to achieve high-precision prediction of ship maneuvering motion in complex sea conditions and changing environments, showing high innovation and practical value. Compared with the prior art, the present invention effectively solves the difficult problems of multi-dimensional feature extraction and temporal relationship modeling in ship maneuvering motion by introducing the attention mechanism of Transformer. At the same time, by integrating the physical information model, the balance between data-driven and physical laws in the forecast results is ensured, greatly improving the physical consistency and prediction accuracy of the model.

[0129] The present invention can dynamically adjust the model weights to make it pay more attention to the features that have a greater impact on the ship's motion, and realize real-time prediction of the ship's maneuvering motion state. Compared with the traditional static model, this method has adaptive learning capabilities and can be continuously updated with the input of new data, ensuring the robustness and generalization ability of the model in complex environments. In addition, the application of sliding window technology enables the present invention to continuously optimize the prediction results of the model through the dynamic input of real-time data, thereby significantly improving the real-time and accuracy of the forecast.

[0130] Therefore, the present invention not only provides more flexible and accurate technical support for ship maneuvering motion analysis and intelligent navigation, but also provides an innovative solution for safe navigation and maneuvering optimization of ships in complex environments. It has important application prospects and broad promotion value.

[0131] Embodiment 2, as Figure 2 As shown, an embodiment of the present invention provides a real-time prediction system for ship maneuvering motion based on fusion technology, comprising:

[0132] The data standardization processing module 1 is used to standardize the ship motion data and the ocean environment data so that the ocean environment data and the ship motion data are within the same numerical range and input into the constructed ship motion prediction model based on the Transformer architecture;

[0133] Ship motion prediction model construction module 2 based on Transformer architecture, which is used for non-parametric ship maneuvering motion based on Transformer, to build a ship motion prediction model based on Transformer architecture. The model is used to input the input layer of ship motion state, rudder angle, propeller speed parameters, and the temporal feature extraction layer based on the self-attention mechanism to output the acceleration of the ship;

[0134] Online gradient update module 3 is used to continuously input the latest collected ship motion and environmental data into the ship motion prediction model based on the Transformer architecture using the sliding time window technology, and use real-time data to perform online gradient updates to adapt to new data characteristics;

[0135] The improved ship motion prediction model based on the Transformer architecture is obtained by module 4, which is used to integrate physical information on the basis of the ship motion prediction model based on the Transformer architecture adapted to the new data characteristics, and obtain the improved ship motion prediction model based on the Transformer architecture by introducing physical loss terms, so as to meet the physical consistency of the ship motion while being data-driven;

[0136] The verification and optimization module 5 is used to train the improved ship motion prediction model based on the Transformer architecture with historical data, and to perform optimization verification to complete the prediction of nonlinear ship maneuvering motion.

[0137] The present invention makes full use of actual navigation data to achieve high-precision prediction of ship maneuvering motion, especially in complex sea conditions and changing environments. Specifically, taking the "No. XX" scientific research test ship as an example, the actual navigation data covers the ship's motion state (such as speed, acceleration, heading angle), control parameters (such as rudder angle, propeller speed) and environmental disturbances (such as wind speed, wave height, wave period) under different sea conditions. As shown in Table 1, these data are preprocessed to ensure the consistency and quality of the model input.

[0138] Table 1 Measured data of scientific research test ship

[0139]

[0140] First, the actual navigation data is cleaned and outliers are removed to remove data points affected by noise. For missing data, interpolation methods are used to fill in the gaps to maintain data integrity. In order to avoid the interference of data scale differences on model training, standardization and normalization methods are used: among them, ship motion parameters are normalized to the interval [0,1] using Min-Max, and marine environmental parameters are normalized using Z-score to a standard distribution with a mean of 0 and a variance of 1. This process ensures the dimensional consistency of different data features and effectively improves the stability and prediction accuracy of the model.

[0141] Next, a Transformer-based ship maneuvering motion prediction model is constructed to realize non-parametric modeling driven by actual navigation data. The model includes an input layer for inputting the ship's motion state and control parameters, and a temporal feature extraction layer based on the self-attention mechanism to perform real-time prediction of motion states such as ship acceleration. The self-attention mechanism enables the model to extract important temporal features in the multidimensional feature subspace, and combines residual connections and layer normalization to ensure the stability of the model training process. The model captures the temporal dependency of ship motion through position encoding, and dynamically adjusts the feature weights so that the model automatically focuses on key features that have a significant impact on acceleration prediction.

[0142] During the training process, in order to improve the model's ability to respond to complex environmental changes, the sliding time window technology is used to input the latest ship motion and environmental data into the model in real time, and adapt to the new data features through online gradient updates. In this process, cross-validation is used to dynamically select the best model structure to further improve the accuracy of the prediction. In order to ensure the physical consistency of the model, the present invention introduces the physical constraints of the ship's maneuvering motion into the loss function, and uses the KT response equation as the physical loss term to ensure that the data-driven prediction results conform to the physical laws of ship motion.

[0143] In order to verify the effectiveness of the method of the present invention in practical applications, this embodiment carried out a comparative experiment based on actual navigation data to analyze the prediction performance of the method of the present invention and traditional models (MMG model, LSTM model) in complex sea conditions.

[0144] The experiment selected multiple sets of actual navigation data, covering typical scenarios such as straight sailing, turning motion, and Z-type motion. Each model was trained and tested based on the same input data (including ship motion state, rudder angle, propeller speed, wind speed, wave height, etc.), and the prediction error and real-time responsiveness of different models in each scenario were recorded. The comparative experiment used mean square error (MSE) as a measurement indicator, and calculated the average calculation time of the model at different time steps to evaluate the real-time performance of the model.

[0145] Experimental results show that the method of the present invention shows significant accuracy improvement in a variety of complex situations. In the scenario of sharp turns with large rudder angles, the MSE of the method of the present invention is about 30% lower than that of the MMG model and about 15% lower than that of the LSTM model; in strong wind and wave environments, the method enhances the ability to capture complex nonlinear features through physical constraints, so that the prediction error is further reduced compared with traditional methods. In addition, due to the introduction of the parallel processing capability of the Transformer model, the average calculation time of the method of the present invention is reduced by more than 40% compared with the MMG model, which significantly improves the real-time responsiveness.

[0146] By introducing the loss function of physical information fusion, the robustness of the method in complex environments is better than that of the purely data-driven LSTM model. It can meet the physical laws of ship maneuvering while ensuring high prediction accuracy, thereby enhancing the physical consistency of the model. The experimental results verify the advantages of the present invention in terms of high precision, real-time and adaptability, and can effectively meet the needs of actual ship control.

[0147] The above description is only a preferred specific implementation manner of the present invention, but the protection scope of the present invention is not limited thereto. Any modifications, equivalent substitutions and improvements made by any technician familiar with the technical field within the technical scope disclosed by the present invention and within the spirit and principles of the present invention should be covered by the protection scope of the present invention.

Claims

1. A real-time prediction method for ship maneuvering motion based on fusion technology, characterized in that: The method includes: S1. Standardize the ship motion data and the ocean environment data so that the ocean environment data and the ship motion data are in the same numerical range, and input them into the constructed ship motion prediction model based on the Transformer architecture; S2. Based on the ship maneuvering motion parameters of Transformer, a ship motion prediction model based on Transformer architecture is constructed. The model is used to input the input layer of ship motion state, rudder angle, and propeller speed parameters, and the temporal feature extraction layer based on the self-attention mechanism outputs the acceleration of the ship; S3, using sliding time window technology, continuously input the latest collected ship motion and environmental data into the ship motion prediction model based on the Transformer architecture, and use real-time data to perform online gradient updates to adapt to new data features; S4. On the basis of the ship motion prediction model based on the Transformer architecture that adapts to the new data characteristics, the physical information is integrated and the loss term of the physical equation is introduced to obtain the improved ship motion prediction model based on the Transformer architecture. While being data-driven, it also meets the physical consistency of the ship motion. S5. Use historical data to train the improved ship motion prediction model based on the Transformer architecture, and perform optimization verification to complete the prediction of nonlinear ship maneuvering motion; In step S2, a ship motion prediction model based on the Transformer architecture is constructed, including: the input data includes the ship's motion state variable x t , manipulation parameter u t And environmental parameters e t ; The motion state variable x t Including: velocity v, acceleration a, heading angle θ; The control parameter u t Including: rudder angle δ, propeller speed n; The environmental parameter e t Including: wind speed, wave height H w 、Wave cycle T w ; The above input data is input into the Transformer model in the form of time steps.

2. The real-time prediction method for ship maneuvering motion based on fusion technology according to claim 1 is characterized in that: In step S1, the ship motion data and the ocean environment data are standardized so that the ocean environment data and the ship motion data are within the same numerical range, including: Clean the collected ship motion parameters including speed, acceleration, and rudder angle, and environmental parameters including wind speed, wave height, and wave period, delete outliers, and interpolate missing data; The processed data are standardized, and the Min-Max normalization method is used for the ship motion parameters, which are scaled to the interval [0,1] to eliminate the dimensional differences between the parameters; For marine environmental parameters, the Z-score standardization method was used to convert them into a standard distribution with a mean of 0 and a variance of 1.

3. The real-time prediction method for ship maneuvering motion based on fusion technology according to claim 1 is characterized in that: In step S2, the temporal feature extraction layer adopts a multi-head attention mechanism to learn temporal features in multiple feature subspaces, identify and extract key features that have a great impact on ship acceleration; The ship motion prediction model based on the Transformer architecture includes a position encoding module, which learns the temporal dependency of ship motion when processing disordered input data by embedding temporal position information in the input data; The ship motion prediction model based on the Transformer architecture is configured with a weight adaptive adjustment module, which dynamically adjusts the weights of the ship motion state, rudder angle, and propeller speed parameters based on the self-attention mechanism, and automatically focuses on the key parameters that have a great impact on acceleration prediction; The ship motion prediction model structure based on the Transformer architecture includes residual connection and layer normalization modules to avoid gradient disappearance.

4. The real-time prediction method for ship maneuvering motion based on fusion technology according to claim 1 is characterized in that: In step S3, the sliding time window technology is used to continuously input the latest collected ship motion and environmental data into the ship motion prediction model based on the Transformer architecture, including: setting the size of the sliding window to N, indicating that the maneuvering motion state data x of the most recent N time steps are used in each time period t-N+1 , x t-N+2 , ..., ...x t As input, predict the motion state at the next moment t+1 The window is updated by real-time sliding, new data points are added, and the earliest data is discarded, forming a dynamically updated data stream.

5. The real-time prediction method for ship maneuvering motion based on fusion technology according to claim 4 is characterized in that: In step S3, the online gradient update is performed using real-time data to adapt to the new data features, including: S301, data window definition: At time step t, using the manipulation motion state data of N time steps, define the sliding window as: W t =[x t-N+1 ,x t-N+2 ,...,x t ] These input features include the ship's speed, acceleration, heading angle, rudder angle, and environmental characteristics, forming a time series feature matrix W t ; S302, predicting the motion state at the next moment: using the input data in the window to predict the ship's maneuvering motion, and obtaining the predicted value of the motion state at the next moment through the Transformer time series model in Indicates the speed and attitude angle maneuvering motion state of the ship at time t+1; In the formula, f(W t ) is the prediction function after the ship motion prediction model based on the Transformer architecture encodes the ship motion data in the current time window; W t Indicates the ship's motion status at the past moment; S303, data correction and model update: At time step t+1, the actual manipulation motion state y t+1 After being collected, it will be compared with the predicted value Compare and calculate the error using the loss function The expression is: The error is used to adjust the model's parameter $\theta$ through an online learning algorithm, and the weight update formula is: In the formula, η is the learning rate, is the gradient of the loss function, θ t+1 is the updated parameter of the ship motion prediction model based on the Transformer architecture at time t+1, θ t are the updated parameters of the ship motion prediction model based on the Transformer architecture at time t; S304, sliding window update: for the input of time step t+2, the sliding window moves forward one position and discards the earliest time step data x t-N+1 , add a new time step x t+1 , forming a new data window W t+1 , used for prediction and correction at the next moment t+2.

6. The real-time prediction method for ship maneuvering motion based on fusion technology according to claim 1 is characterized in that: In step S4, an improved ship motion prediction model based on the Transformer architecture is obtained, including: S401, introduction of physical constraints: using the KT response equation based on the ship's speed, acceleration, and rudder angle parameters to describe the dynamic characteristics of the ship's maneuvering motion; S402, total loss function construction: the integration of physical information and data-driven model is realized by constructing the total loss function; S403, dynamic adjustment and optimization.

7. The real-time prediction method for ship maneuvering motion based on fusion technology according to claim 6 is characterized in that: In step S401, the expression of the KT response equation is: Where M is the mass matrix of the ship, is the speed change rate of the ship, N ship is the damping coefficient matrix, v is the motion velocity vector of the ship, and T is the maneuvering force caused by the external control force; In step S402, the total loss function The expression is: In the formula, is the error loss term between the ship motion prediction model based on the Transformer architecture and the actual data, expressed by the least squares error; λ is the weight coefficient of the physical equation loss term, which is used to control the proportion of the equation loss term in the total loss; is the physical equation loss term based on the physical equation, which is used to describe the error between the model prediction result and the solution of the KT response equation; In step S403, dynamic adjustment and optimization include: during the training process, the ship motion prediction model based on the Transformer architecture is trained by minimizing the total loss function Dynamically adjust network weights while respecting physical constraints.

8. A real-time prediction system for ship maneuvering motion based on fusion technology, characterized in that: The system implements the real-time prediction method for ship maneuvering motion based on fusion technology as described in any one of claims 1 to 7, and the system comprises: A data standardization processing module (1) is used to perform standardization processing on the ship motion data and the ocean environment data so that the ocean environment data and the ship motion data are within the same numerical range and input into the constructed ship motion prediction model based on the Transformer architecture; A ship motion prediction model building module based on the Transformer architecture (2) is used for the non-parametric ship maneuvering motion based on the Transformer architecture, and a ship motion prediction model based on the Transformer architecture is built. The model is used to input the input layer of the ship motion state, rudder angle, and propeller speed parameters, and the temporal feature extraction layer based on the self-attention mechanism, and outputs the acceleration of the ship; An online gradient update module (3) is used to continuously input the latest collected ship motion and environmental data into the ship motion prediction model based on the Transformer architecture using a sliding time window technology, and perform online gradient updates using real-time data to adapt to new data features; An improved ship motion prediction model acquisition module based on the Transformer architecture (4) is used to integrate physical information on the basis of the ship motion prediction model based on the Transformer architecture adapted to the new data features, and to obtain an improved ship motion prediction model based on the Transformer architecture by introducing a physical loss term, so as to satisfy the physical consistency of the ship motion while being data-driven; The verification and optimization module (5) is used to train the improved ship motion prediction model based on the Transformer architecture using historical data, and to perform optimization verification to complete the prediction of nonlinear ship maneuvering motion.

9. The real-time prediction system for ship maneuvering motion based on fusion technology according to claim 8 is characterized in that: The real-time prediction system for ship maneuvering motion based on fusion technology is carried on a computer-readable storage medium, and the computer-readable storage medium stores a computer program. When the computer program is executed by a processor, the functions of the real-time prediction system for ship maneuvering motion based on fusion technology are realized.

Citation Information

Patent Citations

  • Marine environment and ship movement monitoring and forecasting system and monitoring and forecasting method

    CN111336996A

  • Ship track prediction method based on variable weight gating circulation unit

    CN116720608A