Method, apparatus, device and computer-readable medium for trajectory compression

By screening and determining the degree of deviation and driving duration of trajectory points, key trajectory points are selected for compression, which solves the problem of long trajectory data compression time in the existing technology and realizes efficient trajectory data processing and real-time visualization.

CN114925291BActive Publication Date: 2025-09-12JINGDONG CITY BEIJING DIGITS TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202210429166.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-04-22
Publication Date
2025-09-12
Estimated Expiration
2042-04-22

AI Technical Summary

Technical Problem

The time complexity of trajectory data compression methods in the existing technology is too high, which increases the compression time and cannot effectively process the massive and growing trajectory data.

Method used

By screening out the retained trajectory points with a deviation greater than a threshold from the trajectory points, and combining the driving time of the trajectory points to determine the key trajectory points, the key trajectory points are screened out for compression to reduce the time complexity.

Benefits of technology

It reduces the time complexity of trajectory data compression, reduces compression time, improves the efficiency of processing massive trajectory data, and supports upper-level applications such as real-time trajectory visualization.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114925291B_ABST
    Figure CN114925291B_ABST
Patent Text Reader

Abstract

The present invention discloses a method, apparatus, device, and computer-readable medium for trajectory compression, and relates to the field of computer technology. A specific implementation of the method includes: among the trajectory points of a driving trajectory, screening out the retained trajectory points of the driving trajectory according to the degree of deviation of the trajectory points from the road; determining the retained trajectory points as key trajectory points based on the driving duration of the retained trajectory points, where the driving duration is the time interval from the previous trajectory point of the retained trajectory point to the next trajectory point of the retained trajectory point; and adding the starting point of the driving trajectory, the key trajectory points, and the ending point of the driving trajectory to the compressed trajectory to compress the driving trajectory. This implementation can reduce the time complexity of compressed trajectory data, thereby reducing compression time.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and in particular to a trajectory compression method, apparatus, device, and computer-readable medium. Background Art

[0002] With the widespread use of smart locators and the advent of the big data era, massive amounts of trajectory data are being generated, including trajectory data from vehicles, pedestrians, and various data collection devices. This massive and ever-increasing volume of trajectory data requires more storage space, but physical storage resources are precious and limited. This necessitates compression of trajectory data, specifically minimizing its footprint while ensuring data availability.

[0003] In the process of implementing the present invention, the inventors discovered that there are at least the following problems in the prior art: when using a lossy compression method to compress trajectory data, the time complexity is too high, resulting in increased compression time. Summary of the Invention

[0004] In view of this, embodiments of the present invention provide a trajectory compression method, apparatus, device, and computer-readable medium, which can reduce the time complexity of compressing trajectory data, thereby reducing compression time.

[0005] To achieve the above objective, according to one aspect of an embodiment of the present invention, a trajectory compression method is provided, comprising:

[0006] Among the track points of the driving track, selecting the retained track points of the driving track according to the degree of deviation between the track points and the road;

[0007] Determining the reserved trajectory point as a key trajectory point based on a driving duration of the reserved trajectory point, wherein the driving duration is a time interval from a trajectory point preceding the reserved trajectory point to a trajectory point following the reserved trajectory point;

[0008] The starting point of the driving trajectory, the key trajectory point and the ending point of the driving trajectory are added to the compressed trajectory to compress the driving trajectory.

[0009] The method of screening out the retained track points of the driving trajectory according to the degree of deviation between the track points and the road includes:

[0010] determining, among the trajectory points of the driving trajectory, a degree of deviation of the current trajectory point based on a trajectory point preceding the current trajectory point and a trajectory point following the current trajectory point;

[0011] The current trajectory point whose deviation degree is greater than the deviation threshold is used as the reserved trajectory point.

[0012] The determining the degree of deviation of the current trajectory point based on a trajectory point preceding the current trajectory point and a trajectory point following the current trajectory point includes:

[0013] According to the previous trajectory point, the current trajectory point and the next trajectory point, locating the radius of the circle where the current trajectory point is located;

[0014] The degree of deviation of the current trajectory point is determined by the radius of the circle where the current trajectory point is located.

[0015] The step of taking the current trajectory point whose deviation degree is greater than the deviation threshold as the reserved trajectory point includes:

[0016] One or more deviation thresholds are set according to the road, and the deviation threshold is determined according to the road where the current trajectory point is located;

[0017] The current trajectory point whose deviation degree is greater than the determined deviation threshold is used as the reserved trajectory point.

[0018] The step of determining the reserved trajectory point as a key trajectory point in combination with the travel time of the reserved trajectory point includes:

[0019] Determining the space-time curvature of the reserved trajectory point according to the travel time of the reserved trajectory point and the radius of the circle in which the reserved trajectory point is located, wherein the travel time of the reserved trajectory point is the time interval from the previous trajectory point of the reserved trajectory point to the next trajectory point of the reserved trajectory point, and the radius of the circle in which the reserved trajectory point is located is determined by the previous trajectory point, the current trajectory point, and the next trajectory point;

[0020] If the spatiotemporal curvature of the retained trajectory point is greater than a preset spatiotemporal threshold, the retained trajectory point is determined as a key trajectory point.

