Ship cluster collaborative optimization method and system and storage medium

By evaluating the contribution value of the local ship optimization model and dynamically adjusting the aggregation weights, the problem of unsatisfactory model performance in federated learning is solved, achieving more accurate and efficient collaborative optimization of ship clusters.

CN122087900APending Publication Date: 2026-05-26XJ ELECTRIC CO LTD +1
View PDF 1 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
XJ ELECTRIC CO LTD
Filing Date
2025-12-22
Publication Date
2026-05-26

Smart Images

  • Figure CN122087900A_ABST
    Figure CN122087900A_ABST
Patent Text Reader

Abstract

The invention belongs to the technical field of ship collaborative optimization, and particularly relates to a ship cluster collaborative optimization method and system and a storage medium. The method comprises the following steps: acquiring model parameters of ship optimization local models deployed at each ship local; evaluating the contribution value of each ship optimization local model to the construction of a high-performance ship optimization global model deployed in a server, and obtaining an aggregation weight corresponding to each ship optimization local model during federal aggregation by using the contribution value corresponding to each ship optimization local model; and performing federal aggregation on the model parameters of each ship optimization local model by using the aggregation weight to obtain global model parameters, and updating the model parameters of each ship optimization local model according to the global model parameters. According to the method, the performance of the ship optimization global model is directly improved, and the final multi-ship collaborative optimization strategy is more accurate and efficient.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of ship collaborative optimization technology, specifically relating to a ship cluster collaborative optimization method, system, and storage medium. Background Technology

[0002] With the advancement of intelligent ships, the shipping industry is developing towards intelligence, greening, and efficiency. However, the vast majority of ships are still in the initial stage of "information silos" and "single-ship intelligence." Each ship relies solely on its own navigation equipment (such as GPS, radar, and AIS) and preset routes for independent navigation and operation. This traditional model has the following inherent defects: 1) Limited perception capabilities: The detection range of a single ship's sensors is affected by the curvature of the earth and weather and sea conditions, resulting in huge blind spots. There is a serious lag and uncertainty in judging long-distance weather changes, hidden dangers (such as floating objects and shoals), and the real-time intentions of other ships. 2) Limited decision optimization: Single-ship intelligent systems can only perform decision optimization based on their own limited data. For example, path planning only considers static obstacles and publicly available nautical chart information, and cannot effectively integrate the dynamic intentions of surrounding ships, making it difficult to achieve globally optimal traffic flow organization, resulting in low overall channel traffic efficiency. 3) Inefficient resource allocation: In scenarios such as port scheduling and cluster operations (such as towing, escort, and scientific research), there is a lack of effective information sharing and action coordination among ships, which can easily lead to problems such as task conflicts, excessive waiting time, and energy waste.

[0003] Therefore, improving maritime safety and operational efficiency, and enabling intelligent collaboration among ships to complete complex tasks, has become an inevitable trend and an urgent technological requirement for the industry. To achieve intelligent collaboration among ships, Chinese invention patent application CN112906944A, published on June 4, 2021, discloses a ship energy efficiency optimization scheme based on ship-shore collaboration. This scheme combines data collected from ships and from shore-based systems, uses a big data energy efficiency model and intelligent algorithms to calculate the recommended speed for the ship, thus taking into account the influence of navigation environment and meteorological factors, as well as the role of ship-shore collaboration. It can accurately analyze the impact of navigation environment on ship energy efficiency, collaboratively process ship-side and shore-side monitoring data, and use ship-shore collaboration technology to provide recommended speeds for ships navigating in that section of the waterway.

[0004] Furthermore, federated learning, as a novel distributed machine learning paradigm, offers a solution based on its core idea of ​​"the model moves while the data remains stationary." It allows ships to jointly train a powerful and universal global model by exchanging model updates (such as gradients and weight parameters) instead of the original data, while preserving the original data locally. While federated learning protects data privacy, its performance is highly dependent on the core aggregation algorithm. Currently, the most widely used algorithm is Federated Avg and its variants. Its core idea is to perform a simple weighted average of the model weights or gradients trained by each client (i.e., each ship in this invention's scenario) to update the global model. However, this "one-size-fits-all" averaging aggregation strategy reveals the following serious flaws in the complex scenario of ship collaboration: FedAvg attempts to find a "compromise" globally optimal solution by averaging all local models. However, when the data is highly heterogeneous, this "compromise" global model is not optimal for most participating ships, and may even be a poorly performing model. It loses the unique knowledge of the local data distribution of each ship, resulting in the final collaborative model performing poorly in various specific scenarios, which may also lead to low prediction accuracy of the local models of each ship. Summary of the Invention

[0005] The purpose of this invention is to provide a method, system, and storage medium for collaborative optimization of ship clusters, in order to solve the problem that the collaborative model generated by FedAvg-style federated learning for collaborative optimization of ship clusters in the prior art is not ideal in terms of the performance of each ship.

[0006] To address the aforementioned technical problems, this invention provides a technical solution for a ship swarm collaborative optimization method, as detailed below:

[0007] A method for collaborative optimization of ship swarms includes the following steps:

[0008] 1) Obtain the model parameters of the ship optimization local model deployed on each ship; the ship optimization local model is used to predict the key ship navigation indicators corresponding to different navigation strategies in the ship environment and ship state based on the ship environment, ship state and different navigation strategies executed by the ship.

[0009] 2) Evaluate the contribution value of each ship optimization local model to the construction of a high-performance ship optimization global model deployed on the server, and use the contribution value of each ship optimization local model to obtain the aggregation weight of each ship optimization local model during federated aggregation; where the greater the contribution value, the greater the corresponding aggregation weight.

[0010] 3) The aggregation weights are used to perform federated aggregation of the model parameters of the local optimization model of each ship to obtain the global model parameters, so that the model parameters of the local optimization model of each ship are updated according to the global model parameters.

[0011] The beneficial effects of the above technical solution are as follows: This invention uses federated learning to update the model parameters of each ship's local optimization model. Moreover, when performing federated aggregation, it no longer uses the federated averaging algorithm in the existing technology. Instead, it adjusts the aggregation weight of each ship's local optimization model based on its contribution value to building a high-performance global ship optimization model deployed on the server. When the contribution value is relatively high, its aggregation weight is also larger. Thus, the participation of ship optimization models with higher contribution value is higher during aggregation. By giving higher weights to high-quality, high-contribution ships, the aggregation process actually focuses on those updates that are most helpful in improving the performance of the global model. This transforms federated learning from a "public welfare project" into a "fair market," where data contributors can receive corresponding rewards and are thus willing to contribute high-quality, high-value data, breaking down "data silos," directly improving the performance of the global ship optimization model, and making the final multi-ship collaborative optimization strategy more accurate and efficient.

[0012] Furthermore, the SHAP method is used to evaluate the contribution value of each ship's local optimization model. The contribution value of each ship's local optimization model is the Shapley value, and the value function value used to calculate the Shapley value is the prediction accuracy of the ship's local optimization model. The Shapley value is then normalized to obtain the aggregate weight corresponding to each ship's local optimization model.

