Compression method and decompression method of non-standard floating point data

Through the mantissa mapping function processing of non-standard floating-point data, efficient storage compression and accuracy maintenance of data in wireless communications are achieved, and the problem of taking into account both dynamic range and accuracy in the prior art is solved, and the high requirements for next-generation communications are applicable.

CN118939231APending Publication Date: 2024-11-12INST OF COMPUTING TECH CHINESE ACAD OF SCI
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410950555.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-16
Publication Date
2024-11-12

AI Technical Summary

Technical Problem

When the prior art meets the requirements of large dynamic range and high precision for next-generation communication computing and processing, it is difficult to take into account data storage requirements, and reducing exponential or mantis digits will lead to a decrease in dynamic range or accuracy loss.

Method used

By preset mapping function processing of the mantissa of non-standard floating point data, map it to a mantissa of fewer bits, construct compressed non-standard floating point data, and restore it through inverse function when needed to achieve data compression and settlement. Compress, maintain calculation accuracy.

Benefits of technology

It realizes efficient storage compression of non-standard floating-point data in wireless communication, reduces storage requirements and power consumption, and restores data accuracy before calculation and processing, which is suitable for the high dynamic range and high precision requirements of 5G or 6G communication.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118939231A_ABST
    Figure CN118939231A_ABST
Patent Text Reader

Abstract

The invention provides a non-standard floating point data compression method, the method is used for carrying out compression expression and / or storage on non-standard floating point data in the field of wireless communication, the wireless communication comprises 5G or 6G communication, the method comprises the following steps: obtaining non-standard floating point data in a preset format, the non-standard floating point data comprises a sign bit, an exponent bit and a first mantissa of M bits; mapping the first mantissa into an N-bit second mantissa by using a preset mapping function, N being less than M; compressed non-standard floating point data is constructed based on the second mantissa, including the sign bits, the exponent bits, and the second mantissa.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, in particular to the field of data compression, and more particularly to a non-standard floating point data compression method. Background Art

[0002] In order to meet the "Internet of Things" needs of the IT3.0 era with "things" as the core, the next-generation 5G and 6G standards require ultra-high speed, ultra-high reliability, and ultra-low latency communications and high dynamic range and high-precision data processing. The currently commonly used 16-bit or 32-bit fixed-point calculation and storage solutions cannot take into account both dynamic range and calculation accuracy, so they are not suitable for the requirements of next-generation communication calculation and processing. In order to meet the requirements of large dynamic range and high processing accuracy, some existing technologies use standard floating point or non-standard floating point data representation for data processing, which can solve this problem to a certain extent. However, one of the problems introduced by this is how to represent and store floating point data with fewer bits to reduce the demand for memory.

[0003] Existing solutions mainly focus on adjusting the representation method of non-standard floating-point data, using fewer exponent bits or fewer mantissa bits to represent data in order to reduce storage. However, reducing the exponent bits will cause the dynamic range of the data to decrease exponentially, which is not suitable for the requirements of a large dynamic range in the communication process or data processing. Fewer mantissa bits can make the calculation process simpler to implement, but it will inevitably lead to a decrease in the accuracy of data representation.

[0004] Therefore, it is necessary to improve the prior art.

[0005] It should be noted that this background technology is only used to introduce the relevant information of the present invention to help understand the technical solution of the present invention, but it does not mean that the relevant information is necessarily the prior art. The relevant information is submitted and disclosed together with the present invention solution. If there is no evidence that the relevant information has been disclosed before the application date of the present invention, the relevant information shall not be regarded as the prior art. Summary of the invention

[0006] Therefore, the object of the present invention is to overcome the defects of the above-mentioned prior art and provide a compression method and a decompression method for non-standard floating point data.

[0007] The objective of the present invention is achieved through the following technical solutions:

[0008] According to a first aspect of the present invention, a method for compressing non-standard floating-point data is provided, the method being used for compressing and / or storing non-standard floating-point data in the field of wireless communications, the wireless communications including 5G or 6G communications, the method comprising: obtaining non-standard floating-point data in a preset format, which comprises a sign bit, an exponent bit, and an M-bit first mantissa; using a preset mapping function, mapping the first mantissa to an N-bit second mantissa, wherein N<M; constructing compressed non-standard floating-point data based on the second mantissa, which comprises the sign bit, the exponent bit, and the second mantissa.

[0009] Optionally, the mapping function is:

[0010] MF=log a (1+mantissa)

[0011] Wherein, MF represents a mapping function, the output of the mapping function is the second mantissa, a represents the base, and mantissa represents the input of the mapping function, that is, the first mantissa.

[0012] Optionally, the mapping function includes multiple linear functions and a segmented lookup table for fitting the logarithmic function, the segmented lookup table records at least multiple segments and the coverage, multiplicative factors and additive factors of each segment, and the mapping of the first mantissa to the N-bit second mantissa is performed in the following manner: determine the segment where the first mantissa is located according to the coverage to which the first mantissa belongs; search the multiplicative factor and additive factor of the segment from the segmented lookup table; determine the linear function of the segment based on the multiplicative factor and additive factor of the segment; and obtain the second mantissa based on the result of mapping the first mantissa to the linear function of the segment.