[0021] The method of screening out the retained track points of the driving trajectory according to the degree of deviation between the track points and the road includes:

[0022] Among the trajectory points of the driving trajectory, the trajectory points having a degree of deviation greater than a deviation threshold are screened out as retained trajectory points, where the degree of deviation is determined by the driving time of the trajectory point and the radius of the circle in which the trajectory point is located;

[0023] The step of determining the reserved trajectory point as a key trajectory point in combination with the travel time of the reserved trajectory point includes:

[0024] A reserved trajectory point with a ratio greater than a key threshold is used as the key trajectory point, where the ratio is equal to the quotient of the driving time of the reserved trajectory point and the radius of the circle where the reserved trajectory point is located.

[0025] The deviation threshold and the critical threshold are determined by the number of trajectory points in the compression trajectory and the number of trajectory points in the driving trajectory.

[0026] According to a second aspect of an embodiment of the present invention, there is provided a trajectory compression apparatus, comprising:

[0027] a screening module, configured to screen out, from among the track points of the driving track, the track points to be retained according to the degree of deviation between the track points and the road;

[0028] a determination module, configured to determine the reserved trajectory point as a key trajectory point in combination with a travel time of the reserved trajectory point, wherein the travel time is a time interval from a trajectory point preceding the reserved trajectory point to a trajectory point following the reserved trajectory point;

[0029] The compression module is used to add the starting point of the driving trajectory, the key trajectory point and the ending point of the driving trajectory to the compressed trajectory to compress the driving trajectory.

[0030] According to a third aspect of an embodiment of the present invention, there is provided an electronic device for trajectory compression, comprising:

[0031] one or more processors;

[0032] a storage device for storing one or more programs,

[0033] When the one or more programs are executed by the one or more processors, the one or more processors implement the above-described method.

[0034] According to a fourth aspect of an embodiment of the present invention, a computer-readable medium is provided, on which a computer program is stored. When the program is executed by a processor, the method described above is implemented.

[0035] One embodiment of the above invention has the following advantages or beneficial effects: among the trajectory points of a driving trajectory, retained trajectory points of the driving trajectory are screened according to the degree of deviation of the trajectory points from the road; the retained trajectory points are determined as key trajectory points based on the driving time of the retained trajectory points, where the driving time is the time interval from the trajectory point before the retained trajectory point to the trajectory point after the retained trajectory point; the starting point of the driving trajectory, the key trajectory points, and the ending point of the driving trajectory are added to the compressed trajectory to compress the driving trajectory. Because the number of key trajectory points is much smaller than the number of trajectory points, the time complexity of compressing the trajectory data can be reduced, thereby reducing the compression time.

[0036] The further effects of the above-mentioned non-conventional optional manner will be described below in conjunction with specific embodiments. BRIEF DESCRIPTION OF THE DRAWINGS

[0037] The accompanying drawings are provided for a better understanding of the present invention and are not intended to limit the present invention.

[0038] Figure 1 is a schematic diagram of the main flow of a method for trajectory compression according to an embodiment of the present invention;

[0039] Figure 2 is a schematic diagram of a process for screening retained trajectory points of a driving trajectory according to an embodiment of the present invention;

[0040] Figure 3 is a schematic diagram of a process for determining the degree of deviation of a current trajectory point according to an embodiment of the present invention;

[0041] Figure 4 is a schematic diagram of vehicle driving according to an embodiment of the present invention;

[0042] Figure 5 is a schematic diagram of a process for determining a retained trajectory point according to an embodiment of the present invention;

[0043] Figure 6 is a schematic diagram of the degree of trajectory deviation under time constraints according to an embodiment of the present invention;

[0044] Figure 7 is a schematic diagram of a process for determining key trajectory points according to an embodiment of the present invention;

[0045] Figure 8 is a schematic diagram of a compression ratio trajectory according to an embodiment of the present invention;

[0046] Figure 9 is a schematic diagram of an application flow of a method for trajectory compression according to an embodiment of the present invention;

[0047] Figure 10 is a schematic diagram of the main structure of a trajectory compression device according to an embodiment of the present invention;

[0048] Figure 11 is an exemplary system architecture diagram in which embodiments of the present invention may be applied;

[0049] Figure 12 It is a schematic diagram of the structure of a computer system of a terminal device or a server suitable for implementing an embodiment of the present invention. DETAILED DESCRIPTION

[0050] The following description of exemplary embodiments of the present invention is made in conjunction with the accompanying drawings, in which various details of the embodiments of the present invention are included to facilitate understanding. These details should be considered as merely exemplary. Therefore, it should be appreciated by those skilled in the art that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present invention. Similarly, for the sake of clarity and conciseness, descriptions of well-known functions and structures are omitted in the following description.

[0051] Currently, there are two main types of trajectory compression strategies: lossy and lossless. Lossy compression achieves compression by not recording points that contribute little to the trajectory information, while ensuring that the compression error remains within an acceptable range. However, since some trajectory points are directly lost, the original trajectory cannot be restored from the compressed trajectory. Lossless compression generally provides less effective compression than lossy compression, resulting in a relatively low compression ratio. However, it retains all the original trajectory information, allowing for complete restoration.

