A ship global path planning method

By combining a global path planning model with generative adversarial networks and multi-head attention mechanisms, and integrating electronic nautical charts and gridded static environmental images with multi-level navigation safety weights, a global path is generated and optimized. This solves the problems of rationality, feasibility, and stability of ship path planning in complex marine environments in existing technologies, thereby improving ship navigation safety.

CN122131758APending Publication Date: 2026-06-02NINGBO UNIV

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
NINGBO UNIV
Filing Date
2026-01-27
Publication Date
2026-06-02

AI Technical Summary

Technical Problem

Existing global path planning methods for ships lack the ability to integrate multiple factors, lack dynamic adjustment mechanisms, and fail to adequately consider physical constraints in complex maritime environments. This results in weak path rationality, poor practical feasibility, and insufficient stability, making it difficult to adapt to complex and dynamic marine environments and thus creating potential safety hazards for ships.

Method used

A global path planning model is adopted, which integrates conditional generative adversarial networks, Wasserstein generative adversarial networks with gradient penalties, and multi-head attention mechanism. Combined with electronic nautical charts and grid static environment images with multi-level navigation safety weights, a path search algorithm is used to generate and optimize global paths. Finally, smoothing is performed to ensure the rationality, feasibility and stability of the paths.

Benefits of technology

It enables the generation of reasonable, feasible, and stable global paths in complex marine environments, improving the safety of ship navigation, adapting to complex and dynamic marine environments, and ensuring the safety of ships.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122131758A_ABST
    Figure CN122131758A_ABST
Patent Text Reader

Abstract

This invention discloses a global path planning method for ships. In the sea area to be planned, a global path planning model that integrates conditional-generative adversarial networks, Wasserstein generative adversarial networks with gradient penalties, and multi-head attention mechanisms is used to generate predicted path information that conforms to historical navigation habits based on ship characteristics. Then, the predicted path information is converted into a predicted global path for the ship. Subsequently, a grid static environment image containing multi-level navigation safety weights is constructed. Next, guided by the predicted global path for the ship, a path search algorithm that integrates the costs of multiple navigation constraints using a cost function is used to search for a path in the grid static environment image to obtain the global path. Finally, the global path is smoothed to obtain the optimal global path. The advantages are that it can comprehensively improve the rationality, practical feasibility, and stability of the path, thereby adapting to complex and dynamic sea environments and better ensuring the safety of ship navigation in the sea environment.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to path planning methods, and more particularly to a global path planning method for ships. Background Technology

[0002] With the accelerating pace of global economic integration and the ever-expanding scale of international trade, ocean shipping, as the most important means of international trade, handles nearly 90% of global trade volume and plays a dual role as a key hub and last-mile delivery provider. To better fulfill its maritime transport responsibilities, ships are gradually developing towards intelligence and autonomy, and ship route planning, as the foundation for achieving ship intelligence, has become a research hotspot in academia.

[0003] Based on varying degrees of environmental information availability, ship path planning methods can be categorized into global path planning and local path planning. Global path planning involves finding an optimal path before the voyage begins, based on known static environmental information, to ensure the ship's safe and efficient journey from the port of origin to the port of destination. Local path planning, on the other hand, addresses dynamic obstacles encountered during navigation that were not included in the global plan. In such cases, the ship adjusts its path in real-time based on dynamic obstacle data received from sensors to avoid these obstacles. Research on global ship path planning plays a significant role in ensuring navigational safety and promoting the development of ship intelligence and autonomous navigation technologies.

[0004] Currently, global path planning methods for ships mainly focus on static environment modeling, forming static models, and solving for the optimal path in these static models using heuristic search algorithms. While these global path planning methods are effective in static scenarios, they suffer from several significant problems in actual shipping environments: (1) Lack of comprehensive consideration of key navigation factors: Key navigation constraints such as ship length, ship type, wind and waves, water depth, and traffic separation channels are ignored. This results in low utilization rates of the planned paths in actual navigation, or even lack of feasibility; (2) State space expansion problem: In complex navigation environments, path search needs to consider multiple variables, leading to rapid expansion of the state space, severely impacting the efficiency and scalability of the optimization algorithm; (3) Strong performance dependence of heuristic search algorithms: Traditional heuristic search algorithms (such as...) The search process heavily relies on the design of the heuristic function. If the heuristic function is inappropriate, the search process may deviate from the optimal solution or even get trapped in a local optimum.

[0005] To address the aforementioned issues, Zhen Rong et al. proposed a global ship path planning method in their paper "An Improved A-Star Ship Path-Planning Algorithm Considering Current, Water Depth, and Traffic Separation Rules," which considers water current, water depth, and traffic separation schemes (TSS). This method involves... The algorithm was improved, resulting in an improved version. The algorithm solves for the optimal path, achieving a balance between path length and navigation safety, reducing the risk of ship collisions and groundings, and contributing to improvement. The algorithm represents a significant advancement in the application of global path planning for ships. However, the simulation verification scenarios for this method are all relatively simple waterways, and simulation verification has not been conducted in complex TSS waterways (such as the Ningbo-Zhoushan Port and the Yangtze River Estuary). Furthermore, the influence of wind has not been considered, making it difficult to ensure its practical application in complex maritime environments.

[0006] Therefore, when solving the global path planning problem for ships in complex maritime environments, relying solely on static environment modeling and manually designed heuristic functions is insufficient to meet practical needs. The actual navigation trajectory of a ship in complex waters is influenced not only by static factors such as ship length and type, but also by a variety of dynamic factors, such as wind, current, water depth, and TSS (Total Safety Surface). Compared to relying on manually designed heuristic functions or rule logic, integrating real-time historical trajectory data can more accurately reflect real navigation behavior and environmental interaction patterns, and also provide more representative learning samples for the model, helping to improve the accuracy and adaptability of path planning. Based on this, modeling using historical trajectory data from the Automatic Identification System (AIS) has become a key direction for improving the intelligence level of global path planning for ships.

[0007] In their paper "A prediction model of vessel trajectory based on generative adversarial network," Wang Senjie et al. attempted to combine historical trajectory data from AIS with a deep learning model, introducing a generative adversarial network (GAN) model to learn complex real-world path distributions. However, traditional GAN ​​models struggle to capture the temporal series characteristics of trajectory data and the complex relationships between multiple factors, and suffer from drawbacks such as training instability, pattern collapse, and lack of generative controllability.

[0008] In summary, existing global path planning methods for ships still have prominent problems when facing real and complex maritime environments, such as a lack of ability to integrate multiple factors, a lack of dynamic adjustment mechanisms, and insufficient consideration of physical constraints. This results in weak path rationality, poor practical feasibility, and insufficient stability, making it difficult to adapt to complex and dynamic marine environments, and thus creating potential safety hazards for ships.

[0009] Therefore, there is an urgent need for a multi-module global ship path planning method that combines historical data-driven approaches with multiple physical constraints to comprehensively improve the rationality, feasibility, and stability of the path, and better ensure the navigation safety of ships in complex environments. Summary of the Invention

[0010] The technical problem to be solved by the present invention is to provide a global path planning method for ships that can comprehensively improve the rationality, practical feasibility and stability of the global path, thereby adapting to complex and dynamic marine environments and better ensuring the safety of ships navigating in marine environments.

[0011] The technical solution adopted by this invention to solve the above-mentioned technical problems is as follows: a global path planning method for ships. In the sea area to be planned, a global path planning model that integrates conditional-generative adversarial networks, Wasserstein generative adversarial networks with gradient penalties, and multi-head attention mechanism is used to generate predicted path information that conforms to historical navigation habits based on ship characteristics. Then, the predicted path information is converted into a predicted global path for the ship. Subsequently, based on the electronic nautical chart of the sea area to be planned, a grid static environment image containing multi-level navigation safety weights is constructed. Next, guided by the predicted global path for the ship, a path search algorithm that integrates multiple navigation constraint costs using a cost function is used to search for a path in the grid static environment image to obtain a global path. Finally, the global path is smoothed to obtain the optimal global path.

[0012] Compared with existing technologies, the advantages of this invention lie in its firstly utilizing a global path planning model that integrates conditional generative adversarial networks, Wasserstein generative adversarial networks with gradient penalties, and multi-head attention mechanisms. This model generates predicted path information based on ship characteristics, enabling global path planning to learn from historical navigation habits and laying the foundation for generating reasonable global path trends. Subsequently, a gridded static environment image containing multi-level navigation safety weights is constructed based on electronic nautical charts. Guided by the predicted global path of the ship, a path search algorithm that integrates various navigation constraints using a cost function is employed to optimize the search within this gridded static environment image. This path search algorithm is no longer... Instead of searching for a single shortest path, this approach integrates a cost function that incorporates multiple navigation constraints. During the search process, it considers various practical navigation requirements simultaneously, ensuring the feasibility of generating a global path. Finally, by smoothing the global path, a stable optimal global path is output. The overall global path planning, through a continuous process of "generation prediction - environment modeling - constraint optimization - smooth output," combines data-driven path generation capabilities with optimization search capabilities based on rigorous environmental models and multiple constraints. This results in a synergistic improvement in the rationality, feasibility, and stability of the planned global path, enabling it to better adapt to complex maritime environments and ensure navigation safety.

[0013] Furthermore, the predicted path information is a predicted global path RGB image; the predicted global path RGB image of the ship is inversely transformed into the predicted global path of the ship using the Gram Angular Difference Field (GADF) method; the predicted global path of the ship consists of multiple nodes arranged in chronological order of the ship's passage time, and each node is represented by its latitude and longitude coordinates.

[0014] Furthermore, the ship characteristics are a conditional vector consisting of the ship's length and hull type.

[0015] Furthermore, the global path planning model satisfies ship length, ship type, static navigation environment, and TSS, and is obtained by training the MHA-cWGAN-GP model. The MHA-cWGAN-GP model is obtained by combining a conditional generative adversarial network with a Wasserstein generative adversarial network with gradient penalty and introducing a multi-head attention mechanism. The training is performed using a training set, which is constructed as follows: First, obtain several historical ship trajectories from the start to the end point of the sea area to be planned; then, based on the historical trajectory, determine the ship length, ship type, and path RGB image of each ship, where the path RGB image of each ship is its true global path RGB image; next, use the ship length and ship type of each ship to construct its conditional vector; then, use the conditional vector of each ship and the true global path RGB image to construct a sample; finally, use all samples to construct the training set.

[0016] Furthermore, the MHA-cWGAN-GP model includes a generator and a discriminator; the generator includes a first fully connected layer and a first one-dimensional convolutional neural network layer; the first one-dimensional convolutional neural network layer includes a first one-dimensional convolutional layer Conv1D, a first multi-head attention mechanism, and three sequentially connected upsampling convolutional sub-networks, referred to as the first-level upsampling convolutional sub-network, the second-level upsampling convolutional sub-network, and the third-level upsampling convolutional sub-network, respectively; all three upsampling convolutional sub-networks are standard lightweight convolutional structures; the first multi-head attention mechanism is introduced between the one-dimensional upsampling operator inside the first-level upsampling convolutional sub-network and its subsequent one-dimensional convolutional operator, so that the one-dimensional upsampling operator inside the first-level upsampling convolutional sub-network and its subsequent one-dimensional convolutional operator... The integration operators are no longer directly connected, but are connected through the first multi-head attention mechanism, which enhances the global modeling capability of the first one-dimensional convolutional neural network layer for initial features. Both the second-level upsampled convolutional sub-network and the third-level upsampled convolutional network are used to achieve efficient feature decoding and image reconstruction. The first fully connected layer is connected to the first-level upsampled convolutional network. The first one-dimensional convolutional layer (Conv1D) is connected to the third-level upsampled convolutional network. The first fully connected layer is used to convert its input data into data suitable for the dimension of the first-level upsampled convolutional network and output it to the first-level upsampled convolutional network. When training the MHA-cWGAN-GP model, the input data of the first fully connected layer is the sample data, and the trained MHA-cWGAN-GP model is used as the input data. When the model, i.e., the global path planning model, performs path prediction, the input data of the first fully connected layer is the condition vector of the ship whose path is to be planned; the first-level upsampling convolutional subnetwork is used to upsample the data output from the first fully connected layer to it, and the first-level upsampled features are output to the second-level upsampling convolutional subnetwork. The second-level upsampling convolutional subnetwork is used to upsample the first-level upsampled features output from the first-level upsampling convolutional subnetwork to it, and the second-level upsampled features are output to the third-level upsampling convolutional subnetwork. The network is used to upsample the second-level upsampled features output from the second-level upsampled convolutional sub-network to obtain third-level upsampled features, which are then output to the first one-dimensional convolutional layer Conv1D. The first one-dimensional convolutional layer Conv1D is used to perform convolutional mapping on the third-level upsampled features to generate a predicted global path RGB image output for the ship. The discriminator includes a second one-dimensional convolutional neural network layer and a second fully connected layer. The second one-dimensional convolutional neural network layer includes a second one-dimensional convolutional layer Conv1D, a second multi-head attention mechanism, and a three-level downsampled convolutional sub-network connected in series.The three-level downsampling convolutional subnetworks are all standard lightweight convolutions, consisting of a first-level downsampling convolutional subnetwork, a second-level downsampling convolutional subnetwork, and a third-level downsampling convolutional subnetwork, respectively. A second multi-head attention mechanism is introduced between the one-dimensional downsampling operator and its subsequent one-dimensional convolutional operator within the first-level downsampling convolutional subnetwork. This eliminates the direct connection between the one-dimensional downsampling operator and its subsequent one-dimensional convolutional operator; instead, the connection is achieved through the second multi-head attention mechanism, which enhances the global modeling capability of the discriminative features of the second one-dimensional convolutional neural network layer. The third-level downsampling convolutional subnetwork is connected to the second one-dimensional convolutional layer (Conv1D), and the second one-dimensional convolutional layer (Conv1D) is connected to the second fully connected layer. This is applied to the MHA-cWGAN-GP... During model training, the first-level downsampling convolutional network downsamples the input data to obtain a first-level downsampled feature sequence, which is then output to the second-level downsampling convolutional network. The input data for the first-level downsampling convolutional network consists of the ship's true global path RGB image, the predicted global path RGB image, and a conditional vector. The second-level downsampling convolutional network downsamples the first-level downsampled feature sequence to generate a second-level downsampled feature sequence, which is then output to the third-level downsampling convolutional network. The third-level downsampling convolutional network downsamples the second-level downsampled feature sequence to generate a third-level downsampled feature sequence, which is then output to the second one-dimensional convolutional layer (Conv1D). The second one-dimensional convolutional layer (Conv1D) performs local feature extraction and channel mapping / fusion on the third-level downsampled feature sequence to generate high-dimensional discriminative features, which are then output to the second fully connected layer. The second fully connected layer fuses and discriminates the high-dimensional features output from the second one-dimensional convolutional layer (Conv1D) to obtain a judgment result indicating whether the predicted path RGB image of the ship is true or false.