[0013] Optionally, the linear function of the segment j where the first mantissa is located is expressed as:

[0014] MF′ j =a j ×mantissa+b j

[0015] Among them, MF′ j represents the linear function of segment j, retains N bits of integer from the output of the linear function as the second mantissa, mantissa represents the first mantissa, the size of the first mantissa belongs to the coverage range of segment j, a j represents the M-bit multiplicative factor of segment j, b j Represents the M-bit additive factor for segment j.

[0016] Optionally, the segment lookup table includes:

[0017]

[0018]

[0019] Among them, [x k-1 ,x k ) indicates that the coverage of segment k is greater than or equal to x k-1 Less than x k The interval of a k represents the multiplicative factor of segment k, b k represents the additive factor of segment k, where K represents the total number of segments.

[0020] According to a second aspect of the present invention, a method for decompressing non-standard floating-point data is provided, comprising: obtaining compressed non-standard floating-point data constructed according to the method described in the first aspect, and extracting a second mantissa therefrom; obtaining an inverse function corresponding to the mapping function, and obtaining a restored first mantissa based on a result of processing the second mantissa by the inverse function; and constructing restored non-standard floating-point data based on the restored first mantissa and a sign bit and an exponent bit recorded in the compressed non-standard floating-point data, which includes a sign bit, an exponent bit and the restored first mantissa.

[0021] According to a third aspect of the present invention, a method for decompressing non-standard floating point data is provided, comprising: obtaining a non-standard floating point data based on the mapping function MF=log a (1+mantissa) to extract the second mantissa from the compressed non-standard floating-point data; obtain the inverse function corresponding to the mapping function, and obtain the restored first mantissa based on the result of processing the second mantissa by the inverse function, wherein the inverse function is expressed as: Y=a w -1, wherein a represents the base, w represents the input of the inverse function, i.e., the second mantissa, and the output of Y is the restored first mantissa; based on the restored first mantissa and the sign bit and exponent bit recorded in the compressed non-standard floating-point data, the restored non-standard floating-point data is constructed, which includes the sign bit, the exponent bit and the restored first mantissa.

[0022] According to a fourth aspect of the present invention, a method for decompressing non-standard floating point data is provided, comprising: obtaining a linear function MF′ based on the segment j where the first mantissa is located in the aforementioned method j =a j ×mantissa+b jConstruct compressed non-standard floating-point data, extract a second mantissa from it; obtain a segment lookup table, which also records the restoration range of each segment; determine the segment where the second mantissa belongs according to the restoration range to which the second mantissa belongs; find the multiplicative factor and the additive factor of the segment where the mantissa is located from the segment lookup table, and determine the inverse function of the segment where the mantissa is located; obtain the restored first mantissa based on the result of processing the second mantissa according to the inverse function of the segment where the mantissa is located; based on the restored first mantissa and the sign bit and exponent bit recorded in the compressed non-standard floating-point data, construct the restored non-standard floating-point data, which includes the sign bit, the exponent bit and the restored first mantissa.

[0023] According to a fifth aspect of the present invention, there is provided an electronic device, comprising: one or more processors; and a memory, wherein the memory is used to store executable instructions; the one or more processors are configured to implement the steps of the method described in one or more of the first, second, third, and fourth aspects by executing the executable instructions. BRIEF DESCRIPTION OF THE DRAWINGS

[0024] The embodiments of the present invention are further described below with reference to the accompanying drawings, in which:

[0025] Figure 1 A schematic diagram of a flow chart of a method for compressing non-standard floating-point data according to an embodiment of the present invention;

[0026] Figure 2 A schematic diagram of a data structure of original non-standard floating-point data and compressed non-standard floating-point data according to an embodiment of the present invention;

[0027] Figure 3 is a schematic diagram of a mapping function according to an embodiment of the present invention;

[0028] Figure 4 Schematic diagram of comparative experimental results according to an embodiment of the present invention. DETAILED DESCRIPTION

[0029] In order to make the purpose, technical solutions and advantages of the present invention more clearly understood, the present invention is further described in detail below through specific embodiments in conjunction with the accompanying drawings. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention.

