Real-time data compression and storage method and device

By combining XOR encoding and run-length encoding with an adaptive reference frame update mechanism, the problems of high computational overhead and unstable compression effect of the vehicle terminal compression algorithm are solved, and efficient and stable real-time data storage is achieved.

CN120915852APending Publication Date: 2025-11-07CETC ECRIEEPOWER (ANHUI) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511253147.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-09-03
Publication Date
2025-11-07

AI Technical Summary

Technical Problem

Existing compression algorithms have high computational overhead in vehicle terminals, fail to adapt to the characteristics of real-time data, have unstable compression effects, and cannot meet the storage requirements under different driving conditions.

Method used

A dual-coupled compression mechanism of XOR encoding and run-length encoding is adopted. By combining the difference data processing of the reference frame and the incremental frame, the change is extracted by XOR operation and deep compression is performed by run-length encoding. Combined with the adaptive reference frame update mechanism, it can adapt to the data changes in different driving scenarios.

Benefits of technology

Significantly reducing storage overhead enhances the robustness and practical value of the compression system in vehicle terminals, ensuring high compression performance under various operating conditions while balancing computational efficiency and resource adaptability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120915852A_ABST
    Figure CN120915852A_ABST
Patent Text Reader

Abstract

The invention discloses a real-time data compression and storage method and device, relates to the field of vehicle-mounted terminal data storage, and can solve the technical problems that when a vehicle-mounted terminal stores real-time data at the present stage, an existing compression scheme is high in calculation overhead, not suitable for real-time data characteristics and unstable in compression effect. Comprising the following steps: determining a plurality of data frames according to vehicle controller area network (CAN) bus information; wherein the data frames are used for representing vehicle dynamic parameters in a preset time period, and each data frame corresponds to a different preset time period; determining a reference frame and an increment frame from the plurality of data frames; determining difference data of the increment frame relative to the reference frame, and compressing the difference data of the increment frame to obtain a compression result of the increment frame; and storing the compression results of the reference frame and the increment frame into a target database. The method is used for real-time compression and storage of the vehicle state parameters.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the field of vehicle terminal data storage, and in particular to a real-time data compression storage method and device. BACKGROUND

[0002] The vehicle terminal collects Controller Area Network (CAN) bus messages, packages real-time data according to Telematics Service Provider (TSP) protocols, and stores the data in a local medium (such as an embedded database) for subsequent analysis, uploading, or tracing. Due to frequent data collection (such as generating data packets every second), long-term accumulation of uncompressed raw data can rapidly consume limited storage space, posing a serious challenge to storage capacity and lifespan.

[0003] Although existing general compression algorithms have high compression rates, their compression and decompression processes can consume excessive processor resources in vehicle terminals with limited computing and memory resources, affecting the real-time performance of critical tasks of the terminal. Moreover, these algorithms are not optimized for the characteristics of real-time data, i.e., a large number of fields remain unchanged or change slightly at consecutive time points.

[0004] Fixed compression strategies cannot adapt to the differences in data changes under different driving states of the vehicle: the compression effect is acceptable when the data is smooth, but the compression effect decreases significantly when the data fluctuates dramatically, and even the compressed data volume can be greater than the original data, making it difficult to meet the storage needs of the vehicle terminal. SUMMARY

[0005] The present application provides a real-time data compression storage method and device, which can solve the technical problems of high computational overhead, inadaptability to real-time data characteristics, and unstable compression effect of existing compression schemes when storing real-time data in vehicle terminals at the present stage.

[0006] To achieve the above purpose, the present application adopts the following technical solutions: In a first aspect, the present application provides a real-time data compression storage method, comprising: determining a plurality of data frames according to vehicle Controller Area Network (CAN) bus information; wherein the data frame is used to represent the vehicle dynamic parameters within a predetermined period, and each data frame corresponds to a different predetermined period; determining a reference frame and an incremental frame from the plurality of data frames; wherein the reference frame is the first data frame or a data frame in a predetermined order among the plurality of data frames, and the incremental frame is other data frame except the reference frame among the plurality of data frames; determining the difference data of the incremental frame relative to the reference frame, compressing the difference data of the incremental frame to obtain the compression result of the incremental frame; and storing the compression results of the reference frame and the incremental frame into a target database.

[0007] In a possible implementation, determining the difference data of the incremental frame relative to the reference frame is performed by the following steps: performing an exclusive OR (XOR) operation on the incremental frame and the reference frame.

[0008] In a possible implementation, compressing the difference data of the incremental frame to obtain the compression result of the incremental frame is performed by the following steps: performing run-length encoding (RLE) on the difference data of the incremental frame.

[0009] In a possible implementation, when the original data of the incremental frame needs to be obtained, the method further includes the following steps: reading the compression result of the reference frame and the incremental frame from the target database; decompressing the compression result of the incremental frame to obtain the difference data of the incremental frame relative to the current reference frame; and determining the original data of the incremental frame according to the reference frame and the difference data of the incremental frame relative to the current reference frame.

[0010] In a possible implementation, after the difference data of the incremental frame is compressed to obtain the compression result of the incremental frame, the method further includes the following steps: when the incremental frame and the current reference frame satisfy at least one preset condition, determining the incremental frame as a new reference frame; wherein the preset condition includes at least one of the following: an average difference degree of the last N incremental frames relative to the current reference frame exceeds a first preset threshold, an average compression rate of the compressed difference data of the last M incremental frames exceeds a second preset threshold, and a number of the incremental frames determined since the current reference frame is determined exceeds a third preset threshold, N and M are positive integers.

[0011] In a possible implementation, the average difference degree of the last N incremental frames relative to the current reference frame is determined by the following formula one: Formula one wherein, represents the difference degree, and n represents the length of the data frame, represents the incremental frame, represents the reference frame, and i represents the number of bytes in the data frame, represents the average difference degree, and j represents the number of the data frame. The average compression rate of the compressed difference data of the last M incremental frames is determined by the following formula two: Formula two wherein, represents the compression rate, represents the data capacity of the compressed difference data, represents the original data capacity of the incremental frame, represents the average compression rate, and j represents the number of the data frame.

[0012] In a possible implementation, after the difference data of the incremental frame is compressed to obtain the compression result of the incremental frame, the method further includes: updating the current reference frame according to a reference frame update decision function and a reference frame update execution function; wherein the output value of the reference frame update function is a Boolean value, and the Boolean value is used to represent whether the current reference frame needs to be updated after the kth incremental frame is compressed, and the reference frame update decision function is represented by the following formula three: Formula three wherein, the Boolean value output by the reference frame update function, and the logical or operation is represented by, the preset condition that the average difference degree of the continuous N incremental frames relative to the current reference frame exceeds the first preset threshold, the preset condition that the average compression rate of the compressed difference data of the continuous M incremental frames exceeds the second preset threshold, the preset condition that the number of the incremental frames determined continuously since the current reference frame is determined exceeds the third preset threshold; The reference frame update execution function is represented by the following formula four: Formula four wherein, the reference frame used when the mth incremental frame is processed, k the updated reference frame.

[0013] In a possible implementation, the method further includes: periodically obtaining the vehicle CAN bus information of the vehicle in each preset period.

[0014] In a possible implementation, the data frame is determined according to the vehicle CAN bus information, specifically including: performing structured data processing on the periodically obtained vehicle CAN bus information according to the telematics service provider (TSP) protocol specification to obtain a plurality of data frames.

