Trajectory data compression method and device, electronic equipment and storage medium

By identifying the type of reference point in the trajectory data and applying different compression algorithms, the compression problem of trajectory data under limited storage and complex network conditions is solved, achieving efficient data storage and transmission while retaining key attribute data and supporting real-time analysis.

CN119254238BActive Publication Date: 2025-11-18CHERY AUTOMOBILE CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411353585.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-09-26
Publication Date
2025-11-18
Estimated Expiration
2044-09-26

AI Technical Summary

Technical Problem

Existing technologies struggle to preserve attribute data while maintaining compression effectiveness in trajectory data compression, especially given the need for real-time transmission and storage of vehicle trajectory data, which cannot meet the requirements for storing and transmitting massive amounts of data.

Method used

By determining whether there are forward and backward reference trajectory points in the trajectory data, compression algorithms are used to compress key trajectory points, forward prediction points, and bidirectional prediction points respectively, while retaining key attribute data.

Benefits of technology

It achieves efficient compression of massive trajectory data under limited storage space and complex network conditions, ensuring the integrity of attribute data, and supports real-time storage, uploading, and decoding analysis.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119254238B_ABST
    Figure CN119254238B_ABST
Patent Text Reader

Abstract

The application discloses a trajectory data compression method and device, electronic equipment and a storage medium. The method comprises the following steps: if there is no forward reference trajectory point in the trajectory data, compressing a to-be-compressed trajectory point to obtain a key trajectory point and adding the key trajectory point to a to-be-written queue; if there is a forward reference trajectory point and no backward reference trajectory point in the trajectory data, and the to-be-compressed trajectory point is similar to the forward reference trajectory point, compressing the to-be-compressed trajectory point to obtain a first forward prediction point; if the to-be-compressed trajectory point is not similar to the forward reference trajectory point and the backward reference trajectory point, compressing the to-be-compressed trajectory point to obtain a second forward prediction point, and adding the second forward prediction point and the first forward prediction point to the to-be-written queue; if the to-be-compressed trajectory point is similar to the forward reference trajectory point and the backward reference trajectory point, compressing the to-be-compressed trajectory point to obtain a bidirectional prediction point and adding the bidirectional prediction point to the to-be-written queue, and storing data in all to-be-written queues to a preset terminal. Thus, the data compression of a large amount of data is realized while the state information of the data is completely reserved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of vehicle technology, and in particular to a method, apparatus, electronic device, and storage medium for compressing trajectory data. Background Technology

[0002] With the widespread adoption of in-vehicle navigation and autonomous driving technologies in smart cockpits, the massive amounts of travel trajectory data will place high demands on data storage, network transmission, fast playback, and rapid retrieval technologies. Currently, there are many methods for trajectory data denoising, compression, and optimization, but most focus on preprocessing, such as denoising abnormal trajectory points, interpolation optimization, and trajectory point data optimization based on specific models. These methods can significantly filter out redundant data at a macro level, but in reality, vehicle trajectories are constantly generated across different geographical locations, such as taxis and buses. Some methods also utilize the similarity between trajectory points for simplified storage, but these methods are relatively rudimentary, inflexible, and have limited compression capabilities. Daily car user trajectories often require storage for at least several days to months and real-time uploading for analysis. Massive storage and real-time transmission remain unavoidable; therefore, extreme compression at the micro level of each trajectory point is necessary to meet these requirements.

[0003] Travel trajectory points often exhibit prominent characteristics such as continuity, long time spans, and massive data volumes. Furthermore, the automotive field not only requires local storage, playback, and analysis, but also cross-platform needs such as remote network transmission, real-time monitoring, and analysis. While vehicle-to-everything (V2X) technology and 5G communication technology have made significant progress, they have not yet resulted in substantial cost reductions in both commercial and civilian applications. With the rapid development of new energy electric vehicles, both traditional and electric vehicles have entered a phase of fierce competition. The storage and real-time transmission and analysis of massive trajectory data place high demands on hardware. Given the inability to further reduce hardware costs on a large scale, breakthroughs are urgently needed in large-scale data compression and transmission.

[0004] Related technologies merge and compress trajectory points with the same location, that is, multiple location points are deleted and merged into a single trajectory point, and the time is stored as a sequence. Trajectory points at different locations are judged for velocity within a threshold, and those with the same velocity are merged and compressed in the same way.

[0005] However, this method only applies to determining whether position and speed are the same. In reality, travel trajectory points contain far more attribute information than just spatial position and speed; they also include positioning type, accuracy, satellite type and intensity, sensor data, and so on. Even trajectory points with the same spatial position may have different vehicle driving states, therefore, they cannot be simply deleted. In vehicle travel trajectory recordings, redundant data should not be simply deleted; instead, all attribute data should be retained as much as possible to accurately determine and analyze the vehicle's position, driving state, and predictable conditions. Summary of the Invention

[0006] This application provides a method, apparatus, electronic device, and storage medium for compressing trajectory data to solve the problem that it is difficult to retain attribute data while ensuring compression effect for large-volume trajectory data. In scenarios where there is insufficient physical data storage space for vehicles and complex network conditions but real-time location upload is required to accurately restore the original trajectory and for monitoring and analysis, the physical occupancy and network transmission size of massive data are greatly compressed, facilitating real-time high-speed storage, uploading, and decoding analysis.

[0007] The first aspect of this application provides a method for compressing trajectory data, including the following steps:

[0008] Acquire vehicle trajectory data and trajectory points to be compressed;

[0009] Determine whether a forward reference trajectory point exists in the trajectory data;

[0010] If there is no forward reference trajectory point in the trajectory data, the trajectory point to be compressed is compressed using a preset intra-point compression algorithm to obtain a key trajectory point. The key trajectory point is added to the queue to be written and cached as a forward reference trajectory point. Otherwise, it is determined whether there is a backward reference trajectory point in the trajectory data.