[0030] As mentioned in the background technology section, the existing scheme of reducing the exponent bit will cause the dynamic range of the data to decrease exponentially, which is not suitable for the requirements of large dynamic range in the communication process or data processing; fewer mantissa bits can make the calculation process simple to implement, but it will inevitably lead to a decrease in data representation accuracy. Considering the need to retain the large dynamic range and high processing accuracy of non-standard floating-point data in the calculation process, while reducing the pressure on data storage as much as possible. The present application does not change the data representation and calculation process of non-standard floating-point data, but in the process of data storage, by mapping the original mantissa of non-standard floating-point data (for distinction, called the first mantissa) to a function, a mantissa represented by fewer bits is obtained (for distinction, called the second mantissa), thereby mapping the large dynamic range to a small dynamic range, and storing non-standard floating-point data with fewer bit widths, so as to achieve the purpose of data compression and reduce the storage requirements of non-standard floating-point data storage in the new wireless communication standard scenario. After the storage demand is reduced, power consumption can also be reduced. Before the compressed non-standard floating-point data is processed by calculation, the compressed non-standard floating-point data is decompressed into restored non-standard floating-point data (with the same precision as the non-standard floating-point data before compression) through inverse function mapping, thereby ensuring high-precision processing in the calculation process.

[0031] The implementation process of the present invention mainly includes the following two steps:

[0032] (1) when storage is required, compressing the data using a compression method to obtain compressed non-standard floating-point data, and saving the compressed non-standard floating-point data;

[0033] According to one embodiment of the present invention, a non-standard floating point data compression method is provided for compressing and / or storing non-standard floating point data in the field of wireless communication, wherein the wireless communication includes 5G or 6G communication, see Figure 1 , the method comprises the steps of:

[0034] A1. Obtain non-standard floating-point data in a preset format, which includes a sign bit, an exponent bit, and an M-bit first mantissa;

[0035] A2. Mapping the first mantissa to a second mantissa of N bits using a preset mapping function, where N<M;

[0036] A3. Construct compressed non-standard floating-point data based on the second mantissa, which includes the sign bit, the exponent bit and the second mantissa.

[0037] (2) Before the compressed non-standard floating-point data needs to be processed by calculation, the compressed non-standard floating-point data is decompressed by using a decompression method to obtain restored non-standard floating-point data.

[0038] According to one embodiment of the present invention, a method for decompressing non-standard floating point data is provided, comprising the steps of:

[0039] B1. Obtaining compressed non-standard floating-point data constructed according to the compression method for non-standard floating-point data, and extracting a second mantissa therefrom;

[0040] B2. Obtain an inverse function corresponding to the mapping function, and obtain a restored first mantissa based on a result of processing the second mantissa by the inverse function;

[0041] B3. Based on the restored first mantissa and the sign bit and exponent bit recorded in the compressed non-standard floating-point data, construct restored non-standard floating-point data, which includes the sign bit, the exponent bit and the restored first mantissa.

[0042] For ease of understanding, we first briefly introduce non-standard floating-point data in wireless communication. In wireless communication, what may be sent, received and / or saved at one time may be a set of non-standard floating-point data X, including C (C ≥ 1) non-standard floating-point data, where each data is represented as follows:

[0043] X[i]=(-1) S *2 E *mantissa,i=0,1,...,C-1

[0044] Among them, X[i] represents the i-th data in a set of non-standard floating-point data X, S is the sign bit, represented by 1 bit; E is the exponent bit, represented by P bits; mantissa is the mantissa (or mantissa bit), represented by M bits. Since the exponent bit is shorter than the mantissa bit, and the sign bit is only 1 bit, the method of the present invention only maps the M-bit mantissa to shorten its representation bit width and realize data compression. For illustration, see Figure 2 , assuming that the sign bit S of the original non-standard floating-point data is 1 bit, the exponent bit E is P bits, and the mantissa bit is M bits; the mantissa bit of the compressed non-standard floating-point data is shortened to N bits.

[0045] In order to adapt to the dynamic range of data, it can be flexibly adjusted. In this embodiment, P is 5, that is, the exponent bit is represented by 5 bits. Mantissa is the mantissa bit, and the bit width is M. It can be flexibly adjusted according to the requirements of the data for calculation accuracy. In this embodiment, M is 11 bits. In this embodiment, the storage format of the above non-standard floating point is 17 bits, that is, 1 bit sign bit, 5 bits exponent bit, and 11 bits mantissa bit.

[0046] A more detailed implementation is given below to illustrate the solution of the present invention. Since different mapping functions and inverse function combinations can be used to form different implementations, two exemplary function combinations are used to illustrate the implementation. However, it should be understood that on the basis of the implementation given in the present invention, those skilled in the art can adopt some other replacement means to achieve an equivalent implementation.

[0047] Implementation Method 1

[0048] The mapping function of this embodiment adopts a logarithmic function, and the inverse function adopts an exponential function. According to an embodiment of the present invention, the mapping function is:

[0049] MF=log a (1+mantissa)

[0050] Wherein, MF represents a mapping function, the output of the mapping function is the second mantissa, a represents the base, and mantissa represents the input of the mapping function, i.e., the first mantissa. Optionally, a can be 1.1, 1.7, 2, e, 4, 8, 10, etc., or other values ​​selected by the implementer according to the length of the first mantissa and the degree of compression required. However, in order to make the implementation more convenient, a is preferably 2, e or 10.

