Vehicle data compression method and device, vehicle and program product
By selecting and setting compression algorithms and levels according to the vehicle operating status, dynamically compressing vehicle data is solved, and the fixed compression algorithm cannot adapt to various data types is achieved, and stable transmission and efficient compression of vehicle data are achieved.
Patent Information
- Application Number
- CN202411353703.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-25
- Publication Date
- 2024-12-10
AI Technical Summary
The existing fixed compression algorithm cannot be applied to various types of vehicle data, resulting in data compression and transmission occupying vehicle resources and affecting the stable operation of the vehicle.
According to the operating status of the vehicle, the target compression algorithm is selected from multiple compression algorithms and the compression level is set to achieve dynamic compression of vehicle data.
By adaptively compressing vehicle data, the stable operation of the vehicle is ensured in the case of excessive data, and the data transmission efficiency and the receiver decompression speed are improved.
Smart Images

Figure CN119109953A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data processing technology, and in particular to a vehicle data compression method, device, vehicle and program product. Background Art
[0002] With the widespread application of Internet of Vehicles technology, vehicles need to upload more and more data to the cloud, such as text, images, videos and other vehicle data.
[0003] Currently, a fixed compression algorithm is usually used to compress vehicle data and transmit the compressed vehicle data to the cloud. However, the fixed compression algorithm cannot be applied to compress various types of vehicle data, and data compression and transmission will occupy vehicle resources. When there is too much vehicle data, it is difficult to ensure stable operation of the vehicle. Summary of the invention
[0004] The purpose of the embodiments of the present application is to provide a vehicle data compression method, device, vehicle and program product to achieve the technical effect of dynamically compressing vehicle data and ensuring stable operation of the vehicle.
[0005] In a first aspect, an embodiment of the present application provides a vehicle data compression method, comprising:
[0006] Obtaining data to be compressed of the vehicle and determining the current operating state of the vehicle;
[0007] selecting a target compression algorithm from a plurality of compression algorithms according to the running state of the vehicle, and setting a compression level of the target compression algorithm;
[0008] The data to be compressed is compressed according to the target compression algorithm and the compression level of the target compression algorithm to obtain a compressed data packet.
[0009] In the above implementation process, after obtaining the vehicle's data to be compressed, according to the current operating status of the vehicle, a target compression algorithm is selected from multiple compression algorithms and the compression level of the target compression algorithm is set, and the data to be compressed is compressed according to the target compression algorithm and the compression level of the target compression algorithm. The vehicle data can be adaptively compressed according to the vehicle's operating status, thereby realizing dynamic compression of the vehicle data and ensuring stable operation of the vehicle.
[0010] Further, selecting a target compression algorithm from a plurality of compression algorithms according to the running state of the vehicle, and setting a compression level of the target compression algorithm, comprises:
[0011] When the running state of the vehicle is the intelligent driving function on state, a first compression algorithm that satisfies a first screening condition among the multiple compression algorithms is used as the target compression algorithm, and a compression level of the target compression algorithm is set to a first compression level; wherein the first screening condition is related to the amount of hardware resources occupied by the compression algorithm of the vehicle, and the first compression level is within a low compression level range of the first compression algorithm;
[0012] When the running state of the vehicle is an intelligent driving function off state or a parking state, a second compression algorithm that satisfies a second filtering condition among the plurality of compression algorithms is used as the target compression algorithm, and a compression level of the target compression algorithm is set to a second compression level; wherein the second filtering condition is set by a user, and the second compression level is within a high compression level range of the second compression algorithm;
[0013] When the operating state of the vehicle is the intelligent driving function off state and the driving state, a third compression algorithm among the multiple compression algorithms that meets the third filtering condition is used as the target compression algorithm, and the compression level of the target compression algorithm is set to the third compression level; wherein the third filtering condition and the third compression level are determined based on the current resource performance indicators of the vehicle.
[0014] In the above implementation process, by flexibly selecting the target compression algorithm and setting the compression level of the target compression algorithm according to the resource availability of the vehicle under different operating conditions, the vehicle data can be adaptively compressed according to the operating status of the vehicle, thereby realizing dynamic compression of the vehicle data and ensuring stable operation of the vehicle.
[0015] Further, the first screening condition includes a condition that the compression algorithm takes up the least amount of hardware resources of the vehicle;
[0016] The second screening condition includes a condition that the compression algorithm is an algorithm historically used to compress the target data; wherein the data type of the target data is the same as the data type of the data to be compressed.
[0017] In the above implementation process, by configuring a first filtering condition including the condition that the compression algorithm minimizes the amount of hardware resources occupied by the vehicle and configuring a second filtering condition including the condition that the compression algorithm is the algorithm historically used to compress target data, the data compression efficiency can be improved.
[0018] Furthermore, before setting the compression level of the target compression algorithm to the first compression level, the method further includes:
[0019] Within the low compression level range of the first compression algorithm, a low compression level that matches the current value of the hardware resource performance indicator of the vehicle is used as the first compression level.
[0020] In the above implementation process, when the vehicle's operating state is the intelligent driving function turned on state, by using the low-level compression level within the low-level compression level range of the first compression algorithm that matches the value of the hardware resource performance indicator of the current vehicle as the first compression level, the compression level of the target compression algorithm can be flexibly set according to the resource availability of the vehicle when the intelligent driving function is turned on, thereby realizing dynamic compression of vehicle data and ensuring stable operation of the vehicle.
[0021] Furthermore, before setting the compression level of the target compression algorithm to the second compression level, the method further includes:
[0022] Within the high compression level range of the second compression algorithm, a high compression level corresponding to the hardware resource occupancy of the vehicle-mounted application currently in the vehicle is used as the second compression level.
[0023] In the above implementation process, when the vehicle's operating state is the intelligent driving function off state and the parking state, the advanced compression level within the advanced compression level range of the second compression algorithm that matches the value of the hardware resource occupancy of the current vehicle-mounted application is used as the second compression level. The compression level of the target compression algorithm can be flexibly set according to the occupancy of the vehicle's hardware resources by the vehicle-mounted applications when the vehicle's operating state is the intelligent driving function off state and the parking state, thereby realizing dynamic compression of vehicle data and ensuring stable operation of the vehicle.
[0024] Furthermore, the resource performance index of the vehicle includes a hardware resource performance index and a network resource performance index;
[0025] Before taking the third compression algorithm that satisfies the third screening condition among the plurality of compression algorithms as the target compression algorithm and setting the compression level of the target compression algorithm to the third compression level, the method further includes:
[0026] In the case where the value of the hardware resource performance indicator is not within the first indicator threshold range, determining that the third screening condition is related to the amount of hardware resources occupied by the compression algorithm on the vehicle, and determining that the third compression level is within a low compression level range of the third compression algorithm;
[0027] In a case where the value of the hardware resource performance indicator is within the first indicator threshold range and the value of the network resource performance indicator is not within the second indicator threshold range, determining that the third screening condition is set by a user, and determining that the third compression level is within the advanced compression level range of the third compression algorithm;
[0028] When the value of the hardware resource performance indicator is within the first indicator threshold range and the value of the network resource performance indicator is within the second indicator threshold range, it is determined that the third filtering condition is set by the user, and the third compression level is determined to be the default compression level of the third compression algorithm.
[0029] In the above implementation process, by determining the third filtering condition and the third compression level according to the hardware resource performance indicators and network resource performance indicators of the current vehicle when the vehicle's operating state is the intelligent driving function off state and the driving state, the vehicle data can be adaptively compressed according to the vehicle's operating state, thereby realizing dynamic compression of the vehicle data and ensuring stable operation of the vehicle.
[0030] Furthermore, the hardware resource performance indicator includes central processing unit CPU occupancy rate and / or memory occupancy rate, and the network resource performance indicator includes network bandwidth and / or network delay.
[0031] In the above implementation process, by determining the third filtering condition and the third compression level based on resource performance indicators such as the vehicle's CPU occupancy rate, memory occupancy rate, network bandwidth, and network latency, the vehicle's resource availability can be comprehensively and accurately inferred, ensuring accurate determination of the third filtering condition and the third compression level.
[0032] Further, the number of the target compression algorithm is one;
[0033] The method further comprises:
[0034] A data packet to be transmitted is generated according to the compressed data packet, the target compression algorithm and the compression level of the target compression algorithm.
[0035] In the above implementation process, by generating a data packet to be transmitted according to the compressed data packet, the target compression algorithm and the compression level of the target compression algorithm, it is possible to ensure that the receiving end can accurately and effectively decompress the compressed data packet.
[0036] Furthermore, the number of the target compression algorithms is multiple;
[0037] The method further comprises:
[0038] Evaluate the compression effect index of each target compression algorithm according to the compressed data packets corresponding to each target compression algorithm;
[0039] According to the compression effect indicators of the plurality of target compression algorithms, selecting an optimal compression algorithm whose compression effect indicator has a target value from the plurality of target compression algorithms;
[0040] A data packet to be transmitted is generated according to the compressed data packet corresponding to the optimal compression algorithm, the optimal compression algorithm and the compression level of the optimal compression algorithm.
[0041] In the above implementation process, by obtaining compressed data packets corresponding to multiple target compression algorithms, the compression effect index of each target compression algorithm is evaluated according to the compressed data packets corresponding to each target compression algorithm, and the optimal compression algorithm whose compression effect index value among the multiple target compression algorithms is the target value, the compressed data packet corresponding to the optimal compression algorithm and the compression level of the optimal compression algorithm are generated to be transmitted. This can take into account the vehicle resource occupancy and the decompression time at the receiving end during the data transmission stage, further ensuring the stable operation of the vehicle.
[0042] Furthermore, the compression effect index includes a compression ratio.
[0043] In the above implementation process, by selecting the compression ratio as the compression effect indicator, the compression effects of multiple target compression algorithms on the compressed data can be accurately evaluated.
[0044] Furthermore, the multiple compression algorithms are determined according to the data type of the data to be compressed.
[0045] In the above implementation process, by selecting a target compression algorithm from a plurality of compression algorithms corresponding to the data type of the data to be compressed, the screening operation can be simplified and the data compression efficiency can be improved.
[0046] In a second aspect, an embodiment of the present application provides a vehicle data compression device, including:
[0047] A state determination module, used to obtain the data to be compressed of the vehicle and determine the current running state of the vehicle;
[0048] A dynamic processing module, used for selecting a target compression algorithm from a plurality of compression algorithms according to the running state of the vehicle, and setting a compression level of the target compression algorithm;
[0049] The data compression module is used to compress the data to be compressed according to the target compression algorithm and the compression level of the target compression algorithm to obtain a compressed data packet.
[0050] In a third aspect, an embodiment of the present application provides an electronic device, comprising a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor; the memory is coupled to the processor, and the processor implements the method described above when executing the computer program.
[0051] In a fourth aspect, an embodiment of the present application provides a vehicle, comprising the electronic device as described above.
[0052] In a fifth aspect, an embodiment of the present application provides a computer program product, which includes instructions, and when the instructions are executed by a computer, the computer implements the method as described above.
[0053] In a sixth aspect, an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium includes a stored computer program; wherein, when the computer program is running, the device where the computer-readable storage medium is located is controlled to execute the method described above. BRIEF DESCRIPTION OF THE DRAWINGS
[0054] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments of the present application will be briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.
[0055] Figure 1 A schematic flow chart of a vehicle data compression method provided in the first embodiment of the present application;
[0056] Figure 2 A data flow diagram of a vehicle data compression method exemplified in the first embodiment of the present application;
[0057] Figure 3 A schematic diagram of the structure of a vehicle data compression device provided in the second embodiment of the present application;
[0058] Figure 4 A schematic diagram of the structure of an electronic device provided in the third embodiment of the present application. DETAILED DESCRIPTION
[0059] The technical solutions in the embodiments of the present application will be described below in conjunction with the drawings in the embodiments of the present application.
[0060] It should be noted that similar reference numerals and letters represent similar items in the following drawings, so once an item is defined in one drawing, it does not need to be further defined and explained in subsequent drawings. At the same time, in the description of this application, the terms "first", "second", etc. are only used to distinguish the description and cannot be understood as indicating or implying relative importance.
[0061] With the widespread application of Internet of Vehicles technology, vehicles need to upload more and more data to the cloud, such as text, images, videos and other vehicle data.
[0062] In related technologies, a fixed compression algorithm is usually used to compress vehicle data and transmit the compressed vehicle data to the cloud. However, a fixed compression algorithm may have a good compression effect on some types of vehicle data, but a poor compression effect on other types of vehicle data. A fixed compression algorithm cannot be applied to compress various types of vehicle data. In addition, data compression and transmission will occupy vehicle resources. In the case of too much vehicle data, too many vehicle resources are occupied, so it is easy for the vehicle's intelligent driving system to frequently trigger function degradation events, and the applications in the vehicle's infotainment system to frequently experience network freezes, making it difficult to ensure stable operation of the vehicle.
[0063] To this end, the present application proposes a vehicle data compression method. After obtaining the vehicle data to be compressed, according to the current operating status of the vehicle, a target compression algorithm is selected from multiple compression algorithms and the compression level of the target compression algorithm is set, and the data to be compressed is compressed according to the target compression algorithm and the compression level of the target compression algorithm. The vehicle data can be adaptively compressed according to the operating status of the vehicle, thereby realizing dynamic compression of the vehicle data and ensuring stable operation of the vehicle.
[0064] The technical solutions in the embodiments of the present application will be described below in conjunction with the drawings 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.
[0065] It should be understood that the vehicle described in the embodiments of the present application may be a pure electric vehicle, or a hybrid vehicle, a gas-electric hybrid vehicle, a fuel cell vehicle, or a vehicle of other energy types with a motor, and the embodiments of the present application are not limited thereto. The types of vehicles in the embodiments of the present application may include vehicles such as sedans, off-road vehicles, trucks, and buses, and the embodiments of the present application are not limited thereto. The vehicles in the embodiments of the present application may be vehicles with automatic intelligent driving, manned vehicles, or manned vehicles with assisted automatic driving functions, and the embodiments of the present application are not limited thereto.
[0066] Combine the following Figure 1-4 A vehicle data compression method provided in the first embodiment of the present application is described. The method provided in the first embodiment of the present application can be executed by a vehicle controller or a domain controller, and the following description is made by taking the vehicle controller as an example of the execution subject.
[0067] Please see Figure 1 , Figure 1 The first embodiment of the present application provides a vehicle data compression method, including steps S101 to S103:
[0068] S101. Obtain the vehicle data to be compressed and determine the current operating status of the vehicle.
[0069] As an example, the vehicle controller collects vehicle-side information in real time, wherein the vehicle-side information includes the on / off status of the vehicle's intelligent driving function, the driving and stopping status, and resource performance indicators.
[0070] It should be noted that the vehicle's intelligent driving function on / off state refers to the state in which the vehicle's intelligent driving function is on or off, which is divided into two states: the intelligent driving function on state and the intelligent driving function off state. The vehicle's driving and parking state refers to the state in which the vehicle is driving or parking, which is divided into two states: driving state and parking state. The vehicle's resource performance indicators are used to characterize the vehicle's resource occupancy.
[0071] The vehicle controller obtains the vehicle data to be compressed and determines the current operating status of the vehicle based on the currently collected vehicle-side information.
[0072] In practical applications, after detecting that the vehicle has collected text, images, videos or other vehicle data, the vehicle controller can automatically obtain the vehicle data as the vehicle data to be compressed.
[0073] In actual applications, since users are usually allowed to select vehicle data on their own and manually control the vehicle to initiate a data upload request for the vehicle data, the vehicle controller can also monitor the data upload request initiated by the vehicle in real time. After monitoring the data upload request initiated by the vehicle, it responds to the data upload request and obtains the vehicle data from the data upload request as the vehicle's data to be compressed.
[0074] It should be noted that the vehicle-side information currently collected is the vehicle-side information collected by the vehicle controller at the time when the vehicle's data to be compressed is acquired.
[0075] S102. Select a target compression algorithm from a plurality of compression algorithms according to the running state of the vehicle, and set a compression level of the target compression algorithm.
[0076] As an exemplary embodiment, after determining the operating state of the vehicle, the vehicle controller selects a target compression algorithm from a plurality of compression algorithms according to the operating state of the vehicle, and sets a compression level of the target compression algorithm.
[0077] In practical applications, the resource availability of the vehicle under different operating conditions can be considered, different algorithm screening conditions and different level setting rules can be configured, a target compression algorithm can be selected from multiple compression algorithms according to the algorithm screening conditions corresponding to the vehicle's operating state, and the compression level of the target compression algorithm can be set according to the level setting rules corresponding to the vehicle's operating state.
[0078] S103: compress the data to be compressed according to the target compression algorithm and the compression level of the target compression algorithm to obtain a compressed data packet.
[0079] As an exemplary embodiment, after determining the target compression algorithm and the compression level of the target compression algorithm, the vehicle controller compresses the data to be compressed according to the target compression algorithm and the compression level of the target compression algorithm to obtain a compressed data packet.
[0080] In actual applications, if only one target compression algorithm is determined, the data to be compressed will be compressed according to this target compression algorithm and the compression level of this target compression algorithm to obtain a compressed data packet. At this time, this compressed data packet can be directly uploaded to the cloud; if multiple target compression algorithms are determined, the data to be compressed will be compressed for each target compression algorithm according to the target compression algorithm and the compression level of the target compression algorithm to obtain a compressed data packet corresponding to the target compression algorithm, thereby obtaining compressed data packets corresponding to multiple target compression algorithms. At this time, the compressed data packet corresponding to any target compression algorithm can be randomly selected, or the compressed data packet corresponding to any target compression algorithm specified by the user can be selected, and the selected compressed data packet can be transmitted to the cloud.
[0081] The embodiment of the present application, after acquiring the vehicle data to be compressed, selects a target compression algorithm from multiple compression algorithms and sets the compression level of the target compression algorithm according to the current operating state of the vehicle, and compresses the data to be compressed according to the target compression algorithm and the compression level of the target compression algorithm. It can adaptively compress the vehicle data according to the operating state of the vehicle, thereby realizing dynamic compression of the vehicle data and ensuring stable operation of the vehicle.
[0082] In an optional embodiment, the method of selecting a target compression algorithm from a plurality of compression algorithms according to the running state of the vehicle and setting the compression level of the target compression algorithm includes: when the running state of the vehicle is the intelligent driving function on state, taking a first compression algorithm among the plurality of compression algorithms that satisfies a first filtering condition as the target compression algorithm, and setting the compression level of the target compression algorithm to the first compression level; wherein the first filtering condition is related to the amount of hardware resource occupation of the vehicle by the compression algorithm, and the first compression level is within the low-level compression level range of the first compression algorithm; when the running state of the vehicle is the intelligent driving function off state and the parking state, taking a second compression algorithm among the plurality of compression algorithms that satisfies a second filtering condition as the target compression algorithm, and setting the compression level of the target compression algorithm to the second compression level; wherein the second filtering condition is set by a user, and the second compression level is within the high-level compression level range of the second compression algorithm; when the running state of the vehicle is the intelligent driving function off state and the driving state, taking a third compression algorithm among the plurality of compression algorithms that satisfies a third filtering condition as the target compression algorithm, and setting the compression level of the target compression algorithm to the third compression level; wherein the third filtering condition and the third compression level are determined according to the resource performance index of the current vehicle.
[0083] As an example, after acquiring the vehicle data to be compressed, the vehicle controller determines the current operating status of the vehicle based on the currently collected vehicle-side information.
[0084] If the currently collected vehicle-side information indicates that the intelligent driving function is turned on, it is determined that the current operating state of the vehicle is the intelligent driving function turned on state.
[0085] Since the current vehicle has the intelligent driving function turned on, the stable operation of the intelligent driving system depends on the vehicle's hardware resources, such as CPU (Central Processing Unit) and MEM (Memory), etc. It is necessary to reserve as many hardware resources as possible for the intelligent driving system to avoid problems such as the intelligent driving system frequently triggering function degradation events. Therefore, the hardware resources available to the current vehicle are relatively tight, and it is necessary to limit the amount of hardware resources occupied by data compression on the vehicle.
[0086] In order to ensure that data compression occupies as little vehicle hardware resources as possible, taking into account that different compression algorithms occupy different amounts of vehicle hardware resources, a first filtering condition is configured. The first filtering condition is related to the amount of vehicle hardware resources occupied by the compression algorithm, and taking into account that the lower the compression level, the smaller the amount of vehicle hardware resources occupied, the target compression algorithm is required to have a lower compression level.
[0087] When the vehicle is in the operating state of the intelligent driving function being turned on, multiple compression algorithms and a first filtering condition are obtained, a first compression algorithm among the multiple compression algorithms that meets the first filtering condition is used as a target compression algorithm, and the compression level of the target compression algorithm is set to the first compression level within the low-level compression level range of the first compression algorithm.
[0088] For example, assuming that the vehicle's data to be compressed is text data, and when the vehicle's operating state is that the intelligent driving function is turned on, the multiple compression algorithms obtained are the zstd compression algorithm, the gzip compression algorithm, and the tar compression algorithm, and the first screening condition obtained is that the compression algorithm's hardware resource occupancy for the vehicle is less than the hardware resource occupancy threshold, the zstd compression algorithm and the gzip compression algorithm's hardware resource occupancy for the vehicle is less than the hardware resource occupancy threshold, and the tar compression algorithm's hardware resource occupancy for the vehicle is greater than or equal to the hardware resource occupancy threshold. There are two first compression algorithms that meet the first screening condition among the multiple compression algorithms, namely the zstd compression algorithm and the gzip compression algorithm. The zstd compression algorithm is taken as the first target compression algorithm, and the first target compression algorithm's The compression level is set to the first compression level within the low-level compression level range of the zstd compression algorithm, where the first compression level can be any low-level compression level within the low-level compression level range of the zstd compression algorithm, or a low-level compression level specified by the user within the low-level compression level range of the zstd compression algorithm, such as the lowest compression level, and the gzip compression algorithm is used as the second target compression algorithm, and the compression level of the second target compression algorithm is set to the first compression level within the low-level compression level range of the gzip compression algorithm, where the first compression level can be any low-level compression level within the low-level compression level range of the gzip compression algorithm, or a low-level compression level specified by the user within the low-level compression level range of the gzip compression algorithm, such as the lowest compression level. The hardware resource usage threshold is pre-set according to the maximum value of the hardware resource usage of the vehicle by data compression.
[0089] It should be noted that the low-level compression level range of each compression algorithm is pre-divided.
[0090] In practical applications, compression algorithms have multiple compression levels, and usually a compression level is selected as the default compression level. According to the default compression level of the compression algorithm, the compression algorithm can be divided into a low-level compression level range and a high-level compression level range. The compression level of the compression algorithm lower than the default compression level is classified into the low-level compression level range of the compression algorithm, and the compression level of the compression algorithm higher than the default compression level is classified into the high-level compression level range of the compression algorithm.
[0091] If the currently collected vehicle-side information includes the intelligent driving function off state and the parking state, then it is determined that the current operating state of the vehicle is the intelligent driving function off state and the parking state.
[0092] Since the intelligent driving function of the current vehicle is turned off and the vehicle is in a parked state, the hardware resources available to the current vehicle are relatively abundant. You can choose to occupy the vehicle's excess hardware resources to reduce traffic consumption.
[0093] In order to ensure that data compression occupies as much of the vehicle's excess hardware resources as possible, taking into account that the driver and passengers may be navigating, listening to music, watching movies, playing games or other activities while the vehicle is parked, the user is allowed to customize the second filtering condition based on actual scenarios, user preferences and algorithm advantages. Considering that the higher the compression level, the greater the occupation of the vehicle's hardware resources, the target compression algorithm is required to have a higher compression level.
[0094] When the vehicle is in the intelligent driving function off state and parking state, multiple compression algorithms and second filtering conditions are obtained, a second compression algorithm that meets the second filtering conditions among the multiple compression algorithms is used as a target compression algorithm, and the compression level of the target compression algorithm is set to a second compression level within the advanced compression level range of the second compression algorithm.
[0095] For example, assuming that the data to be compressed of the vehicle is text data, and when the vehicle's operating state is the intelligent driving function off state and the parking state, the multiple compression algorithms obtained are the zstd compression algorithm, the gzip compression algorithm and the tar compression algorithm, and the second filtering condition obtained is that the compression algorithm is the tar compression algorithm specified by the user. Then, the second compression algorithm that meets the second filtering condition among the multiple compression algorithms is the tar compression algorithm, and the tar compression algorithm is used as the target compression algorithm. The compression level of the target compression algorithm is set to the second compression level within the advanced compression level range of the tar compression algorithm. The second compression level here can be any advanced compression level within the advanced compression level range of the tar compression algorithm, or it can be an advanced compression level specified by the user within the advanced compression level range of the tar compression algorithm, such as the highest compression level.
[0096] If the currently collected vehicle-side information includes the intelligent driving function off state and the driving state, then it is determined that the current vehicle operating state is the intelligent driving function off state and the driving state.
[0097] Since the intelligent driving function of the current vehicle is turned off and the vehicle is in driving state, the resource availability of the vehicle is unclear. Therefore, it is necessary to determine the resource occupancy of the vehicle based on the current vehicle resource performance indicators, and then infer the resource availability of the vehicle. According to the resource availability of the vehicle, the third filtering condition and the third compression level are determined to reasonably select the target compression algorithm and set the compression level of the target compression algorithm.
[0098] When the vehicle's operating state is the intelligent driving function off state or the driving state, multiple compression algorithms and resource performance indicators of the current vehicle are obtained, and a third filtering condition and a third compression level are determined based on the vehicle's resource performance indicators. The third compression algorithm that meets the third filtering condition among the multiple compression algorithms is used as the target compression algorithm, and the compression level of the target compression algorithm is set to the third compression level.
[0099] For example, assuming that the vehicle's data to be compressed is text data, and when the vehicle's operating states are the intelligent driving function off state and the driving state, the multiple compression algorithms obtained are the zstd compression algorithm, the gzip compression algorithm, and the tar compression algorithm. If the current vehicle's resource performance indicators indicate that the resources available to the vehicle are relatively tight, then the third filtering condition determined is that the compression algorithm's hardware resource occupancy for the vehicle is less than the hardware resource occupancy threshold, and the determined third compression level is within the low-level compression level range of the third compression algorithm. Since the zstd compression algorithm and the gzip compression algorithm's hardware resource occupancy for the vehicle is less than the hardware resource occupancy threshold, and the tar compression algorithm's hardware resource occupancy for the vehicle is greater than or equal to the hardware resource occupancy threshold, there are two third compression algorithms that meet the third filtering condition among the multiple compression algorithms, namely the zstd compression algorithm and the gzip compression algorithm. The zstd compression algorithm is used as the first target compression algorithm, and the compression level of the first target compression algorithm is set to the third compression level within the low-level compression level range of the zstd compression algorithm. The third compression level here can be any low-level compression level within the low-level compression level range of the zstd compression algorithm, or a low-level compression level specified by the user within the low-level compression level range of the zstd compression algorithm, such as the lowest compression level; and the gzip compression algorithm is used as the second target compression algorithm, and the compression level of the second target compression algorithm is set to the third compression level within the low-level compression level range of the gzip compression algorithm. The third compression level here can be any low-level compression level within the low-level compression level range of the gzip compression algorithm, or a low-level compression level specified by the user within the low-level compression level range of the gzip compression algorithm, such as the lowest compression level;If the resource performance index of the current vehicle indicates that the resources available to the vehicle are relatively abundant, the third filtering condition determined is the full filtering condition, the third compression level determined is within the compression level range of the third compression algorithm, and multiple compression algorithms are third compression algorithms that meet the third filtering condition. The zstd compression algorithm is used as the first target compression algorithm, and the compression level of the first target compression algorithm is set to the third compression level within the compression level range of the zstd compression algorithm. The third compression level here can be any compression level within the compression level range of the zstd compression algorithm, or it can be a compression level specified by the user within the compression level range of the zstd compression algorithm, such as the highest compression level. The gzip compression algorithm is used as the second target compression algorithm, and the first target compression algorithm is set to the third compression level within the compression level range of the zstd compression algorithm. The compression level of the second target compression algorithm is set to the third compression level within the compression level range of the gzip compression algorithm, where the third compression level can be any compression level within the compression level range of the gzip compression algorithm, or a compression level specified by the user within the compression level range of the gzip compression algorithm, such as the highest compression level; and the tar compression algorithm is used as the third target compression algorithm, and the compression level of the third target compression algorithm is set to the third compression level within the compression level range of the tar compression algorithm, where the third compression level can be any compression level within the compression level range of the tar compression algorithm, or a compression level specified by the user within the compression level range of the tar compression algorithm, such as the highest compression level.;
[0100] The embodiments of the present application flexibly select the target compression algorithm and set the compression level of the target compression algorithm according to the resource availability of the vehicle under different operating conditions, so as to adaptively compress the vehicle data according to the operating status of the vehicle, thereby realizing dynamic compression of the vehicle data and ensuring stable operation of the vehicle.
[0101] In an optional embodiment, the first filtering condition includes the condition that the compression algorithm minimizes the amount of hardware resources occupied by the vehicle; the second filtering condition includes the condition that the compression algorithm is an algorithm historically used to compress target data; wherein the data type of the target data is the same as the data type of the data to be compressed.
[0102] As an example, considering that when the vehicle is in the operating state of the intelligent driving function turned on, data compression is required to occupy as few hardware resources of the vehicle as possible, and for one piece of data to be compressed, ultimately only one compressed data packet corresponding to a target compression algorithm needs to be transmitted to the cloud. It is possible to directly configure a first filtering condition including the condition that the compression algorithm minimizes the amount of hardware resources occupied by the vehicle, so as to select only one first compression algorithm from multiple compression algorithms as the target compression algorithm. There is no need to compress the same data to be compressed multiple times according to multiple target compression algorithms, thereby simplifying the data compression operation.
[0103] Taking into account that when the vehicle's operating state is the intelligent driving function off state and the parking state, the user is allowed to customize the second filtering condition. The second filtering condition is relatively loose. In order to ensure that the data to be compressed can be successfully compressed later, the second filtering condition including the condition that the compression algorithm is the algorithm historically used to compress the target data can be configured, wherein the data type of the target data is the same as the data type of the data to be compressed, so as to filter out the second compression algorithm previously used to compress the same type of data from multiple compression algorithms as the target compression algorithm, thereby avoiding the problem of failure to compress the data to be compressed according to the target compression algorithm.
[0104] The embodiment of the present application can improve data compression efficiency by configuring a first filtering condition including the condition that the compression algorithm minimizes the amount of hardware resources occupied by the vehicle, and configuring a second filtering condition including the condition that the compression algorithm is an algorithm historically used to compress target data.
[0105] In an optional embodiment, before setting the compression level of the target compression algorithm to the first compression level, it also includes: within the low-level compression level range of the first compression algorithm, using a low-level compression level that matches the value of the hardware resource performance indicator of the current vehicle as the first compression level.
[0106] As an example, considering that when the vehicle's operating state is a state in which the intelligent driving function is turned on, it is allowed to dynamically select the first compression level within the low-level compression level range of the first compression algorithm based on the current resource availability of the vehicle, a first mapping table corresponding to the compression algorithm can be set in advance for each compression algorithm, and the first mapping table is used to store the mapping relationship between each low-level compression level within the low-level compression level range of the compression algorithm and each value of the vehicle's hardware resource performance indicator.
[0107] After taking the first compression algorithm among multiple compression algorithms that meets the first filtering condition as the target compression algorithm, the vehicle controller obtains the hardware resource performance index of the current vehicle and the first mapping table corresponding to the first compression algorithm, searches the first mapping table corresponding to the first compression algorithm for a low-level compression level that matches the value of the hardware resource performance index of the current vehicle as the first compression level, and sets the compression level of the target compression algorithm to the first compression level.
[0108] In the embodiment of the present application, when the operating state of the vehicle is the intelligent driving function turned on state, a low-level compression level within the low-level compression level range of the first compression algorithm that matches the value of the hardware resource performance indicator of the current vehicle is used as the first compression level. The compression level of the target compression algorithm can be flexibly set according to the resource availability of the vehicle when the intelligent driving function is turned on, thereby realizing dynamic compression of vehicle data and ensuring stable operation of the vehicle.
[0109] In an optional embodiment, before setting the compression level of the target compression algorithm to the second compression level, it also includes: within the advanced compression level range of the second compression algorithm, using the advanced compression level corresponding to the hardware resource occupancy of the on-board application of the current vehicle as the second compression level.
[0110] As an example, considering that when the vehicle is in the intelligent driving function off state and the parking state, it is allowed to dynamically select the second compression level within the advanced compression level range of the second compression algorithm according to the hardware resource occupancy of the current vehicle's on-board applications, a second mapping table corresponding to the compression algorithm can be set in advance for each compression algorithm, and the second mapping table is used to store the mapping relationship between each advanced compression level within the advanced compression level range of the compression algorithm and each value of the hardware resource occupancy of the on-board applications.
[0111] After selecting the second compression algorithm that meets the second filtering condition among multiple compression algorithms as the target compression algorithm, the vehicle controller obtains the hardware resource occupancy of the current vehicle-mounted application and a second mapping table corresponding to the second compression algorithm, searches the second mapping table corresponding to the second compression algorithm for an advanced compression level that matches the value of the hardware resource occupancy of the current vehicle-mounted application as the second compression level, and sets the compression level of the target compression algorithm to the second compression level.
[0112] The embodiment of the present application uses the advanced compression level within the advanced compression level range of the second compression algorithm that matches the value of the hardware resource occupancy of the current on-board application as the second compression level when the vehicle's operating state is the intelligent driving function off state or the parked state. This allows the compression level of the target compression algorithm to be flexibly set according to the occupancy of the vehicle's hardware resources by the on-board application when the vehicle's operating state is the intelligent driving function off state or the parked state, thereby achieving dynamic compression of vehicle data and ensuring stable operation of the vehicle.
[0113] In an optional embodiment, the resource performance indicators of the vehicle include hardware resource performance indicators and network resource performance indicators; before the third compression algorithm that satisfies the third filtering condition among the multiple compression algorithms is used as the target compression algorithm, and the compression level of the target compression algorithm is set to the third compression level, it also includes: when the value of the hardware resource performance indicator is not within the first indicator threshold range, determining that the third filtering condition is related to the hardware resource occupancy of the vehicle by the compression algorithm, and determining that the third compression level is within the low-level compression level range of the third compression algorithm; when the value of the hardware resource performance indicator is within the first indicator threshold range and the value of the network resource performance indicator is not within the second indicator threshold range, determining that the third filtering condition is set by the user, and determining that the third compression level is within the high-level compression level range of the third compression algorithm; when the value of the hardware resource performance indicator is within the first indicator threshold range and the value of the network resource performance indicator is within the second indicator threshold range, determining that the third filtering condition is set by the user, and determining that the third compression level is the default compression level of the third compression algorithm.
[0114] As an example, considering that data compression and transmission will occupy the vehicle's hardware resources and network resources, the vehicle's hardware resource performance indicators and network resource performance indicators can be pre-selected as the vehicle's resource performance indicators, and a first indicator threshold range can be set for the hardware resource performance indicator, and a second indicator threshold range can be set for the network resource performance indicator.
[0115] It should be noted that the first indicator threshold range is set in consideration of the reasonable occupation of vehicle hardware resources, and the second indicator threshold range is set in consideration of the reasonable occupation of vehicle network resources.
[0116] When the vehicle is in the intelligent driving function off state or driving state, the vehicle controller obtains multiple compression algorithms and resource performance indicators of the current vehicle, the resource performance indicators of the vehicle include hardware resource performance indicators and network resource performance indicators, determines whether the value of the hardware resource performance indicator is within a first indicator threshold range, and determines whether the value of the network resource performance indicator is within a second indicator threshold range. When the value of the hardware resource performance indicator is not within the first indicator threshold range, it is considered that the hardware resources available to the current vehicle are relatively tight. To ensure successful compression of the data to be compressed, it is determined that the third screening condition is related to the amount of hardware resources occupied by the compression algorithm for the vehicle, and that the third compression level is within the low-level compression level range of the third compression algorithm; in the hardware resource performance indicator When the value of is within the first indicator threshold range and the value of the network resource performance indicator is not within the second indicator threshold range, it is considered that the hardware resources available to the current vehicle are relatively abundant, and the available network resources are relatively tight. To ensure the successful transmission of the compressed data packet, it is necessary to reduce the data size of the compressed data packet, determine that the third filtering condition is set by the user, and determine that the third compression level is within the advanced compression level range of the third compression algorithm; when the value of the hardware resource performance indicator is within the first indicator threshold range and the value of the network resource performance indicator is within the second indicator threshold range, it is considered that the hardware resources available to the current vehicle are relatively abundant, and the available network resources are also relatively abundant, determine that the third filtering condition is set by the user, and determine that the third compression level is the default compression level of the third compression algorithm.
[0117] The embodiment of the present application determines the third filtering condition and the third compression level according to the hardware resource performance indicators and network resource performance indicators of the current vehicle when the vehicle's operating state is the intelligent driving function off state or the driving state. It can adaptively compress the vehicle data according to the vehicle's operating state, thereby realizing dynamic compression of the vehicle data and ensuring stable operation of the vehicle.
[0118] In an optional embodiment, the hardware resource performance indicator includes the CPU occupancy rate and / or the memory occupancy rate, and the network resource performance indicator includes the network bandwidth and / or the network delay.
[0119] As an example, the vehicle's hardware resource performance indicators may be selected from CPU occupancy and / or memory occupancy, and the vehicle's network resource performance indicators include network bandwidth and / or network latency.
[0120] In practical applications, the vehicle controller may use ping (Packet Internet Groper) to detect the network delay of the vehicle.
[0121] It should be noted that there are three situations for CPU usage and / or memory usage: only CPU usage; only memory usage; both CPU usage and memory usage. There are three situations for network bandwidth and / or network latency: only network bandwidth; only network latency; both network bandwidth and latency.
[0122] It can be understood that by determining the third filtering condition and the third compression level based on resource performance indicators such as the vehicle's CPU occupancy rate, memory occupancy rate, network bandwidth, and network latency when the vehicle's operating state is the intelligent driving function off state and the driving state, the vehicle's resource availability can be comprehensively and accurately inferred, ensuring the accurate determination of the third filtering condition and the third compression level.
[0123] The embodiment of the present application determines the third filtering condition and the third compression level according to resource performance indicators such as the vehicle's CPU occupancy rate, memory occupancy rate, network bandwidth, and network latency, thereby being able to comprehensively and accurately infer the vehicle's resource availability and ensure accurate determination of the third filtering condition and the third compression level.
[0124] In an optional embodiment, the number of the target compression algorithm is one; the method further comprises step S104:
[0125] S104: Generate a data packet to be transmitted according to the compressed data packet, the target compression algorithm and the compression level of the target compression algorithm.
[0126] As an example, considering that after the vehicle controller obtains multiple data to be compressed at the same time, it usually concurrently generates multiple compressed data packets corresponding to the data to be compressed, and the target compression algorithms and compression levels of the target compression algorithms used for different data to be compressed may be different. In order to ensure that the cloud can accurately and effectively decompress each compressed data packet, you can choose to transmit the compressed data packet, target compression algorithm and compression level of the target compression algorithm to the cloud at the same time.
[0127] After determining only one target compression algorithm and the compression level of the target compression algorithm, the vehicle controller compresses the data to be compressed according to the target compression algorithm and the compression level of the target compression algorithm to obtain a compressed data packet.
[0128] After obtaining the compressed data packet, a data packet to be transmitted is generated according to the compressed data packet, the target compression algorithm and the compression level of the target compression algorithm, so as to transmit the data packet to be transmitted to the cloud or other receiving end.
[0129] In actual applications, the target compression algorithm and the compression level of the target compression algorithm can be added to the message header of the data upload request, such as the http header, and the compressed data packet and the data upload request can be transmitted to the cloud or other receiving end as the data packet to be transmitted.
[0130] The embodiment of the present application generates a data packet to be transmitted according to the compressed data packet, the target compression algorithm and the compression level of the target compression algorithm, thereby ensuring that the receiving end can accurately and effectively decompress the compressed data packet.
[0131] In an optional embodiment, there are multiple target compression algorithms; the method further includes steps S105 to S107:
[0132] S105, evaluating the compression effect index of each target compression algorithm according to the compressed data packets corresponding to each target compression algorithm;
[0133] S106, selecting an optimal compression algorithm whose compression effect index value is a target value from among the multiple target compression algorithms according to the compression effect indexes of the multiple target compression algorithms;
[0134] S107: Generate a data packet to be transmitted according to the compressed data packet corresponding to the optimal compression algorithm, the optimal compression algorithm, and the compression level of the optimal compression algorithm.
[0135] As an exemplary embodiment, if the vehicle controller determines multiple target compression algorithms, it will obtain compressed data packets corresponding to the multiple target compression algorithms.
[0136] Considering that for a piece of data to be compressed, only one compressed data packet corresponding to a target compression algorithm needs to be transmitted to the cloud in the end, the resource availability of the current vehicle can be considered, and the compressed data packet corresponding to the optimal compression algorithm can be selected from the compressed data packets corresponding to multiple target compression algorithms and transmitted to the cloud.
[0137] After obtaining compressed data packets corresponding to multiple target compression algorithms, the vehicle controller evaluates the compression effect index of each target compression algorithm according to the compressed data packets corresponding to each target compression algorithm, selects an optimal compression algorithm whose compression effect index value is the target value from the multiple target compression algorithms, and generates a data packet to be transmitted according to the compressed data packet corresponding to the optimal compression algorithm, the optimal compression algorithm and the compression level of the optimal compression algorithm, so as to transmit the data packet to be transmitted to the cloud or other receiving end.
[0138] It should be noted that the target value is determined based on the resource performance index of the current vehicle.
[0139] For example, assuming that the compression effect index selects the compression rate, since the compression rate is the ratio of the size of the data after compression to the size of the data before compression, for example, a 100m file is compressed to 90m, and the compression rate is 90 / 100*100%=90%. The smaller the compression rate, the smaller the compressed data packet, but the longer the decompression time. Therefore, in the case that the network resources of the current vehicle are relatively tight, the target value can be determined as the minimum value of the compression effect index values of multiple target compression algorithms to ensure the successful transmission of the compressed data packet; in the case that the hardware resources and network resources of the current vehicle are relatively abundant, the target value can be determined as the maximum value of the compression effect index values of multiple target compression algorithms to ensure that the receiving end can quickly decompress the compressed data packet.
[0140] In practical applications, the optimal compression algorithm and the compression level of the optimal compression algorithm can be added to the message header of the data upload request, such as the http header, and the compressed data packet corresponding to the optimal compression algorithm and the data upload request can be transmitted as the data packet to be transmitted to the cloud or other receiving end.
[0141] The embodiment of the present application obtains compressed data packets corresponding to multiple target compression algorithms, evaluates the compression effect index of each target compression algorithm according to the compressed data packets corresponding to each target compression algorithm, generates a data packet to be transmitted according to the optimal compression algorithm whose compression effect index value is the target value among the multiple target compression algorithms, the compressed data packet corresponding to the optimal compression algorithm and the compression level of the optimal compression algorithm. This can take into account the vehicle resource occupancy and the decompression time at the receiving end during the data transmission stage, and further ensure the stable operation of the vehicle.
[0142] In an optional embodiment, the compression effect indicator includes a compression ratio.
[0143] The embodiment of the present application selects the compression ratio as the compression effect indicator, so as to accurately evaluate the compression effects of multiple target compression algorithms on the compressed data.
[0144] In an optional embodiment, multiple compression algorithms are determined based on the data type of the data to be compressed.
[0145] As an example, considering that different types of vehicle data have different characteristics and patterns, the applicable compression algorithms are also different. In order to ensure efficient compression of vehicle data, multiple compression algorithms applicable to various types of vehicle data can be pre-stored, so that the target compression algorithm can be directly selected from the multiple compression algorithms applicable to the data to be compressed.
[0146] The embodiment of the present application can simplify the screening operation and improve the data compression efficiency by selecting a target compression algorithm from a plurality of compression algorithms corresponding to the data type of the data to be compressed.
[0147] In order to more clearly illustrate a vehicle data compression method provided by the first embodiment of the present application, a data flow diagram of the vehicle data compression method is as follows: Figure 2 shown.
[0148] Please see Figure 3 , Figure 3 A schematic diagram of the structure of a vehicle data compression device provided in the second embodiment of the present application. The second embodiment of the present application provides a vehicle data compression device, comprising: a state determination module 201, used to obtain the data to be compressed of the vehicle and determine the current operating state of the vehicle; a dynamic processing module 202, used to select a target compression algorithm from multiple compression algorithms according to the operating state of the vehicle, and set the compression level of the target compression algorithm; a data compression module 203, used to compress the data to be compressed according to the target compression algorithm and the compression level of the target compression algorithm to obtain a compressed data packet.
[0149] In an optional embodiment, the method of selecting a target compression algorithm from a plurality of compression algorithms according to the running state of the vehicle and setting the compression level of the target compression algorithm includes: when the running state of the vehicle is the intelligent driving function on state, taking a first compression algorithm among the plurality of compression algorithms that satisfies a first filtering condition as the target compression algorithm, and setting the compression level of the target compression algorithm to the first compression level; wherein the first filtering condition is related to the amount of hardware resource occupation of the vehicle by the compression algorithm, and the first compression level is within the low-level compression level range of the first compression algorithm; when the running state of the vehicle is the intelligent driving function off state and the parking state, taking a second compression algorithm among the plurality of compression algorithms that satisfies a second filtering condition as the target compression algorithm, and setting the compression level of the target compression algorithm to the second compression level; wherein the second filtering condition is set by a user, and the second compression level is within the high-level compression level range of the second compression algorithm; when the running state of the vehicle is the intelligent driving function off state and the driving state, taking a third compression algorithm among the plurality of compression algorithms that satisfies a third filtering condition as the target compression algorithm, and setting the compression level of the target compression algorithm to the third compression level; wherein the third filtering condition and the third compression level are determined according to the resource performance index of the current vehicle.
[0150] In an optional embodiment, the first filtering condition includes the condition that the compression algorithm minimizes the amount of hardware resources occupied by the vehicle; the second filtering condition includes the condition that the compression algorithm is an algorithm historically used to compress target data; wherein the data type of the target data is the same as the data type of the data to be compressed.
[0151] In an optional embodiment, the dynamic processing module 202 is further used to, before setting the compression level of the target compression algorithm to the first compression level, use a low-level compression level that matches the value of the hardware resource performance indicator of the current vehicle as the first compression level within the low-level compression level range of the first compression algorithm.
[0152] In an optional embodiment, the dynamic processing module 202 is further used to, before setting the compression level of the target compression algorithm to the second compression level, use the advanced compression level corresponding to the hardware resource occupancy of the on-board application of the current vehicle as the second compression level within the advanced compression level range of the second compression algorithm.
[0153] In an optional embodiment, the resource performance indicators of the vehicle include hardware resource performance indicators and network resource performance indicators; the dynamic processing module 202 is also used to determine that the third filtering condition is related to the hardware resource occupancy of the vehicle by the compression algorithm, and that the third compression level is within the low-level compression level range of the third compression algorithm, when the value of the hardware resource performance indicator is not within the first indicator threshold range, before taking the third compression algorithm that meets the third filtering condition among the multiple compression algorithms as the target compression algorithm and setting the compression level of the target compression algorithm to the third compression level; when the value of the hardware resource performance indicator is within the first indicator threshold range and the value of the network resource performance indicator is not within the second indicator threshold range, determine that the third filtering condition is set by the user, and determine that the third compression level is within the high-level compression level range of the third compression algorithm; when the value of the hardware resource performance indicator is within the first indicator threshold range and the value of the network resource performance indicator is within the second indicator threshold range, determine that the third filtering condition is set by the user, and determine that the third compression level is the default compression level of the third compression algorithm.
[0154] In an optional embodiment, the hardware resource performance indicator includes the CPU occupancy rate and / or the memory occupancy rate, and the network resource performance indicator includes the network bandwidth and / or the network delay.
[0155] In an optional embodiment, the number of target compression algorithms is one; the device further includes: an information adding module, which is used to generate a data packet to be transmitted according to the compressed data packet, the target compression algorithm and the compression level of the target compression algorithm.
[0156] In an optional embodiment, there are multiple target compression algorithms; the device also includes: an effect evaluation module, which is used to evaluate the compression effect index of each target compression algorithm based on the compressed data packet corresponding to each target compression algorithm; a preferential processing module, which is used to select the optimal compression algorithm whose compression effect index value is the target value from multiple target compression algorithms based on the compression effect indicators of multiple target compression algorithms; an information adding module, which is used to generate a data packet to be transmitted based on the compressed data packet corresponding to the optimal compression algorithm, the optimal compression algorithm and the compression level of the optimal compression algorithm.
[0157] In an optional embodiment, the compression effect indicator includes a compression ratio.
[0158] In an optional embodiment, multiple compression algorithms are determined based on the data type of the data to be compressed.
[0159] The implementation process of the functions and effects of each module in the above-mentioned device is specifically described in the implementation process of the corresponding steps in the above-mentioned method, which will not be repeated here.
[0160] Please see Figure 4 , Figure 4 The third embodiment of the present application provides an electronic device 30, comprising a processor 301, a memory 302, and a computer program stored in the memory 302 and configured to be executed by the processor 301; the memory 302 is coupled to the processor 301, and when the processor 301 executes the computer program, the method described in the first embodiment of the present application is implemented and the same beneficial effects can be achieved.
[0161] The processor 301 may implement the method described in the first embodiment of the present application when reading the computer program from the memory 302 via the bus 303 and executing the computer program.
[0162] Processor 301 can process digital signals and can include various computing structures, such as complex instruction set computer structure, reduced instruction set computer structure, or a structure that implements a combination of multiple instruction sets. In some examples, processor 301 can be a microprocessor.
[0163] The memory 302 may be used to store instructions executed by the processor 301 or data related to the execution of instructions. These instructions and / or data may include codes for implementing some functions or all functions of one or more modules described in the embodiments of the present application. The processor 301 of this embodiment may be used to execute instructions in the memory 302 to implement the method described in the first embodiment of the present application. The memory 302 includes a dynamic random access memory, a static random access memory, a flash memory, an optical memory, or other memory known to those skilled in the art.
[0164] The fourth embodiment of the present application provides a vehicle, including the electronic device described in the third embodiment of the present application, and can achieve the same beneficial effects as the third embodiment.
[0165] The fifth embodiment of the present application provides a computer program product, which includes instructions. When the instructions are executed by a computer, the computer implements the method described in the first embodiment of the present application and can achieve the same beneficial effects.
[0166] The method described in the first embodiment of the present application can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer programs or instructions. When the computer program or instruction is loaded and executed on a computer, the process or function described in each embodiment of the present application is executed in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, a network device, a user device, a core network device, an OAM (Open Application Model) or other programmable device.
[0167] The computer program or instructions may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium, for example, the computer program or instructions may be transmitted from one website, computer, server or data center to another website, computer, server or data center by wired or wireless means. The computer-readable storage medium may be any available medium that can be accessed by a computer or a data storage device such as a server or data center that integrates one or more available media. The available medium may be a magnetic medium, such as a floppy disk, a hard disk, or a magnetic tape; it may also be an optical medium, such as a digital video disk; it may also be a semiconductor medium, such as a solid-state drive. The computer-readable storage medium may be a volatile or non-volatile storage medium, or may include both volatile and non-volatile types of storage media.
[0168] The sixth embodiment of the present application provides a computer-readable storage medium, which includes a stored computer program; wherein, when the computer program is running, the device where the computer-readable storage medium is located is controlled to execute the method described in the first embodiment of the present application, and can achieve the same beneficial effects as the method described in the first embodiment of the present application.
[0169] In summary, the embodiments of the present application provide a vehicle data compression method, device, vehicle and program product, wherein the vehicle data compression method comprises: obtaining the vehicle data to be compressed and determining the current operating state of the vehicle; selecting a target compression algorithm from a plurality of compression algorithms and setting the compression level of the target compression algorithm according to the operating state of the vehicle; compressing the data to be compressed according to the target compression algorithm and the compression level of the target compression algorithm to obtain a compressed data packet. The embodiments of the present application can adaptively compress the vehicle data according to the operating state of the vehicle by selecting a target compression algorithm from a plurality of compression algorithms and setting the compression level of the target compression algorithm according to the current operating state of the vehicle after obtaining the vehicle data to be compressed, and compressing the data to be compressed according to the target compression algorithm and the compression level of the target compression algorithm. This can realize dynamic compression of vehicle data and ensure stable operation of the vehicle.
[0170] The above embodiments are only described as examples. The various embodiments of the present application can be combined or nested with each other, and the present application is not limited to this.
[0171] In several embodiments provided in the present application, it should be understood that the disclosed devices and methods can also be implemented in other ways. The device embodiments described above are merely schematic. For example, the flowcharts and block diagrams in the accompanying drawings show the possible architecture, functions and operations of the devices, methods and computer program products according to multiple embodiments of the present application. In this regard, each box in the flowchart or block diagram can represent a module, a program segment or a part of a code, and the module, a program segment or a part of a code contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flowchart, and the combination of boxes in the block diagram and / or flowchart can be implemented with a dedicated hardware-based system that performs a specified function or action, or can be implemented with a combination of dedicated hardware and computer instructions.
[0172] In addition, the functional modules in the various embodiments of the present application may be integrated together to form an independent part, or each module may exist separately, or two or more modules may be integrated to form an independent part.
[0173] If the functions are implemented in the form of software function modules and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application can be essentially or partly embodied in the form of a software product that contributes to the prior art. The computer software product is stored in a storage medium, including several instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0174] The above description is only an embodiment of the present application and is not intended to limit the scope of protection of the present application. For those skilled in the art, the present application may have various changes and variations. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application should be included in the scope of protection of the present application. It should be noted that similar reference numerals and letters represent similar items in the following drawings, so once an item is defined in one drawing, it does not need to be further defined and explained in the subsequent drawings.
[0175] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
[0176] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.
Claims
1. A vehicle data compression method, characterized in that: include: Obtaining data to be compressed of the vehicle and determining the current operating state of the vehicle; selecting a target compression algorithm from a plurality of compression algorithms according to the running state of the vehicle, and setting a compression level of the target compression algorithm; The data to be compressed is compressed according to the target compression algorithm and the compression level of the target compression algorithm to obtain a compressed data packet.
2. The method according to claim 1, characterized in that The step of selecting a target compression algorithm from a plurality of compression algorithms according to the running state of the vehicle, and setting a compression level of the target compression algorithm comprises: When the running state of the vehicle is the intelligent driving function on state, a first compression algorithm that satisfies a first screening condition among the multiple compression algorithms is used as the target compression algorithm, and a compression level of the target compression algorithm is set to a first compression level; wherein the first screening condition is related to the amount of hardware resources occupied by the compression algorithm of the vehicle, and the first compression level is within a low compression level range of the first compression algorithm; When the running state of the vehicle is an intelligent driving function off state or a parking state, a second compression algorithm that satisfies a second filtering condition among the plurality of compression algorithms is used as the target compression algorithm, and a compression level of the target compression algorithm is set to a second compression level; wherein the second filtering condition is set by a user, and the second compression level is within a high compression level range of the second compression algorithm; When the operating state of the vehicle is the intelligent driving function off state and the driving state, a third compression algorithm among the multiple compression algorithms that meets the third filtering condition is used as the target compression algorithm, and the compression level of the target compression algorithm is set to the third compression level; wherein the third filtering condition and the third compression level are determined based on the current resource performance indicators of the vehicle.
3. The method according to claim 2, characterized in that The first screening condition includes a condition that the compression algorithm takes up the least amount of hardware resources of the vehicle; The second screening condition includes a condition that the compression algorithm is an algorithm historically used to compress the target data; wherein the data type of the target data is the same as the data type of the data to be compressed.
4. The method according to claim 2, characterized in that: Before setting the compression level of the target compression algorithm to the first compression level, the method further includes: Within the low compression level range of the first compression algorithm, a low compression level that matches the current value of the hardware resource performance indicator of the vehicle is used as the first compression level.
5. The method according to claim 2, characterized in that: Before setting the compression level of the target compression algorithm to the second compression level, the method further includes: Within the high compression level range of the second compression algorithm, a high compression level corresponding to the hardware resource occupancy of the vehicle-mounted application currently in the vehicle is used as the second compression level.
6. The method according to claim 2, characterized in that The resource performance indicators of the vehicle include hardware resource performance indicators and network resource performance indicators; Before taking the third compression algorithm that satisfies the third screening condition among the plurality of compression algorithms as the target compression algorithm and setting the compression level of the target compression algorithm to the third compression level, the method further includes: In the case where the value of the hardware resource performance indicator is not within the first indicator threshold range, determining that the third screening condition is related to the amount of hardware resources occupied by the compression algorithm on the vehicle, and determining that the third compression level is within a low compression level range of the third compression algorithm; In a case where the value of the hardware resource performance indicator is within the first indicator threshold range and the value of the network resource performance indicator is not within the second indicator threshold range, determining that the third screening condition is set by a user, and determining that the third compression level is within the advanced compression level range of the third compression algorithm; When the value of the hardware resource performance indicator is within the first indicator threshold range and the value of the network resource performance indicator is within the second indicator threshold range, it is determined that the third filtering condition is set by the user, and the third compression level is determined to be the default compression level of the third compression algorithm.
7. The method according to claim 6, characterized in that The hardware resource performance indicator includes the CPU occupancy rate and / or the memory occupancy rate, and the network resource performance indicator includes the network bandwidth and / or the network delay.
8. The method according to claim 1, characterized in that The number of the target compression algorithm is one; The method further comprises: A data packet to be transmitted is generated according to the compressed data packet, the target compression algorithm and the compression level of the target compression algorithm.
9. The method according to claim 1, characterized in that: The number of the target compression algorithms is multiple; The method further comprises: Evaluate the compression effect index of each target compression algorithm according to the compressed data packets corresponding to each target compression algorithm; According to the compression effect indicators of the plurality of target compression algorithms, selecting an optimal compression algorithm whose compression effect indicator has a target value from the plurality of target compression algorithms; A data packet to be transmitted is generated according to the compressed data packet corresponding to the optimal compression algorithm, the optimal compression algorithm and the compression level of the optimal compression algorithm.
10. The method according to claim 9, characterized in that The compression effect index includes a compression ratio.
11. The method according to any one of claims 1 to 10, characterized in that: The multiple compression algorithms are determined according to the data type of the data to be compressed.
12. An electronic device, characterized in that: The method comprises a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor; the memory is coupled to the processor, and the processor implements the method according to any one of claims 1 to 11 when executing the computer program.
13. A vehicle, characterized in that: Comprising an electronic device according to claim 12.
14. A computer program product, characterized in that The computer program product comprises instructions which, when executed by a computer, cause the computer to implement the method according to any one of claims 1 to 11.