[0011] If no backward reference trajectory point exists in the trajectory data, then when the trajectory point to be compressed and the forward reference trajectory point meet the first preset similarity matching requirement, the trajectory point to be compressed is compressed using a preset forward reference trajectory point compression algorithm to obtain a first forward prediction point, and the first forward prediction point is added to a temporary queue and cached as a backward reference trajectory point. Otherwise, when the trajectory point to be compressed does not meet the second preset similarity matching requirement with the forward reference trajectory point and the backward reference trajectory point, the trajectory point is compressed using the preset forward reference trajectory point compression algorithm to obtain a first forward prediction point. The trajectory point to be compressed is compressed to obtain a second forward prediction point. The second forward prediction point and the first forward prediction point in the temporary queue are added to the queue to be written. The second forward prediction point is cached as a forward reference trajectory point. When the trajectory point to be compressed meets the second preset similarity matching requirement with the forward reference trajectory point and the backward reference trajectory point, the trajectory point to be compressed is compressed to obtain a bidirectional prediction point using a preset compression algorithm between forward and backward bidirectional reference points. The bidirectional prediction point is added to the queue to be written. All data in the queue to be written is stored in a preset terminal.

[0012] Optionally, in some embodiments, after determining that the forward reference trajectory point exists in the trajectory data and that the backward reference trajectory point does not exist in the trajectory data, the method further includes:

[0013] If the trajectory point to be compressed and the forward reference trajectory point do not meet the first preset similarity matching requirement, then the trajectory point to be compressed is compressed using a preset intra-point compression algorithm to obtain the key trajectory point.

[0014] Optionally, in some embodiments, after determining that the forward reference trajectory point exists in the trajectory data and the backward reference trajectory point does not exist in the trajectory data, the method further includes:

[0015] If at least one major matching element between the trajectory point to be compressed and the forward reference trajectory point exceeds the corresponding error threshold, it is determined that the trajectory point to be compressed and the forward reference trajectory point do not meet the first preset similarity matching requirement; otherwise, it is determined that the trajectory point to be compressed and the forward reference trajectory point meet the first preset similarity matching requirement.

[0016] Optionally, in some embodiments, after determining that the forward reference trajectory point exists in the trajectory data and the backward reference trajectory point exists in the trajectory data, the method further includes:

[0017] If the trajectory point to be compressed has at least one minor matching element with the forward reference trajectory point and the backward reference trajectory point that exceeds the corresponding error threshold, then it is determined that the trajectory point to be compressed does not meet the second preset similarity matching requirement with the forward reference trajectory point and the backward reference trajectory point; otherwise, it is determined that the trajectory point to be compressed meets the second preset similarity matching requirement with the forward reference trajectory point and the backward reference trajectory point.

[0018] A second aspect of this application provides a trajectory data compression apparatus, comprising:

[0019] The acquisition module is used to acquire vehicle trajectory data and trajectory points to be compressed;

[0020] The judgment module is used to determine whether there is a forward reference trajectory point in the trajectory data;

[0021] The first compression module is used to compress the trajectory points to be compressed into key trajectory points by using a preset intra-point compression algorithm when there are no forward reference trajectory points in the trajectory data, add the key trajectory points to the queue to be written, and cache the key trajectory points as forward reference trajectory points; otherwise, it determines whether there are backward reference trajectory points in the trajectory data.

[0022] The second compression module is used to compress the trajectory point to be compressed into a first forward prediction point using a preset forward reference trajectory point compression algorithm when there is no backward reference trajectory point in the trajectory data, and the trajectory point to be compressed meets a first preset similarity matching requirement with the forward reference trajectory point. The first forward prediction point is then added to a temporary queue and cached as a backward reference trajectory point. Otherwise, when the trajectory point to be compressed does not meet the second preset similarity matching requirement with both the forward and backward reference trajectory points, the module uses the preset forward reference trajectory point compression algorithm to compress the trajectory point to be compressed into a first forward prediction point. The compression algorithm compresses the trajectory point to be compressed to obtain a second forward prediction point. The second forward prediction point and the first forward prediction point in the temporary queue are added to the queue to be written. The second forward prediction point is cached as a forward reference trajectory point. When the trajectory point to be compressed meets the second preset similarity matching requirement with the forward reference trajectory point and the backward reference trajectory point, the trajectory point to be compressed is compressed to obtain a bidirectional prediction point using a preset bidirectional reference point compression algorithm. The bidirectional prediction point is added to the queue to be written. All data in the queue to be written is stored in a preset terminal.

[0023] Optionally, in some embodiments, after determining that the forward reference trajectory point exists in the trajectory data and that the backward reference trajectory point does not exist in the trajectory data, the second compression module further includes:

[0024] The first compression unit is used to compress the trajectory point to be compressed into the key trajectory point by using a preset intra-point compression algorithm when the trajectory point to be compressed and the forward reference trajectory point do not meet the first preset similarity matching requirement.

[0025] Optionally, in some embodiments, after determining that the forward reference trajectory point exists in the trajectory data and the backward reference trajectory point does not exist in the trajectory data, the second compression module further includes:

[0026] The first determination unit is configured to determine that the trajectory point to be compressed and the forward reference trajectory point do not meet the first preset similarity matching requirement if at least one major matching element between the trajectory point to be compressed and the forward reference trajectory point exceeds the corresponding error threshold; otherwise, it determines that the trajectory point to be compressed and the forward reference trajectory point meet the first preset similarity matching requirement.

[0027] Optionally, in some embodiments, after determining that the forward reference trajectory point exists in the trajectory data and the backward reference trajectory point exists in the trajectory data, the second compression module further includes:

[0028] The second determination unit is configured to determine that the trajectory point to be compressed does not meet the second preset similarity matching requirement when at least one secondary matching element between the forward reference trajectory point and the backward reference trajectory point exceeds the corresponding error threshold; otherwise, it determines that the trajectory point to be compressed meets the second preset similarity matching requirement.

