Data compression, decompression method and apparatus

CN117335810BActive Publication Date: 2026-09-22CALTERAH SEMICON TECH (SHANGHAI) CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202210720880.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-06-23
Publication Date
2026-09-22
Estimated Expiration
2042-06-23

AI Technical Summary

Technical Problem

[0005]本申请提供一种数据压缩、解压缩方法及装置,用以解决现有的数据有损压缩方法中,压缩后数据占用的存储空间较大的问题

Benefits of technology

[0084]第十方面,本申请提供一种计算机程序产品,包括计算机程序,所述计算机程序被处理器执行时实现第一方面、第二方面、第三方面及第四方面任一项所述的方法。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117335810B_ABST
    Figure CN117335810B_ABST
Patent Text Reader

Abstract

The application provides a data compression and decompression method and device. The compression method comprises the following steps: obtaining a data block to be compressed, calculating the average effective bit number of each data in the data block, calculating and storing the average storage bit width occupied by the remainder part of each data in the compressed data block according to a preset compression rate, and finally performing dynamic shift processing on the original remainder part of each data in the data block according to the average effective bit number and the average storage bit width, so as to obtain the compressed remainder part of each data in the data block. The decompression method comprises the following steps: obtaining data to be decompressed, calculating the average effective bit number of the data in the data block, and finally performing dynamic shift processing on the compressed remainder part of each data in the data block according to the average effective bit number and the average storage bit width contained in the data to be decompressed, so as to obtain the original remainder part of each data in the data block. The method provided by the application reduces the storage space occupied by the data remainder part.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of data storage technology, and in particular to a data compression and decompression method and apparatus. Background Technology

[0002] During the storage process, in order to reduce storage space and improve transmission, storage and processing efficiency, data is compressed according to certain algorithms. Data compression includes lossy compression and lossless compression.

[0003] There are two main types of existing lossy data compression methods: transform domain compression and predictive compression. Taking transform domain compression as an example, the transform compression involved is usually Discrete Cosine Transform (DCT) compression. The data to be compressed is compressed by performing DCT operations, and storage space is allocated according to the storage bit width occupied by the remaining part of the compressed data.

[0004] However, existing lossy compression methods result in data that occupies a large amount of storage space after compression. Summary of the Invention

[0005] This application provides a data compression and decompression method and apparatus to solve the problem that the compressed data occupies a large amount of storage space in existing lossy data compression methods.

[0006] In a first aspect, this application provides a data compression method, comprising:

[0007] Obtain the data block to be compressed;

[0008] Calculate the average number of significant bits for each data item within the data block;

[0009] Based on a preset compression ratio, calculate and store the average storage bit width occupied by the remainder portion of each data in the compressed data block;

[0010] Based on the average effective bit value and the average storage bit width, the original remainder portion of each data in the data block is dynamically shifted to obtain the compressed remainder portion of each data in the data block.

[0011] Optionally, obtaining the data block to be compressed includes:

[0012] Obtain the data to be compressed;

[0013] The data to be compressed is divided into blocks to obtain multiple data blocks to be compressed.

[0014] Determine and store the effective number of bits corresponding to each data in the data block to be compressed.

[0015] Optionally, the dynamic shifting of the original remainder portion of each data within the data block includes:

[0016] The data blocks obtained by segmentation are processed in parallel to dynamically shift the original remainder portion of each data in each data block.

[0017] Optionally, the step of dynamically shifting the original remainder portion of each data within the data block based on the average effective bit value and the average storage bit width to obtain the compressed remainder portion of each data within the data block includes:

[0018] Based on the average effective bit value and the average storage bit width, calculate the dynamic shift bit width of the original remainder portion of each data in the data block;

[0019] Based on the number of significant bits corresponding to each data in the data block, the average number of significant bits, and the average storage bit width, calculate the dynamic truncation bit width of the original remainder portion of each data in the data block;

[0020] The original remainder portion of each data in the data block is shifted to the corresponding dynamic shift bit width, and the highest bit is taken to the corresponding dynamic truncation bit width to obtain the compressed remainder portion of each data in the data block.

[0021] Optionally, the step of shifting the original remainder portion of each data in the data block to the corresponding dynamic shift bit width, and taking the highest bit as the corresponding dynamic truncation bit width, to obtain the compressed remainder portion of each data in the data block includes:

[0022] The remainder of each data point within the data block after compression is obtained using the following formula:

[0023] M n [i]=sat_shift(D[i], avg_E-db, db+E[i]-avg_E+1)

[0024] Among them, M n[i] represents the remainder of the i-th data in the data block after compression; D[i] represents the original remainder of the i-th data in the data block; avg_E-db represents the dynamic shift width of the original remainder of the i-th data in the data block; avg_E represents the average number of significant bits; db represents the average storage width; db+E[i]-avg_E+1 represents the dynamic truncation width of the original remainder of each data in the data block; E[i] represents the number of significant bits corresponding to the i-th data in the data block; sat_shift can be used to represent the aforementioned shift operation, and the corresponding parameters can be the three values ​​configured in parentheses, namely D[i], avg_E-db, and db+E[i]-avg_E+1.

[0025] Optionally, if the calculated dynamic shift width is less than 0, the original remainder portion of each data in the data block is shifted to the left by the dynamic shift width.

[0026] Alternatively, if the calculated dynamic shift bit width is greater than 0, the original remainder portion of each data in the data block is shifted to the right by the dynamic shift bit width.

[0027] Optionally, based on a preset compression ratio, the average storage bit width occupied by the remainder portion of each data within the compressed data block is calculated and stored, including:

[0028] Obtain the storage bit width occupied by each data in the data block when it is uncompressed and the storage bit width occupied by the effective bit portion of each data in the data block;

[0029] Multiply the storage bit width occupied by each data point in the data block when it is uncompressed by the preset compression rate, and subtract the storage bit width occupied by the effective bit portion of each data point in the data block to obtain the average storage bit width occupied by the remainder portion of each data point in the data block.

[0030] Optionally, determining and storing the effective number of bits corresponding to each data in the data block to be compressed includes:

[0031] If each data in the data block is a real number, then the number of significant digits of each data in the data block that is determined and stored is the number of significant digits corresponding to the real number;

[0032] Alternatively, if each data point in the data block is a complex number, then the number of significant digits for each data point in the data block that is determined and stored is the largest of the real and imaginary parts of the complex number.

[0033] Secondly, this application provides a data decompression method, including:

[0034] Obtain the data to be decompressed, the data including the effective number of bits corresponding to each data in the data block stored during the compression process, the average storage bit width occupied by the remainder of each data in the data block, and the remainder of each data in the data block after compression;

[0035] Calculate the average number of significant bits in the data block based on the number of significant bits corresponding to each data point in the data block.

[0036] Based on the average effective bit value and the average storage bit width, the remainder portion of each data in the data block after compression is dynamically shifted to obtain the original remainder portion of each data in the data block.

[0037] Optionally, the step of dynamically shifting the remainder portion of each data in the data block after compression based on the average effective bit value and the average storage bit width to obtain the original remainder portion of each data in the data block includes:

[0038] Based on the average effective bit value and the average storage bit width, calculate the dynamic shift bit width of the remainder portion of each data in the data block after compression;