[0013] Furthermore, the network framework of the ship optimization local model includes GCN, LSTM, and prediction head. GCN is used to process the data input to the ship optimization local model to capture the spatial topological relationships between ships in the fleet at the same time. LSTM is used to process the output of GCN to capture the time-varying patterns of the state of a single ship and its surrounding environment. The prediction head is used to map the output of LSTM to the prediction results of the ship optimization local model through a fully connected layer for output.

[0014] Furthermore, key indicators for ship navigation include total energy consumption in the short term, ship arrival time, and recommended speed / power; navigation strategies include power distribution strategy, path planning strategy, and charging scheduling strategy. Power distribution strategy refers to the power output strategy of each power source in the ship, path planning strategy refers to the path or speed curve planned for the ship, and charging scheduling strategy refers to the charging port, charging time, and charging power determined for ships that need charging.

[0015] Further, in step 3), the model parameters of each ship's local optimization model are updated to the verified global model parameters. The verification of the global model parameters is performed as follows: the optimal navigation strategy for each ship is determined based on the latest prediction results of the global ship optimization model; the MMG ship dynamics model and real-time ship environment data are obtained, and simulation calculations are performed based on the obtained model and data to determine whether the navigation strategy generated by the global ship optimization model meets the requirements. If it does, it indicates that the global model parameters have been verified. If it does not meet the requirements, it indicates that the global model parameters have not been verified. Then, the hyperparameters of the ship's local model are corrected and step 1) is re-executed, or step 1) is re-executed and the aggregation weights are adjusted when executing step 2) until the global model parameters are verified.

[0016] Furthermore, the method for determining the optimal navigation strategy for each ship based on the prediction results of the latest global ship optimization model includes: feeding the prediction results of the global ship optimization model into a multi-objective optimization algorithm, solving the multi-objective optimization algorithm to find the optimal navigation strategy for each ship from different navigation strategies; wherein, the multi-objectives in the multi-objective optimization algorithm include minimizing the total energy consumption of the ship formation, minimizing operating costs, and minimizing the task completion time; power allocation refers to allocating the output power of different power sources under a given ship speed; charging scheduling refers to the charging behavior, which includes charging start time, charging end time, charging power, and charging location.

[0017] Furthermore, the ship's state includes time-series data of the ship's three-axis acceleration and angular velocity; the ship's environment includes point cloud data of the ship's surrounding environment, RGB images of the ship's surrounding environment, and time-series data of depth images of the ship's surrounding environment.

[0018] Furthermore, the hash value of the latest global model parameters is calculated and stored on the blockchain.

[0019] To address the aforementioned technical problems, the present invention also provides a technical solution for a ship swarm collaborative optimization system, as detailed below:

[0020] A ship swarm collaborative optimization system includes a processor that executes a computer program to implement the steps of the following method:

[0021] 1) Obtain the model parameters of the ship optimization local model deployed on each ship; the ship optimization local model is used to predict the key ship navigation indicators corresponding to different navigation strategies in the ship environment and ship state based on the ship environment, ship state and different navigation strategies executed by the ship.

[0022] 2) Evaluate the contribution value of each ship optimization local model to the construction of a high-performance ship optimization global model deployed on the server, and use the contribution value of each ship optimization local model to obtain the aggregation weight of each ship optimization local model during federated aggregation; where the greater the contribution value, the greater the corresponding aggregation weight.

[0023] 3) The aggregation weights are used to perform federated aggregation of the model parameters of the local optimization model of each ship to obtain the global model parameters, so that the model parameters of the local optimization model of each ship are updated according to the global model parameters.

[0024] The beneficial effects of the above technical solution are as follows: The ship cluster collaborative optimization system of the present invention provides hardware support for realizing the ship cluster collaborative optimization method of the present invention. This method uses federated learning to update the model parameters of each ship's local optimization model. Moreover, during federated aggregation, it no longer uses the federated averaging algorithm of existing technologies, but adjusts the aggregation weight of each ship's local optimization model based on its contribution value to building a high-performance global ship optimization model deployed on the server. When the contribution value is higher, its aggregation weight is also larger. Therefore, the participation of ship local optimization models with higher contribution value is higher during aggregation. By assigning higher weights to high-quality, high-contribution ships, the aggregation process actually focuses on updates that are most helpful in improving the performance of the global model. This transforms federated learning from a "public welfare project" into a "fair market," where data contributors receive corresponding rewards, thus encouraging them to contribute high-quality, high-value data, breaking down "data silos," directly improving the performance of the global ship optimization model, and making the final multi-ship collaborative optimization strategy more accurate and efficient.

[0025] Furthermore, the SHAP method is used to evaluate the contribution value of each ship's local optimization model. The contribution value of each ship's local optimization model is the Shapley value, and the value function value used to calculate the Shapley value is the prediction accuracy of the ship's local optimization model. The Shapley value is then normalized to obtain the aggregate weight corresponding to each ship's local optimization model.

[0026] Furthermore, the network framework of the ship optimization local model includes GCN, LSTM, and prediction head. GCN is used to process the data input to the ship optimization local model to capture the spatial topological relationships between ships in the fleet at the same time. LSTM is used to process the output of GCN to capture the time-varying patterns of the state of a single ship and its surrounding environment. The prediction head is used to map the output of LSTM to the prediction results of the ship optimization local model through a fully connected layer for output.

[0027] Furthermore, key indicators for ship navigation include total energy consumption in the short term, ship arrival time, and recommended speed / power; navigation strategies include power distribution strategy, path planning strategy, and charging scheduling strategy. Power distribution strategy refers to the power output strategy of each power source in the ship, path planning strategy refers to the path or speed curve planned for the ship, and charging scheduling strategy refers to the charging port, charging time, and charging power determined for ships that need charging.

[0028] Further, in step 3), the model parameters of each ship's local optimization model are updated to the verified global model parameters. The verification of the global model parameters is performed as follows: the optimal navigation strategy for each ship is determined based on the latest prediction results of the global ship optimization model; the MMG ship dynamics model and real-time ship environment data are obtained, and simulation calculations are performed based on the obtained model and data to determine whether the navigation strategy generated by the global ship optimization model meets the requirements. If it does, it indicates that the global model parameters have been verified. If it does not meet the requirements, it indicates that the global model parameters have not been verified. Then, the hyperparameters of the ship's local model are corrected and step 1) is re-executed, or step 1) is re-executed and the aggregation weights are adjusted when executing step 2) until the global model parameters are verified.

[0029] Furthermore, the method for determining the optimal navigation strategy for each ship based on the prediction results of the latest global ship optimization model includes: feeding the prediction results of the global ship optimization model into a multi-objective optimization algorithm, solving the multi-objective optimization algorithm to find the optimal navigation strategy for each ship from different navigation strategies; wherein, the multi-objectives in the multi-objective optimization algorithm include minimizing the total energy consumption of the ship formation, minimizing operating costs, and minimizing the task completion time; power allocation refers to allocating the output power of different power sources under a given ship speed; charging scheduling refers to the charging behavior, which includes charging start time, charging end time, charging power, and charging location.

[0030] Furthermore, the ship's state includes time-series data of the ship's three-axis acceleration and angular velocity; the ship's environment includes point cloud data of the ship's surrounding environment, RGB images of the ship's surrounding environment, and time-series data of depth images of the ship's surrounding environment.

