Trajectory compression method, apparatus, device, medium and product
By extracting the envelope and turning feature points from the trajectory data, and combining the difference algorithm and the extreme value method to process these feature points, the problem of high complexity in existing trajectory compression methods is solved, and efficient and accurate trajectory data compression is achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- AEROSPACE INFORMATION RES INST CAS
- Filing Date
- 2026-03-18
- Publication Date
- 2026-06-26
AI Technical Summary
Existing trajectory compression methods take the entire trajectory as the starting point, resulting in high algorithm runtime complexity and reliance on manual input parameters, leading to poor compression performance.
By extracting envelope feature points and turning feature points from trajectory data, and processing these feature points using difference algorithms and extremum methods, the fused data is used as compressed trajectory data, reducing operational complexity while preserving key geometric features.
While ensuring compression accuracy, the runtime complexity of trajectory data is significantly reduced, and key features of the trajectory are effectively preserved, achieving efficient trajectory data compression.
Smart Images

Figure CN122293093A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of information technology, and in particular to a trajectory compression method, apparatus, device, medium, and product. Background Technology
[0002] With the rapid development of location services, the BeiDou Navigation Satellite System, and the Internet of Things, as well as the increasing popularity of mobile smart terminals, the scale of mobile trajectory data is growing exponentially, posing a huge challenge to trajectory data storage, analysis, mining, and visualization. Therefore, trajectory compression has become one of the current research hotspots.
[0003] Existing compression methods achieve good compression results by taking the entire trajectory as the starting point, but their algorithm has high time complexity and depends on manual input parameters. In practical applications, due to insufficient experience in setting appropriate parameter thresholds, the expected compression effect is often not achieved. Summary of the Invention
[0004] This invention provides a trajectory compression method, apparatus, device, medium, and product to address the shortcomings of existing technologies that use the entire trajectory as the starting point and have high algorithm execution time complexity.
[0005] This invention provides a trajectory compression method, comprising: Obtain the trajectory data to be compressed, and determine the trajectory point sequence based on the trajectory data; Based on the trajectory point sequence, envelope feature points and turning feature points are determined; Based on the envelope feature points and the turning feature points, the compressed data of the trajectory data is determined.
[0006] According to a trajectory compression method provided by the present invention, determining compressed data of the trajectory data based on the envelope feature points and the turning feature points includes: Based on the envelope feature points, determine the optimal feature points; The optimal feature point and the turning feature point are fused together, and the fused feature point is used as the compressed data of the trajectory data.
[0007] According to a trajectory compression method provided by the present invention, determining the optimal feature points based on the envelope feature points includes: The envelope feature points are processed using the difference algorithm and the extreme value method, and the processed envelope feature points are taken as the optimal feature points.
[0008] According to a trajectory compression method provided by the present invention, determining envelope feature points and turning feature points based on the trajectory point sequence includes: Based on the coordinates of each trajectory point in the trajectory point sequence, determine the difference between each trajectory point in the envelope; If the difference between the trajectory points is less than a preset difference threshold, the trajectory points are used as envelope feature points. Based on the coordinates of each trajectory point in the trajectory point sequence, determine the turning angle at all intermediate trajectory points; If the turning angle at any of the intermediate trajectory points is greater than a preset turning threshold, the intermediate trajectory point is used as a turning feature point.
[0009] According to a trajectory compression method provided by the present invention, determining the turning angle at all intermediate trajectory points based on the coordinates of each trajectory point in the trajectory point sequence includes: Three consecutive trajectory points are extracted from the trajectory point sequence based on the window, and a first trajectory point vector and a second trajectory point vector are constructed based on the coordinates of the three consecutive trajectory points. The turning angle at the intermediate trajectory point is determined based on the angle between the first trajectory point vector and the second trajectory point vector. Repeat the above steps to determine the turning angle at all intermediate trajectory points.
[0010] According to a trajectory compression method provided by the present invention, determining the trajectory point sequence based on the trajectory data includes: Duplicate, abnormal, and drifting data are removed from the trajectory data to obtain a sequence of trajectory points.
[0011] The present invention also provides a trajectory compression device, comprising: The sequence determination module is used to acquire trajectory data to be compressed and determine the trajectory point sequence based on the trajectory data; The feature point determination module is used to determine envelope feature points and turning feature points based on the trajectory point sequence; The compressed data determination module is used to determine the compressed data of the trajectory data based on the envelope feature points and the turning feature points.
[0012] The present invention also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the trajectory compression method as described above.
[0013] The present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the trajectory compression method as described above.
[0014] The present invention also provides a computer program product, including a computer program that, when executed by a processor, implements the trajectory compression method as described above.
[0015] The present invention provides a trajectory compression method, apparatus, device, medium, and product that acquires trajectory data to be compressed; determines a trajectory point sequence based on the trajectory data; determines envelope feature points and turning feature points based on the trajectory point sequence; and determines compressed data of the trajectory data based on the envelope feature points and the turning feature points. The present invention extracts envelope feature points and turning feature points from trajectory data. Since these feature points contain the geometric features of the trajectory data, the time complexity of operation can be reduced while ensuring compression accuracy. Attached Figure Description
[0016] To more clearly illustrate the technical solutions in this invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.
[0017] Figure 1 This is a schematic flowchart of the trajectory compression method provided by the present invention.
[0018] Figure 2 This is one of the schematic diagrams of the trajectory compression effect provided by the present invention.
[0019] Figure 3 This is the second schematic diagram of the trajectory compression effect provided by the present invention.
[0020] Figure 4 This is the third schematic diagram of the trajectory compression effect provided by the present invention.
[0021] Figure 5 This is a schematic diagram of the trajectory compression device provided by the present invention.
[0022] Figure 6 This is a schematic diagram of the structure of the electronic device provided by the present invention. Detailed Implementation
[0023] To make the objectives, technical solutions, and advantages of this invention clearer, the technical solutions of this invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this invention. All other embodiments obtained by those skilled in the art based on the embodiments of this invention without creative effort are within the scope of protection of this invention.
[0024] Figure 1 This is a schematic flowchart of the trajectory compression method provided by the present invention, as shown below. Figure 1 As shown, the present invention provides a trajectory compression method, which may include steps S110-S130.
[0025] Step S110: Obtain the trajectory data to be compressed, and determine the trajectory point sequence based on the trajectory data.
[0026] Trajectory data typically refers to the record of the movement path of objects (such as vehicles, pedestrians, mobile phones, etc.) in space. The core includes attributes such as timestamps and latitude and longitude coordinates. Common formats are CSV (comma-separated), JSON (key-value pairs), or GPX (GPS exchange format), for example {"timestamp": "20XX-01-01 10:00:00", "lat": 39.9042, "lng":116.4074}.
[0027] There are three main ways to acquire trajectory data: hardware acquisition (such as GPS devices, vehicle OBD), software acquisition (such as mobile apps recording location via SDK), and open data sources (such as public traffic data, map API interfaces).
[0028] Trajectory data records the movement path of an object through continuous sampling and consists of a sequence of trajectory points arranged in chronological order. Correspondingly, determining the trajectory point sequence based on the trajectory data includes preprocessing the trajectory data and using the preprocessed trajectory data as the trajectory point sequence. Further, preprocessing the trajectory data refers to the process of cleaning, correcting, and optimizing the raw trajectory data, aiming to eliminate noise (such as GPS positioning drift), fill in missing values, correct outliers (such as sudden velocity changes or position jumps), and convert the data into a standard format, thereby improving the data quality, accuracy, and reliability of subsequent analysis.
[0029] Step S120: Based on the trajectory point sequence, determine the envelope feature points and turning feature points.
[0030] Envelope feature points are the extreme points located on the outermost edge of the trajectory contour in trajectory data, used to describe the overall shape and extent of the trajectory. For example, in vehicle trajectories, envelope feature points can identify the leftmost, rightmost, topmost, or bottommost boundary points of the vehicle's path, and are often used for trajectory compression or bounding box calculation.
[0031] Turning feature points are points in the trajectory where the direction changes significantly. They can be identified by calculating the angle or curvature between adjacent trajectory segments. Turning feature points can effectively capture local morphological changes in the trajectory, such as vehicle turning, U-turns, or obstacle avoidance.
[0032] Based on the trajectory point sequence, the envelope feature points and turning feature points are determined, including: extracting the envelope of the trajectory point sequence to determine the envelope feature points, and determining the turning feature points by analyzing the change in the turning angle at adjacent intermediate trajectory points or calculating the curvature extrema of the trajectory curve.
[0033] Step S130: Based on the envelope feature points and the turning feature points, determine the compressed data of the trajectory data.
[0034] Trajectory compression refers to reducing the number of redundant points in trajectory data through algorithms, while preserving key geometric features (such as shape and direction) or semantic features (such as stops and turns) of the trajectory. This significantly reduces data storage space and transmission costs while maintaining trajectory reconstruction accuracy. Based on the envelope feature points and the turning feature points, the compressed trajectory data is determined, including fusing the envelope feature points and turning feature points to obtain the compressed trajectory data.
[0035] It is understood that the present invention extracts envelope feature points and turning feature points from trajectory data. Since the envelope feature points and turning feature points contain the geometric features of the trajectory data, the time complexity of the operation can be reduced while ensuring the accuracy of compression.
[0036] As an optional embodiment, determining the trajectory point sequence based on the trajectory data includes: Duplicate, abnormal, and drifting data are removed from the trajectory data to obtain a sequence of trajectory points.
[0037] Duplicate data refers to data that is recorded multiple times due to equipment failure or network transmission errors, resulting in the same timestamp or location being recorded multiple times. Anomalous data refers to data points that clearly violate physical laws or common sense, such as speeds exceeding vehicle limits or locations jumping instantly to locations thousands of miles away, caused by sensor malfunctions or signal interference. Drift data refers to positioning deviations caused by GPS signals in obstructed environments (such as tunnels or between tall buildings), manifesting as trajectory points deviating from the actual path, forming irregular spikes or jitter.
[0038] Deduplication algorithms can be used to remove duplicate data by comparing timestamps and coordinate information, deleting identical records. For records with the same timestamp but minor differences in coordinates (such as those caused by device jitter), spatial clustering or time windows can be used for merging. Optionally, during the process of deleting identical records by comparing timestamps and coordinate information, only the first trajectory point can be retained.
[0039] Removing outlier data mainly relies on threshold filtering, such as setting a speed limit (e.g., 120km / h) or a distance threshold to directly remove data points that exceed a reasonable range. Preferably, the continuity of the trajectory is utilized to determine the rationality of isolated points by the relationship between preceding and following points.
[0040] Drift data can be removed using smoothing algorithms (such as Kalman filtering and moving average) or trajectory repair. Smoothing algorithms eliminate high-frequency noise through weighted averaging, while repair algorithms use historical trajectory trends to predict and correct deviations.
[0041] Optionally, a minimum movement distance threshold (e.g., 1 meter) can be set. After removing duplicate, abnormal, and drift data from the trajectory data, the distance between adjacent trajectory points is calculated, and trajectory points with a distance greater than the minimum movement distance threshold are selected to obtain a trajectory point sequence.
[0042] Understandably, removing duplicate, outlier, and drifting data can significantly improve the quality and efficiency of trajectory compression. Eliminating duplicate and outlier data avoids misidentifying redundant or erroneous information as important feature points, thereby reducing the storage volume of the compressed trajectory. Drifting data introduces unnecessary geometric fluctuations, and removing drifting data can improve the compression ratio. The cleaned trajectory data is smoother and semantically clearer, enabling more accurate extraction of key features such as true turning points and stopping points, achieving a higher compression ratio while ensuring accurate reproduction of the trajectory shape.
[0043] As an optional embodiment, determining the envelope feature points and turning feature points based on the trajectory point sequence includes: Based on the coordinates of each trajectory point in the trajectory point sequence, determine the difference between each trajectory point in the envelope; If the difference between the trajectory points is less than a preset difference threshold, the trajectory points are used as envelope feature points. Based on the coordinates of each trajectory point in the trajectory point sequence, determine the turning angle at all intermediate trajectory points; If the turning angle at any of the intermediate trajectory points is greater than a preset turning threshold, the intermediate trajectory point is used as a turning feature point.
[0044] In this embodiment of the invention, the trajectory point includes a timestamp, longitude, and latitude. The coordinates of the trajectory point are composed of longitude and latitude, with longitude being the X-coordinate value and latitude being the Y-coordinate value. Let the trajectory point sequence include N trajectory points, represented as follows: The envelope includes an upper peak envelope and a lower peak envelope. The upper and lower peak envelopes are extracted from the X and Y coordinate values of the trajectory points, respectively, to obtain the upper and lower peak envelopes for X and Y. The absolute value of the difference between the X or Y coordinate values corresponding to each trajectory point in the upper and lower peak envelopes is compared with a preset difference threshold. Theoretically, the closer the preset difference threshold is to 0, the better. However, setting the preset difference threshold too small will result in less than ideal data compression results. The preset difference threshold is 10. -3This is a better choice. Trajectory points whose absolute difference is less than a preset difference threshold are designated as envelope feature points, while trajectory points whose difference is greater than or equal to the preset difference threshold are designated as non-envelope feature points.
[0045] In this embodiment of the invention, the turning angle at the intermediate trajectory point is calculated using the vector angle method. Specifically, two vectors are constructed using the coordinates of three adjacent trajectory points in the trajectory point sequence, and the angle between the two vectors is calculated to obtain the turning angle at the intermediate trajectory point. The intermediate trajectory point refers to the second to the second-to-last trajectory point. Taking N trajectory points as an example, the intermediate trajectory point refers to the 2nd to N-1th trajectory points.
[0046] The criteria for determining a turn are shown in Table 1.
[0047] Table 1 According to the turning determination criteria, this embodiment of the invention sets the preset turning threshold to 30°. Correspondingly, if the turning angle at a certain intermediate trajectory point is greater than 30°, the intermediate trajectory point is taken as the turning feature point.
[0048] It is understood that the present invention provides a technical solution for extracting envelope feature points and turning feature points from trajectory data. Since the envelope feature points and turning feature points contain the geometric features of the trajectory data, the time complexity of operation can be reduced while ensuring compression accuracy.
[0049] As an optional embodiment, determining the turning angle at all intermediate trajectory points based on the coordinates of each trajectory point in the trajectory point sequence includes: Three consecutive trajectory points are extracted from the trajectory point sequence based on the window, and a first trajectory point vector and a second trajectory point vector are constructed based on the coordinates of the three consecutive trajectory points. The turning angle at the intermediate trajectory point is determined based on the angle between the first trajectory point vector and the second trajectory point vector. Repeat the above steps to determine the turning angle at all intermediate trajectory points.
[0050] First, extract the first to third trajectory points from the trajectory point sequence using a window. Based on the coordinates of each of these points, construct a first trajectory point vector and a second trajectory point vector. Substitute these vectors into the dot product formula to calculate the turning angle at the second trajectory point. Then, slide the window forward one trajectory point to extract the second to fourth trajectory points and calculate the turning angle at the third trajectory point. Continue this process until the turning angle at the second-to-last trajectory point is obtained. Optionally, the turning angles of all trajectory points can be obtained by combining the turning angles of the second and second-to-last trajectory points.
[0051] For three consecutive trajectory points The formulas for constructing the first and second trajectory point vectors are shown below: ; in, Let be the vector of the first trajectory point. Let be the vector of the second trajectory point.
[0052] The formula for calculating the turning angle is shown below: in, This indicates the conversion angle.
[0053] It is understood that the present invention proposes a technical solution to calculate the turning angle at all intermediate trajectory points. By applying the vector angle method to trajectory compression, the directional changes of trajectory points can be quantified through the turning angle to effectively identify turning feature points. This method can preserve the macroscopic shape of the trajectory and key turning information during the compression process, achieving a balance between high compression ratio and high fidelity.
[0054] As an optional embodiment, determining the compressed data of the trajectory data based on the envelope feature points and the turning feature points includes: Based on the envelope feature points, determine the optimal feature points; The optimal feature point and the turning feature point are fused together, and the fused feature point is used as the compressed data of the trajectory data.
[0055] Optionally, determining the optimal feature point based on the envelope feature point includes: The envelope feature points are processed using the difference algorithm and the extreme value method, and the processed envelope feature points are taken as the optimal feature points.
[0056] For continuous envelope feature points, the curve feature points and turning feature points in the upper peak envelope and the lower peak envelope are set to 1 and the non-curve feature points are set to 0, respectively, to obtain the upper envelope feature curve and the lower envelope feature curve.
[0057] The envelope feature points are processed based on the difference algorithm, including: Calculate the difference between the next data point and the previous data point in the upper envelope characteristic curve and the lower envelope characteristic curve, respectively; When the difference value is 1, the next data point is taken as the starting point of the feature segment; When the difference value is -1, the previous data point is taken as the end point of the feature segment; The features of the upper envelope feature curve and the lower envelope feature curve are obtained by determining the end point and the start point of the feature segment in the upper envelope feature curve and the lower envelope feature curve, respectively.
[0058] The envelope feature points are processed based on the region extremum method, including: Identify the maximum data point among the data points of the curve data to be compressed, corresponding to the feature segment of the upper envelope feature curve, and the minimum data point among the data points of the curve data to be compressed, corresponding to the feature segment of the lower envelope feature curve; extract the maximum and minimum data points as the optimal feature points.
[0059] The optimal feature points and the turning feature points are fused, and the fused feature points are used as compressed trajectory data. This includes fusing the optimal feature points of the upper and lower envelopes of latitude and longitude with the turning feature points to obtain compressed trajectory data. The fusion process sets the optimal feature points and turning feature points of the curves in the upper and lower peak envelopes to 1 and the non-feature points to 0, respectively, to obtain the trajectory feature curve. The compressed data is obtained by acquiring the original curve value corresponding to the position where the feature curve value is 1.
[0060] Figure 2 This is one of the schematic diagrams of trajectory compression effect provided by the present invention. Figure 3 This is the second schematic diagram of the trajectory compression effect provided by the present invention. Figure 4 This is the third schematic diagram of the trajectory compression effect provided by the present invention, as shown below. Figures 2 to 4As shown in the three schematic diagrams illustrating taxi trajectory compression, the trajectory compression method provided by this invention effectively compresses trajectory data while preserving its geometric features. The trajectory compression algorithm provided by this invention achieves efficient compression of trajectory data without requiring any prior knowledge, making it suitable for a wide range of applications and possessing broad development potential and application prospects. Furthermore, the compression algorithm provided by this invention does not require the branching recursion strategy used in commonly used compression algorithms. In a preferred embodiment, the present invention introduces a motion state value as a metric for trajectory complexity and dynamically adjusts the local curvature threshold based on the motion state value. The motion state value is used to quantify the degree of motion disorder of the trajectory within a local window. The higher the value, the more frequent and complex the changes in the direction of the trajectory segment (such as frequent turns), requiring a lower threshold to preserve details; the lower the value, the straighter the trajectory, allowing for the application of a higher threshold for aggressive compression.
[0061] The formula for calculating the motion state value is as follows: ; in, Indicates the first i The motion state value of a trajectory point; the larger the value, the more chaotic the trajectory is near that point. This indicates that it is within a sliding window (e.g., window size is...). n ), No. k The probability distribution of the direction angle (or velocity) of a trajectory point among all points within the window is obtained by calculating the rate of change of the direction angle or the normalized value of the velocity. n This represents the size of the sliding window, used to control the granularity of local calculations, and is typically set to 5-10.
[0062] Based on the calculated motion state values, the curvature threshold used to determine turning feature points is dynamically adjusted. The formula for calculating the curvature threshold is as follows: ; in, This represents the adaptive angle threshold for the i-th trajectory point. This represents the base angle threshold, which is preset according to the application scenario (e.g., 15°) and used as the basis for adjustment. This represents the attenuation coefficient, which controls the intensity of the influence of the motion state value on the threshold. It can be set to 0.5-1.0. The larger the value, the stronger the attenuation effect on the threshold. This represents the exponential decay function. When the motion state value is large, the value of the exponential decay function approaches 0, the curvature threshold becomes very small, and the trajectory points need to be preserved more strictly. Conversely, a greater degree of compression can be performed.
[0063] This invention elevates trajectory compression from simple geometric calculation to intelligent state perception by introducing motion state values. It can keenly capture calm and chaotic sections of the trajectory and adopt differentiated compression strategies. When dealing with scenarios involving numerous changes in direction and turns, such as complex urban road networks and ship navigation trajectories, it offers significant advantages over traditional fixed threshold methods, perfectly reproducing every key turning detail of the trajectory while reducing the amount of data.
[0064] In summary, this invention proposes a trajectory compression algorithm that considers turning feature points. It extracts key feature points from the trajectory based on turning feature points and uses feature points extracted from the envelope to compress the trajectory data. Only one manually input parameter is required to achieve fast and accurate adaptive compression of trajectory data while effectively preserving the features at the turning points. The method proposed in this invention is a novel trajectory data compression method that can compress trajectory data without any prior knowledge. It has a wide range of applications and broad development potential.
[0065] The trajectory compression device provided by the present invention is described below. The trajectory compression device described below and the trajectory compression method described above can be referred to in correspondence.
[0066] Figure 5 This is a schematic diagram of the trajectory compression device provided by the present invention, as shown below. Figure 5 As shown, the present invention also provides a trajectory compression device, comprising: The sequence determination module 510 is used to acquire trajectory data to be compressed and determine a sequence of trajectory points based on the trajectory data; The feature point determination module 520 is used to determine envelope feature points and turning feature points based on the trajectory point sequence; The compressed data determination module 530 is used to determine the compressed data of the trajectory data based on the envelope feature points and the turning feature points.
[0067] As one embodiment, the compressed data determination module 530 is used for: Based on the envelope feature points, determine the optimal feature points; The optimal feature point and the turning feature point are fused together, and the fused feature point is used as the compressed data of the trajectory data.
[0068] As one embodiment, the compressed data determination module 530 is used for: The envelope feature points are processed using the difference algorithm and the extreme value method, and the processed envelope feature points are taken as the optimal feature points.
[0069] As one embodiment, the feature point determination module 520 is used for: Based on the coordinates of each trajectory point in the trajectory point sequence, determine the difference between each trajectory point in the envelope; If the difference between the trajectory points is less than a preset difference threshold, the trajectory points are used as envelope feature points. Based on the coordinates of each trajectory point in the trajectory point sequence, determine the turning angle at all intermediate trajectory points; If the turning angle at any of the intermediate trajectory points is greater than a preset turning threshold, the intermediate trajectory point is used as a turning feature point.
[0070] As one embodiment, the feature point determination module 520 is used for: Three consecutive trajectory points are extracted from the trajectory point sequence based on the window, and a first trajectory point vector and a second trajectory point vector are constructed based on the coordinates of the three consecutive trajectory points. The turning angle at the intermediate trajectory point is determined based on the angle between the first trajectory point vector and the second trajectory point vector. Repeat the above steps to determine the turning angle at all intermediate trajectory points.
[0071] As one embodiment, the sequence determination module 510 is used for: Duplicate, abnormal, and drifting data are removed from the trajectory data to obtain a sequence of trajectory points.
[0072] It should be noted that the trajectory compression device provided by the present invention has the same technical effects as the trajectory compression method, which will not be elaborated further.
[0073] Figure 6 An example is a schematic diagram of the physical structure of an electronic device, such as... Figure 6 As shown, the electronic device may include: a processor 610, a communications interface 620, a memory 630, and a communication bus 640, wherein the processor 610, the communications interface 620, and the memory 630 communicate with each other via the communication bus 640. The processor 610 can call logical instructions in the memory 630 to execute a trajectory compression method, which includes: Obtain the trajectory data to be compressed, and determine the trajectory point sequence based on the trajectory data; Based on the trajectory point sequence, envelope feature points and turning feature points are determined; Based on the envelope feature points and the turning feature points, the compressed data of the trajectory data is determined.
[0074] Furthermore, the logical instructions in the aforementioned memory 630 can be implemented as software functional units and, when sold or used as independent products, can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0075] On the other hand, the present invention also provides a computer program product, the computer program product comprising a computer program that can be stored on a non-transitory computer-readable storage medium, wherein when the computer program is executed by a processor, the computer is capable of executing the trajectory compression method provided by the above methods, the method comprising: Obtain the trajectory data to be compressed, and determine the trajectory point sequence based on the trajectory data; Based on the trajectory point sequence, envelope feature points and turning feature points are determined; Based on the envelope feature points and the turning feature points, the compressed data of the trajectory data is determined.
[0076] In another aspect, the present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, is implemented to perform the trajectory compression methods provided by the methods described above, the method comprising: Obtain the trajectory data to be compressed, and determine the trajectory point sequence based on the trajectory data; Based on the trajectory point sequence, envelope feature points and turning feature points are determined; Based on the envelope feature points and the turning feature points, the compressed data of the trajectory data is determined.
[0077] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without any creative effort.
[0078] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments or some parts of the embodiments.
[0079] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A trajectory compression method characterized by, include: Obtain the trajectory data to be compressed, and determine the trajectory point sequence based on the trajectory data; Based on the trajectory point sequence, envelope feature points and turning feature points are determined; Based on the envelope feature points and the turning feature points, the compressed data of the trajectory data is determined.
2. The trajectory compression method of claim 1, wherein, The step of determining compressed data of the trajectory data based on the envelope feature points and the turning feature points includes: Based on the envelope feature points, determine the optimal feature points; The optimal feature point and the turning feature point are fused together, and the fused feature point is used as the compressed data of the trajectory data.
3. The trajectory compression method according to claim 2, characterized in that, The step of determining the optimal feature point based on the envelope feature point includes: The envelope feature points are processed using the difference algorithm and the extreme value method, and the processed envelope feature points are taken as the optimal feature points.
4. The trajectory compression method according to claim 1, characterized in that, The step of determining envelope feature points and turning feature points based on the trajectory point sequence includes: Based on the coordinates of each trajectory point in the trajectory point sequence, determine the difference between each trajectory point in the envelope; If the difference between the trajectory points is less than a preset difference threshold, the trajectory points are used as envelope feature points. Based on the coordinates of each trajectory point in the trajectory point sequence, determine the turning angle at all intermediate trajectory points; If the turning angle at any of the intermediate trajectory points is greater than a preset turning threshold, the intermediate trajectory point is used as a turning feature point.
5. The trajectory compression method according to claim 4, characterized in that, The step of determining the turning angle at all intermediate trajectory points based on the coordinates of each trajectory point in the trajectory point sequence includes: Three consecutive trajectory points are extracted from the trajectory point sequence based on the window, and a first trajectory point vector and a second trajectory point vector are constructed based on the coordinates of the three consecutive trajectory points. The turning angle at the intermediate trajectory point is determined based on the angle between the first trajectory point vector and the second trajectory point vector. Repeat the above steps to determine the turning angle at all intermediate trajectory points.
6. The trajectory compression method according to claim 1, characterized in that, Determining the trajectory point sequence based on the trajectory data includes: Duplicate, abnormal, and drifting data are removed from the trajectory data to obtain a sequence of trajectory points.
7. A trajectory compression device, characterized in that, include: The sequence determination module is used to acquire trajectory data to be compressed and determine the trajectory point sequence based on the trajectory data; The feature point determination module is used to determine envelope feature points and turning feature points based on the trajectory point sequence; The compressed data determination module is used to determine the compressed data of the trajectory data based on the envelope feature points and the turning feature points.
8. An electronic device comprising a memory, a processor, and a computer program stored in the memory and running on the processor, characterized in that, When the processor executes the computer program, it implements the trajectory compression method as described in any one of claims 1 to 6.
9. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the trajectory compression method as described in any one of claims 1 to 6.
10. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the trajectory compression method as described in any one of claims 1 to 6.