[0039] The remainder portion of each data in the data block after compression is shifted by the corresponding dynamic shift bit width to obtain the original remainder portion of each data in the data block.

[0040] Optionally, shifting the remainder portion of each data item in the data block after compression by the corresponding dynamic shift bit width to obtain the original remainder portion of each data item in the data block includes:

[0041] The original remainder portion of each data point within the data block is obtained using the following formula:

[0042] D′ [i] =shift(M n [i],db-avg_E)

[0043] Among them, D′ [i] It is the original remainder of the i-th data within the data block;

[0044] M n [i] represents the remainder portion of the i-th data in the data block after compression; db-avg_E represents the dynamic shift width of the remainder portion of the i-th data in the data block after compression; avg_E represents the average effective bit value; and db represents the average storage bit width.

[0045] Optionally, if the calculated dynamic shift width is less than 0, the remainder portion of each compressed data in the data block is shifted to the left by the dynamic shift width.

[0046] Alternatively, if the calculated dynamic shift bit width is greater than 0, then the remainder portion of each compressed data in the data block is shifted to the right by the dynamic shift bit width.

[0047] Optionally, the data also includes the storage bit width occupied by each piece of data in the data block when it is not compressed during the compression process, and the storage bit width occupied by the effective bit portion of each piece of data in the data block;

[0048] The average storage bit width occupied by the remainder portion of each data within the data block is calculated based on a preset compression ratio, including:

[0049] Multiply the storage bit width occupied by each data point in the data block when it is uncompressed by the preset compression rate, and subtract the storage bit width occupied by the effective bit portion of each data point in the data block to obtain the average storage bit width occupied by the remainder portion of each data point in the data block.

[0050] Optionally, the number of significant bits corresponding to each data point within the data block includes:

[0051] If each data point in the data block is a real number, then the number of significant digits in each data point in the data block is the number of significant digits corresponding to the real number.

[0052] Alternatively, if each data point in the data block is a complex number, then the number of significant digits for each data point in the data block is the largest of the real and imaginary parts of the complex number.

[0053] Thirdly, this application provides a method for data compression and storage, applicable to any data block, wherein the data block includes at least two data items to be compressed, and the method includes:

[0054] For any of the data to be compressed, compress and store the data as a combination of compressed data;

[0055] The data combination includes a significant number of digits unit and a remainder unit.

[0056] Optionally, the method further includes:

[0057] Obtain the valid bit portion of the data to be compressed;

[0058] Specifically, the valid bit portion is fully preserved and stored in the valid number unit in a variable-length format.

[0059] Optionally, the method further includes:

[0060] The data compression method described in any one of the present applications is used to obtain the remainder portion of the data to be compressed.

[0061] The remainder portion is stored in the remainder unit.

[0062] Fourthly, this application provides a data decompression method applied to compressed data of a data combination obtained by using any of the methods described in this application, the method comprising:

[0063] The corresponding valid bit portion is restored from the compressed data, and the number of valid bits in the compressed data is obtained;

[0064] Based on the effective number of bits, the remainder portion of the compressed data is obtained using any one of the data decompression methods described in this application; and

[0065] Based on the valid bit portion and the remainder portion, decompressed data corresponding to the compressed data is obtained.

[0066] Fifthly, this application provides a data compression apparatus, comprising:

[0067] The acquisition module is used to acquire the data blocks to be compressed;

[0068] The calculation module is used to calculate the average number of significant bits of each data within the data block;

[0069] The calculation module is also used to calculate and store the average storage bit width occupied by the remainder of each data in the compressed data block according to the preset compression ratio.

[0070] The dynamic shift processing module is used to perform dynamic shift processing on the original remainder portion of each data in the data block according to the average effective bit value and the average storage bit width, so as to obtain the compressed remainder portion of each data in the data block.

[0071] Sixthly, this application provides a data decompression apparatus, comprising:

[0072] The acquisition module is used to acquire the data to be decompressed. The data includes the effective number of bits corresponding to each data in the data block stored during the compression process, the average storage bit width occupied by the remainder of each data in the data block, and the remainder of each data in the data block after compression.

[0073] The calculation module is used to calculate the average number of significant bits in the data block based on the number of significant bits corresponding to each data point in the data block.

[0074] The dynamic shift processing module is used to perform dynamic shift processing on the remainder portion of each data in the data block after compression, based on the average effective bit value and the average storage bit width, to obtain the original remainder portion of each data in the data block.

[0075] In a seventh aspect, this application provides a data compression device, comprising: at least one processor, a memory, a receiver, and a transmitter;

[0076] Both the receiver and the transmitter are coupled to the processor; the processor controls the receiving action of the receiver and the transmitting action of the transmitter.

[0077] The memory stores computer-executed instructions;

[0078] The at least one processor executes computer execution instructions stored in the memory, causing the electronic device to perform the method described in any of the first aspects.

[0079] Eighthly, this application provides a data decompression device, comprising: at least one processor, a memory, a receiver, and a transmitter;

[0080] Both the receiver and the transmitter are coupled to the processor; the processor controls the receiving action of the receiver and the transmitting action of the transmitter.

[0081] The memory stores computer-executed instructions;

[0082] The at least one processor executes computer execution instructions stored in the memory, causing the electronic device to perform the method described in any of the second aspects.

[0083] Ninthly, this application provides a computer-readable storage medium storing computer-executable instructions that, when executed by a processor, implement the method described in any one of the first, second, third, and fourth aspects.

[0084] In a tenth aspect, this application provides a computer program product, including a computer program that, when executed by a processor, implements the method described in any one of the first, second, third, and fourth aspects.

[0085] This application provides a data compression and decompression method and apparatus. The method involves acquiring a data block to be compressed and calculating the average number of significant bits for each data element within the data block. Then, based on a preset compression ratio, it calculates and stores the average storage width occupied by the remainder portion of each data element within the compressed data block. Finally, based on the average number of significant bits and the average storage width, it dynamically shifts the original remainder portion of each data element within the data block to obtain the compressed remainder portion. This method compresses the remainder portion of the data based on the average number of significant bits and the average storage width within the data block, thereby reducing the storage space occupied by the remaining data. Attached Figure Description

[0086] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.

[0087] Figure 1 A schematic flowchart of a data compression method provided in Embodiment 1 of this application;

[0088] Figure 2 A flowchart illustrating yet another data compression method provided in Embodiment 2 of this application;

[0089] Figure 3 This is a flowchart illustrating a data decompression method provided in Embodiment 4 of this application;

[0090] Figure 4 This is a flowchart illustrating another data decompression method provided in Embodiment 5 of this application;

[0091] Figure 5 This is a schematic diagram of the structure of a data compression device provided in Embodiment 7 of this application;

[0092] Figure 6 This is a schematic diagram of the structure of a data decompression device provided in Embodiment 8 of this application;

[0093] Figure 7 This is a schematic diagram of the structure of a data compression device provided in Embodiment 9 of this application;

[0094] Figure 8 This is a schematic diagram of the structure of a data decompression device provided in Embodiment 10 of this application;

[0095] Figure 9 A comparison chart of the velocity dimension obtained after processing FMCW radar data using the compression method described in this application embodiment;

