Power calibration method, device and computer-readable storage medium

By obtaining the pre-stored voltage value and real-time voltage value in the microcontroller for correction, the problem of inaccurate display value of the equipment is solved, and the accuracy of the display value is improved.

CN114839546BActive Publication Date: 2025-06-17SHENZHEN BOFEI KETE TECH
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202210299149.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-03-25
Publication Date
2025-06-17
Estimated Expiration
2042-03-25

AI Technical Summary

Technical Problem

Due to uncontrollable factors such as hardware differences and line loss, the accuracy of the equipment's power display value is not high.

Method used

By obtaining the pre-stored voltage value of the analog-to-digital converter in the target microcontroller, determining the compensation value, and confirming the correction voltage value in combination with the real-time voltage value to improve the accuracy of the power display value.

Benefits of technology

Real-time correction of pre-stored voltage values ​​and real-time voltage values ​​in the device is achieved, and the accuracy of the power display value of the equipment is improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114839546B_ABST
    Figure CN114839546B_ABST
Patent Text Reader

Abstract

The present invention provides a power calibration method, device and computer-readable storage medium. Among them, the power calibration method includes: obtaining a pre-stored voltage value of an analog-to-digital converter in a target single-chip microcomputer; determining a compensation value according to the pre-stored voltage value; obtaining a real-time voltage value detected by the analog-to-digital converter, and confirming a calibrated voltage value of the target single-chip microcomputer according to the real-time voltage value and the compensation value. The purpose of the present invention is to improve the accuracy of the device power display value.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of electricity, and in particular to a method and device for calibrating electric quantity and a computer-readable storage medium. Background Art

[0002] An MCU (Microcontroller Unit) is also called a single-chip microcomputer or a single-chip microcontroller. A single-chip microcomputer is an integrated circuit chip that integrates a CPU (Central Processing Unit) with data processing capabilities, a random access memory (RAM), an ADC (Analog-to-digital converter), etc. onto a single chip using very large scale integrated circuit technology. With the development of single-chip microcomputer technology, more and more single-chip microcomputers are applied to wearable devices.

[0003] Since wearable devices generally need to be carried around, most wearable devices are powered by batteries. When the battery power display is insufficient, users will charge or replace the battery according to their needs. Therefore, calibrating the voltage value has become an important parameter for wearable devices. In the related art, the ADC is used to obtain the real-time voltage value as the power display value. However, due to uncontrollable factors such as hardware differences and line losses, the accuracy of the device power display value is too low.

[0004] The above content is only used to assist in understanding the technical solution of the present invention, and does not represent an admission that the above content is prior art. Summary of the Invention

[0005] The main purpose of the present invention is to provide a method and device for calibrating electric quantity and a computer-readable storage medium, aiming to achieve the effect of improving the accuracy of the device power display value.

[0006] To achieve the above object, the present invention provides a method for calibrating electric quantity, and the method for calibrating electric quantity includes:

[0007] Obtain the pre-stored voltage value of the analog-to-digital converter in the target microcontroller unit;

[0008] Determine a compensation value according to the pre-stored voltage value;

[0009] Obtain the real-time voltage value detected by the analog-to-digital converter, and confirm the calibrated voltage value of the target microcontroller unit according to the real-time voltage value and the compensation value.

[0010] Optionally, before the step of obtaining the real-time voltage value detected by the analog-to-digital converter and confirming the calibrated voltage value of the target microcontroller unit according to the real-time voltage value and the compensation value, the method further includes:

[0011] If the pre-stored voltage value is not obtained, obtain a preset compensation value as the compensation value.

[0012] Optionally, the step of determining the compensation value according to the pre-stored voltage value includes:

[0013] Obtain the standard voltage value of the analog-to-digital converter;

[0014] Determine the compensation value according to the difference between the standard voltage value and the pre-stored voltage value.

[0015] Optionally, the step of obtaining the standard voltage value of the analog-to-digital converter includes:

[0016] When obtaining the voltage values detected by the analog-to-digital converters of multiple single-chip microcomputers of the same specification as the target single-chip microcomputer when each is externally connected to a regulated power supply;

[0017] Take the average value of the obtained voltage values as the standard voltage value.

[0018] Optionally, the step of confirming the corrected voltage value of the target single-chip microcomputer according to the real-time voltage value and the compensation value includes:

[0019] Confirm that the sum value of the real-time voltage value and the compensation value is the corrected voltage value;

[0020] Determine the power display value of the target single-chip microcomputer during actual use according to the corrected voltage value.