[0015] In a second aspect, the present application provides a real-time data compression storage device, comprising: a processing unit and a storage unit; the processing unit is used to determine a plurality of data frames according to vehicle CAN bus information; wherein the data frame is used to represent the vehicle dynamic parameter in a preset period, and each data frame corresponds to a different preset period; the processing unit is further used to determine a reference frame and an incremental frame from the plurality of data frames; wherein the reference frame is the first data frame or a data frame in a preset order in the plurality of data frames, and the incremental frame is other data frame except the reference frame in the plurality of data frames; the processing unit is further used to determine the difference data of the incremental frame relative to the reference frame, and compress the difference data of the incremental frame to obtain the compression result of the incremental frame; and the storage unit is used to store the reference frame and the compression result of the incremental frame into a target database.​

[0016] In one possible implementation, the processing unit is also used to perform an XOR encoding operation between the incremental frame and the reference frame.

[0017] In one possible implementation, the processing unit is also used to compress the difference data of the incremental frames using run-length encoding (RLE).

[0018] In one possible implementation, the processing unit is further configured to read the compression results of the reference frame and the incremental frame from the target database; the processing unit is further configured to decompress the compression result of the incremental frame to obtain the difference data of the incremental frame relative to the current reference frame; the processing unit is further configured to determine the original data of the incremental frame based on the difference data of the reference frame and the incremental frame relative to the current reference frame.

[0019] In one possible implementation, the processing unit is further configured to determine the incremental frame as a new reference frame when the incremental frame and the current reference frame satisfy at least one preset condition; wherein the preset condition includes at least one of the following: the average difference between N consecutive incremental frames and the current reference frame exceeds a first preset threshold, the average compression ratio of the difference data of M consecutive incremental frames after compression exceeds a second preset threshold, and the number of incremental frames determined consecutively since the current reference frame is determined exceeds a third preset threshold, where N and M are positive integers.

[0020] In one possible implementation, the processing unit is further configured to update the current reference frame based on the reference frame update decision function and the reference frame update execution function; wherein, the output value of the reference frame update function is a Boolean value, which is used to characterize whether the current reference frame needs to be updated after compressing the k-th incremental frame, and the reference frame update decision function is expressed as the following formula 3: Formula 3 in, This represents the boolean value output by the baseline frame update function; ∨ indicates a logical OR operation. This indicates that the preset condition is met, meaning that the average difference between N consecutive incremental frames and the current reference frame exceeds a first preset threshold. This indicates that the preset condition is met: the average compression ratio of the differential data after compression of M consecutive incremental frames exceeds a second preset threshold. This indicates a preset condition where the number of incremental frames determined consecutively since the current reference frame is determined exceeds the third preset threshold. The base frame update execution function is represented by the following formula: Formula 4 in, Indicates processing the first k The reference frame used for each incremental frame. The updated reference frame is represented.

[0021] In a possible implementation, the real-time data compression storage device further includes an acquisition unit; the acquisition unit is configured to periodically acquire vehicle CAN bus information of the vehicle in each preset time period.

[0022] In a possible implementation, the processing unit is further configured to perform structured data processing on the periodically acquired vehicle CAN bus information according to a remote information service provider (TSP) protocol specification, to obtain a plurality of data frames.

[0023] In a third aspect, the present application provides a computer readable storage medium storing one or more programs, the one or more programs including instructions that, when executed by an electronic device of the present application, cause the electronic device to perform the real-time data compression storage method as described in the first aspect and any possible implementation of the first aspect.

[0024] In a fifth aspect, the present application provides an electronic device, including a processor and a memory; the memory is configured to store one or more programs, the one or more programs including computer execution instructions; when the electronic device is running, the processor executes the computer execution instructions stored in the memory, so that the electronic device performs the real-time data compression storage method as described in the first aspect and any possible implementation of the first aspect.

[0025] In a sixth aspect, the present application provides a computer program product including instructions that, when executed on a computer, cause an electronic device of the present application to perform the real-time data compression storage method as described in the first aspect and any possible implementation of the first aspect.

[0026] In a seventh aspect, the present application provides a chip system applied to a real-time data compression storage device; the chip system includes one or more interface circuits and one or more processors. The interface circuit and the processor are interconnected through a circuit; the interface circuit is configured to receive a signal from a memory of the real-time data compression storage device and send the signal to the processor, the signal including computer instructions stored in the memory. When the processor executes the computer instructions, the real-time data compression storage device performs the real-time data compression storage method as described in the first aspect and any possible implementation of the first aspect.

[0027] Based on the above technical scheme, the CAN bus message in the preset period is aggregated into a structured data frame according to the TSP protocol, the standardization and timing processing of the vehicle dynamic parameters are realized, and a standard basis is provided for subsequent processing; the dual coupling compression mechanism of XOR coding and RLE is used, and the two algorithms are synergistic. The time redundancy characteristic of the vehicle real-time data is used by means of XOR coding, the unchanged data is converted into a large number of continuous zero bytes by operation with the reference frame, so that the change amount is extracted efficiently, and at the same time, an ideal input is created for RLE. RLE is used for deep compression of the continuous zero bytes, so that the storage cost is greatly reduced. The overall compression effect is much higher than that of a single algorithm or a general compression library, and the two algorithms are efficient in calculation and suitable for the environment of limited resources of the vehicle terminal. At the same time, the closed-loop adaptive reference frame updating mechanism is innovatively introduced, the Manhattan distance is used to quantify the data fluctuation, the compression effect is monitored as feedback, and the safety strategy of setting the upper limit of the update cycle is set, so that the closed-loop control with feedback is formed. The system can intelligently cope with the data changes in different driving scenes, and the complex logic is abstracted into a clear mathematical model through the formal decision function and the update execution function, so that the scheme is rigorous and implementable. In combination with the structured storage of the lightweight database, the storage efficiency is improved while the calculation efficiency, reliability and system adaptability are taken into account, the resource constraint problem of the vehicle real-time data storage is effectively solved, the overall compression performance can be maintained at a high level under various working conditions, and the robustness and practical value of the compression system in the vehicle scene are improved. BRIEF DESCRIPTION OF DRAWINGS

[0028] Figure 1 An architectural schematic diagram of a real-time data compression storage system provided by an embodiment of the application is shown in the figure. Figure 2 A flowchart of a real-time data compression storage method provided by an embodiment of the application is shown in the figure. Figure 3 A flowchart of another real-time data compression storage method provided by an embodiment of the application is shown in the figure. Figure 4 A flowchart of another real-time data compression storage method provided by an embodiment of the application is shown in the figure. Figure 5 A schematic diagram of XOR coding of a reference frame and a delta frame provided by an embodiment of the application is shown in the figure. Figure 6 A compression schematic diagram of RLE provided by an embodiment of the application is shown in the figure. Figure 7 A structural schematic diagram of a real-time data compression storage device provided by an embodiment of the application is shown in the figure. Figure 8 A structural schematic diagram of another real-time data compression storage device provided by an embodiment of the application is shown in the figure. DETAILED DESCRIPTION

[0029] With reference to the drawings and the embodiments of the present application, the technical solutions in the embodiments of the present application will be clearly and completely described. Obviously, the described embodiments are only a part of the embodiments of the present application, but not all the embodiments of the present application. Based on the embodiments of the present application, all other embodiments obtained by a person of ordinary skill in the art without creative effort are within the scope of the present application.

[0030] The character " / " in the present application generally represents that the associated objects before and after the character " / " are in an "or" relationship. For example, A / B can be understood as A or B.

[0031] The terms "first" and "second" in the description and claims of the present application are used to distinguish different objects, and are not used to describe a specific order of the objects. For example, the first edge service node and the second edge service node are used to distinguish different edge service nodes, and are not used to describe the order of the features of the edge service nodes.

[0032] In addition, the terms "comprising" and "having" and any variations thereof mentioned in the description of the present application are intended to cover non-exclusive inclusion. For example, a process, method, system, product or device that includes a series of steps or units is not limited to the listed steps or units, but can optionally include other steps or units not listed, or can optionally include other steps or units inherent to the process, method, product or device.