[0096] Figure 10 This is a comparison chart of the velocity dimension obtained after processing FMCW radar data using the compression method described in this application embodiment.

[0097] The accompanying drawings illustrate specific embodiments of this application, which will be described in more detail below. These drawings and descriptions are not intended to limit the scope of the concept in any way, but rather to illustrate the concept of this application to those skilled in the art through reference to particular embodiments. Detailed Implementation

[0098] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numbers in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this application. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this application as detailed in the appended claims.

[0099] It should be noted that in the description of the embodiments of this application, the terms "inner", "outer", "left", "right" and other terms indicating the direction or positional relationship are based on the direction or positional relationship shown in the drawings. This is only for the convenience of description and is not intended to indicate or imply that the device or component must have a specific orientation, or be constructed and operated in a specific orientation. Therefore, it should not be construed as a limitation of this application.

[0100] When data is compressed and stored, it is typically stored in binary scientific notation based on the IEEE 754 standard. IEEE 754 stands for Institute of Electrical and Electronics Engineers' Binary Floating-Point Arithmetic Standard, also known as binary floating-point arithmetic for microprocessor systems. The IEEE 754 standard stores data in a format where, for example, the decimal number 8.25 can be converted to the binary number 1.00001 * 2^25. 3 In this context, "1.00001" represents the remainder of the data, and "3" represents the exponent of the data, also known as the significant digits.

[0101] The data is converted into binary scientific notation for storage. The integer remainder is always 1, which doesn't need to be represented in memory; only the binary "00001" after the decimal point needs to be stored in memory. For example, Table 1 shows the storage method for 32-bit data. As shown in Table 1, when storing data, the leftmost bit (the highest bit) is the sign bit, used to indicate whether the data is positive or negative. The middle part is the exponent bit, used to store the exponent part (significant digits), and the rightmost part is the remainder part, used to store the remainder.

[0102] Table 1

[0103] 0 11 00001

[0104] First, the data needs to be compressed before storage. In this application, this mainly refers to compressing the remainder portion of the data.

[0105] Data compression refers to reducing the amount of data to decrease storage space without losing useful information, thereby improving the efficiency of transmission, storage, and processing. During compression, data is typically reorganized according to a specific algorithm to reduce redundancy and save storage space. Data compression includes lossy compression and lossless compression.

[0106] The method described in this application is lossy compression of data. Lossy compression means that some information is allowed to be lost during compression. Although the original data cannot be completely recovered, the lost part has a small impact on the original data.

[0107] There are two main types of existing lossy data compression methods: transform domain compression and predictive compression. Taking transform domain compression as an example, the transform compression involved is usually Discrete Cosine Transform (DCT) compression. Data compression is achieved by performing DCT operations on the data to be compressed, and storage space is allocated according to the storage bit width occupied by the remaining part of the compressed data.

[0108] However, existing lossy compression methods result in data that occupies a large amount of storage space after compression.

[0109] The reason is that existing lossy compression determines the compression ratio based on the compression algorithm used and the type of data. Current compression algorithms cannot achieve a fixed compression ratio for all types of data; they are only effective for data with a certain uniform probability distribution. This means that for some non-uniform probability distribution data, even after compression, the compressed data still occupies a relatively large amount of storage space due to the low compression ratio.

[0110] Therefore, to address the aforementioned technical problems of the prior art, this application proposes a data compression and decompression method and apparatus. By setting a fixed compression ratio (preset compression ratio), the method acquires data blocks to be compressed. For any given data block, it calculates the average number of significant bits for each data element. Then, based on the preset compression ratio, it calculates and stores the average storage width occupied by the remainder portion of each data element within the compressed data block. Finally, based on the average number of significant bits and the average storage width, it performs dynamic shifting on the original remainder portion of each data element within the data block to obtain the compressed remainder portion. Thus, by using the average number of significant bits and the average storage width, a fixed compression ratio is achieved for the remainder portion of the data, reducing the storage space occupied by the data remainder. Furthermore, during operations such as compression, storage, and decompression, each data block can be compressed and / or decompressed independently, enabling parallel data processing without mutual interference. In other words, this application can solve problems such as data compression and storage under large data volume and large dynamic range, and achieve large data compression and storage with small performance loss. At the same time, it can also achieve compression with relatively fixed compression ratio and / or non-fixed compression ratio regardless of data probability distribution.

[0111] This application can be applied to the compression and decompression of various types of data. For example, the data type can be data with a uniform probability distribution or data with a non-uniform probability distribution. This data can be voice, image, or video data, such as range, velocity, and / or angle data obtained after data processing in FMCW (Frequency Modulated Continuous Wave) radar. It is understood that the data compression and decompression methods provided in this application include, but are not limited to, the above data types, and are not intended to limit this application.

[0112] The technical solution of this application and how the technical solution of this application solves the above-mentioned technical problems are described in detail below with specific embodiments. These specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described again in some embodiments. The embodiments of this application will now be described with reference to the accompanying drawings.

[0113] Figure 1 This is a flowchart illustrating a data compression method provided in Embodiment 1 of this application, as shown below. Figure 1 As shown, the method specifically includes the following steps:

[0114] S101. Obtain the data block to be compressed.

[0115] The executing entity of this application can be a computer or other device or equipment that can compress data. This embodiment uses a computer as an example for illustration.

[0116] When a computer processes data, regardless of whether the input data is in decimal or hexadecimal, it will eventually be converted into binary scientific notation for storage.

[0117] The acquisition of data blocks involves dividing the data to be compressed into blocks, thereby obtaining multiple data blocks. The number of data in each data block can be set individually according to the compression requirements, such as dividing the data into groups of 2, 3, or 4 data. This application does not limit the specific number.

[0118] S102. Calculate the average number of significant bits for each data item within the data block.

[0119] After dividing the data to be compressed into blocks, determine and store the effective number of bits corresponding to each data in the data block to be compressed.

[0120] This application uses a data block containing four data items as an example to illustrate the process. It determines the effective number of bits E[i] corresponding to the four data items in the data block and stores the effective number of bits in the computer's memory. Here, i represents the i-th data item in the data block.

[0121] The number of significant digits for each data item in a data block can be determined in the following two ways:

[0122] If all data in a data block are real numbers, then the number of significant digits of each data in the data block that is determined and stored is the number of significant digits corresponding to the real numbers;

[0123] Alternatively, if all data within a data block are complex numbers, then the number of significant digits for each data point within the data block that is determined and stored is the largest of the real and imaginary parts of the complex number.

[0124] After determining the number of significant digits for each data point in the data block, the average number of significant digits is calculated. This application does not limit the method for calculating the average number of significant digits; any averaging algorithm or formula can be used to calculate the average number of significant digits in each data block.

[0125] For example, the average number of significant bits in a data block can be calculated using the following algorithm:

[0126] avg_E=average(E[0]+E[1]+…+E[blk sz -1])

[0127] Among them, E[blk sz -1] represents the blk-th data block. sz -1 represents the number of significant digits in the data; average is an operation used to calculate the mean.

[0128] Assuming the data block contains 4 data points with significant digits of 17, 16, 15, and 16 respectively, the average significant digit value calculated using the algorithm described above is 16.