[0021] Optionally, before the step of obtaining the pre-stored voltage value of the analog-to-digital converter in the target single-chip microcomputer, it further includes:

[0022] When the target single-chip microcomputer is powered on for the first time, obtain the voltage value detected by the analog-to-digital converter when externally connected to a regulated power supply as the pre-stored voltage value.

[0023] Optionally, after the step of obtaining the voltage value detected by the analog-to-digital converter when externally connected to a regulated power supply as the pre-stored voltage value, it further includes:

[0024] Store the pre-stored voltage value in a non-volatile random access memory.

[0025] In addition, to achieve the above object, the present invention further provides a power correction device, the power correction device includes a memory, a processor, and a power correction program stored on the memory and executable on the processor, and when the power correction program is executed by the processor, it implements the steps of the power correction method as described above.

[0026] In addition, to achieve the above object, the present invention further provides a power correction device, the power correction device includes:

[0027] An acquisition module, configured to acquire a pre-stored voltage value of an analog-to-digital converter in a target single-chip microcomputer;

[0028] A determination module, configured to determine a compensation value according to the pre-stored voltage value;

[0029] A calibration module, configured to acquire a real-time voltage value detected by the analog-to-digital converter, and confirm a calibrated voltage value of the target single-chip microcomputer according to the real-time voltage value and the compensation value.

[0030] In addition, to achieve the above object, the present invention further provides a computer-readable storage medium, on which a power calibration program is stored, and when the power calibration program is executed by a processor, the steps of the power calibration method as described above are implemented.

[0031] A power calibration method, device and computer-readable storage medium provided by an embodiment of the present invention first acquire a pre-stored voltage value of an analog-to-digital converter in a target single-chip microcomputer; determine a compensation value according to the pre-stored voltage value; acquire a real-time voltage value detected by the analog-to-digital converter, and confirm a calibrated voltage value of the target single-chip microcomputer according to the real-time voltage value and the compensation value. In this way, the compensation value is determined by using the pre-stored voltage value dedicated to the target single-chip microcomputer in the device, and the calibrated voltage value is determined in real time by using the compensation value and the detected real-time voltage value. The calibrated voltage value can be used for the device to display the power. Such real-time calibration can improve the accuracy of the device power display value. BRIEF DESCRIPTION OF THE DRAWINGS

[0032] Figure 1 is a schematic diagram of the terminal structure of the hardware operating environment involved in the solution of the embodiment of the present invention;

[0033] Figure 2 is a schematic flowchart of an embodiment of the power calibration method of the present invention;

[0034] Figure 3 is a schematic flowchart of another embodiment of the power calibration method of the present invention;

[0035] Figure 4 is a schematic diagram of an application scenario involved in the embodiment of the present invention;

[0036] Figure 5 is a schematic diagram of the architecture of the power calibration device involved in the embodiment of the present invention.

[0037] The realization, functional features and advantages of the object of the present invention will be further described with reference to the embodiments and the accompanying drawings. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0038] It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.

[0039] Due to uncontrollable factors such as hardware differences and line losses in the related art, the accuracy of the power display value of the device is not high.

[0040] In order to improve the accuracy of the power display value of the device, an embodiment of the present invention proposes a power correction method, device, and computer-readable storage medium. The main steps of the method include:

[0041] Obtain the pre-stored voltage value of the analog-to-digital converter in the target microcontroller;

[0042] Determine the compensation value according to the pre-stored voltage value;

[0043] Obtain the real-time voltage value detected by the analog-to-digital converter, and confirm the corrected voltage value of the target microcontroller according to the real-time voltage value and the compensation value.

[0044] In this way, the compensation value is determined by the pre-stored voltage value dedicated to the target microcontroller in the device, and the corrected voltage value is determined in real time by using the compensation value and the detected real-time voltage value. The corrected voltage value can be used for the device to display the power, thereby achieving the effect of improving the accuracy of the power display value of the device.

[0045] The following will describe in detail the content protected by the claims of the present invention with reference to the accompanying drawings.

[0046] As Figure 1 shown, Figure 1 is a schematic diagram of the terminal structure of the hardware operating environment involved in the embodiment of the present invention.

[0047] The terminal in the embodiment of the present invention may be a power correction device.

[0048] As Figure 1 shown, the terminal may include: a processor 1001, such as a CPU, a memory 1003, and a communication bus 1002. Among them, the communication bus 1002 is used to implement connection communication between these components. The memory 1003 may be a high-speed RAM memory or a stable memory (non-volatile memory), such as a disk memory. Optionally, the memory 1003 may also be a storage device independent of the aforementioned processor 1001.

[0049] Those skilled in the art can understand that Figure 1 the terminal structure shown in

[0050] As Figure 1As shown, the memory 1003, which is a computer storage medium, may include an operating system and a power correction program.

[0051] In Figure 1 the terminal shown, the processor 1001 may be used to call the power correction program stored in the memory 1003 and perform the following operations:

[0052] Obtain the pre-stored voltage value of the analog-to-digital converter in the target single-chip microcomputer;

[0053] Determine a compensation value according to the pre-stored voltage value;

[0054] Obtain the real-time voltage value detected by the analog-to-digital converter, and confirm the corrected voltage value of the target single-chip microcomputer according to the real-time voltage value and the compensation value.

[0055] Further, the processor 1001 may call the power correction program stored in the memory 1003 and further perform the following operations:

[0056] If the pre-stored voltage value is not obtained, obtain a preset compensation value as the compensation value.

[0057] Further, the processor 1001 may call the power correction program stored in the memory 1003 and further perform the following operations:

[0058] Obtain the standard voltage value of the analog-to-digital converter;

[0059] Determine the compensation value according to the difference between the standard voltage value and the pre-stored voltage value.

[0060] Further, the processor 1001 may call the power correction program stored in the memory 1003 and further perform the following operations:

[0061] Obtain the voltage values detected by the analog-to-digital converters of multiple single-chip microcomputers of the same specification as the target single-chip microcomputer when they are respectively externally connected to a regulated power supply;

[0062] Take the average value of the obtained voltage values as the standard voltage value.

[0063] Further, the processor 1001 may call the power correction program stored in the memory 1003 and further perform the following operations:

[0064] Confirm that the sum value of the real-time voltage value and the compensation value is the corrected voltage value;

[0065] Determine the power display value of the target single-chip microcomputer during actual use according to the corrected voltage value.

[0066] Further, the processor 1001 may call the power correction program stored in the memory 1003 and further perform the following operations:

[0067] When the target microcontroller is powered on for the first time, obtain the voltage value detected by the analog-to-digital converter when connecting to an external regulated power supply as the pre-stored voltage value.

[0068] Further, the processor 1001 may call the power correction program stored in the memory 1003 and further perform the following operations:

[0069] Store the pre-stored voltage value in a non-volatile random access memory.

[0070] MCU (Microcontroller Unit) is also known as a single-chip microcomputer or a microcontroller. A microcontroller is an integrated circuit chip that integrates a CPU (Central Processing Unit) with data processing capabilities, a random access memory (RAM), an ADC (Analog-to-digital converter), etc. using ultra-large scale integrated circuit technology. With the development of microcontroller technology, more and more microcontrollers are applied to wearable devices.

[0071] Since wearable devices are generally carried around, most wearable devices are powered by batteries. When the battery power is shown to be insufficient, users will charge or replace the battery according to their needs. Therefore, calibrating the voltage value has become an important parameter for wearable devices. In the related art, the ADC is used to obtain the real-time voltage value as the power display value. However, due to uncontrollable factors such as hardware differences and line losses, the accuracy of the device's power display value is too low.

[0072] The embodiment of the present invention proposes a power correction method to solve the above defects, aiming to achieve the effect of confirming the calibrated voltage value in real time through the unique pre-stored voltage value of the target microcontroller and improving the accuracy of the device's current display value.

[0073] Hereinafter, through specific exemplary solutions, the content protected by the claims of the present invention will be explained and illustrated so that those skilled in the art can better understand the protection scope of the claims of the present invention. It can be understood that the following exemplary solutions do not limit the protection scope of the present invention and are only used to explain the present invention.

[0074] Exemplarily, referring to Figure 2 , in an embodiment of the power correction method of the present invention, the power correction method includes the following steps:

[0075] Step S10: Obtain the pre-stored voltage value of the analog-to-digital converter in the target microcontroller;

[0076] In this embodiment, the main body executing the power correction method may be a power correction device.