[0033] In addition, in the embodiments of the present application, the words "exemplarily" or "for example" are used to represent an example, illustration or description. Any embodiment or design scheme described as "exemplarily" or "for example" in the present application should not be interpreted as more preferred or more advantageous than other embodiments or design schemes. Rather, the words "exemplarily" or "for example" are used to present the concept in a specific manner.

[0034] The technical terms related to the present application are described below: 1. XOR encoding XOR encoding is a data processing technology based on logical operation, and the core is to compare the differences between two groups of data through "XOR operation" to efficiently extract the change information.

[0035] The basic principle is: compare two groups of data of the same length (such as two binary sequences) bit by bit. If the corresponding values are the same (both 0 or both 1), the operation result is 0; if the values are different (one is 0 and the other is 1), the result is 1. Through this operation, a group of "difference data" can be quickly obtained - the positions with 1 in the result represent the differences between the two groups of data, and the positions with 0 represent the same places.

[0036] For example, assuming the baseline data is "101010" and the target data is "100011", the XOR operation yields "001001". This result visually demonstrates that the two sets of data differ in the 3rd and 6th positions.

[0037] In data storage or transmission, the advantage of XOR encoding is that it eliminates the need to store the complete target data. Only the baseline data and the difference data obtained through XOR are needed to reconstruct the original target data. This method is computationally simple and fast, with low CPU and memory resource consumption, making it ideal for resource-constrained scenarios such as in-vehicle terminals. It is particularly suitable for processing continuously generated real-time data with a large amount of repetitive content (such as vehicle status parameters).

[0038] 2. Run coding

[0039] Run-Length Encoding (RLE) is a lightweight compression technique for repetitive data. Its core principle is to replace continuously repeating original data with "repetition count + repetitive content", thereby reducing storage requirements.

[0040] The basic principle is: when scanning a data sequence, record the consecutive occurrences of the same content (called "runs") and the number of times the content is repeated, and then use the combination of "number of times + content" to represent this segment of data, instead of storing each piece of content repeatedly.