[0051] In schematic form, assuming that the data contains 1-bit sign bit, 5-bit exponent bit, and 11-bit mantissa bit (M=11), and the implementer wants the number of bits of the compressed mantissa to be N=4, then a can be set to 2. When a=2, the example logarithmic function MF=log2(1+mantissa) is used to map the mantissa (first mantissa) of the input non-standard floating-point data, and the mapping relationship is as follows: Figure 3 As shown, the mantissa of the input data is 11 bits, and its value range is 0 to 2 M -1, that is, 0 to 2047 in decimal, after being mapped by logarithmic function, its value range is 0 to 11 in decimal, and only 4 bits are needed to represent it in binary, so its value range is greatly reduced, thereby achieving data compression.

[0052] According to one embodiment of the present invention, a method for decompressing non-standard floating-point data includes: obtaining compressed non-standard floating-point data constructed according to the method of the above embodiment, and extracting a second mantissa from it; obtaining an inverse function corresponding to the mapping function, and processing the second mantissa based on the inverse function to obtain a restored first mantissa, wherein the inverse function is expressed as: Y = a w-1, where a represents the base, w represents the input of the inverse function, i.e., the second mantissa, and the output of Y is the restored first mantissa; based on the restored first mantissa and the sign bit and exponent bit recorded in the compressed non-standard floating-point data, the restored non-standard floating-point data is constructed, which includes the sign bit, the exponent bit and the restored first mantissa. Schematically, for the case where the mapping function adopts the example logarithmic function MF=log2(1+mantissa), the corresponding inverse function is Y=2 w -1.

[0053] Through the mapping function and inverse function shown in Implementation 1, the method of the present invention can compress the mantissa of non-standard floating-point data from M bits to N bits, thereby achieving the purpose of representing the original non-standard floating-point data with a smaller amount of data.

[0054] Implementation Method 2

[0055] At the same time, considering that when the logarithmic function is used as the mapping function, the processing complexity of function mapping and inverse function mapping is relatively high, this embodiment uses a linear fitting method to approximate the logarithmic function and its inverse function representation, thereby further reducing the computational complexity of function mapping and inverse function mapping.

[0056] According to one embodiment of the present invention, the mapping function includes multiple linear functions for fitting the segment of the logarithmic function and a segment lookup table, wherein the segment lookup table records at least multiple segments and the coverage, multiplicative factor and additive factor of each segment.

[0057] The schematic implementation process is as follows:

[0058] (1) Prepare and save the piecewise lookup table, linear function, and inverse function

[0059] According to one embodiment of the present invention, the segment lookup table includes:

[0060] Coverage Restore Scope Segmentation Multiplicative Factor Additive Factor <![CDATA[[x0,x1)]]> <![CDATA[[y0,y1)]]> 1 <![CDATA[a1]]> <![CDATA[b1]]> <![CDATA[[x1,x2)]]> <![CDATA[[y1,y2)]]> 2 <![CDATA[a3]]> <![CDATA[b2]]> …… …… …… …… …… <![CDATA[[x k-1 ,x k )]]> <![CDATA[[y k-1 ,and k )]]> k <![CDATA[a k ]]> <![CDATA[b k ]]> …… …… …… …… …… <![CDATA[[x K-1 ,x K )]]> <![CDATA[[y K-1 ,and K )]]> K <![CDATA[a K ]]> <![CDATA[b K ]]>

[0061] The coverage range is used to query the segment where the first mantissa is located. When the value of a first mantissa is within a coverage range, the segment corresponding to the coverage range is called the segment where the first mantissa is located. Indicatively, if the value of the first mantissa falls within the coverage range [x k-1 ,x k ), then the segment where the first mantissa is located is called segment k. For simplicity, the embodiment of the present invention assumes that the segment where any first mantissa is located is segment j, j∈[1,K].

[0062] The restoration range is used to query the segment where the second mantissa is located. When the value of a second mantissa is within a restoration range, the segment corresponding to the restoration range is called the segment where the second mantissa is located. Indicatively, if the value of the second mantissa falls within the restoration range [y k-1 ,y k ), then the segment where the second mantissa is located is called segment k. For simplicity, the embodiment of the present invention assumes that the segment where any second mantissa is located is segment j, j∈[1,K];

[0063] The multiplicative factors and additive factors are variables used to construct linear functions and inverse functions, and are obtained by querying the multiplicative factors and additive factors corresponding to the segment where the first mantissa is located or the segment where the second mantissa is located.

[0064] In the table, [x k-1 ,x k ) indicates that the coverage of segment k is greater than or equal to x k-1 Less than x k The interval [y k-1 ,y k ) indicates that the restoration range of segment k is greater than or equal to y k-1 Less than y k The interval of a k represents the multiplicative factor of segment k, b k represents the additive factor of segment k, and K represents the total number of segments. The subscript k can represent any value from 1 to K, so the meaning of other subscripts can refer to the above explanation and will not be repeated here.