[0052] The main lossy compression method is the Douglas-Peucker algorithm, referred to as the DP algorithm. It is based on the idea of ​​dynamic programming algorithm to globally consider trajectory information. By setting a threshold and iteratively screening out trajectory points that exceed the threshold, it achieves the purpose of trajectory thinning and compression while maintaining the original trajectory shape.

[0053] The DP algorithm is a lossy compression algorithm with three main disadvantages:

[0054] First, the time complexity is high.

[0055] The time complexity of the DP algorithm is O(n 2 ), where n is the number of points in the trajectory. Excessive time complexity increases compression time, which in turn affects the user experience of upper-layer applications such as trajectory visualization.

[0056] Second, you need to know the global information in advance.

[0057] The DP algorithm requires input of all trajectory points before running. Firstly, with limited memory, inputting a large amount of trajectory data can easily cause memory overflow, making it impossible to process the trajectory. Secondly, trajectories are generated continuously and dynamically, and it is impossible to wait for all trajectory points to be generated before processing. This requires the compression algorithm to have streaming processing capabilities, that is, to process each trajectory point as it is generated, which the DP algorithm does not have.

[0058] Third, the key trajectory points generated when switching roads cannot be well preserved.

[0059] When the DP algorithm was designed, it did not take into account the changes in trajectory curvature of moving objects such as vehicles when switching roads on the road network. As a result, it was unable to capture the trajectory points generated at road intersections, and thus lost some key trajectory information.

[0060] In summary, the existing method of compressing trajectory data has a high time complexity, which increases the compression time.

[0061] In order to solve the technical problem of high time complexity, the following technical solutions in the embodiments of the present invention may be adopted.

[0062] See also Figure 1 , Figure 1 3 is a schematic diagram of the main process of the trajectory compression method according to an embodiment of the present invention, which realizes trajectory compression by screening out key trajectory points from the trajectory points of the driving trajectory.

[0063] like Figure 1 As shown, the specific steps include:

[0064] S101. Filter out the remaining track points of the driving trajectory according to the degree of deviation between the track points and the road.

[0065] In a road network, vehicles and pedestrians travel on the road. The location of a vehicle / pedestrian is called a trajectory point. A trajectory point p = <lng; lat; t>, where the coordinates of a trajectory point consist of a longitude lng, a latitude lat, and a timestamp t. A trajectory point represents the geographic coordinate location of a moving object at time t. <lng;lat>。

[0066] The set of trajectory points of the same vehicle or pedestrian is called a driving trajectory. Driving trajectory tr=<p1,p2,…,p n >, where p i = <lng i ;lat i ;t i > is a trajectory point, and for any two points p i and p j , if i>j, then t i >t j , that is, the trajectory points are arranged in time sequence. The following takes the vehicle's driving trajectory as an example for illustrative explanation.

[0067] Individual roads in a spatial road network are often straight. When a vehicle travels on a road, its trajectory points are mostly straight, ignoring positioning errors. Therefore, we can filter out retained trajectory points based on their deviation from the road. The number of retained trajectory points is smaller than the total number of trajectory points.

[0068] See also Figure 2 , Figure 2 This is a schematic diagram of a process for filtering out retained track points of a driving track according to an embodiment of the present invention. Specifically, the following steps are included:

[0069] S201 : Determine, among the trajectory points of the driving trajectory, a degree of deviation of the current trajectory point based on a trajectory point preceding the current trajectory point and a trajectory point following the current trajectory point.

[0070] The driving trajectory includes multiple trajectory points. The plane of the current trajectory point can be determined by the previous trajectory point, the current trajectory point and the next trajectory point, and then the degree of deviation of the current trajectory point from the road can be determined.

[0071] See also Figure 3 , Figure 3 1 is a flow chart of determining the degree of deviation of the current trajectory point according to an embodiment of the present invention. Specifically, the following steps are included:

[0072] S301: Locate the radius of the circle where the current track point is located according to the previous track point, the current track point and the next track point.

[0073] A plane can be determined based on the previous, current, and next trajectory points. Specifically, the radius of the circle surrounding the current trajectory point is determined based on the previous, current, and next trajectory points. The larger the radius of the circle, the more likely the three trajectory points form a straight line. The smaller the radius, the more likely the three trajectory points form an arc, potentially indicating a vehicle change of direction.

[0074] See also Figure 4 , Figure 4 is a schematic diagram of vehicle driving according to an embodiment of the present invention. Figure 4 The gray line in the figure represents the actual road. The vehicle travels from p1 to p3, as shown in: p1→p2→p3. At this time, the radius of the circle formed by the three trajectory points is larger.

[0075] If a vehicle enters an intersection and is about to change lanes, its trajectory will bend, and the vehicle will travel from p4 to p6, such as: Figure 4 As shown in p4→p5→p6, the radius of the circle formed by the three trajectory points becomes smaller.

[0076] S302: Determine the degree of deviation of the current trajectory point based on the radius of the circle where the current trajectory point is located.

[0077] The smaller the radius of the circle where the current trajectory point is located, the higher the degree of deviation of the current trajectory point; the larger the radius of the circle where the current trajectory point is located, the lower the degree of deviation of the current trajectory point.