[0029] A third aspect of this application 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 program to implement the trajectory data compression method as described in the above embodiments.

[0030] A fourth aspect of this application provides a computer-readable storage medium having a computer program stored thereon, which is executed by a processor to implement the trajectory data compression method as described in the above embodiments.

[0031] Therefore, by acquiring the vehicle's trajectory data and the trajectory points to be compressed; determining whether there are forward reference trajectory points in the trajectory data; if there are no forward reference trajectory points in the trajectory data, then using a preset intra-point compression algorithm to compress the trajectory points to be compressed to obtain key trajectory points, adding the key trajectory points to the queue to be written, and caching the key trajectory points as forward reference trajectory points; otherwise, determining whether there are backward reference trajectory points in the trajectory data.

[0032] If no backward reference trajectory point exists in the trajectory data, then when the trajectory point to be compressed and the forward reference trajectory point meet the first preset similarity matching requirement, the trajectory point to be compressed is compressed using a preset forward reference trajectory point compression algorithm to obtain a first forward prediction point. The first forward prediction point is added to a temporary queue and cached as a backward reference trajectory point. Otherwise, when the trajectory point to be compressed does not meet the second preset similarity matching requirement with the forward and backward reference trajectory points, the trajectory point to be compressed is compressed using a preset forward reference trajectory point compression algorithm to obtain a second forward prediction point. The second forward prediction point and the first forward prediction point in the temporary queue are added to a write queue, and the second forward prediction point is cached as a forward reference trajectory point. When the trajectory point to be compressed meets the second preset similarity matching requirement with the forward and backward reference trajectory points, the trajectory point to be compressed is compressed using a preset bidirectional reference point compression algorithm to obtain a bidirectional prediction point. The bidirectional prediction point is added to a write queue, and all data in the write queue is stored in a preset terminal. This solves the problem of retaining attribute data while ensuring compression of large-volume trajectory data. In scenarios where there is insufficient physical data storage space for vehicles, complex network conditions but real-time location uploads, accurate restoration of original trajectories, and monitoring and analysis are required, it greatly compresses the physical footprint and network transmission size of massive amounts of data, facilitating real-time high-speed storage, uploading, and decoding analysis.

[0033] Additional aspects and advantages of this application will be set forth in part in the description which follows, and in part will be obvious from the description, or may be learned by practice of this application. Attached Figure Description

[0034] The above and / or additional aspects and advantages of this application will become apparent and readily understood from the following description of the embodiments taken in conjunction with the accompanying drawings, wherein:

[0035] Figure 1 This is a flowchart of a trajectory data compression method provided according to an embodiment of this application;

[0036] Figure 2 This is a schematic diagram illustrating the classification principle of trajectory points according to an embodiment of this application;

[0037] Figure 3This is a schematic diagram illustrating the compression principle of trajectory data according to an embodiment of this application;

[0038] Figure 4 This is a schematic diagram illustrating the principle of a preset intra-point compression algorithm provided according to an embodiment of this application;

[0039] Figure 5 This is a schematic diagram illustrating the principle of similarity matching according to an embodiment of this application;

[0040] Figure 6 This is a block diagram of a trajectory data compression device provided according to an embodiment of this application;

[0041] Figure 7 This is a schematic diagram of the structure of an electronic device provided according to an embodiment of this application. Detailed Implementation

[0042] The embodiments of this application are described in detail below. Examples of these embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and intended to explain this application, and should not be construed as limiting this application.

[0043] The following describes a method, apparatus, electronic device, and storage medium for compressing trajectory data according to embodiments of this application, with reference to the accompanying drawings. Addressing the problem mentioned in the background art of difficulty in preserving attribute data while ensuring compression effectiveness for large-volume trajectory data, this application provides a method for compressing trajectory data. In this method, vehicle trajectory data and trajectory points to be compressed are acquired; it is determined whether a forward reference trajectory point exists in the trajectory data; if no forward reference trajectory point exists, the trajectory points to be compressed are compressed using a preset intra-point compression algorithm to obtain key trajectory points, which are then added to a write queue and cached as forward reference trajectory points; otherwise, it is determined whether a backward reference trajectory point exists in the trajectory data; if no backward reference trajectory point exists, when the trajectory points to be compressed and the forward reference trajectory points meet a first preset similarity matching requirement, the trajectory points to be compressed are compressed using a preset inter-forward reference trajectory point compression algorithm to obtain... The first forward prediction point is selected and added to a temporary queue. The first forward prediction point is also cached as a backward reference trajectory point. Otherwise, if the trajectory point to be compressed does not meet the second preset similarity matching requirement with the forward and backward reference trajectory points, the trajectory point to be compressed is compressed using a preset forward reference trajectory point compression algorithm to obtain a second forward prediction point. The second forward prediction point and the first forward prediction point in the temporary queue are added to a write queue, and the second forward prediction point is cached as a forward reference trajectory point. If the trajectory point to be compressed meets the second preset similarity matching requirement with the forward and backward reference trajectory points, the trajectory point to be compressed is compressed using a preset bidirectional reference point compression algorithm to obtain a bidirectional prediction point. The bidirectional prediction point is added to a write queue, and all data in the write queue is stored in a preset terminal. This solves the problem of retaining attribute data while ensuring compression of large-volume trajectory data. In scenarios where there is insufficient physical data storage space for vehicles, complex network conditions but real-time location uploads, accurate restoration of original trajectories, and monitoring and analysis are required, it greatly compresses the physical footprint and network transmission size of massive amounts of data, facilitating real-time high-speed storage, uploading, and decoding analysis.

[0044] Specifically, Figure 1 This is a flowchart illustrating a trajectory data compression method provided in an embodiment of this application.

[0045] like Figure 1 As shown, the compression method for this trajectory data includes the following steps:

[0046] In step S101, the vehicle's trajectory data and the trajectory points to be compressed are acquired.

[0047] Specifically, a large amount of trajectory data is generated during the vehicle's journey that needs to be compressed and stored. After the generated trajectory data undergoes conventional noise reduction and outlier removal, the trajectory points to be compressed are obtained.

[0048] In step S102, it is determined whether there is a forward reference trajectory point in the trajectory data.

[0049] It should be noted that, as Figure 2 As shown in the embodiments of this application, the actual stored user trajectory point data is defined as three types: key trajectory point I, forward reference trajectory point P, and forward and backward bidirectional reference trajectory point B.

[0050] Specifically, all attribute data for key trajectory points (I) will be fully recorded. Key trajectory points (I) can be understood as the starting position trajectory points of users at some similar or identical trajectory locations. For example, the first position point when the user starts the vehicle and begins recording the location; the first position point when driving to the next road; the first position point after the signal is interrupted; the position point where the difference from the previous key position point exceeds a threshold; and the first position point where the positioning accuracy meets the high-precision requirements for the first time.

[0051] For the forward reference trajectory point P, attribute data that differs from the previous reference trajectory point will be recorded; attribute data that is not different will not be recorded. Point P can be understood as the subsequent trajectory point of the previous reference trajectory point (the same or similar trajectory position point). For example, the second trajectory point after the key trajectory point I, which is the same as the previous trajectory point in some attributes, but has significant differences in some attributes.

[0052] For point B, a bidirectional reference trajectory, only a few attribute data that differ from both bidirectional reference points will be recorded; attribute data that does not differ will not be recorded.

[0053] Define a set of trajectory points between a critical trajectory I point and the next critical trajectory I point as a trajectory point group.

[0054] Specifically, in combination Figure 3 As shown, after obtaining the trajectory points to be compressed, the trajectory point encoding process can begin. First, it is determined whether there are any previous forward reference trajectory points. Generally, the first recorded trajectory point to be compressed will not have a forward reference trajectory point. In step S103, if there are no forward reference trajectory points in the trajectory data, the trajectory points to be compressed are compressed using a preset intra-point compression algorithm to obtain key trajectory points. These key trajectory points are added to the write queue and cached as forward reference trajectory points. Otherwise, it is determined whether there are any backward reference trajectory points in the trajectory data.

[0055] Specifically, if there is no forward reference trajectory point in the trajectory data, the key trajectory point I is directly compressed and encoded within the point and transmitted to the trajectory data waiting to be written queue Q. At the same time, the key trajectory point I is automatically cached as a forward reference trajectory point.

[0056] It should be noted that the preset intra-point compression algorithm can be as follows: Figure 4 As shown, the trajectory point number, timing time, system time, trajectory type (GPS, NET, BeiDou, etc.), trajectory longitude, trajectory latitude, elevation, direction angle, horizontal positioning accuracy, vertical positioning accuracy, angular positioning accuracy, speed, number of positioning satellites, signal strength, sensor temperature, sensor type, and road ID are first uniformly integerized. Then, they are re-encoded according to Varints and ZigZag encoding standards. Taking 32.121 as an example, the original 8 bytes (64 bits) of double-encoded data can be encoded into 3 bytes (24 bits) of encoded data. The preset intra-point compression algorithm is directly applied to the encoding of the key trajectory point I. For each attribute data of the trajectory data, intra-point data compression encoding is performed using Varints and ZigZag encoding standards. The preset forward reference trajectory point compression algorithm is directly applied to the encoding of the forward prediction point P, and the preset forward and backward bidirectional reference point compression algorithm is directly applied to the encoding of the forward and backward bidirectional prediction point B.

[0057] In step S104, if there is no backward reference trajectory point in the trajectory data, then when the trajectory point to be compressed and the forward reference trajectory point meet the first preset similarity matching requirement, the trajectory point to be compressed is compressed using a preset forward reference trajectory point compression algorithm to obtain a first forward prediction point, and the first forward prediction point is added to a temporary queue and cached as a backward reference trajectory point. Otherwise, when the trajectory point to be compressed does not meet the second preset similarity matching requirement with the forward and backward reference trajectory points, the trajectory point to be compressed is compressed using a preset forward reference trajectory point compression algorithm to obtain a second forward prediction point, the second forward prediction point and the first forward prediction point in the temporary queue are added to a write queue, and the second forward prediction point is cached as a forward reference trajectory point. When the trajectory point to be compressed meets the second preset similarity matching requirement with the forward and backward reference trajectory points, the trajectory point to be compressed is compressed using a preset bidirectional reference point compression algorithm to obtain a bidirectional prediction point, and the bidirectional prediction point is added to a write queue. All data in the write queue is stored in a preset terminal.

[0058] Optionally, in some embodiments, after determining that there is a forward reference trajectory point in the trajectory data and there is no backward reference trajectory point in the trajectory data, the method further includes: if at least one major matching element between the trajectory point to be compressed and the forward reference trajectory point exceeds the corresponding error threshold, then it is determined that the trajectory point to be compressed and the forward reference trajectory point do not meet the first preset similarity matching requirement; otherwise, it is determined that the trajectory point to be compressed and the forward reference trajectory point meet the first preset similarity matching requirement.

[0059] It should be noted that, in the embodiments of this application, the similarity matching principle is as follows: Figure 3 As shown, the trajectory location (latitude, longitude, elevation, and velocity) is used as the primary matching elements (FirstFeatures), and the remaining attributes are used as secondary matching elements (SecondFeatures). A dynamically adjustable similarity error threshold is defined for both primary and secondary attributes. FirstFeatures with differences exceeding the threshold are used to distinguish key trajectory points (I), recording detailed attribute data within each trajectory point. FirstFeatures with differences not exceeding the threshold are used to distinguish forward prediction points (P), recording the differences between primary and secondary matching elements. Similar values ​​or negligible errors in secondary matching elements are separated by zeros. Similarly, SecondFeatures with differences exceeding the threshold are used to distinguish forward prediction points (P), while SecondFeatures with differences not exceeding the threshold are used to distinguish bidirectional prediction points (B), recording the differences in secondary matching elements. Similar values ​​or negligible errors in primary matching elements are separated by zeros.