[0031] Furthermore, the hash value of the latest global model parameters is calculated and stored on the blockchain.

[0032] To address the aforementioned technical problems, the present invention also provides a technical solution for a computer-readable storage medium, as detailed below:

[0033] A computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, performs the steps of the following method:

[0034] 1) Obtain the model parameters of the ship optimization local model deployed on each ship; the ship optimization local model is used to predict the key ship navigation indicators corresponding to different navigation strategies in the ship environment and ship state based on the ship environment and ship state and the ship's execution of different navigation strategies.

[0035] 2) Evaluate the contribution value of each ship optimization local model to the construction of a high-performance ship optimization global model deployed on the server, and use the contribution value of each ship optimization local model to obtain the aggregation weight of each ship optimization local model during federated aggregation; where the greater the contribution value, the greater the corresponding aggregation weight.

[0036] 3) The aggregation weights are used to perform federated aggregation of the model parameters of the local optimization model of each ship to obtain the global model parameters, so that the model parameters of the local optimization model of each ship are updated according to the global model parameters.

[0037] The beneficial effects of the above technical solution are as follows: The computer-readable storage medium of the present invention stores software code corresponding to the ship cluster collaborative optimization method of the present invention, supporting the implementation of the method of the present invention. This method uses federated learning to update the model parameters of the local ship optimization models of each ship. Moreover, when performing federated aggregation, it no longer uses the federated averaging algorithm in the prior art, but adjusts the aggregation weight of each local ship optimization model based on its contribution value to building a high-performance global ship optimization model deployed on the server. When the contribution value is relatively high, its aggregation weight is also larger. Therefore, the participation of local ship optimization models with higher contribution value is higher during aggregation. By assigning higher weights to high-quality, high-contribution ships, the aggregation process actually focuses on those updates that are most helpful in improving the performance of the global model, making federated learning transform from a "public welfare project" into a "fair market." Data contributors can receive corresponding rewards, thus being willing to contribute high-quality, high-value data, breaking down "data silos," directly improving the performance of the global ship optimization model, and making the final multi-ship collaborative optimization strategy more accurate and efficient.

[0038] Furthermore, the SHAP method is used to evaluate the contribution value of each ship's local optimization model. The contribution value of each ship's local optimization model is the Shapley value, and the value function value used to calculate the Shapley value is the prediction accuracy of the ship's local optimization model. The Shapley value is then normalized to obtain the aggregate weight corresponding to each ship's local optimization model.

[0039] Furthermore, the network framework of the ship optimization local model includes GCN, LSTM, and prediction head. GCN is used to process the data input to the ship optimization local model to capture the spatial topological relationships between ships in the fleet at the same time. LSTM is used to process the output of GCN to capture the time-varying patterns of the state of a single ship and its surrounding environment. The prediction head is used to map the output of LSTM to the prediction results of the ship optimization local model through a fully connected layer for output.

[0040] Furthermore, key indicators for ship navigation include total energy consumption in the short term, ship arrival time, and recommended speed / power. Ship navigation strategies include power distribution strategy, path planning strategy, and charging scheduling strategy. Power distribution strategy refers to the power output strategy of each power source in the ship. Path planning strategy refers to the path or speed curve planned for the ship. Charging scheduling strategy refers to the charging port, charging time, and charging power determined for ships that need charging.

[0041] Further, in step 3), the model parameters of each ship's local optimization model are updated to the verified global model parameters. The verification of the global model parameters is performed as follows: the optimal navigation strategy for each ship is determined based on the latest prediction results of the global ship optimization model; the MMG ship dynamics model and real-time ship environment data are obtained, and simulation calculations are performed based on the obtained model and data to determine whether the navigation strategy generated by the global ship optimization model meets the requirements. If it does, it indicates that the global model parameters have been verified. If it does not meet the requirements, it indicates that the global model parameters have not been verified. Then, the hyperparameters of the ship's local model are corrected and step 1) is re-executed, or step 1) is re-executed and the aggregation weights are adjusted when executing step 2) until the global model parameters are verified.

[0042] Furthermore, the method for determining the optimal navigation strategy for each ship based on the prediction results of the latest global ship optimization model includes: feeding the prediction results of the global ship optimization model into a multi-objective optimization algorithm, solving the multi-objective optimization algorithm to find the optimal navigation strategy for each ship from different navigation strategies; wherein, the multi-objectives in the multi-objective optimization algorithm include minimizing the total energy consumption of the ship formation, minimizing operating costs, and minimizing the task completion time; power allocation refers to allocating the output power of different power sources under a given ship speed; charging scheduling refers to the charging behavior, which includes charging start time, charging end time, charging power, and charging location.

[0043] Furthermore, the ship's state includes time-series data of the ship's three-axis acceleration and angular velocity; the ship's environment includes point cloud data of the ship's surrounding environment, RGB images of the ship's surrounding environment, and time-series data of depth images of the ship's surrounding environment.

[0044] Furthermore, the hash value of the latest global model parameters is calculated and stored on the blockchain. Attached Figure Description

[0045] Figure 1 This is a framework diagram of the entire ship cluster collaborative optimization system of the present invention;

[0046] Figure 2 This is a flowchart of the entire ship cluster collaborative optimization system of the present invention;

[0047] Figure 3 This is a flowchart of the simulation verification of the present invention;

[0048] Figure 4 This is a flowchart of the NSGA-III algorithm application of the present invention;

[0049] Figure 5 This is a flowchart of the processing of the LSTM-GCN hybrid model of the present invention;

[0050] Figure 6 This is an overall flowchart of the federated learning phase of the present invention;

[0051] Figure 7 This is a flowchart of the dynamic verification process of the present invention;

[0052] Figure 8 This is a flowchart of the power distribution module of the present invention;

[0053] Figure 9 This is a flowchart of the charging scheduling module of the present invention. Detailed Implementation

[0054] The core of the ship cluster optimization method of this invention lies in dynamically adjusting the aggregation weights corresponding to each ship's local optimization model based on the contribution value of each ship's local optimization model to the construction of a high-performance global ship optimization model deployed on a server. This aggregation weights are then used to obtain the global model parameters, and the model parameters of each ship's local optimization model are updated according to the global model parameters. This method can guide the global model to converge faster and achieve higher final performance, making the final multi-ship collaborative optimization strategy more accurate and efficient.

[0055] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings.

[0056] An implementation method for ship cluster collaborative optimization:

[0057] This invention discloses a ship swarm collaborative optimization method, which is a federated learning-digital twin dual-loop collaborative optimization method. The entire system contains numerous ships, and these ships need to coordinate with each other to achieve their respective navigation goals. To implement this method, four layers are designed: an edge computing layer, a federated aggregation layer, a digital twin layer, and an application layer, such as... Figure 1 As shown. Edge computing layer: Each ship deploys a local federated learning agent to run the ship's local optimization model (specifically a lightweight LSTM-GCN hybrid model) and process its own multimodal data in real time; Federated aggregation layer: A dynamic weight aggregation server based on ship contribution, quantifying the value of each ship's model through Shapley values; Digital twin layer: A high-fidelity ship twin in the cloud, integrating a multiphysics simulation engine and a real-time meteorological database; Application layer: Dynamic optimization strategies are distributed to the ship's control system, including path replanning, power allocation, and charging scheduling modules. Except for the edge computing layer, the federated aggregation layer, digital twin layer, and application layer can all be deployed in the cloud.

