CN112182493B - Analog quantity calibration method, analog quantity calibration device, electronic equipment and storage medium - Google Patents

Analog quantity calibration method, analog quantity calibration device, electronic equipment and storage medium Download PDF

Info

Publication number
CN112182493B
CN112182493B CN202010979487.8A CN202010979487A CN112182493B CN 112182493 B CN112182493 B CN 112182493B CN 202010979487 A CN202010979487 A CN 202010979487A CN 112182493 B CN112182493 B CN 112182493B
Authority
CN
China
Prior art keywords
analog
value
values
fitting
preset
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.)
Active
Application number
CN202010979487.8A
Other languages
Chinese (zh)
Other versions
CN112182493A (en
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.)
Shenzhen Samkoon Technology Corp ltd
Original Assignee
Shenzhen Samkoon Technology Corp 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 Shenzhen Samkoon Technology Corp ltd filed Critical Shenzhen Samkoon Technology Corp ltd
Priority to CN202010979487.8A priority Critical patent/CN112182493B/en
Publication of CN112182493A publication Critical patent/CN112182493A/en
Application granted granted Critical
Publication of CN112182493B publication Critical patent/CN112182493B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F17/00Digital computing or data processing equipment or methods, specially adapted for specific functions
    • G06F17/10Complex mathematical operations
    • G06F17/15Correlation function computation including computation of convolution operations
    • GPHYSICS
    • G01MEASURING; TESTING
    • G01DMEASURING NOT SPECIALLY ADAPTED FOR A SPECIFIC VARIABLE; ARRANGEMENTS FOR MEASURING TWO OR MORE VARIABLES NOT COVERED IN A SINGLE OTHER SUBCLASS; TARIFF METERING APPARATUS; MEASURING OR TESTING NOT OTHERWISE PROVIDED FOR
    • G01D18/00Testing or calibrating apparatus or arrangements provided for in groups G01D1/00 - G01D15/00
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F17/00Digital computing or data processing equipment or methods, specially adapted for specific functions
    • G06F17/10Complex mathematical operations
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/21Design or setup of recognition systems or techniques; Extraction of features in feature space; Blind source separation
    • G06F18/214Generating training patterns; Bootstrap methods, e.g. bagging or boosting
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F30/00Computer-aided design [CAD]
    • G06F30/20Design optimisation, verification or simulation
    • G06F30/27Design optimisation, verification or simulation using machine learning, e.g. artificial intelligence, neural networks, support vector machines [SVM] or training a model
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods
    • G06N3/084Backpropagation, e.g. using gradient descent
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • General Engineering & Computer Science (AREA)
  • Mathematical Physics (AREA)
  • Evolutionary Computation (AREA)
  • Software Systems (AREA)
  • Artificial Intelligence (AREA)
  • Pure & Applied Mathematics (AREA)
  • Mathematical Optimization (AREA)
  • Mathematical Analysis (AREA)
  • Computational Mathematics (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Computing Systems (AREA)
  • Databases & Information Systems (AREA)
  • Algebra (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Molecular Biology (AREA)
  • Computational Linguistics (AREA)
  • Biophysics (AREA)
  • General Health & Medical Sciences (AREA)
  • Health & Medical Sciences (AREA)
  • Biomedical Technology (AREA)
  • Medical Informatics (AREA)
  • Computer Hardware Design (AREA)
  • Geometry (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • Evolutionary Biology (AREA)
  • Indication And Recording Devices For Special Purposes And Tariff Metering Devices (AREA)

Abstract

The invention discloses an analog quantity calibration method, an analog quantity calibration device, electronic equipment and a storage medium, wherein the analog quantity calibration method comprises the following steps: acquiring a plurality of analog input values and a plurality of corresponding analog output values; training a fitting model by utilizing the plurality of analog input values and the plurality of analog output values to obtain a fitting function; and calculating according to the fitting function to obtain a calibration result. By the analog quantity calibration method, the influence of material difference on acquisition precision can be reduced, and the data processing efficiency is improved.

Description

Analog quantity calibration method, analog quantity calibration device, electronic equipment and storage medium
Technical Field
The present invention relates to the field of data processing technologies, and in particular, to a method and apparatus for calibrating analog quantities, an electronic device, and a storage medium.
Background
The early design of analog quantity collection adopts theoretical design, and the theoretical design usually ignores the quality of circuit components and the precision of sampling chips, however, unavoidable material differences exist between sampling chips, so that the performance of chip products after measuring is inferior to the preset effect.
At present, a user performs configuration of an acquisition mode by inquiring a corresponding chip manual, then reads a sampled coding result, restores the acquired result by comparing with coding rules and the design of a peripheral circuit, further obtains an analog quantity result of the current sampling, and finally uses the result as a judging basis for executing certain actions.
Disclosure of Invention
The present invention aims to solve at least one of the technical problems existing in the prior art. Therefore, the invention provides the analog quantity calibration method, which can reduce the influence of material difference on acquisition precision, improve data processing efficiency and reduce memory occupation.
The invention also provides an analog quantity calibration device.
The invention further provides electronic equipment.
The invention also proposes a computer readable storage medium.
An analog quantity calibration method according to an embodiment of the first aspect of the present invention includes:
acquiring a plurality of analog input values and a plurality of corresponding analog output values;
training a fitting model by utilizing the plurality of analog input values and the plurality of analog output values to obtain a fitting function;
and calculating according to the fitting function to obtain a calibration result.
The analog quantity calibration method according to the embodiment of the first aspect of the invention has at least the following beneficial effects: the fitting model is trained to obtain the fitting function through the obtained analog input values and the corresponding analog output values, and the calibration result can be obtained by calculating according to the obtained fitting function, so that the influence of material difference on the acquisition precision can be reduced, the data processing efficiency is improved, and the memory occupation can be reduced.
According to some embodiments of the invention, the fitting model is obtained by: respectively taking the multiple analog input values and the multiple analog output values as inputs of a fitting model to be trained, and obtaining an actual analog output by the fitting model; calculating according to the actual analog quantity and the analog quantity output value to obtain a loss value; and updating parameters in the fitting model to be trained according to the loss value until a preset convergence condition is reached, and taking the fitting model to be trained obtained by updating finally as the fitting model.
According to some embodiments of the invention, the calculating according to the fitting function to obtain the calibration result includes: acquiring a preset input value and a corresponding preset output value; calculating according to the preset input value and the fitting function to obtain a target output value; calculating according to the preset output value and the target output value to obtain an error value; and calibrating according to the error value to obtain a calibration result.
According to some embodiments of the invention, the calibrating according to the error value, to obtain a calibration result, includes: acquiring a plurality of error values; performing variance calculation according to the error values to obtain variance values corresponding to the target output values; and calibrating according to the variance value to obtain a calibration result.
According to some embodiments of the invention, the obtaining a plurality of analog input values and a corresponding plurality of analog output values includes: and performing code conversion according to the analog input values to obtain analog output values corresponding to the analog input values.
According to some embodiments of the invention, before the obtaining the plurality of analog input values, the method further includes: obtaining a plurality of sample analog quantities; and sequentially carrying out table lookup according to the plurality of sample analog quantities to obtain a plurality of analog quantity input values.
An analog quantity calibration apparatus according to an embodiment of the second aspect of the present invention includes:
the acquisition module is used for acquiring a plurality of analog input values and a plurality of corresponding analog output values;
the training module is used for training a fitting model by utilizing the plurality of analog input values and the plurality of analog output values to obtain a fitting function;
and the calibration module is used for calculating and obtaining a calibration result according to the fitting function.
The analog quantity calibration device according to the embodiment of the second aspect of the invention has at least the following advantages: by executing the analog quantity calibration method of the embodiment of the first aspect of the invention, the influence of material difference on the acquisition precision can be reduced, and the data processing efficiency is improved.
An electronic device according to an embodiment of a third aspect of the present invention includes: at least one processor, and a memory communicatively coupled to the at least one processor; wherein the memory stores instructions for execution by the at least one processor to cause the at least one processor to implement the analog quantity calibration method of the first aspect when executing the instructions.
The electronic equipment according to the embodiment of the third aspect of the invention has at least the following beneficial effects: by executing the analog quantity calibration method of the embodiment of the first aspect of the invention, the influence of material difference on the acquisition precision can be reduced, and the data processing efficiency is improved.
A computer-readable storage medium according to an embodiment of the fourth aspect of the present invention stores computer-executable instructions for causing a computer to perform the analog quantity calibration method according to the first aspect.
The computer-readable storage medium according to the embodiment of the fourth aspect of the present invention has at least the following advantageous effects: by executing the analog quantity calibration method of the embodiment of the first aspect of the invention, the influence of material difference on the acquisition precision can be reduced, and the data processing efficiency is improved.
Additional aspects and advantages of the invention will be set forth in part in the description which follows, and in part will be obvious from the description, or may be learned by practice of the invention.
Drawings
The foregoing and/or additional aspects and advantages of the invention will become apparent and may be better understood from the following description of embodiments taken in conjunction with the accompanying drawings in which:
FIG. 1 is a flow chart of an analog calibration method according to an embodiment of the invention;
FIG. 2 is a schematic diagram of an analog calibration apparatus according to an embodiment of the present invention;
fig. 3 is a functional block diagram of an electronic device according to an embodiment of the present invention.
Reference numerals:
the device comprises an acquisition module 200, a training module 210, a calibration module 220, a processor 300, a memory 310, a data transmission module 320, a camera 330 and a display screen 340.
Detailed Description
Embodiments of the present invention are described in detail below, examples of which are illustrated in the accompanying drawings, wherein like or similar reference numerals refer to like or similar elements or elements having like or similar functions throughout. The embodiments described below by referring to the drawings are illustrative only and are not to be construed as limiting the invention.
In the description of the present invention, unless explicitly defined otherwise, terms such as arrangement, installation, connection, etc. should be construed broadly and the specific meaning of the terms in the present invention can be reasonably determined by a person skilled in the art in combination with the specific contents of the technical scheme.
Referring to fig. 1, an analog quantity calibration method according to an embodiment of the first aspect of the present invention includes:
step S100, a plurality of analog input values and a plurality of corresponding analog output values are obtained.
The analog input value can be a numerical value of the acquired analog; the analog output value may be a value converted from the analog input value. The analog input values can be multiple, and then the corresponding multiple analog output values can be obtained by converting the multiple analog input values. Any device that needs to interact with the outside can acquire related data through the sensor, and the related data can be converted into corresponding analog quantity signals (namely voltage and current) through various sensors such as sound, light, heat, force and the like. Whether a dedicated ADC (Analog-to-Digital Converter abbreviation, meaning an Analog-to-digital converter or an Analog-to-digital converter, meaning a device that converts a continuously varying Analog signal into a discrete digital signal), or a CPU with AD sampling function, stores the current sampling information by a specific encoding mode. And the user inquires a corresponding chip manual to configure an acquisition mode of the ADC, reads the sampled coding result, restores the acquired result against coding rules and the design of a peripheral circuit, further obtains the analog quantity result of the current sampling, and finally takes the result as a judgment basis for executing certain behaviors. For analog quantity collection requiring table lookup, such as a common temperature sensor K-type thermocouple, a common graduation table covers a range of-50-1360 ℃, a mu V (micro volt level) graduation table covers 1410 values, and in order to keep the precision, the analog quantity collection is generally stored by adopting unsigned short shaping (2 bytes), and the total memory is required to occupy 2.75 MB. However, the common products all contain a plurality of temperature measuring modes, so that the number of the modes can be increased by multiple in the actual use of the memory for storing the graduation table; in terms of precision, the display precision of a common temperature sensor is mostly 0.1 ℃, so that when the table lookup error is lower than 0.1 ℃, an accurate acquisition result cannot be obtained. Therefore, a method of software compensation deviation can be adopted to solve the material difference problem caused by the hardware detection method. Alternatively, it is assumed that the analog input value may be obtained by looking up the index table, for example, the acquired sensor resistance value, and the obtained resistance value is the analog input value. The temperature value can be obtained through conversion according to the resistance value, and a plurality of corresponding analog output values can be obtained.
Step S110, training a fitting model by using a plurality of analog input values and a plurality of analog output values to obtain a fitting function.
Wherein the fitting function may be a mathematical function that selects an appropriate curve type to fit the relationship between the observed plurality of analog input values and the plurality of analog output values; the fitting model may be a mathematical model used to train the resulting fitting function. Alternatively, the fitting model may be trained using a plurality of analog input values and a plurality of analog output values to obtain a fitting function for the fitting model to output, and then a mathematical relationship between the plurality of analog input values and the plurality of analog output values may be observed according to the fitting function.
Step S120, calculating according to the fitting function to obtain a calibration result.
The calibration result may be a result obtained by calibrating the analog output value. Optionally, the fitting function may reflect a mathematical relationship between the plurality of analog input values and the plurality of analog output values, so that an ideal analog output value may be obtained according to the fitting function and the analog input values, and the obtained ideal analog output value may be compared with the analog output value obtained by conversion, so that an error between the ideal value and the conversion value may be obtained, and a calibration result may be obtained by performing calibration according to the error.
According to the analog quantity calibration method, the fitting model is trained to obtain the fitting function through the acquired analog quantity input values and the corresponding analog quantity output values, and the calibration result can be obtained by calculating according to the obtained fitting function, so that the influence of material difference on the acquisition precision can be reduced, the data processing efficiency is improved, and the memory occupation can be reduced.
In some embodiments of the invention, the fitted model is obtained by:
and respectively taking the plurality of analog input values and the plurality of analog output values as the input of the fitting model to be trained, and obtaining the actual analog output by the fitting model. The fitting model to be trained can be a fitting model to be trained; the actual analog quantity can be an actual output value corresponding to an analog quantity input value obtained according to the fitting model to be trained. Optionally, since the value output by the fitting model to be trained is not necessarily an ideal output value, an actual analog quantity output by the fitting model to be trained needs to be obtained, and the actual analog quantity can be used for comparing with the ideal output value, so that the weight of the fitting model to be trained can be adjusted according to the comparison result.
And calculating according to the actual analog quantity and the analog quantity output value to obtain a loss value. The loss value may be a value representing an error between the actual analog quantity and the analog quantity output value. Optionally, the analog output value B may be used as an ideal output value, and if the actual analog is C, the loss value may be obtained by comparing B with C, and the loss value may be used to train the fitting model to be trained.
And updating parameters in the fitting model to be trained according to the loss value until a preset convergence condition is reached, and taking the fitting model to be trained obtained by updating finally as a fitting model. Alternatively, the fitting model to be trained may be trained according to the loss value, for example, a BP algorithm (Back Propagation, a multi-layer feedforward network trained according to an error Back Propagation algorithm) may be used, and the parameters w and b in the fitting model to be trained are adjusted according to the loss value, where it is assumed that w and b may be adjusted by the following formula:
wherein Y can be a fitting function, x can be an independent variable (namely an analog input value) of the fitting function, tan sig is a tan sig function, purline is a purline function, so that a fitting model with smaller error and higher precision can be obtained through training, and the data processing speed is accelerated.
In some embodiments of the present invention, the calibration results calculated from the fitting function include:
and acquiring a preset input value and a corresponding preset output value. The preset input value may be an input value of a preset fitting function; the preset output value may be an ideal fit function output value corresponding to the preset input value. Alternatively, the preset output value may be set according to the requirement. For example, assume that the preset input value is x 1 The x can be obtained by assuming that the corresponding preset output value is y' =0deg.C 1 And y'.
And calculating according to the preset input value and the fitting function to obtain a target output value. The target output value may be an actual output value of the fitting function after the preset input value is input into the fitting function.Alternatively, let the fitting function be y (x), let the preset input value be x 1 Assume that the input value x is preset 1 Substituting the fitting function y (x) to obtain the actual output value of the fitting function as y 1 Obtaining the target output value y 1
And calculating according to the preset output value and the target output value to obtain an error value. The error value may be an error value between a preset output value and a target output value. Since there is a difference between the actual output value and the ideal output value, an error value between the two can be calculated to represent the difference. Optionally, assume that the preset output value is y' =0deg.C, and assume that the target output value is y 1 Error value f if=0.05deg.C 1 =y 1 -y’=0.05℃。
And calibrating according to the error value to obtain a calibration result. Optionally, the analog quantity may be calibrated according to the error value, that is, the target output value is corrected according to the error value, so that the target output value reaches an acceptable fault tolerance range, and a calibration result of the compensation deviation is obtained. By calculating the error value between the preset output value and the target output value and calibrating according to the error value, an accurate calibration result is obtained, table lookup operation is reduced, compensation deviation of software is realized, and the influence on calibration between measurement channels of hardware is avoided.
In some embodiments of the present invention, performing calibration according to the error value to obtain a calibration result includes:
a plurality of error values is obtained. Alternatively, each target output value may correspond to one error value, and then the error value corresponding to each target output value may be obtained respectively, so that a plurality of error values may be obtained. For example, assume that the target output value is y 1 Correspondingly obtaining an error value f 1 The method comprises the steps of carrying out a first treatment on the surface of the Assuming that the target output value is y 2 Correspondingly obtaining an error value f 2 … … assuming a target output value of x n Correspondingly obtaining an error value f n . Thus, a plurality of error values f can be obtained 1 ,f 2 ,f 3 ,……,f n
Performing variance calculation according to the error values to obtain multiple error valuesAnd a variance value corresponding to the target output value. Alternatively, the variance of the plurality of error values may be calculated according to the error value corresponding to each of the preset input values obtained respectively. For example, assume that the resulting error values are f respectively 1 ,f 2 ,f 3 ,……,f n Then it can be according to f 1 ,f 2 ,f 3 ,……,f n Calculating an average value of the error valuesThe variance value of the error value is:
so that an overall variance value v of the plurality of target output values can be obtained, the above variance v can be used for calibration, whereby the uncertainty error can be eliminated.
And calibrating according to the variance value to obtain a calibration result. Optionally, calibration may be performed according to the overall variances of the multiple target output values to eliminate errors, and the calculated variance value v is assumed to correct the target output value, so that the target output value reaches an acceptable fault tolerance range, and a calibration result of compensating the deviation is obtained. The integral variance value of a plurality of target output values is obtained through calculation of a plurality of error values, and the correction is carried out according to the variance value to obtain a correction result, so that the compensation deviation of software can be realized, the table lookup operation is reduced, and the correction result is more accurate.
In some embodiments of the present invention, obtaining a plurality of analog input values and a corresponding plurality of analog output values includes:
and respectively converting according to the plurality of analog input values to obtain a plurality of analog output values corresponding to the analog input values. Alternatively, let the analog input value be resistors, r respectively 1 ,r 2 ,……,r n The ADC converter can be used for encoding, so that the encoding conversion can be sequentially realized to obtain an analog output value corresponding to the analog input value, and the analog output value is assumed to be a voltage valueRespectively obtain U 1 ,U 2 ,……,U n . Alternatively, let the analog input value be resistors, r respectively 1 ,r 2 ,……,r n The ADC converter can be used for encoding, so that the encoding conversion can be sequentially realized to obtain an analog output value corresponding to the analog input value, and the T is obtained respectively if the analog output value is the temperature 1 ,T 2 ,……,T n . Thus, a plurality of analog output values corresponding to the plurality of analog input values can be obtained. By converting the analog input value to obtain a corresponding analog output value, the memory space for storing the table can be saved, the data processing efficiency is improved, the memory occupied by the index table is greatly saved, the time consumption of table lookup operation and calibration is reduced, and meanwhile, an accurate calibration result can be obtained.
In some embodiments of the present invention, before acquiring the plurality of analog input values, the method further includes:
a plurality of sample analog quantities are acquired. The sample analog quantity may be a value acquired, such as a resistance value. Alternatively, assuming that the sensor resistance value can be obtained by sampling the Ni120 sensor, the sensor resistance value can be used as a sample analog quantity, and a plurality of sample analog quantities can be obtained.
And sequentially looking up a table according to the multiple sample analog quantities to obtain multiple analog quantity input values. Alternatively, the multiple analog input values may be obtained by looking up the index table, respectively. For example, assuming that the graduation table is a sampling table corresponding to the Ni120 sensor, the sampling table may be queried according to the acquired sensor resistance value (i.e., the sample analog quantity), so as to obtain a plurality of corresponding resistance values, or a plurality of temperature values, or a plurality of voltage values, i.e., a plurality of analog input value quantities. The acquired analog quantities of the samples are subjected to table lookup to obtain a plurality of analog quantity input values, so that the data processing speed can be increased.
Referring to fig. 2, an analog quantity calibration apparatus according to an embodiment of the second aspect of the present invention includes:
the acquisition module 200 is configured to acquire a plurality of analog input values and a corresponding plurality of analog output values;
a training module 210, configured to train a fitting model to obtain a fitting function by using a plurality of analog input values and a plurality of analog output values;
the calibration module 220 is configured to calculate a calibration result according to the fitting function.
In some embodiments of the invention, the fitted model is obtained by: the obtaining module 200 is further configured to obtain an actual analog quantity output by the fitting model by respectively using the plurality of analog quantity input values and the plurality of analog quantity output values as inputs of the fitting model to be trained; the obtaining module 200 is further configured to calculate a loss value according to the actual analog quantity and the analog quantity output value; the training module 210 is further configured to update parameters in the fitting model to be trained according to the loss value until a preset convergence condition is reached, and take the fitting model to be trained obtained by updating last as the fitting model.
In some embodiments of the present invention, the calibration results calculated from the fitting function include: the obtaining module 200 is further configured to obtain a preset input value and a corresponding preset output value; the obtaining module 200 is further configured to calculate according to a preset input value and a fitting function, so as to obtain a target output value; the obtaining module 200 is further configured to calculate an error value according to the preset output value and the target output value; the calibration module 220 is further configured to calibrate according to the error value, and obtain a calibration result.
In some embodiments of the present invention, performing calibration according to the error value to obtain a calibration result includes: the acquisition module 200 is further configured to acquire a plurality of error values; the obtaining module 200 is further configured to perform variance calculation according to the plurality of error values, so as to obtain variance values corresponding to the plurality of target output values; the calibration module 220 is further configured to perform calibration according to the variance value to obtain a calibration result.
In some embodiments of the present invention, obtaining a plurality of analog input values and a corresponding plurality of analog output values includes: the obtaining module 200 is further configured to convert according to the plurality of analog input values, respectively, to obtain a plurality of analog output values corresponding to the analog input values.
In some embodiments of the present invention, before acquiring the plurality of analog input values, the method further includes: the acquisition module 200 is further configured to acquire a plurality of sample analog quantities; the obtaining module 200 is further configured to perform table lookup sequentially according to the plurality of sample analog values to obtain a plurality of analog input values.
Referring to fig. 3, an embodiment of the third aspect of the present invention further provides an internal structural diagram of an electronic device, including: at least one processor 300, and a memory 310 communicatively coupled to the at least one processor 300; a data transmission module 320, a camera 330, a display screen 340 may also be included.
Wherein the processor 300 is adapted to perform the analog quantity calibration method in the first embodiment by invoking a computer program stored in the memory 310.
The memory, as a non-transitory storage medium, may be used to store a non-transitory software program, as well as a non-transitory computer-executable program, such as the analog calibration method in the embodiment of the first aspect of the present invention. The processor implements the analog quantity calibration method in the embodiment of the first aspect described above by running a non-transitory software program and instructions stored in a memory.
The memory may include a memory program area and a memory data area, wherein the memory program area may store an operating system, at least one application program required for a function; the memory data area may store data for performing the analog quantity calibration method in the embodiments of the first aspect described above. In addition, the memory may include high-speed random access memory, and may also include non-transitory memory, such as at least one magnetic disk storage device, flash memory device, or other non-transitory solid state storage device. In some embodiments, the memory optionally includes memory remotely located relative to the processor, the remote memory being connectable to the terminal through a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The non-transitory software programs and instructions required to implement the analog quantity calibration method in the embodiments of the first aspect described above are stored in memory and when executed by one or more processors, perform the analog quantity calibration method in the embodiments of the first aspect described above.
The fourth aspect embodiment of the present invention also provides a computer-readable storage medium storing computer-executable instructions for: the analog quantity calibration method in the embodiment of the first aspect is performed.
In some embodiments, the storage medium stores computer-executable instructions that are executed by one or more control processors, for example, by one processor in an electronic device according to an embodiment of the third aspect, which may cause the one or more processors to perform the analog quantity calibration method according to an embodiment of the first aspect.
The embodiments of the present invention have been described in detail with reference to the accompanying drawings, but the present invention is not limited to the above embodiments, and various changes can be made within the knowledge of one of ordinary skill in the art without departing from the spirit of the present invention.
Those of ordinary skill in the art will appreciate that all or some of the steps, systems, and methods disclosed above may be implemented as software, firmware, hardware, and suitable combinations thereof. Some or all of the physical components may be implemented as software executed by a processor, such as a central processing unit, digital signal processor, or microprocessor, or as hardware, or as an integrated circuit, such as an application specific integrated circuit. Such software may be distributed on computer readable media, which may include computer storage media (or non-transitory media) and communication media (or transitory media). The term computer storage media includes both volatile and nonvolatile, removable and non-removable media implemented in any method or technology for storage of information such as computer readable instructions, data structures, program modules or other data, as known to those skilled in the art. Computer storage media includes, but is not limited to, RAM, ROM, EEPROM, flash memory or other memory technology, CD-ROM, digital Versatile Disks (DVD) or other optical disk storage, magnetic cassettes, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other medium which can be used to store the desired information and which can be accessed by a computer. Furthermore, as is well known to those of ordinary skill in the art, communication media typically embodies computer readable instructions, data structures, program modules or other data in a modulated data signal such as a carrier wave or other transport mechanism and includes any information delivery media.
In the description of the present specification, reference to the terms "one embodiment," "some embodiments," "illustrative embodiments," "examples," "specific examples," or "some examples," etc., means that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the invention. In this specification, schematic representations of the above terms do not necessarily refer to the same embodiments or examples. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples.
While embodiments of the present invention have been shown and described, it will be understood by those of ordinary skill in the art that: many changes, modifications, substitutions and variations may be made to the embodiments without departing from the spirit and principles of the invention, the scope of which is defined by the claims and their equivalents.

Claims (6)

1. An analog quantity calibration method, comprising:
acquiring a plurality of analog input values and a plurality of corresponding analog output values, wherein the analog input values comprise resistance values obtained by sampling a sensor, and the analog output values comprise temperature values;
training a fitting model by utilizing the plurality of analog input values and the plurality of analog output values to obtain a fitting function;
according to the fitting function, a calibration result is obtained through calculation, so that the influence of material difference on acquisition precision can be reduced, and memory occupation is reduced;
wherein, the calculating according to the fitting function obtains a calibration result, including:
acquiring a preset input value and a corresponding preset output value, wherein the preset input value comprises a resistance value obtained by sampling a sensor, and the preset output value comprises a temperature value;
calculating according to the preset input value and the fitting function to obtain a target output value;
calculating according to the preset output value and the target output value to obtain an error value;
acquiring a plurality of error values;
performing variance calculation according to the error values to obtain variance values corresponding to the target output values;
calibrating according to the variance value to obtain a calibration result;
the fitting model is obtained by the following steps:
respectively taking the multiple analog input values and the multiple analog output values as inputs of a fitting model to be trained, and obtaining an actual analog output by the fitting model;
calculating according to the actual analog quantity and the analog quantity output value to obtain a loss value;
updating parameters in the fitting model to be trained according to the loss value until a preset convergence condition is reached, and taking the fitting model to be trained obtained by updating last as the fitting model, wherein the parameters in the fitting model to be trained comprise w and b;
updating parameters in the fitting model to be trained according to the loss value, and specifically adjusting the parameters through a formula, wherein the formula comprises:
wherein Y is a fitting function; x is the independent variable of the fitting function and is the input value of the analog quantity; tan sig is a tan sig function; purline is a purline function.
2. The method of claim 1, wherein the obtaining a plurality of analog input values and a corresponding plurality of analog output values comprises:
and respectively converting according to the analog input values to obtain a plurality of analog output values corresponding to the analog input values.
3. The method of claim 2, further comprising, prior to said obtaining a plurality of analog input values:
obtaining a plurality of sample analog quantities;
and sequentially carrying out table lookup according to the plurality of sample analog quantities to obtain a plurality of analog quantity input values.
4. An analog quantity calibration apparatus, comprising:
the acquisition module is used for acquiring a plurality of analog input values and a plurality of corresponding analog output values, wherein the analog input values comprise resistance values obtained by sampling of the sensor, and the analog output values comprise temperature values;
the training module is used for training a fitting model by utilizing the plurality of analog input values and the plurality of analog output values to obtain a fitting function;
the calibration module is used for calculating and obtaining a calibration result according to the fitting function, reducing the influence of material difference on acquisition precision and memory occupation, wherein the calculating and obtaining the calibration result according to the fitting function comprises the following steps: acquiring a preset input value and a corresponding preset output value, wherein the preset input value comprises a resistance value obtained by sampling a sensor, and the preset output value comprises a temperature value; calculating according to the preset input value and the fitting function to obtain a target output value; calculating according to the preset output value and the target output value to obtain an error value; acquiring a plurality of error values; performing variance calculation according to the error values to obtain variance values corresponding to the target output values; calibrating according to the variance value to obtain a calibration result;
the fitting model is obtained by the following steps:
respectively taking the multiple analog input values and the multiple analog output values as inputs of a fitting model to be trained, and obtaining an actual analog output by the fitting model;
calculating according to the actual analog quantity and the analog quantity output value to obtain a loss value;
updating parameters in the fitting model to be trained according to the loss value until a preset convergence condition is reached, and taking the fitting model to be trained obtained by updating last as the fitting model, wherein the parameters in the fitting model to be trained comprise w and b;
updating parameters in the fitting model to be trained according to the loss value, and specifically adjusting the parameters through a formula, wherein the formula comprises:
wherein Y is a fitting function; x is the independent variable of the fitting function and is the input value of the analog quantity; tan sig is a tan sig function; purline is a purline function.
5. An electronic device, comprising:
at least one processor, and,
a memory communicatively coupled to the at least one processor; wherein,
the memory stores instructions that are executed by the at least one processor to cause the at least one processor to implement the analog quantity calibration method of any one of claims 1 to 3 when the instructions are executed.
6. A computer-readable storage medium storing computer-executable instructions for causing a computer to perform the analog quantity calibration method according to any one of claims 1 to 3.
CN202010979487.8A 2020-09-17 2020-09-17 Analog quantity calibration method, analog quantity calibration device, electronic equipment and storage medium Active CN112182493B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010979487.8A CN112182493B (en) 2020-09-17 2020-09-17 Analog quantity calibration method, analog quantity calibration device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010979487.8A CN112182493B (en) 2020-09-17 2020-09-17 Analog quantity calibration method, analog quantity calibration device, electronic equipment and storage medium

Publications (2)

Publication Number Publication Date
CN112182493A CN112182493A (en) 2021-01-05
CN112182493B true CN112182493B (en) 2024-01-09

Family

ID=73921490

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010979487.8A Active CN112182493B (en) 2020-09-17 2020-09-17 Analog quantity calibration method, analog quantity calibration device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN112182493B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115060306B (en) * 2022-08-16 2022-11-08 北京万维盈创科技发展有限公司 Analog quantity calibration method and device and analog quantity acquisition equipment
CN116127332B (en) * 2022-12-01 2023-08-15 深圳市华众自动化工程有限公司 Analog data processing device and method

Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US4896282A (en) * 1987-01-08 1990-01-23 Schlumberger Electronics (U.K.) Limited Flow computer calibration technique
US5822225A (en) * 1994-09-21 1998-10-13 Ericsson Raynet Corporation Self-calibrating data processors and methods for calibrating same
EP1244217A1 (en) * 2001-03-06 2002-09-25 Sony International (Europe) GmbH Calibration of an A/D-converter
CN102819261A (en) * 2012-08-06 2012-12-12 北京雪迪龙科技股份有限公司 Data calibration method and device
CN104970776A (en) * 2015-07-03 2015-10-14 深圳市掌康科技有限公司 Body temperature detection method and high-precision dynamic calibration electronic thermometer device
CN106941354A (en) * 2017-04-17 2017-07-11 北京机械设备研究所 A kind of hardware circuit bearing calibration based on Mathematical Fitting
CN107483111A (en) * 2017-06-27 2017-12-15 青岛海信宽带多媒体技术有限公司 A kind of calibration method and device of the optical module transmitting luminous power based on temperature
CN108700640A (en) * 2017-10-13 2018-10-23 深圳中兴力维技术有限公司 Calibration method, control platform and the system of voltage acquisition module, storage medium
CN109408970A (en) * 2018-10-29 2019-03-01 合肥本源量子计算科技有限责任公司 A kind of D conversion method, device and a kind of analog-digital converter
CN110968833A (en) * 2019-12-10 2020-04-07 上海艾临科智能科技有限公司 Calibration function relation obtaining method and device for analog quantity calibration
CN111625764A (en) * 2020-05-21 2020-09-04 北京嘀嘀无限科技发展有限公司 Calibration method and device for mobile data, electronic equipment and storage medium

Patent Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US4896282A (en) * 1987-01-08 1990-01-23 Schlumberger Electronics (U.K.) Limited Flow computer calibration technique
US5822225A (en) * 1994-09-21 1998-10-13 Ericsson Raynet Corporation Self-calibrating data processors and methods for calibrating same
EP1244217A1 (en) * 2001-03-06 2002-09-25 Sony International (Europe) GmbH Calibration of an A/D-converter
CN102819261A (en) * 2012-08-06 2012-12-12 北京雪迪龙科技股份有限公司 Data calibration method and device
CN104970776A (en) * 2015-07-03 2015-10-14 深圳市掌康科技有限公司 Body temperature detection method and high-precision dynamic calibration electronic thermometer device
CN106941354A (en) * 2017-04-17 2017-07-11 北京机械设备研究所 A kind of hardware circuit bearing calibration based on Mathematical Fitting
CN107483111A (en) * 2017-06-27 2017-12-15 青岛海信宽带多媒体技术有限公司 A kind of calibration method and device of the optical module transmitting luminous power based on temperature
CN108700640A (en) * 2017-10-13 2018-10-23 深圳中兴力维技术有限公司 Calibration method, control platform and the system of voltage acquisition module, storage medium
CN109408970A (en) * 2018-10-29 2019-03-01 合肥本源量子计算科技有限责任公司 A kind of D conversion method, device and a kind of analog-digital converter
CN110968833A (en) * 2019-12-10 2020-04-07 上海艾临科智能科技有限公司 Calibration function relation obtaining method and device for analog quantity calibration
CN111625764A (en) * 2020-05-21 2020-09-04 北京嘀嘀无限科技发展有限公司 Calibration method and device for mobile data, electronic equipment and storage medium

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
一种热电偶测量仪表的校准方法;孔繁军 等;《舰船科学技术》;20120831;第34卷(第8期);第109-111、118页 *
基于径向基函数神经网络的探空仪湿度传感器曲线拟合;杨子宾 等;《气象科技》;20100430;第38卷(第2期);第226-229页 *

Also Published As

Publication number Publication date
CN112182493A (en) 2021-01-05

Similar Documents

Publication Publication Date Title
CN112182493B (en) Analog quantity calibration method, analog quantity calibration device, electronic equipment and storage medium
US7595748B2 (en) Method of gain error calibration in a pipelined analog-to-digital converter or a cyclic analog-to-digital converter
CN109654125B (en) Displacement correction device, magnetic suspension bearing system and displacement correction method thereof
WO2017113570A1 (en) Method and system for calibrating transmission power and radio frequency system
WO2021063058A1 (en) Adc (error automatic correction) method and apparatus, analog-digital conversion circuit and storage medium
CN112051562A (en) Distance compensation method and device for wireless ranging, electronic equipment and storage medium
US11536596B2 (en) Sensor for detecting environmental parameters and method of calibrating the sensor
CN111504491B (en) Data processing method, temperature detection circuit and electronic equipment
US8228073B2 (en) Signal monitoring systems
US20050225470A1 (en) Digitally self-calibrating pipeline adc and controlling method thereof
CN111669178B (en) High-precision successive approximation type analog-to-digital converter and linearity calibration method thereof
US8547256B2 (en) Analog unit
KR20130017467A (en) Analog filter in a mobile transition device and thereof method for seting cut-off frequency
KR20090085283A (en) Apparatus and method of compensating the error of analog to digital converter
CN113517891B (en) Linear calibration system and method applied to digital-to-analog converter
CN107976646B (en) Signal power characteristic compensation method and device based on vector network analyzer
JP2020065241A (en) Calibration method and calibration system
CN115931178A (en) BJT-based intelligent temperature sensor correction method
CN116505947B (en) Analog-to-digital converter calibration method, device, storage medium and chip
JPH066218A (en) A/d converter with temperature compensating function
CN113447871A (en) Calibration method and device
KR20190033813A (en) Apparatus for measuring current and method for modifing nonlinear properties thereof
CN117571163B (en) Method and device for eliminating sensor output jitter and sensor
KR20190047556A (en) Autonomic Calibration method in Sensor Measuring Device
WO2023007752A1 (en) Circuit device

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
GR01 Patent grant
GR01 Patent grant