[0060] Specifically, the trajectory location (latitude, longitude, elevation, and speed) is used as the primary matching elements, while other attributes are used as secondary matching elements. Points with significant differences in the primary matching elements are used to distinguish key trajectory points (I), and detailed attribute data within these points is recorded. Points with similar primary matching elements are used to distinguish forward prediction points (P), recording the differences between the primary and secondary matching elements. Identical values ​​in secondary matching elements are separated by zeros. Similarly, points with significant differences in secondary matching elements are used to distinguish forward prediction points (P), while points with similar secondary matching elements are used to distinguish bidirectional prediction points (B), recording the differences between the secondary matching elements. Identical values ​​in primary matching elements are separated by zeros.

[0061] In actual implementation, combined with Figure 3 As shown, if a production trajectory point enters and a forward reference trajectory point is identified, it is necessary to determine whether a backward reference trajectory point exists. If no backward reference trajectory point exists, the trajectory point data similarity matching process begins. If the difference between the trajectory point and the forward reference trajectory point is small and within the threshold range of point P, the trajectory point is cached in a temporary queue T and temporarily not entered into the trajectory data waiting-to-be-written queue Q. Simultaneously, this point is automatically cached as a backward reference trajectory point. Optionally, in some embodiments, after determining that a forward reference trajectory point exists in the trajectory data and no backward reference trajectory point exists, the process further includes: if the trajectory point to be compressed does not meet the first preset similarity matching requirement with the forward reference trajectory point, then a preset intra-point compression algorithm is used to compress the trajectory point to be compressed to obtain a key trajectory point.

[0062] Specifically, if a production trajectory point comes in and there is a forward reference trajectory point in the trajectory data but no backward reference trajectory point in the trajectory data, then the trajectory point data similarity matching process is entered. If the difference with the forward reference trajectory point is relatively large, then the compression encoding process is directly performed according to the key trajectory point I.

[0063] Optionally, in some embodiments, after determining that there are forward reference trajectory points and backward reference trajectory points in the trajectory data, the method further includes: if the trajectory point to be compressed has at least one secondary matching element with the forward reference trajectory point and the backward reference trajectory point that exceeds the corresponding error threshold, then it is determined that the trajectory point to be compressed does not meet the second preset similarity matching requirement with the forward reference trajectory point and the backward reference trajectory point; otherwise, it is determined that the trajectory point to be compressed meets the second preset similarity matching requirement with the forward reference trajectory point and the backward reference trajectory point.

[0064] Specifically, in combination Figure 3 As shown, if a trajectory point to be compressed comes in and there is a forward reference trajectory point and a backward reference trajectory point, then the trajectory point data similarity matching process is entered. If the similarity exceeds the BP point threshold, the trajectory point is recorded as a forward prediction point P and enters the trajectory data to be written queue Q together with the previously cached temporary queue T. At the same time, the point is automatically cached as a forward reference trajectory point.

[0065] If the similarity between the trajectory point to be compressed and the forward and backward reference trajectory points is within the BP threshold, such as Figure 5 As shown, the rightmost point B, the forward critical reference point I, and the backward reference trajectory point P differ only in a few local attribute values, while the other attributes are the same. Therefore, this point is recorded as the bidirectional prediction point B and enters the trajectory data waiting-to-be-written queue Q together with the previously cached temporary queue T.

[0066] It should be noted that the embodiments of this application provide a compressed encoding process for vehicle trajectory points. During the decoding of compressed data, the process is performed according to... Figure 3 and Figure 4 Simply reverse the process and operations.

[0067] In summary, this application's embodiments divide trajectory points into key location points I, forward reference location points P, and bidirectional reference location points B according to their spatiotemporal characteristics. It then constructs a point-based intra-point data compression coding method based on point I, a forward reference trajectory point inter-point data compression coding method based on point P, and a bidirectional reference point inter-point compression coding method based on point B. Through these three steps of intra-point and inter-point data encoding and compression, it is possible to significantly remove duplicate attribute data from massive trajectory data, greatly compress the physical storage size of different data types, and completely restore all attribute data of the original trajectory data through reverse decoding. This achieves a significant reduction in data storage and transmission costs through encoding technology, and a complete restoration of the original trajectory data through reverse decoding technology.

[0068] Therefore, the trajectory data compression method of this application embodiment can not only restore the position and operating status of the vehicle at any time with the greatest completeness, but also flexibly control the data compression ratio. It not only achieves data compression of individual trajectory points, but also data compression between trajectory points, greatly reducing the physical size of massive data, facilitating real-time fast storage, fast uploading, and fast decoding and analysis. At the same time, it can also restore the original trajectory data through fast decoding, truly restoring the original trip's position and driving status information. By defining the compression accuracy threshold, a custom compression ratio can be achieved, flexibly controlling lossless compression and lossy compression.