[0077] The MCU (Microcontroller Unit) is also known as a single-chip microcomputer or a microcontroller. A microcontroller is an integrated circuit chip that integrates a CPU (Central Processing Unit) with data processing capabilities, a random access memory (RAM), an ADC (Analog-to-digital converter), etc. using ultra-large scale integrated circuit technology onto a single chip. It is equivalent to a miniature computer and is widely used in various micro-devices, such as wearable devices. During use, a microcontroller requires power supply, such as a battery. Thus, the power display value is particularly important. The analog-to-digital converter in the microcontroller can obtain the real-time voltage value of the microcontroller in real time. The larger the voltage, the more sufficient the current power. However, due to hardware differences and uncontrollable reasons such as line loss, it is unreliable to use the real-time detected voltage value as the displayed power value, and there is a difference from the actual voltage value. This difference is for a single microcontroller. Therefore, the microcontroller can pre-store a voltage value, which can be used as a calibration reference. The power display value of the microcontroller can be corrected in real time through the pre-stored voltage value corresponding to the analog-to-digital converter in the target microcontroller, and then a calibration action can be taken.

[0078] Optionally, when the target microcontroller is powered on for the first time, the voltage value detected by the analog-to-digital converter when connected to an external regulated power supply is used as the pre-stored voltage value.

[0079] The pre-stored voltage value can be obtained when the target microcontroller is powered on for the first time and an external regulated power supply of 3.3V is connected to the target microcontroller. At this time, the voltage value detected by the analog-to-digital converter of the target microcontroller is obtained. Since it is the regulated power supply for the first power-on, the detected voltage value has high reference value and can be saved as the pre-stored voltage value.

[0080] Further, the pre-stored voltage value is stored in a non-volatile random access memory.

[0081] After confirming the pre-stored voltage value, the pre-stored voltage value can be stored in the non-volatile random access memory (NARAM) of the target microcontroller. For the target microcontroller, before confirming the pre-stored voltage value, a storage location for the pre-stored voltage value can be reserved in its NARAM, and the default pre-stored voltage value is 0. After confirming the pre-stored voltage value, it is stored in the NARAM, and the NARAM updates the previous pre-stored voltage value to the newly obtained pre-stored voltage value. After the update, the pre-stored voltage value is not 0.

[0082] Further, send the pre-stored voltage value to the cloud server.

[0083] After the pre-stored voltage value is confirmed, it can be sent to the cloud server, and the cloud server associates and stores the pre-stored voltage value with the target microcontroller identifier. When the target microcontroller is in use, it accesses the Internet, establishes a connection with the cloud server, and obtains the pre-stored voltage value for correcting the power display value.

[0084] Step S20: Determine the compensation value according to the pre-stored voltage value;

[0085] In this embodiment, after obtaining the pre-stored voltage value, the compensation value is determined according to the pre-stored voltage value. The pre-stored voltage value is a unique value of the target microcontroller. According to the pre-stored voltage value, the hardware differences between the target microcontroller and other microcontrollers and the real-time voltage value differences caused by factors such as line loss can be determined, so that the compensation value unique to the target microcontroller can be further confirmed according to the pre-stored voltage value.

[0086] Optionally, obtain the standard voltage value of the analog-to-digital converter; determine the compensation value according to the difference between the standard voltage value and the pre-stored voltage value.

[0087] The pre-stored voltage value is the unique data of the target microcontroller, which is caused by the standard circuit and circuit differences. Therefore, the difference between the pre-stored voltage value and the standard voltage value is the error between the real-time measurement value and the actual value brought by the hardware difference, that is, the compensation value. The confirmation of the standard voltage value can be based on a standard microcontroller or several microcontrollers of the same specification.

[0088] Further, when obtaining a plurality of microcontrollers of the same specification as the target microcontroller and externally connecting a regulated power supply respectively, obtain the voltage values detected by the analog-to-digital converter of each microcontroller; take the average value of the obtained voltage values as the standard voltage value.

[0089] Confirm the standard voltage value based on several microcontrollers of the same specification as the target microcontroller. For example, connect 10 microcontrollers of the same specification as the target microcontroller to an externally connected regulated circuit respectively. The voltage value of the externally connected regulated circuit needs to be the same as the voltage value of the externally connected regulated circuit when obtaining the preset voltage value of the target microcontroller, such as 3.3V. After connecting to the externally connected regulated circuit, record the voltage values detected by the analog-to-digital converter of each microcontroller, and take the average value of the voltage values of each microcontroller as the standard voltage value.

[0090] Optionally, store the standard voltage value in a non-volatile random access memory.

[0091] Step S30: Obtain the real-time voltage value detected by the analog-to-digital converter, and confirm the corrected voltage value of the target microcontroller according to the real-time voltage value and the compensation value.

[0092] In this embodiment, the real-time voltage value detected by the analog-to-digital converter is obtained, and the previously confirmed compensation value is called. The compensation value corresponds to the hardware difference of the target single-chip microcomputer. There is such a hardware difference in the voltage value of the real-time voltage value detected by the analog-to-digital converter. It is necessary to remove the influence brought by the hardware difference in the real-time voltage value according to the compensation value to obtain the corrected voltage value.

[0093] Optionally, it is confirmed that the sum value of the real-time voltage value and the compensation value is the corrected voltage value; the power display value of the target single-chip microcomputer during actual use is determined according to the corrected voltage value.

[0094] The compensation value is the difference compensation of the target single-chip microcomputer for the actual measurement value. Calculate the sum value of the real-time voltage value and the compensation value, and this sum value is the corrected voltage value, that is, the actual voltage value of the target single-chip microcomputer. This actual voltage value can represent the power in the target single-chip microcomputer. The higher the actual voltage value, the higher the power. The percentage of the actual voltage value occupying the voltage value when fully charged can be used as the power display value. Further, the power display value is not necessarily directly shown to the user. For example, when the power display value is lower than the preset power, the low-power indicator light is lit.

[0095] In the technical solution disclosed in this embodiment, the pre-stored voltage value of the analog-to-digital converter in the target single-chip microcomputer is obtained; the compensation value is determined according to the pre-stored voltage value; the real-time voltage value detected by the analog-to-digital converter is obtained, and the corrected voltage value of the target single-chip microcomputer is confirmed according to the real-time voltage value and the compensation value. The pre-stored voltage value is a unique value of the target single-chip microcomputer. Through the pre-stored voltage value, the hardware difference of the target single-chip microcomputer, that is, the compensation value, can be confirmed. During use, the real-time voltage value is obtained, and the corrected voltage value after correction can be confirmed according to the compensation value. The corrected voltage value can be used as the basis for the power display value. In this way, there is no need to increase the production hardware cost, and the accuracy of the device power display value is improved.

[0096] Optionally, referring to Figure 3 , based on any of the above embodiments, in another embodiment of the power correction method of the present invention, the power correction method includes:

[0097] Step S40: If the pre-stored voltage value is not obtained, obtain the preset compensation value as the compensation value.

[0098] The pre-stored voltage value is generally stored in the non-volatile random access memory of the target single-chip microcomputer and defaults to 0. The situation that the pre-stored voltage value is not obtained may be that the pre-stored voltage value is not found or the found pre-stored voltage value is 0. The reasons for this situation may be that the external voltage stabilization circuit step and pre-stored voltage value storage recognition are not performed during factory production, and the pre-stored voltage value cannot be confirmed. At this time, it can be considered that the compensation value is 0, and only step S30 needs to be performed.

[0099] For better understanding, an explanation will be given in combination with a specific application scenario. Please refer to Figure 4 :

[0100] Take a number of mass-produced single-chip microcomputers (for example, the quantity is 10 pieces, or a larger quantity, and here 10 pieces are used as the benchmark), externally connect a regulated power supply of 3.3V, collect the ADC value. The ADC value is the voltage value detected by the analog-to-digital converter of the single-chip microcomputer. Calculate the average ADC value of 10 single-chip microcomputers (the average value is represented by average). The average value is stored in the software NVRAM. During factory production, when the machine is powered on for the first time, a regulated power supply of 3.3V is externally connected to each single-chip microcomputer. At this time, the ADC value obtained (represented by A, and A is defaulted to 0 in the software NVRAM) is stored in the software NVRAM. During actual use, when the device is powered on, the target single-chip microcomputer first obtains the value A stored in the NVRAM. If A is greater than 0, the compensation value (the compensation value is represented by B) B = A - average; otherwise, B = 0. The ADC value read during the use of the target single-chip microcomputer is C, and the corrected target value D = C + B.

[0101] In the technical solution disclosed in this embodiment, if the pre-stored voltage value is not obtained, a preset compensation value is obtained as the compensation value. In this way, the correction of the real-time voltage value of the target single-chip microcomputer is more applicable to actual life and production and has generalizability. In addition, this embodiment takes into account single-chip microcomputers that do not save the pre-stored voltage value, making it more universal.

[0102] In addition, an embodiment of the present invention also proposes a power correction device. The power correction device includes a memory, a processor, and a power correction program stored on the memory and executable on the processor. When the power correction program is executed by the processor, the steps of the power correction method described in each of the above embodiments are implemented.

[0103] In addition, an embodiment of the present invention also proposes a power correction device. Exemplarily, refer to Figure 5 , the power correction device 100 includes:

[0104] An acquisition module 101, a determination module 102, and a correction module 103. Among them, the acquisition module 101 is used to acquire the pre-stored voltage value of the analog-to-digital converter in the target single-chip microcomputer; the determination module 102 is used to determine the compensation value according to the pre-stored voltage value; the correction module 103 is used to acquire the real-time voltage value detected by the analog-to-digital converter, and confirm the corrected voltage value of the target single-chip microcomputer according to the real-time voltage value and the compensation value.

[0105] In addition, an embodiment of the present invention further provides a computer-readable storage medium, on which a power calibration program is stored. When the power calibration program is executed by a processor, the steps of the power calibration method described in each of the above embodiments are implemented.

[0106] It should be noted that, in this article, the terms "include", "comprise" or any other variant thereof are intended to cover non-exclusive inclusion, so that a process, method, article or system including a series of elements not only includes those elements, but also includes other elements not expressly listed, or further includes elements inherent to such process, method, article or system. Without further limitation, an element defined by the statement "including a..." does not exclude the existence of another identical element in the process, method, article or system including that element.

[0107] The serial numbers of the above embodiments of the present invention are only for description and do not represent the advantages or disadvantages of the embodiments.

[0108] Through the description of the above embodiments, those skilled in the art can clearly understand that the above embodiment methods can be implemented by means of software plus a necessary general hardware platform. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) as described above and includes several instructions for causing a power calibration device to execute the methods described in each embodiment of the present invention.

[0109] The above are only the preferred embodiments of the present invention, and do not limit the patent scope of the present invention accordingly. Any equivalent structure or equivalent process transformation made by using the specification and drawings of the present invention, or directly or indirectly applied in other related technical fields, shall be equally included in the patent protection scope of the present invention.

Claims

1. A method for power calibration, characterized in that, The power correction method includes: When the target single-chip microcomputer is powered on for the first time, obtain the voltage value detected by the analog-to-digital converter in the target single-chip microcomputer when externally connected to a regulated power supply as the pre-stored voltage value; Obtain the voltage values detected by the analog-to-digital converters of multiple single-chip microcomputers of the same specification as the target single-chip microcomputer when each is externally connected to a regulated power supply; Take the average value of the obtained voltage values as the standard voltage value of the analog-to-digital converter; Determine the compensation value according to the difference between the standard voltage value and the pre-stored voltage value; Obtain the real-time voltage value detected by the analog-to-digital converter, and confirm that the sum of the real-time voltage value and the compensation value is the corrected voltage value of the target single-chip microcomputer; Determine the power display value of the target single-chip microcomputer during actual use according to the corrected voltage value.

2. The method for power calibration according to claim 1, characterized in that, Before obtaining the real-time voltage value detected by the analog-to-digital converter, it further includes: If the pre-stored voltage value is not obtained, obtain a preset compensation value as the compensation value.

3. The method for power calibration according to claim 1, characterized in that, After the step of obtaining the voltage value detected by the analog-to-digital converter when externally connected to a regulated power supply as the pre-stored voltage value, it further includes: Store the pre-stored voltage value in a non-volatile random access memory.

4. A power calibration device, characterized in that, The power correction device includes: a memory, a processor, and a power correction program stored on the memory and executable on the processor. When the power correction program is executed by the processor, it implements the steps of the power correction method according to any one of claims 1 to 3.

5. A power calibration device, characterized in that, The power correction device includes: An acquisition module, configured to obtain, when the target single-chip microcomputer is powered on for the first time, the voltage value detected by the analog-to-digital converter in the target single-chip microcomputer when externally connected to a regulated power supply as the pre-stored voltage value; A determination module, configured to obtain the voltage values detected by the analog-to-digital converters of multiple single-chip microcomputers of the same specification as the target single-chip microcomputer when each is externally connected to a regulated power supply; take the average value of the obtained voltage values as the standard voltage value of the analog-to-digital converter; and determine the compensation value according to the difference between the standard voltage value and the pre-stored voltage value; A correction module, configured to obtain the real-time voltage value detected by the analog-to-digital converter, and confirm that the sum of the real-time voltage value and the compensation value is the corrected voltage value of the target single-chip microcomputer; and determine the power display value of the target single-chip microcomputer during actual use according to the corrected voltage value.

6. A computer-readable storage medium, characterized in that, A computer-readable storage medium stores a power correction program, and when the power correction program is executed by a processor, it implements the steps of the power correction method according to any one of claims 1 to 3.

Citation Information

Patent Citations

  • Electric quantity calibration method and device

    CN113030821A