[0129] Understandably, after the averaging algorithm, the resulting average significant digits may not be an integer but a decimal. In this case, to obtain an integer, possible processing methods include: rounding the decimal up; rounding it down; or rounding to the nearest integer. For example, if the average significant digits value is 17.49, then the decimal is rounded up to 18, rounded down to 17, and then rounded to the nearest integer to 17.

[0130] S103. Calculate and store the average storage bit width occupied by the remainder of each data in the compressed data block according to the preset compression ratio.

[0131] The preset compression rate can be flexibly set according to needs. By compressing the data to achieve the preset compression rate, the data can be compressed at a fixed compression rate.

[0132] The average storage bit width (db) can be represented as the average storage bit width occupied by the remainder of each data after compression and storage in the data block. It is determined by the preset compression rate and the proportion of the effective bits of each data in the data block.

[0133] Optional,

[0134] The average storage bit width (dB) can be calculated using the following method:

[0135] Get the storage bit width occupied by each data in the data block when it is not compressed, and the storage bit width occupied by the effective bit portion of each data in the data block;

[0136] Multiply the storage width occupied by each data point in the data block when it is uncompressed by the preset compression rate, and subtract the storage width occupied by the effective bits of each data point in the data block to obtain the average storage width occupied by the remainder of each data point in the data block.

[0137] It should be noted that the storage width occupied by each uncompressed data point within a data block, and the storage width occupied by the effective bits of each data point within the data block, are related to the data storage method in the computer. Therefore, the same data may have different storage widths depending on the storage method. For specific storage methods and the methods for determining the corresponding storage widths, please refer to relevant technologies; this application will not elaborate on them.

[0138] For example,

[0139] Assuming a preset compression rate of 0.5, the storage width occupied by uncompressed data is 16 bits, and the storage width occupied by the effective bits of data within a block is 2 bits.

[0140] Therefore, according to the above optional method, the average storage bit width occupied by the remainder of each data in the data block is db = 16 × 0.5 - 2 = 6 bits.

[0141] S104. Based on the average effective bit value and the average storage bit width, perform dynamic shifting on the original remainder portion of each data in the data block to obtain the compressed remainder portion of each data in the data block.

[0142] In this application, data compression mainly refers to compressing the remainder portion of the data.

[0143] Based on the average effective bit value and the average storage bit width, the dynamic shift bit width and dynamic truncation bit width of the original remainder part of each data in the data block are calculated. Then, the original remainder part of each data in the data block is dynamically shifted according to the dynamic shift bit width and dynamic truncation bit width to obtain the compressed remainder part of each data in the data block.

[0144] It should be noted that during the compression process, the data blocks obtained from the segmentation can be processed and compressed in parallel. This means that the original remainder of each data block is dynamically shifted, thereby improving the data compression efficiency.

[0145] The specific method for obtaining the remainder of each data block after compression will be described in detail in Embodiment 2 of this application. Please refer to Embodiment 2.

[0146] In the above embodiments of this application, a data block to be compressed is obtained, and the average number of significant bits of each data within the data block is calculated. Then, based on a preset compression ratio, the average storage width occupied by the remainder portion of each data within the compressed data block is calculated and stored. Finally, based on the average number of significant bits and the average storage width, the original remainder portion of each data within the data block is dynamically shifted to obtain the compressed remainder portion of each data within the data block. The method of this embodiment achieves a fixed compression ratio for the remainder portion of the data based on the average number of significant bits and the average storage width of the data within the data block, thereby reducing the storage space occupied by the remainder portion of the data.

[0147] Optionally, based on the above embodiment one, the following, in conjunction with Figure 2 The embodiment shown describes the specific process of dynamically shifting the original remainder portion of each data in the data block according to the average effective bit value and the average storage bit width in step S104 above to obtain the compressed remainder portion of each data in the data block.

[0148] Figure 2 This is a flowchart illustrating another data compression method provided in Embodiment 2 of this application, as shown below. Figure 2As shown, the method includes the following steps:

[0149] S201. Calculate the dynamic shift width of the original remainder portion of each data in the data block based on the average effective bit value and the average storage bit width.

[0150] S202. Calculate the dynamic truncation width of the original remainder portion of each data in the data block based on the number of significant bits, the average number of significant bits, and the average storage width of each data in the data block.

[0151] S203. Shift the original remainder of each data in the data block to the corresponding dynamic shift bit width, and take the corresponding dynamic truncation bit width for the highest bit to obtain the compressed remainder of each data in the data block.

[0152] Specifically,

[0153] The remainder of each data point within a data block after compression can be obtained using the following formula:

[0154] M n [i]=sat_shift(D[i], avg_E-db, db+E[i]-avg_E+1)

[0155] Among them, M n [i] represents the remainder of the i-th data in the data block after compression; D[i] represents the original remainder of the i-th data in the data block, dat; avg_E-db represents the dynamic shift width shift_bit of the original remainder of the i-th data in the data block; avg_E represents the average number of significant bits; db represents the average storage width; db+E[i]-avg_E+1 represents the dynamic truncation width bit_width of the original remainder of each data in the data block; E[i] represents the number of significant bits corresponding to the i-th data in the data block.

[0156] Among them, sat_shift(dat, shift_bit, bit_width) takes the original remainder of each data in the data block, rounds it, shifts it by shift_bit, and then saturates it by taking the highest bit bit_width, that is, retaining bit_width bits of width.

[0157] It should be noted that,

[0158] If the calculated dynamic shift bit width is less than 0, then the original remainder of each data in the data block is shifted to the left by the calculated dynamic shift bit width.

[0159] Alternatively, if the calculated dynamic shift width is greater than 0, the original remainder of each data in the data block is shifted to the right by the calculated dynamic shift width.

[0160] In the above embodiments of this application, the dynamic shift width of the original remainder portion of each data in the data block is calculated based on the average significant bit value and the average storage bit width. The dynamic truncation width of the original remainder portion of each data in the data block is also calculated based on the number of significant bits, the average significant bit value, and the average storage bit width, thereby determining the storage space occupied by the remainder portion of each data in the data block. Then, the original remainder portion of each data in the data block is shifted by the corresponding dynamic shift width, and the highest bit is taken as the corresponding dynamic truncation width. Finally, the compressed remainder portion of each data in the data block is obtained, completing the compression of the data remainder portion and reducing storage space.

[0161] Optionally, to facilitate understanding of the methods in Embodiments 1 and 2, the data compression method will be described in detail below through a specific Embodiment 3.

[0162] First, we define the remainder part of the data and the significant number of digits for the real and imaginary parts of positive, negative, and complex numbers.

[0163] The number of significant digits in the real part of both positive and complex numbers refers to the length from the first non-zero digit in the highest digit to the lowest digit, where the highest digit represents the sign bit, "0" represents a positive number, and "1" represents a negative number.

[0164] As shown in Table 2, the numbers represented in Table 2 are the real part of positive or complex numbers. According to the above definition, it can be seen that the number has 14 significant digits and the rest of the number is "11010101110010".

[0165] Table 2

[0166] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 1 0 1 0 1 1 1 0 0 1 0

[0167] The number of significant digits in the imaginary part of negative numbers and complex numbers refers to the length from the first non-1 digit in the highest digit to the lowest digit.