[0078] In one embodiment of the present invention, the degree to which the curve formed by the three trajectory points deviates from the straight line is measured by the spatial curvature. i-1 、p i and p i+1 are three consecutive trajectory points, r is the radius of the circle determined by the three points, then define p i The spatial curvature K s =1 / r. In special cases, if the three trajectory points are collinear, then K is specified. s =0.

[0079] The greater the spatial curvature, the greater the curvature of the curve, and the more information the trajectory point contains. For example, if the vehicle is currently traveling at an intersection, the trajectory point should be retained.

[0080] exist Figure 3 In the embodiment, the offset degree of the current trajectory point is determined by three trajectory points.

[0081] S202: The current trajectory point whose deviation degree is greater than the deviation threshold is used as a reserved trajectory point.

[0082] A deviation threshold is preset. If the current trajectory point's deviation exceeds the threshold, it indicates that the current trajectory point may be a vehicle traveling at an intersection and needs to be retained. Therefore, the current trajectory point with a deviation greater than the threshold is considered a retained trajectory point.

[0083] See also Figure 5 , Figure 5 This is a schematic diagram of a process for determining retained trajectory points according to an embodiment of the present invention. Specifically, the following steps are included:

[0084] S501. Set one or more deviation thresholds according to the road, and determine the deviation threshold according to the road where the current trajectory point is located.

[0085] Roads are generally straight. However, in special cases, such as mountainous areas, roads can be quite curvy. Therefore, one or more deviation thresholds can be set for each road. For example, for a straight road, one deviation threshold can be set; for a curvy road, multiple deviation thresholds can be set based on the curvature. For the current track point, the deviation threshold can be determined based on the road it is on.

[0086] S502: The current trajectory point whose deviation degree is greater than the determined deviation threshold is used as a reserved trajectory point.

[0087] If the deviation degree of the current trajectory point is greater than the deviation threshold, it means that the vehicle is more likely to turn on the road. Furthermore, the current trajectory point with a deviation degree greater than the determined deviation threshold can be used as a retained trajectory point.

[0088] exist Figure 5In the embodiment, multiple deviation thresholds are set for the road, thereby being applicable to trajectory compression in roads of various shapes.

[0089] S102. Determine the reserved trajectory point as a key trajectory point based on the driving duration of the reserved trajectory point, where the driving duration is the time interval from the previous trajectory point of the reserved trajectory point to the next trajectory point of the reserved trajectory point.

[0090] In the practice of trajectory compression, the retained trajectory points with a large degree of deviation are not necessarily generated when the road switches, but may also be noise points.

[0091] See also Figure 6 , Figure 6 Schematic diagram of trajectory deviation degree under time constraint according to an embodiment of the present invention. Figure 6 In the figure, p1→p2→p3 shows that p2 has a high degree of deviation. However, the vehicle is traveling on a straight road and should not have a trajectory point with a high degree of deviation. This phenomenon occurs because p2 is a noise point that deviates far from the original path, resulting in a misjudgment.

[0092] In order to correctly identify noise points, in an embodiment of the present invention, the reserved track points are determined as key track points in combination with their travel time. Travel time is the time interval from the previous track point to the next track point.

[0093] That is, when the time range, i.e., the driving time, is small, it means that the three track points were generated in a short time, and the three track points should be on the same straight line. If the noise point generated at this time causes the track to deviate, a smaller time range can also minimize the deviation, so that the track point will be discarded, such as Figure 6 point p2.

[0094] On the contrary, when the driving time is long, it means that the time difference between the three trajectory points is large. In this case, even if there is a deviation, it can be considered that the vehicle has traveled to other roads during this period. However, the trajectory points on other roads have not been collected due to the low sampling rate of the device. At this time, the degree of deviation is large, and the trajectory point is eventually retained. Figure 6 p5 point.

[0095] See also Figure 7 , Figure 7 This is a schematic diagram of a process for determining key trajectory points according to an embodiment of the present invention. Specifically, the following steps are included:

[0096] S701. Determine the spatiotemporal curvature of the retained trajectory point based on the travel duration of the retained trajectory point and the radius of the circle in which the retained trajectory point is located. The travel duration of the retained trajectory point is the time interval from the previous trajectory point to the next trajectory point of the retained trajectory point. The radius of the circle in which the retained trajectory point is located is determined by the previous trajectory point, the current trajectory point, and the next trajectory point.

[0097] In the embodiment of the present invention, in order to obtain the key trajectory points, it is necessary to determine the space-time curvature of the retained trajectory points. Specifically, the space-time curvature of the retained trajectory points is determined based on the travel time of the retained trajectory points and the radius of the circle in which the retained trajectory points are located.

[0098] The travel time of a reserved track point is the time interval between the previous track point and the next track point. The radius of the circle where the reserved track point is located is determined by the previous track point, the current track point, and the next track point.

[0099] As an example, the space-time curvature of the retained trajectory point is equal to the ratio of the travel time of the retained trajectory point to the radius of the circle where the retained trajectory point is located. Let p i-1 、p i and p i+1 For three consecutive trajectory points, K i For p i The spatial curvature of , then define p i The spacetime curvature K st =K s *Δt=Δt / r. Where Δt=t i+1 -t i-1 .

[0100] Spacetime curvature measures the degree of deviation of the curve formed by three points under the time constraint. The time constraint here is the time range Δt generated by the three points. Under the condition of the same spatial curvature, the larger the time range, the greater the spacetime curvature, and the more likely the trajectory points should be retained.