[0065] In the process of segmentation, uniform segmentation can be used, that is, the length of the interval covered by each segment is consistent. According to an embodiment of the present invention, uniform segmentation can be performed according to the system's requirements for compression performance. If the compression accuracy requirement is high, more segments can be divided, and if the compression accuracy requirement is low, fewer segments can be divided. The number of segments is, for example, 16, 32, or 64 segments.

[0066] However, considering that the slope of the logarithmic function gradually decreases, if uniform segmentation is used, the performance loss in the compression process is relatively large. Therefore, further improvement can be considered. According to one embodiment of the present invention, among the multiple linear functions of the segmentation, the interval of the segment whose coverage range is relatively close to 0 is relatively shorter, and vice versa. Since the slope of the logarithmic function is not fixed, if a uniform segmentation method is used, in order to ensure the fitting performance of each linear function segment, it may be necessary to divide it into quite a number of segments, resulting in the storage table being too large. However, if a non-uniform segmentation method is used, the segmentation interval can be smaller for the part with a larger slope, and the segmentation interval can be larger for the part with a smaller slope, thereby ensuring the fitting performance while reducing the complexity of table storage and calculation as much as possible.

[0067] Indicatively, based on the above example, assuming that the data contains 1-bit sign bit, 5-bit exponent bit, and 11-bit mantissa bit (M=11), and the implementer hopes that the number of bits of the compressed mantissa N=4, then a is set to 2. Correspondingly, assuming that it is divided into 32 segments, an illustrative segment lookup table is as follows:

[0068]

[0069]

[0070] In the segment 1 in the above table, it only involves one data 0, so when processing, if the first mantissa is 0, the corresponding second mantissa is directly mapped to 0; correspondingly, the same applies when decompressing.

[0071] According to one embodiment of the present invention, the linear function of the segment j where the first mantissa is located is expressed as:

[0072] MF′ j =a j ×mantissa+b j

[0073] Among them, WF′ j represents the linear function of segment j, retains N bits of integer from the output of the linear function as the second mantissa, mantissa represents the first mantissa, the size of the first mantissa belongs to the coverage range of segment j, a j represents the M-bit multiplicative factor of segment j, b j Represents the M-bit additive factor for segment j.

[0074] According to an example of the present invention, it is assumed that the multiplicative factor a is represented by 11 bits, and it is assumed that all 11 bits are decimal places (which can be defined by the implementer), the additive factor b is represented by 11 bits, and it is assumed that there are 7 decimal places in the 11 bits (which can be defined by the implementer), and the first mantissa is represented by 11 bits. A*mantissa is implemented by an 11-bit multiplier to obtain a 22-bit result temp_1. Since the decimal places of temp_1 and the additive factor are different, temp_1 is shifted right by T bits to obtain temp_2 during calculation, and temp_2 is added to b to obtain the result c. Since the dynamic range becomes smaller after the mapping function is calculated, it can be represented by fewer bits. In order to achieve the purpose of compression, the decimal places of c are discarded, and only the 4 integer bits are retained as the output after the function mapping, that is, the second mantissa. Among them, T bits are a j and b j The difference in decimal places during the quantization process is shifted right by T bits to ensure that jAlign decimal places. In the specific implementation, the size of T can be adjusted according to different quantization implementation schemes. The right shift by a certain number of places is related to the specific quantization implementation and has nothing to do with the implementation principle of this scheme. For example, the mantissa of a certain data x is 1024 (decimal). According to the mantissa table, the multiplicative factor is 2 (decimal), and the additive factor is 1134 (decimal). The calculation results are temp_1=1024*2 (decimal), temp_2=temp_1>>4=128 (decimal), c=temp_2+1134=1262 (decimal)=10011101110 (binary). Since the additive factor is 7 decimal places, c has 7 decimal places. Here, only the integer places are retained for the result of c. In order to minimize the data compression loss, zero rounding is performed here, and the 4 bits of integer places retained are 1010 (binary), which is the value after compression, that is, the second mantissa.

[0075] According to an optional embodiment of the present invention, the inverse function of the segment where the second mantissa is located is expressed as:

[0076]

[0077] Among them, a j The multiplicative factor of M bits of segment j recorded in the segment lookup table, b j represents the M-bit additive factor of segment j recorded in the segment lookup table, and w represents the second mantissa.

[0078] In order to avoid the calculation of division, further improvement can be considered. According to another optional embodiment of the present invention, the inverse function of the segment where the second mantissa is located is expressed as:

[0079] Y j =c j ×w+d j

[0080] Among them, w represents the second mantissa, c j represents the multiplicative factor of segment j during decompression (to distinguish, a j is called the multiplicative factor of the compression time segment j), d j represents the additive factor of segment j during decompression (to distinguish, b j is called the additive factor of segment j during compression). According to the table above, assuming that it is divided into 32 segments, a schematic segment lookup table is as follows:

[0081]

[0082]