[0017] Furthermore, the specific process of training the MHA-cWGAN-GP model to obtain the global path planning model is as follows: Step A: Construct the AIS trajectory sample set. The specific process is as follows: Step A1: Extract the trajectory data of all vessels whose navigation paths run from the starting point to the end point of the planned route area from the AIS data of the most recent month in the sea area to be planned. The trajectory data of each vessel includes the vessel length, vessel type, Maritime Mobile Service Identifier (MMSI), and all trajectory point data. Each trajectory point data includes the timestamp, latitude and longitude, speed, and course of that trajectory point. Record the total number of all vessels as follows: a ; Step A2: Construct the AIS trajectory sample set T, specifically as follows: A2.1. Preprocess the trajectory point data of each ship separately. Specifically, iterate through each trajectory point data and remove trajectory point data with zero speed or abnormal position change. Abnormal position change means that the speed of a certain trajectory point relative to its previous trajectory point data exceeds the normal speed range of the ship based on the displacement and time difference between the two. A2.2 Sort all remaining trajectory point data of each ship after preprocessing according to the order of timestamps to obtain the trajectory point sequence of each ship. Take the first trajectory point in the trajectory point sequence of each ship as its starting trajectory point and the last trajectory point as its ending trajectory point. A2.3. Using the coordinates of the starting point and the ending point of the sea area to be planned as the center, delineate a circle with a radius of 5 miles near the starting point and the ending point respectively; A2.4, will a Among the vessels, those whose starting trajectory point is located within a circle near the starting point and whose ending trajectory point is located within a circle near the ending point are considered target vessels, and the number of target vessels is recorded as follows: b ; Step A3: Compress the trajectory point sequence of each target ship using the Douglas-Peucker algorithm to obtain its compressed trajectory point sequence; b The compressed trajectory point sequence of the target vessel constitutes the trajectory sample set. T 1; Step A4: Based on the ship's length, classify the ships into three categories: small ships, medium ships, and large ships. Ships with a length less than 24m are considered small ships, ships with a length greater than or equal to 24m but less than 200m are considered medium ships, and ships with a length greater than or equal to 200m are considered large ships. Small ships are represented by a single-hot vector [1,0,0], medium ships by a single-hot vector [0,1,0], and large ships by a single-hot vector [0,0,1]. For each target ship, first determine its corresponding single-hot vector based on its length category, using this vector to represent its length. Then, use single-hot encoding to convert its ship type into a single-hot vector, using this vector to represent its ship type. Finally, concatenate the single-hot vector representing the ship's length and the single-hot vector representing the ship type to obtain its conditional vector. Step A5: Use the GADF method to process the trajectory sample set. T In step 1, the compressed trajectory point sequence of each target ship is converted into a path RGB image, which is its true global path RGB image; Step B: Construct a sample from the conditional vector of each target vessel and the true global path RGB image; use all samples to form a training set; use this training set to train the MHA-cWGAN-GP model, specifically as follows: Step B1: Set the following training parameters: minibatch size is 32; learning rate is 0.0001; activation function for calculating negative values ​​is LeakyReLU with a slope alpha of 0.2, random dropout of 0.3, and batch normalization momentum of 0.8; the discriminator of the MHA-cWGAN-GP model is trained 5 times, and the generator is trained once. During training, the Frachert distance (FID) and maximum mean difference (MMD) are used to evaluate the predicted global path RGB image output by the MHA-cWGAN-GP model. Step B2: Under the set training parameters, train the MHA-cWGAN-GP model using the training set until it meets the preset prediction accuracy requirements to obtain the global path planning model.

[0018] Furthermore, based on the electronic nautical chart of the sea area to be planned, the specific process of constructing a gridded static environment image containing multi-level navigation safety weights is as follows: First, extract all static obstacle information from the S-57 nautical chart and visualize it to obtain a static environment image containing all static obstacle information; then, perform grid processing on the static environment image to divide it into several grids to form a gridded static environment image; then, determine the navigation safety weight of each grid based on whether there are static obstacles in each grid and its adjacent grids in the gridded static environment image.

[0019] Furthermore, the specific method for determining the navigation safety weight of a certain grid is as follows: if the grid has static obstacles, it is considered a non-navigable grid, and its navigation safety weight is set to 0; if the grid does not have static obstacles, it is considered a navigable grid. In this case, first determine the number of its surrounding adjacent grids, and record this number as P1. Then count the number of non-navigable grids among the P1 adjacent grids, and record this number as P2. Finally, use the formula P3 = (P1 - P2) / P1 to calculate the navigation safety weight P3 of the grid.

[0020] Furthermore, the path search algorithm is an improvement Algorithm, the improvement The algorithm, through the The algorithm was improved, specifically as follows: 1. [The algorithm was modified to...] The algorithm's cost function is improved as follows: The cost function is changed from simple distance accumulation to a weighted sum of remaining range and comprehensive constraint costs. The remaining range is accumulated based on distance constraints. The comprehensive constraint costs are determined based on distance constraints, safety constraints, lane separation constraints, water depth constraints, and wind and current constraints. Safety constraints are determined by navigation safety weights; lane separation constraints are determined based on the consistency of the main channel's course; water depth constraints are determined based on the maximum permissible draft; and wind and current constraints are determined based on the time-related costs caused by wind and current. Secondly, the search strategy is changed to an 8-neighborhood search strategy.