[0058] The overall process of this method is as follows: Figure 2 As shown, the details are as follows:

[0059] Step 1: Each vessel uses its onboard sensor array to collect the data required for its locally deployed ship optimization local model.

[0060] In this embodiment, the ship-side sensor array acquires raw environmental data at a sampling frequency of 1000Hz, specifically including ship status and ship environment data. Data types include, but are not limited to: lidar point cloud data of the ship's surrounding environment (belonging to the ship environment), acceleration and angular velocity of the ship's three axes measured by the inertial measurement unit (IMU) (belonging to the ship status), and RGB-D image stream of the ship's surrounding environment acquired by the visual sensor (belonging to the ship environment).

[0061] The surrounding environment of the ship includes the water surface, other ships, docks, obstacles, etc.; the lidar point cloud data specifically includes the coordinates (X,Y,Z) of points in three-dimensional space; the RGB-D image stream includes RGB images (color images, used for target recognition and scene understanding) and depth images (depth images, providing distance information for each pixel).

[0062] Step two: Preprocess the data collected in step one.

[0063] In this embodiment, the preprocessing methods specifically include:

[0064] 1. Kalman Filtering: Noise is eliminated using a Kalman filter to improve the signal-to-noise ratio (SNR) of the data, increasing it to:

[0065]

[0066] In the formula, SNR represents the signal-to-noise ratio, and P signal P represents the power of the signal. signal This indicates the power of the noise.

[0067] 2. Data normalization: This process eliminates differences in sensor dimensions, improving the convergence speed of subsequent training of the local ship optimization model. The normalization formula is:

[0068]

[0069] In the formula, x norm σ represents the normalized value, x represents the Kalman filtered value, μ represents the mean of this feature dimension in the training dataset, and σ represents the standard deviation of this feature dimension in the training dataset.

[0070] The normalization operation described above performs two tasks: first, it decentralizes the data by subtracting the mean μ, effectively shifting the entire data distribution to near 0; second, it scales the data by dividing by the standard deviation σ, compressing or expanding the data's "range of fluctuation" to a standard scale. The purpose of this operation is to transform the original data into a new distribution with a mean of 0 and a standard deviation of 1, eliminating the dimensional differences between different sensor data (e.g., acceleration is measured in m / s², image pixel values ​​range from 0 to 255, and LiDAR point cloud coordinates are measured in meters), bringing all features to the same order of magnitude. This significantly improves the training convergence speed and stability of the ship optimization local model.

[0071] Step 3, Federated Learning Phase.

[0072] The entire process of this stage is as follows: Figure 6 As shown, the contribution value of the local ship optimization model is calculated once in each aggregation cycle, and the weight allocation of each local ship optimization model is dynamically adjusted, as follows:

[0073] 1. Local Training: Each vessel uses the collected data (also known as each vessel's local private data) to train its local optimization model, and each vessel obtains the parameters of its own local optimization model. ,correspond Figure 6 The first step.

[0074] The ship optimization local model is used to predict key navigation indicators for different navigation strategies under the given ship environment and state, based on the ship's environment, ship state, and the different navigation strategies executed by the ship. In this embodiment, the ship optimization local model deployed on each ship is an LSTM-GCN hybrid model. The LSTM-GCN hybrid model can predict the results (i.e., key indicators) that would result from executing different candidate actions (i.e., navigation strategies). The LSTM-GCN hybrid model is the intelligent brain of the system in which the method of this invention is based; its output is a "prediction" and "metric" that measures the merits of different strategies, and it serves as a bridge connecting perceived data and the final optimization decision. The core design idea of ​​the LSTM-GCN hybrid model is to first use GCN (Graph Convolutional Network) to capture the spatial topological relationships (distance, relative speed, communication connections, etc.) between ships in the fleet at the same time, use GCN to process the spatial relationships at all time steps, then use LSTM (Long Short-Term Memory Neural Network) to capture the changes in the state of a single ship and its surrounding environment over time, and finally use a prediction head to map the output of LSTM to the desired output result. The entire processing process of the LSTM-GCN hybrid model is as follows: Figure 5 As shown, this structure is suitable for modeling spatiotemporal graph data. A detailed explanation of the model (spatiotemporal concatenation structure) is as follows:

[0075] Suppose there is a fleet of M ships, which can be represented using a graph structure. Each ship is a node in the graph, and each node has its own feature vector at time t. The feature vectors include latitude and longitude, speed, heading, energy consumption rate, battery SOC, wind speed and current speed, etc.; the edges in the graph are constructed based on the Euclidean distance between ships. For example, edges are created between ships within 10 kilometers to indicate that they may influence each other.

[0076] The input to the model is a time series data segment (the past T=10 time steps, with each time step spaced 1 minute apart), specifically including the ship state time series data and ship environment time series data mentioned in step one, as well as the different navigation strategies executed by the ship.

[0077] GCN acts as a spatial encoder, operating at each independent time slice. It analyzes static snapshots of the fleet and uses graph convolution operations to enable each ship to "aware" the status of its neighbors (such as collision risk or favorable formation position), thus solving the problems of "data silos" and "multi-ship collaboration." The specific processing procedure of GCN is as follows: at each time step t (t=1,2,…,T), the features of all ship nodes are stacked into a matrix. ;Will The input is fed into a two-layer graph convolutional network (GCN) to learn the spatially aggregated node features. , This represents the normalized adjacency matrix. and It is a trainable weight matrix. The output represents the joint state information of each ship and its neighboring ships at time t. ReLU represents the activation function, X. t Indicates input, This represents the node characteristics after spatial aggregation.

[0078] LSTM acts as a time encoder, processing the individual time series of each ship. This series has already been injected with spatial neighbor information by GCN. LSTM learns how these spatial states evolve over time (e.g., acceleration, turning, energy consumption trends). It solves the problem of "hysteresis in dynamic environment response." The LSTM (time modeling) process is as follows: For each ship i (i=1,2,…,M), its features encoded by GCN at all time steps are extracted to form a time series: ; Time series The input is fed into an LSTM layer, which processes the sequence step by step, including its hidden states. As a spatiotemporal feature summary of the i-th ship, it integrates the spatiotemporal dynamic information of the ship itself and its neighboring ships over the past T time steps.

[0079] The process of Prediction Head: Determining the final hidden state of each ship. It maps to the desired prediction target through a fully connected layer (FC Layer) and outputs the final predicted value.

[0080] Each ship's local agent performs LSTM-GCN hybrid model training and updates the gradient parameters according to the following formula:

[0081]

[0082] In the formula, Indicates the learning rate. Represents the mixed loss function. This represents the model parameters. During each round of local training, the number of iterations (epochs) is 5, and the batch size (batch_size) is 32.

[0083] The model performs a supervised learning task, and its prediction target (label) is set according to the optimization objective. The core prediction parameters (i.e., key indicators) include: ① Future short-term total energy consumption prediction: for example, predicting the ship's total energy consumption (in kWh) within the next 5 minutes. This is a key input for minimizing energy consumption in multi-objective optimization; ② Arrival time estimation: predicting the time required to reach the next key waypoint under the current strategy. This is key to balancing the objectives of "energy consumption" and "time"; ③ Recommended speed / power: directly outputting the recommended speed or main engine power setting calculated to achieve the optimal Pareto front. Moreover, it predicts the consequences of executing different "candidate actions" (i.e., ship navigation strategies), namely the above three key indicators: future short-term total energy consumption prediction, arrival time estimation, and recommended speed / power.

[0084] The ship navigation strategy here is a specific, executable set of instructions, typically including: ① Power distribution strategy: instructing each ship's main engine, auxiliary engines, batteries, and other power sources to output specific power levels. ② Path planning strategy: planning a new, more optimized, finely adjusted path or speed curve for each ship. ③ Charging scheduling strategy: specifying the port, time, and power level for ships requiring charging.

[0085] The functions of the output parameters are: 1) Local real-time optimization: Each ship can adjust its power system in real time using the output of its local LSTM-GCN hybrid model, achieving preliminary energy efficiency optimization for a single ship. For example, if the model predicts that future energy consumption is too high, it can automatically fine-tune the speed. 2) As a local training objective for federated learning: During the local training phase, the model updates its weights by minimizing the error between the predicted and actual energy consumption values. These weight gradients include the ship's own operating patterns and its cooperative mode with neighboring ships. 3) As input for digital twin simulation: The cloud-based digital twin can call this trained model, input different assumptions (including different speed strategies and different formation configurations), and quickly predict the energy consumption and arrival time results under different strategies, thereby safely and efficiently evaluating countless possible solutions in virtual space. 4) Supporting global collaborative decision-making: All these predicted parameters are fed into multi-objective optimization algorithms such as NSGA-III to solve the Pareto optimal solution set, generating a global collaborative strategy (including speed guidance, path replanning, and charging scheduling) that achieves the best balance between "energy consumption," "time," and "cost" for the entire fleet.