[0168] As shown in Table 3, the numbers represented in Table 3 are negative numbers or the imaginary part of complex numbers. According to the above definition, it can be seen that the significant digits of the number are 15. The remaining part is "11010101110010".

[0169] Table 3

[0170] 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0

[0171] Assume the data to be compressed is shown in Table 4 below. The data to be compressed is a complex hexadecimal number with a storage width of 32 bits. It should be noted that in Table 4, if the number of digits is not fully displayed, it should be preceded by "0". For example, "a8f0" is actually "0000a8f0".

[0172] Table 4

[0173] 0 0×fffe6ad0 0 1 0×a8f0 0×8160 2 0xffffb11c 0×5e84 3 0×88b0 0xffff8368

[0174] After conversion to binary, the corresponding binary data are shown in Table 5:

[0175] Table 5

[0176] 11111111111111100110101011010000 0 1010100011110000 1000000101100000 11111111111111111011000100011100 0101111010000100 1000100010110000 11111111111111111000001101101000

[0177] Since the significant number of a complex number is the larger of the significant numbers in its real and imaginary parts, according to the judgment methods in Tables 2 and 3, we can determine that the significant number of the data 0 is 17, the significant number of the data 1 is 16, the significant number of the data 2 is 15, and the significant number of the data 3 is 16.

[0178] After the data to be compressed is divided into blocks, the number of significant bits corresponding to each data in the data block is determined and stored. The number of significant bits is 17, 16, 15, and 16.

[0179] Calculate the average number of significant bits for each data point within the data block:

[0180]

[0181] Assuming that the average storage width (db) occupied by the remainder of each data in the calculated data block is 5 bits, the remainder of each data in the data block after compression can be obtained according to steps S201-S203 in Example 2.

[0182] For example, the compression process is illustrated using data from serial number 0 in Table 4:

[0183] As shown in step S201 of Embodiment 2, the dynamic shift bit width of the original remainder portion of each data in the data block is calculated based on the average effective bit value and the average storage bit width:

[0184] avg_E-db = 16 - 5 = 11

[0185] As shown in step S202 of Embodiment 2, the dynamic truncation bit width of the original remainder portion of each data in the data block is calculated based on the number of significant bits, the average number of significant bits, and the average storage bit width corresponding to each data in the data block:

[0186] db+E[i]-avg_E+1=5+17-16+1=7

[0187] As shown in step S203 of Embodiment 2, the original remainder portion of each data in the data block is shifted to the corresponding dynamic shift bit width, and the highest bit is taken to the corresponding dynamic truncation bit width to obtain the compressed remainder portion of each data in the data block.

[0188] Since the dynamic shift bit width of 11 is greater than 0, the shift is right by 11 bits, and the saturation operation takes the highest bit as 7 bits, that is, retains 7 bits.

[0189] Specifically,

[0190] After rounding the original remainder of the data "11111111111111100110101011010000", it is shifted right by 11 bits to become "111111111111111001101". Retaining 7 bits, it becomes "1001101". Therefore, the remainder after data compression is "1001101", which becomes "4d" after conversion to hexadecimal.

[0191] Accordingly, the remaining data in Table 4 are compressed as described above. Examples will not be provided here. After compression, the data in Table 4 is shown in Table 6.

[0192] Table 6

[0193] 0 0×4d 0 1 0×15 0×10 2 0×16 0×c 3 0×11 0×30

[0194] This embodiment is a specific exemplary description based on the steps shown in Embodiment 1 and Embodiment 2 above. The technical effects achieved are similar, and will not be described again.

[0195] The following describes the data decompression method. Figure 3 This is a flowchart illustrating a data decompression method provided in Embodiment 4 of this application, as shown below. Figure 3 As shown, the method specifically includes the following steps:

[0196] S301. Obtain the data to be decompressed. The data includes the number of significant bits corresponding to each data in the data block stored during the compression process, the average storage bit width occupied by the remainder of each data in the data block, and the remainder of each data in the data block after compression.

[0197] The executing entity of this application can be a computer or other device or equipment that can compress data. This embodiment uses a computer as an example for illustration.

[0198] S302. Calculate the average number of significant bits in the data block based on the number of significant bits corresponding to each data point in the data block.

[0199] During the data compression process, the data to be compressed is divided into blocks, and the effective number of bits E[i] corresponding to each data in each data block is pre-stored in the computer's storage unit, where i represents the i-th data in the data block.

[0200] The number of significant digits for each data item in a data block can be determined in the following two ways:

[0201] If all data in a data block are real numbers, then the number of significant digits of each data in the data block that is determined and stored is the number of significant digits corresponding to the real numbers;

[0202] Alternatively, if all data within a data block are complex numbers, then the number of significant digits for each data point within the data block that is determined and stored is the largest of the real and imaginary parts of the complex number.

[0203] After determining the number of significant digits for each data point in the data block, the average number of significant digits is calculated. This application does not limit the method for calculating the average number of significant digits; any averaging algorithm or formula can be used to calculate the average number of significant digits in each data block. Similar to Embodiment 1, this will not be repeated here.

[0204] S303. Based on the average effective bit value and the average storage bit width, dynamically shift the remainder of each data in the data block after compression to obtain the original remainder of each data in the data block.

[0205] During the data compression process, the average storage width (db) occupied by the remainder of each data block within the data block is pre-stored in the computer's storage unit.

[0206] The average storage bit width (db) can be represented as the average storage bit width occupied by the remainder of each data item after compression and storage in a data block. It is determined by the preset compression rate and the proportion of effective bits in the data within the block.

[0207] Specifically,

[0208] The average storage bit width (dB) can be calculated using the following method:

[0209] Get the storage bit width occupied by each data in the data block when it is not compressed, and the storage bit width occupied by the effective bit portion of each data in the data block;

[0210] Multiply the storage width occupied by each data point in the data block when it is uncompressed by the preset compression rate, and subtract the storage width occupied by the effective bits of each data point in the data block to obtain the average storage width occupied by the remainder of each data point in the data block.

[0211] The method for calculating the average storage bit width (db) corresponds to the way data is compressed; please refer to Example 1, which will not be described again here.

[0212] Based on the average effective bit value and the average storage bit width, the dynamic shift bit width of the remainder portion of each data in the data block after compression is calculated, and the dynamic shift bit width is used to dynamically shift the remainder portion of each data in the data block to obtain the original remainder portion of each data in the data block.

[0213] It should be noted that during the decompression process, multiple data blocks are also processed and decompressed in parallel, thereby improving the decompression efficiency.

[0214] The specific method for obtaining the original remainder of each data within a data block will be described in detail in Example 5. Please refer to Example 5.

[0215] In the above embodiments of this application, by acquiring the data to be decompressed, wherein the acquired data to be compressed includes the number of significant bits corresponding to each data in the data block stored during the compression process, the average storage bit width occupied by the remainder portion of each data in the data block, and the remainder portion of each data in the data block after compression, and calculating the average number of significant bits of the data in the data block based on the number of significant bits corresponding to each data in the data block, and finally performing dynamic shift processing on the remainder portion of each data in the data block based on the average number of significant bits and the average storage bit width, the original remainder portion of each data in the data block is obtained. The method of this embodiment can quickly restore the compressed data to the original data.

