Data compression method and device, medium, equipment, vehicle and cloud server

By playing and compressing the theme data in the original bag file in an autonomous driving vehicle, and generating a target bag file with a smaller amount of data, the problem of slow transmission speed and large storage space is solved, and faster transmission and more saving storage is achieved.

CN119620915APending Publication Date: 2025-03-14MOMENTA (SUZHOU) TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311181079.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-09-13
Publication Date
2025-03-14

AI Technical Summary

Technical Problem

When an autonomous vehicle uploads the original bag file to a cloud server, the transmission speed is slow and the storage space is large, resulting in increased storage pressure and cost.

Method used

By obtaining the original bag file collected by the vehicle, playing the file according to the collection time of the topic data in the file, and compressing the compressed topic data during the playback process, copying the topic data to be copied, and finally generating a target bag file with a small amount of data.

Benefits of technology

It improves the transmission speed of bag files, saves storage space and equipment costs, and ensures that the time information of topic data in the target bag file is consistent with the original file.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119620915A_ABST
    Figure CN119620915A_ABST
Patent Text Reader

Abstract

The invention discloses a data compression method and device, a medium, equipment, a vehicle and a cloud server, relates to the technical field of automobiles, and can solve the problems of low original bag file transmission speed and high storage space occupied by original bag file storage. The method comprises the steps that after an original bag file collected by a vehicle is obtained, the original bag file is played according to the collection time of at least one piece of top data contained in the original bag file; compressing the to-be-compressed topic data to obtain compressed topic data under the condition that the at least one piece of topic data played currently contains the to-be-compressed topic data, and copying the to-be-copied topic data to obtain copied topic data under the condition that the at least one piece of topic data played currently contains the to-be-copied topic data; and after the original bag file is played, generating a target bag file according to the compressed top data and the copied top data. The method and the device can be applied to scenes of vehicle data transmission and vehicle data storage.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of automobile technology, and more specifically, to a data compression method, device, medium, equipment, vehicle and cloud server. Background Art

[0002] The actual vehicle data of autonomous driving is generally stored in bag files, which collect topic data collected by various data collection devices, such as radar point cloud data collected by lidar, image data collected by cameras, etc. However, due to the large amount of data in the original bag files, the transmission speed when the vehicle uploads the original bag files to the cloud server is low, the storage space occupied by the cloud server when storing the original bag files is high, and the cloud server will also increase the storage pressure and storage cost as the number of original bag files received increases. Summary of the invention

[0003] The present application provides a data compression method, device, medium, equipment, vehicle and cloud server, which can solve the problems of low transmission speed of original bag files and high storage space occupied by storing original bag files.

[0004] The specific technical solutions are as follows:

[0005] In a first aspect, an embodiment of the present application provides a data compression method, the method comprising:

[0006] After obtaining the original bag file collected by the vehicle, playing the original bag file according to the collection time of at least one topic data contained in the original bag file;

[0007] In the case that at least one topic data currently being played includes topic data to be compressed, compressing the topic data to be compressed to obtain compressed topic data; in the case that at least one topic data currently being played includes topic data to be copied, copying the topic data to be copied to obtain copied topic data, wherein the topic data to be copied includes topic data other than the topic data to be compressed;

[0008] After the original bag file is played, a target bag file is generated according to the compressed topic data and the copied topic data.

[0009] It can be seen from the above scheme that the embodiment of the present application can play the original bag file according to the acquisition time of at least one topic data contained in the original bag file after obtaining the original bag file, and in the process of playing the original bag file, compress the topic data to be compressed and copy the topic data to be copied. After the original bag file is played, a target bag file is generated according to the compressed topic data and the copied topic data, so that the data volume of the target bag file is much smaller than the data volume of the original bag file, and then the transmission of the target bag file is faster than the transmission of the original bag file, and more bandwidth is saved. Storing the target bag file saves more storage space than storing the original bag file, and saves more cost of storage devices.

[0010] In a first possible implementation manner of the first aspect, the method further includes:

[0011] When the topic data to be compressed begins to be compressed, the topic data to be copied that is played simultaneously with the topic data to be compressed is stopped from being played and copied;

[0012] When compression of the topic data to be compressed is completed, the topic data to be copied that is played simultaneously with the topic data to be compressed continues to be played and copied, and when the copying of the topic data to be copied that is played simultaneously with the topic data to be compressed is completed, the original bag file continues to be played.