[0069] According to the trajectory data compression method proposed in this application, the method involves acquiring vehicle trajectory data and trajectory points to be compressed; determining whether a forward reference trajectory point exists in the trajectory data; if no forward reference trajectory point exists, then a preset intra-point compression algorithm is used to compress the trajectory points to be compressed to obtain key trajectory points, which are added to a write queue and cached as forward reference trajectory points; otherwise, the method determines whether a backward reference trajectory point exists in the trajectory data; if no backward reference trajectory point exists, then when the trajectory points to be compressed and the forward reference trajectory points meet a first preset similarity matching requirement, a preset inter-forward reference trajectory point compression algorithm is used to compress the trajectory points to be compressed to obtain a first forward prediction point, which is added to a temporary queue. The system compresses the trajectory point by storing the first forward prediction point as a backward reference trajectory point. Otherwise, if the trajectory point to be compressed does not meet the second preset similarity matching requirement with the forward and backward reference trajectory points, a preset compression algorithm between forward reference trajectory points is used to compress the trajectory point to be compressed to obtain the second forward prediction point. The second forward prediction point and the first forward prediction point in the temporary queue are added to the write queue, and the second forward prediction point is cached as a forward reference trajectory point. If the trajectory point to be compressed meets the second preset similarity matching requirement with the forward and backward reference trajectory points, a preset compression algorithm between forward and backward reference points is used to compress the trajectory point to be compressed to obtain a bidirectional prediction point, and the bidirectional prediction point is added to the write queue. All data in the write queue is stored in a preset terminal. This solves the problem of retaining attribute data while ensuring compression effect for large-volume trajectory data. In scenarios where vehicle physical data storage space is insufficient, network conditions are complex but real-time location upload is required, and the original trajectory must be accurately restored for monitoring and analysis, the system greatly compresses the physical footprint and network transmission size of massive data, facilitating real-time high-speed storage, uploading, and decoding analysis.

[0070] Next, the trajectory data compression apparatus proposed according to the embodiments of this application is described with reference to the accompanying drawings.

[0071] Figure 6 This is a block diagram of a trajectory data compression device according to an embodiment of this application.

[0072] like Figure 6 As shown, the trajectory data compression device 10 includes: an acquisition module 100, a judgment module 200, a first compression module 300, and a second compression module 300.

[0073] The acquisition module 100 is used to acquire the vehicle's trajectory data and the trajectory points to be compressed.

[0074] The judgment module 200 is used to determine whether there is a forward reference trajectory point in the trajectory data.

[0075] The first compression module 300 is used to compress the trajectory points to be compressed into key trajectory points using a preset intra-point compression algorithm when there are no forward reference trajectory points in the trajectory data, add the key trajectory points to the queue to be written, and cache the key trajectory points as forward reference trajectory points; otherwise, it determines whether there are backward reference trajectory points in the trajectory data.

[0076] The second compression module 400 is configured to, when there is no backward reference trajectory point in the trajectory data, compress the trajectory point to be compressed using a preset forward reference trajectory point compression algorithm to obtain a first forward prediction point when the trajectory point to be compressed and the forward reference trajectory point meet a first preset similarity matching requirement, and add the first forward prediction point to a temporary queue and cache the first forward prediction point as a backward reference trajectory point; otherwise, when the trajectory point to be compressed does not meet the second preset similarity matching requirement with the forward reference trajectory point and the backward reference trajectory point, use the preset forward reference trajectory point compression algorithm to compress the trajectory point to be compressed to obtain a first forward prediction point, add the first forward prediction point to a temporary queue, and cache the first forward prediction point as a backward reference trajectory point. The compression algorithm compresses the trajectory point to be compressed to obtain a second forward prediction point. The second forward prediction point and the first forward prediction point in the temporary queue are added to the queue to be written. The second forward prediction point is cached as a forward reference trajectory point. When the trajectory point to be compressed meets the second preset similarity matching requirement with the forward reference trajectory point and the backward reference trajectory point, the trajectory point to be compressed is compressed to obtain a bidirectional prediction point using a preset bidirectional reference point compression algorithm. The bidirectional prediction point is added to the queue to be written. All data in the queue to be written is stored in a preset terminal.

[0077] Optionally, in some embodiments, after determining that the forward reference trajectory point exists in the trajectory data and the backward reference trajectory point does not exist in the trajectory data, the second compression module 400 further includes: a first compression unit.

[0078] The first compression unit is used to compress the trajectory point to be compressed into the key trajectory point by using a preset intra-point compression algorithm when the trajectory point to be compressed and the forward reference trajectory point do not meet the first preset similarity matching requirement.

[0079] Optionally, in some embodiments, after determining that the forward reference trajectory point exists in the trajectory data and the backward reference trajectory point does not exist in the trajectory data, the second compression module 400 further includes: a first determination unit.

[0080] The first determination unit is configured to determine that the trajectory point to be compressed and the forward reference trajectory point do not meet the first preset similarity matching requirement if at least one major matching element between the trajectory point to be compressed and the forward reference trajectory point exceeds the corresponding error threshold; otherwise, it determines that the trajectory point to be compressed and the forward reference trajectory point meet the first preset similarity matching requirement.

[0081] Optionally, in some embodiments, after determining that the forward reference trajectory point exists in the trajectory data and the backward reference trajectory point exists in the trajectory data, the second compression module 400 further includes: a second determination unit.

[0082] The second determination unit is configured to determine that the trajectory point to be compressed does not meet the second preset similarity matching requirement when at least one secondary matching element between the forward reference trajectory point and the backward reference trajectory point exceeds the corresponding error threshold; otherwise, it determines that the trajectory point to be compressed meets the second preset similarity matching requirement.

[0083] It should be noted that the foregoing explanation of the trajectory data compression method embodiment also applies to the trajectory data compression device of this embodiment, and will not be repeated here.

