CN113961168A - Data processing method and device, electronic equipment and storage medium - Google Patents

Data processing method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN113961168A
CN113961168A CN202111220739.XA CN202111220739A CN113961168A CN 113961168 A CN113961168 A CN 113961168A CN 202111220739 A CN202111220739 A CN 202111220739A CN 113961168 A CN113961168 A CN 113961168A
Authority
CN
China
Prior art keywords
data
value
preset
determining
result
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202111220739.XA
Other languages
Chinese (zh)
Inventor
李晓明
郑波浪
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Shengzhe Science & Technology Co ltd
Original Assignee
Beijing Shengzhe Science & Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Shengzhe Science & Technology Co ltd filed Critical Beijing Shengzhe Science & Technology Co ltd
Priority to CN202111220739.XA priority Critical patent/CN113961168A/en
Publication of CN113961168A publication Critical patent/CN113961168A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F7/00Methods or arrangements for processing data by operating upon the order or content of the data handled
    • G06F7/38Methods or arrangements for performing computations using exclusively denominational number representation, e.g. using binary, ternary, decimal representation
    • G06F7/48Methods or arrangements for performing computations using exclusively denominational number representation, e.g. using binary, ternary, decimal representation using non-contact-making devices, e.g. tube, solid state device; using unspecified devices
    • G06F7/544Methods or arrangements for performing computations using exclusively denominational number representation, e.g. using binary, ternary, decimal representation using non-contact-making devices, e.g. tube, solid state device; using unspecified devices for evaluating functions by calculation
    • G06F7/552Powers or roots, e.g. Pythagorean sums

Landscapes

  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Engineering & Computer Science (AREA)
  • Computational Mathematics (AREA)
  • Mathematical Analysis (AREA)
  • Pure & Applied Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Computing Systems (AREA)
  • Mathematical Optimization (AREA)
  • General Engineering & Computer Science (AREA)
  • Power Sources (AREA)

Abstract

The embodiment of the invention discloses a data processing method, a data processing device, electronic equipment and a storage medium. When the data to be processed comprise the evolution operation data, the evolution operation data are amplified based on the preset amplification factor, the reference data corresponding to the evolution operation data are determined, the reference data are respectively compared with all preset threshold values obtained by calculating all threshold coefficients, the target threshold coefficient is determined in all the preset threshold values based on the comparison result, further, a table lookup value result is determined based on the target threshold coefficient, a pre-generated offline evolution table and the reference data, a data processing result corresponding to the evolution operation data is determined according to the table lookup value result and the preset amplification factor, the data to be processed are updated based on the data processing result, the data to be processed are processed based on small storage and small calculation cost, and the data processing efficiency is improved. In addition, the method can also be effectively operated on low-power-consumption platforms such as Soc or FPGA.

Description

