Data quantization method, device and equipment based on Lagrange approximation
By using the Lagrange approximation method, the division calculation in the data quantization process is transformed into a shift-addition operation, which solves the problems of resource consumption and efficiency, and achieves efficient data quantization.
Patent Information
- Application Number
- CN202511106899.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-08
- Publication Date
- 2025-11-25
AI Technical Summary
In programmable gate arrays and phased array antennas, existing data quantization methods require a lot of resources and time. Especially in large-scale phased array antennas, the division calculation is large and the resource consumption increases linearly, making it difficult to implement efficiently.
A data quantization method based on Lagrange approximation is adopted. By performing fixed-point processing, constructing the Lagrange approximation formula, and performing shift addition operations, the division calculation is replaced, thereby optimizing the quantization results.
It reduces the computational load of data quantization, improves efficiency, and reduces resource consumption. In particular, it simplifies the quantization process of phase data in phased array antennas.
Smart Images

Figure CN121008085A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of data quantization technology, and in particular to a data quantization method, apparatus and device based on Lagrange approximation. Background Technology
[0002] In programmable gate arrays (PGAs), data quantization can be achieved with fewer resources and less time. The conventional method of data quantization involves dividing the data by a quantization factor, which inevitably introduces division operations, consuming resources within the PGA. However, this resource consumption is negligible during normal data quantization. For large amounts of data requiring quantization conversion within a short timeframe, common methods include parallel multiplexing or increasing the system clock frequency. In the same amount of time, parallel multiplexing means multiple dividers are needed for the operation, leading to a linear increase in resource consumption.
[0003] In the implementation of phased array antennas, large-scale phased array antennas based on analog phase shifter architectures need to convert the phase into a low-precision analog phase shifter code after calculating the channel phase. A typical implementation involves dividing the phase by the precision of the analog phase shifter and rounding it to reduce phase error. In large-scale phased array antennas, the number of elements exceeds 1000, and for phased array antennas supporting multiple beams, each beam needs to be calculated individually. The computational cost of division is NUM. ANT ×NUM beams . Summary of the Invention
[0004] Therefore, it is necessary to provide a data quantization method, apparatus, and device based on Lagrange approximation to address the aforementioned technical problems.
[0005] A data quantization method based on Lagrange approximation, the method comprising:
[0006] Perform point-to-point processing on the target data to be quantified;
[0007] Based on the pre-set quantization accuracy requirements, the parameters for performing the Lagrange approximation are determined; the parameters include an integer i and an integer set N;
[0008] Based on the integer i and the set of integers N, a Lagrange approximation formula is constructed, and the target data is processed by combinational logic to obtain preliminary quantization results;
[0009] The preliminary quantization results are rounded to obtain the final quantization results.
[0010] In one embodiment, the target data is phase data of a phased array antenna, and the bit width of the phase data is (M+K)-bit; it also includes: for a float type target data, multiplying it by 2^K, truncating it into an integer, and converting it into a (M+K)-bit binary data; wherein the high M bits are the integer part and the low K bits are the fractional part.
[0011] In one embodiment, the method further includes: selecting samples that meet the quantization accuracy requirement based on an error threshold. -i -∑ n> i 2 -n With 1 / q precise All integers n less than the error threshold are used to determine the integer set N; where i = round(log2q) precise ), q precise Indicates the quantization precision.
[0012] In one embodiment, the method further includes: rounding the preliminary quantization result to obtain the final quantization result as follows:
[0013] result = D[Q:1] + D[0]
[0014] Where, result is the final quantization result, D[Q:1] is the binary data from the most significant bit to the second least significant bit of the quantization result, D[0] is the least significant bit of the quantization result, and Q is the quantization bit width.
[0015] A data quantization device based on Lagrange approximation, the device comprising:
[0016] The data processing module is used to perform point-to-point processing on the target data to be quantized;
[0017] The parameter setting module is used to determine the parameters for Lagrange approximation based on the preset quantization accuracy requirements; the parameters include an integer i and an integer set N;
[0018] The preliminary quantization module is used to construct a Lagrange approximation formula based on the integer i and the set of integers N, and to perform operations on the target data through combinational logic to obtain the preliminary quantization result;
[0019] The final quantization module is used to round and optimize the preliminary quantization results to obtain the final quantization results.
[0020] In one embodiment, the target data is the phase data of a phased array antenna, and the bit width of the phase data is (M+K)-bit; the data processing module is also used to multiply a float type target data by 2^K, truncate it to an integer, and convert it into a (M+K)-bit binary data; wherein the high M bits are the integer part and the low K bits are the fractional part.
[0021] In one embodiment, the parameter setting module is further configured to filter parameters that meet the quantization accuracy requirement based on the error threshold. -i -∑ n>i 2 -n With 1 / q precise All integers n less than the error threshold are used to determine the integer set N; where i = round(log2q) precise ), q precise Indicates the quantization precision.
[0022] In one embodiment, the final quantization module is further configured to round the preliminary quantization result to obtain the final quantization result as follows:
[0023] result = D[Q:1] + D[0]
[0024] Where, result is the final quantization result, D[Q:1] is the binary data from the most significant bit to the second least significant bit of the quantization result, D[0] is the least significant bit of the quantization result, and Q is the quantization bit width.
[0025] A computer device includes a memory and a processor, the memory storing a computer program, and the processor executing the computer program performing the following steps:
[0026] Perform point-to-point processing on the target data to be quantified;
[0027] Based on the pre-set quantization accuracy requirements, the parameters for performing the Lagrange approximation are determined; the parameters include an integer i and an integer set N;
[0028] Based on the integer i and the set of integers N, a Lagrange approximation formula is constructed, and the target data is processed by combinational logic to obtain preliminary quantization results;
[0029] The preliminary quantization results are rounded to obtain the final quantization results.
[0030] A computer-readable storage medium having a computer program stored thereon, the computer program performing the following steps when executed by a processor:
[0031] Perform point-to-point processing on the target data to be quantified;
[0032] Based on the pre-set quantization accuracy requirements, the parameters for performing the Lagrange approximation are determined; the parameters include an integer i and an integer set N;
[0033] Based on the integer i and the set of integers N, a Lagrange approximation formula is constructed, and the target data is processed by combinational logic to obtain preliminary quantization results;
[0034] The preliminary quantization results are rounded to obtain the final quantization results.
[0035] The aforementioned data quantization method, apparatus, and equipment based on Lagrange approximation first perform fixed-point processing on the target data to be quantized, using this as the basis for subsequent integer calculations. Then, based on pre-set quantization accuracy requirements, the parameters for Lagrange approximation are determined, specifically the integer i and the integer set N. A Lagrange approximation formula is constructed based on integer i and the integer set N. Combinatorial logic is then used to perform calculations on the target data to obtain a preliminary quantization result. Finally, the preliminary quantization result is rounded to obtain the final quantization result. Using this method, division calculations can be transformed into simple shift-addition operations, significantly reducing the computational load of data quantization and improving efficiency. Attached Figure Description
[0036] Figure 1 This is a flowchart illustrating a data quantization method based on Lagrange approximation in one embodiment;
[0037] Figure 2 This is a structural block diagram of a data quantization device based on Lagrange approximation in one embodiment;
[0038] Figure 3 This is an internal structural diagram of a computer device in one embodiment. Detailed Implementation
[0039] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.
[0040] In one embodiment, such as Figure 1 As shown, a data quantization method based on Lagrange approximation is provided, including the following steps:
[0041] Step 102: Perform point-to-point processing on the target data to be quantized.
[0042] In the field of digital signal processing, fixed-point conversion of data is a common operation that converts continuous numerical values into integer forms that can be directly processed by digital circuits. The target data is phase data acquired in a phase quantization scenario for a phased array antenna. Specifically, taking phase data containing fractional parts 30.25° and 55.78° as an example, the fractional parts 0.25° and 0.78° are converted to integers 0.25 × 2 by left shifting by 16 bits. 16 0.78×2 16 This ensures that the decimal part is not lost during quantification calculations.
[0043] Step 204: Determine the parameters for Lagrange approximation based on the pre-set quantization accuracy requirements; the parameters include integer i and integer set N.
[0044] Since the complex quantization precision is used as a coefficient, it is difficult to calculate directly using hardware logic. In this step, a simple combination of negative powers of 2 is used to approximate the reciprocal of the quantization precision. For example, negative powers of 2... -i 2 -n In digital circuits, this can be directly implemented through shift operations, consuming very few resources. Essentially, the Lagrange approximation transforms multiplication / division, which is difficult to perform logically in hardware, into addition / subtraction, which is easier to perform.
[0045] When determining the set of integers N, taking a phase shifter with a phase accuracy of 5.625° as an example, the target coefficient is 1 / 5.625 ≈ 0.1778, 2 -3 =0.125, therefore, the integer i is 3, N = {7, 8, 10}, corresponding to 2 -7 ≈0.0078,2 -8 ≈0.0039,2 -10 ≈0.000976.
[0046] Step 106: Based on integer i and integer set N, construct the Lagrange approximation formula, and perform operations on the target data through combinational logic to obtain preliminary quantization results.
[0047] The preliminary quantization result is the direct output of the above combinational logic operation. Its physical meaning is target data × approximation coefficient. This result is essentially a hardware-friendly substitution of target data ÷ quantization accuracy.
[0048] Step 108: Round the preliminary quantization results to obtain the final quantization results.
[0049] In the aforementioned data quantization method based on Lagrange approximation, firstly, the target data to be quantized is processed into fixed-point values for subsequent integer calculations. Then, based on pre-set quantization accuracy requirements, the parameters for Lagrange approximation are determined, specifically the integer i and the integer set N. A Lagrange approximation formula is constructed based on integer i and the integer set N. Combinatorial logic is then used to perform calculations on the target data to obtain a preliminary quantization result. Finally, the preliminary quantization result is rounded to obtain the final quantization result. Using this method, division calculations can be transformed into simple shift-addition operations, significantly reducing the computational load of data quantization and improving efficiency.
[0050] In one embodiment, the target data is the phase data of a phased array antenna, and the bit width of the phase data is (M+K)-bit. For a float-type target data, it is multiplied by 2^K, truncated to an integer, and converted into (M+K)-bit binary data; where the high M bits are the integer part and the low K bits are the fractional part. Taking a phase data bit width of 32-bit as an example, since the phase data has a fractional part, in order to ensure calculation accuracy, the phase data is fixed-point processed by multiplying it by 2^15. In the final 32-bit data, the high 17 bits are the integer part and the low 15 bits are the fractional part.
[0051] In one embodiment, the step of determining the set of integers includes:
[0052] Based on the error threshold required for quantization accuracy, samples meeting the following criteria are selected: -i -∑ n>i 2 -n With 1 / q precise All integers n less than the error threshold are used to determine the integer set N; where i = round(log2q) precise ), q precise Indicates the quantization precision.
[0053] Specifically, taking a 6-bit phase shifter as an example, with a phase accuracy of 5.625°, the conventional method is to directly divide the phase by 5.625°, rounding the quotient to obtain the quantization result. Considering cases where the phase is greater than 360°, only the lower 6 bits of the quotient are used. In this case, the maximum quantization error is 5.625°. To optimize the quantization error, the decimal part of the quotient is usually considered and rounded to reduce the quantization error. The maximum quantization error after rounding is 2.8125°. In this application, the quantization process can be expressed by the following formula:
[0054]
[0055] For a 6-bit phase shifter, the quantization process can be transformed from division into the following formula:
[0056]
[0057] For any We can approximate it using 2 raised to the power of negative N. When N is large enough, the fit is... The accuracy is also high enough that the approximation relationship can be expressed by the following formula:
[0058]
[0059] Where i = round(log2q) precise ), where n is a number greater than i.
[0060] For a 32-bit data set, where the maximum value of n is 31, the set of integers can be obtained through the following steps:
[0061] Start: The process begins and enters the initialization phase.
[0062] Variable assignment:
[0063] Define q remain The initial value is 2 -i -q precise ;
[0064] Initialize N: Set N = i + 1;
[0065] Error judgment: Determine q remain ≥2 -N Is it true or false?
[0066] If true: Store N in a list, add the current N to the integer set N; then update q. remain =q remain -2 -N Then return to the error judgment step and continue to try to correct the error by a larger N;
[0067] If not true: skip storage, return directly to error judgment, and try the next N;
[0068] Termination judgment: q is continuously adjusted within the loop. remain Then, determine q. remain ≤threshold:
[0069] Condition met: Process ends;
[0070] If not satisfied: Return to the error judgment stage and continue iterative correction.
[0071] The values in the N list generated by the above process are used as the values of n to construct the Lagrange equation. Since all values are powers of 2, they are simple shift operations in the implementation of a programmable gate array, requiring very few resources; the operation can be completed with just a few adders.
[0072] In one embodiment, to reduce quantization error, the quantization precision needs to be maintained at (M+K+1)-bit when quantizing data from the (M+K)-bit phase shifter. Increasing the quantization precision by one bit is for data rounding. Due to the characteristics of binary, the least significant bit is half the value of the most significant bit. In the actual data quantization calculation process, if the least significant bit is quantized to 1, it indicates that the fractional part is greater than 0.5, requiring a carry-over. The initial quantization result is then rounded to optimize the final quantization result.
[0073] result = D[Q:1] + D[0]
[0074] Where, result is the final quantization result, D[Q:1] is the binary data from the most significant bit to the second least significant bit of the quantization result, D[0] is the least significant bit of the quantization result, and Q is the quantization bit width.
[0075] Compare the resource consumption of data quantization using Lagrange approximation and dividers, taking 6-bit data quantization as an example.
[0076]
[0077] Based on a comparison of single-channel resource usage, the Lagrange approximation method achieves data quantization with less resource consumption.
[0078] It should be understood that, although Figure 1 The steps in the flowchart are shown sequentially as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order in which these steps are executed, and they can be performed in other orders. Figure 1 At least some of the steps in the process may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be executed in turn or alternately with other steps or at least some of the sub-steps or stages of other steps.
[0079] In one embodiment, such as Figure 2 As shown, a data quantization device based on Lagrange approximation is provided, comprising: a data processing module 202, a parameter setting module 204, a preliminary quantization module 206, and a final quantization module 208, wherein:
[0080] Data processing module 202 is used to perform point-to-point processing on the target data to be quantized;
[0081] The parameter setting module 204 is used to determine the parameters for Lagrange approximation according to the preset quantization accuracy requirements; the parameters include an integer i and an integer set N;
[0082] The preliminary quantization module 206 is used to construct a Lagrange approximation formula based on the integer i and the set of integers N, and to perform operations on the target data through combinational logic to obtain the preliminary quantization result;
[0083] The final quantization module 208 is used to round up the preliminary quantization result to obtain the final quantization result.
[0084] In one embodiment, the target data is the phase data of a phased array antenna, and the bit width of the phase data is (M+K)-bit; the data processing module 202 is also used to multiply a float type target data by 2^K, truncate it to an integer, and convert it into a (M+K)-bit binary data; wherein the high M bits are the integer part and the low K bits are the fractional part.
[0085] In one embodiment, the parameter setting module 204 is further configured to filter parameters that meet the quantization accuracy requirement based on the error threshold. -i- ∑ n>i 2 -n With 1 / q precise All integers n less than the error threshold are used to determine the integer set N; where i = round(log2q) precise ), q precise Indicates the quantization precision.
[0086] In one embodiment, the final quantization module 208 is further configured to perform rounding optimization on the preliminary quantization result to obtain the final quantization result as follows:
[0087] result = D[Q:1] + D[0]
[0088] Where, result is the final quantization result, D[Q:1] is the binary data from the most significant bit to the second least significant bit of the quantization result, D[0] is the least significant bit of the quantization result, and Q is the quantization bit width.
[0089] Specific limitations regarding the data quantization device based on Lagrange approximation can be found in the limitations of the data quantization method based on Lagrange approximation mentioned above, and will not be repeated here. Each module in the aforementioned data quantization device based on Lagrange approximation can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device, or stored in the memory of a computer device as software, so that the processor can call and execute the operations corresponding to each module.
[0090] In one embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be as follows: Figure 3 As shown, the computer device includes a processor, memory, network interface, and database connected via a system bus. The processor provides computational and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and the database. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The database stores target data. The network interface communicates with external terminals via a network connection. When executed by the processor, the computer program implements a data quantization method based on Lagrange approximation.
[0091] Those skilled in the art will understand that Figure 3 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[0092] In one embodiment, a computer device is provided, including a memory and a processor, the memory storing a computer program, the processor executing the computer program to implement the steps of the method described above.
[0093] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon, which, when executed by a processor, implements the steps of the method described above.
[0094] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, storage, databases, or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), Rambus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.
[0095] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0096] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of the invention. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.
Claims
1. A data quantization method based on Lagrange approximation, characterized in that, The method includes: Perform point-to-point processing on the target data to be quantified; Based on the pre-set quantization accuracy requirements, the parameters for performing the Lagrange approximation are determined; the parameters include an integer i and an integer set N; Based on the integer i and the set of integers N, a Lagrange approximation formula is constructed, and the target data is processed by combinational logic to obtain preliminary quantization results; The preliminary quantization results are rounded to obtain the final quantization results.
2. The method according to claim 1, characterized in that, The target data is the phase data of the phased array antenna, and the bit width of the phase data is (M+K)-bit; Target data to be quantified is processed using point-to-point methods, including: For a target data of type float, multiply it by 2^K, truncate it to an integer, and convert it into a (M+K)-bit binary data; where the high M bits are the integer part and the low K bits are the fractional part.
3. The method according to claim 1, characterized in that, The steps to determine the set of integers include: Based on the error threshold required for quantization accuracy, samples meeting the following criteria are selected: -i -∑ n>i 2 -n With 1 / q precise All integers n less than the error threshold are used to determine the integer set N; where i = round(log2q) precise ), q precise Indicates the quantization precision.
4. The method according to claim 1, characterized in that, The preliminary quantization results are rounded to obtain the final quantization results, including: The preliminary quantization result was rounded to obtain the final quantization result: result = D[Q:1] + D[0] Where, result is the final quantization result, D[Q:1] is the binary data from the most significant bit to the second least significant bit of the quantization result, D[0] is the least significant bit of the quantization result, and Q is the quantization bit width.
5. A data quantization device based on Lagrange approximation, characterized in that, The device includes: The data processing module is used to perform point-to-point processing on the target data to be quantized; The parameter setting module is used to determine the parameters for Lagrange approximation based on the preset quantization accuracy requirements; the parameters include an integer i and an integer set N; The preliminary quantization module is used to construct a Lagrange approximation formula based on the integer i and the set of integers N, and to perform operations on the target data through combinational logic to obtain the preliminary quantization result; The final quantization module is used to round and optimize the preliminary quantization results to obtain the final quantization results.
6. The apparatus according to claim 5, characterized in that, The target data is the phase data of the phased array antenna, and the bit width of the phase data is (M+K)-bit. The data processing module is also used to multiply a float type target data by 2^K, truncate it to an integer, and convert it into a (M+K)-bit binary data. The high M bits are the integer part and the low K bits are the fractional part.
7. The apparatus according to claim 5, characterized in that, The parameter setting module is also used to filter parameters that meet the error threshold required for quantization accuracy, based on the threshold value. -i -∑ n>i 2 -n With 1 / q precise All integers n less than the error threshold are used to determine the integer set N; where i = round(log2q) precise ), q precise Indicates the quantization precision.
8. The apparatus according to claim 5, characterized in that, The final quantization module is also used to round the preliminary quantization result to obtain the final quantization result: result = D[Q:1] + D[0] Where, result is the final quantization result, D[Q:1] is the binary data from the most significant bit to the second least significant bit of the quantization result, D[0] is the least significant bit of the quantization result, and Q is the quantization bit width.
9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 4.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 4.