[0101] S702: If the spatiotemporal curvature of the retained trajectory point is greater than a preset spatiotemporal threshold, the retained trajectory point is determined as a key trajectory point.

[0102] In an embodiment of the present invention, key trajectory points are determined by a preset spatiotemporal threshold. The preset spatiotemporal threshold can be set based on actual application scenarios and experience. Specifically, if the spatiotemporal curvature of a retained trajectory point is greater than the preset spatiotemporal threshold, the retained trajectory point is determined to be a key trajectory point.

[0103] exist Figure 7In the embodiment, spacetime curvature retains the advantage of spatial curvature in identifying key trajectory points at bends while having a certain ability to resist noise interference. The purpose of trajectory compression is to retain points with larger spacetime curvature as much as possible and discard points with smaller spacetime curvature.

[0104] In one embodiment of the present invention, taking the space-time curvature into consideration can not only determine the key trajectory points, but also screen out the retained trajectory points.

[0105] Specifically, among the points in the driving trajectory, those with a degree of deviation greater than a deviation threshold are screened and retained as track points. The degree of deviation is determined by the driving duration of the track point and the radius of the circle in which the track point lies. In other words, the degree of deviation is determined by the ratio of the driving duration of the track point to the radius of the circle in which the track point lies.

[0106] Then, the retained trajectory points with a ratio greater than a critical threshold are taken as key trajectory points. The above ratio is equal to the quotient of the travel time of the retained trajectory point and the radius of the circle where the retained trajectory point is located.

[0107] As an example, if the deviation threshold is less than the critical threshold, the deviation threshold is first used to filter out the retained trajectory points; then, the critical threshold is used to identify the key trajectory points among the retained trajectory points. As another example, if the deviation threshold is equal to the critical threshold, the key trajectory points can be identified among the trajectory points through a single comparison.

[0108] S103: Add the starting point, key trajectory points, and end point of the driving trajectory to the compressed trajectory to compress the driving trajectory.

[0109] Trajectories are generated on the road network and are the points on a vehicle's trajectory as it travels continuously along different roads. When a vehicle passes from one road to another, it inevitably deviates, causing the intersections to bend. Trajectory compression aims to eliminate invalid points in the trajectory while preserving as many key points as possible.

[0110] Trajectory points generated on a straight road, excluding the first and last points, are invalid points because they do not provide any information. The first and last points alone cannot be used to infer that the vehicle was traveling on that road. Conversely, trajectory points generated at the intersection of different roads, such as the first and last points, are key trajectory points. The goal of trajectory compression is to retain as many key trajectory points as possible and discard invalid points. Furthermore, the starting point, key trajectory points, and end point of the driving trajectory are added to the compressed trajectory to compress the driving trajectory.

[0111] In one embodiment of the present invention, the deviation threshold and critical threshold are determined by the number of track points in the compressed trajectory and the number of track points in the driving trajectory. As an example, compression ratio = number of original track points / number of compressed track points. The greater the compression ratio, the greater the deviation threshold and critical threshold. A deep learning model can be used to determine the specific functional relationship between the deviation threshold and critical threshold and the compression ratio.

[0112] See also Figure 8 , Figure 8 2 is a schematic diagram of a compression ratio trajectory according to an embodiment of the present invention. Figure 8 The upper left picture is the original trajectory from location A to location B; Figure 8 The upper right figure shows compression trajectory 1 for determining the deviation threshold and key threshold at the first compression ratio; Figure 8 The lower left figure shows compression trajectory 2 for determining the deviation threshold and the key threshold at the second compression ratio; Figure 8 The lower right figure shows compression trajectory 3, which determines the deviation threshold and key threshold at the third compression ratio. Here, the first compression ratio < the second compression ratio < the third compression ratio. As can be seen, the number of key trajectory points decreases as the compression ratio increases.

[0113] Depend on Figure 8 As can be seen, as the compression ratio increases, the deviation threshold and critical threshold increase. This increase in deviation threshold and critical threshold makes the conditions for defining critical trajectory points more stringent, thus tending to retain trajectory points at intersections, thereby achieving better compression effects while also preserving key driving information for the entire trajectory.

[0114] See also Figure 9 , Figure 9 This is a schematic diagram of the application process of the trajectory compression method according to an embodiment of the present invention. Specifically, it includes the following steps:

[0115] The deviation threshold is equal to the critical threshold, both equal to K0. Calculate the space-time curvature K of each trajectory point in turn st , if K st ≥K0, then the trajectory point is regarded as a key trajectory point, otherwise it is discarded. For the starting point and the end point of the driving trajectory, the space-time curvature cannot be calculated. For this, the starting point and the end point of the driving trajectory can be directly retained.

[0116] First, K0 is preset, the compressed trajectory tr′ is set to an empty set, and the starting point is added. Read the trajectory to be processed tr = <p1,…,p n >, calculate the space-time curvature K of all trajectory points except the starting point and the end point in turn st If K st If ≥K0, the trajectory point is retained, otherwise it is discarded. Finally, the end point is added to the compressed trajectory, the result is returned, and the compression task ends.