[0086] 2. Upload and Update: Each vessel will upload and update the parameters of its local optimized vessel model. Uploaded to the aggregation server, corresponding Figure 6 The second step.

[0087] In this embodiment, each vessel encrypts and uploads the model parameters of its local optimized vessel model to the aggregation server.

[0088] 3. Evaluate Contribution: The aggregation server evaluates the contribution value of each ship optimization local model to building a high-performance global ship optimization model deployed on the server.

[0089] In this implementation, the aggregation server uses a unified, high-quality benchmark set to evaluate the performance v(S) of any model (whether from a single ship, a sub-coalition, or a global model). The performance metric is the energy prediction mean squared efficiency (MSE). Based on the model's performance v(S), the SHAP method is used to calculate the Shapley value for each ship's local model optimization. This Shapley value represents the model's contribution value. The core idea of ​​the Shapley value is to measure the contribution of a ship (e.g., ship A). ​​The skewing method involves allowing ship A to join all possible "small teams" S and calculating the value improvement (marginal contribution) it brings to the team each time it joins. Finally, the average is calculated over all possible scenarios. The formula for calculating the Shapley value is:

[0090]

[0091] In the formula, denoted by , where represents the Shapley value of the local model optimized by the i-th ship; N represents the set of ships participating in federated learning; v(S) represents the model contribution evaluation value of the sub-coalition S, which is any subset of the entire set of ships N. v(S) represents an evaluation function used to measure the quality of the global ship optimization model if only the data of all ships in the sub-coalition S are used to train the global ship optimization model. The higher the v(S) value, the better the model trained by the sub-coalition S. This item represents the marginal contribution. This item calculates the value increment brought about by ship i after joining the sub-alliance S. The larger this increment is, the more important ship i is to this specific team S.

[0092] It should be noted that traditional SHAP technology calculates the contribution of the model's input features, while in this invention... Instead of calculating the contribution of features within the model, the calculation represents the contribution value of the local data / model update of the i-th ship to building a high-performance global model. This value is then used as a dynamic weight during federated aggregation, giving ships with greater contributions more say in the next round of aggregation, thus solving the problems of "model heterogeneity" and "incentivizing the participation of high-quality data holders".

[0093] 4. Dynamic weight allocation: The calculated original Shapley values ​​are then... Normalization is performed to convert it into aggregate weights. ,correspond Figure 6 The fourth step in the process.

[0094] 5. Weighted Aggregation: The aggregation server uses the calculated weights to perform a federated average to obtain the global model parameters, corresponding to... Figure 6 The fifth step in the process. For example... Figure 6 As shown, This refers to the model update of ship i. This means that the model updates of high-contribution ships have a greater influence on the formation of the next generation of the global model. The specific calculation formula for federated aggregation is:

[0095]

[0096] In the formula, This represents the global model parameters after federated aggregation. This represents the aggregate weight corresponding to the local model for optimizing the i-th ship.

[0097] After obtaining the global model parameters, the most direct approach is to directly distribute the aggregated weights, i.e., execute the subsequent "6. Distribute the new model"; another optimized approach is to perform the digital twin verification in step four, and then distribute the verified global model parameters to the ship after the verification is successful.

[0098] 6. Distribute the new model: Distribute the obtained global model parameters to each vessel, so that the model parameters of each vessel's local model are updated to the global model parameters, until the start of a new round of federated learning training cycle. This step corresponds to... Figure 6 The sixth step in the process.

[0099] The entire federated learning phase employs the aforementioned methods for weight adjustment and global model parameter updates, primarily serving two purposes. First, it acts as a fair incentive. Aiming to address the question of "how to attract high-quality data holders to participate continuously," the system can allocate substantial rewards based on Shapley values. This transforms federated learning from a "public welfare project" into a "fair market," where data contributors receive corresponding rewards, thus encouraging them to contribute high-quality, high-value data and breaking down "data silos." Second, it serves as an optimization strategy to improve the quality of the global model. It aims to address the problem of "traditional federated averaging ignoring data heterogeneity" and directly improve the performance of the global model. Traditional federated averaging (FedAvg) simply averages all local updates, assuming all data are independently and identically distributed (IID). However, in reality, ship data is not IID (some ships are in rivers, some are at sea; some are cargo ships, some are passenger ships). Simple averaging allows low-quality or skewed local models to "contaminate" the global model. By assigning higher weights to high-quality, high-contribution ships, the aggregation process is actually focusing on updates that are most helpful in improving the performance of the global model. The method of this invention is equivalent to an "elite screening" process, which can guide the global model to converge faster and obtain higher final performance, making the final multi-ship collaborative optimization strategy more accurate and efficient.

[0100] Moreover, the ship uses its updated ship optimization local model to quickly re-predict and re-optimize for emergencies, generating local adjustment instructions.

[0101] Step four: Load the MMG ship dynamics simulation model from the digital twin database to validate the new global model parameters.

[0102] The whole process is as follows Figure 3 As shown, the entire process indirectly and systematically verifies the effectiveness and security of the final result produced by the aforementioned weight allocation mechanism. This step, together with step three, constitutes a complete closed loop from "model training" to "policy generation" and then to "effect verification." Details are as follows... Figure 7 As shown, the specific process is as follows:

[0103] 1. The prediction results of the LSTM-GCN model are used as input to the NSGA-III algorithm. The task of NSGA-III is to search for the optimal solution set that achieves the best balance among the three objectives of "energy consumption," "time," and "cost" from countless possible combinations of "candidate actions." That is, the NSGA-III algorithm generates the Pareto front. From this solution set, a final strategy is selected through a decision-making method (such as TOPSIS). This selected strategy is the "ship control strategy S," i.e., the optimal ship navigation strategy. The algorithm flow is as follows: Figure 4 As shown:

[0104]

[0105] In the formula, Indicates minimization. This indicates the total energy consumption of the ship formation. This indicates operating costs (including fuel, maintenance, etc.). Representing task completion time, the expressions for the three objectives are as follows:

[0106]

[0107] In the formula, N represents the number of ships; T represents the total time step of the mission; and i is the ship index. Let represent the power function of the i-th ship at time t, where the power function is the speed of the i-th ship. Operating status (Including acceleration, cruising, etc.) and environmental factors Complex functions (including wind speed, current velocity, and water depth) can be predicted by a local LSTM-GCN hybrid model. Indicates a time interval.

[0108]

[0109] In the formula, E represents the cost per unit of energy. i C represents the total energy consumed by the i-th ship during the entire mission. maint D represents the maintenance cost per unit distance. i This represents the total distance traveled by the i-th ship.

[0110]

[0111] In the formula, This represents the time it takes for the i-th ship to complete its designated task. This indicates the latest completion time among all ships, which is the "completion time" of the entire collaborative mission.

[0112] 2. Input the generated ship control strategy S into the digital twin engine, and load physical models such as MMG (including hull geometry parameters, power system configuration, etc.) and real-time environmental data from the digital twin database.

[0113] The initial state is set based on the MMG ship motion model:

[0114]

[0115] Wherein, X represents the total hydrodynamic force acting on the ship longitudinally, Y represents the total hydrodynamic force acting on the ship laterally, N represents the yaw moment acting on the ship's vertical axis, u represents the longitudinal speed of the ship, v represents the lateral speed of the ship, r represents the yaw angular velocity of the ship, represents the rudder angle.

[0116] In the MMG ship dynamics model loaded by the digital twin engine, the total hydrodynamic force X acting on the ship in the forward direction is the resistance and added mass force, etc. X H generated by the thrust or pull force X of the propeller P generated by the rudder and other accessories X R and the sum of them.

[0117] 3. The high-fidelity simulation executes the ship control strategy S to determine whether the ship control strategy S is safe and efficient:

[0118] If it is safe and efficient, it indicates that the verification is passed, and the ship control strategy S can be directly sent to the real ship for execution;

[0119] Otherwise, if the verification fails, analyze the root cause. Whether it is because of improper weight distribution that there are defects in the global ship optimization global model. If so, generate a feedback signal to trigger a new round of federated learning to optimize the aggregation weight, that is, re-execute step three, adjust the dynamic weight distribution and the training process (hyperparameters) of the local model, use the new aggregation weight to aggregate to obtain the global optimization model, and re-execute step 1 according to the global optimization model until the generated ship control strategy S is safe and efficient.

[0120] Figure 3 The correction mechanism in

[0121] is specifically as follows: Evaluate the performance of the global strategy. In the case of poor strategy performance, analyze the failure reasons and give corresponding adjustment suggestions. The adjustment suggestions include the performance deviation amount (such as the energy consumption prediction deviation), weight adjustment suggestions, model correction suggestions (such as adjusting the learning rate), and accordingly adjust the Shapley calculation parameters, adjust the aggregation weight, adjust the hyperparameters of the ship optimization local model (such as the learning rate η, batch size batch_size), and trigger a new round of federated learning, that is, re-execute step three, and the aggregation server uses the modified aggregation coefficient for a new round of processing.

[0121] Specifically, the correction mechanism here is a closed-loop feedback system, which not only corrects the federated aggregation strategy (weight), but also corrects the training process (hyperparameters) of the local model. The adjustment methods are as follows:

[0122] 1) Adjust the Shapley calculation parameters (correct the contribution evaluation).

[0123] Adjusting the benchmark set: If the validation finds that the model performs poorly under certain sea conditions (such as high winds and waves), the weight of the data in that scenario in the benchmark set can be dynamically increased so that the local ship model that performs well in that scenario can receive a higher contribution evaluation.

[0124] Adjust the value function: Change the single prediction accuracy index to a comprehensive score as shown below.

[0125]

[0126] In the above formula , , These are the weights corresponding to the accuracy score, high data diversity score, and model stability score, respectively. When digital twin validation detects policy instability, the stability weight can be automatically increased.

[0127] 2) Adjust the aggregate weight (directly correct the weight).

[0128] Weight pruning: To prevent a ship from monopolizing the aggregation process due to an abnormally high contribution, a weight cap can be set, and any excess weight can be evenly distributed among the other ships.

[0129] Weight smoothing: Introduces historical weighting factors; the new aggregate weights are derived from the weights calculated in this iteration. Weights from the previous round This decision was made jointly to avoid drastic fluctuations in weighting.

[0130]

[0131] 3) Adjust the hyperparameters of the ship optimization local model (correct local training).

[0132] If the diagnosis finds that the digital twin validation fails and the root cause analysis indicates overfitting.

[0133] Therefore, the proposed adjustment is to increase the regularization intensity by issuing instructions from the server to all or specific ships.

[0134] If the diagnosis reveals that the model converges slowly or has generally poor performance.

[0135] Therefore, the recommended adjustment is to instruct ships to increase the number of local training rounds.

[0136] 4. The blockchain evidence storage module records the hash value of the verification result:

[0137]

[0138] In the formula, H represents the final hash output, SHA256 represents the cryptographic hash function, timestamp represents the timestamp, and data represents the protected data.

[0139] The NSGA-III and digital twin work collaboratively and are interconnected, forming a closed-loop "decision-verification" process. NSGA-III performs rapid decision optimization within the virtual environment provided by the digital twin; the digital twin, in turn, provides highly realistic verification of NSGA-III's decisions, ensuring their feasibility and security.

[0140] Step 5: Each vessel uses the power distribution module, charging scheduling module, and route planning module to perform power distribution, charging scheduling, and route planning, respectively.

[0141] The core task of the power distribution module is to operate at a given target ship speed v. target Under the premise of (determined by the optimization strategy), the power distribution module intelligently allocates the output power of different power sources (such as main engine, auxiliary engine, battery, fuel cell, etc.) to achieve the highest instantaneous energy efficiency for single-ship operation. The power distribution module is a real-time control system whose workflow is a closed-loop control process based on optimization strategies, sensor feedback, and model prediction. Figure 8 As shown, the specific process is as follows: at a given target ship speed v target Under the premise of optimizing the objective function (specifically, minimizing total energy consumption and emissions), the power system is modeled, an efficiency map of each power source is established, and combined with real-time constraints (including battery SOC, temperature and power limits, etc.), the optimization objective is solved in real time to obtain the optimal power allocation combination, thereby outputting the optimal power setting of each power source, and then sending it to the actuator (such as the main engine throttle, inverter commands, etc.).