[0216] Optionally, based on the above-described embodiment four, the following, in conjunction with Figure 4 The embodiment shown describes the specific process of dynamically shifting the remainder portion of each data in the data block after compression based on the average effective bit value and the average storage bit width in step S103 above to obtain the original remainder portion of each data in the data block.

[0217] Figure 4 This is a flowchart illustrating another data decompression method provided in Embodiment 5 of this application, as shown below. Figure 4 As shown, the method includes the following steps:

[0218] S401. Calculate the dynamic shift width of the remainder portion of each data in the data block after compression, based on the average effective bit value and the average storage bit width.

[0219] S402. Shift the remainder portion of each data in the data block after compression to the corresponding dynamic shift bit width to obtain the original remainder portion of each data in the data block.

[0220] Specifically,

[0221] The original remainder of each data point within the data block can be obtained using the following formula:

[0222] D′ [i] =shift(M n [i],db-avg_E)

[0223] Among them, D′ [i] This represents the original remainder of the i-th data within the data block.

[0224] Mn [i] represents the remainder dat after compression of the i-th data in the data block; db-avg_E represents the dynamic shift bit width shift_bit of the remainder after compression of the i-th data in the data block; avg_E represents the average number of effective bits; and db represents the average storage bit width.

[0225] Among them, sat_shift(dat, shift_bit) shifts the remainder of each data in the data block after compression by shift_bit to restore the original data.

[0226] It should be noted that,

[0227] If the calculated dynamic shift bit width is less than 0, then the remainder of each data in the data block after compression is shifted to the left by the calculated dynamic shift bit width.

[0228] Alternatively, if the calculated dynamic shift bit width is greater than 0, the remainder of each data block after compression is shifted to the right by the calculated dynamic shift bit width.

[0229] In the above embodiments of this application, the dynamic shift width of the remainder portion of each data in the data block after compression is calculated based on the average effective bit value and the average storage bit width, and the remainder portion of each data in the data block after compression is shifted to the corresponding dynamic shift width to obtain the original remainder portion of each data in the data block, thereby quickly restoring the compressed data to the original data.

[0230] Optionally, to facilitate understanding of the methods in Embodiments 4 and 5, the data decompression method will be described in detail below through a specific Embodiment 6.

[0231] In this embodiment, the method for calculating the average number of significant bits in the data block and the average storage width (db) occupied by the remainder of each data item in the data block is as shown in Embodiment 3, and will not be repeated here. The average number of significant bits is 16, and the average storage width (db) is 5 bits.

[0232] According to the description in Example 5, the original remainder portion of each data in the data block can be obtained.

[0233] For example, the decompression process is illustrated using data from serial number 0 in Table 6:

[0234] As shown in step 401 of Embodiment 5, the dynamic shift bit width of the remainder portion of each data in the data block after compression is calculated based on the average effective bit value and the average storage bit width:

[0235] db-avg_E = 5 - 16 = -11

[0236] As shown in step 402 of Embodiment 5, the remainder portion of each data in the data block after compression is shifted by the corresponding dynamic shift bit width to obtain the original remainder portion of each data in the data block.

[0237] Since the dynamic shift bit width -11 is less than 0, it is shifted left by 11 bits.

[0238] Specifically,

[0239] The remainder of the compressed data is "1001101". Shifting it left by 11 bits, it becomes "100110100000000000". Since the storage width of the data before compression was 32 bits, and it is currently 18 bits, the missing 14 bits are padded. Because the highest bit of "100110100000000000" is "1" after shifting left by 11 bits, the padded number is "1". Therefore, the original remainder of the decompressed data is "11111111111111100110100000000000". Converting it to hexadecimal, it becomes "fffe6800".

[0240] Accordingly, the remaining data in Table 6 is decompressed as described above. Examples will not be provided here. After decompression, the data in Table 6 is shown in Table 7.

[0241] Table 7

[0242] 0 0×fffe6800 0 1 0×a800 0×8000 2 0xffffb000 0×6000 3 0×8800 0xffff8000

[0243] This embodiment is a specific exemplary description based on the steps shown in Embodiments 4 and 5 above. The technical effects achieved are similar, and will not be described again.

[0244] This application also provides a data compression and storage method, which can be applied to any data block (such as the data block obtained in the above embodiments), that is, the data block may include at least two data to be compressed. The method may specifically include:

[0245] For any data to be compressed, it can be compressed and stored as a data combination; wherein, the data combination includes a significant bit unit and a remainder unit. That is, when compressing the aforementioned data to be compressed, it can be compressed and stored as a data combination consisting of two parts, namely, a significant bit unit (part) and a remainder unit (part). Correspondingly, when decompressing the compressed data stored using the above data combination, this data combination can be decompressed as a block.

[0246] Specifically, the effective bits of the data to be compressed can be obtained first, and then stored in a non-fixed-length format (i.e., a variable-length format) to ensure that the effective bits are fully preserved. The remainder of the data to be compressed can be obtained and stored based on the relevant technical content of the data compression method in this embodiment. That is, the remainder obtained after compressing different data may not have a fixed bit width, thereby achieving a specific compression ratio while achieving greater data compression and storage with minimal performance loss.

[0247] This application also provides a data decompression method, which can be applied to compressed data of data combinations obtained by any of the methods in this application. In this method, the compressed data of the data combinations can be decompressed as a block. Specifically, the corresponding valid bit portion can be restored from the compressed data first, and the number of valid bits of the compressed data can be obtained. Then, based on the number of valid bits, the remainder portion of the compressed data can be obtained using any of the data decompression methods in this application. Finally, the decompressed data corresponding to the compressed data can be obtained based on the valid bit portion and the remainder portion.

[0248] It should be noted that since the embodiments of this application use lossy compression, the decompressed data obtained may differ from the original compressed data to some extent, as long as the loss of information is within an acceptable range.

[0249] Figure 5 This is a schematic diagram of the structure of a data compression device provided in Embodiment 7 of this application, as shown below. Figure 5 As shown, the device includes: an acquisition module 501, a calculation module 502, and a dynamic shift processing module 503.

[0250] Module 501 is used to acquire the data block to be compressed;

[0251] Calculation module 502 is used to calculate the average number of significant bits of each data in the data block;

[0252] The calculation module 502 is also used to calculate and store the average storage bit width occupied by the remainder of each data in the compressed data block according to the preset compression ratio;

[0253] The dynamic shift processing module 503 is used to perform dynamic shift processing on the original remainder part of each data in the data block according to the average effective bit value and the average storage bit width, so as to obtain the compressed remainder part of each data in the data block.

[0254] The data compression device provided in this embodiment is used to execute the aforementioned data compression (storage) method, and its technical effects are similar, so it will not be described again.

[0255] Figure 6This is a schematic diagram of the structure of a data decompression device provided in Embodiment 8 of this application, as shown below. Figure 6 As shown, the device includes: an acquisition module 601, a calculation module 602, and a dynamic shift processing module 603.

[0256] The acquisition module 601 is used to acquire the data to be decompressed. The data includes the number of significant bits corresponding to each data in the data block stored during the compression process, the average storage bit width occupied by the remainder of each data in the data block, and the remainder of each data in the data block after compression.

[0257] The calculation module 602 is used to calculate the average number of significant bits in the data block based on the number of significant bits corresponding to each data in the data block.