[0117] Using the above-described embodiment of the present invention, among the points in a driving trajectory, retained trajectory points are screened based on their degree of deviation from the road. These retained trajectory points are then identified as key trajectory points based on their driving duration. The starting point of the driving trajectory, the key trajectory points, and the end point of the driving trajectory are then added to a compressed trajectory to compress the driving trajectory. Because the number of key trajectory points is significantly smaller than the number of trajectory points, the time complexity of compressing trajectory data can be reduced, thereby reducing compression time.

[0118] In this embodiment of the present invention, only three trajectory points are required to determine a trajectory point: the previous trajectory point, the current trajectory point, and the next trajectory point. This is a constant and can be ignored when calculating the time complexity, that is, the time complexity is O(n). Compared with the traditional DP algorithm, this significantly reduces time consumption and effectively improves the user experience.

[0119] Furthermore, when determining whether a trajectory point should be retained, only local information—that is, information about only three trajectory points—is required, without global information. This eliminates the need to load the entire trajectory into memory for computation. In the context of big data, this significantly reduces the need for memory resources, enabling the system to handle massive amounts of trajectory data.

[0120] Finally, as trajectory points are dynamically generated, the decision to retain them is also being made. This is also due to the fact that it does not require global information for calculation, which allows for richer upper-layer applications, such as real-time trajectory thinning, compression, and visualization.

[0121] See also Figure 10 , Figure 10 Schematic diagram of the main structure of the trajectory compression device according to an embodiment of the present invention. The trajectory compression device can implement the trajectory compression method, such as Figure 10 As shown, the trajectory compression device specifically includes:

[0122] A screening module 1001 is configured to screen out the retained track points of the driving trajectory according to the degree of deviation between the track points and the road;

[0123] A determination module 1002 is configured to determine the reserved trajectory point as a key trajectory point based on a travel time of the reserved trajectory point, wherein the travel time is a time interval from a trajectory point preceding the reserved trajectory point to a trajectory point following the reserved trajectory point;

[0124] The compression module 1003 is configured to add the starting point of the driving trajectory, the key trajectory points, and the ending point of the driving trajectory to a compressed trajectory, so as to compress the driving trajectory.

[0125] In one embodiment of the present invention, the screening module 1001 is specifically configured to determine, among the trajectory points of the driving trajectory, a degree of deviation of the current trajectory point based on a trajectory point preceding the current trajectory point and a trajectory point following the current trajectory point;

[0126] The current trajectory point whose deviation degree is greater than the deviation threshold is used as the reserved trajectory point.

[0127] In one embodiment of the present invention, the screening module 1001 is specifically configured to locate the radius of the circle where the current trajectory point is located according to the previous trajectory point, the current trajectory point, and the next trajectory point;

[0128] The degree of deviation of the current trajectory point is determined by the radius of the circle where the current trajectory point is located.

[0129] In one embodiment of the present invention, the screening module 1001 is specifically configured to set one or more deviation thresholds according to the road, and determine the deviation threshold according to the road where the current trajectory point is located;

[0130] The current trajectory point whose deviation degree is greater than the determined deviation threshold is used as the reserved trajectory point.

[0131] In one embodiment of the present invention, the determination module 1002 is specifically configured to determine the spatiotemporal curvature of the reserved trajectory point based on the travel duration of the reserved trajectory point and the radius of the circle in which the reserved trajectory point is located, wherein the travel duration of the reserved trajectory point is the time interval between the previous trajectory point of the reserved trajectory point and the next trajectory point of the reserved trajectory point, and the radius of the circle in which the reserved trajectory point is located is determined by the previous trajectory point, the current trajectory point, and the next trajectory point;

[0132] If the spatiotemporal curvature of the retained trajectory point is greater than a preset spatiotemporal threshold, the retained trajectory point is determined as a key trajectory point.

[0133] In one embodiment of the present invention, the screening module 1001 is specifically configured to screen out, from among the trajectory points of the driving trajectory, trajectory points whose degree of deviation is greater than a deviation threshold, and select them as retained trajectory points, wherein the degree of deviation is determined by the driving time of the trajectory point and the radius of the circle in which the trajectory point is located;

[0134] The determination module 1002 is specifically configured to select a retained trajectory point having a ratio greater than a key threshold as the key trajectory point, where the ratio is equal to the quotient of the driving time of the retained trajectory point and the radius of the circle in which the retained trajectory point is located.

[0135] In one embodiment of the present invention, the deviation threshold and the critical threshold are determined by the number of trajectory points in the compressed trajectory and the number of trajectory points in the driving trajectory.

[0136] Figure 11 An exemplary system architecture 1100 is shown to which the method or apparatus for trajectory compression according to an embodiment of the present invention may be applied.

[0137] like Figure 11 As shown, system architecture 1100 may include terminal devices 1101, 1102, and 1103, a network 1104, and a server 1105. Network 1104 is used to provide a medium for communication links between terminal devices 1101, 1102, and 1103 and server 1105. Network 1104 may include various connection types, such as wired or wireless communication links or fiber optic cables.

[0138] Users can use terminal devices 1101, 1102, and 1103 to interact with server 1105 via network 1104 to receive or send messages, etc. Various communication client applications can be installed on terminal devices 1101, 1102, and 1103, such as shopping applications, web browser applications, search applications, instant messaging tools, email clients, social platform software, etc. (only as examples).