[0142] The core task of the charging scheduling module is to coordinate the charging behavior of multiple vessels at the fleet level (when, where, and at what power) to minimize total charging costs, balance grid load, and ensure that all vessels can complete their subsequent tasks on time. The charging scheduling module is a planning and execution system based on global optimization results, whose decision-making process comprehensively considers multi-dimensional factors such as time, space, electricity price, and battery status. Figure 9As shown, the specific process is as follows: 1) The objective function is set to minimize motor cost. The scheduling problem is solved based on the set constraints, and a charging schedule for each ship is output. These constraints include spatial constraints, time constraints, and battery health constraints. Spatial constraints can be related to the location and number of charging piles; time constraints can be related to the task window and charging duration; and battery health constraints can be related to the maximum charging power and SOC range. The charging schedule includes the charging port, charging start time, and end time. 2) The output charging schedule for each ship is sent to the corresponding ship and port charging systems, enabling the ships to charge according to the plan. During this process, real-time monitoring detects any anomalies. If anomalies are detected (such as delays), the charging plan is dynamically adjusted.

[0143] The route planning module is used for route planning, and can specifically employ... The algorithm performs path planning, and its total cost function f(n) is:

[0144] f(n) = g(n) + h(n)

[0145] In the formula, g(n) represents the actual cost from the starting point to node n, and h(n) represents the heuristically estimated cost from node n to the endpoint.

[0146] Furthermore, it should be emphasized that LSTM-GCN provides global prediction and data support for global collaborative decision-making. The power allocation, charging scheduling, and path planning modules perform local execution, enabling real-time optimization and control. In this invention, "global prediction" and "local execution" are not contradictory, but rather describe the different functions and decision flows at different stages of the model at different levels. A detailed explanation follows:

[0147] 1. Global Prediction: This refers to the ability of a global model to support collaborative decision-making. "Global" does not refer to the prediction scope of a local model: the training and inference of a local LSTM-GCN model deployed on each ship are indeed physically and data-wise "local"—it uses the ship's historical and real-time data and primarily serves to predict the short-term behavioral effects of that ship. The true meaning of "global prediction" is:

[0148] ① Global nature of model knowledge: The server-side global model, obtained by aggregating updates from the local models of each ship through federated learning, incorporates the operational patterns and collaborative modes of multiple ships in the fleet under different environments and tasks in its parameters. This global model possesses more general and robust predictive capabilities.

[0149] ② Global predictive service: When cross-ship collaborative decision-making is required (such as formation route replanning and charging resource collaborative scheduling), the digital twin layer or collaborative decision-making algorithm can call this high-performance global model to quickly simulate and predict different strategies for multi-ship combinations, thereby evaluating the global performance of the entire fleet (such as total energy consumption and total completion time). This ability to provide predictive support for global collaborative optimization is called "global prediction".

[0150] ③ "Global" enhancement of local model prediction capabilities: Since the local model updates its parameters from the global model periodically, although it runs locally, its prediction capabilities have been indirectly empowered by "global knowledge", enabling it to better understand the impact of its own behavior on collaborative formation.

[0151] 2. Local Execution: This refers to the final execution of optimization decisions being completed locally on each ship. Whether the strategy is generated through global collaborative optimization or through real-time fine-tuning based on the ship's own model, the final physical execution control must be completed by the local control system of each ship. These local execution modules receive instructions from two sources:

[0152] ① The results of global collaborative decision-making: The global optimal strategy, verified by the cloud-based digital twin, is decomposed into specific instructions for each ship.

[0153] ② Local real-time autonomous optimization results: The ship uses its updated local model to quickly re-predict and re-optimize for emergencies and generate local adjustment instructions.

[0154] 3. The system's workflow forms a closed loop of "global-local-global":

[0155] 1) Local training, global contribution: Each ship trains its local model using local data and uploads the updated model.

[0156] 2) Global aggregation to generate intelligence: The server aggregates updates from various local models based on contribution evaluation to generate a more powerful global model;

[0157] 3) Global prediction, supporting collaboration: Utilizing a global model, the optimal collaboration strategy is searched for the entire fleet in a digital twin environment;

[0158] 4) Strategy verification and issuance: The verified global strategy is decomposed into instructions for each ship.

[0159] 5) Local reception and execution: Each ship receives instructions and executes them through its local control module;

[0160] 6) Local feedback, global iteration: The new data generated during execution is used for the next round of local training, thereby initiating a new round of knowledge iteration and global optimization.

[0161] An implementation method for a ship cluster collaborative optimization system:

[0162] An embodiment of a ship swarm collaborative optimization system according to the present invention includes a memory, a processor, an internal bus, and a computer program stored in the memory. The processor and the memory communicate and interact with each other via the internal bus. The processor executes the computer program to implement the steps of the method described in an embodiment of the ship swarm collaborative optimization method of the present invention. The processor can be a microprocessor (MCU), a programmable logic device (FPGA), or other processing devices; the memory can be various types of memory that store information using electrical energy, such as RAM or ROM, or other types of memory. The core idea and process of this method are as follows:

[0163] 1) Each vessel uses its onboard sensor array to collect the data required for its locally deployed vessel optimization local model.

[0164] The collected data includes, but is not limited to: lidar point cloud data of the ship's surrounding environment (belonging to the ship's environment), acceleration and angular velocity of the ship's three axes measured by the inertial measurement unit (IMU) (belonging to the ship's state), and RGB-D image stream of the ship's surrounding environment collected by the visual sensor (belonging to the ship's environment).

[0165] 2) Preprocess the data collected in step 1).

[0166] The preprocessing here specifically includes noise reduction and normalization.

[0167] 3) Federated learning.

[0168] First, the model parameters of the ship optimization local models deployed on each ship are obtained. The ship optimization local models are used to predict ship navigation optimization parameters based on the ship environment and ship status. Then, the contribution value of each ship optimization local model to the construction of a high-performance ship optimization global model deployed on the server is evaluated. The aggregation weight of each ship optimization local model during federated aggregation is obtained using the contribution value of each ship optimization local model. The larger the contribution value, the larger the aggregation weight. Finally, the model parameters of each ship optimization local model are federated and aggregated using the aggregation weight to obtain the global model parameters, so that the model parameters of each ship optimization local model are updated according to the global model parameters.

[0169] The ship optimization local model here can specifically be an LSTM-GCN hybrid model, which includes GCN, LSTM and prediction head. GCN is used to process the data input to the ship optimization local model to capture the spatial topological relationship between ships in the fleet at the same time. LSTM is used to process the output of GCN to capture the time-varying pattern of the state of a single ship and its surrounding environment. The prediction head is used to map the output of LSTM to the prediction result of the ship optimization local model through a fully connected layer and output it.

[0170] 4) Load the MMG ship dynamics simulation model from the digital twin database to validate the new global model parameters.

[0171] 5) Each vessel uses the power distribution module, charging scheduling module, and route planning module to perform power distribution, charging scheduling, and route planning, respectively.