[0258] The dynamic shift processing module 603 is used to perform dynamic shift processing on the remainder part of each data after compression within the data block based on the average effective bit value and the average storage bit width, so as to obtain the original remainder part of each data within the data block.

[0259] The data decompression apparatus provided in this embodiment is used to execute the aforementioned data decompression method embodiment, and its technical effects are similar, so it will not be described again.

[0260] Figure 7 This is a schematic diagram of a data compression device provided in Embodiment 9 of this application. This data compression device can be, for example, the computer described above. Figure 7 As shown, the electronic device may include: a receiver 7011, a transmitter 7012, at least one processor 701, and a memory 702.

[0261] Both the receiver 7011 and the transmitter 7012 are coupled to the processor 701. The processor 701 controls the receiving operation of the receiver 7011 and the transmitting operation of the transmitter 7012.

[0262] The memory 702 is used to store programs. Specifically, the program may include program code, which includes computer operation instructions.

[0263] The memory 702 may include high-speed RAM memory, and may also include non-volatile memory, such as at least one disk storage device.

[0264] The processor 701 is used to execute computer execution instructions stored in the memory 702 to implement the communication method described in the foregoing method embodiments. The processor 701 may be a central processing unit (CPU), an application-specific integrated circuit (ASIC), or one or more integrated circuits configured to implement the embodiments of this application.

[0265] Optionally, the electronic device 700 may also include a communication interface 703. In specific implementations, if the communication interface 703, memory 702, and processor 701 are implemented independently, they can be interconnected via a bus to complete communication. The bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. Buses can be categorized as address buses, data buses, control buses, etc., but this does not imply that there is only one bus or one type of bus.

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

[0267] Figure 8 This is a schematic diagram of a data decompression device provided in Embodiment 10 of this application. This data decompression device can be, for example, the computer described above. Figure 8 As shown, the data decompression device may include: a receiver 8011, a transmitter 8012, at least one processor 801, and a memory 802.

[0268] Both the receiver 8011 and the transmitter 8012 are coupled to the processor 801. The processor 801 controls the receiving operation of the receiver 8011 and the transmitting operation of the transmitter 8012.

[0269] The memory 802 is used to store programs. Specifically, the program may include program code, which includes computer operation instructions.

[0270] The memory 802 may include high-speed RAM memory, and may also include non-volatile memory, such as at least one disk storage device.

[0271] The processor 801 is used to execute computer execution instructions stored in the memory 802 to implement the communication method described in the foregoing method embodiments. The processor 801 may be a central processing unit (CPU), an application-specific integrated circuit (ASIC), or one or more integrated circuits configured to implement the embodiments of this application.

[0272] Optionally, the electronic device 800 may also include a communication interface 803. In specific implementations, if the communication interface 803, memory 802, and processor 801 are implemented independently, they can be interconnected via a bus to complete communication. The bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. Buses can be categorized as address buses, data buses, control buses, etc., but this does not imply that there is only one bus or one type of bus.

[0273] Optionally, in a specific implementation, if the communication interface 803, memory 802, and processor 801 are integrated on a single chip, then the communication interface 803, memory 802, and processor 801 can communicate through an internal interface.

[0274] This application also provides a computer-readable storage medium, which may include various media capable of storing program code, such as a USB flash drive, a portable hard drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk. Specifically, the computer-readable storage medium stores program instructions, which are used for the data compression or data decompression methods described in the above embodiments.

[0275] This application also provides a program product including executable instructions stored in a readable storage medium. At least one processor of an electronic device can read the executable instructions from the readable storage medium, and the at least one processor executes the executable instructions to cause the electronic device to implement the data compression or decompression methods provided in the various embodiments described above.

[0276] Figure 9 A comparison chart of the velocity dimension obtained after processing FMCW radar data using the compression method described in this application embodiment; Figure 10 This is a comparison chart of the velocity dimension obtained after processing FMCW radar data using the compression method described in this application embodiment. Figure 9 and Figure 10 As can be seen from the comparison before and after compression of the velocity dimension data obtained after processing FMCW radar data using the data compression method in this embodiment, this embodiment can achieve near-desired data storage results using fewer storage units (see [link to relevant documentation]). Figure 9 As shown), the signal-to-weight ratio changes very little before and after compression (see [reference]). Figure 10 As shown in the figure, the signal data is well preserved with minimal performance loss.

[0277] It should be noted that the data within a block in this application embodiment is not limited to groups of four; it can also be grouped into groups of eight, sixteen, or thirty-two, etc. Furthermore, the type of compressed data is not limited to FMCW radar data; other types of data can also achieve the same compression and decompression effects. In addition, to avoid redundancy, identical or similar technical content between embodiments of this application is not repeated. That is, the technical content between embodiments of this application can be integrated and supported by each other without contradiction, so that the technical details in each embodiment can be fully understood by those skilled in the art.

[0278] Other embodiments of this application will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of this application that follow the general principles of this application and include common knowledge or customary techniques in the art not disclosed herein. The specification and examples are to be considered exemplary only, and the true scope and spirit of this application are indicated by the following claims.

[0279] It should be understood that this application is not limited to the precise structure described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of this application is limited only by the appended claims.

Claims

1. A data compression method, characterized in that, include: Obtain the data block to be compressed; Calculate the average number of significant bits for each data item within the data block; Based on a preset compression ratio, calculate and store the average storage bit width occupied by the remainder portion of each data in the compressed data block; Based on the average effective bit value and the average storage bit width, the original remainder portion of each data in the data block is dynamically shifted to obtain the compressed remainder portion of each data in the data block.

2. The method according to claim 1, characterized in that, The process of obtaining the data block to be compressed includes: Obtain the data to be compressed; The data to be compressed is divided into blocks to obtain multiple data blocks to be compressed. For any of the data blocks to be compressed, determine and store the effective number of bits corresponding to each data in the data block to be compressed.

3. The method according to claim 2, characterized in that, The dynamic shifting process for the original remainder portion of each data within the data block includes: The data blocks obtained by segmentation are processed in parallel to dynamically shift the original remainder of each data in each data block.

4. The method according to claim 2, characterized in that, The step of dynamically shifting the original remainder portion of each data within the data block based on the average effective bit value and the average storage bit width to obtain the compressed remainder portion of each data within the data block includes: Based on the average effective bit value and the average storage bit width, calculate the dynamic shift bit width of the original remainder portion of each data in the data block; Based on the number of significant bits corresponding to each data in the data block, the average number of significant bits, and the average storage bit width, calculate the dynamic truncation bit width of the original remainder portion of each data in the data block; The original remainder portion of each data in the data block is shifted to the corresponding dynamic shift bit width, and the highest bit is taken to the corresponding dynamic truncation bit width to obtain the compressed remainder portion of each data in the data block.

5. The method according to claim 4, characterized in that, The step of shifting the original remainder portion of each data in the data block by the corresponding dynamic shift bit width, and taking the highest bit as the corresponding dynamic truncation bit width, to obtain the compressed remainder portion of each data in the data block includes: The remainder of each data point within the data block after compression is obtained using the following formula: in, The remainder after compressing the i-th data within the data block; It is the original remainder of the i-th data within the data block; The dynamic shift bit width is the original remainder portion of the i-th data within the data block; The average number of significant bits; The average storage bit width; The dynamic truncation bit width for the original remainder portion of each data within the data block; The effective number of bits corresponding to the i-th data in the data block.