[0021] Furthermore, the improvements The cost function of the algorithm is shown in Equation (1): (1) in, N [ i ] represents the first planned path i 1 node i =1, 2, 3, ..., n , n This represents the total number of nodes in the planned path; F ( N [ i ])express N [ i The cost of ]; h ( N [ i ]) yes N [ i ]arrive N [ n The remaining range cost, G ( N [ i ]) express N [ i The comprehensive constraint cost; α These are constant coefficients used for balancing. G ( N [ i ]) and h ( N [ i The weights between ]) are taken from a value greater than 0 and less than 1, based on actual usage requirements; h ( N [ i ])and G ( N [ i The calculation formulas are as shown in formulas (2) and (3) respectively; (2) (3) in, ( x i , y i ) for N [ i The location coordinates of ] x i Longitude y i Latitude; β This is a constant coefficient, and its value is taken within the range of greater than 0 and less than 1, depending on the actual usage requirements. g ( N [ i ])yes N [ i The cost of navigation under distance constraints D ( i )yes N [ i The cost of navigation under safety constraints l total ( N [ i ])for N [ i Navigation costs under the overall constraints of TSS, water depth, and wind flow; g ( N [ i The calculation formulas are shown in formulas (4) and (5). D ( i The calculation method is shown in formula (6). l total ( N [ i The calculation method is shown in formula (7): (4) (5) (6) (7) in, w i+1 For nodes N [ i +1] navigation safety weight, l tra ( N [ i ])for N [ i The cost of navigation under TSS constraints. l depth ( N [ i ])for N [i Navigation costs under water depth constraints l wc ( N [ i ])for N [ i The cost of navigation under wind and current constraints; l tra ( N [ i The calculation method is shown in formula (8). l depth ( N [ i The calculation method is shown in formulas (9) and (10). l wc ( N [ i The calculation method is shown in formulas (11)-(14): (8) (9) (10) (11) (12) (13) (14) in, θ sep This specifies the direction of the TSS-corresponding waterway, and this specified direction points to true north. θ ship The vector represents instantaneous velocity, and inf denotes infinity. Depth ( i )yes N [ i The water depth at that location, S max It is the maximum draft of the ship. It is the maximum sinking of the ship at its current speed. L It is the length of the ship. θ max It is the ship's maximum pitch angle. It is the average draft of the ship under the current mission load; e enc This is the calculation error, used to compensate for uncertainties such as water depth measurement errors and the maximum draft error of ships. Generally, the vertical accuracy of water depth data is about ±0.2 m, with a certain safety margin reserved, which is taken as 0.3 m here. v '( iFor ships in N [ i The speed of the ship is affected by the combined effects of wind and water currents. v ( i For ships in N [ i The speed vector of a ship in still water. For ships in N [ i The vector of speed change relative to still water under the combined influence of wind and water current. Calculate the symbol for the vector norm; M ship For the mass of the ship's rigid hull, This indicates the disturbance force of wind on a ship. This indicates the disturbance force exerted on a ship by the water flow; air density, The density of seawater; The area projected onto the wind surface above the water level. The side projection area of ​​the wind above the water surface; For along Wind load coefficient decomposed by direction (X direction is along the bow-stern direction, positive direction points to the bow), For along Wind load coefficient decomposed by direction (Y direction is along the transverse direction of the ship, positive direction points to starboard); For nodes The angle between the wind direction and the bow direction; For nodes The current wind speed relative to the current speed of the ship; The area of ​​the water flow below the water surface is the projected area. The lateral projected area of ​​the water flow below the water surface; The lower edge of the water flow Load factor decomposed by direction (X direction is along the bow-stern direction, positive direction points to the bow), The lower edge of the water flow Load factor decomposed in direction (Y direction is along the transverse direction of the ship, positive direction points to starboard); For nodes The angle between the current current direction and the current bow direction; For nodes The relative speed of the current water flow to the current speed of the ship.

[0022] Furthermore, the aforementioned improvements are adopted. The algorithm performs path search in the grid static environment image to obtain the global path. The specific process is as follows: the predicted global path of the ship is stored in the improved... In the algorithm's OpenList, each node in the predicted global path of the ship, except for the start and end points, is taken as the current node. The eight neighboring grids around each current node are taken as its candidate nodes. For each current node, the following operations are performed: calculate the cost function value of the current node and its eight candidate nodes; if there is a candidate node whose cost function value is lower than that of the current node, then update the current node in the predicted global path of the ship in the OpenList with the candidate node with the lowest cost function value; after traversing all current nodes, the predicted global path of the ship in the OpenList is the global path.

[0023] Furthermore, the smoothing process uses B-spline interpolation. Attached Figure Description

[0024] Figure 1 This is a framework diagram of the ship global path planning method of the present invention; Figure 2 A flowchart for generating a ship's predicted global path using the ship global path planning method of the present invention; Figure 3 The present invention provides a flowchart of the ship global path planning method for generating the optimal global path of a ship based on the predicted global path of the ship. Figure 4 AIS trajectory density map for a selected area of ​​Ningbo-Zhoushan Port; Figure 5 A visualization of the AIS trajectory sample set T constructed based on AIS trajectories in a selected area of ​​Ningbo-Zhoushan Port; Figure 6 This is a schematic diagram of 12 real global path RGB images selected from the real global path RGB images of a selected area in Ningbo-Zhoushan Port. Figure 7 A schematic diagram illustrating the predicted global paths of ships in the selected area of ​​Ningbo-Zhoushan Port; Figure 8 This is a schematic diagram of a grid-based static environment image containing multi-level navigation safety weights, constructed based on electronic nautical charts of a selected area in the Ningbo-Zhoushan Port region. Figure 9 A schematic diagram of wind field data for a selected area of ​​Ningbo-Zhoushan Port as of November 1, 2025; Figure 10 A schematic diagram of the flow field data for a selected area of ​​Ningbo-Zhoushan Port on November 1, 2025; Figure 11 The optimal global path diagram for ships is obtained in the selected area of ​​Ningbo-Zhoushan Port. Detailed Implementation

[0025] The present invention will be further described in detail below with reference to the accompanying drawings and embodiments.

[0026] Example 1: A global path planning method for ships, comprising the following steps: Step 1: Combine Conditional Generative Adversarial Network (c-GAN) with Wasserstein Generative Adversarial Network with Gradient Penalty (WGAN-GP) and introduce Multi-Head Attention (MHA) mechanism to obtain the MHA-cWGAN-GP model. Step 2: Obtain several historical ship trajectories from the starting point to the ending point of the sea area to be planned. Based on these historical trajectories, determine the ship length, ship type, and path RGB image of each ship. The path RGB image of each ship is its true global path RGB image. Use the ship length and ship type of each ship to construct its condition vector. Use the condition vector of each ship and the true global path RGB image to construct a sample. Use all samples to construct a training set. Use this training set to train the MHA-cWGAN-GP model to obtain the global path planning model. Step 3: Use a global path planning model to predict the global path. Specifically, use the length and type of the ship to be planned to form its condition vector. Input the condition vector into the global path planning model. The global path planning model outputs the RGB image of the predicted global path of the ship. Step 4: Use the GADF method to inversely transform the RGB image of the ship's predicted global path into the ship's predicted global path. The ship's predicted global path consists of multiple nodes arranged in chronological order of the ship's passage time, and each node is represented by its latitude and longitude coordinates. Step 5: Perform static environment modeling for the sea area to be planned. Specifically, first, extract all static obstacle information from the S-57 nautical chart and visualize it to obtain a static environment image containing all static obstacle information; then, perform grid processing on the static environment image to divide it into several grids, forming a gridded static environment image; then, determine the navigation safety weight of each grid based on whether there are static obstacles in each grid and its adjacent grids in the gridded static environment image; the specific method for determining the navigation safety weight of a grid is as follows: if the grid has static obstacles, it is considered a non-navigable grid, and its navigation safety weight is set to 0; if the grid does not have static obstacles, it is considered a navigable grid. In this case, first determine the number of its surrounding adjacent grids, record this number as P1, and count the number of non-navigable grids among the P1 adjacent grids, record this number as P2, and then use the formula P3 = (P1 - P2) / P1 to calculate the navigation safety weight P3 of the grid; Step 6, for The algorithm was improved, resulting in an improved version. The algorithm is improved as follows: 1. The cost function is improved by changing the cost from simple distance accumulation to a weighted sum of remaining range and comprehensive constraint cost; whereby the remaining range is accumulated based on distance constraints; the comprehensive constraint cost is determined based on distance constraints, safety constraints, lane separation constraints, water depth constraints, and wind and current constraints: safety constraints are determined by navigation safety weights; lane separation constraints are determined based on the consistency of the main channel heading; water depth constraints are determined based on the maximum allowable draft; and wind and current constraints are determined based on the time-related costs caused by wind and current. 2. The search strategy is changed to an 8-neighborhood search strategy. Step 7: Input the predicted global path of the ship into the improvement system. Algorithm, Improvement The algorithm performs path search in a grid static environment image to obtain a global path, and then uses B-spline interpolation to smooth the global path to obtain the optimal global path.

[0027] In this embodiment, the specific process of training the MHA-cWGAN-GP model to obtain the global path planning model is as follows: Step A: Construct the AIS trajectory sample set. The specific process is as follows: Step A1: Extract the trajectory data of all vessels whose navigation paths run from the starting point to the end point of the planned route area from the AIS data of the most recent month in the sea area to be planned. The trajectory data of each vessel includes the vessel length, vessel type, MMSI, and all trajectory point data. Each trajectory point data includes the timestamp, latitude and longitude, speed, and course. The total number of all vessels is recorded as follows: a ; Step A2: Construct the AIS trajectory sample set T, specifically as follows: A2.1. Preprocess the trajectory point data of each ship separately. Specifically, iterate through each trajectory point data and remove trajectory point data with zero speed or abnormal position change. Abnormal position change means that the speed of a certain trajectory point relative to its previous trajectory point data exceeds the normal speed range of the ship based on the displacement and time difference between the two. A2.2 Sort all remaining trajectory point data of each ship after preprocessing according to the order of timestamps to obtain the trajectory point sequence of each ship. Take the first trajectory point in the trajectory point sequence of each ship as its starting trajectory point and the last trajectory point as its ending trajectory point. A2.3. Using the coordinates of the starting point and the ending point of the sea area to be planned as the center, delineate a circle with a radius of 5 miles near the starting point and the ending point respectively; A2.4, will aAmong the vessels, those whose starting trajectory point is located within a circle near the starting point and whose ending trajectory point is located within a circle near the ending point are considered target vessels, and the number of target vessels is recorded as follows: b ; Step A3: Compress the trajectory point sequence of each target ship using the Douglas-Peucker algorithm to obtain its compressed trajectory point sequence; b The compressed trajectory point sequence of the target vessel constitutes the trajectory sample set. T 1; Step A4: Based on the ship's length, classify the ships into three categories: small ships, medium ships, and large ships. Ships with a length less than 24m are considered small ships, ships with a length greater than or equal to 24m but less than 200m are considered medium ships, and ships with a length greater than or equal to 200m are considered large ships. Small ships are represented by a single-hot vector [1,0,0], medium ships by a single-hot vector [0,1,0], and large ships by a single-hot vector [0,0,1]. For each target ship, first determine its corresponding single-hot vector based on its length category, using this vector to represent its length. Then, use single-hot encoding to convert its ship type into a single-hot vector, using this vector to represent its ship type. Finally, concatenate the single-hot vector representing the ship's length and the single-hot vector representing the ship type to obtain its conditional vector. Step A5: Use the GADF method to process the trajectory sample set. T In step 1, the compressed trajectory point sequence of each target ship is converted into a path RGB image, which is its true global path RGB image; Step B: Construct a sample from the conditional vector of each target vessel and the true global path RGB image; use all samples to form a training set; use this training set to train the MHA-cWGAN-GP model. The specific process is as follows: Step B1: Set the following training parameters: minibatch size is 32; learning rate is 0.0001; activation function for negative values ​​is LeakyReLU with slope alpha of 0.2, dropout of 0.3, and batch normalization momentum of 0.8; the discriminator of the MHA-cWGAN-GP model is trained 5 times, and the generator is trained once. During training, the Frachert distance (FID) and maximum mean difference (MMD) are used to evaluate the predicted global path RGB image output by the MHA-cWGAN-GP model. Step B2: Under the set training parameters, train the MHA-cWGAN-GP model using the training set until it meets the preset prediction accuracy requirements to obtain the global path planning model.

[0028] like Figure 1As shown, the ship global path planning method in this embodiment constructs a hybrid planning framework that can learn from historical data and strictly adhere to nautical physics and rule constraints by building a data-driven initial global path generation module and a path optimization module under multiple physical constraints. In the data-driven initial global path generation module, the MHA-cWGAN-GP model is constructed and AIS trajectory features are extracted. This ensures that the global path planning model obtained after training the MHA-cWGAN-GP model satisfies ship length, ship type, static navigation environment, and TSS, generating a predicted global path RGB image (i.e., the initial global path) associated with specific ship characteristics. This ensures that the initial global path generation is not random or universal, but rather encodes the differences in navigation operation characteristics of different ship types and scales, as well as the macroscopic channel experience contained in historical trajectories. Subsequently, through the inverse transformation of the GADF method, the image information (i.e., the predicted global path RGB image) is restored to a node sequence with latitude and longitude coordinates (i.e., the ship's trajectory point sequence), providing a path skeleton with preliminary rationality and personalization for subsequent optimization. In the path optimization module under multiple physical constraints, through... The fundamental improvement to the algorithm involves reconstructing its cost function and search strategy. Path search is transformed from a simple distance minimization problem into a decision-making process seeking comprehensive optimality under multi-dimensional constraints. The cost function is explicitly defined as the weighted sum of the remaining voyage accumulated based on distance constraints and the comprehensive constraint costs determined by distance, safety, lane separation, water depth, and wind current constraints. This achieves the construction of a cost function under multiple physical constraints. Specifically, the safety constraint is directly determined by the navigation safety weights assigned after extraction and gridding from the S-57 nautical chart. Lane separation, water depth, and wind current constraints are quantified based on the consistency of the main channel heading, the maximum allowable draft, and the time-related costs caused by wind and current, respectively. These improvements enable the algorithm to achieve better performance. When searching in a grid-based static environment image, the algorithm can simultaneously consider collision avoidance safety, navigation rule compliance, ship physical limitations, and dynamic environmental benefits, thereby outputting a global path that is truly highly feasible in complex static environments.

[0029] Therefore, the ship global path planning method in this embodiment first uses the trained MHA-cWGAN-GP model, i.e., the global path planning model, to generate a predicted global path, and then uses it as input data to guide the improvement. The algorithm searches in a gridded static environment image and uses B-spline interpolation for smoothing, forming a complementary and synergistic system. The global path planning model is responsible for providing a prior path that integrates historical experience and individual characteristics, effectively limiting the solution space range of the optimization search and improving computational efficiency; while the improved Building upon this foundation, the algorithm leverages its precise multi-constraint quantification architecture to perform local corrections and feasibility enhancements on the global path, ensuring the final optimal global path's strong adaptability to complex and rule-critical marine environments. This embodiment's global path planning method architecture utilizes both the knowledge extraction capabilities of data-driven methods and ensures the interpretability and constraint satisfaction reliability of model-based methods. Overall, it achieves a comprehensive improvement in the rationality, feasibility, and stability of global path planning, thereby enabling it to adapt to complex and dynamic marine environments and better guarantee the safety of ship navigation in such environments.

[0030] Example 2: This example is basically the same as Example 1, except that in this example, as... Figure 2As shown, the MHA-cWGAN-GP model includes a generator and a discriminator. The generator consists of a first fully connected layer and a first one-dimensional convolutional neural network layer. The first one-dimensional convolutional neural network layer includes a first one-dimensional convolutional layer Conv1D (abbreviated as: first Conv1D), a first multi-head attention mechanism, and three sequentially connected upsampling convolutional sub-networks, referred to as the first-level upsampling convolutional sub-network (abbreviated as: first-level upsampling), the second-level upsampling convolutional network (abbreviated as: second-level upsampling), and the third-level upsampling convolutional network (abbreviated as: third-level upsampling). All three upsampling convolutional sub-networks are standard lightweight convolutional structures. The first multi-head attention mechanism is introduced into the first-level upsampling layer. The one-dimensional upsampling operator within the first-level upsampling layer is no longer directly connected to its subsequent one-dimensional convolution operator. Instead, they are connected through a first multi-head attention mechanism, which enhances the global modeling capability of the first one-dimensional convolutional neural network layer for initial features. The second and third levels of upsampling are used for efficient feature decoding and image reconstruction. The first fully connected layer is connected to the first-level upsampling layer. The first Conv1D layer is connected to the third-level upsampling layer. The first fully connected layer converts its input data into data suitable for the dimension of the first-level upsampling layer and outputs it to the first-level upsampling layer. When training the MHA-cWGAN-GP model, the input data of the first fully connected layer is the sample data. After training the MHA-cWGAN-GP model... When the model, i.e., the global path planning model, performs path prediction, the input data of the first fully connected layer is the condition vector of the ship to be planned. The first-level upsampling is used to upsample the data output from the first fully connected layer to its location, and the resulting first-level upsampled features are output to the second-level upsampling. The second-level upsampling is used to upsample the first-level upsampled features output from the first-level upsampling to its location, and the resulting second-level upsampled features are output to the third-level upsampling. The third-level upsampling is used to upsample the second-level upsampled features output from the second-level upsampling to its location, and the resulting third-level upsampled features are output to the first Conv1D. The first Conv1D... The discriminator is used to perform convolutional mapping on the features after the third-level upsampling to generate a predicted global path RGB image output for the ship. The discriminator includes a second one-dimensional convolutional neural network layer and a second fully connected layer. The second one-dimensional convolutional neural network layer includes a second one-dimensional convolutional layer Conv1D (abbreviated as: second Conv1D), a second multi-head attention mechanism, and a three-level downsampling convolutional sub-network connected in series. The three-level downsampling convolutional sub-networks are all standard lightweight convolutions, namely the first-level downsampling convolutional sub-network (abbreviated as: first downsampling), the second-level downsampling convolutional network (abbreviated as: second downsampling), and the third-level downsampling convolutional network (abbreviated as: third downsampling).A second multi-head attention mechanism is introduced between the one-dimensional downsampling operator within the first-level downsampling layer and its subsequent one-dimensional convolutional operator. This eliminates the direct connection between the one-dimensional downsampling operator and its subsequent convolutional operator, instead connecting them through the second multi-head attention mechanism. This second multi-head attention mechanism enhances the global modeling capability of the discriminative features of the second one-dimensional convolutional neural network layer. The third-level downsampling layer is connected to the second Conv1D layer, which in turn is connected to the second fully connected layer. This applies to MHA-cWGAN-GP. During model training, the first-level downsampling downsamples the input data to obtain a first-level downsampled feature sequence, which is then output to the second-level downsampling. The input data for the first-level downsampling includes the ship's true global path RGB image, the predicted global path RGB image, and a conditional vector. The second-level downsampling downsamples the first-level downsampled feature sequence to generate a second-level downsampled feature sequence, which is then output to the third-level downsampling. The third-level downsampling downsamples the second-level downsampled feature sequence to generate a third-level downsampled feature sequence, which is then output to the second Conv1D. The second Conv1D performs local feature extraction and channel mapping / fusion on the third-level downsampled feature sequence to generate high-dimensional discriminative features, which are then output to the second fully connected layer. The second fully connected layer fuses and discriminates the high-dimensional features output from the second Conv1D, resulting in a judgment result indicating whether the predicted path RGB image of the ship is true or false.

[0031] Example 3: This example is basically the same as Example 2, except that in this example, improvements are made. The cost function of the algorithm is shown in Equation (1): (1) in, N [ i ] represents the first planned path i 1 node i =1, 2, 3, ..., n , n This represents the total number of nodes in the planned path; F ( N [ i ])express N [ i The cost of ]; h ( N [ i ]) yes N [ i ]arrive N [ n The remaining range cost, G ( N [ i ]) express N [i The comprehensive constraint cost; α These are constant coefficients used for balancing. G ( N [ i ]) and h ( N [ i The weights between ]) are taken from a value greater than 0 and less than 1, based on actual usage requirements. h ( N [ i ])and G ( N [ i The calculation formulas are as shown in formulas (2) and (3) respectively; (2) (3) in, ( x i , y i ) for N [ i The location coordinates of ] x i Longitude y i Latitude; β This is a constant coefficient, and its value is taken within the range of greater than 0 and less than 1, depending on the actual usage requirements. g ( N [ i ])yes N [ i The cost of navigation under distance constraints D ( i )yes N [ i The cost of navigation under safety constraints l total ( N [ i ])for N [ i Navigation costs under the overall constraints of TSS, water depth, and wind flow; g ( N [ i The calculation formulas are shown in formulas (4) and (5). D ( i The calculation method is shown in formula (6). l total ( N [ i The calculation method is shown in formula (7): (4) (5) (6) (7) in, w i+1 For nodes N [ i +1] navigation safety weight, l tra ( N [ i ])for N [ i The cost of navigation under TSS constraints. l depth ( N [ i ])for N [ i Navigation costs under water depth constraints l wc ( N [ i ])for N [ i The cost of navigation under wind and current constraints; l tra ( N [ i The calculation method is shown in formula (8). l depth ( N [ i The calculation method is shown in formulas (9) and (10). l wc ( N [ i The calculation method is shown in formulas (11)-(14): (8) (9) (10) (11) (12) (13) (14) in, θ sep This specifies the direction of the TSS-corresponding waterway, and this specified direction points to true north. θ ship The vector represents instantaneous velocity, and inf denotes infinity. Depth ( i )yes N [ i The water depth at that location, S max It is the maximum draft of the ship. It is the maximum sinking of the ship at its current speed. L It is the length of the ship. θ max It is the ship's maximum pitch angle. It is the average draft of the ship under the current mission load; e enc This is the calculation error, used to compensate for uncertainties such as water depth measurement errors and the maximum draft error of ships. Generally, the vertical accuracy of water depth data is about ±0.2 m, with a certain safety margin reserved, which is taken as 0.3 m here. v '( i For ships in N [ i The speed of the ship is affected by the combined effects of wind and water currents. v ( i For ships in N [ i The speed vector of a ship in still water. For ships in N [ i The vector of speed change relative to still water under the combined influence of wind and water current. Calculate the symbol for the vector norm; M ship For the mass of the ship's rigid hull, This indicates the disturbance force of wind on a ship. This indicates the disturbance force exerted on a ship by the water flow; air density, The density of seawater; The area projected onto the wind surface above the water level. The side projection area of ​​the wind above the water surface; For along Wind load coefficients decomposed by direction For along Wind load coefficients decomposed by direction; For nodes The angle between the wind direction and the bow direction; For nodes The current wind speed relative to the current speed of the ship; The area of ​​the water flow below the water surface is the projected area. The lateral projected area of ​​the water flow below the water surface; The lower edge of the water flow Load factor of directional decomposition The lower edge of the water flow Load factor of directional decomposition; For nodes The angle between the current current direction and the current bow direction; For nodes The relative speed of the current water flow to the current speed of the ship.

[0032] In this embodiment, as Figure 3 As shown, an improved The algorithm performs path search in a grid-based static environment image to obtain the global path. The specific process is as follows: the predicted global path of the ship is stored in the improved... In the algorithm's OpenList, each node in the predicted global path of the ship, except for the start and end points, is then taken as the current node. The eight neighboring grids around each current node are taken as its candidate nodes. For each current node, the following operations are performed: calculate the cost function value of the current node and its eight candidate nodes; if there is a candidate node whose cost function value is lower than that of the current node, then update the current node in the predicted global path of the ship in the OpenList with the candidate node with the lowest cost function value; after traversing all current nodes, the predicted global path of the ship in the OpenList is the global path.

[0033] To verify the performance of the ship global path planning method of this invention, the MHA-cWGAN-GP model was implemented in PyTorch. The platform was a Microsoft Windows 11 desktop computer with an Intel(R) Core(TM) i9-14900KF processor (3.20 GHz) and an NVIDIA GeForce RTX 4080 Super GPU. The MHA-cWGAN-GP model was trained for 10,000 iterations using the RMSprop optimizer. During training, the learning rate was set to 0.0001, and the minibatch size was 32. To handle negative activation values, the LeakyReLU activation function was used, with a leakage slope of 0.2. Dropout (dropout rate of 0.3) was used, and the momentum parameter for batch normalization was set to 0.8. To ensure the stability of adversarial training, a common practice in WGAN series methods is adopted: for every generator update, the discriminator is updated 5 times to achieve a balance between convergence speed and gradient quality. The MHA-cWGAN-GP model, after training, yields a global path planning model. Further improvements are needed. In the algorithm, the ship's still water speed is set to 10 knots. To improve the authenticity and effectiveness of the global path planning evaluation, authoritative environmental data is introduced: wind field data comes from the Climate Prediction System Version 2 (CFSv2) of the National Center for Environmental Prediction (NCEP); ocean current data comes from the coupled product of Hybrid Coordinate Ocean Model (HYCOM) and Naval Coupled Oceanographic Data Assimilation System (NCODA); the update cycle for both types of data is 3 hours; the weighting coefficients in equations (1) and (3) are... and The values ​​are set to 0.2 and 0.5 respectively to balance navigation efficiency and safety under dynamic ocean conditions; in formula (10) e enc A margin of 0.3m is used to compensate for uncertainties such as water depth measurement errors and the maximum draft error of the vessel. The vertical accuracy of general water depth data is approximately ±0.2m, with a certain safety margin reserved. Other environmental load parameters are summarized in Table 1. It should be noted that in practical applications, the parameters required for the global path planning method of this invention should be set based on the latest authoritative environmental data, vessel design parameters, and actual application requirements.

[0034] Table 1: Environmental load parameter settings in the simulation environment

[0035] Select AIS data from Ningbo-Zhoushan Port in October 2025. The AIS trackpoint density distribution map after preprocessing in step A2.1 is shown below. Figure 4 As shown; the sea area to be planned is from the entrance of the Xiazhimen Channel to the Beilun Port area. This sea area is defined as a rectangle: upper left corner (121°50.9337′E, 29°58.9282′N), lower right corner (121°54.6937′E, 29°55.3902′N). The entrance of the Xiazhimen Channel is set as the starting point, and Beilun Port as the ending point. The coordinates of the starting point are (122°21′33″E, 29°43′57″N), and the coordinates of the ending point are (121°51′03″E, 29°56′52″N). Based on steps A1 and A2, an AIS trajectory sample set T is constructed for this sea area to be planned, and the AIS trajectory sample set T is visualized, as shown below. Figure 5 As shown. Following step A3, the AIS trajectory sample set T is compressed to form a trajectory sample set. T 1. Based on step A4, construct the ship's conditional vector, and based on step A5, construct the true global path RGB image. Then, randomly select 12 true global path RGB images for visualization, such as... Figure 6 As shown.

[0036] A cargo ship with a length of 158 m was selected for the experiment. The main parameters of the ship (i.e., the cargo ship) are shown in Table 2.

[0037] Table 2: Main Parameters of the Ship

[0038] First, a global path planning model is used to generate a predicted global path RGB image for the ship. Then, the GADF method is used to inversely transform this predicted global path RGB image into a predicted global path for the ship. Figure 7 The black curve in the diagram is shown. Analysis. Figure 7 It can be seen that the predicted global path of the ship is in Figure 7 The area in region A does not fully conform to the TSS and requires further correction based on wind and ocean currents. Then, according to step 5, a static environment model of the sea area to be planned is performed, and the navigation safety weight for each grid is calculated, such as... Figure 8 As shown, darker colors indicate a more dangerous grid. Simultaneously, wind and current field data for the sea area to be planned for this path were extracted on November 1, 2025, as follows: Figure 9 and Figure 10 As shown. Following step 7, the predicted global path of the ship is input into the improvement... The algorithm obtains the global path and performs B-spline interpolation to obtain the optimal global path, such as... Figure 11 The orange curve shown.

[0039] To verify the conversion advantages of the GADF method, the global path planning model of this invention is compared with LSTM-GAN based on Long Short-Term Memory Network (LSTM). The average distance error (ADE) and the destination distance error (FDE) are used as prediction error indicators, and the results are shown in Table 3.

[0040] Table 3: Comparison of prediction error metrics between LSTM-GAN and global path planning models

[0041] Analysis of the data in Table 3 shows that, compared to LSTM-GAN, which is trained directly on the trajectory point sequence, the global path planning model of this invention is obtained by converting the trajectory point sequence into an RGB image using the GADF method before training the MHA-cWGAN-GP model, significantly improving prediction performance. This is because the GADF method can effectively encode the dynamics and periodicity of trajectory points and integrate them into the RGB image, thereby enhancing the feature extraction capability of the global path planning model and ultimately improving prediction accuracy.

[0042] To further verify the global path prediction performance of the global path planning model of the present invention, it was compared with commonly used global path planning models such as Long Short-Term Memory Network (LSTM), Bi-LSTM, Gated Recurrent Unit (GRU), Bi-Gated Recurrent Unit (Bi-GRU), Sequence-to-Sequence Model (Seq2Seq), and Transformer Model. The results are shown in Table 4.

[0043] Table 4: Comparison of prediction error indices between the six other global path planning models and the global path planning model of this invention.

[0044] Table 4 shows that the global path planning model of this invention has the best long-term prediction performance and is more stable compared to other global path planning models, with stronger generalization ability. The improved prediction performance of the global path planning model of this invention is mainly due to the enhanced RGB transformation of the GADF method, the improved training stability and sample diversity of the cGAN and WGAN-GP models, and the multi-head attention mechanism to capture key long-term dependencies, making the reconstruction of statistical features and latent patterns more stable and accurate.

[0045] To verify the planning effectiveness of the global path planning method of this invention, this invention is compared with the method disclosed in the literature "Research and implementation of global path planning for unmanned surface vehicle based on electronic chart". The algorithm was compared with common global path planning methods such as Dijkstra and Bellman-Ford. The planning results are shown in Table 5. The evaluation includes the number of nodes, path length, whether the TSS is followed, and whether water depth, wind and water flow are considered.

[0046] Table 5: Comparison of Relevant Indicators of Planning Results from Different Path Planning Methods

[0047] As can be seen from Table 5, the global path planning method of the present invention, while satisfying TSS, takes into account water depth, wind, and ocean currents. The planned global path is slightly longer, but this is a necessary trade-off to meet safety and TSS compliance, and is closer to the actual navigation needs.

[0048] In summary, the ship global path planning method of this invention firstly constructs a training set based on AIS trajectory data. AIS trajectory data provides real navigation trajectories and historical patterns, offering reliable prior information for global path planning. Secondly, the MHA-cWGAN-GP model, through the fusion of generative adversarial networks, MHA, and gradient penalty mechanisms, combined with GADF feature encoding, can efficiently learn ship trajectory features under the influence of complex navigation environments. This enables the global path planning model to generate global paths (i.e., predicted global path RGB images) that conform to ship length, ship type, static obstacles, TSS, and safety constraints, reducing the search space in the global path planning process and overcoming the problems of traditional heuristic algorithms' strong dependence on heuristic functions and large deviations in predicted global paths. Furthermore, based on the ship's predicted global path, an improved... The algorithm generates the optimal global path. Improvements are needed. The algorithm further optimizes the global path in a dynamic environment, improves the search strategy, and comprehensively considers factors such as static obstacles, water depth, TSS, wind and current to construct a multi-constraint cost function. By expanding the nodes of the global path, the search efficiency and global path quality are improved, and the rationality, practical feasibility and stability of the planned global path of the ship are significantly enhanced overall.

Claims

1. A method for global path planning of ships, characterized in that, In the sea area to be planned, a global path planning model is used, which integrates conditional generative adversarial networks, Wasserstein generative adversarial networks with gradient penalties, and multi-head attention mechanisms, to generate predicted path information that conforms to historical navigation habits based on ship characteristics. Then, the predicted path information is converted into a predicted global path for the ship. Subsequently, based on the electronic nautical chart of the sea area to be planned, a grid static environment image containing multi-level navigation safety weights is constructed. Next, guided by the predicted global path for the ship, a path search algorithm that integrates the costs of multiple navigation constraints using a cost function is used to search for a path in the grid static environment image to obtain the global path. Finally, the global path is smoothed to obtain the optimal global path.

2. The ship global path planning method according to claim 1, characterized in that, The predicted path information is a predicted global path RGB image; the GADF method is used to inversely transform the ship predicted global path RGB image into the ship predicted global path; the ship predicted global path consists of multiple nodes arranged in chronological order of ship passage time, and each node is represented by its latitude and longitude coordinates.

3. The ship global path planning method according to claim 2, characterized in that, The ship characteristics are a conditional vector consisting of the ship's length and hull type.

4. The ship global path planning method according to claim 3, characterized in that, The global path planning model satisfies ship length, ship type, static navigation environment, and TSS, and is obtained by training the MHA-cWGAN-GP model. The MHA-cWGAN-GP model is obtained by combining a conditional generative adversarial network with a Wasserstein generative adversarial network with gradient penalty and introducing a multi-head attention mechanism. The training is performed using a training set, which is constructed as follows: First, obtain several historical ship trajectories from the start to the end point of the sea area to be planned; then, based on the historical trajectory, determine the ship length, ship type, and path RGB image of each ship, where the path RGB image of each ship is its true global path RGB image; next, use the ship length and ship type of each ship to construct its conditional vector; then, use the conditional vector of each ship and the true global path RGB image to construct a sample; finally, use all samples to construct the training set.

5. The ship global path planning method according to claim 4, characterized in that, The MHA-cWGAN-GP model includes a generator and a discriminator. The generator includes a first fully connected layer and a first one-dimensional convolutional neural network layer connected in sequence. The first one-dimensional convolutional neural network layer includes a first multi-head attention mechanism and a first-level upsampled convolutional sub-network, a second-level upsampled convolutional sub-network, a third-level upsampled convolutional sub-network, and a first one-dimensional convolutional layer Conv1D connected in sequence. The first multi-head attention mechanism is introduced into the first-level upsampled convolutional sub-network. The discriminator includes a second one-dimensional convolutional neural network layer and a second fully connected layer connected in sequence. The second one-dimensional convolutional neural network layer includes a second multi-head attention mechanism and a first-level downsampled convolutional sub-network, a second-level downsampled convolutional sub-network, a third-level downsampled convolutional sub-network, and a second one-dimensional convolutional layer Conv1D connected in sequence. The second multi-head attention mechanism is introduced into the first-level downsampled convolutional network.

6. The ship global path planning method according to claim 1, characterized in that, The specific process of constructing a gridded static environment image containing multi-level navigation safety weights based on the electronic nautical chart of the sea area to be planned is as follows: First, extract all static obstacle information from the S-57 nautical chart and visualize it to obtain a static environment image containing all static obstacle information; then, perform grid processing on the static environment image to divide it into several grids to form a gridded static environment image; finally, determine the navigation safety weight of each grid based on whether there are static obstacles in each grid and its adjacent grids in the gridded static environment image.

7. The ship global path planning method according to claim 6, characterized in that, The specific method for determining the navigation safety weight of a grid is as follows: If the grid has static obstacles, it is considered a non-navigable grid, and its navigation safety weight is set to 0; if the grid does not have static obstacles, it is considered a navigable grid. In this case, first determine the number of its surrounding neighboring grids, and record this number as P1. Then count the number of non-navigable grids among the P1 neighboring grids, and record this number as P2. Finally, use the formula P3 = (P1 - P2) / P1 to calculate the navigation safety weight P3 of the grid.

8. The ship global path planning method according to claim 1, characterized in that, The path search algorithm is an improvement Algorithm, the improvement The algorithm, through the analysis of... The algorithm was improved, specifically as follows:

1. [The algorithm was modified to...] The algorithm's cost function is improved as follows: The cost function is changed from simple distance accumulation to a weighted sum of remaining range and comprehensive constraint costs. The remaining range is accumulated based on distance constraints. The comprehensive constraint costs are determined based on distance constraints, safety constraints, lane separation constraints, water depth constraints, and wind and current constraints. Safety constraints are determined by navigation safety weights; lane separation constraints are determined based on the consistency of the main channel's course; water depth constraints are determined based on the maximum permissible draft; and wind and current constraints are determined based on the time-related costs caused by wind and current. Secondly, the search strategy is changed to an 8-neighborhood search strategy.

9. The ship global path planning method according to claim 8, characterized in that, Adopting the aforementioned improvement The algorithm performs path search in the grid static environment image to obtain the global path. The specific process is as follows: the predicted global path of the ship is stored in the improved... In the algorithm's OpenList, each node in the predicted global path of the ship, except for the start and end points, is taken as the current node. The eight neighboring grids around each current node are taken as its candidate nodes. For each current node, the following operations are performed: calculate the cost function value of the current node and its eight candidate nodes; if there is a candidate node whose cost function value is lower than that of the current node, then update the current node in the predicted global path of the ship in the OpenList with the candidate node with the lowest cost function value; after traversing all current nodes, the predicted global path of the ship in the OpenList is the global path.

10. The ship global path planning method according to claim 1, characterized in that, The smoothing process uses B-spline interpolation.