[0172] More detailed information about the above method can be found in the description of a collaborative optimization implementation of ship clusters, which will not be repeated here.

[0173] One embodiment of a computer-readable storage medium:

[0174] This invention provides a computer-readable storage medium storing computer-executable instructions / programs. When these instructions / programs are invoked and executed by a processor, they cause the processor to implement a ship swarm collaborative optimization method according to this invention. The core idea and process of this method are as follows:

[0175] 1) Each vessel uses its onboard sensor array to collect the data required for its locally deployed vessel optimization local model.

[0176] The collected data includes, but is not limited to: lidar point cloud data of the ship's surrounding environment (belonging to the ship's environment), acceleration and angular velocity of the ship's three axes measured by the inertial measurement unit (IMU) (belonging to the ship's state), and RGB-D image stream of the ship's surrounding environment collected by the visual sensor (belonging to the ship's environment).

[0177] 2) Preprocess the data collected in step 1).

[0178] The preprocessing here specifically includes noise reduction and normalization.

[0179] 3) Federated learning.

[0180] First, the model parameters of the ship optimization local models deployed on each ship are obtained. The ship optimization local models are used to predict ship navigation optimization parameters based on the ship environment and ship status. Then, the contribution value of each ship optimization local model to the construction of a high-performance ship optimization global model deployed on the server is evaluated. The aggregation weight of each ship optimization local model during federated aggregation is obtained using the contribution value of each ship optimization local model. The larger the contribution value, the larger the aggregation weight. Finally, the model parameters of each ship optimization local model are federated and aggregated using the aggregation weight to obtain the global model parameters, so that the model parameters of each ship optimization local model are updated according to the global model parameters.

[0181] The ship optimization local model here can specifically be an LSTM-GCN hybrid model, which includes GCN, LSTM and prediction head. GCN is used to process the data input to the ship optimization local model to capture the spatial topological relationship between ships in the fleet at the same time. LSTM is used to process the output of GCN to capture the time-varying pattern of the state of a single ship and its surrounding environment. The prediction head is used to map the output of LSTM to the prediction result of the ship optimization local model through a fully connected layer and output it.

[0182] 4) Load the MMG ship dynamics simulation model from the digital twin database to validate the new global model parameters.

[0183] 5) Each vessel uses the power distribution module, charging scheduling module, and route planning module to perform power distribution, charging scheduling, and route planning, respectively.

[0184] More detailed information about the above method can be found in the description of a collaborative optimization implementation of ship clusters, which will not be repeated here.

[0185] In summary, this invention addresses the model heterogeneity problem in traditional federated learning by designing a dynamic aggregation weight based on a dual factor of contribution and data volume, combined with Shapley values ​​to quantify the contribution of ship models. It constructs a multi-objective optimization framework, uses the NSGA-III algorithm to generate Pareto front solutions, and selects the optimal strategy through TOPSIS decision-making. A cloud-based digital twin layer integrates a high-precision ship dynamics model with a real-time environmental database to achieve strategy pre-validation and safety assessment.

Claims

1. A method for collaborative optimization of ship swarms, characterized in that, Includes the following steps: 1) Obtain the model parameters of the ship optimization local model deployed on each ship; the ship optimization local model is used to predict the key ship navigation indicators corresponding to different navigation strategies in the ship environment and ship state based on the ship environment, ship state and different navigation strategies executed by the ship. 2) Evaluate the contribution value of each ship optimization local model to the construction of a high-performance ship optimization global model deployed on the server, and use the contribution value of each ship optimization local model to obtain the aggregation weight of each ship optimization local model during federated aggregation; where the greater the contribution value, the greater the corresponding aggregation weight. 3) The aggregation weights are used to perform federated aggregation of the model parameters of the local optimization model of each ship to obtain the global model parameters, so that the model parameters of the local optimization model of each ship are updated according to the global model parameters.

2. The ship cluster collaborative optimization method according to claim 1, characterized in that, The Shapley value is used to evaluate the contribution value of each ship's local optimization model. The contribution value of each ship's local optimization model is called the Shapley value. The value function value used to calculate the Shapley value is the prediction accuracy of the ship's local optimization model. The Shapley value is then normalized to obtain the aggregate weight corresponding to each ship's local optimization model.

3. The ship cluster collaborative optimization method according to claim 1, characterized in that, The network framework of the ship optimization local model includes GCN, LSTM, and prediction head. GCN is used to process the data input to the ship optimization local model to capture the spatial topological relationships between ships in the fleet at the same time. LSTM is used to process the output of GCN to capture the time-varying patterns of the state of a single ship and its surrounding environment. The prediction head is used to map the output of LSTM to the prediction results of the ship optimization local model through a fully connected layer.

4. The ship cluster collaborative optimization method according to claim 1, characterized in that, Key indicators for ship navigation include total energy consumption in the short term, ship arrival time, and recommended speed / power. Navigation strategies include power distribution strategy, path planning strategy, and charging scheduling strategy. Power distribution strategy refers to the power output strategy of each power source in the ship. Path planning strategy refers to the path or speed curve planned for the ship. Charging scheduling strategy refers to the charging port, charging time, and charging power determined for ships that need charging.

5. The ship cluster collaborative optimization method according to any one of claims 1 to 4, characterized in that, In step 3), the model parameters of each ship's local optimization model are updated to the validated global model parameters; and the method for validating the global model parameters is as follows: The optimal navigation strategy for each ship is determined based on the prediction results of the latest global ship optimization model. Obtain the MMG ship dynamics model and real-time ship environment data. Perform simulation calculations based on the obtained model and data to determine whether the navigation strategy generated by the ship's optimized global model meets the requirements. If it does, it indicates that the global model parameters have passed the verification. If it does not meet the requirements, it indicates that the global model parameters have failed the verification. Then, correct the hyperparameters of the ship's local model and re-execute step 1), or re-execute step 1) and adjust the aggregation weights when executing step 2) until the global model parameters pass the verification.

6. The ship cluster collaborative optimization method according to claim 5, characterized in that, The methods for determining the optimal navigation strategy for each ship based on the prediction results of the latest global ship optimization model include: The prediction results of the global ship optimization model are fed into a multi-objective optimization algorithm to solve the multi-objective optimization algorithm in order to find the optimal navigation strategy for each ship from different navigation strategies. Among them, the multi-objective optimization algorithm includes minimizing the total energy consumption of the ship formation, minimizing operating costs, and minimizing the task completion time; power allocation refers to allocating the output power of different power sources under a given ship speed; charging scheduling refers to the charging behavior, which includes charging start time, charging end time, charging power, and charging location.

7. The ship cluster collaborative optimization method according to claim 1, characterized in that, Ship status includes time-series data of the ship's three-axis acceleration and angular velocity; ship environment includes point cloud data of the ship's surrounding environment, RGB images of the ship's surrounding environment, and time-series data of depth images of the ship's surrounding environment.

8. The ship cluster collaborative optimization method according to claim 1, characterized in that, Calculate the hash value of the latest global model parameters and store it on the blockchain.

9. A ship swarm collaborative optimization system, comprising a processor, characterized in that, The processor executes a computer program to implement the steps of the method according to any one of claims 1 to 8.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 8.