Data processing method and device, electronic equipment and storage medium
Technical Field
The embodiment of the invention relates to the technical field of signal processing, in particular to a data processing method and device, electronic equipment and a storage medium.
Background
The squaring operation sqrt (x) is a commonly used numerical calculation rule. However, it is difficult to calculate an accurate squaring operation result, and the existing squaring operation implementation method is generally a software implementation method based on an iterative algorithm, such as CORDIC. However, the software implementation method based on the iterative algorithm has a large calculation amount, so that the time required by the evolution calculation is long, the occupied memory during the calculation is also large, and the applicability is good on a CPU with a floating-point operation unit, such as a computer and a server, but the software implementation method cannot be effectively operated on a Soc or an FPGA with low power consumption.
Disclosure of Invention
The embodiment of the invention provides a data processing method and device, electronic equipment and a storage medium, which are used for reducing the time required by data processing and improving the efficiency of data processing.
In a first aspect, an embodiment of the present invention provides a data processing method, where the method includes:
determining data to be processed, if the data to be processed comprises evolution operation data, amplifying the evolution operation data based on a preset amplification factor, and determining reference data corresponding to the evolution operation data;
comparing the reference data with each preset threshold value respectively, and determining a target threshold coefficient based on a comparison result, wherein each preset threshold value is obtained by calculation based on each threshold coefficient;
acquiring an off-line square root corresponding to a preset discrete value interval, and determining a table lookup value result based on the target threshold coefficient, the off-line square root and the reference data;
and determining a data processing result corresponding to the evolution operation data based on the table lookup numerical result, the target threshold coefficient and the preset amplification coefficient, and updating the data to be processed based on the data processing result.
Optionally, the comparing the reference data with each preset threshold value respectively, and determining a target threshold coefficient based on the comparison result includes:
comparing the reference data with all preset threshold values respectively, and determining a minimum threshold value which is larger than the reference data in all the preset threshold values based on a comparison result;
and determining the threshold coefficient corresponding to the minimum threshold value as a target threshold coefficient.
Optionally, the method further includes:
calculating each preset threshold value based on each threshold coefficient, the preset amplification coefficient and the maximum value in the set discrete numerical value interval;
calculating each preset threshold value based on each threshold coefficient, the preset amplification coefficient and the maximum value in the set discrete value interval, wherein the preset threshold values satisfy the following formula:
Figure BDA0003312496560000021
wherein, THRlIs the preset threshold value, F1And M is the maximum value in the set discrete value interval, and l is the threshold coefficient.
Optionally, the determining a table lookup value result based on the target threshold coefficient, the offline square-off table, and the reference data includes:
determining a look-up table index value based on the target threshold coefficient and the reference data;
determining a table lookup value result based on the table lookup index value and the offline squaring table;
the offline square-root table comprises each table entry index value and a table entry result corresponding to each table entry index value.
Optionally, the table lookup index value is determined based on the target threshold coefficient and the reference data, and the following formula is satisfied:
index=round(x′/4l)
wherein, index is the index value of the look-up table, x' is the reference data, l is the target threshold coefficient, and round () represents rounding processing according to the set number of bits.
Optionally, the determining a data processing result corresponding to the evolution operation data based on the table lookup result, the target threshold coefficient, and the preset amplification coefficient includes:
calculating a displacement dimension corresponding to the evolution operation data based on the preset amplification factor and the target threshold coefficient;
determining a data processing result corresponding to the evolution operation data based on the displacement dimension and the table lookup numerical result;
wherein, the data processing result corresponding to the evolution operation data is determined based on the displacement dimension and the table lookup numerical result, and the following formula is satisfied:
out=y/shift
wherein out is the data processing result, y is the table lookup numerical result, and shift is the displacement dimension.
Optionally, the shift dimension corresponding to the reference data is calculated based on the preset amplification factor and the target threshold coefficient, and the following formula is satisfied:
shift=sqrt(F1)/2l
wherein, F1And l is the target threshold coefficient, sqrt () represents that the square value calculation is carried out, and shift is the displacement dimension corresponding to the reference data.
In a second aspect, an embodiment of the present invention further provides a data processing apparatus, where the apparatus includes:
the numerical value amplification module is used for determining data to be processed, if the data to be processed comprises evolution operation data, amplifying the evolution operation data based on a preset amplification factor, and determining reference data corresponding to the evolution operation data;
the threshold comparison module is used for comparing the reference data with each preset threshold value respectively and determining a target threshold coefficient based on the comparison result, wherein each preset threshold value is obtained by calculation based on each threshold coefficient;
the table look-up module is used for acquiring an off-line square root corresponding to a preset discrete value interval and determining a table look-up value result based on the target threshold coefficient, the off-line square root and the reference data;
and the numerical value synthesis module is used for determining a data processing result corresponding to the evolution operation data based on the table lookup numerical value result, the target threshold coefficient and the preset amplification coefficient, and updating the data to be processed based on the data processing result.
In a third aspect, an embodiment of the present invention further provides an electronic device, where the electronic device includes:
one or more processors;
a storage device for storing one or more programs,
when executed by the one or more processors, cause the one or more processors to implement a data processing method as provided by any of the embodiments of the invention.
In a fourth aspect, the embodiments of the present invention further provide a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements the data processing method according to any of the embodiments of the present invention.
The embodiment of the invention has the following advantages or beneficial effects:
when the data to be processed is determined to comprise the evolution operation data, the evolution operation data is amplified based on the preset amplification factor, the reference data corresponding to the evolution operation data is determined, the reference data is respectively compared with each preset threshold value obtained by calculating each threshold coefficient, the target threshold coefficient is determined in each preset threshold value based on the comparison result, further, the table look-up numerical result is determined based on the target threshold coefficient, the pre-generated off-line evolution table and the reference data, the data processing result corresponding to the evolution operation data is determined according to the table look-up numerical result and the preset amplification factor, the data to be processed is updated based on the data processing result, the determination of the data processing result based on the off-line evolution table is realized, and the data to be processed can be completed based on small storage and small calculation expense due to the small storage space occupied by the off-line evolution table, and further improve data processing efficiency. In addition, the method can also effectively operate on low-power-consumption platforms such as Soc or FPGA, and the like, and solves the technical problem that the low-power-consumption platforms such as Soc or FPGA and the like in the prior art cannot process evolution operation data.
Drawings
In order to more clearly illustrate the technical solutions of the exemplary embodiments of the present invention, a brief description is given below of the drawings used in describing the embodiments. It should be clear that the described figures are only views of some of the embodiments of the invention to be described, not all, and that for a person skilled in the art, other figures can be derived from these figures without inventive effort.
Fig. 1 is a schematic flowchart of a data processing method according to an embodiment of the present invention;
fig. 2A is a schematic flowchart of a data processing method according to a second embodiment of the present invention;
fig. 2B is a schematic flowchart of another data processing method according to a second embodiment of the present invention;
fig. 3 is a schematic structural diagram of a data processing apparatus according to a third embodiment of the present invention;
fig. 4 is a schematic structural diagram of an electronic device according to a fourth embodiment of the present invention.
Detailed Description
The present invention will be described in further detail with reference to the accompanying drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the invention and are not limiting of the invention. It should be further noted that, for the convenience of description, only some of the structures related to the present invention are shown in the drawings, not all of the structures.
Before describing the data processing method provided by the present embodiment, an application scenario of the data processing method is exemplarily described. For example, in design and development of communication receiver schemes, it is often necessary to convert power values obtained by conjugate multiplication or square accumulation into amplitude values, which requires the use of an evolution operation; or, when calculating the root mean square value of the signal, it is necessary to perform an operation of squaring the mean square value (average power) of the signal; alternatively, when calculating the Root Mean Square Error (RMSE) of a signal, it is necessary to perform an operation of squaring the Mean Square Error (MSE) of the signal, and the like.
Example one
Fig. 1 is a schematic flow chart of a data processing method according to an embodiment of the present invention, where the present embodiment is applicable to a case where data to be processed includes evolution operation data, and the evolution operation data is processed, the method may be executed by a data processing apparatus, and the apparatus may be implemented by hardware and/or software, and the method specifically includes the following steps:
s110, determining data to be processed, if the data to be processed comprises evolution operation data, amplifying the evolution operation data based on a preset amplification factor, and determining reference data corresponding to the evolution operation data.
The data to be processed may be low-power consumption platforms such as Soc and FPGA, or current data to be processed on a computer or a server. For example, the application program may send a data processing request to a processor of a low-power Soc, FPGA, or other platform when processing the request, where the data processing request may include data to be processed, so that the low-power Soc, FPGA, or other platform performs data processing on the data to be processed.
In this embodiment, after the to-be-processed data is acquired, it is determined whether the to-be-processed data includes the evolution data, and if so, the evolution data is further amplified. Illustratively, the evolution data may be data in the design and development of a communication receiver scheme, such as power values for which amplitude values need to be calculated, average power for which root mean square values need to be calculated, mean square error for which root mean square error needs to be calculated, etc.
Specifically, the processing of amplifying the evolution operation data based on a preset amplification factor may be: and multiplying the evolution operation data by a preset amplification factor, and determining a multiplication result as reference data corresponding to the evolution operation data. Wherein the predetermined amplification factor may be an even power of 2, e.g., 216. In this embodiment, the preset amplification factor may be used to define a minimum value of the evolution data, that is, the minimum value of the evolution data processed by the data processing method provided in this embodiment is not less than the preset amplification factor. Can be used forOptionally, a maximum threshold value may be set to limit the maximum value of the evolution data. In an exemplary manner, the first and second electrodes are,
Figure BDA0003312496560000071
wherein, F1 and F2 respectively represent a preset amplification factor and a maximum threshold value, respectively determine a minimum value and a maximum value of the evolution data which can be solved by the method to solve the evolution value, and x represents the evolution data.
Illustratively, with a preset amplification factor of 216For example, the process of amplifying the square root operation data may be: x ═ x × F1Wherein x' is reference data corresponding to the evolution data, i.e. the amplified result of the evolution data, F1X is the evolution data for the predetermined amplification factor. For example, x is 0.5, x' is 0.5 x 216=32768。
And S120, comparing the reference data with each preset threshold value respectively, and determining a target threshold coefficient based on the comparison result, wherein each preset threshold value is obtained by calculation based on each threshold coefficient.
In this embodiment, after the square root operation data is amplified, the reference data obtained by the amplification process needs to be further subjected to a numerical conversion process, so as to map the square root operation data into the set discrete numerical value interval of the offline square root table.
Specifically, the reference data is compared with preset threshold values obtained by calculating threshold coefficients respectively, and a target threshold coefficient is determined in each preset threshold coefficient according to a comparison result. In an optional implementation manner, the comparing the reference data with each preset threshold respectively, and determining the target threshold coefficient based on the comparison result may be: comparing the reference data with all preset threshold values respectively, and determining a minimum threshold value which is larger than the reference data in all the preset threshold values based on a comparison result; and determining the threshold coefficient corresponding to the minimum threshold value as a target threshold coefficient.
That is, the reference data is compared with each preset threshold value, the minimum threshold coefficient causing the preset threshold value to be larger than the reference data is found, and the minimum threshold coefficient is determined as the target threshold coefficient. In the comparison process, the reference data and the preset threshold values can be compared one by one in sequence according to the sequence from small to large of the preset threshold values, and then when the preset threshold value larger than the reference data is compared for the first time, the corresponding threshold coefficient is determined as the target threshold coefficient, so that the minimum threshold value is rapidly determined, all the preset threshold values do not need to be compared at one time, and the data processing efficiency is improved.
Illustratively, the method further includes calculating each preset threshold value based on each threshold coefficient, the preset amplification coefficient, and a maximum value within the set discrete value interval; calculating each preset threshold value based on each threshold coefficient, the preset amplification coefficient and the maximum value in the set discrete value interval, wherein the preset threshold values satisfy the following formula:
Figure BDA0003312496560000081
wherein, THRlIs the preset threshold value, F1And M is the maximum value in the set discrete value interval, and l is the threshold coefficient.
In this alternative embodiment, the discrete value interval is set to be the range of discrete values in the off-line evolution table for calculating the evolution value, and the discrete value interval is set to be [1,255] as an example]The maximum value in the discrete value interval is set to the upper limit of the discrete value interval, which is 255 in the above example. Through the formula, the preset threshold value corresponding to each middle threshold coefficient can be calculated, and then each preset threshold value is compared with the reference data. For example, a value of l-0,
Figure BDA0003312496560000091
...;l=3,
Figure BDA0003312496560000092
Figure BDA0003312496560000093
l=4,
Figure BDA0003312496560000094
and x' is 32768, the target threshold value is 65536 and the target threshold coefficient is 4.
S130, obtaining an off-line square root corresponding to a preset discrete value interval, and determining a table lookup value result based on the target threshold coefficient, the off-line square root and the reference data.
The offline root table may be a root table containing root results corresponding to respective numbers in the set discrete value interval. The set discrete value interval can be set according to actual requirements, and it should be noted that the larger the set discrete value interval is, the more the number of entries stored in the offline evolution table is, the larger the memory occupied is, and the higher the precision of the processing result of evolution operation data is; the smaller the discrete value interval is set, the smaller the number of entries stored in the offline evolution table is, the smaller the memory occupied is, and the lower the accuracy of the processing result of evolution operation data is. Illustratively, the discrete value interval may be set to [1,255 ].
In this embodiment, the offline opening table may be stored in a form of a two-dimensional array, which may include entries and entry contents. For example, the offline evolution table may be a two-dimensional offline table sqrtable (M,2), where the entry may be sqrtable (i,1) ═ i, and the entry content may be qrtable (i,2) ═ sqrt (i), where i ═ 1, 2.
Specifically, the obtaining of the offline square table corresponding to the preset discrete value interval may be: and reading the offline square root table corresponding to the set discrete value interval from the memory or the local disk, and if the offline square root table does not exist in the memory or the local disk, generating the offline square root table corresponding to the set discrete value interval. That is, the method can generate a primary offline square root table to be stored in the memory or the local disk before data processing is performed on each piece of data to be processed, and further directly read the generated offline square root table without being generated again when data processing is performed on each piece of data to be processed.
Further, after the offline evolution table is obtained, numerical value conversion processing may be performed on the reference data based on the target threshold coefficient to determine a mapping value of the evolution operation data in a set discrete numerical value interval corresponding to the offline evolution table, and then a corresponding table lookup numerical value result is searched in the offline evolution table based on the mapping value.
S140, determining a data processing result corresponding to the evolution operation data based on the table lookup numerical result, the target threshold coefficient and the preset amplification coefficient, and updating the data to be processed based on the data processing result.
After the table lookup numerical result is determined, the table lookup numerical result, the target threshold coefficient and the preset amplification coefficient can be integrated to calculate a data processing result corresponding to the evolution operation data.
Illustratively, the determining a data processing result corresponding to the evolution operation data based on the table lookup result, the target threshold coefficient and the preset amplification coefficient includes: calculating a displacement dimension corresponding to the evolution operation data based on the preset amplification factor and the target threshold coefficient; determining a data processing result corresponding to the evolution operation data based on the displacement dimension and the table lookup numerical result; wherein, the data processing result corresponding to the evolution operation data is determined based on the displacement dimension and the table lookup numerical result, and the following formula is satisfied:
out=y/shift
wherein out is the data processing result, y is the table lookup numerical result, and shift is the displacement dimension. For example, y 11.3137, shift 16,
Figure BDA0003312496560000101
optionally, the shift dimension corresponding to the reference data is calculated based on the preset amplification factor and the target threshold coefficient, and the following formula is satisfied:
shift=sqrt(F1)/2l
wherein, F1And l is the target threshold coefficient, sqrt () represents that the square value calculation is carried out, and shift is the displacement dimension corresponding to the reference data. Through the formula, the shift dimension corresponding to the reference data can be accurately calculated, and then the data processing result of the evolution operation data, namely the approximate calculation result of the evolution operation data, is determined based on the shift dimension and the table lookup numerical result. For example, F1=216,l=4,shift=16。
Further, the data to be processed can be updated by the data processing result. For example, the data processing result is taken as the data to be processed, to perform subsequent numerical calculation processing based on the data to be processed, or to return to the application program.
According to the technical scheme of the embodiment, when the data to be processed comprise the evolution operation data, the evolution operation data are amplified based on the preset amplification factor, the reference data corresponding to the evolution operation data are determined, the reference data are respectively compared with each preset threshold value obtained by calculating each threshold coefficient, the target threshold coefficient is determined in each preset threshold value based on the comparison result, further, the table lookup numerical value result is determined based on the target threshold coefficient, the pre-generated offline evolution table and the reference data, the data processing result corresponding to the evolution operation data is determined according to the table lookup numerical value result and the preset amplification factor, the data to be processed is updated based on the data processing result, the determination of the data processing result based on the offline evolution table is realized, and the data to be processed can be completed based on small storage and small calculation expense due to the fact that the offline evolution table occupies a small storage space, and further improve data processing efficiency. In addition, the method can also effectively operate on low-power-consumption platforms such as Soc or FPGA, and the like, and solves the technical problem that the low-power-consumption platforms such as Soc or FPGA and the like in the prior art cannot process evolution operation data.
Example two
Fig. 2A is a schematic flow chart of a data processing method according to a second embodiment of the present invention, where on the basis of the second embodiment, optionally, the determining a table lookup value result based on the target threshold coefficient, the offline square-root table, and the reference data includes: determining a look-up table index value based on the target threshold coefficient and the reference data; determining a table lookup value result based on the table lookup index value and the offline squaring table; the offline square-root table comprises each table entry index value and a table entry result corresponding to each table entry index value. Wherein explanations of the same or corresponding terms as those of the above embodiments are omitted. Referring to fig. 2A, the data processing method provided in this embodiment includes the following steps:
s210, determining data to be processed, if the data to be processed comprises evolution operation data, amplifying the evolution operation data based on a preset amplification factor, and determining reference data corresponding to the evolution operation data.
S220, comparing the reference data with each preset threshold value respectively, and determining a target threshold coefficient based on the comparison result, wherein each preset threshold value is obtained by calculation based on each threshold coefficient.
And S230, acquiring an offline evolution table corresponding to a preset discrete value interval, and determining a table look-up index value based on the target threshold coefficient and the reference data, wherein the offline evolution table comprises each table entry index value and a table entry result corresponding to each table entry index value.
In this embodiment, the index value looked up in the offline square table, that is, the look-up table index value, may be calculated through the target threshold coefficient and the reference data. Optionally, the table lookup index value is determined based on the target threshold coefficient and the reference data, and the following formula is satisfied:
index=round(x′/4l)
wherein, index is the index value of the look-up table, x' is the reference data, l is the target threshold coefficient, and round () represents rounding processing according to the set number of bits. Illustratively, using the above example, x' 32768, l 4, and index 128. By the formula, the index value of the lookup table can be accurately calculated, and then the lookup table numerical result corresponding to the evolution operation data is searched in the off-line evolution table based on the index value of the lookup table.
S240, determining a table lookup value result based on the table lookup index value and the offline evolution table.
Specifically, the table lookup index value may be matched with each table entry index value in the offline square root table, and the table entry result corresponding to the matched table entry index value is determined as a table lookup numerical result.
Illustratively, the lookup table value result y is sqrt _ able (index, 2). For example, index 128, y sqrtable (128,2), sqrt (128), 11.3137.
S250, determining a data processing result corresponding to the evolution operation data based on the table lookup numerical result, the target threshold coefficient and the preset amplification coefficient, and updating the data to be processed based on the data processing result.
Optionally, this embodiment further provides a data processing method, where the method includes the following steps:
step 1, acquiring data x to be processed, and if the data x to be processed comprises evolution operation data, amplifying the evolution operation data by a preset amplification factor to obtain reference data x';
step 2, converting the reference data to a set discrete value interval corresponding to the off-line evolution table, comprising: (1) respectively connecting the reference data x' with each preset threshold value THRlComparing to determine a target threshold coefficient l corresponding to the minimum preset threshold value larger than the reference data x'; (2) calculating a table look-up index value index based on the target threshold coefficient l and the reference data x'; (3) based on a predetermined amplification factor F1Calculating a shift dimension shift by using the target threshold coefficient l;
step 3, searching a table lookup value result y in the off-line squaring table according to the table lookup index value index;
step 4, calculating a data processing result out corresponding to the evolution operation data x based on the shift dimension shift and the table lookup numerical result y;
and 5, updating the data to be processed based on the data processing result.
Illustratively, as shown in fig. 2B, a flow diagram of another data processing method is shown. Firstly, carrying out numerical value interval conversion processing on the square operation data x to obtain a look-up table index value index; then, in a table look-up module, based on a pre-generated off-line evolution table, looking up a table look-up numerical result corresponding to evolution operation data; finally, based on the searched table lookup numerical result and the movement dimension, determining a data processing result of the evolution operation data, and outputting the data processing result as an output signal
According to the technical scheme of the embodiment, when the data to be processed comprise the evolution operation data, the evolution operation data are amplified based on the preset amplification factor, the reference data corresponding to the evolution operation data are determined, the reference data are respectively compared with each preset threshold value obtained by calculating each threshold coefficient, the target threshold coefficient is determined in each preset threshold value based on the comparison result, further, the table lookup index value is determined based on the target threshold coefficient and the reference data, the table lookup numerical result is determined in the off-line evolution table through the table lookup index value, the data processing result corresponding to the evolution operation data is determined according to the table lookup numerical result and the preset amplification factor, the data to be processed are updated based on the data processing result, the determination of the data processing result based on the query off-line evolution table is realized, and because the off-line evolution table occupies a small storage space, the method can complete the processing of the data to be processed based on small storage and small calculation overhead, thereby improving the data processing efficiency. In addition, the method can also effectively operate on low-power-consumption platforms such as Soc or FPGA, and the like, and solves the technical problem that the low-power-consumption platforms such as Soc or FPGA and the like in the prior art cannot process evolution operation data.
EXAMPLE III
Fig. 3 is a schematic structural diagram of a data processing apparatus according to a third embodiment of the present invention, where the data to be processed includes evolution operation data, and the data processing apparatus specifically includes: a value amplification module 310, a threshold comparison module 320, a look-up table module 330, and a value synthesis module 340.
The numerical value amplification module 310 is configured to determine to-be-processed data, and if the to-be-processed data includes evolution operation data, perform amplification processing on the evolution operation data based on a preset amplification factor to determine reference data corresponding to the evolution operation data;
a threshold comparison module 320, configured to compare the reference data with each preset threshold value, and determine a target threshold coefficient based on a comparison result, where each preset threshold value is calculated based on each threshold coefficient;
the table look-up module 330 is configured to obtain an offline square root table corresponding to a preset discrete value interval, and determine a table look-up value result based on the target threshold coefficient, the offline square root table, and the reference data;
a numerical value integration module 340, configured to determine a data processing result corresponding to the evolution operation data based on the table lookup numerical value result, the target threshold coefficient, and the preset amplification coefficient, and update the to-be-processed data based on the data processing result.
Optionally, the threshold comparing module 320 includes a coefficient determining unit, where the coefficient determining unit is configured to compare the reference data with each preset threshold value, and determine, based on a comparison result, a minimum threshold value greater than the reference data in each preset threshold value; and determining the threshold coefficient corresponding to the minimum threshold value as a target threshold coefficient.
Optionally, the apparatus further includes a threshold calculation module, configured to calculate each preset threshold value based on each threshold coefficient, the preset amplification coefficient, and a maximum value in the set discrete value interval; calculating each preset threshold value based on each threshold coefficient, the preset amplification coefficient and the maximum value in the set discrete value interval, wherein the preset threshold values satisfy the following formula:
Figure BDA0003312496560000151
wherein, THRlIs the preset threshold value, F1And M is the maximum value in the set discrete value interval, and l is the threshold coefficient.
Optionally, the table lookup module 330 includes an index lookup unit, configured to determine a table lookup index value based on the target threshold coefficient and the reference data; determining a table lookup value result based on the table lookup index value and the offline squaring table; the offline square-root table comprises each table entry index value and a table entry result corresponding to each table entry index value.
Optionally, the index searching unit is specifically configured to determine a look-up table index value according to the following formula:
index=round(x′/4l)
wherein, index is the index value of the look-up table, x' is the reference data, l is the target threshold coefficient, and round () represents rounding processing according to the set number of bits.
Optionally, the numerical integration module 340 includes a result determining unit, configured to calculate a shift dimension corresponding to the evolution operation data based on the preset amplification factor and the target threshold coefficient; determining a data processing result corresponding to the evolution operation data based on the displacement dimension and the table lookup numerical result; wherein, the data processing result corresponding to the evolution operation data is determined based on the displacement dimension and the table lookup numerical result, and the following formula is satisfied:
out=y/shift
wherein out is the data processing result, y is the table lookup numerical result, and shift is the displacement dimension.
Optionally, the result determining unit calculates a shift dimension corresponding to the reference data based on the following formula:
shift=sqrt(F1)/2l
wherein, F1And l is the target threshold coefficient, sqrt () represents that the square value calculation is carried out, and shift is the displacement dimension corresponding to the reference data.
In this embodiment, when it is determined that the data to be processed includes the squaring operation data, the squaring operation data is amplified based on a preset amplification factor by the numerical amplification module, reference data corresponding to the squaring operation data is determined, the reference data is compared with each preset threshold value calculated by each threshold coefficient by the threshold comparison module, a target threshold coefficient is determined in each preset threshold value based on the comparison result, a table lookup result is determined based on the target threshold coefficient, a pre-generated offline squaring table and the reference data by the table lookup module, a data processing result corresponding to the squaring operation data is determined according to the table lookup result and the preset amplification factor by the numerical integration module to update the data to be processed based on the data processing result, determination of the offline data processing result based on the offline squaring table is achieved, since the squaring table occupies a small storage space, therefore, the method can complete the processing of the data to be processed based on small storage and small calculation overhead, thereby improving the data processing efficiency. In addition, the method can also effectively operate on low-power-consumption platforms such as Soc or FPGA, and the like, and solves the technical problem that the low-power-consumption platforms such as Soc or FPGA and the like in the prior art cannot process evolution operation data.
The data processing device provided by the embodiment of the invention can execute the data processing method provided by any embodiment of the invention, and has corresponding functional modules and beneficial effects of the execution method.
It should be noted that, the units and modules included in the system are merely divided according to functional logic, but are not limited to the above division as long as the corresponding functions can be realized; in addition, specific names of the functional units are only for convenience of distinguishing from each other, and are not used for limiting the protection scope of the embodiment of the invention.
Example four
Fig. 4 is a schematic structural diagram of an electronic device according to a fourth embodiment of the present invention. FIG. 4 illustrates a block diagram of an exemplary electronic device 12 suitable for use in implementing embodiments of the present invention. The electronic device 12 shown in fig. 4 is only an example and should not bring any limitation to the function and the scope of use of the embodiment of the present invention. The device 12 is typically an electronic device that undertakes data processing functions.
As shown in FIG. 4, electronic device 12 is embodied in the form of a general purpose computing device. The components of electronic device 12 may include, but are not limited to: one or more processors or processing units 16, a memory 28, and a bus 18 that couples the various components (including the memory 28 and the processing unit 16).
Bus 18 represents one or more of any of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, and a processor or local bus using any of a variety of bus architectures. By way of example, such architectures include, but are not limited to, an Industry Standard Architecture (ISA) bus, a Micro Channel Architecture (MCA) bus, an enhanced ISA bus, a Video Electronics Standards Association (VESA) local bus, and a Peripheral Component Interconnect (PCI) bus.
Electronic device 12 typically includes a variety of computer-readable media. Such media may be any available media that is accessible by electronic device 12 and includes both volatile and nonvolatile media, removable and non-removable media.
Memory 28 may include computer device readable media in the form of volatile Memory, such as Random Access Memory (RAM) 30 and/or cache Memory 32. The electronic device 12 may further include other removable/non-removable, volatile/nonvolatile computer storage media. By way of example only, the storage device 34 may be used to read from and write to non-removable, nonvolatile magnetic media (not shown in FIG. 4, and commonly referred to as a "hard drive"). Although not shown in FIG. 4, a magnetic disk drive for reading from and writing to a removable, nonvolatile magnetic disk (e.g., a "floppy disk") and an optical disk drive for reading from or writing to a removable, nonvolatile optical disk (e.g., a Compact disk-Read Only Memory (CD-ROM), a Digital Video disk (DVD-ROM), or other optical media) may be provided. In these cases, each drive may be connected to bus 18 by one or more data media interfaces. Memory 28 may include at least one program product 40, with program product 40 having a set of program modules 42 configured to carry out the functions of embodiments of the invention. Program product 40 may be stored, for example, in memory 28, and such program modules 42 include, but are not limited to, one or more application programs, other program modules, and program data, each of which examples or some combination may comprise an implementation of a network environment. Program modules 42 generally carry out the functions and/or methodologies of the described embodiments of the invention.
Electronic device 12 may also communicate with one or more external devices 14 (e.g., keyboard, mouse, camera, etc., and display), one or more devices that enable a user to interact with electronic device 12, and/or any devices (e.g., network card, modem, etc.) that enable electronic device 12 to communicate with one or more other computing devices. Such communication may be through an input/output (I/O) interface 22. Also, the electronic device 12 may communicate with one or more networks (e.g., a Local Area Network (LAN), Wide Area Network (WAN), and/or a public Network such as the internet) via the Network adapter 20. As shown, the network adapter 20 communicates with other modules of the electronic device 12 via the bus 18. It should be understood that although not shown in the figures, other hardware and/or software modules may be used in conjunction with electronic device 12, including but not limited to: microcode, device drivers, Redundant processing units, external disk drive Arrays, disk array (RAID) devices, tape drives, and data backup storage devices, to name a few.
The processor 16 executes various functional applications and data processing by executing programs stored in the memory 28, for example, implementing the data processing method provided by the above-described embodiment of the present invention, including:
determining data to be processed, if the data to be processed comprises evolution operation data, amplifying the evolution operation data based on a preset amplification factor, and determining reference data corresponding to the evolution operation data;
comparing the reference data with each preset threshold value respectively, and determining a target threshold coefficient based on a comparison result, wherein each preset threshold value is obtained by calculation based on each threshold coefficient;
acquiring an off-line square root corresponding to a preset discrete value interval, and determining a table lookup value result based on the target threshold coefficient, the off-line square root and the reference data;
and determining a data processing result corresponding to the evolution operation data based on the table lookup numerical result, the target threshold coefficient and the preset amplification coefficient, and updating the data to be processed based on the data processing result.
Of course, those skilled in the art can understand that the processor can also implement the technical solution of the data processing method provided by any embodiment of the present invention.
EXAMPLE five
An embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements the steps of the data processing method provided in any embodiment of the present invention, where the method includes:
determining data to be processed, if the data to be processed comprises evolution operation data, amplifying the evolution operation data based on a preset amplification factor, and determining reference data corresponding to the evolution operation data;
comparing the reference data with each preset threshold value respectively, and determining a target threshold coefficient based on a comparison result, wherein each preset threshold value is obtained by calculation based on each threshold coefficient;
acquiring an off-line square root corresponding to a preset discrete value interval, and determining a table lookup value result based on the target threshold coefficient, the off-line square root and the reference data;
and determining a data processing result corresponding to the evolution operation data based on the table lookup numerical result, the target threshold coefficient and the preset amplification coefficient, and updating the data to be processed based on the data processing result.
Computer storage media for embodiments of the invention may employ any combination of one or more computer-readable media. The computer readable medium may be a computer readable signal medium or a computer readable storage medium. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples (a non-exhaustive list) of the computer readable storage medium would include the following: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the context of this document, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.
A computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device.
Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
Computer program code for carrying out operations for embodiments of the present invention may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, Smalltalk, C + + or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider).
It is to be noted that the foregoing is only illustrative of the preferred embodiments of the present invention and the technical principles employed. It will be understood by those skilled in the art that the present invention is not limited to the particular embodiments described herein, but is capable of various obvious changes, rearrangements and substitutions as will now become apparent to those skilled in the art without departing from the scope of the invention. Therefore, although the present invention has been described in greater detail by the above embodiments, the present invention is not limited to the above embodiments, and may include other equivalent embodiments without departing from the spirit of the present invention, and the scope of the present invention is determined by the scope of the appended claims.