[0013] It can be seen from the above scheme that when the topic data to be compressed and the topic data to be copied are played simultaneously, the embodiment of the present application can compress first and then copy, and then copy again after the compression is completed. After the copying is completed, the original bag file can continue to be played, and the compression and / or copying of the next time node can be performed, thereby avoiding the inconsistency between the time information of each topic data in the generated target bag file and the time information of each topic data in the original bag file due to the different time spent on compression and copying.

[0014] In a second possible implementation manner of the first aspect, the method further includes:

[0015] When the topic data to be copied, which is played simultaneously with the topic data to be compressed, is copied but the topic data to be compressed is not compressed, the playing of the original bag file is stopped; when the topic data to be compressed is compressed, the playing of the original bag file is continued.

[0016] It can be seen from the above scheme that in the embodiment of the present application, when the topic data to be compressed and the topic data to be copied are played simultaneously, compression and copying can be performed simultaneously. After the copying is completed, compression can be waited for. When the compression is also completed, the original bag file can be continued to be played, and compression and / or copying of the next time node can be performed, thereby avoiding the inconsistency between the time information of each topic data in the generated target bag file and the time information of each topic data in the original bag file due to the different time spent on compression and copying.

[0017] In a third possible implementation manner of the first aspect, the method further includes:

[0018] When the topic data to be copied begins to be copied, the topic data to be compressed that is played simultaneously with the topic data to be copied is stopped from being played and compressed;

[0019] When the copying of the topic data to be copied is completed, the topic data to be compressed that is played simultaneously with the topic data to be copied continues to be played and compressed, and when the compression of the topic data to be compressed that is played simultaneously with the topic data to be copied is completed, the original bag file continues to be played.

[0020] It can be seen from the above scheme that when the topic data to be compressed and the topic data to be copied are played simultaneously, the embodiment of the present application can copy first and then compress, and then compress after the copying is completed. After the compression is completed, the original bag file can continue to be played, and the compression and / or copying of the next time node can be performed, thereby avoiding the inconsistency between the time information of each topic data in the generated target bag file and the time information of each topic data in the original bag file due to the different time spent on compression and copying.

[0021] In a fourth possible implementation manner of the first aspect, compressing the topic data to be compressed to obtain compressed topic data includes:

[0022] Determining a compression ratio corresponding to the topic data to be compressed according to the type of the data acquisition device corresponding to the topic data to be compressed;

[0023] The topic data to be compressed is compressed according to the compression ratio corresponding to the topic data to be compressed.

[0024] It can be seen from the above scheme that compared with using the same compression ratio to compress all topic data to be compressed, the embodiment of the present application compresses the topic data to be compressed by determining different compression ratios according to different types of data acquisition devices. Under the premise of ensuring the decompression quality, the data volume of the compressed topic data can be reduced as much as possible, thereby reducing the data volume of the target bag file.

[0025] In a fifth possible implementation manner of the first aspect, after generating a target bag file according to the compressed topic data and the copied topic data, the method further includes:

[0026] Determine the compression ratio of the target bag file according to the business requirements of the target bag file;

[0027] The target bag file is compressed as a whole according to the compression ratio corresponding to the target bag file.

[0028] It can be seen from the above scheme that after obtaining the target bag file, the embodiment of the present application determines the compression ratio corresponding to the target bag file according to the business requirements corresponding to the target bag file, and compresses the target bag file as a whole according to the compression ratio, thereby reducing the data volume of the target bag file as much as possible while ensuring the decompression quality, thereby further improving the transmission speed of the target bag file, or further saving storage space on the cloud server side.

[0029] In a second aspect, an embodiment of the present application provides a data compression device, the device comprising:

[0030] A playing unit, configured to play the original bag file after acquiring the original bag file collected by the vehicle according to the collection time of at least one topic data contained in the original bag file;

[0031] A compression unit, configured to compress the topic data to be compressed to obtain compressed topic data when at least one topic data currently being played includes the topic data to be compressed;

[0032] a copying unit, configured to copy the topic data to be copied to obtain copied topic data when the at least one topic data currently being played includes the topic data to be copied, wherein the topic data to be copied includes topic data other than the topic data to be compressed;