6. The method according to claim 5, characterized in that, If the calculated dynamic shift width is less than 0, then the original remainder portion of each data in the data block is shifted to the left by the dynamic shift width. Alternatively, if the calculated dynamic shift bit width is greater than 0, the original remainder portion of each data in the data block is shifted to the right by the dynamic shift bit width.

7. The method according to claim 1, characterized in that, The step of calculating and storing the average storage bit width occupied by the remainder portion of each data in the compressed data block according to a preset compression ratio includes: Obtain the storage bit width occupied by each data in the data block when it is uncompressed and the storage bit width occupied by the effective bit portion of each data in the data block; Multiply the storage bit width occupied by each data point in the data block when it is uncompressed by the preset compression rate, and subtract the storage bit width occupied by the effective bit portion of each data point in the data block to obtain the average storage bit width occupied by the remainder portion of each data point in the data block.

8. The method according to any one of claims 2-6, characterized in that, The process of determining and storing the effective number of bits corresponding to each data point within the data block to be compressed includes: If each data in the data block is a real number, then the number of significant digits of each data in the data block that is determined and stored is the number of significant digits corresponding to the real number; Alternatively, if each data point in the data block is a complex number, then the number of significant digits for each data point in the data block that is determined and stored is the largest of the real and imaginary parts of the complex number.

9. A data decompression method, characterized in that, include: Obtain the data to be decompressed, the data including the effective number of bits corresponding to each data in the data block stored during the compression process, the average storage bit width occupied by the remainder of each data in the data block, and the remainder of each data in the data block after compression; Calculate the average number of significant bits in the data block based on the number of significant bits corresponding to each data point in the data block. Based on the average effective bit value and the average storage bit width, the remainder portion of each data in the data block after compression is dynamically shifted to obtain the original remainder portion of each data in the data block.

10. The method according to claim 9, characterized in that, The step of dynamically shifting the remainder portion of each data in the data block after compression based on the average effective bit value and the average storage bit width to obtain the original remainder portion of each data in the data block includes: Based on the average effective bit value and the average storage bit width, calculate the dynamic shift bit width of the remainder portion of each data in the data block after compression; The remainder portion of each data in the data block after compression is shifted by the corresponding dynamic shift bit width to obtain the original remainder portion of each data in the data block.

11. The method according to claim 10, characterized in that, The step of shifting the remainder portion of each data item in the data block after compression by the corresponding dynamic shift bit width to obtain the original remainder portion of each data item in the data block includes: The original remainder portion of each data point within the data block is obtained using the following formula: in, It is the original remainder of the i-th data within the data block; The remainder after compressing the i-th data within the data block; The dynamic shift bit width is the remainder portion of the compressed data within the data block. The average number of significant bits; The average storage bit width is denoted as .

12. The method according to claim 11, characterized in that, If the calculated dynamic shift width is less than 0, then the remainder of each data in the data block after compression is shifted to the left by the dynamic shift width. Alternatively, if the calculated dynamic shift bit width is greater than 0, then the remainder portion of each compressed data in the data block is shifted to the right by the dynamic shift bit width.

13. The method according to claim 9, characterized in that, The data also includes the storage bit width occupied by each piece of data in the data block when it is not compressed during the compression process, and the storage bit width occupied by the effective bit portion of each piece of data in the data block; The average storage bit width occupied by the remainder portion of each data within the data block is calculated based on a preset compression ratio, including: Multiply the storage bit width occupied by each data point in the data block when it is uncompressed by the preset compression rate, and subtract the storage bit width occupied by the effective bit portion of each data point in the data block to obtain the average storage bit width occupied by the remainder portion of each data point in the data block.

14. The method according to any one of claims 9-12, characterized in that, The number of significant bits corresponding to each data point within the data block includes: If each data point in the data block is a real number, then the number of significant digits in each data point in the data block is the number of significant digits corresponding to the real number. Alternatively, if each data point in the data block is a complex number, then the number of significant digits for each data point in the data block is the largest of the real and imaginary parts of the complex number.

15. A method for data compression and storage, characterized in that, Applied to any data block, the data block comprising at least two pieces of data to be compressed, the method includes: For any of the data to be compressed, compress and store the data as a combination of compressed data; The data combination includes a significant number of digits unit and a remainder unit; The remainder portion of the data to be compressed is obtained using the data compression method described in any one of claims 1-8; The remainder portion is stored in the remainder unit.

16. The method according to claim 15, characterized in that, The method further includes: Obtain the valid bit portion of the data to be compressed; Specifically, the valid bit portion is fully preserved and stored in the valid number unit in a variable-length format.

17. A method for data decompression, characterized in that, Compressed data applied to a combination of data obtained using the method described in claim 15 or 16, the method comprising: The corresponding valid bit portion is restored from the compressed data, and the number of valid bits in the compressed data is obtained; Based on the effective number of bits, the remainder portion of the compressed data is obtained using the data decompression method according to any one of claims 9-14; and Based on the valid bit portion and the remainder portion, decompressed data corresponding to the compressed data is obtained.

18. A data compression device, characterized in that, include: The acquisition module is used to acquire the data blocks to be compressed; The calculation module is used to calculate the average number of significant bits of each data within the data block; The calculation module is also used to calculate and store the average storage bit width occupied by the remainder of each data in the compressed data block according to the preset compression ratio. The dynamic shift processing module is used to perform dynamic shift processing on the original remainder portion of each data in the data block according to the average effective bit value and the average storage bit width, so as to obtain the compressed remainder portion of each data in the data block.

19. A data decompression apparatus, characterized in that, include: The acquisition module is used to acquire the data to be decompressed. The data includes the effective number of bits corresponding to each data in the data block stored during the compression process, the average storage bit width occupied by the remainder of each data in the data block, and the remainder of each data in the data block after compression. The calculation module is used to calculate the average number of significant bits in the data block based on the number of significant bits corresponding to each data point in the data block. The dynamic shift processing module is used to perform dynamic shift processing on the remainder portion of each data in the data block after compression, based on the average effective bit value and the average storage bit width, to obtain the original remainder portion of each data in the data block.

20. A data compression device, characterized in that, include: At least one processor, memory, receiver, and transmitter; Both the receiver and the transmitter are coupled to the processor; The processor controls the receiving action of the receiver, and the processor controls the transmitting action of the transmitter; The memory stores computer-executed instructions; The at least one processor executes computer execution instructions stored in the memory, causing the data compression device to perform the method according to any one of claims 1-8, 15-16.

21. A data decompression device, characterized in that, include: At least one processor, memory, receiver, and transmitter; Both the receiver and the transmitter are coupled to the processor; The processor controls the receiving action of the receiver, and the processor controls the transmitting action of the transmitter; The memory stores computer-executed instructions; The at least one processor executes computer execution instructions stored in the memory, causing the data decompression device to perform the method according to any one of claims 9-14, 17.

Citation Information

Patent Citations

  • Gray scale data transmission controller, transmission control system and transmission method

    CN113012635A