[0083] In the above table, segment 1 has only one data 0, so when processing, if the data to be compressed is 0, a special value is set to indicate that the value after compression is 0, such as 0000; if a special value is found during the decompression process, it is directly restored to 0.

[0084] In this embodiment, d j =880, occupying 6 decimal places, c j = -7790, then the decompression process is as follows: 1010 (binary) = 10 (decimal), 10*880-7790 = 1010 (decimal) is the value after decompression. It can be seen that 1024 becomes 1010 after compression and decompression, and the compression loss is Small compression loss.

[0085] (3) Mapping of mantissa

[0086] According to one embodiment of the present invention, mapping the first mantissa to the N-bit second mantissa is performed in the following manner:

[0087] A21. Determine the segment to which the first mantissa belongs according to the coverage range to which the first mantissa belongs;

[0088] A22. Find the multiplicative factor and the additive factor of the segment from the segment lookup table;

[0089] A23, determining a linear function of the segment based on the multiplicative factor and the additive factor of the segment;

[0090] A24. Obtain a second mantissa by mapping the first mantissa according to the linear function of the segment.

[0091] (4) Construction of compressed non-standard floating point data based on the second mantissa

[0092] See again Figure 2 The representation of the compressed non-standard floating-point data still uses the original representation of the non-standard floating-point data, and only the mantissa bits are replaced by the second mantissa.

[0093] (5) Before processing any non-standard floating-point data, call the decompression method of the non-standard floating-point data, first restore the second mantissa, and then construct the restored non-standard floating-point data

[0094] According to one embodiment of the present invention, a method for decompressing non-standard floating point data includes:

[0095] Obtaining the compressed non-standard floating-point data constructed according to the method described in Implementation 2, and extracting the second mantissa therefrom;

[0096] Get the segment lookup table, which also records the restoration range of each segment;

[0097] Determining the segment to which the second mantissa belongs according to the restoration range to which the second mantissa belongs;

[0098] Find the multiplicative factor and the additive factor of the segment from the segment lookup table to determine the inverse function of the segment;

[0099] The second mantissa is processed according to the inverse function of the segment to obtain a restored first mantissa;

[0100] Based on the restored first mantissa and the sign bit and the exponent bit recorded in the compressed nonstandard floating-point data, a restored nonstandard floating-point data is constructed, which includes the sign bit, the exponent bit and the restored first mantissa.

[0101] The scheme of this implementation can adjust the representation of functions and inverse functions according to the performance requirements for data compression, adjust the precision of the linear fitting piecewise function, so as to flexibly adjust the compression efficiency and compression performance, and is suitable for different needs. According to one embodiment of the present invention, the compression method of non-standard floating-point data includes: obtaining the performance requirements for data compression, selecting a segmented lookup table that meets the performance requirements from a plurality of preset segmented lookup tables to search for multiplicative factors and additive factors, wherein each segmented lookup table corresponds to a performance requirement. The bit width and / or number of segments of the second mantissa corresponding to different segmented lookup tables are different. Correspondingly, the decompression method of the non-standard floating-point data includes: determining a segmented lookup table that matches the compressed non-standard floating-point data from the plurality of segmented lookup tables, and searching for multiplicative factors and additive factors from the matching segmented lookup table. There are many ways to determine the matching segmented lookup table, for example, the mantissa bit width of the second mantissa corresponding to different performance requirements can be set differently, thereby determining the matching segmented lookup table according to the mantissa bit width. Alternatively, compressed data with different performance requirements may be stored in different areas, thereby determining a matching segment lookup table based on the storage area.

[0102] According to an example of the present invention, a method for compressing non-standard floating point data is provided, and the schematic process is as follows:

[0103] Step 1: Input a set of non-standard floating-point data X, including N non-standard floating-point data, where each data is represented as follows:

[0104] X[i]=(-1) S *2 E *mantissa,i=0,1,...,N-1

[0105] Among them, S is the sign bit, which is represented by 1 bit, and E is the exponent bit, which is represented by P bits. In order to adapt to the dynamic range of the data, it can be flexibly adjusted. In this example, P is 5, that is, the exponent bit is represented by 5 bits. Mantissa is the mantissa bit, and the bit width is Q. It can be flexibly adjusted according to the requirements of the data for calculation accuracy. In this example, Q is 11 bits. In this example, the storage format of the above non-standard floating point is 17 bits, that is, 1 bit sign bit, 5 bits exponent bit, and 11 bits mantissa bit.

[0106] Step 2: Perform function mapping on the mantissa of the input non-standard floating-point data X. The specific process is as follows:

[0107] Option 1: Use the logarithmic function log2(1+mantissa)

[0108] The mantissa of the input data is mapped using a logarithmic function to compress the dynamic range of the mantissa.

[0109] In this example, the logarithmic function log2(1+mantissa) is used to map the mantissa of the input data. The mantissa of the input data is 11 bits, and its value range is 0 to 2. Q -1, that is, 0 to 2047, after being mapped by the logarithmic function, its value range is 0 to 11;