[0033] A generating unit is used to generate a target bag file according to the compressed topic data and the copied topic data after playing the original bag file. In a first possible implementation of the second aspect,.

[0034] In a first possible implementation manner of the second aspect, the apparatus further includes:

[0035] a first stopping unit, configured to stop playing and copying the topic data to be copied that is played simultaneously with the topic data to be compressed when the topic data to be compressed starts to be compressed;

[0036] The playback unit is further configured to continue to play the topic data to be copied which is played simultaneously with the topic data to be compressed when the compression of the topic data to be compressed is completed;

[0037] The copying unit is further used for copying the played topic data when the playing unit continues to play the topic data to be copied which is played simultaneously with the topic data to be compressed;

[0038] The playback unit is further configured to continue playing the original bag file when the topic data to be copied, which is played simultaneously with the topic data to be compressed, is copied completely.

[0039] In a second possible implementation manner of the second aspect, the device further includes:

[0040] A second stopping unit, used for stopping playing the original bag file when the topic data to be copied played simultaneously with the topic data to be compressed completes copying but the topic data to be compressed has not completed compression;

[0041] The playback unit is further configured to continue playing the original bag file when the compression of the topic data to be compressed is completed.

[0042] In a third possible implementation manner of the second aspect, the device further includes:

[0043] a third stopping unit, configured to stop playing and compressing the topic data to be compressed that is played simultaneously with the topic data to be copied when starting to copy the topic data to be copied;

[0044] The playing unit is used to continue playing the topic data to be compressed that is played simultaneously with the topic data to be copied when the copying of the topic data to be copied is completed;

[0045] The compression unit is further used to compress the topic data to be compressed that is played by the playback unit simultaneously with the topic data to be copied;

[0046] The playback unit is further configured to continue playing the original bag file when the compression of the topic data to be compressed, which is played simultaneously with the topic data to be copied, is completed.

[0047] In a fourth possible implementation manner of the second aspect, the compression unit includes:

[0048] A determination module, used to determine the compression ratio corresponding to the topic data to be compressed according to the type of the data acquisition device corresponding to the topic data to be compressed;

[0049] The compression module is used to compress the topic data to be compressed according to the compression ratio corresponding to the topic data to be compressed.

[0050] In a fifth possible implementation manner of the second aspect, the apparatus further includes:

[0051] A determination unit, configured to determine a compression ratio corresponding to the target bag file according to a business requirement corresponding to the target bag file after generating the target bag file according to the compressed topic data and the copied topic data;

[0052] The compression unit is further used to compress the target bag file as a whole according to the compression ratio corresponding to the target bag file.

[0053] It can be seen from the above scheme that the embodiment of the present application can play the original bag file according to the acquisition time of at least one topic data contained in the original bag file after obtaining the original bag file, and in the process of playing the original bag file, compress the topic data to be compressed and copy the topic data to be copied. After the original bag file is played, a target bag file is generated according to the compressed topic data and the copied topic data, so that the data volume of the target bag file is much smaller than the data volume of the original bag file, and then the transmission of the target bag file is faster than the transmission of the original bag file, and more bandwidth is saved. Storing the target bag file saves more storage space than storing the original bag file, and saves more cost of storage devices.

[0054] In a third aspect, an embodiment of the present application provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the method described in any possible implementation manner of the first aspect.

[0055] In a fourth aspect, an embodiment of the present application provides an electronic device, the electronic device comprising:

[0056] one or more processors;

[0057] The processor is coupled to a storage device, and the storage device is used to store one or more programs;

[0058] When one or more programs are executed by one or more processors, the electronic device implements the method described in any possible implementation manner of the first aspect.

[0059] In a fifth aspect, an embodiment of the present application provides a vehicle, the vehicle comprising a device as described in any possible implementation of the second aspect, or comprising an electronic device as described in the fourth aspect.

[0060] In a sixth aspect, an embodiment of the present application provides a cloud server, which includes a device as described in any possible implementation method of the second aspect, or includes an electronic device as described in the fourth aspect.

[0061] In a seventh aspect, an embodiment of the present application provides a computer program product, which includes instructions. When the instructions are executed on a computer or a processor, the computer or the processor executes the method described in any possible implementation of the first aspect. BRIEF DESCRIPTION OF THE DRAWINGS

[0062] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the drawings required for use in the embodiments or the prior art description are briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For those of ordinary skill in the art, other drawings can also be obtained based on these drawings without creative work.

