Data compression method, device, electronic device and storage medium
By obtaining the amount of data to be compressed and the data compression parameters under the HARQ mechanism, determining the actual compression bit width and performing data compression, the problem of large data storage space under HARQ is solved, and the data compression effect is achieved that reduces hardware costs and does not affect decoding performance.
Patent Information
- Application Number
- CN202411848425.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-16
- Publication Date
- 2025-04-11
- Estimated Expiration
- 2044-12-16
AI Technical Summary
Under the hybrid automatic retransmission mechanism (HARQ), the storage space required for data retransmission is large, resulting in an increase in hardware costs.
By obtaining the amount of data to be compressed and the data compression parameters, the actual compressed bit width is determined, and the data to be compressed is compressed according to the bit width to reduce the storage space usage.
It effectively reduces the amount of data in storage space, reduces hardware costs, and realizes data compression without affecting decoding performance.
Smart Images

Figure CN119300086B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of wireless communication technology, and in particular to a data compression method, device, electronic device and storage medium. Background Art
[0002] In the wireless communication process of New Radio (NR) or Long Term Evolution (LTE), the Hybrid Automatic Repeat reQuest (HARQ) mechanism is usually introduced to ensure the accuracy of data. The working principle of HARQ is that when the receiving end receives a code block, it needs to decode it and determine whether the decoding is successful. If the decoding fails, the sending end needs to retransmit it until the receiving end decodes it successfully.
[0003] In the related art, since each retransmitted data needs to be stored under the HARQ mechanism, it is easy to cause the problem of large storage space occupied by the data. Therefore, how to compress the data to reduce the storage space occupied by the data has become a technical problem that needs to be solved urgently. Summary of the invention
[0004] The present application provides a data compression method, device, electronic device and storage medium to solve the problem of large data storage space required by the HARQ mechanism in the related art.
[0005] In a first aspect, an embodiment of the present application provides a data compression method, the method comprising:
[0006] Acquire the amount of data to be compressed and data compression parameters, wherein the amount of data to be compressed is the amount of data retransmitted each time under the hybrid automatic retransmission mechanism, and the data compression parameters are determined based on current hardware conditions;
[0007] Determining an actual compression bit width corresponding to the amount of data to be compressed based on the amount of data to be compressed and the data compression parameter;
[0008] The data to be compressed is compressed according to the actual compression bit width.
[0009] Optionally, the data compression parameters include expected compression bit width, single-transfer data volume and hardware effective bit width;
[0010] The determining, based on the amount of data to be compressed and the data compression parameter, an actual compression bit width corresponding to the amount of data to be compressed includes:
[0011] Determine and obtain a first intermediate parameter based on the amount of data to be compressed and the amount of data transferred at a single time;
[0012] Based on the expected compression bit width, determining and obtaining a second intermediate parameter;
[0013] The actual compression bit width is determined based on the first intermediate parameter, the second intermediate parameter, the expected compression bit width, and the hardware effective bit width.
[0014] Optionally, the determining a first intermediate parameter based on the amount of data to be compressed and the amount of data transferred at a single time includes:
[0015] According to the formula calculate;
[0016] in, represents the first intermediate parameter, represents the amount of data to be compressed, Indicates the amount of data transferred in a single time.
[0017] Optionally, the determining a second intermediate parameter based on the expected compression bit width includes:
[0018] According to the formula calculate;
[0019] in, represents the second intermediate parameter, Indicates the desired compression bit width.
[0020] Optionally, the determining the actual compression bit width based on the first intermediate parameter, the second intermediate parameter, the expected compression bit width and the hardware effective bit width includes:
[0021] According to the formula calculate;
[0022] in, represents the actual compressed bit width, represents the first intermediate parameter, represents the second intermediate parameter, represents the desired compression bit width, Indicates the effective bit width of the hardware.
[0023] Optionally, compressing the data to be compressed according to the actual compression bit width includes:
[0024] Determining a target bit width and a target value of the data to be compressed after compression according to the hardware effective bit width and the actual compression bit width, wherein the data to be compressed are both floating point numbers before and after compression;
[0025] Convert the target value from a floating point number to a fixed point number to obtain a fixed point number corresponding to the target bit width;
[0026] The fixed-point number corresponding to the target bit width is stored.
[0027] Optionally, determining a target bit width and a target value of the data to be compressed after compression according to the hardware effective bit width and the actual compression bit width includes:
[0028] According to the formula ;and
[0029] calculate;
[0030] in, represents the target bit width, represents the target value, Indicates the effective bit width of the hardware, represents the actual compressed bit width, represents the ceiling function, Indicates the data to be compressed.
[0031] In a second aspect, an embodiment of the present application further provides a data compression device, the device comprising:
[0032] An acquisition module, used to acquire the amount of data to be compressed and data compression parameters, wherein the amount of data to be compressed is the amount of data retransmitted each time under the hybrid automatic retransmission mechanism, and the data compression parameters are determined based on current hardware conditions;
[0033] A determination module, configured to determine an actual compression bit width corresponding to the amount of data to be compressed based on the amount of data to be compressed and the data compression parameter;
[0034] A compression module is used to compress the data to be compressed according to the actual compression bit width.
[0035] In a third aspect, an embodiment of the present application further provides an electronic device, including a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other via the communication bus;
[0036] Memory, used to store computer programs;
[0037] The processor is used to implement the data compression method described in the first aspect when executing the program stored in the memory.
[0038] In a fourth aspect, an embodiment of the present application further provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the data compression method as described in the first aspect.
[0039] The above technical solution provided by the embodiment of the present application has the following advantages over the prior art: the method provided by the embodiment of the present application, by obtaining the amount of data to be compressed and the data compression parameter, wherein the amount of data to be compressed is the amount of data retransmitted each time under the hybrid automatic retransmission mechanism, and the data compression parameter is determined based on the current hardware conditions; based on the amount of data to be compressed and the data compression parameter, the actual compression bit width corresponding to the amount of data to be compressed is determined; according to the actual compression bit width, the data to be compressed is compressed. In the above manner, the amount of data retransmitted each time under the hybrid automatic retransmission mechanism can be compressed based on the amount of data retransmitted each time under the hybrid automatic retransmission mechanism and the data compression parameter supported under the current hardware conditions, thereby reducing the storage space occupied by the data and achieving the purpose of reducing hardware costs. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0041] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0042] Figure 1 A flowchart of a data compression method provided in an embodiment of the present application;
[0043] Figure 2 A schematic diagram of the structure of a data compression device provided in an embodiment of the present application;
[0044] Figure 3 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0045] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of this application.
[0046] See also Figure 1 , Figure 1 A flow chart of a data compression method provided in an embodiment of the present application. Figure 1 As shown, the data compression method may include the following steps:
[0047] Step S102: Obtain the amount of data to be compressed and data compression parameters, wherein the amount of data to be compressed is the amount of data retransmitted each time under the hybrid automatic retransmission mechanism, and the data compression parameters are determined based on current hardware conditions.
[0048] Specifically, the above-mentioned data to be compressed is the amount of data retransmitted each time under the hybrid automatic repeat mechanism HARQ, that is, the number of LLR data retransmitted each time under the hybrid automatic repeat mechanism HARQ. The reason why it is necessary to consider compressing the data retransmitted each time under the hybrid automatic repeat mechanism HARQ is that the automatic repeat mechanism HARQ occupies a very large amount of memory space. Taking LTE as an example, the maximum length of a transport block (Transport Block, referred to as TB) under single-layer transmission is 137792 bits, while the length of a transport block TB under four-layer transmission can reach 502624 bits, and each bit in each transport block Tb can correspond to a log-likelihood ratio (Log-Likelihood Ratio, referred to as LLR). When the hardware represents an LLR through 8 bits, about 1MB of storage space is required when storing data for the next transport block TB under single-layer transmission, and about 3.8MB of storage space is required when storing data for the next transport block TB under four-layer transmission. Moreover, compared with LTE, NR has a larger amount of transmitted data, and a transmission block TB can theoretically have no upper limit, so the required storage space is larger. It can be seen that when performing hybrid automatic retransmission mechanism HARQ under LTE or NR, a large amount of storage space is required, which not only affects the area required for hardware, but also reduces the access rate and throughput of the memory.
[0049] The above-mentioned data compression parameters may include, but are not limited to, parameters such as the expected compression bit width, the amount of data transferred at a time, and the effective bit width of the hardware. Among them, the effective bit width of the hardware here refers to the hardware bit width used by the hardware to represent data in fixed-point mode, and the effective bit width of the hardware is determined based on the hardware's own properties, such as the type and rules of the hardware. Since the left bit of binary fixed-point data is the highest bit in the hardware, it generally represents the positive and negative signs of the data, so the bit width of the actual data is equal to the effective bit width of the hardware minus one bit width. The expected compression bit width here refers to the bit width size expected to be compressed under the effective bit width of the hardware. This value can be selected according to the actual design needs of the hardware. It needs to be selected and determined in the early stage of the hardware design. Once the hardware design is completed, it cannot be changed. The amount of data transferred at a time here refers to the amount of data that the hardware can transfer each time when performing an operation. This value is determined by the working characteristics of the hardware.
[0050] Step S104: Determine the actual compression bit width corresponding to the amount of data to be compressed based on the amount of data to be compressed and the data compression parameters.
[0051] Since the core of the compression scheme is to perform division operations on the compressed data, here we take the floating-point data llr_a=0.1234 as an example. If it is represented by an 8-bit fixed-point number (that is, the hardware effective bit width is 8 bits), where the highest bit of the data is the first bit on the left, which represents the sign of the data, then according to the conversion relationship from floating-point numbers to fixed-point numbers, we can get: ,in, Represents a binary number. According to the conversion relationship between fixed-point numbers and floating-point numbers, we can get: . Comparing the two floating-point numbers 0.1234 and 0.1172, we can see that in the current hardware fixed-point representation format, the data loss introduced by the change in precision is 0.1234-0.1172=0.0062. In theory, only the fixed-point representation with infinite bit width can achieve zero drop in floating-point precision. In other words, under any fixed hardware effective bit width, different representable data precisions are determined, so any floating-point LLR will always introduce different precision losses in actual hardware calculations.
[0052] According to experience, when LLR data is decoded, although high-precision floating-point numbers are helpful for decoding performance, as the effective bit width of the hardware continues to increase, the improvement in decoding performance brought about by the increase in precision will become smaller and smaller. Because LLR data is decoded using the forward error correction code (Forward Error Correction, referred to as FEC) algorithm, and the greatest impact of forward error correction comes from the sign bit, the larger the effective bit width of the hardware, the more precision bits after the decimal point can be represented, which is helpful for the decoding algorithm itself. However, as the effective bit width of the hardware reaches a certain threshold value, the change in the superposition of positive and negative values brought about by the increase in precision is very small, so the improvement in decoding performance brought about at this time is getting smaller and smaller. Therefore, as long as the bit width threshold value can be determined and the data is compressed to the bit width threshold value, the storage space occupied by the data can be reduced without affecting the decoding performance.
[0053] In this step, after obtaining the amount of data to be compressed and the data compression parameters, the actual compression bit width can be determined based on the amount of data to be compressed and the data compression parameters without affecting the decoding performance and satisfying the expected compression ratio, and then the above-mentioned bit width threshold value can be determined based on the hardware effective bit width and the actual compression bit width, that is, the above-mentioned bit width threshold value is equal to the hardware effective bit width minus the actual compression bit width.
[0054] Step S106: compress the data to be compressed according to the actual compression bit width.
[0055] After the actual compression bit width is obtained, the data to be compressed may be compressed based on the actual compression bit width, so that the bit width of the data to be compressed is reduced.
[0056] Through the above method, the amount of data retransmitted each time under the hybrid automatic retransmission mechanism can be compressed based on the amount of data retransmitted each time under the hybrid automatic retransmission mechanism and the data compression parameters supported under the current hardware conditions, thereby reducing the storage space occupied by the data and achieving the purpose of reducing hardware costs.
[0057] In an optional embodiment, the data compression parameters include the expected compression bit width, the amount of data transferred at a single time, and the effective bit width of the hardware; the above step 102, based on the amount of data to be compressed and the data compression parameters, determines the actual compression bit width corresponding to the amount of data to be compressed, including:
[0058] Determine and obtain a first intermediate parameter based on the amount of data to be compressed and the amount of data transferred at a single time;
[0059] Based on the expected compression bit width, determining a second intermediate parameter;
[0060] Based on the first intermediate parameter, the second intermediate parameter, the expected compression bit width and the hardware effective bit width, the actual compression bit width is determined.
[0061] Specifically, when determining the actual compression bit width based on the amount of data to be compressed and the data compression parameter, the first intermediate parameter for characterizing the amount of compressed data that is allowed to be carried out in a single time without affecting the decoding performance can be determined based on the amount of data to be compressed and the amount of data to be carried out in a single time, and the second intermediate parameter for characterizing the actual data bit width for a single time under the condition of satisfying the expected compression bit width can be determined based on the expected compression bit width, and then the actual compression bit width can be determined based on the first intermediate parameter, the second intermediate parameter, the expected compression bit width and the hardware effective bit width, so that the compressed data can be compressed based on the actual compression bit width, and the size of the storage space occupied by the data can be effectively reduced without affecting the decoding performance. It should be noted that the first intermediate parameter here can be used to characterize the size of the amount of compressed data that is allowed to be carried out in a single time without affecting the decoding performance; the second intermediate parameter here can be used to characterize the actual data bit width for a single time under the condition of satisfying the expected compression bit width; the actual compression bit width here is used to characterize the compression bit width actually required without affecting the decoding performance and satisfying the expected compression ratio. Among them, when determining the first intermediate parameter, the root mean square calculation can be performed based on the amount of data to be compressed and the amount of data transported in a single time, so that the amount of data to be compressed can ensure that the compressed data is still continuous when the data is transported according to the amount of data transported in a single time, thereby ensuring that the compressed data retains the characteristics of the Markov chain, and can use the characteristics of the Markov chain to decode the data, thereby ensuring that data compression is achieved without affecting the decoding performance. It should be noted that since the common combination of the data to be compressed (such as LLR, etc.) itself is an integer plus a decimal part, the integer part determines the positive and negative direction of the data in most cases, and the decimal part determines the superposition influence of the Markov chain when adjusting during decoding, only when the Markov chain between the data is established can the Markov chain be used to decode the data. Of course, other methods can also be used to calculate the first intermediate parameter, and the embodiments of the present application are not specifically limited.
[0062] When determining the second intermediate parameter, it can be calculated based on the expected compression bit width. Specifically, To calculate, where Indicates the expected compression bit width. In this way, the data bit width that the hardware allows to be transferred in a single time under the condition of meeting the expected compression bit width can be calculated.
[0063] In the above manner, the actual compression bit width can be accurately determined based on the amount of data to be compressed and the data compression parameters without affecting the decoding performance and satisfying the expected compression ratio.
[0064] In an optional embodiment, the above step of determining the first intermediate parameter based on the amount of data to be compressed and the amount of data transferred at a single time includes:
[0065] According to the formula calculate;
[0066] in, represents the first intermediate parameter, represents the amount of data to be compressed, Indicates the amount of data transferred in a single time.
[0067] For example, assuming that the number of LLRs in a retransmission under the hybrid automatic repeat mechanism is 50, and each LLR is represented by 8 bits, then the amount of data to be compressed LLR_combine for this retransmission is 400 bits. Assuming that the current hardware processes a total of 8 LLRs in one operation (or transfer), the amount of data transferred in a single time LLR_block is 8*8=64 bits. Substituting the amount of data to be compressed LLR_combine and the amount of data transferred in a single time LLR_block into the above formula, the first intermediate parameter can be calculated. .
[0068] In this way, by performing RMS calculation on the amount of data to be compressed and the amount of data moved at a time, the amount of data to be compressed can be ensured to be continuous after compression when the data is moved at the amount of data moved at a time, thereby ensuring that the compressed data retains the characteristics of the Markov chain and can be decoded using the characteristics of the Markov chain, thereby ensuring that data compression is achieved without affecting the decoding performance.
[0069] In an optional embodiment, the above step of determining and obtaining the second intermediate parameter based on the expected compression bit width includes:
[0070] According to the formula calculate;
[0071] in, represents the second intermediate parameter, Indicates the desired compression bit width.
[0072] For example, suppose you want to compress the bit width is 4, then the second intermediate parameter .
[0073] In this way, the second intermediate parameter can be accurately determined based on the expected compression bit width, which facilitates subsequent calculations.
[0074] In an optional embodiment, the above step, based on the first intermediate parameter, the second intermediate parameter, the expected compression bit width and the hardware effective bit width, determines the actual compression bit width, including:
[0075] According to the formula calculate;
[0076] in, represents the actual compressed bit width, represents the first intermediate parameter, represents the second intermediate parameter, represents the desired compression bit width, Indicates the effective bit width of the hardware.
[0077] According to the above formula, when determining the actual compression bit width, the third intermediate parameter can be determined based on the first intermediate parameter and the second intermediate parameter. , the third intermediate parameter can be used to characterize the compression bit width that needs to be achieved without affecting the decoding performance and satisfying the expected compression ratio. And based on the expected compression bit width and the hardware effective bit width, the fourth intermediate parameter is determined to be , the four intermediate parameters can be used to characterize the compression bit width that needs to be achieved under the condition of meeting the expected compression bit width. Then, the minimum value is taken from the two calculated compression bit widths to obtain the actual compression bit width. In this way, the actual compression bit width finally calculated can not only meet the decoding performance requirements, but also meet the requirements of the expected compression bit width, which is convenient for subsequent data compression according to the actual compression bit width.
[0078] Continuing with the above example, assuming that the amount of data to be compressed LLR_combine is 400 bits and the amount of data transferred in a single time LLR_block is 64 bits, the first intermediate parameter can be calculated ; Assuming the effective hardware bit width is 8 bits, the expected compressed bit width is The second intermediate parameter can be calculated as At this time, the first intermediate parameter and the second intermediate parameter Substitute the above formula to calculate the actual compressed bit width .
[0079] Through the above method, the actual compression bit width can be accurately calculated, which is convenient for subsequent data compression according to the actual compression bit width.
[0080] In an optional embodiment, the above step 106, compressing the data to be compressed according to the actual compression bit width, includes:
[0081] Determine the target bit width and target value of the data to be compressed after compression according to the hardware effective bit width and the actual compression bit width, wherein the data to be compressed are floating point numbers before and after compression;
[0082] Convert the target value from floating point to fixed point to obtain the corresponding fixed point number under the target bit width;
[0083] The fixed-point number corresponding to the target bit width is stored. Specifically, when compressing the data to be compressed according to the actual compression bit width, the target bit width and target value after the data to be compressed can be determined based on the hardware effective bit width and the actual compression bit width, wherein the target bit width here refers to the bit width after the data to be compressed is compressed, and the target value here refers to the value after the data to be compressed is compressed. Then the target value is converted from a floating point number to a fixed point number to obtain the fixed-point number corresponding to the target bit width, and then the fixed-point number corresponding to the target bit width is stored. In other words, the amount of data retransmitted each time under the hybrid automatic retransmission mechanism can be compressed and stored in the above manner, so that the amount of data retransmitted each time can be combined with the data stored in the last retransmission, and after the combination, coding verification is performed to determine the accuracy of the data.
[0084] In an optional embodiment, the above step of determining the target bit width and target value after compressing the data to be compressed according to the hardware effective bit width and the actual compression bit width includes:
[0085] According to the formula ;and
[0086] calculate;
[0087] in, represents the target bit width, represents the target value, Indicates the effective bit width of the hardware, represents the actual compressed bit width, represents the ceiling function, Indicates the data to be compressed.
[0088] Specifically, when determining the target bit width of the compressed data based on the hardware effective bit width and the actual compression bit width, the difference between the hardware effective bit width and the actual compression bit width can be first calculated, and then the difference is rounded up to determine the value obtained as the target bit width. The actual compression bit width block_shift is 8 bits wide. , it can be calculated 4.1635, and after rounding up the result, the final calculation result is 5. That is to say, after the LLR data originally represented by 8 bits is compressed, it needs to be represented by 5 bits.
[0089] When determining the target value of the data to be compressed based on the hardware effective bit width and the actual compression bit width, the second ratio between the actual compression bit width and the hardware effective bit width can be calculated first, and then the ratio between the data to be compressed and the second ratio can be determined as the target value. The actual compression bit width block_shift is 8 bits wide. , we can calculate block_shift / N=3.8365 / 8=0.4795625. If the data to be compressed llr_a=0.1172=b'10001111, we can divide 0.1172 by , the target value is 0.244389417. In this way, the target value can be converted from floating point to fixed point, that is, b'10000+b'(0.244389417*2 4 )=b'10011, and get the corresponding fixed-point number b'10011 under the target bit width.
[0090] Through the above method, the target bit width and target value of the compressed data can be accurately determined according to the hardware effective bit width and the actual compression bit width, so as to facilitate the subsequent representation of the compressed data according to the target bit width and target value.
[0091] In order to verify the compression performance loss of the data compression method provided in the embodiment of the present application, considering that 8 bits are often used in hardware to represent one LLR data, for different code rate ranges, LLR is compressed to 6 bits, 4 bits and 2 bits respectively, and simulation tests are performed. The final decoding performance loss is shown in the following table:
[0092]
[0093] Since different code rate ranges will determine the coding diagram of the Low-Density Parity-Check Code (LDPC) used under the 3rd Generation Partnership Project (3GPP), different coding diagrams will have different decoding performance impacts. Therefore, in order to characterize the compression effect of the present invention in different scenarios, it is necessary to cover as many different coding diagrams as possible. The coding performance loss here refers to the loss value of the block error rate (BLER) obtained by the final decoding mapped to the signal-to-noise ratio (SNR). It can be seen from the above table that the data compression method provided in the embodiment of the present application is used for data compression, and the worst SNR relationship will be 1.7 db worse than the decoding BLER without compression.
[0094] Therefore, the data compression method provided in the embodiment of the present application can achieve data compression with a small compression performance loss, reduce the demand for memory, and thus achieve the purpose of reducing hardware area and cost.
[0095] See also Figure 2 , Figure 2 This is a schematic diagram of the structure of a data compression device provided in an embodiment of the present application. Figure 2 As shown, the data compression device 200 includes:
[0096] The acquisition module 202 is used to acquire the amount of data to be compressed and the data compression parameters, wherein the amount of data to be compressed is the amount of data retransmitted each time under the hybrid automatic retransmission mechanism, and the data compression parameters are determined based on the current hardware conditions;
[0097] A determination module 204, configured to determine an actual compression bit width corresponding to the amount of data to be compressed based on the amount of data to be compressed and the data compression parameter;
[0098] The compression module 206 is used to compress the data to be compressed according to the actual compression bit width.
[0099] Furthermore, the data compression parameters include the expected compression bit width, the amount of data transferred at a single time, and the hardware effective bit width; the determination module 204 includes:
[0100] A first determination submodule, configured to determine a first intermediate parameter based on the amount of data to be compressed and the amount of data transferred at a single time;
[0101] A second determination submodule, configured to determine a second intermediate parameter based on an expected compression bit width;
[0102] The third determination submodule is used to determine the actual compression bit width based on the first intermediate parameter, the second intermediate parameter, the expected compression bit width and the hardware effective bit width.
[0103] Furthermore, the first determining submodule is specifically used for:
[0104] According to the formula calculate;
[0105] in, represents the first intermediate parameter, represents the amount of data to be compressed, Indicates the amount of data transferred in a single time.
[0106] Furthermore, the second determining submodule is specifically used for:
[0107] According to the formula calculate;
[0108] in, represents the second intermediate parameter, Indicates the desired compression bit width.
[0109] Furthermore, the third determining submodule is specifically used for:
[0110] According to the formula calculate;
[0111] in, represents the actual compressed bit width, represents the first intermediate parameter, represents the second intermediate parameter, represents the desired compression bit width, Indicates the effective bit width of the hardware.
[0112] Further, the compression module 206 includes:
[0113] The fourth determination submodule is used to determine the target bit width and target value of the data to be compressed after compression according to the hardware effective bit width and the actual compression bit width, wherein the data to be compressed are floating point numbers before and after compression;
[0114] The conversion submodule is used to convert the target value from floating point to fixed point to obtain the corresponding fixed point number under the target bit width;
[0115] The storage submodule is used to store the fixed-point numbers corresponding to the target bit width.
[0116] Furthermore, the fourth determining submodule is specifically used for:
[0117] According to the formula ;and
[0118] calculate;
[0119] in, represents the target bit width, represents the target value, Indicates the effective bit width of the hardware, represents the actual compressed bit width, represents the ceiling function, Indicates the data to be compressed.
[0120] It should be noted that the data compression device 200 can implement the steps of the data compression method provided by any of the aforementioned method embodiments and can achieve the same technical effects, which will not be described in detail here.
[0121] like Figure 3 As shown, the embodiment of the present application further provides an electronic device, including a processor 311, a communication interface 312, a memory 313 and a communication bus 314, wherein the processor 311, the communication interface 312, and the memory 313 communicate with each other through the communication bus 314.
[0122] Memory 313, used for storing computer programs;
[0123] In one embodiment of the present application, the processor 311 is used to implement the steps of the data compression method provided by any of the aforementioned method embodiments when executing the program stored in the memory 313.
[0124] The electronic device provided in the embodiment of the present application may specifically be a module capable of realizing a communication function or a terminal device including the module, etc. The terminal device may be a mobile terminal or a smart terminal. The mobile terminal may specifically be at least one of a mobile phone, a tablet computer, a laptop computer, etc.; the smart terminal may specifically be a terminal including a wireless communication module such as a smart car, a smart watch, a shared bicycle, a smart cabinet, etc.; the module may specifically be a wireless communication module, such as any one of a 2G communication module, a 3G communication module, a 4G communication module, a 5G communication module, and a NB-IOT communication module.
[0125] An embodiment of the present application also provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the steps of the data compression method provided in any of the aforementioned method embodiments are implemented.
[0126] The embodiment of the present application also provides a computer program product or a computer program, which includes a computer instruction stored in a computer-readable storage medium. The processor of the computer device reads the computer instruction from the computer-readable storage medium, and the processor executes the computer instruction, so that the computer device performs the steps of the above-mentioned data compression method.
[0127] It should be noted that, in this article, relational terms such as "first" and "second" 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.
[0128] The above description is only a specific implementation of the present application, so that those skilled in the art can understand or implement the present application. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein can be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application will not be limited to the embodiments shown herein, but will conform to the widest range consistent with the principles and novel features applied for herein.
Claims
1. A data compression method, characterized in that: The method comprises: Obtaining the amount of data to be compressed and data compression parameters, wherein the amount of data to be compressed is the amount of data retransmitted each time under the hybrid automatic retransmission mechanism, and the data compression parameters are determined based on current hardware conditions, and the data compression parameters include the expected compression bit width, the amount of data transferred at a single time, and the effective bit width of the hardware; Determining an actual compression bit width corresponding to the amount of data to be compressed based on the amount of data to be compressed and the data compression parameter; compressing the data to be compressed according to the actual compression bit width; The step of determining the actual compression bit width corresponding to the amount of data to be compressed based on the amount of data to be compressed and the data compression parameter includes: Determine and obtain a first intermediate parameter based on the amount of data to be compressed and the amount of data transferred at a single time; Based on the expected compression bit width, determining and obtaining a second intermediate parameter; The actual compression bit width is determined based on the first intermediate parameter, the second intermediate parameter, the expected compression bit width, and the hardware effective bit width.
2. The data compression method according to claim 1, characterized in that: The determining of the first intermediate parameter based on the amount of data to be compressed and the amount of data transferred at a single time includes: According to the formula calculate; in, represents the first intermediate parameter, represents the amount of data to be compressed, Indicates the amount of data transferred in a single time.
3. The data compression method according to claim 1, characterized in that: The determining and obtaining a second intermediate parameter based on the expected compression bit width includes: According to the formula calculate; in, represents the second intermediate parameter, Indicates the desired compression bit width.
4. The data compression method according to claim 1, characterized in that: The determining the actual compression bit width based on the first intermediate parameter, the second intermediate parameter, the expected compression bit width, and the hardware effective bit width includes: According to the formula calculate; in, represents the actual compressed bit width, represents the first intermediate parameter, represents the second intermediate parameter, represents the desired compression bit width, Indicates the effective bit width of the hardware.
5. The data compression method according to claim 1, characterized in that: The compressing the data to be compressed according to the actual compression bit width includes: Determining a target bit width and a target value of the data to be compressed after compression according to the hardware effective bit width and the actual compression bit width, wherein the data to be compressed are both floating point numbers before and after compression; Convert the target value from a floating point number to a fixed point number to obtain a fixed point number corresponding to the target bit width; The fixed-point number corresponding to the target bit width is stored.
6. The data compression method according to claim 5, characterized in that: The step of determining a target bit width and a target value after compressing the data to be compressed according to the hardware effective bit width and the actual compression bit width includes: According to the formula ;and calculate; in, represents the target bit width, represents the target value, Indicates the effective bit width of the hardware, represents the actual compressed bit width, represents the ceiling function, Indicates the data to be compressed.
7. A data compression device, characterized in that: The device comprises: An acquisition module is used to acquire the amount of data to be compressed and data compression parameters, wherein the amount of data to be compressed is the amount of data retransmitted each time under the hybrid automatic retransmission mechanism, and the data compression parameters are determined based on the current hardware conditions, and the data compression parameters include the expected compression bit width, the amount of data transferred at a single time, and the effective bit width of the hardware; A determination module, configured to determine an actual compression bit width corresponding to the amount of data to be compressed based on the amount of data to be compressed and the data compression parameter; A compression module, used for compressing the data to be compressed according to the actual compression bit width; Wherein, the determination module includes: A first determination submodule, configured to determine a first intermediate parameter based on the amount of data to be compressed and the amount of data transferred at a single time; A second determination submodule, configured to determine a second intermediate parameter based on the expected compression bit width; The third determination submodule is used to determine the actual compression bit width based on the first intermediate parameter, the second intermediate parameter, the expected compression bit width and the hardware effective bit width.
8. An electronic device, characterized in that: It includes a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other through the communication bus; Memory, used to store computer programs; A processor, for implementing the data compression method according to any one of claims 1 to 6 when executing a program stored in a memory.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the data compression method according to any one of claims 1 to 6 is implemented.
Citation Information
Patent Citations
Data compression method and device, computer readable storage medium and electronic equipment
CN112527752A