A graph-based localization method for ship path planning
By constructing a directed graph network of sea lanes based on graph theory and using historical AIS data to generate ship paths that conform to actual navigation laws, the problems of low efficiency and insufficient accuracy in path planning in existing technologies are solved, and efficient and reliable path planning is achieved.
Patent Information
- Application Number
- CN202411290502.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-14
- Publication Date
- 2025-10-14
- Estimated Expiration
- 2044-09-14
AI Technical Summary
Existing ship path planning methods are inefficient and lack accuracy when processing massive dynamic data and complex marine environments. They find it difficult to generate paths that conform to actual operations and rely on manual corrections.
A graph theory-based method is used to collect and preprocess historical AIS data of ships to construct a directed graph network of maritime routes. A clustering algorithm is used to extract key waypoints and routes. Combined with a path search algorithm and path smoothing technology, a path that conforms to actual navigation rules is generated.
The efficiency and reliability of path planning are improved, the generated path is more in line with the actual navigation rules of ships, and can automatically avoid non-navigation areas, reducing manual intervention and improving the practicality and safety of the path.
Smart Images

Figure CN119146967B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of automatic route planning, and in particular to a localized ship path planning method based on graph theory. Background Art
[0002] Maritime transport is an essential component of global trade and transportation, and vessel path planning is key to ensuring the efficiency, safety, and economy of maritime navigation. Reliable planning relies on massive amounts of data. However, factors such as the complexity of the marine environment and the complexity of ship navigation behavior increase data uncertainty, making efficient processing and analysis of large amounts of dynamic data a challenge. In addition, complex ocean terrain and obstacles place higher demands on vessel path planning. Some existing path planning methods have certain limitations in accuracy and computational complexity, making them difficult to operate efficiently in large-scale data and real-time applications. The resulting planned paths are often not applicable to actual operations, and in reality, they still rely on the driver's experience to correct the planned paths.
[0003] In recent years, automated ship path planning methods based on satellite data and numerical simulation have been widely used. How to efficiently integrate and utilize data has become the key to ship path planning. Summary of the Invention
[0004] To address the aforementioned issues of path planning efficiency and reliability, this paper provides a localized ship path planning method based on graph theory. By improving data processing techniques and path planning algorithms through graph theory, the system's real-time responsiveness is enhanced, significantly improving the efficiency and reliability of path planning. Combined with path localization measures, this method ultimately yields a planned path that is more realistic for practical operations.
[0005] To achieve the above objectives, the present invention adopts the following technical solutions:
[0006] A localized ship path planning method based on graph theory includes the following steps:
[0007] S1: Collect historical AIS data of ships, pre-process the historical AIS data of ships, extract ship tracks and obtain historical track data, and construct a ship historical track dataset;
[0008] S2: Using the ship historical trajectory dataset constructed in step S1, cluster the trajectory points and trajectories in the dataset through a clustering algorithm to obtain key waypoints and key waterways, and analyze the historical trajectories to determine the connection relationship between the key waypoints. With the key waypoints as nodes and the key waterways as directed edges connecting the nodes, a directed graph network of maritime waterways is established; using the historical trajectory data to calculate the weight information of the key waypoints and directed edges, calculate the travel distance and estimated travel speed of the directed edges, and thus calculate the travel time;
[0009] S3: Using the directed graph network information of the sea route established in step S2, a path search algorithm based on graph theory is used to search and calculate the optimal path from the current point to the destination under different path costs;
[0010] S4: Use the information of the optimal path obtained in step S3 to localize the path, perform avoidance through the path automatic avoidance algorithm, and smooth the overall path through B-spline interpolation to obtain a final passable path planning result.
[0011] Furthermore, the preprocessing in step S1 includes abnormal data elimination, condition screening, trajectory extraction, and downsampling operations.
[0012] First, delete the data with null values and data that does not conform to the logical value range and determine the latitude and longitude range of the data;
[0013] Then, multiple ship type trajectory data are divided according to the ship type entries in the AIS data, and the data of a specific ship type are selected for trajectory extraction;
[0014] Finally, linear interpolation is used to downsample the trajectory.
[0015] Furthermore, step S2 includes the following steps:
[0016] First, the key point extraction parameters are initialized, including the minimum steering angle and the minimum dwell time. When the trajectory angle is less than the minimum steering angle or the duration of a small change in the trajectory point position exceeds the minimum dwell time, these trajectory points are judged as key points.
[0017] Secondly, the clustering parameters, including the maximum distance threshold and the minimum distance threshold, are initialized as the distance constraints between key points, and the obtained cluster centers are used as key waypoints.
[0018] Then, the historical trajectory is analyzed based on the key waypoints, the connection relationship between the key waypoints is determined, and the key waterways are obtained. With the key waypoints as nodes and the key waterways as directed edges connecting the nodes, a directed graph network of sea lanes is established.
[0019] Next, the geographic distances of directed edges are calculated. Based on historical trajectory data, similar segments with the same direction and within the preset range of each directed edge are identified. The average speed of these similar segments is calculated as the estimated speed for the directed edge, thereby calculating the travel time. The number of historical trajectories passing through key waypoints is used as the node weight, and the directed edge weight is the ratio of the number of trajectories from each outgoing edge of the node to the total number of outgoing trajectories.
[0020] Furthermore, step S3 includes the following steps:
[0021] First, the path costs of all directed edges in the route map network are calculated. The path costs include the path's travel probability, travel time, or travel distance, where the travel probability is calculated from the directed edge weights.
[0022] Secondly, according to the current point and destination of the ship, the path search algorithm is used to search for the optimal path under different path costs.
[0023] Furthermore, step S4 includes the following steps:
[0024] First, when passing through a non-navigation area, an automatic avoidance algorithm for non-navigation areas is used to avoid the area. If the path passes through a non-navigation area, the perpendicular bisector of the intersection of the path and the area is obtained. On the perpendicular bisector, the intermediate node is searched in the direction closer to the edge of the area with a preset step size. The intermediate node is connected to the two end points to create a new path. The above search operation is repeated until the new path no longer passes through the non-navigation area.
[0025] Next, intermediate nodes within a preset range that do not have non-navigable areas and whose weights are below a preset threshold are deleted one by one along the path. If deleting a node causes the path to pass through a non-navigable area again, the path is restored to its previous state. Between nodes whose distance exceeds a preset value, control points are first added using linear interpolation, and then the path is smoothed using B-spline interpolation.
[0026] Afterwards, a buffer of a certain width is created based on the path before smoothing, and the non-navigable area within the buffer is removed. This buffer is used to limit the offset of the path nodes after smoothing and avoid repeated operations after the smoothing operation.
[0027] Finally, the path planning results are obtained and the travel distance and time of the planned path are recalculated.
[0028] Compared with the prior art, the present invention has the following beneficial effects:
[0029] The graph-theory-based localized ship path planning scheme provided by the present invention applies probabilistic graph theory to AIS data, using graph theory to construct a directed graph network of maritime routes, with nodes and directed edges representing key shipping points and directional channels, respectively, and weight information representing their busyness. This abstract representation of historical ship trajectory data can accurately reflect the navigation patterns of ships. Combined with the path localization method, it can achieve feasible path planning that is more in line with actual navigation patterns. BRIEF DESCRIPTION OF THE DRAWINGS
[0030] Figure 1 This is a general flow chart of the localized ship path planning method based on graph theory of the present invention;
[0031] Figure 2 Schematic diagram of a directed graph network of sea lanes established based on ship AIS data in an embodiment of the present invention;
[0032] Figure 3 Schematic diagram of the automatic avoidance algorithm for non-navigational areas in localization of the present invention;
[0033] Figure 4 Schematic diagram of path smoothing in localization of the present invention;
[0034] Figure 5 A partial schematic diagram of a planned path of a localized ship path planning method based on graph theory in an embodiment of the present invention;
[0035] Figure 6 Schematic diagram of the planning paths under three path costs of the localized ship path planning method based on graph theory in an embodiment of the present invention. DETAILED DESCRIPTION
[0036] The present invention will be further described in detail below with reference to the accompanying drawings and specific implementation examples.
[0037] See also Figure 1 The present invention provides a localized ship path planning method based on graph theory, comprising the following steps:
[0038] S1: AIS data cleaning and track extraction: Preprocess the historical AIS data of the ship, extract the ship track and obtain historical track data; the preprocessing includes abnormal data removal, condition screening, track extraction, downsampling, etc.
[0039] The specific implementation of step S1 in this embodiment includes the following sub-steps:
[0040] First, data with null values or that does not conform to the logical value range is deleted and the longitude and latitude range of the data is determined. Data of a specific ship type is selected for trajectory extraction. Speed values exceeding 30 knots, longitude values outside the range of -180° to 180°, and latitude values outside the range of -90° to 90° are considered to be out of the logical value range. In this example, the longitude and latitude of (4°, 59°) and (17°, 53°) are used as the upper left and lower right corners of the geographic map to determine the longitude and latitude range of the AIS data, and the trajectory of the tanker ship type is extracted.
[0041] Next, the system divides multiple ship-type trajectory data sets based on the ship type entries in the AIS data. The data is grouped by the ship's MMSI and sorted by time. Trajectories are segmented where the time interval between adjacent trajectory coordinate points exceeds a preset time interval threshold. Trajectories with a duration less than a preset trajectory duration threshold or a number of trajectory coordinate points less than a preset trajectory coordinate point threshold are removed. For example, the preset time interval threshold can be set to 2 hours, the preset trajectory duration threshold can be set to 6 hours, and the preset trajectory coordinate point threshold is 20.
[0042] After that, the data is down-sampled by linear interpolation with a certain time interval. Exemplarily, the time interval can be set to 300s.
[0043] Finally, the longitude and latitude data with a certain effective resolution, the ground speed and the ground course data are set. Exemplarily, the longitude and latitude data resolution, the ground speed and the ground course data resolution can be set to 0.01°, 1 knot and 1° respectively.
[0044] In this process, the ship trajectory is extracted from the massive data, the abnormal data is excluded, and the data resolution is reduced to reduce the data amount, thereby providing data support for the construction of the directed graph.
[0045] S2: Key point clustering and route network construction: using the historical trajectory data set constructed in step S1, the key route points are obtained by clustering, and the connection relationship between the key route points is determined by analyzing the historical trajectory, the key route points are taken as nodes, and the key channel is taken as a directed edge connecting the nodes to establish a marine channel directed graph network; the key route point and the directed edge weight information are calculated by using the historical trajectory data, the passing distance of the directed edge and the estimated passing speed are calculated, and thus the passing time is calculated;
[0046] The specific implementation of step S2 in the embodiment includes the following sub-steps:
[0047] Firstly, the key point extraction parameters are initialized, including the minimum turning angle and the minimum berthing time, when the trajectory angle is less than the minimum turning angle or the small change amplitude of the trajectory point position lasts for more than the minimum berthing time, these trajectory points are determined as key points. In the embodiment, the minimum turning angle and the minimum berthing time can be set to 45° and 5min respectively.
[0048] Secondly, the clustering parameters are initialized, including the maximum distance threshold and the minimum distance threshold, which are used as the distance constraints between the key points, and the obtained clustering center is taken as the key route point. In the embodiment, the maximum distance threshold and the minimum distance threshold can be set to 20km and 5km respectively.
[0049] Then, the historical trajectory is analyzed based on the key route points to determine the connection relationship between the key route points and obtain the key channel. The key route points are taken as nodes, and the key channel is taken as a directed edge connecting the nodes to establish a marine channel directed graph network.
[0050] Afterwards, the geographic distance of the directed edges is calculated. Based on the historical trajectory data, similar flight segments with the same direction and within the preset range of each directed edge are identified. The average travel speed of these similar flight segments is calculated as the estimated travel speed of the directed edge, thereby calculating the travel time. The number of historical trajectories passing through the key waypoints is used as the node weight, and the proportion of the number of trajectories of each outgoing edge at the key point to the total number of trajectories of the outgoing edges is used as the directed edge weight. For example, the preset range can be set as a circle with a radius of 5km, with the two endpoints of the directed edge as the center. Similar flight segments are determined by finding trajectory points that fall within the preset range.
[0051] This process uses historical trajectory datasets to identify key waypoints—those busy maritime traffic chokepoints like turning points or strait entrances—and connects them through key waterways to form a route network based on historical data. The resulting information on directed edge travel times, distances, and weights lays the foundation for subsequent pathfinding cost calculations and route search.
[0052] Schematic diagram of a directed graph network of sea lanes established based on ship AIS data in an embodiment of the present invention Figure 2 The black nodes are the key waypoints obtained by clustering, and the blue lines are the key channels after trajectory clustering. The waypoints are connected by these directed channels to form a maritime route network.
[0053] S3: Optimal path search algorithm: Using the sea route directed graph network information established in step S2, a path search algorithm is used to search for the optimal path from the current point to the destination.
[0054] The specific implementation of step S3 in this embodiment includes the following sub-steps:
[0055] First, calculate the path cost of all directed edges in the route map network. The cost can be the travel probability, travel time, or travel distance. The probability cost is obtained by converting the directed edge weight information. The formula is as follows:
[0056] w′(u, v)=-log(w(v, v))
[0057] Where w′(u, v) is the cost from node u to node v, and w(u, v) is the weight of the directed edge between node u and node v, which is determined by the travel probability of each trajectory diversion.
[0058] Secondly, find the nodes closest to the starting point and the expected end point respectively, and calculate the total probability cost of all possible paths between the two nodes. The formula is as follows:
[0059] s(v1,v n )=w′(v1, v2)+w′(v2, v3)+w′(v3, v4)+…+w′(v n-1 , vn )
[0060] Where, s(v1,v n ) for nodes v1 to v n The total probability cost of the path.
[0061] Then, calculate the total distance cost and total time cost of all possible paths. The formula is as follows:
[0062] d(v1,v n )=d(v1, v2)+d(v2, v3)+d(v3, v4)+…+d(v n-1 , v n )
[0063] t(v1,v n )=t(v1, v2)+t(v2, v3)+t(v3, v4)+…+t(v n-1 , v n )
[0064] Where, d(v1,v n ) for nodes v1 to v n The total distance cost of the path, t(v1, v n ) for nodes v1 to v n The total distance cost of the path.
[0065] Afterwards, the Dijkstra path search algorithm based on graph theory is used to search for the optimal path under different path costs.
[0066] During this process, the path search algorithm finds the shortest time path, shortest distance path, and most probable path from the current point to the destination, corresponding to the path-finding results with the lowest cost. The route map only needs to be constructed once, and all subsequent operations are performed on this map, greatly improving the efficiency of path planning.
[0067] S4: Ship path localization: Using the optimal path information obtained in step S3, the final path planning result is obtained through the localization method of the path automatic avoidance algorithm and the B-spline interpolation path smoothing.
[0068] In this embodiment, the schematic diagram of the automatic avoidance algorithm for non-navigation areas in localization is as follows: Figure 3 As shown, the blue polygon O is the non-navigation area.<U,V> For the original path from node U to node V, search for intermediate nodes on the vertical line according to a certain step size to avoid the non-navigation area, and obtain P1 and P2, where P2 is the first intermediate node that meets the avoidance condition. Create connections between nodes U and V and the intermediate nodes to obtain a new path<U,P2> and <P2,V>;The schematic diagram of path smoothing is as follows Figure 4 As shown, Figure 4In the figure, the narrow area formed by the two non-navigation areas O1 and O2 represents the narrow sea area that may appear in the actual navigation environment. The local path passing through the area is generated by sequentially connecting V1, V2 and V3. The B-spline interpolation result is represented by a curve passing through each point. The buffer zone used to limit the range of the smoothed curve is represented by the gray dotted line range. The specific implementation of step S4 includes the following sub-steps:
[0069] First, when passing through a non-navigable area, the automatic non-navigable area avoidance algorithm is used to avoid it. If the path passes through a non-navigable area, the perpendicular midline of the intersection of the path and the area is obtained. On the perpendicular midline, in the direction closer to the area edge, a search is performed with a preset step size. The intermediate nodes are connected to the two end points to create a new path. This search operation is repeated until the new path no longer passes through the non-navigable area. For example, the preset step size can be set to 200 meters.
[0070] Secondly, intermediate nodes within a preset range that do not have non-navigation areas and whose weights are lower than a preset threshold are deleted one by one along the path direction. If deleting a node causes the path to pass through a non-navigation area again, the path is restored to its previous state after deletion. Between nodes whose distance exceeds a preset value, control points are first added using linear interpolation, and then the path is smoothed using B-spline interpolation. For example, the node preset range can be set to a circle with a radius of 5 km and the node coordinates as the center, the weight preset threshold can be set to 2000, and the linear interpolation distance preset threshold can be set to 40 km.
[0071] Afterwards, a buffer zone of a certain width is created based on the pre-smoothing path, and the non-navigable areas within the buffer zone are removed. This buffer zone is used to limit the offset of path nodes after smoothing, avoiding repeated operations after smoothing. For example, the buffer zone width can be set to 1 km.
[0072] Finally, the path planning results are obtained and the travel distance and time of the planned path are recalculated.
[0073] During this process, an automatic non-navigational area avoidance algorithm is used to avoid non-navigational areas that may be encountered by the path in step S3, ensuring the feasibility of the planned path. Intermediate nodes are deleted to reduce the possibility of passing through less important turning points, while also reducing travel time and distance without significantly impacting the original path. Smoothing the path avoids excessive corners, making the planning results more consistent with ship dynamics and more practical. The localization method in this step adjusts the results of the path search algorithm to ensure efficient generation of the planned path in complex marine environments.
[0074] Figure 5A partial schematic diagram of the planned path of the graph-theory-based localized ship path planning method in an embodiment of the present invention is provided. The red broken line represents the local result of the path planning from the start point to the end point in step S3, and the green curve represents the local path after the result is localized in step S4. As can be seen from the figure, the path planned by the red broken line passes through non-navigable areas such as islands and cannot maintain a safe distance from land, posing a high safety risk. The localized green path effectively avoids non-navigable areas and maintains a safe distance from land. It also has smoother cornering, which is consistent with the dynamic characteristics of the ship.
[0075] Figure 6 A schematic diagram of the planned paths under three different path costs for a localized ship path planning method based on graph theory in an embodiment of the present invention is shown. Red nodes represent the ship's starting and ending points. In this example, a ship sails from the south to the north. Based on the maritime route network, the optimal paths under three different path costs are obtained: the shortest time, shortest distance, and highest probability paths. Finally, after path localization in step S4, the purple, green, and orange curves represent the final paths with the shortest time, shortest distance, and highest probability, respectively.
[0076] The present invention provides a localized ship path planning method based on graph theory. This method systematically processes historical ship AIS data to construct a precise directed graph network of maritime routes, and utilizes this network to achieve efficient and accurate path planning. Specifically, the method includes four main steps: data preprocessing, key waypoint extraction and directed graph construction, path search, and path optimization and smoothing. In the data preprocessing stage, massive amounts of AIS data are cleaned, filtered, and downsampled to remove abnormal data and reduce data resolution, effectively reducing the data volume and providing high-quality data support for subsequent steps. In the key waypoint extraction and directed graph construction stage, a clustering algorithm is used to identify key waypoints with heavy traffic. A directed graph network is then established based on historical trajectory data. The weights of key waypoints and directed edges, travel distances, and estimated travel speeds are simultaneously calculated, providing a rich information foundation for path search. In the path search stage, by calculating path costs and employing appropriate path search algorithms, the optimal path from the current point to the destination can be quickly found, including the shortest time path, the shortest distance path, and the most probable path, significantly improving path planning efficiency. During the path optimization and smoothing stage, the path is optimized and smoothed in one step through the automatic avoidance algorithm for non-navigation areas and the B-spline interpolation path smoothing technology to ensure the feasibility and practicality of the planned path, while making the path more in line with the dynamic characteristics of the ship and in line with actual operational needs.
[0077] In summary, the graph-theory-based localized ship path planning method proposed in this invention has the advantages of high efficiency, accuracy, and strong practicality, and has broad application prospects in the fields of marine transportation, ship navigation, etc.
[0078] The above embodiments are only preferred embodiments of the present invention and should not be considered to limit the scope of the present invention. All equivalent changes and improvements made within the scope of the present invention should still fall within the scope of the patent of the present invention.
Claims
1. A localized ship path planning method based on graph theory, characterized by The following steps are involved: S1: Collect historical AIS data of ships, pre-process the historical AIS data of ships, extract ship tracks and obtain historical track data, and construct a ship historical track dataset; S2: Using the ship historical trajectory dataset constructed in step S1, cluster the trajectory points and trajectories in the dataset through a clustering algorithm to obtain key waypoints and key waterways, and analyze the historical trajectories to determine the connection relationship between the key waypoints. With the key waypoints as nodes and the key waterways as directed edges connecting the nodes, a directed graph network of maritime waterways is established; using the historical trajectory data to calculate the weight information of the key waypoints and directed edges, calculate the travel distance and estimated travel speed of the directed edges, and thus calculate the travel time; S3: Using the directed graph network information of the sea route established in step S2, a path search algorithm based on graph theory is used to search and calculate the optimal path from the current point to the destination under different path costs; S4: Use the information of the optimal path obtained in step S3 to localize the path, perform avoidance through the path automatic avoidance algorithm, and smooth the overall path through B-spline interpolation to obtain a final passable path planning result.
2. A localized ship path planning method based on graph theory according to claim 1, characterized in that The preprocessing in step S1 includes abnormal data removal, condition screening, trajectory extraction, and downsampling operations. First, data with null values and data that do not conform to the logical value range are deleted and the longitude and latitude range of the data are determined. Then, multiple ship type trajectory data are divided according to the ship type entries in the AIS data. Data of specific ship types are selected for trajectory extraction, and then linear interpolation is used to downsample the trajectory.
3. A localized ship path planning method based on graph theory according to claim 1, characterized in that The implementation of step S2 includes the following steps: (1) Initialize the key point extraction parameters, including the minimum steering angle and the minimum parking time. When the trajectory angle is less than the minimum steering angle or the duration of the small change in the trajectory point position exceeds the minimum parking time, these trajectory points are determined to be key points; (2) Initialize clustering parameters, including the maximum distance threshold and the minimum distance threshold, as distance constraints between key points, and use the obtained cluster centers as key waypoints; (3) Analyze the historical trajectory based on key waypoints, determine the connection relationship between key waypoints, and obtain key waterways; use key waypoints as nodes and key waterways as directed edges to connect nodes to establish a directed graph network of sea waterways; (4) Calculate the geographical distance of the directed edge, identify similar segments with the same direction within the preset range of each directed edge based on the historical trajectory data, calculate the average travel speed of these similar segments, and use it as the estimated travel speed of the directed edge, thereby calculating the travel time; the number of historical trajectories of the key waypoints is used as the node weight, and the ratio of the number of trajectories of each outgoing edge in the node to the total number of outgoing trajectories is used as the directed edge weight.
4. A localized ship path planning method based on graph theory according to claim 1, characterized in that The implementation of step S3 includes the following steps: (1) Calculate the path cost of all directed edges in the route map network. The path cost includes the path's travel probability, travel time, or travel distance. The travel probability is calculated based on the directed edge weights. (2) Based on the current point and destination of the ship, the path search algorithm is used to search for the optimal path under different path costs.
5. The localized ship path planning method based on graph theory according to claim 1 is characterized in that The implementation of step S4 includes the following steps: (1) When passing through a non-navigational area, the automatic avoidance algorithm for non-navigational areas is used for avoidance. If the path passes through a non-navigational area, the perpendicular bisector of the intersection of the path and the area is obtained. On the perpendicular bisector, in the direction closer to the edge of the area, an intermediate node is searched with a preset step size. The intermediate node is connected to the two end points to create a new path. The above search operation is repeated until the new path no longer passes through the non-navigational area. (2) Delete intermediate nodes within a preset range that do not have non-navigation areas and whose weights are lower than a preset threshold one by one according to the path direction; if deleting a node causes the path to pass through a non-navigation area again, restore the path to the state before deletion; between nodes whose distance exceeds the preset value, first use linear interpolation to add control points, and then use B-spline interpolation to smooth the path; (3) A buffer zone of a certain width is established based on the path before smoothing, and the non-navigation area within the buffer zone is removed; the buffer zone is used to limit the offset of the path nodes after smoothing and avoid repeated operations after the smoothing operation; (4) Obtain the path planning results and recalculate the travel distance and time of the planned path.
Citation Information
Patent Citations
Pirate area ship route planning method and system, electronic equipment and storage medium
CN113961004A
Marine affair big data-based ship navigation path planning method and system
CN114705193A