[0063] Figure 1 A flowchart of a data compression method provided in an embodiment of the present application;

[0064] Figure 2 An example diagram of compressing an original bag file provided in an embodiment of the present application;

[0065] Figure 3 An example diagram of decompressing a target bag file provided in an embodiment of the present application;

[0066] Figure 4 A block diagram of a data compression device provided in an embodiment of the present application;

[0067] Figure 5 A schematic diagram of the structure of an electronic device or computer device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0068] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0069] It should be noted that, in the absence of conflict, the embodiments in the present application and the features in the embodiments can be combined with each other. The terms "including" and "having" in the embodiments of the present application and the accompanying drawings and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device comprising a series of steps or units is not limited to the listed steps or units, but optionally also includes steps or units that are not listed, or optionally also includes other steps or units inherent to these processes, methods, products or devices.

[0070] Figure 1 The flowchart of a data compression method is shown in FIG. 1 . The method can be applied to electronic devices or computer devices, and can be applied to vehicles or cloud servers. The method can include the following steps:

[0071] S110: After acquiring the original bag file collected by the vehicle, the original bag file is played according to the collection time of at least one topic data contained in the original bag file.

[0072] The bag file is a file in a data storage format commonly used by ROS (Robot Operating System). The original bag file may include topic data in Jpeg format, topic data in radar point cloud format, topic data in log format, and topic data in other formats. Topic data in Jpeg format include original images, cylindrical images, stitched images, etc. When the vehicle's hardware and software can support the direct acquisition of H264 and H265 data, the original bag file may also include topic data in H264 and H265 formats. In summary, the types of topic data contained in the original bag file may include any one or more combinations of Jpeg, radar point cloud, log, H264, H265, and other types, and the number of topic data in each format included may be at least one.

[0073] When the method is applied to a vehicle, after the vehicle obtains the original bag file it has collected, it can first execute steps S110-S130 to obtain the target bag file, then compress the target bag file as a whole, and upload the compressed target bag file to the cloud server for storage, or the vehicle directly uploads the target bag file to the cloud server, which directly stores it, or compresses the target bag file as a whole before storing it.

[0074] When the method is applied to a cloud server, after the cloud server receives the original bag file uploaded by the vehicle, or the cloud server receives the overall compressed original bag file uploaded by the vehicle and decompresses it as a whole to obtain the original bag file, steps S110-S130 can be executed first to obtain the target bag file, and then the target bag file can be stored, or the target bag file can be stored after being overall compressed.

[0075] After obtaining the original bag file collected by the vehicle, the original bag file can be played according to the collection time of at least one topic data contained in the original bag file, that is, it can be played in the order of the collection time of at least one topic data contained in the original bag file, and when there are multiple topic data at the same time, multiple threads or multiple processes can be started to play the multiple topic data in parallel.

[0076] S120: When at least one topic data currently being played includes topic data to be compressed, the topic data to be compressed is compressed to obtain compressed topic data; when at least one topic data currently being played includes topic data to be copied, the topic data to be copied is copied to obtain copied topic data.

[0077] The topic data to be copied includes topic data other than the topic data to be compressed. The topic data to be compressed may include topic data in Jpeg format. Accordingly, the topic data to be copied includes other topic data other than Jpeg format, such as topic data in point cloud format, topic data in H264 format, and topic data in H265 format. It should be noted that the embodiments of the present application do not limit the compression algorithm or the compressed data format, and may be other compressed data formats other than H264 and H265.

[0078] like Figure 2 As shown in the figure, the original bag file includes two topic data in Jpeg format, one topic data in H265 format and one topic data in point cloud format, namely Jpeg(1), Jpeg(2), H265 and point cloud. Since these four types of data are collected at the same time, four processes or threads can be started to compress Jpeg(1) and Jpeg(2) into H264(1) and H264(2) respectively, and copy H265 and point cloud. Finally, the target bag file containing two topic data in H264 format, one topic data in H265 format and one topic data in point cloud format is obtained.

[0079] When compressing different topic data to be compressed, the same compression ratio can be used, but the quality of data collected by different data acquisition devices is different. For example, the quality of fisheye cameras is not as good as that of front cameras. Therefore, in order to further reduce the amount of data, the compression ratios of topic data collected by different acquisition devices can be different. That is, when compressing the topic data to be compressed, the compression ratio corresponding to the topic data to be compressed can be determined according to the type of data acquisition device corresponding to the topic data to be compressed, and then the topic data to be compressed can be compressed according to the compression ratio corresponding to the topic data to be compressed. Among them, the compression ratio corresponding to the data acquisition device with high collected data quality is greater than the compression ratio corresponding to the data acquisition device with low collected data quality, such as the compression ratio of the topic data collected by the front camera is greater than the compression ratio of the topic data collected by the fisheye camera.

[0080] S130: After the original bag file is played, a target bag file is generated according to the compressed topic data and the copied topic data.

[0081] After the original bag file is played, all the topic data to be compressed is compressed, and all the topic data to be copied is copied, all the compressed topic data and all the copied topic data can be combined into a new bag file as the target bag file.

[0082] The data compression method provided in the embodiment of the present application can, after acquiring the original bag file, play the original bag file according to the acquisition time of at least one topic data contained in the original bag file, and in the process of playing the original bag file, compress the topic data to be compressed and copy the topic data to be copied. After the original bag file is played, a target bag file is generated according to the compressed topic data and the copied topic data, so that the data volume of the target bag file is much smaller than the data volume of the original bag file, and thus the transmission of the target bag file is faster than the transmission of the original bag file, and more bandwidth is saved. Storing the target bag file saves more storage space than storing the original bag file, and the cost of the storage device is saved.

[0083] In one implementation, since the time spent on compression and replication is often different, in order to make the time information of each topic data in the generated target bag file consistent with the time information of each topic data in the original bag file, the embodiment of the present application provides the following two methods:

[0084] The first method: when the compression of the topic data to be compressed begins, the playback and copying of the topic data to be copied that is played simultaneously with the topic data to be compressed are stopped; when the compression of the topic data to be compressed is completed, the playback and copying of the topic data to be copied that is played simultaneously with the topic data to be compressed are continued, and when the copying of the topic data to be copied that is played simultaneously with the topic data to be compressed is completed, the original bag file is continued to be played.

[0085] The second method: when the topic data to be copied, which is played simultaneously with the topic data to be compressed, is copied but the topic data to be compressed is not compressed, stop playing the original bag file; when the topic data to be compressed is compressed, continue playing the original bag file.

[0086] The third method: when the topic data to be copied begins to be copied, the topic data to be compressed that is played simultaneously with the topic data to be copied is stopped from being played and compressed; when the topic data to be copied is copied, the topic data to be compressed that is played simultaneously with the topic data to be copied is continued to be played and compressed, and when the compression of the topic data to be compressed that is played simultaneously with the topic data to be copied is completed, the original bag file is continued to be played.

[0087] The first method is to compress first and then copy, and then copy after the compression is completed. After the copying is completed, continue to play the original bag file and perform compression and / or copying at the next time node; the second method is to compress and copy at the same time, and then wait for compression after the copying is completed. When the compression is also completed, continue to play the original bag file and perform compression and / or copying at the next time node; the third method is to copy first and then compress, and then compress after the copying is completed. After the compression is completed, continue to play the original bag file and perform compression and / or copying at the next time node.

[0088] The embodiments of the present application are not limited to the above three methods. In practical applications, it is sufficient as long as the time information of each topic data in the target bag file can be kept consistent with the time information of each topic data in the original bag file.

[0089] In one embodiment, in order to further reduce the data volume of the target bag file, thereby increasing the transmission speed of the target bag file, or further save storage space on the cloud server side and improve storage space utilization, after the target bag file is generated according to the compressed topic data and the copied topic data, the embodiment of the present application can first determine the compression ratio corresponding to the target bag file according to the business requirements corresponding to the target bag file, and then perform overall compression on the target bag file according to the compression ratio corresponding to the target bag file. For example, the target bag file used for perception has higher quality requirements than the target bag file used for other business requirements, so to avoid distortion caused by compression and the inability to restore the original data, the compression ratio corresponding to the target bag file used for perception can be lower than the compression ratio corresponding to the target bag file for other business requirements. In other words, the compression ratio corresponding to the target bag file with high quality requirements is lower than the compression ratio corresponding to the target bag file with low quality requirements.

[0090] In one implementation, after obtaining the target bag file, when the target bag file needs to be used, when the business group does not need to care about the topic data in the H264 / H265 format, only other topic data in the target bag file is used, or when the topic data in the H264 and H265 formats are already compatible, the target bag file can be used directly; when the business group still uses the topic data in the Jpeg format for processing or model training, the topic data containing H264 / H265 can be converted to the topic data in the Jpeg format before subsequent use. Specifically, if the target bag file is compressed as a whole, the target bag file can be decompressed as a whole first, and then the compressed topic data in the target bag file can be decompressed separately, and the uncompressed topic data is not decompressed, such as Figure 3 As shown, the topic data in H264 format and the topic data in H265 format in the target bag file can be decompressed into topic data in Jpeg format respectively, while the topic data in other formats remain unchanged.

[0091] Corresponding to the above method embodiment, another embodiment of the present application provides a data compression device, such as Figure 4 As shown, the device comprises:

[0092] The playing unit 210 is used to play the original bag file after acquiring the original bag file collected by the vehicle according to the collection time of at least one topic data contained in the original bag file;

[0093] A compression unit 220, configured to compress the topic data to be compressed to obtain compressed topic data when at least one topic data currently being played includes the topic data to be compressed;

[0094] A copying unit 230, configured to copy the topic data to be copied to obtain copied topic data when the at least one topic data currently being played includes the topic data to be copied, wherein the topic data to be copied includes topic data other than the topic data to be compressed;

[0095] The generating unit 240 is used to generate a target bag file according to the compressed topic data and the copied topic data after playing the original bag file.

[0096] In a possible implementation manner, the device further includes:

[0097] a first stopping unit, configured to stop playing and copying the topic data to be copied that is played simultaneously with the topic data to be compressed when the topic data to be compressed starts to be compressed;

[0098] The playing unit 210 is further configured to continue playing the topic data to be copied which is played simultaneously with the topic data to be compressed when the compression of the topic data to be compressed is completed;

[0099] The copying unit 230 is further configured to copy the played topic data when the playing unit 210 continues to play the topic data to be copied that is played simultaneously with the topic data to be compressed;

[0100] The playing unit 210 is further configured to continue playing the original bag file when the topic data to be copied, which is played simultaneously with the topic data to be compressed, is copied completely.

[0101] In a possible implementation manner, the device further includes:

[0102] A second stopping unit, used for stopping playing the original bag file when the topic data to be copied played simultaneously with the topic data to be compressed completes copying but the topic data to be compressed has not completed compression;

[0103] The playing unit 210 is further configured to continue playing the original bag file when the compression of the topic data to be compressed is completed.

[0104] In a possible implementation manner, the device further includes:

[0105] a third stopping unit, configured to stop playing and compressing the topic data to be compressed that is played simultaneously with the topic data to be copied when starting to copy the topic data to be copied;

[0106] The playing unit 210 is used to continue playing the topic data to be compressed that is played simultaneously with the topic data to be copied when the copying of the topic data to be copied is completed;

[0107] The compression unit 220 is further used to compress the topic data to be compressed that is played by the playback unit 210 and is played simultaneously with the topic data to be copied;

[0108] The playing unit 210 is further configured to continue playing the original bag file when the compression of the topic data to be compressed, which is played simultaneously with the topic data to be copied, is completed.

[0109] In a possible implementation, the compression unit 220 includes:

[0110] A determination module, used to determine the compression ratio corresponding to the topic data to be compressed according to the type of the data acquisition device corresponding to the topic data to be compressed;

[0111] The compression module is used to compress the topic data to be compressed according to the compression ratio corresponding to the topic data to be compressed.

[0112] In a possible implementation manner, the device further includes:

[0113] A determination unit, configured to determine a compression ratio corresponding to the target bag file according to a business requirement corresponding to the target bag file after generating the target bag file according to the compressed topic data and the copied topic data;

[0114] The compression unit 220 is further configured to compress the target bag file as a whole according to the compression ratio corresponding to the target bag file.

[0115] The data compression device provided in the embodiment of the present application can, after acquiring the original bag file, play the original bag file according to the acquisition time of at least one topic data contained in the original bag file, and in the process of playing the original bag file, compress the topic data to be compressed and copy the topic data to be copied. After the original bag file is played, a target bag file is generated according to the compressed topic data and the copied topic data, so that the data volume of the target bag file is much smaller than the data volume of the original bag file, and thus the transmission of the target bag file is faster than the transmission of the original bag file, and more bandwidth is saved. Storing the target bag file saves more storage space than storing the original bag file, and the cost of the storage device is saved.