[0041] For example, for the data sequence "AAAAABBBCC" (5 A's, 3 B's, 2 C's), RLE will compress it into "5A3B2C". When restoration is needed, simply expand the "content" according to the "number of times" to recover the original data.

[0042] The advantage of this encoding method lies in its simple algorithm, extremely fast compression and decompression speeds, and minimal computational resource consumption. It is well-suited for processing data containing a large amount of continuous and repetitive content (such as long-term unchanging state parameters of a stationary vehicle or stable background information in monitoring data). Although its compression effect is limited for data with high randomness and low repetition, RLE can effectively reduce storage overhead in real-time data (especially dynamic parameters collected by vehicle terminals) due to the presence of a large number of short-term unchanging fields, and it is also compatible with resource-constrained embedded devices.

[0043] 3. Controller Area Network Bus

[0044] Controller Area Network (CAN) bus is a serial communication protocol inside the vehicle, used to realize real-time data transmission between vehicle-mounted electronic devices (such as engine controller, instrument panel, sensor, etc.). It is like the "nerve network of the vehicle", which can efficiently transmit various vehicle dynamic parameters (such as vehicle speed, steering angle, battery status, etc.).

[0045] In this scheme, the real-time data collected by the vehicle terminal is derived from the CAN bus, so the CAN bus is the "data source" of the scheme - the messages transmitted by it form data frames after processing, providing original materials for the subsequent reference frame / incremental frame division, compressed storage.

[0046] 4、Reference frame

[0047] The reference frame is a "reference frame" determined from multiple data frames collected by the vehicle terminal, used to store complete vehicle dynamic parameters (such as speed, rotation speed, fuel consumption, etc.) within a certain preset period. It plays the role of "reference" in the scheme: on the one hand, it serves as a comparison standard for calculating differences of subsequent incremental frames (other data frames after the reference frame), on the other hand, it is the original basis for data recovery - through the difference data between the reference frame and the incremental frame, the original information of the incremental frame can be reversely restored.

[0048] The core value of the reference frame lies in reducing redundant storage: instead of repeatedly saving the complete content of all data frames, only the difference part of the incremental frame needs to be stored with reference to the reference frame, greatly reducing the storage pressure.

[0049] 5、Incremental frame

[0050] The incremental frame is other data frames after the corresponding period of the reference frame, which still stores complete vehicle dynamic parameters (consistent with the properties of ordinary data frames), but is used to compare with the reference frame to extract change information due to its time sequence after the reference frame.

[0051] In the scheme, the core role of the incremental frame is to "provide difference sources": through operations (such as XOR) with the reference frame, difference data is obtained, which is stored after compression, retaining the key change information of the incremental frame and avoiding the redundancy caused by complete storage. The dynamic cooperation between the incremental frame and the reference frame is the basis for realizing "on-demand compression and efficient storage".

[0052] 6、Telematics service provider agreement

[0053] The Telematics Service Provider (TSP) protocol is a standardized protocol developed by telematics service providers to regulate the data interaction format (such as data packetization, field definition, transmission rules, etc.) between the vehicle terminal and the background service.

[0054] In the scheme, the vehicle terminal needs to package the original message collected from the CAN bus according to the TSP protocol to form a real-time data frame that meets the specification, and then store or upload it. The TSP protocol ensures the uniformity of the data format, which is the prerequisite for subsequent data compression, analysis, and traceability.

[0055] 7. Embedded database

[0056] An embedded database is a lightweight database that does not require a separate server and can be directly embedded into embedded devices such as vehicle terminals for local data storage and management (such as SQLite).

[0057] In this scheme, the compressed reference frame and incremental frame difference data are finally stored in the embedded database. Its "lightweight, low resource consumption" characteristics are suitable for the limited hardware resources (such as memory and storage capacity) of vehicle terminals, ensuring the efficiency and stability of data storage.

[0058] The above introduces the technical terms related to this application.

[0059] At present, vehicle terminals collect CAN bus messages, package real-time data according to the TSP protocol, and store them in local media (such as embedded databases) for subsequent analysis, uploading, or traceability. Due to frequent data collection (such as generating data packets every second), the long-term accumulation of uncompressed raw data will rapidly consume limited storage space, posing a serious challenge to storage capacity and lifespan.

[0060] Although existing general compression algorithms have high compression rates, they consume too much processor resources in the compression and decompression process in vehicle terminals with limited computing and memory resources, affecting the real-time performance of critical tasks. Moreover, these algorithms are not optimized for the characteristics of real-time data, which have a large number of fields that do not change or change slightly at consecutive time points.

[0061] Fixed compression strategies cannot adapt to the differences in data changes under different driving conditions of vehicles: the compression effect is acceptable when the data is flat, but it will significantly decrease when the data fluctuates dramatically, even leading to a situation where the compressed data is larger than the original data, making it difficult to meet the storage needs of vehicle terminals.

[0062] In summary, the existing compression schemes have the defects of high computational overhead, inadaptability to real-time data characteristics, and unstable compression effect when vehicle terminals store real-time data at the present stage.

[0063] In view of this, in order to solve the problems existing in the prior art, the present application provides a real-time data compression storage method and device, which can solve the technical problems of high calculation overhead, inadaptation to real-time data characteristics, and unstable compression effect of the existing compression scheme when the vehicle terminal stores real-time data at the present stage.

[0064] The real-time data compression storage method provided by the present application will be described in detail below in conjunction with the accompanying drawings of the specification: Exemplarily, as shown in Figure 1 , Figure 1 The architecture schematic diagram of the real-time data compression storage system provided by the present application. The real-time data compression storage system 10 comprises a data acquisition module 11, a data packet assembly module 12, a data compression module 13, an adaptive decision module 14, a database module 15, and a decompression module 16.

[0065] The data acquisition module 11 is configured to periodically acquire vehicle CAN bus information of a vehicle within each preset time period.

[0066] The data packet assembly module 12 is configured to determine a plurality of data frames according to the vehicle controller area network (CAN) bus information. The data frames are used to represent vehicle dynamic parameters within a preset time period, and each data frame corresponds to a different preset time period.

[0067] Specifically, the application program of the vehicle terminal acquires messages on the CAN bus in real time, and encapsulates a plurality of messages acquired within a certain preset time period (for example, every second) into a data packet according to the TSP protocol specification. The data packet is a data frame.

[0068] Exemplarily, the vehicle CAN bus information can include power system parameters, chassis and driving system parameters, vehicle body and comfort system parameters, auxiliary and safety system parameters. Specifically, the power system parameters include engine speed, vehicle speed, throttle opening, fuel pressure, coolant temperature, and battery voltage, which reflect the engine operation and energy supply state in real time; the chassis and driving system parameters include gear information, steering wheel angle, brake state, acceleration, and wheel speed, which are related to vehicle driving control and dynamic stability; the vehicle body and comfort system parameters involve door and light state, air conditioning setting, and seat belt state, which are related to driving experience and basic safety; the auxiliary and safety system parameters include fault codes, tire pressure data, radar or camera signals, and airbag state, which provide support for vehicle fault diagnosis and advanced auxiliary functions. These parameters together constitute the core data basis for the vehicle terminal to collect and analyze.

[0069] The data compression module 13 is configured to determine the difference data of the incremental frame relative to the reference frame, compress the difference data of the incremental frame, and obtain the compression result of the incremental frame.

[0070] In some embodiments, the data compression module 13 determines the difference data of the incremental frame relative to the reference frame by performing an exclusive OR (XOR) operation on the incremental frame and the reference frame.

[0071] In some embodiments, the data compression module 13 compresses the difference data of the incremental frame by run-length encoding (RLE) to obtain the compression result of the incremental frame.

[0072] The adaptive decision module 14 is further configured to determine the reference frame and the incremental frame from the plurality of data frames. The reference frame is the first data frame or a data frame in a preset order in the plurality of data frames, and the incremental frame is a data frame other than the reference frame in the plurality of data frames.

[0073] The adaptive decision module 14 is further configured to, when the original data of the incremental frame is needed, perform decompression and recovery operations on the incremental frame, specifically including: reading the compression result of the reference frame and the incremental frame from a target database; decompressing the compression result of the incremental frame to obtain the difference data of the incremental frame relative to the current reference frame; and determining the original data of the incremental frame according to the difference data of the reference frame and the incremental frame relative to the current reference frame.

[0074] The adaptive decision module 14 is further configured to determine the incremental frame as a new reference frame when the incremental frame and the current reference frame satisfy at least one preset condition. The preset condition includes at least one of: an average difference degree of the incremental frame relative to the current reference frame exceeds a first preset threshold, an average compression rate of the difference data of the incremental frame after compression exceeds a second preset threshold, and a number of incremental frames determined since the current reference frame is determined exceeds a third preset threshold. N and M are positive integers.

[0075] The adaptive decision module 14 is further configured to store the compression result of the reference frame and the incremental frame into the target database.

[0076] The database module 15 is a target database configured to store the compression result of the reference frame and the incremental frame.

[0077] In some embodiments, the target database provided by the database module 15 is an embedded database.

[0078] The decompression module 16 is configured to, when the original data of the incremental frame is needed, read the compression result of the reference frame and the incremental frame from the target database; decompress the compression result of the incremental frame to obtain the difference data of the incremental frame relative to the current reference frame; and determine the original data of the incremental frame according to the difference data of the reference frame and the incremental frame relative to the current reference frame.

[0079] Exemplarily, the real-time data compression storage system 10 can also be connected to a cloud server, and the compressed and stored data can be synchronized and uploaded to the cloud server.

[0080] The architecture of the real-time data compression storage system 10 provided by the application is described above. It should be noted that the real-time data compression storage system 10 can be integrated into a vehicle terminal of a vehicle, or can be independently arranged in an electronic device installed on the vehicle. In the following embodiments, the real-time data compression storage system 10 is integrated into the vehicle terminal of the vehicle, that is, the execution subject of the real-time data compression storage method is the vehicle terminal.

[0081] Exemplarily, as shown in Figure 2 , Figure 2 The flowchart of the real-time data compression storage method provided by the application includes the following steps: S201, periodically acquiring vehicle CAN bus information of the vehicle in each preset period.

[0082] Exemplarily, the vehicle CAN bus information can include power system parameters, chassis and driving system parameters, vehicle body and comfort system parameters, auxiliary and safety system parameters. Specifically, the power system parameters include engine speed, vehicle speed, throttle opening, fuel pressure, coolant temperature and battery voltage, which reflect the engine operation and energy supply state in real time; the chassis and driving system parameters include gear information, steering wheel angle, brake state, acceleration and wheel speed, which are related to vehicle driving control and dynamic stability; the vehicle body and comfort system parameters relate to door and light state, air conditioning setting and seat belt state, which are related to driving experience and basic safety; the auxiliary and safety system parameters include fault code, tire pressure data, radar or camera signal and airbag state, which provide support for vehicle fault diagnosis and advanced auxiliary functions, and these parameters together constitute the core data basis for vehicle terminal collection and analysis.

[0083] In one possible implementation, this step can be performed by the data collection module described above, so that the vehicle terminal periodically acquires the vehicle CAN bus information of the vehicle in each preset period.

[0084] S202, determining a plurality of data frames according to the vehicle controller area network CAN bus information.

[0085] Among them, the data frame is used to represent the vehicle dynamic parameter in the preset period, and each data frame corresponds to a different preset period.

[0086] Optionally, the vehicle terminal performs structured data processing on the periodically acquired vehicle CAN bus information according to the TSP protocol specification, to obtain a plurality of data frames. Specifically, the application program of the vehicle terminal collects messages on the CAN bus in real time, and encapsulates a plurality of messages collected within a preset time period (for example, every second) into a data packet according to the TSP protocol specification, and the data packet is a data frame.

[0087] In this step, the vehicle terminal first receives original messages transmitted by the vehicle CAN bus in real time through the controller area network interface. The original messages contain vehicle dynamic parameters sent by each electronic control unit during vehicle operation, which are encoded in a preset communication protocol format (such as the ISO 11898 standard) and transmitted on the CAN bus through a differential signal.

[0088] During the collection process, the vehicle terminal periodically aggregates the CAN bus messages acquired in real time according to a preset time interval (i.e., a preset time period, for example, every second). Within each preset time period, the application program continuously receives and caches a plurality of CAN messages within the time period, and then performs structured processing on the cached messages according to the TSP protocol specification: according to the data field format, field order and encapsulation rules defined by the TSP protocol, the effective parameters in the plurality of CAN messages are extracted and integrated into a unified structure data packet, which is a data frame corresponding to the preset time period.

[0089] The length of the preset time period can be configured according to the TSP protocol requirements or actual application scenarios (such as 100ms, 500ms, 1s, etc.), and each preset time period is continuous and non-overlapping on the time axis. In addition to containing complete vehicle dynamic parameters within the corresponding preset time period, each data frame also needs to carry metadata (such as terminal identifier, timestamp, check code, etc.) specified by the TSP protocol to meet the standardized needs of data uploading, analysis and tracing. Since each preset time period is independent in the time dimension, the plurality of data frames generated finally correspond to different preset time periods and form an ordered sequence in chronological order, providing structured and time-sequenced basic data for the division and processing of reference frames and incremental frames.

[0090] It can be understood that through this step, the vehicle terminal can convert the continuous and dispersed original parameter data transmitted by the CAN bus into structured and time-sequenced data frames, providing a standardized processing object for determining reference frames and incremental frames from the data frames, and through the association of timestamps and preset time periods, ensuring the traceability of data frames in time sequence.

[0091] In a possible implementation, the step can be performed by the data packet packaging module described above, so that the vehicle terminal determines the plurality of data frames according to the CAN bus information of the vehicle controller.

[0092] S203, determining difference data of the incremental frame relative to the reference frame, compressing the difference data of the incremental frame to obtain a compression result of the incremental frame.

[0093] Optionally, the vehicle terminal determines the difference data of the incremental frame relative to the reference frame by performing an XOR encoding operation on the incremental frame and the reference frame.

[0094] Optionally, the vehicle terminal compresses the difference data of the incremental frame to obtain a compression result of the incremental frame by performing a run-length encoding (RLE) on the difference data of the incremental frame.

[0095] It should be noted that in this step, the XOR encoding operation is first performed on the determined incremental frame and the currently effective reference frame to extract the difference data therebetween. Specifically, based on the consistency of the incremental frame and the reference frame in terms of data structure (both are structured data packets encapsulated according to the TSP protocol, containing the same field of vehicle dynamic parameters), the system performs bitwise XOR operation on the two frames of data by byte: for the byte at the corresponding position, if the binary values of the two frames of data are the same, the operation result is 0x00; if the binary values are different, the operation result is the XOR value (not 0x00) of the two bytes at the position. Through the operation, the parameter part consistent with the reference frame in the incremental frame can be converted into continuous 0x00 bytes, and only the part (non-0x00 byte) where the parameter has changed is reserved, so as to efficiently separate the difference data of the incremental frame relative to the reference frame, and realize accurate extraction of the change information.

[0096] Further, after obtaining the difference data, the system further compresses the difference data using RLE. Since the difference data generated by the XOR operation contains a large number of continuous 0x00 bytes (i.e., "runs") converted from unchanged parameters, the RLE compression encodes the same bytes (especially continuous 0x00) by scanning the byte sequence of the difference data: records the number of continuous occurrences (count value) and the byte value itself, and replaces the original continuous byte sequence with a binary tuple of "count value + byte value". For example, if there are 20 continuous 0x00 bytes in the difference data, the RLE compression will be represented as "0x140x00" (where 0x14 is the hexadecimal count value corresponding to the decimal 20); for non-continuous scattered bytes (mainly non-0x00 bytes corresponding to changed parameters), the original values are directly retained. In this way, the storage space occupied by the redundant continuous 0x00 bytes in the difference data can be greatly reduced, and the difference data is compressed twice to obtain the RLE encoding result as the compression result of the incremental frame.

[0097] It can be understood that, by using the combination strategy of "XOR extracting difference + RLE compressing redundancy", the change information is accurately separated by the high efficiency of the XOR operation, and the storage overhead is further reduced by relying on the compression advantage of RLE on continuous repeated data, which is suitable for the characteristics of limited resources of the vehicle terminal, while ensuring that the computational complexity of the compression process is controllable.

[0098] In a possible implementation, the step can be performed by the data compression module described in the foregoing to enable the vehicle terminal to determine the difference data of the incremental frame relative to the reference frame, compress the difference data of the incremental frame, and obtain the compression result of the incremental frame.

[0099] S204, store the compression results of the reference frame and the incremental frame into a target database.

[0100] It can be understood that, in this step, the vehicle terminal writes the compression results of the reference frame and the incremental frame processed in the foregoing into the target database according to a preset storage rule, to realize the structured storage and efficient management of the vehicle dynamic parameter data.

[0101] For example, the target database is a lightweight database (such as SQLite) suitable for the embedded environment of the vehicle terminal, which is preconfigured with a special data table for storing data frames, and the table structure includes but is not limited to the following fields: a unique identifier (ID) of the data frame, a timestamp (corresponding to a preset time period to which the data frame belongs), a frame type identifier (is_base_frame field), an original data / compressed data storage area, a data check code, and the like.

[0102] In a possible implementation, the specific storage process is as follows: for the determined base frame, the system directly writes the complete vehicle dynamic parameter data (without compression processing) of the base frame into the "original data storage area" of the corresponding table item in the database, and sets the "is_base_frame field" of the table item to 1 or TRUE to explicitly identify the base frame attribute; for the compression result of the incremental frame (i.e., the final data obtained by performing XOR encoding to extract the difference data and then performing RLE compression), the system writes the compression result into the "compressed data storage area" of the corresponding table item, and sets the "is_base_frame field" of the table item to 0 or FALSE to distinguish from the base frame.

[0103] In addition, to ensure data integrity and traceability, the system generates a unique timestamp (consistent with the preset time period to which the data frame belongs) and a data check code for each stored table item during the writing process, and stores the timestamp and the data check code in the corresponding fields. Through the above structured storage method, the target database can achieve classified management of the base frame and the compression result of the incremental frame, which not only ensures the efficiency of data query and reading, but also provides a clear index basis for subsequent data recovery steps, and is suitable for the limited storage resources and computing capacity of the vehicle terminal.

[0104] In a possible implementation, this step can be performed by the adaptive decision module described above in cooperation with the database module, so that the vehicle terminal stores the compression result of the base frame and the incremental frame into the target database.

[0105] Based on the above technical solution, the application aggregates the CAN bus messages in a preset time period into structured data frames according to the TSP protocol, realizes the standardization and timing processing of the vehicle dynamic parameters, and provides a standard basis for subsequent compression storage; the core is to use the dual-coupling compression mechanism of "XOR encoding + run-length encoding", which is not simply stacking two algorithms, but using the synergistic effect: XOR encoding first uses the time redundancy characteristic (a large number of bytes are the same) of the real-time data of the vehicle terminal, and converts the unchanged data into a large number of continuous zero bytes by operating with the base frame, efficiently extracts the change, and at the same time creates an ideal input for RLE; RLE performs deep compression on these continuous zero bytes, greatly reduces the storage overhead, and the overall compression effect is much higher than that of a single algorithm or a general compression library; and the two algorithms are computationally efficient, consume less processor resources of the vehicle terminal, and are suitable for embedded environments with limited performance and power consumption. Combined with the structured storage (classified management and integrity protection are realized through frame type identification, timestamp, and check code) of the lightweight database, the final storage efficiency is improved while the computational efficiency and reliability are taken into account, effectively solving the resource constraint problem of the real-time data storage of the vehicle terminal.

[0106] Exemplarily, in combination with Figure 2 For example,Figure 3 as shown, Figure 3 Another real-time data compression storage method provided in the present application is shown in the flowchart. After the difference data of the incremental frame is compressed to obtain the compression result of the incremental frame, the following steps are further included: S301, when the incremental frame and the current reference frame satisfy at least one preset condition, the incremental frame is determined as a new reference frame.

[0107] The preset condition includes at least one of the following: the average difference degree of the continuous N incremental frames relative to the current reference frame exceeds a first preset threshold, the average compression rate of the compressed difference data of the continuous M incremental frames exceeds a second preset threshold, and the number of the incremental frames determined since the current reference frame is determined exceeds a third preset threshold, N and M are positive integers.

[0108] It can be understood that the above three preset conditions correspond to decisions based on data change degree, decisions based on compression effect evaluation, and decisions based on fixed period respectively. The above three preset conditions will be described in the following examples: (1) Decision based on data change degree: In order to quantify the difference between the incremental frame and the reference frame, the Manhattan Distance algorithm is used to measure the difference, which regards the data frame as a multi-dimensional vector, and each byte represents a dimension. The Manhattan distance D k between two data frames P base (current incremental frame) and P k (reference frame) of length n is defined as the sum of the absolute values of the differences between their corresponding bytes, which satisfies the following formula one: Formula one Wherein, represents the difference degree, n represents the length of the data frame, represents the incremental frame, represents the reference frame, i represents the number of bytes in the data frame, represents the average difference degree, j represents the number of data frames.

[0109] When the average difference degree exceeds the preset high bit change threshold τ D , that is, the condition > τ D is satisfied, it indicates that the data stream characteristics have changed significantly, and the current reference frame is no longer representative and needs to be updated.

[0110] At this time, the condition function = ( > τ D, indicates that the average difference degree of the consecutive N incremental frames relative to the current reference frame exceeds the first preset threshold.

[0111] (2) Decision based on compression effect evaluation: The vehicle terminal continuously monitors the compression rate. For an incremental frame , the compression rate is defined as the ratio of the size after compression to the original size . The specific average compression rate is calculated by the following formula two: Formula two wherein represents the compression rate, represents the data capacity of the difference data after compression, represents the original data capacity of the incremental frame, represents the average compression rate, and j represents the number of the data frame.

[0112] When the average compression rate exceeds the preset low compression rate threshold τ R (for example, 0.7 or 70%), i.e. when the condition > τ R is met, it indicates that the benefit of the compression algorithm is declining, and the compression effect needs to be improved by updating the reference frame.

[0113] At this time, the condition function = ( > τ R is defined, which indicates that the average compression rate of the difference data of the consecutive M incremental frames exceeds the second preset threshold.

[0114] (3) Decision based on fixed period: To prevent potential error accumulation and ensure the robustness of the scheme, an incremental frame counter C is set. The counter records the number of incremental frames processed since the last reference frame was established. When the counter value reaches the preset maximum frame threshold N max , i.e. when the condition C ≥ N max is met, the system will forcibly perform a reference frame update.

[0115] At this time, the condition function = ( C ≥ N max is defined, which indicates that the number of incremental frames determined consecutively since the current reference frame is determined exceeds the third preset threshold.

[0116] The above describes the decision-making under the three preset conditions respectively.

[0117] In a possible implementation, based on the decision-making under the three preset conditions, the application defines a reference frame updating decision function, and the vehicle-mounted terminal updates the current reference frame according to the reference frame updating decision function. The output value of the reference frame updating function is a Boolean value, which is used to represent whether the current reference frame needs to be updated after the kth incremental frame is compressed. The reference frame updating decision function is represented by the following formula three: Formula three Wherein, the Boolean value output by the reference frame updating function, ∨ represents a logical OR operation, represents the preset condition that the average difference degree of the consecutive N incremental frames relative to the current reference frame exceeds the first preset threshold, represents the preset condition that the average compression ratio of the compressed difference data of the consecutive M incremental frames exceeds the second preset threshold, represents the preset condition that the number of incremental frames determined consecutively since the current reference frame is determined exceeds the third preset threshold.

[0118] It can be understood that when the output result of formula three is True, the system will trigger the reference frame updating.

[0119] Further, the application defines a reference frame updating execution function, and the updating process of the reference frame can be represented by the function. Let be the reference frame used when the kth incremental frame is processed. The new reference frame will be generated according to the following formula four: Formula four Formula four shows that if the output result of the decision function is True, the current incremental frame P k is set as the new reference frame of the next processing period, and is stored in the database in a complete and uncompressed manner, and the incremental frame counter C is reset to 0; otherwise, the reference frame remains unchanged.

[0120] Therefore, the application forms a closed-loop adaptive reference frame updating mechanism

[0121] ​Based on the above technical scheme, the application first aggregates the CAN bus messages in a preset period into a structured data frame according to the TSP protocol, realizes the standardization and timing processing of vehicle dynamic parameters, and provides a specification basis for subsequent processing; the core adopts a double-coupling compression mechanism of "XOR coding + run-length encoding", and utilizes the synergistic effect of the two - the time redundancy characteristic of the vehicle real-time data is used by the XOR coding to transform the unchanged data into a large number of continuous zero bytes through operation with the reference frame to efficiently extract the change amount, and at the same time, an ideal input is created for the RLE, and the RLE deeply compresses the continuous zero bytes to greatly reduce the storage overhead, and the overall compression effect is much higher than that of a single algorithm or a general compression library, and the two algorithms are efficient in calculation and suitable for the resource-limited environment of the vehicle terminal; at the same time, the closed-loop adaptive reference frame updating mechanism is innovatively introduced, the Manhattan distance quantization data fluctuation and the monitoring compression effect are combined as feedback and the safety strategy of setting the upper limit of the update cycle to form a closed-loop control with feedback, so that the system can intelligently respond to data changes in different driving scenarios, and through the formal decision function and the update execution function, the complex logic is abstracted into a clear mathematical model, enhancing the rigor and implementability of the scheme; in combination with the structured storage of the lightweight database, the storage efficiency is improved while the calculation efficiency, reliability and system adaptability are taken into account, effectively solving the resource constraint problem of vehicle real-time data storage, ensuring that a higher overall compression performance can be maintained under various working conditions, and improving the robustness and practical value of the compression system in the vehicle scene.

[0122] Exemplarily, in combination with Figure 3 As Figure 4 shown, Figure 4 the flowchart of another real-time data compression storage method provided by the application is shown, when the original data of the incremental frame is needed, the real-time data compression storage method further includes the following steps: S401, read the compression results of the reference frame and the incremental frame from the target database.

[0123] Specifically, the system retrieves the corresponding storage record in the target database (such as SQLite) according to the timestamp or unique identifier (ID) of the incremental frame to be restored: by querying the table entries with the "is_base_frame field" being 1 or TRUE in the data table, the complete original data of the current reference frame associated with the incremental frame (stored in the "original data storage area") is read; at the same time, the compression result corresponding to the incremental frame (stored in the "compressed data storage area") is read, and the timestamps, check codes and other metadata of the two are synchronously obtained to verify the time sequence association and integrity of the data (such as ensuring that the data is not tampered with by comparing the check codes).

[0124] S402, decompress the compression result of the incremental frame to obtain the difference data of the incremental frame relative to the current reference frame.

[0125] Since the compression result of the incremental frame is the product of run-length encoding (RLE) compression, the decompression process needs to perform the reverse operation corresponding to the compression: the system scans the RLE compressed data, identifies the binary tuple of "count value + byte value", and restores it to a continuous original byte sequence (for example, if the compressed data is "0x14 0x00", it is restored to 20 continuous 0x00 bytes); for non-continuous scattered bytes (corresponding to non-0x00 values of the change parameter), the original value is directly retained. Through this operation, the difference data generated by the exclusive OR encoding, that is, the bit-by-bit difference information of the incremental frame and the reference frame, can be completely restored.

[0126] S403, according to the difference data of the reference frame and the incremental frame relative to the current reference frame, determine the original data of the incremental frame.

[0127] Based on the correspondence between the difference data and the reference frame (both data structures are consistent, and are packaged according to the TSP protocol, the field order and length match), the system performs a bit-by-bit exclusive OR operation on the reference frame and the difference data: for the corresponding byte, if the byte in the difference data is 0x00, it means that the byte of the incremental frame and the reference frame at this position is the same, and the corresponding byte of the reference frame is directly retained; if the byte in the difference data is a non-0x00 value, the original byte of the incremental frame at this position is restored through the exclusive OR operation (the reference frame byte and the difference data byte are XORed again). After the full operation, the original data of the incremental frame can be completely reconstructed, including all vehicle dynamic parameters and metadata (such as terminal identifier, timestamp, etc.) specified in the TSP protocol, and the restoration result is completely consistent with the format and content of the original data frame.

[0128] Based on the above technical solution, the present application realizes the lossless recovery of the original data of the incremental frame through the process of "reading stored data, decompressing difference information, and restoring original data by exclusive OR", which not only ensures the accuracy of data restoration, but also ensures the reliability of the restoration process through database indexing and verification mechanism, so that the compressed and stored vehicle data can be completely reused when needed, meeting the core needs of data tracing and analysis in the vehicle scene.

[0129] The present application will be further described in detail below in combination with Figure 5 and Figure 6 and specific embodiments: In the present application, it is assumed that the vehicle terminal program collects data once every second and encapsulates it as a TSP data packet containing multiple CAN messages, with a size of 1KB (1024 bytes).

[0130] (1) T=0 seconds: the system starts and collects the first data packet P_0. The system initializes it as a reference frame. Insert a record in the realinfo table of the SQLite database: id: 1; timestamp: (current timestamp); is_base_frame: 1; data: (1024 bytes of P_0 data); original_size: 1024; (2) T=1 second: collect the second data packet This is a delta frame.

[0131] XOR encoding: compute Diff = P_1 XOR P_0. Assuming the vehicle state is stable, P_1 is highly similar to P_0, Diff has 95% of its bytes as 0.

[0132] RLE encoding: RLE compress Diff . For example, a sequence of {... non-zero bytes, 0, 0, 0, 0, 0,...} is compressed. Assuming the compressed Diff is Compressed_Diff , which is only 80 bytes in size.

[0133] Storage: insert a record into the database: id: 2; timestamp: (current timestamp); is_base_frame: 0; data: (80 bytes of Compressed_Diff data); original_size: 1024; where the compression ratio = 80 / 1024 ≈ 7.8%, which is significant.

[0134] (3) T=2 to T=59 seconds: the vehicle continues to drive steadily, and P_2 to P_59 collected are all delta frames. Repeat the process of step (2), which are XORed with P_0 and RLE compressed, and stored. Since the data changes are small, the average compressed size is maintained at around 100 bytes.

[0135] (4) T=60 seconds: the vehicle suddenly accelerates and turns sharply, and the data packet P_60 collected is very different from P_0.

[0136] Compression: compute Diff There are many non-zero bytes in the middle, and almost no long consecutive sequences of zeros. After RLE compression, the compressed_diff... Its size may reach 850 bytes.

[0137] Storage: Stored in the database.

[0138] Decision-making: The adaptive decision-making module evaluates the data after storage. Assume the system parameters are set as N=10, M=10, τD=5000, τR=0.7, and N_max=1000.

[0139] Calculate Manhattan distance: Calculate Due to large data discrepancies, the following was obtained: The value is very high, for example, 15000. This makes the average Manhattan distance of the last 10 frames... (60) Significantly increased, exceeding the threshold τ D =5000.

[0140] Compression ratio calculation: The compressed size is 850 bytes, compression ratio =850 / 1024≈0.83. This makes the average compression ratio of the most recent 10 frames... (60) may also be pulled up, exceeding the threshold τ. R =0.7.

[0141] Triggered Update: Since the update conditions based on Manhattan distance and compression ratio are met, the decision module determines that the current reference frame P_0 has expired and decides to update the reference frame immediately.

[0142] (5) T=61 seconds: Data packet P_61 is collected. Due to the decision in the previous step, the system uses P_61 as the new reference frame.

[0143] Storing a new baseline frame: Inserting a record into the database: id: 62; timestamp: (current timestamp); is_base_frame: 1; data: (Complete 1024 bytes of P_61 data); original_size: 1024; (6) After T=62 seconds: the subsequent data packets P_62, P_63... will be compressed with reference to the new base frame P_61, and the compression rate will be restored to a higher level.

[0144] Through the above embodiments, the method of the present application can dynamically adapt to the changes of the vehicle state, always maintain efficient data compression, thereby greatly saving storage resources throughout the vehicle life cycle.

[0145] The present application embodiment can divide the real-time data compression storage device according to the above method examples into functional modules or functional units, for example, each functional module or functional unit can be divided according to each function, or two or more functions can be integrated in one processing module. The above integrated module can be realized in the form of hardware or in the form of software functional module or functional unit. Among them, the division of modules or units in the present application embodiment is illustrative, and is only a logical function division. When actually implemented, there can be another division method.

[0146] Exemplarily, as Figure 7 shown, a possible structure schematic diagram of a real-time data compression storage device involved in the present application embodiment. The real-time data compression storage device 700 includes a processing unit 701, a storage unit 702, an acquisition unit 703; The processing unit 701 is configured to determine a plurality of data frames according to vehicle CAN bus information. The data frame is used to represent the vehicle dynamic parameter in a preset period, and each data frame corresponds to a different preset period.

[0147] The processing unit 701 is further configured to determine a reference frame and an incremental frame from the plurality of data frames. The reference frame is the first data frame or a data frame in a preset order in the plurality of data frames, and the incremental frame is a data frame other than the reference frame in the plurality of data frames.

[0148] The processing unit 701 is further configured to determine the difference data of the incremental frame relative to the reference frame, compress the difference data of the incremental frame, and obtain the compression result of the incremental frame.

[0149] The storage unit 702 is configured to store the compression result of the reference frame and the incremental frame into a target database.

[0150] Optionally, the processing unit 701 is further configured to perform an exclusive or XOR encoding operation on the incremental frame and the reference frame.

[0151] Optionally, the processing unit 701 is further configured to compress the difference data of the incremental frame by run-length encoding RLE.

[0152] Optionally, the processing unit 701 is further configured to read the compression result of the reference frame and the incremental frame from the target database.

[0153] Optionally, the processing unit 701 is further configured to decompress the compression result of the incremental frame to obtain the difference data of the incremental frame relative to the current reference frame.

[0154] Optionally, the processing unit 701 is further configured to determine the original data of the incremental frame according to the reference frame and the difference data of the incremental frame relative to the current reference frame.

[0155] Optionally, the processing unit 701 is further configured to determine the incremental frame as a new reference frame when the incremental frame meets at least one preset condition with the current reference frame.

[0156] Optionally, the processing unit 701 is further configured to update the current reference frame according to the reference frame update decision function and the reference frame update execution function.

[0157] Optionally, the acquisition unit 703 is configured to periodically acquire the vehicle CAN bus information of the vehicle in each preset time period.

[0158] Optionally, the processing unit 701 is further configured to perform structured data processing on the periodically acquired vehicle CAN bus information according to a telematics service provider (TSP) protocol specification, to obtain a plurality of data frames.

[0159] Optionally, the storage unit 703 stores a program or instruction, and when the processing unit 701 and the acquisition unit 703 execute the program or instruction, the real-time data compression storage device can execute the real-time data compression storage method of the above-mentioned method embodiments.

[0160] In addition, Figure 7 The technical effects of the real-time data compression storage device can refer to the technical effects of the real-time data compression storage method of the above-mentioned embodiments, which will not be repeated here.

[0161] Exemplarily, Figure 8 Another possible structure diagram of the real-time data compression storage method involved in the above-mentioned embodiments is provided. As shown in Figure 8 The real-time data compression storage device 800 includes a processor 802.

[0162] The processor 802 is configured to control and manage the actions of the real-time data compression storage device 700, for example, to execute the steps performed by the processing unit 701 and the acquisition unit 703 in the above-mentioned real-time data compression storage device 700, and / or to execute other processes of the technical solutions described herein.

[0163] The processor 802 described above can be a central processing unit, a general purpose processor, a digital signal processor, an application specific integrated circuit, a field programmable gate array, or other programmable logic device, transistor logic, hardware component, or any combination thereof. It can implement or execute the various exemplary logical blocks, modules, and circuits described in connection with the disclosure. The processor can also be a combination of computing functionality, such as a combination of one or more microprocessors, a combination of a DSP and a microprocessor, and so on.

[0164] Optionally, the real-time data compression storage device 800 can further include a communication interface 803, a memory 801, and a bus 804. The communication interface 803 is configured to support communication between the real-time data compression storage device 800 and other network entities. The memory 801 is configured to store program codes and data of the real-time data compression storage device.

[0165] The memory 801 can be a memory in the real-time data compression storage device, which can include a volatile memory such as a random access memory, and can also include a non-volatile memory such as a read-only memory, a flash memory, a hard disk, or a solid state disk, and can also include a combination of the above types of memories.

[0166] The bus 804 can be an extended industry standard architecture (EISA) bus or the like. The bus 804 can be divided into an address bus, a data bus, a control bus, and the like. For the sake of convenience and brevity, Figure 8 Only one thick line is used to represent the bus in the figure, but it does not mean that there is only one bus or only one type of bus.

[0167] Through the description of the above embodiments, those skilled in the art can clearly understand that, for the convenience and brevity of description, only the above-mentioned division of functional modules is taken as an example, and in actual application, the above-mentioned functions can be completed by different functional modules according to needs, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above. The specific working process of the system, device and module described above can refer to the corresponding process in the foregoing method embodiments, which will not be described here.

[0168] The embodiments of the present application provide a computer program product containing instructions, which, when executed on the electronic device of the present application, cause the computer to perform the real-time data compression storage method described in the method embodiments.

[0169] The embodiment of the present application further provides a computer readable storage medium, and the computer readable storage medium stores instructions. When a computer executes the instructions, the electronic device of the present application executes each step performed by the real-time data compression storage device in the method flow shown in the method embodiment.

[0170] The computer readable storage medium, for example, can be, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or apparatus, or any combination of the above. More specific examples (a non-exhaustive list) of the computer readable storage medium include an electrical connection having one or more wires, a portable computer diskette, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM), a register, a hard disk, an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing, or any other medium of the form of a computer readable storage medium known in the art. An exemplary storage medium is coupled to the processor such that the processor can read information from, and write information to, the storage medium. Of course, the storage medium can be a component of the processor. Suitable processors for the execution of a program of instructions include, by way of example, both general and special purpose microprocessors. The processor can be coupled to memory, which can be the computer readable storage medium. The memory can be used for storing data or other computer usable instructions, programs, and / or modules that implement one or more embodiments of the present application. The memory can also be used for storing temporary variables or other intermediate information during execution of computations. The present application also contemplates methods in which the actual physical elements or apparatuses need not be present. For example, it is contemplated that "cloud" computing could be used for an alternative embodiment wherein all or a portion of computing devices or processors are in communication with one another and with users over the network, for example, the Internet. In portions of the disclosure where "WTRU" is described, the disclosure also contemplates a "fixed line" embodiment in which all or a portion of computing devices or processors are in communication with one another and with users over a fixed line, for example, a telephone line. In this embodiment, the WTRU can be replaced with a fixed line device, such as a telephone.

[0171] The above merely provides the specific implementation of the present application, but the protection scope of the present application is not limited to this. Any change or replacement within the technical scope disclosed in the present application should be covered in the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the protection scope of the claims.

Claims

1. A real-time data compression storage method, characterized by, The method comprises: determining a plurality of data frames according to vehicle controller area network (CAN) bus information, wherein the data frames are used to represent vehicle dynamic parameters in preset time periods, and each data frame corresponds to a different preset time period; determining a reference frame and an incremental frame from the plurality of data frames, wherein the reference frame is the first data frame or a data frame in a preset order in the plurality of data frames, and the incremental frame is a data frame other than the reference frame in the plurality of data frames; determining difference data of the incremental frame relative to the reference frame, and compressing the difference data of the incremental frame to obtain a compression result of the incremental frame; storing the reference frame and the compression result of the incremental frame into a target database.

2. The real-time data compression storage method of claim 1, wherein, The determination of the difference data of the incremental frame relative to the reference frame is performed by the following steps: performing an exclusive OR (XOR) encoding operation on the incremental frame and the reference frame.

3. The real-time data compression storage method of claim 2, wherein, The compression of the difference data of the incremental frame to obtain the compression result of the incremental frame is performed by the following steps: performing run-length encoding (RLE) on the difference data of the incremental frame.

4. The real-time data compression storage method of claim 3, wherein, When it is necessary to obtain original data of the incremental frame, the method further comprises: reading the reference frame and the compression result of the incremental frame from the target database; decompressing the compression result of the incremental frame to obtain difference data of the incremental frame relative to a current reference frame; determining original data of the incremental frame according to the reference frame and the difference data of the incremental frame relative to the current reference frame.

5. The real-time data compression storage method of claim 4, wherein, After the compression of the difference data of the incremental frame to obtain the compression result of the incremental frame, the method further comprises: when the incremental frame and the current reference frame satisfy at least one preset condition, determining the incremental frame as a new reference frame, wherein the preset condition comprises at least one of the following: an average difference degree of continuous N incremental frames relative to the current reference frame exceeds a first preset threshold, an average compression rate of compressed difference data of continuous M incremental frames exceeds a second preset threshold, and a number of incremental frames determined since the current reference frame is determined exceeds a third preset threshold, N and M being positive integers.

6. The real-time data compression storage method of claim 5, wherein, The average difference degree of the continuous N incremental frames relative to the current reference frame is determined by the following formula one: Formula One wherein, represents the degree of difference, n represents the length of the data frame, represents the incremental frame, represents the reference frame, i represents the number of the byte in the data frame, represents the average degree of difference, j represents the number of the data frame; The average compression rate of the compressed difference data of the continuous M incremental frames is determined by the following formula two: Equation Two wherein, represents a compression rate, represents a data volume of the difference data after compression, represents a raw data volume of the incremental frame, represents an average compression rate, j represents the number of the data frame.

7. The real-time data compression storage method of claim 6, wherein, After the compression of the difference data of the incremental frame to obtain the compression result of the incremental frame, the method further comprises: updating the current reference frame according to a reference frame update decision function and a reference frame update execution function, wherein an output value of the reference frame update function is a Boolean value, the Boolean value is used to represent whether the current reference frame needs to be updated after the kth incremental frame is compressed, and the reference frame update decision function is represented by the following formula three: Equation Three wherein, denotes a Boolean value output by the reference frame updating function, and ∨ denotes a logical OR operation, denotes a preset condition that an average difference degree of the continuous N incremental frames relative to the current reference frame exceeds a first preset threshold, denotes a preset condition that an average compression ratio of the difference data of the continuous M incremental frames after compression exceeds a second preset threshold, denotes a preset condition that a number of incremental frames determined continuously since the current reference frame is determined exceeds a third preset threshold. The reference frame update execution function is represented by the following formula four: Formula Four wherein, represents the reference frame used when processing the k delta frame, represents the updated reference frame.

8. The real-time data compression storage method according to any one of claims 1-7, wherein, The method further comprises: periodically obtaining the vehicle CAN bus information of the vehicle in each preset time period.

9. The real-time data compression storage method of claim 8, wherein, The method comprises the following steps: According to the remote information service provider TSP protocol specification, the periodically obtained vehicle CAN bus information is subjected to structured data processing to obtain the multiple data frames.

10. A real-time data compression storage apparatus, characterized by comprising: The real-time data compression storage device comprises a processing unit and a storage unit. The processing unit is configured to determine multiple data frames according to vehicle CAN bus information; wherein the data frames are used to represent vehicle dynamic parameters in a preset time period, and each data frame corresponds to a different preset time period. The processing unit is further configured to determine a reference frame and an incremental frame from the multiple data frames; wherein the reference frame is the first data frame or a data frame in a preset order in the multiple data frames, and the incremental frame is a data frame other than the reference frame in the multiple data frames. The processing unit is further configured to determine difference data of the incremental frame relative to the reference frame, compress the difference data of the incremental frame, and obtain a compression result of the incremental frame. The storage unit is configured to store the compression result of the reference frame and the incremental frame into a target database.