[0084] According to the trajectory data compression device proposed in the embodiments of this application, the device acquires vehicle trajectory data and trajectory points to be compressed; determines whether there are forward reference trajectory points in the trajectory data; if there are no forward reference trajectory points in the trajectory data, it compresses the trajectory points to be compressed using a preset intra-point compression algorithm to obtain key trajectory points, adds the key trajectory points to a write queue, and caches the key trajectory points as forward reference trajectory points; otherwise, it determines whether there are backward reference trajectory points in the trajectory data; if there are no backward reference trajectory points in the trajectory data, when the trajectory points to be compressed and the forward reference trajectory points meet a first preset similarity matching requirement, it compresses the trajectory points to be compressed using a preset inter-forward reference trajectory point compression algorithm to obtain a first forward prediction point, and adds the first forward prediction point to a temporary queue. The system compresses the trajectory point by storing the first forward prediction point as a backward reference trajectory point. Otherwise, if the trajectory point to be compressed does not meet the second preset similarity matching requirement with the forward and backward reference trajectory points, a preset compression algorithm between forward reference trajectory points is used to compress the trajectory point to be compressed to obtain the second forward prediction point. The second forward prediction point and the first forward prediction point in the temporary queue are added to the write queue, and the second forward prediction point is cached as a forward reference trajectory point. If the trajectory point to be compressed meets the second preset similarity matching requirement with the forward and backward reference trajectory points, a preset compression algorithm between forward and backward reference points is used to compress the trajectory point to be compressed to obtain a bidirectional prediction point, and the bidirectional prediction point is added to the write queue. All data in the write queue is stored in a preset terminal. This solves the problem of retaining attribute data while ensuring compression effect for large-volume trajectory data. In scenarios where vehicle physical data storage space is insufficient, network conditions are complex but real-time location upload is required, and the original trajectory must be accurately restored for monitoring and analysis, the system greatly compresses the physical footprint and network transmission size of massive data, facilitating real-time high-speed storage, uploading, and decoding analysis.

[0085] Figure 7 A schematic diagram of the structure of an electronic device provided in an embodiment of this application. The electronic device may include:

[0086] The memory 701, the processor 702, and the computer program stored on the memory 701 and capable of running on the processor 702.

[0087] When the processor 702 executes the program, it implements the trajectory data compression method provided in the above embodiments.

[0088] Furthermore, electronic devices also include:

[0089] Communication interface 703 is used for communication between memory 701 and processor 702.

[0090] The memory 701 is used to store computer programs that can run on the processor 702.

[0091] The memory 701 may include high-speed RAM (Random Access Memory) memory, and may also include non-volatile memory, such as at least one disk storage.

[0092] If the memory 701, processor 702, and communication interface 703 are implemented independently, then the communication interface 703, memory 701, and processor 702 can be interconnected via a bus to complete communication between them. The bus can be an ISA (Industry Standard Architecture) bus, a PCI (Peripheral Component Interconnect) bus, or an EISA (Extended Industry Standard Architecture) bus, etc. The bus can be divided into address bus, data bus, control bus, etc. For ease of representation, Figure 7 The bus is represented by a single thick line, but this does not mean that there is only one bus or one type of bus.

[0093] Optionally, in a specific implementation, if the memory 701, processor 702, and communication interface 703 are integrated on a single chip, then the memory 701, processor 702, and communication interface 703 can communicate with each other through an internal interface.

[0094] The processor 702 may be a CPU (Central Processing Unit), an ASIC (Application Specific Integrated Circuit), or one or more integrated circuits configured to implement the embodiments of this application.

[0095] This application also provides a computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements the above-described method for compressing trajectory data.

[0096] In the description of this specification, the references to terms such as "one embodiment," "some embodiments," "example," "specific example," or "some examples," etc., indicate that a specific feature, structure, material, or characteristic described in connection with that embodiment or example is included in at least one embodiment or example of this application. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples. Moreover, without contradiction, those skilled in the art can combine and integrate the different embodiments or examples described in this specification, as well as the features of different embodiments or examples.

[0097] Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one of that feature. In the description of this application, "N" means at least two, such as two, three, etc., unless otherwise explicitly specified.

[0098] Any process or method described in the flowchart or otherwise herein can be understood as representing a module, segment, or portion of code comprising one or more N executable instructions for implementing custom logic functions or processes, and the scope of the preferred embodiments of this application includes additional implementations in which functions may be performed not in the order shown or discussed, including substantially simultaneously or in reverse order depending on the functions involved, as should be understood by those skilled in the art to which embodiments of this application pertain.

[0099] It should be understood that the various parts of this application can be implemented using hardware, software, firmware, or a combination thereof. In the above embodiments, the N steps or methods can be implemented using software or firmware stored in memory and executed by a suitable instruction execution system. For example, if implemented in hardware, as in another embodiment, it can be implemented using any one or a combination of the following techniques known in the art: discrete logic circuits having logic gates for implementing logical functions on data signals, application-specific integrated circuits (ASICs) having suitable combinational logic gates, programmable gate arrays (FPGAs), field-programmable gate arrays (FPGAs), etc.

[0100] Those skilled in the art will understand that all or part of the steps of the methods in the above embodiments can be implemented by a program instructing related hardware. The program can be stored in a computer-readable storage medium, and when executed, the program includes one or a combination of the steps of the method embodiments.

[0101] Although embodiments of this application have been shown and described above, it is understood that the above embodiments are exemplary and should not be construed as limiting this application. Those skilled in the art can make changes, modifications, substitutions and variations to the above embodiments within the scope of this application.

Claims

1. A method for compressing trajectory data, characterized in that, Includes the following steps: Acquire vehicle trajectory data and trajectory points to be compressed; Determine whether a forward reference trajectory point exists in the trajectory data; If there is no forward reference trajectory point in the trajectory data, the trajectory point to be compressed is compressed using a preset intra-point compression algorithm to obtain a key trajectory point. The key trajectory point is added to the queue to be written and cached as a forward reference trajectory point. Otherwise, it is determined whether there is a backward reference trajectory point in the trajectory data. If no backward reference trajectory point exists in the trajectory data, then when the trajectory point to be compressed and the forward reference trajectory point meet the first preset similarity matching requirement, the trajectory point to be compressed is compressed using a preset forward reference trajectory point compression algorithm to obtain a first forward prediction point, and the first forward prediction point is added to a temporary queue and cached as a backward reference trajectory point. Otherwise, when the trajectory point to be compressed does not meet the second preset similarity matching requirement with the forward reference trajectory point and the backward reference trajectory point, the trajectory point is compressed using the preset forward reference trajectory point compression algorithm to obtain a first forward prediction point. The trajectory point to be compressed is compressed to obtain a second forward prediction point. The second forward prediction point and the first forward prediction point in the temporary queue are added to the queue to be written. The second forward prediction point is cached as a forward reference trajectory point. When the trajectory point to be compressed meets the second preset similarity matching requirement with the forward reference trajectory point and the backward reference trajectory point, the trajectory point to be compressed is compressed to obtain a bidirectional prediction point using a preset compression algorithm between forward and backward bidirectional reference points. The bidirectional prediction point is added to the queue to be written. All data in the queue to be written is stored in a preset terminal.

2. The method according to claim 1, characterized in that, After determining that the forward reference trajectory point exists in the trajectory data and that the backward reference trajectory point does not exist in the trajectory data, the method further includes: If the trajectory point to be compressed and the forward reference trajectory point do not meet the first preset similarity matching requirement, then the trajectory point to be compressed is compressed using a preset intra-point compression algorithm to obtain the key trajectory point.

3. The method according to claim 1, characterized in that, After determining that the forward reference trajectory point exists in the trajectory data and the backward reference trajectory point does not exist in the trajectory data, the method further includes: If at least one major matching element between the trajectory point to be compressed and the forward reference trajectory point exceeds the corresponding error threshold, it is determined that the trajectory point to be compressed and the forward reference trajectory point do not meet the first preset similarity matching requirement; otherwise, it is determined that the trajectory point to be compressed and the forward reference trajectory point meet the first preset similarity matching requirement.

4. The method according to claim 1, characterized in that, After determining that the forward reference trajectory point exists in the trajectory data and that the backward reference trajectory point exists in the trajectory data, the method further includes: If the trajectory point to be compressed has at least one minor matching element with the forward reference trajectory point and the backward reference trajectory point that exceeds the corresponding error threshold, then it is determined that the trajectory point to be compressed does not meet the second preset similarity matching requirement with the forward reference trajectory point and the backward reference trajectory point; otherwise, it is determined that the trajectory point to be compressed meets the second preset similarity matching requirement with the forward reference trajectory point and the backward reference trajectory point.

5. A trajectory data compression device, characterized in that, include: The acquisition module is used to acquire vehicle trajectory data and trajectory points to be compressed; The judgment module is used to determine whether there is a forward reference trajectory point in the trajectory data; The first compression module is used to compress the trajectory points to be compressed into key trajectory points by using a preset intra-point compression algorithm when there are no forward reference trajectory points in the trajectory data, add the key trajectory points to the queue to be written, and cache the key trajectory points as forward reference trajectory points; otherwise, it determines whether there are backward reference trajectory points in the trajectory data. The second compression module is used to compress the trajectory point to be compressed into a first forward prediction point using a preset forward reference trajectory point compression algorithm when there is no backward reference trajectory point in the trajectory data, and the trajectory point to be compressed meets a first preset similarity matching requirement with the forward reference trajectory point. The first forward prediction point is then added to a temporary queue and cached as a backward reference trajectory point. Otherwise, when the trajectory point to be compressed does not meet the second preset similarity matching requirement with both the forward and backward reference trajectory points, the module uses the preset forward reference trajectory point compression algorithm to compress the trajectory point to be compressed into a first forward prediction point. The compression algorithm compresses the trajectory point to be compressed to obtain a second forward prediction point. The second forward prediction point and the first forward prediction point in the temporary queue are added to the queue to be written. The second forward prediction point is cached as a forward reference trajectory point. When the trajectory point to be compressed meets the second preset similarity matching requirement with the forward reference trajectory point and the backward reference trajectory point, the trajectory point to be compressed is compressed to obtain a bidirectional prediction point using a preset bidirectional reference point compression algorithm. The bidirectional prediction point is added to the queue to be written. All data in the queue to be written is stored in a preset terminal.

6. The apparatus according to claim 5, characterized in that, After determining that the forward reference trajectory point exists in the trajectory data and that the backward reference trajectory point does not exist in the trajectory data, the second compression module further includes: The first compression unit is used to compress the trajectory point to be compressed into the key trajectory point by using a preset intra-point compression algorithm when the trajectory point to be compressed and the forward reference trajectory point do not meet the first preset similarity matching requirement.

7. The apparatus according to claim 5, characterized in that, After determining that the forward reference trajectory point exists in the trajectory data and the backward reference trajectory point does not exist in the trajectory data, the second compression module further includes: The first determination unit is configured to determine that the trajectory point to be compressed and the forward reference trajectory point do not meet the first preset similarity matching requirement if at least one major matching element between the trajectory point to be compressed and the forward reference trajectory point exceeds the corresponding error threshold; otherwise, it determines that the trajectory point to be compressed and the forward reference trajectory point meet the first preset similarity matching requirement.

8. The apparatus according to claim 5, characterized in that, After determining that the forward reference trajectory point exists in the trajectory data and that the backward reference trajectory point exists in the trajectory data, the second compression module further includes: The second determination unit is configured to determine that the trajectory point to be compressed does not meet the second preset similarity matching requirement when at least one secondary matching element between the forward reference trajectory point and the backward reference trajectory point exceeds the corresponding error threshold; otherwise, it determines that the trajectory point to be compressed meets the second preset similarity matching requirement.

9. An electronic device, characterized in that, include: A memory, a processor, and a computer program stored in the memory and executable on the processor, the processor executing the program to implement the trajectory data compression method as described in any one of claims 1-4.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that, The program is executed by the processor to implement the trajectory data compression method as described in any one of claims 1-4.

Citation Information

Patent Citations

  • Trajectory data compression method based on Frechet distance

    CN110518916A

  • Vehicle track thinning method and device, electronic equipment and storage medium

    CN114840503A