[0116] Based on the above method embodiments, another embodiment of the present application provides a computer-readable storage medium on which a computer program is stored. When the program is executed by a processor, the method described in any of the above embodiments is implemented.

[0117] Based on the above method embodiment, another embodiment of the present application provides an electronic device or a computer device, such as Figure 5 As shown, including:

[0118] One or more processors 310;

[0119] The processor 310 is coupled to a storage device 320, and the storage device 320 is used to store one or more programs;

[0120] When the one or more programs are executed by the one or more processors 310, the electronic device or computer device implements the method described in any of the above embodiments.

[0121] Based on the above method embodiments, another embodiment of the present application provides a vehicle, which includes the device as described in any of the above embodiments, or includes the electronic device as described above.

[0122] The vehicle includes a CPU (Central Processing Unit), a T-Box (Telematics Box), a laser radar and a camera. The laser radar is used to collect laser radar point clouds, and the camera is used to collect vehicle environment images. The CPU can generate an original bag file based on data collected by various data collection devices such as laser radar point clouds and vehicle environment images, and compress the original bag file by executing the data compression method mentioned in the above embodiment to generate a target bag file, and upload the target bag file to the cloud server through the T-Box for storage; after the CPU generates the original bag file, it can also directly upload the original bag file to the cloud server through the T-Box, and the cloud server compresses the original bag file by executing the data compression method mentioned in the above embodiment, and generates a target bag file for storage. In particular, whether the vehicle uploads a bag file to the cloud server or the cloud server stores a bag file, in order to further reduce the amount of data, the bag file to be uploaded or stored can be compressed as a whole.

[0123] Based on the above method embodiments, another embodiment of the present application provides a cloud server, which includes the device described in any of the above embodiments, or includes the electronic device described above.

[0124] Based on the above embodiments, another embodiment of the present application provides a computer program product, which includes instructions. When the instructions are executed on a computer or a processor, the computer or the processor executes the method described in any of the above embodiments.

[0125] The above device embodiment corresponds to the method embodiment and has the same technical effect as the method embodiment. For specific description, please refer to the method embodiment. The device embodiment is obtained based on the method embodiment. For specific description, please refer to the method embodiment part, which will not be repeated here. It can be understood by those skilled in the art that the accompanying drawings are only schematic diagrams of one embodiment, and the modules or processes in the accompanying drawings are not necessarily required to implement the present application.

[0126] Those skilled in the art can understand that the modules in the device in the embodiment can be distributed in the device in the embodiment according to the description of the embodiment, or can be changed accordingly and located in one or more devices different from the embodiment. The modules in the above embodiment can be combined into one module, or can be further divided into multiple sub-modules.

[0127] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit it. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application.

Claims

1. A data compression method, characterized in that: The method comprises: After obtaining the original bag file collected by the vehicle, playing the original bag file according to the collection time of at least one topic data contained in the original bag file; In the case that at least one topic data currently being played includes topic data to be compressed, compressing the topic data to be compressed to obtain compressed topic data; in the case that at least one topic data currently being played includes topic data to be copied, copying the topic data to be copied to obtain copied topic data, wherein the topic data to be copied includes topic data other than the topic data to be compressed; After the original bag file is played, a target bag file is generated according to the compressed topic data and the copied topic data.

2. The method according to claim 1, characterized in that The method further comprises: When the topic data to be compressed begins to be compressed, the topic data to be copied that is played simultaneously with the topic data to be compressed is stopped from being played and copied; When compression of the topic data to be compressed is completed, the topic data to be copied that is played simultaneously with the topic data to be compressed continues to be played and copied, and when the copying of the topic data to be copied that is played simultaneously with the topic data to be compressed is completed, the original bag file continues to be played.

3. The method according to claim 1, characterized in that The method further comprises: When the topic data to be copied, which is played simultaneously with the topic data to be compressed, is copied but the topic data to be compressed is not compressed, the playing of the original bag file is stopped; when the topic data to be compressed is compressed, the playing of the original bag file is continued.

