An optimization method for ship target trajectory data access
Patent Information
- Application Number
- CN202311408694.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-10-27
- Publication Date
- 2026-09-29
- Estimated Expiration
- 2043-10-27
AI Technical Summary
[0003]然而,在实际情况下,每天会产生大量的船舶目标轨迹数据,如果不能合理的优化数据存储方式及检索方法,从这些大量的数据中检索指定区域、指定时段的船舶目标将会十分困难,会出现检索速度慢,甚至无响应的情况发生
[0055]1、本发明能够实现大量船舶目标轨迹数据组织存储,高效的船舶目标轨迹数据检索,保留关键特征坐标点抽稀的方法。
Smart Images

Figure CN117520392B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of ship target trajectory storage and retrieval in ship traffic management, and in particular to an optimized method for storing and retrieving ship target trajectory data. Background Technology
[0002] The Vessel Traffic Management System (VTS) is a system that uses communication facilities such as AIS base stations, radar, CCTV, VHF, and shipborne terminals to monitor vessels navigating in and out of harbors and provide them with necessary safety information. During vessel traffic management, relevant management personnel need to promptly grasp the historical navigation tracks of vessels to confirm whether any violations have occurred (e.g., whether a vessel entered a restricted area, deviated from its navigation channel, or exceeded speed limits). The historical track mapping and replay mechanism can serve as evidence of vessel violations. Furthermore, historical navigation tracks can be used to statistically analyze vessel traffic flow in designated areas and time periods, all of which greatly assist maritime authorities in managing water traffic.
[0003] However, in reality, a large amount of ship target trajectory data is generated every day. If the data storage and retrieval methods are not optimized reasonably, retrieving ship targets in a specific area and time period from this massive amount of data will be extremely difficult, resulting in slow retrieval speeds or even no response. Furthermore, without thinning, the retrieved data contains very dense ship target trajectory points, affecting transmission efficiency and causing lag when drawing trajectories on the interface; additionally, the drawn trajectories are too dense for users to view properly.
[0004] Therefore, a data thinning method that can reasonably organize and store ship target trajectory data, achieve efficient ship target trajectory data retrieval, and retain key feature trajectory points is very important. Summary of the Invention
[0005] The technical problem to be solved by the present invention is to address the shortcomings of the prior art by providing an optimized method for storing and retrieving ship target trajectory data. This optimized method can achieve the organization and storage of large amounts of ship target trajectory data, efficient retrieval of ship target trajectory data, and a method for thinning out key feature coordinate points.
[0006] To solve the above-mentioned technical problems, the technical solution adopted by the present invention is as follows:
[0007] An optimized method for storing and retrieving ship target trajectory data includes the following steps.
[0008] Step 1: Construct a spatial grid. Construct a spatial grid based on the extent of the monitored area. The constructed spatial grid should completely cover the monitored area. Then, assign index numbers to each spatial grid in order from left to right and from bottom to top.
[0009] Step 2: Initialize the cache: Create and initialize the ship target trajectory cache. The ship target trajectory is cached in a key-value format. The key is used to cache the unique number of the same ship target trajectory data, and the value is used to cache the complete data of the corresponding ship target trajectory received. The complete data of the ship target trajectory includes the ship target coordinates, speed, heading, and target generation time.
[0010] Step 3, Ship Target Trajectory Processing: Receive and parse ship target trajectory data within the monitored area, and cache the parsed ship target trajectory data according to the method in Step 2; in the cache, search all cached ship target trajectory information based on the ship's unique number, and perform anomaly trajectory judgment with the trajectory information of the same ship target received this time. If it is judged to be an abnormal ship target trajectory, add the ship target trajectory data received this time to the cache of that ship, and perform target abnormal trajectory judgment again when the ship target trajectory is received again next time.
[0011] If the target trajectory is determined to be non-abnormal, all previously cached data for that vessel number will be deleted, and only the target trajectory data for this instance will be cached.
[0012] Step 4, Ship Target Trajectory Storage: After obtaining the non-abnormal ship target trajectory, determine the spatial grid A it is located in based on the coordinates of the non-abnormal ship target trajectory, and obtain the index number of spatial grid A; check if there is a storage partition with the same index number as spatial grid A in the storage service; if not, create a storage partition with the same index number as spatial grid A in the storage service; then, store the non-abnormal ship target trajectory information and the corresponding index number together in the storage partition with the same index number as spatial grid A.
[0013] Step 5: Ship Target Trajectory Retrieval: Based on the actual query situation, set up a historical trajectory query area on the map, obtain the coordinate set of the historical trajectory query area clockwise, and obtain all the created spatial grid data; sequentially perform spatial grid matching on each coordinate in the historical trajectory query area coordinate set, and finally obtain all spatial grids containing the historical trajectory query area, and then obtain the index number of all grids including the historical trajectory query area; according to the obtained spatial grid index number, retrieve and query the regional ship target trajectory information in the corresponding storage partition.
[0014] Step 6: Thinning of ship target trajectory: For each ship target's target trajectory curve, the Douglas-Peuker algorithm is used, and the spatial position, the speed and heading of the ship target trajectory are all included in the Douglas-Peuker operation to form a thinned target trajectory curve.
[0015] In step 1, the spatial grid is constructed in the WGS84 coordinate system. Each spatial grid is a square grid with a side length of l, and the side length is arranged along the longitudinal or latitudinal direction. The side length l is determined according to the maximum depth of the monitored area, specifically:
[0016] A. When the maximum depth of the monitored area is more than 500 kilometers, l = 0.5 degrees.
[0017] B. When the maximum depth of the monitored area is 300-500 kilometers, l = 0.35 degrees.
[0018] C. When the maximum depth of the monitored area is 100-300 kilometers, l = 0.25 degrees.
[0019] D. When the maximum depth of the monitored area is less than 100, l = 0.1 degrees.
[0020] Step 3, the method for judging abnormal trajectories, includes the following steps:
[0021] Step A, coordinate radian conversion: Let the current trajectory coordinate point of ship target A be D1(x1, y1), and the time when the current trajectory coordinate of ship target A was generated be t1; let the previous trajectory coordinate point of ship target A be D2(x2, y2), and the time when the previous trajectory coordinate of ship target A was generated be t2; then, through radian conversion, the coordinates x1, y1, x2, and y2 in degree form are converted to coordinates x1', y1', x2', and y2' in radian form, respectively.
[0022] Step B: Calculate the distance d: Based on the coordinates x1', y1', x2', and y2', calculate the distance d between point D1 and point D2.
[0023] Step C: Calculate the velocity k value: Based on t1 and t2 in Step A, and the distance d in Step B, calculate the velocity k value between points D1 and D2. The specific calculation formula is as follows:
[0024]
[0025] In the formula, δ is the speed conversion constant, which is a set value between 0 and 1.
[0026] Step D, Abnormal Trajectory Judgment: The k value obtained in Step C is set as a speed threshold k1 for judgment. The specific judgment method is as follows:
[0027] When k≤k1, the current trajectory coordinate point D1 is determined to be a non-abnormal ship target trajectory.
[0028] When k > k1, the current trajectory coordinate point D1 and the cached previous trajectory point D2 are considered abnormal. At this time, steps A to D are repeated to determine the abnormal trajectory between the current trajectory coordinate point D1 and the cached previous trajectory point D3, until the k value between point D1 and point D3 is less than or equal to k1. When all cached trajectory data corresponding to the ship target A have been traversed and are considered abnormal, the current trajectory coordinate point D1 is determined to be an abnormal ship target trajectory.
[0029] In step 3, k1 = 40.
[0030] In step 4, based on the coordinates of the non-abnormal vessel target trajectory, the spatial grid A where the non-abnormal vessel target trajectory is located is determined using the point and spatial grid inclusion calculation method. The point and spatial grid inclusion calculation method is as follows: Let the coordinates of the non-abnormal vessel target trajectory be S(x, y), and let the clockwise coordinates of the four corner points of one spatial grid be P1(x1, y1), P2(x2, y2), P3(x3, y3) and P4(x4, y4), respectively. Let the distances between point S and the four corner points P1, P2, P3 and P4 be a, b, c and d, respectively.
[0031] If all four values of a, b, c, and d are greater than 0 or less than 0, then the non-abnormal ship target trajectory point S is determined to be within the spatial grid; otherwise, the non-abnormal ship target trajectory point S is determined to be outside the spatial grid.
[0032] In step 4, the formulas for calculating a, b, c, and d are as follows:
[0033]
[0034] Step 6, the method for thinning ship target trajectories based on the Douglas-Peuker algorithm, includes the following steps:
[0035] Step 61: Data Grouping and Sorting: The acquired ship target trajectory data is grouped by ship number and sorted by time sequence to obtain ship target trajectories grouped by unique ship number in order.
[0036] Step 62: Generate track curve: Connect the grouped ship target trajectories in chronological order to form a continuous track curve.
[0037] Step 63: Select the starting and ending points: Select the starting and ending points from each trajectory curve;
[0038] Step 64: Calculate the distance: Connect the starting point and the ending point with a dashed line to form a straight line L. Calculate the distance between each track point on the target ship track curve between the starting point and the ending point and the straight line L, and find the maximum distance value Dmax.
[0039] Step 65, Distance Judgment: Compare the maximum distance value Dmax found in Step 64 with the set distance threshold D, specifically:
[0040] When Dmax≥D, retain the track point B corresponding to Dmax, and use track point B as the dividing point to divide the straight line L into two sub-lines; then, jump to step 67.
[0041] If Dmax < D, proceed to step 66.
[0042] Step 66: Determine the heading difference and speed difference: Calculate the heading difference F and speed difference S between waypoint B and its adjacent waypoints on the left and right, and compare them with the corresponding heading difference threshold F1 or speed difference threshold S1. Specifically:
[0043] When F≤F1 and S≤S1, all track points between the starting point and the ending point are deleted.
[0044] When F > F1 or S > S1, then retain track point B and the track point corresponding to F > F1 or S > S1.
[0045] Step 67, Recursive processing: Repeat steps 63 to 67 for each newly generated sub-straight line to obtain all track retention points.
[0046] Step 68: Output the thinned track curve: Connect the starting point, the ending point, and the last retained track point determined in steps 65 to 67 in chronological order to form the thinned track curve.
[0047] In step 6, the distance threshold D is set to 0.00001°.
[0048] In step 6, the navigation difference threshold F1 is 30 degrees; the speed difference threshold S1 is 5 knots.
[0049] In step 1, the specific method for constructing the spatial grid is as follows:
[0050] Step 11: Determine the starting origin: In the WGS84 coordinate system, take the lower left corner point P of the monitored area as the starting point. 11 (x, y) is the starting point, where x represents longitude and y represents latitude.
[0051] Step 12: Construct the meridional grid points: starting from the origin P 11 A meridional grid point P is generated eastward from (x, y) with a longitude span of l. 12(x+l, y), then P 12 Starting from (x+l, y), continue eastward to generate the next meridional grid point P with a longitude span of l. 13 (x+2l, y), and so on, continuously generating meridional grid points P. 14 (x+3l,y), P 15 (x+4l,y), ...; until the monitored area is fully covered in the longitude direction.
[0052] Step 13: Construct the latitudinal grid points: starting from the origin P 11 A latitudinal grid point P is generated northward from (x, y) with a latitude span of l. 21 (x, y+l), then P 21 Starting from (x, y+l), continue northwards to generate the next latitudinal grid point P with a latitude span of l. 31 (x, y+2l), and so on, continuously generating latitudinal grid points P. 41 (x, y+3l), P 51 (x, y+4l), ...; until the monitored area is fully covered in the latitudinal direction.
[0053] Step 14: Construct a spatial grid: Generate a true north line through each meridional grid point and a true east line through each latitudinal grid point; all direct intersections form a spatial grid that can cover the monitored area.
[0054] The present invention has the following beneficial effects:
[0055] 1. This invention enables the organization and storage of large amounts of ship target trajectory data, efficient retrieval of ship target trajectory data, and a method for thinning out key feature coordinate points.
[0056] 2. The present invention first creates a spatial grid for the management area and generates index numbers, then performs time accumulation and calculation on the received ship target data, and suppresses and eliminates inaccurate jumping targets.
[0057] 3. When storing ship target trajectories, determine the spatial grid where the current target is located and obtain its grid index number. Store ship target trajectory information in partitions according to spatial grid index numbers. When querying ship targets by region, perform a spatial operation between the region and the generated spatial grid to obtain the index numbers of all spatial grids covered by that region. Based on the search criteria, directly locate the partition of all spatial grid index numbers covered by that region to perform the target trajectory query. The query results are sorted in chronological order, and the dataset is thinned while retaining key feature coordinates. Finally, the search results are returned for interface rendering and display.
[0058] 4. This invention can optimize the storage method of ship target trajectory, improve the query efficiency of ship target trajectory, and take into account both the data volume and query effect of query results, thus meeting the requirements of the VTS traffic management industry for the efficiency and display effect of querying and displaying ship target trajectory. Attached Figure Description
[0059] Figure 1 The flowchart of a method for optimizing the access performance of ship target trajectory data according to the present invention is shown.
[0060] Figure 2 The diagram shows the structure of the spatial grid constructed within the monitored area.
[0061] Figure 3 The flowchart for judging abnormal ship target trajectories is shown.
[0062] Figure 4 This diagram illustrates how the grid index number of a ship target is obtained after performing an inclusion operation between the ship target's coordinates and the pre-constructed spatial grid.
[0063] Figure 5 This diagram illustrates how a query region is included in a pre-constructed spatial grid after an inclusion operation is performed. The result is a list of all network index numbers that include the query region.
[0064] Figure 6 This displays the process of thinning the data on the retrieved ship target trajectories. Detailed Implementation
[0065] The present invention will now be described in further detail with reference to the accompanying drawings and specific preferred embodiments.
[0066] In the description of this invention, it should be understood that the terms "left side," "right side," "upper part," "lower part," etc., indicate the orientation or positional relationship based on the orientation or positional relationship shown in the accompanying drawings. They are only for the convenience of describing this invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation. "First," "second," etc., do not indicate the importance of the components, and therefore should not be construed as a limitation of this invention. The specific dimensions used in this embodiment are only for illustrating the technical solution and do not limit the scope of protection of this invention.
[0067] like Figure 1 As shown, an optimized method for storing and retrieving ship target trajectory data includes the following steps.
[0068] Step 1: Construct a spatial grid. Construct a spatial grid based on the extent of the monitored area. The constructed spatial grid should completely cover the monitored area. Then, assign index numbers to each spatial grid in order from left to right and from bottom to top.
[0069] In this invention, the spatial grid is preferably constructed in the WGS84 coordinate system, and each spatial grid is a square grid with a side length of l, with the side lengths arranged along the longitudinal or latitudinal directions; wherein, the side length l is determined according to the maximum depth of the monitored area, specifically as follows:
[0070] A. When the maximum depth of the monitored area is more than 500 kilometers, l = 0.5 degrees.
[0071] B. When the maximum depth of the monitored area is 300-500 kilometers, l = 0.35 degrees.
[0072] C. When the maximum depth of the monitored area is 100-300 kilometers, l = 0.25 degrees.
[0073] D. When the maximum depth of the monitored area is less than 100, l = 0.1 degrees.
[0074] In this invention, such as Figure 2 As shown, the preferred method for constructing a spatial grid is:
[0075] Step 11: Determine the starting origin: In the WGS84 coordinate system, take the lower left corner point P of the monitored area as the starting point. 11 (x, y) is the starting point, where x represents longitude and y represents latitude.
[0076] Step 12: Construct the meridional grid points: starting from the origin P 11 A meridional grid point P is generated eastward from (x, y) with a longitude span of l. 12 (x+l, y), then P 12 Starting from (x+l, y), continue eastward to generate the next meridional grid point P with a longitude span of l. 13 (x+2l, y), and so on, continuously generating meridional grid points P. 14 (x+3l,y), P 15 (x+4l,y), ...; until the monitored area is fully covered in the longitude direction.
[0077] In this embodiment, it is preferable that the maximum depth of the monitored area is more than 500 kilometers, so l = 0.5 degrees.
[0078] Step 13: Construct the latitudinal grid points: starting from the origin P 11 A latitudinal grid point P is generated northward from (x, y) with a latitude span of l. 21 (x, y+l), then P 21 Starting from (x, y+l), continue northwards to generate the next latitudinal grid point P with a latitude span of l. 31(x, y+2l), and so on, continuously generating latitudinal grid points P. 41 (x, y+3l), P 51 (x, y+4l), ...; until the monitored area is fully covered in the latitudinal direction.
[0079] Step 14: Construct a spatial grid: Generate a true north line through each meridional grid point and a true east line through each latitudinal grid point; all direct intersections form a spatial grid that can cover the monitored area.
[0080] Step 2: Initialize the cache: Create and initialize the ship target trajectory cache. The ship target trajectory is cached in a key-value format. The key is used to cache the unique number of the same ship target trajectory data, and the value is used to cache the complete data of the corresponding ship target trajectory received. The complete data of the ship target trajectory includes the ship target coordinates, speed, heading, and target generation time. The complete data of the ship target trajectory may also include a unique number as needed.
[0081] Step 3, ship target trajectory processing, such as Figure 3 As shown, the preferred method includes the following steps.
[0082] Step 31: Receive and parse ship target trajectory data: Continuously receive ship target trajectory data via TCP packets based on the monitored area, parse the packets to obtain ship target trajectory data, including the ship's unique number, ship target coordinates, speed, heading, target generation time, etc.
[0083] The unique identifier of the ship target is used to check if there is any data that was previously received in the cache created in step 2. If no corresponding data is found, the data is cached in step 32.
[0084] Step 32: Cache ship target trajectory data: Use the unique ship number obtained after parsing as the key value, and use the ship target coordinates, speed, heading, target generation time and other information obtained after parsing as the value value to cache in the initialized cache.
[0085] Step 33, Target Abnormal Trajectory Judgment: Search the cache for all cached ship target trajectory information based on the ship's unique number, and judge the abnormal trajectory by comparing it with the trajectory information of the same ship target received this time.
[0086] If the target trajectory is determined to be abnormal, the target trajectory data received this time will be added to the target's cache, and the abnormal trajectory will be determined again when the target trajectory is received again next time.
[0087] If the target trajectory is determined to be non-abnormal, all previously cached data for that vessel number will be deleted, and only the target trajectory data for this instance will be cached.
[0088] The above-mentioned method for judging abnormal trajectories preferably includes the following steps.
[0089] Step A, coordinate radian conversion: Let the current trajectory coordinate point of ship target A be D1(x1, y1), and the time when the current trajectory coordinate of ship target A was generated be t1; let the previous trajectory coordinate point of ship target A be D2(x2, y2), and the time when the previous trajectory coordinate of ship target A was generated be t2; then, through radian conversion, the coordinates x1, y1, x2, and y2 in degree form are converted to coordinates x1', y1', x2', and y2' in radian form, respectively.
[0090]
[0091] In the formula, a is the x' or y' of the coordinate point after radian transformation; r is the x and y values of the coordinate point to be substituted.
[0092] Step B: Calculate the distance d: Based on the coordinates x1', y1', x2', and y2', calculate the distance d between points D1 and D2. The specific calculation formula is as follows:
[0093]
[0094] In the formula, R is the Earth's radius.
[0095] Step C: Calculate the velocity k value: Based on t1 and t2 in Step A, and the distance d in Step B, calculate the velocity k value between points D1 and D2. The specific calculation formula is as follows:
[0096]
[0097] In the formula, δ is the speed conversion constant, which is a set value between 0 and 1. In this embodiment, it is preferably 0.5144444.
[0098] Step D, Abnormal Trajectory Judgment: The k value obtained in Step C is set as a speed threshold k1 for judgment. The specific judgment method is as follows:
[0099] When k≤k1, the current trajectory coordinate point D1 is determined to be a non-abnormal ship target trajectory.
[0100] When k > k1, the current trajectory coordinate point D1 and the cached previous trajectory point D2 are considered abnormal. At this time, steps A to D are repeated to determine the abnormal trajectory between the current trajectory coordinate point D1 and the cached previous trajectory point D3, until the k value between point D1 and point D3 is less than or equal to k1. When all cached trajectory data corresponding to the ship target A have been traversed and are considered abnormal, the current trajectory coordinate point D1 is determined to be an abnormal ship target trajectory.
[0101] In this embodiment, k1 is preferably 40, which represents a ship speed of 40 knots.
[0102] Step 4, Ship Target Trajectory Storage: After obtaining the non-abnormal ship target trajectory, determine its spatial grid A based on the coordinates of the non-abnormal ship target trajectory, and obtain the index number of spatial grid A; check if there is a storage partition with the same index number as spatial grid A in the storage service; if not, create a storage partition with the same index number as spatial grid A in the storage service; then, store the non-abnormal ship target trajectory information (unique number, ship target coordinates, speed, heading, target generation time, etc.) and the corresponding index number together in the storage partition with the same index number as spatial grid A.
[0103] In this invention, based on the coordinates of the non-abnormal ship target trajectory, the preferred method is as follows: Figure 4 The points and spatial grid shown include a calculation method to determine the spatial grid A where the non-abnormal ship target trajectory is located. The calculation method for the points and spatial grid is as follows: Let the coordinates of the non-abnormal ship target trajectory be S(x, y), and the clockwise coordinates of the four corner points of one spatial grid be P1(x1, y1), P2(x2, y2), P3(x3, y3), and P4(x4, y4). Let the distances between point S and the four corner points P1, P2, P3, and P4 be a, b, c, and d, respectively. The preferred specific calculation formula is:
[0104]
[0105] If all four values of a, b, c, and d are greater than 0 or less than 0, then the non-abnormal ship target trajectory point S is determined to be within the spatial grid; otherwise, the non-abnormal ship target trajectory point S is determined to be outside the spatial grid.
[0106] Step 5, Retrieval of Ship Target Trajectory: (e.g., ...) Figure 5As shown, a historical trajectory query area is set on the map according to the actual query situation. The coordinate set of the historical trajectory query area is obtained clockwise, and all the created spatial grid data is obtained. Each coordinate in the coordinate set of the historical trajectory query area is matched with the spatial grid in turn, and finally all spatial grids containing the historical trajectory query area are obtained. Then, the index number of all grids including the historical trajectory query area is obtained. The obtained spatial grid index number is used to store the corresponding storage partition. Other query conditions (such as time period) can also be combined to retrieve and query regional ship target trajectory information.
[0107] Step 6: Thinning of ship target trajectory: For each ship target's target trajectory curve, the Douglas-Peuker algorithm is used, and the spatial position, the speed and heading of the ship target trajectory are all included in the Douglas-Peuker operation to form a thinned target trajectory curve.
[0108] like Figure 6 As shown, the method for thinning ship target trajectories based on the Douglas-Peuker algorithm includes the following steps:
[0109] Step 61, Data Grouping and Sorting: The acquired ship target trajectory data is grouped by ship number and then sorted chronologically to obtain ordered ship target trajectories grouped by unique ship numbers. Figure 6 In the example, the ship targets are assumed to have six trajectory points A0, A1, A2, A3, A4 and A5 in chronological order.
[0110] Step 62: Generate track curve: Connect the grouped ship target trajectories in chronological order to form a continuous track curve.
[0111] Step 63: Select the starting point and ending point: Select the starting point A0 and the ending point A5 from each trajectory curve.
[0112] Step 64: Calculate the distance: Connect the starting point and the ending point with a dashed line to form a straight line L. Calculate the distance between each track point on the target ship track curve between the starting point and the ending point and the straight line L, and find the maximum distance value Dmax.
[0113] Step 65, Distance Judgment: Compare the maximum distance value Dmax found in Step 64 with the set distance threshold D, specifically:
[0114] When Dmax≥D, retain the track point B corresponding to Dmax, and use track point B as the dividing point to divide the straight line L into two sub-lines; then, jump to step 67.
[0115] If Dmax < D, proceed to step 66.
[0116] The preferred distance threshold D is 0.00001°. The smaller the D value, the closer the thinned result is to the original value, but the more points are retained, which is not conducive to reducing the amount of data. Conversely, the larger the D value, the fewer the thinned result values, which is conducive to reducing data storage, but there is a risk of losing key points.
[0117] Therefore, the D value needs to be combined with business requirements and repeatedly adjusted through experiments to find a suitable value. That is, while retaining key points, as many invalid points as possible should be deleted. As shown in Table 1, experiments revealed that after thinning, the D value with the fewest coordinates while ensuring that no key points are lost is 0.00001, and this value was finally determined to be 0.00001.
[0118] This embodiment uses 80 coordinate points, and the experimental results are as follows:
[0119]
[0120]
[0121] Table 1: Results for different D values
[0122] Step 66: Determine the heading difference and speed difference: Calculate the heading difference F and speed difference S between waypoint B and its adjacent waypoints on the left and right, and compare them with the corresponding heading difference threshold F1 or speed difference threshold S1. Specifically:
[0123] When F≤F1 and S≤S1, all track points between the starting point and the ending point are deleted.
[0124] When F > F1 or S > S1, then retain track point B and the track point corresponding to F > F1 or S > S1.
[0125] In this embodiment, the navigation difference threshold F1 is preferably 30 degrees; the speed difference threshold S1 is preferably 5 knots.
[0126] In maritime applications, thinning of a ship's target trajectory cannot simply preserve key inflection points in spatial location. Non-spatial information such as the ship's instantaneous heading and speed must also be taken into account. Furthermore, the trajectory and its adjacent trajectories must be preserved to reflect and compare the changes in the trajectory (heading, speed).
[0127] The F mentioned above represents the change in heading between adjacent trajectory points, measured in degrees. In this invention, 30 is used to indicate that the headings of the original adjacent trajectories differ by 30 degrees, which is a critical value in maritime operations where deviation or collision is possible. This also signifies a significant change in heading in maritime operations, requiring attention and documentation from a maritime regulatory perspective.
[0128] The S mentioned above represents the velocity change of the believed trajectory point, in knots. In this invention, 5 is used to indicate a 5-knot difference in velocity between the original believed trajectories. In maritime operations, such adjacent velocity changes must be recorded for subsequent historical queries and evidence collection.
[0129] Step 67, Recursive processing: Repeat steps 63 to 67 for each newly generated sub-straight line to obtain all track retention points.
[0130] Step 68: Output the thinned track curve: Connect the starting point, the ending point, and the last retained track point determined in steps 65 to 67 in chronological order to form the thinned track curve.
[0131] The preferred embodiments of the present invention have been described in detail above. However, the present invention is not limited to the specific details of the above embodiments. Within the scope of the technical concept of the present invention, various equivalent transformations can be made to the technical solutions of the present invention, and these equivalent transformations all fall within the protection scope of the present invention.
Claims
1. An optimized method for storing and retrieving ship target trajectory data, characterized in that: Includes the following steps: Step 1: Construct a spatial grid: Construct a spatial grid based on the extent of the monitored area, ensuring that the entire area of the constructed spatial grid completely covers the monitored area; then, assign index numbers to each spatial grid in order from left to right and from bottom to top. Step 2: Initialize the cache: Create and initialize the ship target trajectory cache. The ship target trajectory is cached in a key-value format. The key is used to cache the unique number of the same ship target trajectory data, and the value is used to cache the complete data of the corresponding ship target trajectory received. The complete data of the ship target trajectory includes the ship target coordinates, speed, heading, and target generation time. Step 3, Ship Target Trajectory Processing: Receive and parse ship target trajectory data within the monitored area, and cache the parsed ship target trajectory data according to the method in Step 2; in the cache, search all cached ship target trajectory information based on the ship's unique number, and perform anomaly trajectory judgment with the trajectory information of the same ship target received this time. If it is judged to be an abnormal ship target trajectory, add the ship target trajectory data received this time to the cache of that ship, and perform target abnormal trajectory judgment again when the ship target trajectory is received again next time; If the target trajectory is determined to be non-abnormal, all previously cached data for that vessel number will be deleted, and only the target trajectory data for this instance will be cached. Step 4, Ship Target Trajectory Storage: After obtaining the non-abnormal ship target trajectory, determine its spatial grid A based on the coordinates of the non-abnormal ship target trajectory, and obtain the index number of spatial grid A; check if there is a storage partition with the same index number as spatial grid A in the storage service; if not, create a storage partition with the same index number as spatial grid A in the storage service; then, store the non-abnormal ship target trajectory information and its corresponding index number together in the storage partition with the same index number as spatial grid A. Step 5, Ship Target Trajectory Retrieval: Based on the actual query situation, set up a historical trajectory query area on the map, obtain the coordinate set of the historical trajectory query area clockwise, and obtain all created spatial grid data; sequentially perform spatial grid matching on each coordinate in the historical trajectory query area coordinate set, and finally obtain all spatial grids containing the historical trajectory query area, and then obtain the index number of all grids including the historical trajectory query area; according to the obtained spatial grid index number, retrieve and query the regional ship target trajectory information in the corresponding storage partition; Step 6: Thinning of ship target trajectory: For each ship target's target trajectory curve, the Douglas-Peuker algorithm is used, and the spatial position, the speed and heading of the ship target trajectory are all included in the Douglas-Peuker operation to form a thinned target trajectory curve.
2. The optimized method for storing and retrieving ship target trajectory data according to claim 1, characterized in that: In step 1, the spatial grid is constructed in the WGS84 coordinate system. Each spatial grid is a square grid with a side length of l, and the side length is arranged along the longitudinal or latitudinal direction. The side length l is determined according to the maximum depth of the monitored area, specifically: A. When the maximum depth of the monitored area is more than 500 kilometers, l = 0.5 degrees; B. When the maximum depth of the monitored area is 300-500 kilometers, l = 0.35 degrees; C. When the maximum depth of the monitored area is 100-300 kilometers, l = 0.25 degrees; D. When the maximum depth of the monitored area is less than 100, l = 0.1 degrees.
3. The optimized method for storing and retrieving ship target trajectory data according to claim 1, characterized in that: Step 3, the method for judging abnormal trajectories, includes the following steps: Step A, Coordinate Radius Conversion: Let the current trajectory coordinates of ship target A be D1(x1, y1), and the time when the current trajectory coordinates of ship target A were generated be t1; let the previous trajectory coordinates of ship target A be D2(x2, y2), and the time when the previous trajectory coordinates of ship target A were generated be t2; then, through radian conversion, the angular coordinates x1, y1, x2, and y2 are converted into radian coordinates x1', y1', x2', and y2', respectively. Step B, Calculate the distance d: Based on the coordinates x1', y1', x2', and y2', calculate the distance d between point D1 and point D2; Step C: Calculate the velocity k value: Based on t1 and t2 in Step A, and the distance d in Step B, calculate the velocity k value between points D1 and D2. The specific calculation formula is as follows: ; In the formula, δ is the speed conversion constant, which is a set value between 0 and 1; Step D, Abnormal Trajectory Judgment: The k value obtained in Step C is set as a speed threshold k1 for judgment. The specific judgment method is as follows: When k≤k1, the current trajectory coordinate point D1 is determined to be a non-abnormal ship target trajectory; When k > k1, the current trajectory coordinate point D1 and the cached previous trajectory point D2 are considered abnormal. At this time, steps A to D are repeated to determine the abnormal trajectory between the current trajectory coordinate point D1 and the cached previous trajectory point D3, until the k value between point D1 and point D3 is less than or equal to k1. When all cached trajectory data corresponding to the ship target A have been traversed and are considered abnormal, the current trajectory coordinate point D1 is determined to be an abnormal ship target trajectory.
4. The optimized method for storing and retrieving ship target trajectory data according to claim 3, characterized in that: In step 3, k1 = 40.
5. The optimized method for storing and retrieving ship target trajectory data according to claim 1, characterized in that: In step 4, based on the coordinates of the non-abnormal ship target trajectory, the spatial grid A where the non-abnormal ship target trajectory is located is determined using the point and spatial grid inclusion calculation method. The point and spatial grid inclusion calculation method is as follows: Let the coordinates of the non-abnormal ship target trajectory be S(x, y), and let the clockwise coordinates of the four corner points of one spatial grid be P1(x1, y1), P2(x2, y2), P3(x3, y3) and P4(x4, y4), respectively. Let the distances between point S and the four corner points P1, P2, P3 and P4 be a, b, c and d, respectively. If all four values of a, b, c, and d are greater than 0 or all are less than 0, then the non-abnormal ship target trajectory point S is determined to be within the spatial grid; otherwise, the non-abnormal ship target trajectory point S is determined to be outside the spatial grid. The formulas for calculating a, b, c, and d are as follows: 。 6. The optimized method for storing and retrieving ship target trajectory data according to claim 1, characterized in that: Step 6, the method for thinning ship target trajectories based on the Douglas-Peuker algorithm, includes the following steps: Step 61, Data Grouping and Sorting: The acquired ship target trajectory data is grouped by ship number and sorted by time sequence to obtain ship target trajectories grouped by unique ship number in order. Step 62: Generate track curve: Connect the grouped ship target trajectories in chronological order to form a continuous track curve; Step 63: Select the starting and ending points: Select the starting and ending points from each trajectory curve; Step 64: Calculate the distance: Connect the starting point and the ending point with a dashed line to form a straight line L. Calculate the distance between each track point on the target ship track curve between the starting point and the ending point and the straight line L, and find the maximum distance value Dmax. Step 65, Distance Judgment: Compare the maximum distance value Dmax found in Step 64 with the set distance threshold D, specifically: When Dmax≥D, retain the track point B corresponding to Dmax, and use track point B as the dividing point to divide the straight line L into two sub-lines; then, jump to step 67. When Dmax < D, proceed to step 66; Step 66: Determine the heading difference and speed difference: Calculate the heading difference F and speed difference S between waypoint B and its adjacent waypoints on the left and right, and compare them with the corresponding heading difference threshold F1 or speed difference threshold S1. Specifically: When F≤F1 and S≤S1, delete all track points between the start and end points; When F > F1 or S > S1, then retain track point B and the track point corresponding to F > F1 or S > S1. Step 67, Recursive processing: Repeat steps 63 to 67 for each newly generated sub-straight line to obtain all track retention points; Step 68: Output the thinned track curve: Connect the starting point, the ending point, and the last retained track point determined in steps 65 to 67 in chronological order to form the thinned track curve.
7. The optimized method for storing and retrieving ship target trajectory data according to claim 6, characterized in that: In step 6, the distance threshold D is set to 0.00001°.
8. The optimized method for storing and retrieving ship target trajectory data according to claim 6, characterized in that: In step 6, the heading difference threshold F1 is 30 degrees; the speed difference threshold S1 is 5 knots.
9. The optimized method for storing and retrieving ship target trajectory data according to claim 1, characterized in that: In step 1, the specific method for constructing the spatial grid is as follows: Step 11: Determine the starting origin: In the WGS84 coordinate system, take the lower left corner point P of the monitored area as the starting point. 11 (x, y) is the starting point, where x represents longitude and y represents latitude; Step 12: Construct the meridional grid points: starting from the origin P 11 A meridional grid point P is generated eastward from (x, y) with a longitude span of l. 12 (x + l, y), then P 12 Starting from (x + l, y), continue eastward to generate the next meridional grid point P with a longitude span of l. 13 (x + 2l, y), and so on, continuously generating meridional grid points P. 14 (x + 3l, y), P 15 (x + 4l, y), ...; Until the monitored area is fully covered along the longitude direction; Step 13: Construct the latitudinal grid points: starting from the origin P 11 A latitudinal grid point P is generated northward from (x, y) with a latitude span of l. 21 (x, y + l), then P 21 Starting from (x, y + l), continue northwards to generate the next latitudinal grid point P with a latitude span of l. 31 (x, y + 2l), and so on, continuously generating latitudinal grid points P. 41 (x, y + 3l), P 51 (x, y+4l), ...; Until the monitored area is fully covered in both latitudinal directions; Step 14: Construct a spatial grid: Generate a true north line through each meridional grid point and a true east line through each latitudinal grid point; all direct intersections form a spatial grid that can cover the monitored area.
Citation Information
Patent Citations
Method and device for generating GPS trajectory curve
CN109870713A
Track data processing method and device, readable storage medium and electronic equipment
CN113806426A