[0110] Option 2: Using multiple piecewise linear functions, including the following steps:

[0111] Step 2.1: Use piecewise linear fitting method to represent the mapping function.

[0112] In this example, the logarithmic function log2(1+mantissa) is divided into 32 segments using non-uniform segmentation. Each segment is expressed as a linear function, that is, in the form of ax+b, where a is the multiplicative factor of the linear function, x is the actual value of mantissa, and b is the additive factor of the segmented function. Considering that the slope of the logarithmic function gradually decreases, non-uniform segmentation is used to reduce performance loss during compression. The additive and multiplicative factors of the 32-segment linear function are expressed in a fixed-point quantization format with the same bit width as the mantissa and saved in a table in the segmented lookup table.

[0113] Step 2.2: According to the size of the mantissa of the input data, look up the table in the segmented lookup table to obtain the multiplicative factor a and additive factor b of the segmented linear function, calculate a*mantissa+b, and obtain the output after function mapping. In this example, a is represented by 11 bits, b is represented by 11 bits, and mantissa is represented by 11 bits. The result c is obtained by adding a*mantissa and b. Since the dynamic range of the data changes after mapping, 11 bits are not required but 4 bits can be used to represent it, so the decimal places of c are discarded, and only 4 integer bits are retained as the output after function mapping.

[0114] Step 3: Save the compressed data in the format of 1-bit sign bit, 5-bit exponent bit, and 4-bit mantissa bit to complete the data compression.

[0115] In order to verify the effect of the method of the present invention, the inventors also conducted the following comparative experiments.

[0116] This solution is used in the 5G communication system for verification. The original input signal is compressed and decompressed, and then the subsequent signal processing is performed to simulate the overall link performance under the parameter configuration. Figure 4 As shown. It can be seen that compared with directly using the original input signal (uncompressed), by using the method of this solution (compression) to compress and decompress the input signal, there is almost no impact on the overall link performance.

[0117] In addition, the inventor also compares the scheme of the present invention with the existing compression scheme (the scheme derived from patent document CN107608932A). The existing compression scheme divides a group of data into multiple groups to calculate the mean, and calculates the residual of each group and the mean, and compresses the residual, thereby achieving the purpose of data compression. By comparing the present scheme with the existing compression scheme, the error after data decompression and before compression can be compared to find out the advantages and disadvantages of the two schemes. It can be seen that when the data is evenly distributed, other compression schemes are slightly better than the present scheme, and when the data is not evenly distributed, the present scheme is significantly better than other schemes.

[0118] MSE / dB Data is evenly distributed Non-uniform data distribution Solution of the present invention -56 -32 Existing compression schemes -43 -55

[0119] In general, the method of the embodiment of the present invention can achieve at least one of the following beneficial effects:

[0120] 1) Considering the need to retain the large dynamic range and high processing accuracy of non-standard floating points in the calculation process, while reducing the pressure on data storage as much as possible. The method of the embodiment of the present invention does not change the data representation and calculation process of non-standard floating points, but in the process of data storage, through function mapping, the large dynamic range is mapped to a small dynamic range, and non-standard floating point data is stored with a smaller bit width, so as to achieve the purpose of data compression and reduce the demand for storage and / or power consumption.

[0121] 2) Before the compressed non-standard floating-point data is to be calculated and processed, the compressed non-standard floating-point data is decompressed into the original non-standard floating-point data through inverse function mapping to ensure high-precision processing in the calculation process;

[0122] 3) Considering the processing complexity of function mapping and inverse function mapping, some embodiments of the present invention also use a linear fitting method to approximate function and inverse function representation, further reducing the computational complexity of function mapping and inverse function mapping.

[0123] 4) Some embodiments of the present invention can adjust the representation of functions and inverse functions and the accuracy of linear fitting piecewise functions according to the performance requirements for data compression, so as to flexibly adjust the compression efficiency and compression performance to meet the different needs of the new generation of wireless communication scenarios.

[0124] It should be noted that although the above describes the various steps in a specific order, it does not mean that the various steps must be executed in the above specific order. In fact, some of these steps can be executed concurrently or even in a different order as long as the required functions can be achieved.

[0125] The present invention may be a system, a method and / or a computer program product. The computer program product may include a computer-readable storage medium carrying computer-readable program instructions for causing a processor to implement various aspects of the present invention.

[0126] Computer readable storage medium can be a tangible device that holds and stores instructions used by an instruction execution device. Computer readable storage medium can include, for example, but is not limited to, an electrical storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device, or any suitable combination thereof. More specific examples (non-exhaustive list) of computer readable storage medium include: a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a static random access memory (SRAM), a portable compact disk read-only memory (CD-ROM), a digital versatile disk (DVD), a memory stick, a floppy disk, a mechanical encoding device, for example, a punch card or a protruding structure in a groove on which instructions are stored, and any suitable combination thereof.