4. The method according to claim 1, characterized in that: The method further comprises: When the topic data to be copied begins to be copied, the topic data to be compressed that is played simultaneously with the topic data to be copied is stopped from being played and compressed; When the copying of the topic data to be copied is completed, the topic data to be compressed that is played simultaneously with the topic data to be copied continues to be played and compressed, and when the compression of the topic data to be compressed that is played simultaneously with the topic data to be copied is completed, the original bag file continues to be played.

5. The method according to claim 1, characterized in that The compressing the topic data to be compressed to obtain compressed topic data includes: Determining a compression ratio corresponding to the topic data to be compressed according to the type of the data acquisition device corresponding to the topic data to be compressed; The topic data to be compressed is compressed according to the compression ratio corresponding to the topic data to be compressed.

6. The method according to any one of claims 1 to 4, characterized in that After generating a target bag file according to the compressed topic data and the copied topic data, the method further includes: Determine the compression ratio of the target bag file according to the business requirements of the target bag file; The target bag file is compressed as a whole according to the compression ratio corresponding to the target bag file.

7. A data compression device, characterized in that: The device comprises: A playing unit, configured to play the original bag file after acquiring the original bag file collected by the vehicle according to the collection time of at least one topic data contained in the original bag file; A compression unit, configured to compress the topic data to be compressed to obtain compressed topic data when at least one topic data currently being played includes the topic data to be compressed; a copying unit, configured to copy the topic data to be copied to obtain copied topic data when the at least one topic data currently being played includes the topic data to be copied, wherein the topic data to be copied includes topic data other than the topic data to be compressed; A generating unit is used to generate a target bag file according to the compressed topic data and the copied topic data after playing the original bag file.

8. The device according to claim 7, characterized in that The device also includes: a first stopping unit, configured to stop playing and copying the topic data to be copied that is played simultaneously with the topic data to be compressed when the topic data to be compressed starts to be compressed; The playback unit is further configured to continue to play the topic data to be copied which is played simultaneously with the topic data to be compressed when the compression of the topic data to be compressed is completed; The copying unit is further used for copying the played topic data when the playing unit continues to play the topic data to be copied which is played simultaneously with the topic data to be compressed; The playback unit is further configured to continue playing the original bag file when the topic data to be copied, which is played simultaneously with the topic data to be compressed, is copied completely.

9. The device according to claim 7, characterized in that The device also includes: A second stopping unit, used for stopping playing the original bag file when the topic data to be copied played simultaneously with the topic data to be compressed completes copying but the topic data to be compressed has not completed compression; The playback unit is further configured to continue playing the original bag file when the compression of the topic data to be compressed is completed.

10. The device according to claim 7, characterized in that The device also includes: a third stopping unit, configured to stop playing and compressing the topic data to be compressed that is played simultaneously with the topic data to be copied when starting to copy the topic data to be copied; The playing unit is used to continue playing the topic data to be compressed that is played simultaneously with the topic data to be copied when the copying of the topic data to be copied is completed; The compression unit is further used to compress the topic data to be compressed that is played by the playback unit simultaneously with the topic data to be copied; The playback unit is further configured to continue playing the original bag file when the compression of the topic data to be compressed, which is played simultaneously with the topic data to be copied, is completed.

11. The device according to claim 7, characterized in that The compression unit comprises: A determination module, used to determine the compression ratio corresponding to the topic data to be compressed according to the type of the data acquisition device corresponding to the topic data to be compressed; The compression module is used to compress the topic data to be compressed according to the compression ratio corresponding to the topic data to be compressed.

12. The device according to any one of claims 7 to 11, characterized in that The device also includes: A determination unit, configured to determine a compression ratio corresponding to the target bag file according to a business requirement corresponding to the target bag file after generating the target bag file according to the compressed topic data and the copied topic data; The compression unit is further used to compress the target bag file as a whole according to the compression ratio corresponding to the target bag file.

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

14. An electronic device, characterized in that: The electronic device comprises: one or more processors; The processor is coupled to a storage device, and the storage device is used to store one or more programs; When the one or more programs are executed by the one or more processors, the electronic device implements the method according to any one of claims 1 to 6.

15. A vehicle, characterized in that: The vehicle comprises the apparatus as claimed in any one of claims 7 to 12, or comprises the electronic device as claimed in claim 14.

16. A cloud server, characterized in that: The cloud server includes the device as described in any one of claims 7-12, or includes the electronic device as described in claim 14.