[0139] The terminal devices 1101 , 1102 , and 1103 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smart phones, tablet computers, laptop computers, and desktop computers.

[0140] Server 1105 may be a server that provides various services, such as a backend management server (for example only) that supports shopping websites browsed by users using terminal devices 1101, 1102, and 1103. The backend management server may analyze and process received data such as product information query requests, and feed back processing results (for example, target push information and product information—for example only) to the terminal device.

[0141] It should be noted that the trajectory compression method provided in the embodiment of the present invention is generally executed by the server 1105 , and accordingly, the trajectory compression device is generally disposed in the server 1105 .

[0142] It should be understood that Figure 11 The number of terminal devices, networks and servers in the embodiment is merely illustrative. Any number of terminal devices, networks and servers may be provided as required.

[0143] Reference below Figure 12, which shows a schematic structural diagram of a computer system 1200 of a terminal device suitable for implementing an embodiment of the present invention. Figure 12 The terminal device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present invention.

[0144] like Figure 12 As shown, the computer system 1200 includes a central processing unit (CPU) 1201, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 1202 or a program loaded from a storage unit 1208 into a random access memory (RAM) 1203. Various programs and data required for the operation of the system 1200 are also stored in the RAM 1203. The CPU 1201, the ROM 1202, and the RAM 1203 are connected to each other via a bus 1204. An input / output (I / O) interface 1205 is also connected to the bus 1204.

[0145] The following components are connected to the I / O interface 1205: an input section 1206 including a keyboard, a mouse, and the like; an output section 1207 including devices such as a cathode ray tube (CRT), a liquid crystal display (LCD), and speakers; a storage section 1208 including a hard disk; and a communication section 1209 including a network interface card such as a LAN card or a modem. The communication section 1209 performs communication processing via a network such as the Internet. A drive 1210 is also connected to the I / O interface 1205 as needed. Removable media 1211, such as a magnetic disk, an optical disk, a magneto-optical disk, or a semiconductor memory, is installed in the drive 1210 as needed, so that computer programs read therefrom can be installed into the storage section 1208 as needed.

[0146] In particular, according to the embodiments disclosed herein, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, the embodiments disclosed herein include a computer program product comprising a computer program carried on a computer-readable medium, the computer program comprising program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network via the communication section 1209, and / or installed from a removable medium 1211. When the computer program is executed by the central processing unit (CPU) 1201, the above-mentioned functions defined in the system of the present invention are performed.

[0147] It should be noted that the computer-readable medium described in the present invention can be a computer-readable signal medium or a computer-readable storage medium, or any combination thereof. A computer-readable storage medium can be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of computer-readable storage media can include, but are not limited to, an electrical connection having one or more conductors, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In the present invention, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. In the present invention, a computer-readable signal medium can include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code. This propagated data signal can take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium that can transmit, propagate, or transport a program for use by or in conjunction with an instruction execution system, apparatus, or device. Program code embodied on a computer-readable medium may be transmitted using any suitable medium, including but not limited to wireless, wireline, optical fiber cable, RF, or any suitable combination thereof.

[0148] The flowcharts and block diagrams in the accompanying drawings illustrate the possible implementation architecture, functions and operations of the systems, methods and computer program products according to various embodiments of the present invention. In this regard, each box in the flowchart or block diagram can represent a module, program segment, or a part of code, and the above-mentioned module, program segment, or a part of code contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in an order different from that marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flowchart, and the combination of boxes in the block diagram or flowchart, can be implemented with a dedicated hardware-based system that performs the specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0149] The modules involved in the embodiments of the present invention may be implemented in software or hardware. The modules described may also be provided in a processor. For example, they may be described as follows: a processor including a screening module, a determination module, and a compression module. The names of these modules do not, in some cases, limit the modules themselves. For example, the screening module may also be described as "used to screen out the retained track points of the driving trajectory according to the degree of deviation of the track points from the road."

[0150] As another aspect, the present invention further provides a computer-readable medium, which may be included in the device described in the above embodiments, or may exist independently without being incorporated into the device. The computer-readable medium carries one or more programs, and when the one or more programs are executed by the device, the device includes:

[0151] Among the track points of the driving track, selecting the retained track points of the driving track according to the degree of deviation between the track points and the road;

[0152] Determining the reserved trajectory point as a key trajectory point based on a driving duration of the reserved trajectory point, wherein the driving duration is a time interval from a trajectory point preceding the reserved trajectory point to a trajectory point following the reserved trajectory point;

[0153] The starting point of the driving trajectory, the key trajectory point and the ending point of the driving trajectory are added to the compressed trajectory to compress the driving trajectory.

[0154] According to the technical solution of an embodiment of the present invention, among the trajectory points of a driving trajectory, the retained trajectory points of the driving trajectory are screened according to the degree of deviation of the trajectory points from the road; the retained trajectory points are determined as key trajectory points based on the driving time of the retained trajectory points, where the driving time is the time interval from the trajectory point before the retained trajectory point to the trajectory point after the retained trajectory point; the starting point of the driving trajectory, the key trajectory points, and the ending point of the driving trajectory are added to the compressed trajectory to compress the driving trajectory. Because the number of key trajectory points is much smaller than the number of trajectory points, the time complexity of compressing the trajectory data can be reduced, thereby reducing the compression time.