[0127] The embodiments of the present invention have been described above, and the above description is exemplary, not exhaustive, and is not limited to the disclosed embodiments. Many modifications and variations will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the described embodiments. The selection of terms used herein is intended to best explain the principles of the embodiments, practical applications, or technical improvements in the market, or to enable other persons of ordinary skill in the art to understand the embodiments disclosed herein.

Claims

1. A method for compressing non-standard floating-point data, the method being used for compressing and / or storing non-standard floating-point data in the field of wireless communication, wherein the wireless communication includes 5G or 6G communication, and the method comprises: Acquire non-standard floating-point data in a preset format, which includes a sign bit, an exponent bit, and an M-bit first mantissa; Mapping the first mantissa to a second mantissa of N bits using a preset mapping function, where N<M; Compressed nonstandard floating-point data is constructed based on the second mantissa, including the sign bit, the exponent bits, and the second mantissa.

2. The method according to claim 1, characterized in that The mapping function is: MF=log a (1+mantissa) Wherein, MF represents a mapping function, the output of the mapping function is the second mantissa, a represents the base, and mantissa represents the input of the mapping function, that is, the first mantissa.

3. The method according to claim 1, characterized in that The mapping function includes a plurality of linear functions and a segmented lookup table for fitting the segmented logarithmic function, wherein the segmented lookup table records at least a plurality of segments and a coverage range, a multiplicative factor, and an additive factor of each segment. The mapping of the first mantissa to the second mantissa of N bits is performed in the following manner: Determining the segment in which the first mantissa is located according to the coverage range to which the first mantissa belongs; Find the multiplicative factor and the additive factor of the segment from the segment lookup table; Determining a linear function of the segment based on the multiplicative factor and the additive factor of the segment; A second mantissa is obtained by mapping the first mantissa according to the linear function of the segment.

4. The method according to claim 3, characterized in that The linear function of the segment j where the first mantissa is located is expressed as: MF′ j = yes j ×mantissa+b j Among them, MF′ j represents the linear function of segment j, retains N bits of integer bits from the output of the linear function as the second mantissa, mantissa represents the first mantissa, the size of the first mantissa belongs to the coverage range of segment j, a j represents the M-bit multiplicative factor of segment j, b j Represents the M-bit additive factor for segment j.

5. The method according to claim 4, characterized in that The segment lookup table include: Among them, [x k-1 ,x k ) indicates that the coverage of segment k is greater than or equal to x k-1 Less than x k The interval of a k represents the multiplicative factor of segment k, b k represents the additive factor of segment k, where K represents the total number of segments.

6. A method for decompressing non-standard floating point data, comprising: Obtaining the compressed non-standard floating point data constructed according to the method of any one of claims 1 to 5, and extracting a second mantissa therefrom; Obtain an inverse function corresponding to the mapping function, and obtain a restored first mantissa based on a result of processing the second mantissa by the inverse function; Based on the restored first mantissa and the sign bit and the exponent bit recorded in the compressed nonstandard floating-point data, a restored nonstandard floating-point data is constructed, which includes the sign bit, the exponent bit and the restored first mantissa.

7. A method for decompressing non-standard floating point data, comprising: Obtaining the compressed non-standard floating point data constructed according to the method of claim 2, and extracting a second mantissa therefrom; An inverse function corresponding to the mapping function is obtained, and a result of processing the second mantissa by the inverse function is used to obtain a restored first mantissa, where the inverse function is expressed as: And now w -1 Where a represents the base, w represents the input of the inverse function, i.e. the second mantissa, and the output of Y is the restored first mantissa; Based on the restored first mantissa and the sign bit and the exponent bit recorded in the compressed nonstandard floating-point data, a restored nonstandard floating-point data is constructed, which includes the sign bit, the exponent bit and the restored first mantissa.

8. A method for decompressing non-standard floating point data, comprising: Obtaining the compressed non-standard floating point data constructed according to the method of any one of claims 3 to 5, and extracting a second mantissa therefrom; Get the segment lookup table, which also records the restoration range of each segment; Determining the segment to which the second mantissa belongs according to the restoration range to which the second mantissa belongs; Find the multiplicative factor and the additive factor of the segment from the segment lookup table to determine the inverse function of the segment; The second mantissa is processed according to the inverse function of the segment to obtain a restored first mantissa; Based on the restored first mantissa and the sign bit and the exponent bit recorded in the compressed nonstandard floating-point data, a restored nonstandard floating-point data is constructed, which includes the sign bit, the exponent bit and the restored first mantissa.

9. A computer-readable storage medium, characterized in that: A computer program is stored thereon, and the computer program can be executed by a processor to implement the steps of the method according to any one of claims 1 to 8.

10. An electronic device, characterized in that: include: one or more processors; as well as A memory, wherein the memory is used to store executable instructions; The one or more processors are configured to implement the steps of the method of any one of claims 1 to 8 by executing the executable instructions.