Claims (10)

1. A method of data processing, the method comprising:
determining data to be processed, if the data to be processed comprises evolution operation data, amplifying the evolution operation data based on a preset amplification factor, and determining reference data corresponding to the evolution operation data;
comparing the reference data with each preset threshold value respectively, and determining a target threshold coefficient based on a comparison result, wherein each preset threshold value is obtained by calculation based on each threshold coefficient;
acquiring an off-line square root corresponding to a preset discrete value interval, and determining a table lookup value result based on the target threshold coefficient, the off-line square root and the reference data;
and determining a data processing result corresponding to the evolution operation data based on the table lookup numerical result, the target threshold coefficient and the preset amplification coefficient, and updating the data to be processed based on the data processing result.
2. The method of claim 1, wherein comparing the reference data with each of the preset threshold values respectively, and determining a target threshold coefficient based on the comparison result comprises:
comparing the reference data with all preset threshold values respectively, and determining a minimum threshold value which is larger than the reference data in all the preset threshold values based on a comparison result;
and determining the threshold coefficient corresponding to the minimum threshold value as a target threshold coefficient.
3. The method of claim 2, further comprising:
calculating each preset threshold value based on each threshold coefficient, the preset amplification coefficient and the maximum value in the set discrete numerical value interval;
calculating each preset threshold value based on each threshold coefficient, the preset amplification coefficient and the maximum value in the set discrete value interval, wherein the preset threshold values satisfy the following formula:
Figure FDA0003312496550000011
wherein, THRlIs the preset threshold value, F1And M is the maximum value in the set discrete value interval, and l is the threshold coefficient.
4. The method of claim 1, wherein determining a lookup table value result based on the target threshold coefficient, the offline squaring table, and the reference data comprises:
determining a look-up table index value based on the target threshold coefficient and the reference data;
determining a table lookup value result based on the table lookup index value and the offline squaring table;
the offline square-root table comprises each table entry index value and a table entry result corresponding to each table entry index value.
5. The method of claim 4, wherein determining a look-up table index value based on the target threshold coefficient and the reference data satisfies the following equation:
index=round(x′/4l)
wherein, index is the index value of the look-up table, x' is the reference data, l is the target threshold coefficient, and round () represents rounding processing according to the set number of bits.
6. The method of claim 1, wherein determining the data processing result corresponding to the evolution operation data based on the table lookup value result, the target threshold coefficient, and the preset amplification coefficient comprises:
calculating a displacement dimension corresponding to the evolution operation data based on the preset amplification factor and the target threshold coefficient;
determining a data processing result corresponding to the evolution operation data based on the displacement dimension and the table lookup numerical result;
wherein, the data processing result corresponding to the evolution operation data is determined based on the displacement dimension and the table lookup numerical result, and the following formula is satisfied:
out=y/shift
wherein out is the data processing result, y is the table lookup numerical result, and shift is the displacement dimension.
7. The method according to claim 6, wherein the step of calculating the shift dimension corresponding to the reference data based on the preset amplification factor and the target threshold factor satisfies the following formula:
shift=sqrt(F1)/2l
wherein, F1And l is the target threshold coefficient, sqrt () represents that the square value calculation is carried out, and shift is the displacement dimension corresponding to the reference data.
8. A data processing apparatus, characterized in that the apparatus comprises:
the numerical value amplification module is used for determining data to be processed, if the data to be processed comprises evolution operation data, amplifying the evolution operation data based on a preset amplification factor, and determining reference data corresponding to the evolution operation data;
the threshold comparison module is used for comparing the reference data with each preset threshold value respectively and determining a target threshold coefficient based on the comparison result, wherein each preset threshold value is obtained by calculation based on each threshold coefficient;
the table look-up module is used for acquiring an off-line square root corresponding to a preset discrete value interval and determining a table look-up value result based on the target threshold coefficient, the off-line square root and the reference data;
and the numerical value synthesis module is used for determining a data processing result corresponding to the evolution operation data based on the table lookup numerical value result, the target threshold coefficient and the preset amplification coefficient, and updating the data to be processed based on the data processing result.
9. An electronic device, characterized in that the electronic device comprises:
one or more processors;
a storage device for storing one or more programs,
when executed by the one or more processors, cause the one or more processors to implement a data processing method as claimed in any one of claims 1-7.
10. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the data processing method of any one of claims 1 to 7.
CN202111220739.XA 2021-10-20 2021-10-20 Data processing method and device, electronic equipment and storage medium Pending CN113961168A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111220739.XA CN113961168A (en) 2021-10-20 2021-10-20 Data processing method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111220739.XA CN113961168A (en) 2021-10-20 2021-10-20 Data processing method and device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN113961168A true CN113961168A (en) 2022-01-21