[0155] The above specific embodiments do not limit the scope of protection of the present invention. Those skilled in the art will appreciate that various modifications, combinations, sub-combinations, and substitutions may occur depending on design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of the present invention are intended to be included within the scope of protection of the present invention.

Claims

1. A trajectory compression method, characterized in that: Applied to real-time trajectory sparse compression and visualization, including: Among the track points of the driving track, selecting the retained track points of the driving track according to the degree of deviation between the track points and the road; Determining the reserved trajectory point as a key trajectory point based on a driving duration of the reserved trajectory point, wherein the driving duration is a time interval from a trajectory point preceding the reserved trajectory point to a trajectory point following the reserved trajectory point; adding the starting point of the driving trajectory, the key trajectory point, and the ending point of the driving trajectory to a compressed trajectory to compress the driving trajectory; The method of screening out the retained track points of the driving trajectory according to the degree of deviation between the track points and the road includes: Among the trajectory points of the driving trajectory, the trajectory points having a degree of deviation greater than a deviation threshold are screened out as retained trajectory points, where the degree of deviation is determined by the driving time of the trajectory point and the radius of the circle in which the trajectory point is located; The step of determining the reserved trajectory point as a key trajectory point in combination with the travel time of the reserved trajectory point includes: A reserved trajectory point with a ratio greater than a key threshold is used as the key trajectory point, where the ratio is equal to the quotient of the driving time of the reserved trajectory point and the radius of the circle where the reserved trajectory point is located.

2. The trajectory compression method according to claim 1, characterized in that: The method of screening out the retained track points of the driving trajectory according to the degree of deviation between the track points and the road includes: determining, among the trajectory points of the driving trajectory, a degree of deviation of the current trajectory point based on a trajectory point preceding the current trajectory point and a trajectory point following the current trajectory point; The current trajectory point whose deviation degree is greater than the deviation threshold is used as the reserved trajectory point.

3. The trajectory compression method according to claim 2, characterized in that: The determining the degree of deviation of the current trajectory point based on a trajectory point preceding the current trajectory point and a trajectory point following the current trajectory point includes: According to the previous trajectory point, the current trajectory point and the next trajectory point, locating the radius of the circle where the current trajectory point is located; The degree of deviation of the current trajectory point is determined by the radius of the circle where the current trajectory point is located.

4. The trajectory compression method according to claim 2, characterized in that: The step of taking the current trajectory point whose deviation degree is greater than the deviation threshold as the reserved trajectory point includes: One or more deviation thresholds are set according to the road, and the deviation threshold is determined according to the road where the current trajectory point is located; The current trajectory point whose deviation degree is greater than the determined deviation threshold is used as the reserved trajectory point.

5. The trajectory compression method according to claim 1, characterized in that: The step of determining the reserved trajectory point as a key trajectory point in combination with the travel time of the reserved trajectory point includes: Determining the space-time curvature of the reserved trajectory point according to the travel time of the reserved trajectory point and the radius of the circle in which the reserved trajectory point is located, wherein the travel time of the reserved trajectory point is the time interval from the previous trajectory point of the reserved trajectory point to the next trajectory point of the reserved trajectory point, and the radius of the circle in which the reserved trajectory point is located is determined by the previous trajectory point, the current trajectory point, and the next trajectory point; If the spatiotemporal curvature of the retained trajectory point is greater than a preset spatiotemporal threshold, the retained trajectory point is determined as a key trajectory point.

6. The trajectory compression method according to claim 1, characterized in that: The deviation threshold and the critical threshold are determined by the number of trajectory points in the compression trajectory and the number of trajectory points in the driving trajectory.

7. A trajectory compression device, characterized in that: Applied to real-time trajectory sparse compression and visualization, including: a screening module, configured to screen out, from among the trajectory points of the driving trajectory, retained trajectory points of the driving trajectory according to a degree of deviation of the trajectory points from the road; and, from among the trajectory points of the driving trajectory, screen out, as retained trajectory points, trajectory points whose degree of deviation is greater than a deviation threshold, the degree of deviation being determined by a driving duration of the trajectory point and a radius of a circle within which the trajectory point lies; a determination module, configured to determine the reserved trajectory point as a key trajectory point based on a travel duration of the reserved trajectory point, wherein the travel duration is a time interval from a trajectory point preceding the reserved trajectory point to a trajectory point following the reserved trajectory point; and to determine the reserved trajectory point having a ratio greater than a key threshold as the key trajectory point, wherein the ratio is equal to the quotient of the travel duration of the reserved trajectory point and the radius of the circle in which the reserved trajectory point is located; The compression module is used to add the starting point of the driving trajectory, the key trajectory point and the ending point of the driving trajectory to the compressed trajectory to compress the driving trajectory.

8. An electronic device for trajectory compression, characterized in that: include: one or more processors; a storage device for storing one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors implement the method according to any one of claims 1 to 6.

9. A computer-readable medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the method according to any one of claims 1 to 6 is implemented.

Citation Information

Patent Citations

  • Vehicle trajectory data compression method, device and equipment and storage medium

    CN111654290A