Ship trajectory compression method based on shape and space-time motion characteristics
By combining the SSMC algorithm with the DP, TS, SAC and HAC algorithms and adaptively selecting parameters, the problems of insufficient accuracy and efficiency in existing ship trajectory compression methods are solved, and trajectory accuracy and shape preservation at high compression rates are achieved, which is suitable for maritime data processing and safety assurance.
Patent Information
- Application Number
- CN202510627895.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-15
- Publication Date
- 2025-09-09
AI Technical Summary
Existing ship trajectory compression methods cannot obtain complete trajectories during real-time compression, and offline compression methods ignore other motion properties of the ship, resulting in inaccurate and inefficient trajectory compression.
The SSMC algorithm is adopted, combined with the DP, TS, SAC and HAC algorithms, to comprehensively extract trajectory motion data, adaptively select parameters, retain the multi-attribute characteristics of the ship, and achieve trajectory accuracy and shape preservation under high compression rate.
It maintains good trajectory accuracy at high compression rates, has high applicability, can effectively preserve the multi-attribute characteristics of ship navigation, reduce length loss rate and similarity distance, and improve data processing efficiency and security.
Smart Images

Figure CN120614009A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of ship trajectory compression, and in particular to a ship trajectory compression method based on shape and spatiotemporal motion characteristics. Background Art
[0002] With the development of maritime big data, AIS trajectory data has surged. The massive AIS datasets present difficulties in data mining and analysis, and also consume excessive storage and computing resources. Trajectory compression can remove redundant data, retain key information, speed up data processing, and reduce storage requirements. Compressed data not only improves the efficiency of navigation route planning, ensures timely and accurate data transmission, accelerates collision risk prediction, and enhances navigation safety, but also extracts key dynamic characteristics of ships, assisting in waterway planning, identifying anomalies, triggering emergency responses, and reducing pollution. Furthermore, in fisheries management, it helps identify fishing hotspots and activity patterns. Trajectory data compression is of great significance for improving ship navigation efficiency and safety, as well as protecting the marine ecosystem.
[0003] Currently, ship trajectory compression methods fall into two categories. The first is online compression, which compresses the trajectory in real time while the ship is in motion. This approach offers the advantages of low time complexity and low error rate, but suffers from the inability to capture the complete trajectory and achieve globally optimal compression. The second is offline compression, which targets the complete trajectory and achieves smaller errors and more accurate results. This approach often employs the DP algorithm or its improved versions, but ignores other motion properties of the ship.
[0004] To this end, this paper proposes the SSMC algorithm, which sequentially compresses the time, position, speed, and heading of a ship's trajectory, preserving its multi-attribute characteristics. This algorithm maintains good trajectory accuracy at high compression rates and has high applicability. Summary of the Invention
[0005] In response to the technical problems raised above, a ship trajectory compression method based on shape and spatiotemporal motion characteristics is provided. The present invention effectively extracts trajectory motion data by comprehensively proposing the SAC algorithm and the HAC algorithm, and introduces the DP algorithm and the TS algorithm to further retain the trajectory shape as well as time information and spatial data. In addition, the present invention realizes the adaptive determination of the SSMC algorithm parameters based on the compression rate and length loss rate. The trajectory compressed by the SSMC algorithm retains the complete trajectory shape and rich speed and heading change trends, and can achieve a smaller length loss rate and the smallest distance between tracks, showing better trajectory reconstruction capabilities at a higher compression rate.
[0006] The technical means adopted in the present invention are as follows:
[0007] A ship trajectory compression method based on shape and spatiotemporal motion characteristics, comprising:
[0008] S1. Clean and repair the original AIS data;
[0009] S2. Using the DP algorithm, the shape data of each trajectory is compressed;
[0010] S3, using the TS algorithm to compress the spatiotemporal data of each trajectory;
[0011] S4. Using the SAC algorithm, compress the speed data of the ship's trajectory;
[0012] S5. Using the HAC algorithm, compress the heading of the ship during navigation;
[0013] S6. Using the SSMC algorithm, the compression results after the compression processing in steps S2, S3, S4, and S5 are merged to obtain a final compression result.
[0014] S7. Select an adaptive threshold and verify and evaluate the final compression result.
[0015] Furthermore, step S1 specifically includes:
[0016] S11. Clean the original AIS data to remove duplicate and invalid data and eliminate obviously abnormal data;
[0017] S12. Perform data repair on the AIS data after data cleaning. Use interpolation to repair missing parts in the data to ensure the continuity of the trajectory data, thereby obtaining higher-quality trajectory data.
[0018] Furthermore, step S2 specifically includes:
[0019] S21, connect the starting point of the cleaned ship, calculate the distance from all the intermediate track points to this straight line, compare these distances in turn, and get the maximum distance d max ;
[0020] S22. Compare the maximum distance d max and the initial threshold d th , if d max ≤d th , then discard all the intermediate points; if d max >d th , then the trajectory is divided into two parts;
[0021] S23. Execute steps S21 and S22 on the two divided trajectories respectively, and iterate in sequence until the compression is completed.
[0022] Furthermore, step S3 specifically includes:
[0023] S31, connect the starting point and calculate the time ratio distance r of all the trajectory points in the middle to the straight line connecting the starting point i (1<i<n), compare these distances r in turn i (1<i<n), get the maximum distance r max , where the calculation formula is as follows:
[0024]
[0025] Among them, the definition of P i ′(lon i ′,lat i ′) is the time synchronization point, and the specific formula is as follows:
[0026]
[0027] S32, compare the maximum distance r max The time ratio distance threshold r th , if r max ≤r th , then remove all intermediate trajectory points; if r max >r th , then the trajectory is divided into two parts;
[0028] S33. Execute steps S31 and S32 on the two-part trajectory respectively, and iterate in sequence until compression is completed.
[0029] Furthermore, step S4 specifically includes:
[0030] S41. Assume that P1-P2-P3-P4-P5-P6-P7 is the complete trajectory of the ship, v i is the ground speed of trajectory point i (1≤i<n), v th is the speed threshold, n is the number of trajectory points;
[0031] S42, calculate the absolute value of the speed difference between two adjacent points |v i+1 -v i |(1≤i<n), and the speed threshold v th Make comparisons;
[0032] S43, if |v5-v4| and |v6-v5| are both greater than the speed threshold v th , then P5 is considered to be the speed mutation point, and the final speed compression trajectory P1-P5-P7 is output.
[0033] Furthermore, step S5 specifically includes:
[0034] S51. Every three consecutive points in the trajectory form a triangle. Taking the trajectory segment P1-P2-P3 as an example, calculate the side length and The calculation formula is as follows:
[0035]
[0036] S52. Calculate the angle θ'1 between P1P2 and P2P3 using the law of cosines. The calculation formula is as follows:
[0037]
[0038] S53. Based on the calculated angle θ′1 between P1P2 and P2P3, calculate the steering angle θ1 using the following formula:
[0039] θ1=180 0 -θ'1
[0040] S54. If the ship's course over ground (COG) crosses the true north line, the HD algorithm uses θ i , 1≤i<n-1 is the basis for the change of ship navigation behavior, if θ i Greater than the threshold θ th , then this trajectory point is considered to be a heading mutation point and is retained. Otherwise, it is discarded and traversed in sequence to output the final heading compression trajectory.
[0041] Furthermore, step S7 specifically includes:
[0042] S71, DP algorithm threshold selection: select 0.8 times the ship length as the threshold of the DP algorithm;
[0043] S72, TS algorithm threshold selection: Use the threshold point that causes the LLR to have the largest amplitude step, and adaptively select the threshold of the TS algorithm to meet the compression requirements of different trajectories;
[0044] S73, SAC threshold selection: Using different ship trajectories to conduct SAC algorithm compression experiments, it can be seen that as v th The larger the value, the fewer trajectory points are retained. Therefore, the threshold point that allows the compressed ship trajectory to retain more motion information, basically reflect the changes in the original ship speed, and effectively eliminate redundant data is used as the threshold of the SAC algorithm;
[0045] S74, HAC threshold selection: Use the arithmetic mean and standard deviation to determine the data interval of the ship's navigation behavior. Assume that the angle interval where the ship's behavior remains stable is [θ min ,θ max ], where: θ min =μ θ -A θ σ θ ,θ max =μ θ +Aθ σ θ , where μ θ represents the average value of the angle change of the ship's trajectory point, σ θ represents the standard deviation, A θ Indicates the threshold coefficient; since data compression is not only to obtain high CR, but also to focus on the quality of compressed data. Therefore, the threshold coefficient A in the above formula is θ In addition to being used to measure the degree of change in the ship's navigation behavior, it is also used to control the compression effect. θ , σ θ The values are different, but the CR and LLR change trends of each trajectory are similar. Therefore, if we want to determine a reasonable A for all trajectories, θ ,Considering the same compression index, we can take one or several ship trajectories as an example.
[0046] S75. Using the same data set in the same water area, the SSMC algorithm is compared with the DP algorithm and the IDP algorithm to verify the performance of the SSMC algorithm.
[0047] S76. Five similarity measurement methods, Hausdorff distance, SSPD distance, DTW distance, Fréchet distance and MSSPD distance, are used to calculate the distances between different trajectories. These distances reflect the degree of spatial proximity of the trajectories. The smaller the value, the more similar the shape of the compressed trajectory is to the original trajectory.
[0048] Compared with the prior art, the present invention has the following advantages:
[0049] 1. This invention provides a ship trajectory compression method based on shape and spatiotemporal motion characteristics. The SSMC algorithm considers multidimensional information, sequentially compressing the time, position, speed, and heading of a ship's trajectory. The compressed trajectory retains the multi-attribute characteristics of the ship's navigation. Furthermore, through adaptive parameter selection, a high compression ratio is achieved while minimizing length loss and similarity metric distance. This means that the compressed trajectory is highly similar to the original ship trajectory, efficiently compressing data while maximally preserving trajectory accuracy and characteristics, laying a solid foundation for subsequent ship trajectory data mining and behavioral pattern recognition.
[0050] 2. This invention provides a ship trajectory compression method based on shape and spatiotemporal motion characteristics, taking into account adaptive parameter selection capabilities. By analyzing the variations in CR and LLR, the algorithm parameters can be adjusted based on the trajectory data. This makes the algorithm highly adaptable and efficient in a variety of trajectory data scenarios. Unlike traditional algorithms that require manual parameter setting for different data, the SSMC algorithm automatically adapts, significantly improving its versatility and efficiency in processing complex and variable ship trajectory data.
[0051] Based on the above reasons, the present invention can be widely promoted in fields such as ship trajectory compression. BRIEF DESCRIPTION OF THE DRAWINGS
[0052] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0053] Figure 1 Flow chart of the method of the present invention.
[0054] Figure 2 Schematic diagram of the SAC algorithm proposed in this invention.
[0055] Figure 3 Schematic diagram of the HAC algorithm proposed in this invention.
[0056] Figure 4 Schematic diagram of the SSMC algorithm proposed in this invention.
[0057] Figure 5 This is a graph showing the changing trends of CR and LLR of the TS algorithm under different thresholds provided by an embodiment of the present invention.
[0058] Figure 6 This is a diagram of ship trajectory points after compression using the SAC algorithm under different thresholds provided by an embodiment of the present invention.
[0059] Figure 7 This is a graph showing the changing trends of CR and LLR of the HAC algorithm under different thresholds provided by an embodiment of the present invention.
[0060] Figure 8 A comparison and detailed display of the trajectory before and after compression in the Bohai Bay waters provided by an embodiment of the present invention.
[0061] Figure 9 This is a comparison and detail display diagram of the trajectory before and after compression in the Yangtze River waters provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0062] In order to enable those skilled in the art to better understand the solutions of the present invention, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the embodiments described are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts should fall within the scope of protection of the present invention.
[0063] It should be noted that the terms "including" and "having" and any variations thereof in the specification and claims of the present invention and the above-mentioned drawings are intended to cover non-exclusive inclusions. For example, a process, method, system, product or apparatus comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or are inherent to these processes, methods, products or apparatuses.
[0064] like Figure 1 As shown, the present invention provides a ship trajectory compression method based on shape and spatiotemporal motion characteristics, comprising:
[0065] S1. Clean and repair the original AIS data;
[0066] S2. Using the DP algorithm, the shape data of each trajectory is compressed;
[0067] S3, using the TS algorithm to compress the spatiotemporal data of each trajectory;
[0068] S4. Using the SAC algorithm, compress the speed data of the ship's trajectory;
[0069] S5. Using the HAC algorithm, compress the heading of the ship during navigation;
[0070] S6, using the SSMC algorithm, merge the compression results after the compression processing of step S2, step S3, step S4 and step S5 to obtain the final compression result; Figure 4 Figure 2 shows a schematic diagram of the SSMC algorithm.
[0071] S7. Select an adaptive threshold and verify and evaluate the final compression result.
[0072] In specific implementation, as a preferred embodiment of the present invention, step S1 specifically includes:
[0073] S11. Clean the raw AIS data to remove duplicate and invalid data, and eliminate data with obvious anomalies. In this embodiment, due to the potential for data loss, noise interference, and duplicate records during the AIS data reception and transmission process, it is necessary to remove duplicate and invalid data, such as incomplete vessel MMSI numbers, incorrect timestamps, or missing records. Data points with obvious anomalies, such as ship speeds exceeding a reasonable range, ground headings exceeding the range of 0° to 360°, and longitudes or latitudes outside the valid range, are eliminated.
[0074] S12. Perform data repair on the AIS data after data cleaning. Use interpolation to repair the missing parts in the data to ensure the continuity of the trajectory data, thereby obtaining higher-quality trajectory data and providing a reliable basis for subsequent analysis.
[0075] In specific implementation, as a preferred embodiment of the present invention, step S2 specifically includes:
[0076] S21, connect the starting point of the cleaned ship, calculate the distance from all the intermediate track points to this straight line, compare these distances in turn, and get the maximum distance d max ;
[0077] S22. Compare the maximum distance d max and the initial threshold d th , if d max ≤d th , then discard all the intermediate points; if d max >d th , then the trajectory is divided into two parts;
[0078] S23. Execute steps S21 and S22 on the two divided trajectories respectively, and iterate in sequence until the compression is completed.
[0079] In this embodiment, the DP algorithm can recursively segment line data and use a threshold to control the quality of compression, which is a common method for simplifying the trajectory of a moving object.
[0080] In specific implementation, as a preferred embodiment of the present invention, step S3 specifically includes:
[0081] S31, connect the starting point and calculate the time ratio distance r of all the trajectory points in the middle to the straight line connecting the starting point i (1<i<n), compare these distances r in turn i (1<i<n), get the maximum distance r max , where the calculation formula is as follows:
[0082]
[0083] Among them, the definition of P i ′(lon i ′,lat i ′) is the time synchronization point, and the specific formula is as follows:
[0084]
[0085] S32, compare the maximum distance r max The time ratio distance threshold r th , if r max ≤r th , then remove all intermediate trajectory points; if r max >r th , then the trajectory is divided into two parts;
[0086] S33. Execute steps S31 and S32 on the two-part trajectory respectively, and iterate in sequence until compression is completed.
[0087] In this embodiment, the TS algorithm not only considers spatial data but also retains time information. The working principle of the TS algorithm is similar to the DP algorithm, but the TS algorithm uses the trajectory point and its time synchronization point P i ′(lon i ′,lat i The time ratio distance between the two points is used as a metric to determine which trajectory points will be discarded.
[0088] In specific implementation, as a preferred embodiment of the present invention, step S4 specifically includes:
[0089] S41. Assume that P1-P2-P3-P4-P5-P6-P7 is the complete trajectory of the ship, v i is the ground speed of trajectory point i (1≤i<n), v th is the speed threshold, n is the number of trajectory points;
[0090] S42, calculate the absolute value of the speed difference between two adjacent points |v i+1 -v i |(1≤i<n), and the speed threshold v th Make comparisons;
[0091] S43, if |v5-v4| and |v6-v5| are both greater than the speed threshold v th , then P5 is considered to be the speed mutation point, and the final speed compression trajectory P1-P5-P7 is output. Figure 2 Figure 2 shows a schematic diagram of the SAC algorithm.
[0092] In specific implementation, as a preferred embodiment of the present invention, step S5 specifically includes:
[0093] S51. Every three consecutive points in the trajectory form a triangle. Taking the trajectory segment P1-P2-P3 as an example, calculate the side length and The calculation formula is as follows:
[0094]
[0095] S52. Calculate the angle θ'1 between P1P2 and P2P3 using the law of cosines. The calculation formula is as follows:
[0096]
[0097] S53. Based on the calculated angle θ′1 between P1P2 and P2P3, calculate the steering angle θ1 using the following formula:
[0098] θ1=180 0 -θ'1
[0099] S54. If the ship's course over ground (COG) crosses the true north line, the HD algorithm uses θ i , 1≤i<n-1 is the basis for the change of ship navigation behavior, if θ i Greater than the threshold θ th , then this trajectory point is considered to be a heading mutation point and is retained. Otherwise, it is discarded and traversed in sequence to output the final heading compression trajectory. Figure 3 Figure 2 shows a schematic diagram of the HAC algorithm.
[0100] In this embodiment, the COG in the AIS dynamic information represents the ship's heading over the ground, which is defined based on the true north line, that is, the angle between the true north line and the bow line, that is, the current sailing direction of the ship.
[0101] In specific implementation, as a preferred embodiment of the present invention, step S7 specifically includes:
[0102] S71, select 0.8 times the ship length as the threshold of the DP algorithm;
[0103] S72, using a threshold point that causes the LLR to have the largest amplitude step, and adaptively selecting a threshold of the TS algorithm to meet the compression requirements of different trajectories;
[0104] In this embodiment, CR and LLR are two indicators for evaluating the simplicity and effectiveness of the compression algorithm. CR is the ratio of the amount of compressed data to the amount of data before compression, and is a general basic indicator for evaluating compression quality. Let n0 be the number of trajectory points of the original trajectory, n s To simplify the number of trajectory points, CR is defined as r c , LLR is the ratio of the length of the loss after compression to the length of the original trajectory, defined as re , Among them, l o is the length of the original trajectory, l s To simplify the length of the trajectory, Using different ship trajectories to conduct TS algorithm compression experiments, we can see that as the threshold t th As increases, CR and LLR generally show an upward trend. The mutation point of CR and LLR is the critical point of compression effectiveness. Therefore, the threshold of the TS algorithm is adaptively selected by using the threshold point that causes the largest step change in LLR to meet the compression requirements of different trajectories.
[0105] S73, using different ship trajectories to conduct SAC algorithm compression experiments, it can be seen that as v th The larger the value, the fewer trajectory points are retained. Therefore, the threshold point that allows the compressed ship trajectory to retain more motion information, basically reflect the changes in the original ship speed, and effectively eliminate redundant data is used as the threshold of the SAC algorithm;
[0106] S74, HAC threshold selection, using the arithmetic mean and standard deviation to determine the data interval of the ship's navigation behavior, assuming that the angle interval where the ship's behavior remains stable is [θ min ,θ max ], where: θ min =μ θ -A θ σ θ ,θ max =μ θ +A θ σ θ , where μ θ represents the average value of the angle change of the ship's trajectory point, σ θ represents the standard deviation, A θ Indicates the threshold coefficient; since data compression is not only to obtain high CR, but also to focus on the quality of compressed data. Therefore, the threshold coefficient A in the above formula is θ In addition to being used to measure the degree of change in the ship's navigation behavior, it is also used to control the compression effect. θ , σ θ The values are different, but the CR and LLR change trends of each trajectory are similar. Therefore, if we want to determine a reasonable A for all trajectories, θ ,Considering the same compression index, we can take one or several ship trajectories as an example.
[0107] S75. Using the same data set in the same water area, the SSMC algorithm is compared with the DP algorithm and the IDP algorithm to verify the performance of the SSMC algorithm.
[0108] S76. Five similarity measurement methods, Hausdorff distance, SSPD distance, DTW distance, Fréchet distance and MSSPD distance, are used to calculate the distances between different trajectories. These distances reflect the degree of spatial proximity of the trajectories. The smaller the value, the more similar the shape of the compressed trajectory is to the original trajectory.
[0109] Example 1
[0110] The compression experiment was conducted using the trajectory of the ship with MMSI number 412438XXX. The threshold range was set to 0-0.05 with a step size of 0.005.
[0111] DP algorithm threshold selection: 0.8 times the ship length is selected as the threshold selection of the DP algorithm.
[0112] TS algorithm threshold selection: Figure 5 The compression results of TS algorithm under different thresholds are shown. As the threshold t th With the increase of t, CR and LLR generally show an upward trend. th There is a clear step at the beginning, and then as t th As the LLR increases, the CR increases and tends to be flat. th = 0.025, and then it remains stable. The larger the CR, the higher the LLR. As more ship trajectory feature points are lost, the mutation point of CR and LLR is the critical point of the compression effect. th = 0.025, not only can a higher CR be obtained, but also the lowest loss before LLR mutation can be obtained. Therefore, t th =0.025 is used as the TS algorithm compression threshold for this track.
[0113] SAC algorithm threshold selection: Figure 6 Shows different v th The corresponding compression trajectory, as v th As v increases, fewer trajectory points are retained. th =0.05kn, the compressed ship trajectory retains more motion information, which basically reflects the change of the original ship speed. At this time, the CR is 92.61%, which can effectively eliminate redundant data. th = 1 kn, the trajectory points are compressed too much, and the remaining feature points are not enough to reflect the speed characteristics of the ship; when v th When ≥1.5kn, CR no longer changes, because v th Too large, resulting in only the start and end track points being saved after compression. Therefore, select v th = 0.05kN as the threshold of SAC.
[0114] HAC algorithm threshold selection: Set Aθ The range is 1 to 8, the step size is 1, and the HAC compression experiment is performed. Figure 7 The CR and LLR of HAC are given as A θ It can be seen that as A θ As A increases, both indicators show an upward trend. θ Increase to a certain extent, CR remains unchanged. θ =5, a mutation occurs and then becomes stable. This is because A θ The larger the value is, the more feature points of the trajectory are lost, and the greater the difference between the simplified trajectory and the original trajectory. θ =5 is selected as the HAC threshold.
[0115] The SSMC algorithm in the present invention is compared with the DP algorithm and the IDP algorithm. Table 1 shows the compression results of the three algorithms.
[0116] Table 1 Comparison of compression results of different compression algorithms
[0117]
[0118] As shown in Table 1, the DP algorithm achieves the highest compression rate, exceeding the SSMC and IDP algorithms by 5.63% and 10.63%, respectively. However, its length loss rate is significantly higher than those of the SSMC and IDP algorithms, approximately 1.5 and 1.7 times higher. Because the DP algorithm focuses solely on the spatial positional characteristics of ship motion and ignores changes in other attribute information, it achieves the highest compression rate, but also loses more trajectory information. The IDP algorithm has the lowest compression rate, discarding the fewest trajectory points and thus the lowest length loss rate. The SSMC algorithm has a slightly higher length loss rate than the IDP algorithm, but its compression rate is significantly higher, indicating that the SSMC algorithm can effectively compress ship trajectories while balancing the degree of trajectory information loss.
[0119] Example 2
[0120] Compression experiments were conducted using Bohai Bay AIS data.
[0121] Figure 8 The chart shows the ship tracks in the Bohai Bay waters, Figure 8 (a) is the ship track after cleaning, Figure 8 (b) is the ship trajectory compressed using the SSMC algorithm proposed in this invention, Figure 8(c) and (d) show detailed images of the compressed trajectory in the Laotieshan and Weihai waters, respectively. It can be seen that the trajectory compressed by the SSMC algorithm largely retains the spatial characteristics of the original ship trajectory. The trajectory details further demonstrate the compression algorithm's preservation of changes in the ship's navigation behavior. The simplified trajectory shape is consistent with the ship's original trajectory, verifying the effectiveness and applicability of the SSMC algorithm in complex waters.
[0122] Table 2 lists the compression results of three algorithms for ship trajectories in the Bohai Bay. In terms of compression ratio, the DP algorithm achieves the highest ACR, indicating that it is the most effective in data reduction. The SSMC algorithm and the IDP algorithm have similar average CRs. In terms of length loss ratio, the DP algorithm consistently achieves the highest ALLR, indicating that the compressed trajectories lose significant information.
[0123] Table 2 Compression results of ship trajectories in Bohai Bay
[0124]
[0125] The SSMC algorithm's ACR is 3.84% lower than that of the DP algorithm, but its ALLR is approximately 1.2 times lower than that of the DP algorithm. Its ACR is 1.9% higher than that of the IDP algorithm, but its ALLR is almost identical to that of the IDP algorithm, only 0.0002% higher. In terms of similarity metrics, the SSMC algorithm achieves the smallest normalized inter-track distance. For ship trajectories in the Bohai Bay, the SSMC algorithm's Hausdorff distance, SSPD, Fréchet distance, and SSPD are approximately 1.5, 1.4, 1.4, and 1.4 times lower than those of the DP algorithm and the IDP algorithm, respectively, and 1.4, 1.1, 1.3, and 1.1 times lower. Only the DTW distance is slightly higher than that of the IDP algorithm.
[0126] Example 3
[0127] Compression experiments were conducted using AIS data from the Yangtze River.
[0128] Figure 9 It shows the ship tracks in the Yangtze River waters. Figure 9 (a) and (b) are the ship trajectories after cleaning and compression by the SSMC algorithm of the present invention, respectively. Figure 9 (c) and (d) show the trajectory details of the two main curved channels in the waterway. It can be seen that the SSMC algorithm also shows excellent compression effect in inland waterways.
[0129] Table 3 lists the compression results of three algorithms for ship trajectories in the Yangtze River. In terms of compression ratio, the IDP algorithm achieves a lower ACR, indicating that it performs inferior to the SSMC algorithm in inland waters with complex traffic. In terms of length loss ratio, the SSMC algorithm achieves the lowest length loss ratio. Compared with the DP algorithm, the SSMC algorithm's ACR is reduced by 10.1%, but its ALLR is reduced by approximately 2.1 times. Compared with the IDP algorithm, the SSMC algorithm's ACR is improved by 2.58%, but its ALLR is reduced by 1.4 times. This means that during the compression process, the SSMC algorithm is able to better preserve the details and features of the original trajectory data. In terms of similarity metrics, the Hausdorff distance, SSPD, DTW distance, Fréchet distance, and MSSPD of the SSMC algorithm are all approximately 1.2 times lower than those of the DP algorithm, and 1.2, 1.1, 1.1, 1.2, and 1.1 times lower than those of the IDP algorithm, respectively.
[0130] Table 3 Compression results of ship trajectories in the Yangtze River area
[0131]
[0132] In summary, the compression results from the three examples above demonstrate that the SSMC algorithm can achieve a low length loss rate and similarity distance while maintaining a high compression ratio. Furthermore, it effectively preserves the gradual changes in complex motions such as ship turning and acceleration, ensuring that the compressed trajectory still contains rich feature information.
[0133] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the above embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the above embodiments, or replace some or all of the technical features therein with equivalents. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.
Claims
1. A ship trajectory compression method based on shape and spatiotemporal motion characteristics, characterized in that: include: S1. Clean and repair the original AIS data; S2. Using the DP algorithm, the shape data of each trajectory is compressed; S3, using the TS algorithm to compress the spatiotemporal data of each trajectory; S4. Using the SAC algorithm, compress the speed data of the ship's trajectory; S5. Using the HAC algorithm, compress the heading of the ship during navigation; S6. Using the SSMC algorithm, the compression results after the compression processing in steps S2, S3, S4, and S5 are merged to obtain a final compression result. S7. Select an adaptive threshold and verify and evaluate the final compression result.
2. A ship trajectory compression method based on shape and spatiotemporal motion characteristics according to claim 1, characterized in that: Step S1 specifically includes: S11. Clean the original AIS data to remove duplicate and invalid data and eliminate obviously abnormal data; S12. Perform data repair on the AIS data after data cleaning. Use interpolation to repair missing parts in the data to ensure the continuity of the trajectory data, thereby obtaining higher-quality trajectory data.
3. The ship trajectory compression method based on shape and spatiotemporal motion characteristics according to claim 1 is characterized in that: Step S2 specifically includes: S21, connect the starting point of the cleaned ship, calculate the distance from all the intermediate track points to this straight line, compare these distances in turn, and get the maximum distance d max ; S22. Compare the maximum distance d max and the initial threshold d th , if d max ≤d th , then discard all the intermediate points; if d max >d th , then the trajectory is divided into two parts; S23. Execute steps S21 and S22 on the two divided trajectories respectively, and iterate in sequence until the compression is completed.
4. The ship trajectory compression method based on shape and spatiotemporal motion characteristics according to claim 1 is characterized in that: Step S3 specifically includes: S31, connect the starting point and calculate the time ratio distance r of all the trajectory points in the middle to the straight line connecting the starting point i (1<i<n), compare these distances r in turn i (1<i<n), get the maximum distance r max , where the calculation formula is as follows: Among them, the definition of P i ′(lon i ′,lat i ′) is the time synchronization point, and the specific formula is as follows: S32, compare the maximum distance r max The time ratio distance threshold r th , if r max ≤r th , then remove all intermediate trajectory points; if r max >r th , then the trajectory is divided into two parts; S33. Execute steps S31 and S32 on the two-part trajectory respectively, and iterate in sequence until compression is completed.
5. The ship trajectory compression method based on shape and spatiotemporal motion characteristics according to claim 1 is characterized in that: Step S4 specifically includes: S41. Assume that P1-P2-P3-P4-P5-P6-P7 is the complete trajectory of the ship, v i is the ground speed of trajectory point i (1≤i<n), v th is the speed threshold, n is the number of trajectory points; S42, calculate the absolute value of the speed difference between two adjacent points |v i+1 -v i |(1≤i<n), and the speed threshold v th Make comparisons; S43, if |v5-v4| and |v6-v5| are both greater than the speed threshold v th , then P5 is considered to be the speed mutation point, and the final speed compression trajectory P1-P5-P7 is output.
6. The ship trajectory compression method based on shape and spatiotemporal motion characteristics according to claim 1 is characterized in that: Step S5 specifically includes: S51. Every three consecutive points in the trajectory form a triangle. Taking the trajectory segment P1-P2-P3 as an example, calculate the side length and The calculation formula is as follows: S52. Calculate the angle θ'1 between P1P2 and P2P3 using the law of cosines. The calculation formula is as follows: S53. Based on the calculated angle θ′1 between P1P2 and P2P3, calculate the steering angle θ1 using the following formula: θ1=180°-θ'1 S54. If the ship's course over the ground crosses the true north line, the HD algorithm uses θ i , 1≤i<n-1 is the basis for the change of ship navigation behavior, if θ i Greater than the threshold θ th , then this trajectory point is considered to be a heading mutation point and is retained. Otherwise, it is discarded and traversed in sequence to output the final heading compression trajectory.
7. The ship trajectory compression method based on shape and spatiotemporal motion characteristics according to claim 1 is characterized in that: Step S7 specifically includes: S71, select 0.8 times the ship length as the threshold of the DP algorithm; S72, using a threshold point that causes the LLR to have the largest amplitude step, and adaptively selecting a threshold of the TS algorithm to meet the compression requirements of different trajectories; S73, adopting a threshold point that enables the compressed ship trajectory to retain more motion information, basically reflects the change in the original ship speed, and effectively eliminates redundant data as the threshold of the SAC algorithm; S74, HAC threshold selection, using the arithmetic mean and standard deviation to determine the data interval of the ship's navigation behavior, assuming that the angle interval where the ship's behavior remains stable is [θ min ,θ max ], where: θ min =μ θ -A θ σ θ ,θ max =μ θ +A θ σ θ , where μ θ represents the average value of the angle change of the ship's trajectory point, σ θ represents the standard deviation, A θ Indicates the threshold coefficient; threshold coefficient A θ In addition to being used to measure the degree of change in the ship's navigational behavior, it is also used to control compression effects; S75. Using the same data set in the same water area, the SSMC algorithm is compared with the DP algorithm and the IDP algorithm to verify the performance of the SSMC algorithm. S76. Five similarity measurement methods, Hausdorff distance, SSPD distance, DTW distance, Fréchet distance and MSSPD distance, are used to calculate the distances between different trajectories. These distances reflect the degree of spatial proximity of the trajectories. The smaller the value, the more similar the shape of the compressed trajectory is to the original trajectory.