Family

ID=79465722

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111220739.XA Pending CN113961168A (en) 2021-10-20 2021-10-20 Data processing method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN113961168A (en)

Similar Documents

Publication Publication Date Title
CN111090628B (en) Data processing method and device, storage medium and electronic equipment
CN109783490B (en) Data fusion method and device, computer equipment and storage medium
CN109558604B (en) Machine translation method and device, electronic equipment and storage medium
CN109408834B (en) Auxiliary machine translation method, device, equipment and storage medium
CN111985831A (en) Scheduling method and device of cloud computing resources, computer equipment and storage medium
CN114528044B (en) Interface calling method, device, equipment and medium
JP2020027611A (en) Data processing method and apparatus for neural network
CN109815241B (en) Data query method, device, equipment and storage medium
CN110175128B (en) Similar code case acquisition method, device, equipment and storage medium
CN110806502A (en) Method and device for calculating effective value of Alternating Current (AC) quantity, computer equipment and storage medium
CN112419312B (en) Similar house source information detection method and device, electronic equipment and readable medium
CN111367813B (en) Automatic testing method and device for decision engine, server and storage medium
CN110309877B (en) Feature map data quantization method and device, electronic equipment and storage medium
CN113961168A (en) Data processing method and device, electronic equipment and storage medium
CN113723890B (en) Information processing method, device, equipment and storage medium
CN111049988A (en) Intimacy prediction method, system, equipment and storage medium for mobile equipment
CN113961169A (en) Data processing method and device, electronic equipment and storage medium
CN113408724A (en) Model compression method and device
CN109657126B (en) Answer generation method, device, equipment and medium
CN110222777B (en) Image feature processing method and device, electronic equipment and storage medium
CN113806556A (en) Method, device, equipment and medium for constructing knowledge graph based on power grid data
CN113011665A (en) Logistics timeliness prediction method, device, equipment and storage medium
CN112364268A (en) Resource acquisition method and device, electronic equipment and storage medium
CN113779370A (en) Address retrieval method and device
CN111949765A (en) Similar text searching method, system, equipment and storage medium based on semantics

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination