WO2023109300A1 - 一种电量校准方法、电子设备及存储介质 - Google Patents

一种电量校准方法、电子设备及存储介质 Download PDF

Info

Publication number
WO2023109300A1
WO2023109300A1 PCT/CN2022/125964 CN2022125964W WO2023109300A1 WO 2023109300 A1 WO2023109300 A1 WO 2023109300A1 CN 2022125964 W CN2022125964 W CN 2022125964W WO 2023109300 A1 WO2023109300 A1 WO 2023109300A1
Authority
WO
WIPO (PCT)
Prior art keywords
power
electronic device
shutdown
battery
management module
Prior art date
Application number
PCT/CN2022/125964
Other languages
English (en)
French (fr)
Inventor
杨成贺
吴志华
Original Assignee
深圳市百富智能新技术有限公司
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 深圳市百富智能新技术有限公司 filed Critical 深圳市百富智能新技术有限公司
Publication of WO2023109300A1 publication Critical patent/WO2023109300A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G01MEASURING; TESTING
    • G01RMEASURING ELECTRIC VARIABLES; MEASURING MAGNETIC VARIABLES
    • G01R35/00Testing or calibrating of apparatus covered by the other groups of this subclass
    • G01R35/04Testing or calibrating of apparatus covered by the other groups of this subclass of instruments for measuring time integral of power or current
    • 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
    • Y02EREDUCTION OF GREENHOUSE GAS [GHG] EMISSIONS, RELATED TO ENERGY GENERATION, TRANSMISSION OR DISTRIBUTION
    • Y02E60/00Enabling technologies; Technologies with a potential or indirect contribution to GHG emissions mitigation
    • Y02E60/10Energy storage using batteries

Definitions

  • the present application belongs to the technical field of power calibration, and in particular relates to a power calibration method, electronic equipment and a storage medium.
  • the power source of many electronic devices is a battery, and the battery supplies power to the electronic device to ensure the normal power demand of the electronic device.
  • the fuel gauge in the electronic device is powered off and restarted, in order to ensure the accuracy of the remaining power of the electronic device displayed in the fuel gauge, it is necessary to calibrate the power of the electronic device.
  • the calibration of the electric quantity is mostly performed through the OCV curve. Since the OCV curve is inaccurate, the calibrated electric quantity is inaccurate.
  • Embodiments of the present application provide a power calibration method, electronic equipment, and a storage medium, which can solve the problem of inaccurate power calibration.
  • the embodiment of the present application provides a power calibration method, which is applied to an electronic device, and the electronic device includes a first battery, a charging management module, a peripheral circuit module, and a fuel gauge for monitoring the power of the electronic device, After the electronic device is turned on, the first battery supplies power to the fuel gauge and the peripheral circuit module through the charging management module;
  • the methods include:
  • the current power of the electronic device is obtained according to the shutdown time and the remaining power of the electronic device when it was shut down for the last time, wherein the first type includes: the electronic device After shutdown, the first battery supplies power to the charging management module, but not to the peripheral circuit module and the fuel gauge.
  • the embodiment of the present application provides an electronic device, including: a first battery, a charging management module, a peripheral circuit module, and a fuel gauge for monitoring the power of the electronic device.
  • a first battery supplies power to the fuel gauge and the peripheral circuit module through the charging management module, and the peripheral circuit module includes a processor;
  • the processor is configured to implement the power calibration method described in the first aspect above.
  • an embodiment of the present application provides an electronic device, including: a memory, a processor, and a computer program stored in the memory and operable on the processor, wherein the processor executes The computer program implements the power calibration method described in any one of the above-mentioned first aspects.
  • an embodiment of the present application provides a computer-readable storage medium, the computer-readable storage medium stores a computer program, and it is characterized in that, when the computer program is executed by a processor, any of the above-mentioned first aspects can be implemented.
  • an embodiment of the present application provides a computer program product, which, when the computer program product is run on a terminal device, causes the terminal device to execute the power calibration method described in any one of the above first aspects.
  • the embodiment of the first aspect of the present application has the beneficial effect that: after the electronic device is turned on, the present application first obtains the shutdown type of the last shutdown of the electronic device; when the shutdown type is the first type, according to the electronic The current power of the electronic device is obtained by the shutdown time and the remaining power when the device is shut down for the last time.
  • the first type includes: after the electronic device is shut down, the first battery supplies power to the charging management module and does not supply power to the peripheral circuit module and the fuel gauge. ;
  • the current power is obtained by using the shutdown time and the remaining power of the last shutdown, which is more accurate than the current power obtained by using the OCV curve in the prior art.
  • FIG. 1 is a schematic structural diagram of an electronic device provided by an embodiment of the present application.
  • Fig. 2 is a schematic flow chart of a power calibration method provided by an embodiment of the present application
  • Fig. 3 is a schematic flowchart of a power calibration method provided by another embodiment of the present application.
  • FIG. 4 is a schematic flowchart of a method for determining a shutdown type provided by an embodiment of the present application
  • Fig. 5 is a schematic flowchart of a power calibration method provided by another embodiment of the present application.
  • Fig. 6 is a schematic structural diagram of an electronic device provided by an embodiment of the present application.
  • the term “if” may be construed depending on the context as “when” or “once” or “in response to determining” or “in response to detecting” .
  • the phrase “if determined” or “if [the described condition or event] is detected” may be construed, depending on the context, to mean “once determined” or “in response to the determination” or “once detected [the described condition or event] ]” or “in response to detection of [described condition or event]”.
  • references to "one embodiment” or “some embodiments” or the like in the specification of the present application means that a particular feature, structure, or characteristic described in connection with the embodiment is included in one or more embodiments of the present application.
  • appearances of the phrases “in one embodiment,” “in some embodiments,” “in other embodiments,” “in other embodiments,” etc. in various places in this specification are not necessarily All refer to the same embodiment, but mean “one or more but not all embodiments” unless specifically stated otherwise.
  • the terms “including”, “comprising”, “having” and variations thereof mean “including but not limited to”, unless specifically stated otherwise.
  • the safety CPU in the POS machine will be triggered to make the POS machine enter the safe mode, causing the user to be unable to use the POS machine after getting it.
  • the present application powers off some devices in the POS machine when the POS machine is turned off, such as fuel gauges, peripheral circuits, etc., to reduce battery power consumption and prolong battery life.
  • the power gauge does not work when the power is turned off, the data in the fuel gauge will be lost.
  • the POS machine needs to calibrate the power when it is turned on to ensure accurate remaining power of the POS machine.
  • this application saves the shutdown time and the remaining power when the POS is turned off before shutting down, and calibrates the power in the POS machine according to the shutdown time and the remaining power when the POS machine is turned on to obtain an accurate power.
  • Fig. 1 shows a schematic structural diagram of an electronic device provided by the present application.
  • the electronic device includes:
  • the peripheral circuit module 50 includes a processor.
  • the secure CPU module 40 includes a secure CPU chip.
  • the first battery 10 is connected to the charging management module 20 and the safety CPU module 40 respectively.
  • the charging management module 20 is connected to the peripheral circuit module 50 and the fuel gauge 60 respectively.
  • the second battery 30 and the safety CPU module 40 are connected to the charging management module 20 and the safety CPU module 40 .
  • the battery capacity of the first battery 10 is greater than the battery capacity of the second battery 30 .
  • the batteries in the first battery are AA batteries
  • the batteries in the second battery are button batteries.
  • At least one of the first battery 10 and the second battery 30 supplies power to the security CPU module 40 when the electronic device is turned off or turned on.
  • the first battery 10 may supply power to the security CPU module 40 first, and use the second battery 30 to supply power to the security CPU module 40 after the power of the first battery 10 is lower than a preset value.
  • the processor is configured to detect a power-off signal, where the power-off signal is a signal generated by acting on a power-off button or a power-off control of the electronic device.
  • the power-off signal is recorded as the first signal.
  • the first signal is generated after the power-off button is pressed hard.
  • the processor After the processor detects the shutdown signal, it reads the current power value from the fuel gauge 60 , and writes the current power value and current time into the peripheral circuit module 50 . After writing the current power value and the current time, send a first instruction to the charging management module 20, wherein the first instruction is used to instruct the charging management module to control the first battery to stop supplying power to the fuel gauge 60 and the peripheral circuit module 50 .
  • the peripheral circuit module 50 may also include a FLASH chip, and the processor writes the current power value and current time into the FLASH chip.
  • the current power value is used to represent the remaining power of the current shutdown
  • the current time is used to represent the shutdown time of the current shutdown.
  • the shutdown time in the FLASH chip is the shutdown time of the last shutdown
  • the shutdown remaining power in the FLASH chip is the remaining power of the electronic device when it was shut down last time.
  • the processor stores the current time and the current power value in the FLASH chip. After 20 minutes, the current time is 5:40, and the electronic device is turned on. The time and power values stored in the FLASH chip are the shutdown time and remaining power when the computer is turned off at 5:20.
  • the processor sends the first instruction to the charging management module 20 .
  • the charging management module 20 disconnects the charging management module 20 and the peripheral circuit module 50, as well as the path between the charging management module 20 and the fuel gauge 60, so that the first battery 10 is turned off when the electronic device is turned off. At this time, no power is supplied to the peripheral circuit module 50 and the fuel gauge 60, which reduces battery consumption and prolongs the use time of the first battery.
  • the charging management module 20 can still continue to run when the electronic device is turned off.
  • the charging management module 20 is also used to detect a power-on signal, wherein the power-on signal is a signal generated after the power-on button acts on the electronic device, or a signal generated after the electronic device is plugged into an external power source.
  • the charging management module 20 After the charging management module 20 detects the power-on signal, the charging management module 20 connects the charging management module 20 and the peripheral circuit module 50, as well as the path between the charging management module 20 and the fuel gauge 60, so that the first battery 10 passes through the charging management module. 20 supplies power to the peripheral circuit module 50 and the fuel gauge 60 to ensure that each device can operate normally after the electronic device is turned on.
  • the processor may also be used to detect a restart signal, where the restart signal is a signal generated by acting on a restart button or a restart control of the electronic device.
  • a restart signal is generated after the user presses the reset button.
  • the processor After the processor detects the restart signal, the software in the electronic device restarts, and the various hardware in the electronic device are not powered off. Specifically, during the restart process of the electronic device, the first battery 10 continues to supply power to the peripheral circuit module 50 and the fuel gauge 60 through the charging management module 20 . Since the fuel gauge 60 is not powered off during the restart process, the fuel gauge 60 is always in working condition, and the fuel gauge 60 can calculate the current power of the electronic device in real time. Therefore, after the electronic device is turned on, the power in the fuel gauge 60 is the The current electric quantity of the battery does not need to be calibrated for the electric quantity in the fuel gauge 60 . When the electronic device is restarted, the processor will not control the peripheral circuit module 50 to store the shutdown time and the remaining power of the shutdown. Therefore, if the electronic device is shut down due to restarting, the electronic device cannot be read from the peripheral circuit module 50 after the electronic device is turned on. Shutdown time and remaining battery power.
  • the charging management module 20 may include a register.
  • the register is initialized when the power is turned off, and the data in the register can be restored to the initial data.
  • the data in the register is recorded as the first data, and the initial number is recorded as the second preset value, for example, the second preset value
  • the set value can be 0, 2 or 4 etc.
  • the charging management module 20 After the electronic device is turned on, the register is powered on, and the data in the register is still the second preset value until the processor sends the second instruction to the charging management module 20. After receiving the second instruction, the charging management module 20 stores the initial data It is updated to a first preset value, which indicates that the charging management module 20 is powered on, for example, the first preset value can be 1, 3, or 5, etc.
  • the data in the register of the charging management module 20 will keep the first preset value until the charging management module 20 is powered off, and the data in the charging management module 20 is restored. Second default value.
  • the shutdown of the electronic device may also be due to the loosening or removal of the first battery, resulting in the shutdown of the electronic device.
  • the processor does not store the shutdown time and the remaining power of the shutdown to the peripheral circuit module 50. After the electronic device is turned on again, the processor cannot obtain the shutdown time when the last shutdown time and remaining power off.
  • the charge management module 20 the peripheral circuit module 50 and the fuel gauge 60 in the electronic device are all powered off.
  • the data in the charging management module 20 is restored to the second preset value.
  • the processor can first read the first data in the peripheral circuit module 50, and according to the first data, it can be determined whether the last shutdown was caused by the loosening or removal of the first battery.
  • the first data is the first preset value
  • the first information in the peripheral circuit module 50 is obtained, and it is determined whether the last shutdown is through a shutdown button or a shutdown control according to the first information. shutdown. If the first information includes the remaining battery power and the shutdown time, it is determined that the last shutdown was performed by a shutdown button or a shutdown control. In this application, the shutdown method of shutting down by a shutdown button or a shutdown control is recorded as the first type. If the first information does not include the remaining battery power and the shutdown time, it is determined that the last shutdown was done by the restart button or the restart control, and there is no need to calibrate the power.
  • the second data is the second preset value, it is determined that the last shutdown was caused by the loosening or removal of the first battery.
  • the shutdown mode of shutdown is recorded as the second type.
  • the processor may implement the power calibration in the following power calibration method.
  • the following power calibration method For a specific power calibration process, refer to the following power calibration method, which will not be repeated here.
  • FIG. 2 shows a schematic flow chart of the power calibration method provided by the present application. With reference to Figure 2, the method is described in detail as follows:
  • the start-up of the electronic device refers to when the electronic device starts to run.
  • the shutdown type of the electronic device may include shutdown of the electronic device caused by acting on the shutdown button or the shutdown control, shutdown of the electronic device caused by acting on the restart button or the restart control, or shutdown of the electronic device due to the loosening or removal of the first battery. shutdown.
  • the first battery supplies power to the charging management module and does not supply power to the peripheral circuit.
  • the module and the fuel gauge supply power, and this shutdown mode is recorded as the first type.
  • the first battery always supplies power to the charging management module, peripheral circuit modules and fuel gauge during the process from shutdown to restart of the electronic device.
  • the power in the fuel gauge does not need to be calibrated.
  • the first battery will not supply power to the charge management module, the peripheral circuit module and the fuel gauge.
  • the first type includes: after the electronic device is turned off, the first battery supplies power to the charging management module, but does not supply power to the peripheral circuit module and the fuel gauge.
  • the power-off time and the power remaining after power-off are obtained from the FLASH chip in the peripheral circuit module.
  • step S102 may include:
  • the total capacity of the battery can be set according to the type of the battery used, for example, the battery capacity of the No. 7 battery is different from that of the No. 5 battery.
  • the first ratio of the first product to the total capacity is calculated to obtain the shutdown power consumption.
  • a power calculation model may be used to calculate the current power.
  • the power calculation model includes:
  • U is the current power
  • U L is the remaining power of the power off
  • T D is the current time
  • T L is the power off time
  • U A is the power consumption per unit time when the power is off
  • U is the total capacity.
  • the current power may be sent to the fuel gauge, so that the fuel gauge saves the current power and continues to calculate the subsequent power according to the current power.
  • the remaining power and power-off time in the FLASH chip in the peripheral circuit module can be erased to prevent the power from being calibrated after reading the power-off time and power-off power when restarting , resulting in inaccurate power levels of electronic devices after restarting.
  • each power consumption unit in the electronic device can read the current power and determine whether the current power meets its own power demand. If the current power can meet its own power demand, the power unit can work normally; if the current power does not meet its own power demand If the power demand is not met, the power unit cannot work normally.
  • the power consumption unit may include a bluetooth unit, a printing unit, and the like.
  • the shutdown type of the last shutdown of the electronic device is first obtained; when the shutdown type is the first type, the electronic The current power of the device, wherein, the first type includes: after the electronic device is shut down, the first battery supplies power to the charging management module, and does not supply power to the peripheral circuit module and the fuel gauge; in this application, the shutdown time and shutdown remaining time of the last shutdown are used.
  • the current power obtained by the electric power is more accurate than the current electric power obtained by using the OCV curve in the prior art.
  • the above method may further include:
  • the second type includes that after the electronic device is turned off, the first battery does not supply power to the peripheral circuit module, the charge management module and the fuel gauge.
  • the processor when the electronic device is turned off by pulling out the battery, the processor cannot predict in advance, therefore, the peripheral circuit module cannot save the shutdown time and the remaining power of the shutdown, therefore, when the shutdown type is the second type, it cannot Calculate the current battery capacity based on the shutdown time and the remaining battery power.
  • the fuel gauge can read the voltage value of the battery in the first battery.
  • the voltage value read by the fuel gauge is recorded as the current voltage value.
  • the processor can get the current voltage value from the fuel gauge.
  • the prestored OCV graph is obtained; the first power value corresponding to the current voltage value in the OCV graph is searched, and the first power value is the current power value of the POS machine.
  • the OCV graph is a graph representing the relationship between voltage and power, and each voltage value in the graph corresponds to a power value.
  • the current power is sent to the fuel gauge, and the fuel gauge performs subsequent power calculation according to the current power.
  • the current battery voltage and OCV curve are used to obtain the current power, which can ensure that the power can still be calibrated when the shutdown time and remaining power cannot be obtained when the shutdown type is the second type. .
  • step S101 may include:
  • the first data in the charging management module is read first. Specifically, read the first data from the register in the charging management module. Since the charging management module is not powered off during normal shutdown, it is always in the power-on state. Only after the first battery is loosened or unplugged, the charging management module will be powered off. Therefore, a register can be set in the charging management module, and after the charging management module is powered off, the data in the register will restore to default data (initial data), that is, the second preset value. After the charging management module is powered on, the processor can control the second preset value in the register to be updated to the first preset value. Based on the above settings, after the electronic device is powered on, the first data can be read from the register first, and the shutdown type of the last shutdown can be determined based on the first data.
  • the normal shutdown is shutdown by pressing the shutdown button or the shutdown control, or shutdown by pressing the restart button or the restart control.
  • the first preset value indicates that the charging management module is in a power-on state before the electronic device is turned on.
  • the charging management module is not powered off after the last shutdown.
  • the power-off time and the remaining power of the power-off have been stored in the peripheral circuit module when the power is turned off. Whether the last shutdown is the shutdown after acting on the shutdown button or the shutdown control. If the first information includes the remaining battery power and the shutdown time, it is determined that the shutdown type is the first type.
  • the second preset value indicates that the charging management module is in a power-off state before the electronic device is turned on.
  • the first data in the charging management module is updated to the second preset value after the charging management module is powered off, after the electronic device is turned on, it can first be determined according to the setting in the charging management module whether the shutdown type is is the second type, if the first data is the second preset value, then determine the shutdown type as the second type.
  • the processor after determining the shutdown type, sends a second instruction to the charging management module, and the charging management module updates the second preset value to the first preset value after receiving the second instruction, and keeps The first preset value remains unchanged until the charging management module is powered off, and the first preset value in the charging management module becomes the second preset value.
  • the above method may also include:
  • the first signal is a signal generated by acting on a power-off button or a power-off control of the electronic device.
  • the current power value is used to represent the remaining power of the electronic device when it is turned off this time, that is, the remaining power of the electronic device when it is turned off this time.
  • the current power value of the electronic device is acquired from the power gauge.
  • a first instruction is sent to the charging management module.
  • the current time and the current power value are stored in the peripheral circuit module, so that the power can be calibrated according to the stored shutdown time and remaining power when the power is turned off next time.
  • the above method may also include:
  • the first data is a first preset value
  • Sending a second instruction to the charging management module, the second instruction is used to instruct the charging management module to update the first data to a second preset value.
  • the first information includes the remaining battery power and the shutdown time
  • the current power of the electronic device is obtained according to the shutdown time and the remaining power when the electronic device is shut down for the last time.
  • the first type includes: after the electronic device is turned off, the first battery supplies power to the charging management module, but does not supply power to the peripheral circuit module and the fuel gauge. After calculation, send the first instruction to the charging management module.
  • the first instruction is used to instruct the charging management module to control the first battery to stop supplying power to the peripheral circuit module and the fuel gauge.
  • the shutdown type is the second type. Get the current voltage value of the first battery as read by the fuel gauge.
  • the second type includes that after the electronic device is turned off, the first battery does not supply power to the peripheral circuit module, the charging management module and the fuel gauge.
  • the electronic device 500 may include: at least one processor 510, a memory 520, and A running computer program, when the processor 510 executes the computer program, implements the steps in any of the foregoing method embodiments, for example, step S101 to step S102 in the embodiment shown in FIG. 2 .
  • the computer program can be divided into one or more modules/units, and one or more modules/units are stored in the memory 520 and executed by the processor 510 to complete the present application.
  • the one or more modules/units may be a series of computer program segments capable of accomplishing specific functions, and the program segments are used to describe the execution process of the computer program in the electronic device 500 .
  • FIG. 6 is only an example of an electronic device, and does not constitute a limitation to the electronic device. It may include more or fewer components than shown in the figure, or combine certain components, or different components, such as Input and output devices, network access devices, buses, etc.
  • the processor 510 can be a central processing unit (Central Processing Unit, CPU), and can also be other general-purpose processors, digital signal processors (Digital Signal Processor, DSP), application specific integrated circuits (Application Specific Integrated Circuit, ASIC), off-the-shelf Field-Programmable Gate Array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc.
  • a general-purpose processor may be a microprocessor, or the processor may be any conventional processor, or the like.
  • the memory 520 can be an internal storage unit of the electronic device, or an external storage device of the electronic device, such as a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash memory card (Flash Card) etc.
  • the memory 520 is used to store the computer program and other programs and data required by the electronic device.
  • the memory 520 can also be used to temporarily store data that has been output or will be output.
  • the bus can be an Industry Standard Architecture (Industry Standard Architecture, ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (Extended Industry Standard Architecture, EISA) bus, etc.
  • ISA Industry Standard Architecture
  • PCI Peripheral Component Interconnect
  • EISA Extended Industry Standard Architecture
  • the bus can be divided into address bus, data bus, control bus and so on.
  • the buses in the drawings of the present application are not limited to only one bus or one type of bus.
  • the power calibration method provided in the embodiment of the present application can be applied to terminal devices such as computers, tablet computers, notebook computers, netbooks, personal digital assistants (PDAs), and the embodiments of the present application do not make any restrictions on the specific types of terminal devices .
  • terminal devices such as computers, tablet computers, notebook computers, netbooks, personal digital assistants (PDAs), and the embodiments of the present application do not make any restrictions on the specific types of terminal devices .
  • PDAs personal digital assistants
  • the disclosed terminal equipment, apparatus and method may be implemented in other ways.
  • the terminal device embodiments described above are only illustrative.
  • the division of the modules or units is only a logical function division.
  • the mutual coupling or direct coupling or communication connection shown or discussed may be through some interfaces, and the indirect coupling or communication connection of devices or units may be in electrical, mechanical or other forms.
  • the units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place, or may be distributed to multiple network units. Part or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
  • each functional unit in each embodiment of the present application may be integrated into one processing unit, each unit may exist separately physically, or two or more units may be integrated into one unit.
  • the above-mentioned integrated units can be implemented in the form of hardware or in the form of software functional units.
  • the integrated unit is realized in the form of a software function unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, all or part of the processes in the methods of the above embodiments in the present application can also be completed by instructing related hardware through computer programs.
  • the computer programs can be stored in a computer-readable storage medium, and the computer When the program is executed by one or more processors, it can realize the steps of the above-mentioned various method embodiments.
  • the integrated unit is realized in the form of a software function unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, all or part of the processes in the methods of the above embodiments in the present application can also be completed by instructing related hardware through computer programs.
  • the computer programs can be stored in a computer-readable storage medium, and the computer When the program is executed by one or more processors, it can realize the steps of the above-mentioned various method embodiments.
  • the terminal device when the computer program product runs on the terminal device, the terminal device can implement the steps in the foregoing method embodiments when executed.
  • the computer program includes computer program code
  • the computer program code may be in the form of source code, object code, executable file or some intermediate form.
  • the computer-readable medium may include: any entity or device capable of carrying the computer program code, a recording medium, a USB flash drive, a removable hard disk, a magnetic disk, an optical disk, a computer memory, and a read-only memory (ROM, Read-Only Memory) , Random Access Memory (RAM, Random Access Memory), electrical carrier signal, telecommunication signal and software distribution medium, etc.
  • ROM Read-Only Memory
  • RAM Random Access Memory
  • electrical carrier signal telecommunication signal and software distribution medium, etc.
  • the content contained in the computer-readable medium may be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, computer-readable media Excluding electrical carrier signals and telecommunication signals.

Landscapes

  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Charge And Discharge Circuits For Batteries Or The Like (AREA)

Abstract

一种电量校准方法、电子设备及存储介质,该方法包括:在电子设备开机后,先获取电子设备最后一次关机时的关机类型(S101);在关机类型为第一类型时,根据电子设备最后一次关机时的关机时间和关机剩余电量,得到电子设备的当前电量(S102),其中,第一类型包括:电子设备关机后,第一电池为充电管理模块供电,不为***电路模块和电量计供电。使用最后一次关机时的关机时间和关机剩余电量得到当前电量,相较于现有技术中使用OCV曲线得到的当前电量更准确。

Description

一种电量校准方法、电子设备及存储介质
本申请要求于2021年12月17日在中国专利局提交的、申请号为202111556687.3的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请属于电量校准技术领域,尤其涉及一种电量校准方法、电子设备及存储介质。
背景技术
随着科技的发展,越来越多的电子设备应用于人们的日常生活中,不同的电子设备可能具有不同的功能,但是现在的电子设备均需要电源才可以正常运行。
许多电子设备的电源为电池,电池向电子设备供电,以保证电子设备的正常用电需求。目前,电子设备中的电量计在断电再次启动时,为保证电量计中显示的电子设备的剩余电量的准确性,需要对电子设备的电量进行校准。目前,对电量进行校准多通过OCV曲线进行校准,由于OCV曲线不准确,因此,校准的电量不准确。
技术问题
本申请实施例提供了一种电量校准方法、电子设备及存储介质,可以解决电量校准不准确的问题。
技术解决方案
第一方面,本申请实施例提供了一种电量校准方法,应用于电子设备,所述电子设备包括第一电池、充电管理模块、***电路模块和用于监测所述电子设备电量的电量计,在所述电子设备开机后,所述第一电池通过所述充电管理模块为所述电量计和所述***电路模块供电;
所述方法包括:
在所述电子设备开机后,获取所述电子设备最后一次关机时的关机类型;
在所述关机类型为第一类型时,根据所述电子设备最后一次关机时的关机时间和关机剩余电量,得到所述电子设备的当前电量,其中,所述第一类型包括:所述电子设备关机后,所述第一电池为所述充电管理模块供电,不为所述***电路模块和所述电量计供电。
第二方面,本申请实施例提供了一种电子设备,包括:第一电池、充电管理模块、***电路模块和用于监测所述电子设备电量的电量计,在所述电子设备开机后,所述第一电池通过所述充电管理模块为所述电量计和所述***电路模块供电,所述***电路模块包括处理器;
所述处理器用于实现上述第一方面所述的电量校准方法。
第三方面,本申请实施例提供了一种电子设备,包括:存储器、处理器以及存储在所述存储器中并可在所述处理器上运行的计算机程序,其特征在于,所述处理器执行所述计算机程序时实现上述第一方面中任一项所述的电量校准方法。
第四方面,本申请实施例提供了一种计算机可读存储介质,所述计算机可读存储介质存储有计算机程序,其特征在于,所述计算机程序被处理器执行时实现上述第一方面中任一项所述的电量校准方法。
第五方面,本申请实施例提供了一种计算机程序产品,当计算机程序产品在终端设备上运行时,使得终端设备执行上述第一方面中任一项所述的电量校准方法。
有益效果
本申请第一方面实施例与现有技术相比存在的有益效果是:本申请在电子设备开机后,先获取电子设备最后一次关机时的关机类型;在关机类型为第一类型时,根据电子设备最后一次关机时的关机时间和关机剩余电量,得到电子设备的当前电量,其中,第一类型包括:电子设备关机后,第一电池为充电管理模块供电,不为***电路模块和电量计供电;本申请中使用最后一次关机时的关机时间和关机剩余电量得到当前电量,相较于现有技术中使用OCV曲线得到的当前电量更准确。
可以理解的是,上述第二方面至第五方面的有益效果可以参见上述第一方面中的相关描述,在此不再赘述。
附图说明
为了更清楚地说明本申请实施例中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动性的前提下,还可以根据这些附图获得其他的附图。
图1是本申请一实施例提供的电子设备的结构示意图;
图2是本申请一实施例提供的电量校准方法的流程示意图;
图3是本申请另一实施例提供的电量校准方法的流程示意图;
图4是本申请一实施例提供的关机类型的确定方法的流程示意图;
图5是本申请另一实施例提供的电量校准方法的流程示意图;
图6是本申请一实施例提供的电子设备的结构示意图。
本发明的实施方式
以下描述中,为了说明而不是为了限定,提出了诸如特定***结构、技术之类的具体细节,以便透彻理解本申请实施例。然而,本领域的技术人员应当清楚,在没有这些具体 细节的其它实施例中也可以实现本申请。在其它情况中,省略对众所周知的***、装置、电路以及方法的详细说明,以免不必要的细节妨碍本申请的描述。
应当理解,当在本申请说明书和所附权利要求书中使用时,术语“包括”指示所描述特征、整体、步骤、操作、元素和/或组件的存在,但并不排除一个或多个其它特征、整体、步骤、操作、元素、组件和/或其集合的存在或添加。
还应当理解,在本申请说明书和所附权利要求书中使用的术语“和/或”是指相关联列出的项中的一个或多个的任何组合以及所有可能组合,并且包括这些组合。
如在本申请说明书和所附权利要求书中所使用的那样,术语“如果”可以依据上下文被解释为“当……时”或“一旦”或“响应于确定”或“响应于检测到”。类似地,短语“如果确定”或“如果检测到[所描述条件或事件]”可以依据上下文被解释为意指“一旦确定”或“响应于确定”或“一旦检测到[所描述条件或事件]”或“响应于检测到[所描述条件或事件]”。
另外,在本申请说明书和所附权利要求书的描述中,术语“第一”、“第二”、“第三”等仅用于区分描述,而不能理解为指示或暗示相对重要性。
在本申请说明书中描述的参考“一个实施例”或“一些实施例”等意味着在本申请的一个或多个实施例中包括结合该实施例描述的特定特征、结构或特点。由此,在本说明书中的不同之处出现的语句“在一个实施例中”、“在一些实施例中”、“在其他一些实施例中”、“在另外一些实施例中”等不是必然都参考相同的实施例,而是意味着“一个或多个但不是所有的实施例”,除非是以其他方式另外特别强调。术语“包括”、“包含”、“具有”及它们的变形都意味着“包括但不限于”,除非是以其他方式另外特别强调。
目前,电子设备多是通过电池供电,例如POS机,在电子设备为关机状态时,电池依然在为电子设备中的电量计和***电路等供电,电池的电量消耗较快。为了便于说明,本申请中电子设备以POS机为例进行说明。
对于POS机来说,当电池电量低于预设值后,将会触发POS机中的安全CPU,使POS机进入安全模式,导致用户在拿到POS机之后不能使用。
基于上述问题,本申请在POS机关机时,将POS机中的部分设备断电,例如,电量计、***电路等,以减少电池的耗电量,延长电池的使用时间。
另外,由于电量计在关机时断电不工作,电量计中的数据会丢失,POS机在开机时需要校准电量,以保证得到准确的POS机的剩余电量。
基于上述问题,本申请在关机之前,将关机时的关机时间和关机剩余电量进行保存,在POS机开机后,根据关机时间和关机剩余电量对POS机中的电量进行校准,得到准确的 电量。
图1示出了本申请提供的电子设备的结构示意图,参照图1,对该电子设备包括:
第一电池10、第二电池30、充电管理模块20、安全CPU模块40、***电路模块50和电量计60。***电路模块50包括处理器。安全CPU模块40包括安全CPU芯片。
第一电池10分别与充电管理模块20和安全CPU模块40相连。充电管理模块20分别与***电路模块50和电量计60相连。第二电池30与安全CPU模块40。
第一电池10的电池容量大于第二电池30的电池容量。例如,第一电池中的电池为5号电池,第二电池中的电池为纽扣电池。
在本实施例中,在电子设备关机或开机时,第一电池10和第二电池30中的至少一个为安全CPU模块40供电。具体的,第一电池10可以先为安全CPU模块40供电,在第一电池10的电量低于预设值后,使用第二电池30为安全CPU模块40供电。
在一种可能的实现方式中,在电子设备运行过程中,处理器用于检测关机信号,其中,关机信号为作用在电子设备的关机按键或关机控件上生成的信号。本申请中将关机信号记为第一信号。例如,用力按压关机按键后生成第一信号。
处理器在检测到关机信号后,从电量计60中读取当前电量值,并将当前电量值和当前时间写入***电路模块50。在写入当前电量值和当前时间后,向充电管理模块20发送第一指令,其中第一指令用于指示充电管理模块控制第一电池停止为所述电量计60和所述***电路模块50供电。
具体的,***电路模块50还可以包括FLASH芯片,处理器将当前电量值和当前时间写入FLASH芯片中。
具体的,当前电量值用于表征本次关机的关机剩余电量,当前时间用于表征本次关机的关机时间。在下次开机时,FLASH芯片中的关机时间为上次关机时的关机时间,FLASH芯片中的关机剩余电量为上次关机时的电子设备的剩余电量。
作为举例,若当前时间为5点20分,电子设备需要关机,处理器将当前时间和当前电量值存储至FLASH芯片中。在经过20分钟后,当前时间为5点40分,电子设备开机。FLASH芯片中存储的时间和电量值为5点20分关机时的关机时间和关机剩余电量。
在本实施例中,处理器在将关机时间和关机剩余电量写入***电路模块50后,处理器向充电管理模块20发送第一指令。充电管理模块20接收到第一指令后,充电管理模块20断开充电管理模块20与***电路模块50,以及充电管理模块20和电量计60之间的通路,使第一电池10在电子设备关机时,不为***电路模块50和电量计60供电,减少了电池的消耗,延长了第一电池的使用时间。
作为举例,若POS机的电池总容量是2000mAh,关机时单位时间的功耗是20uAh,那么消耗1%的电量需要的时间为:1%=Y*20*100%/3600/2000000,Y=3600000秒=1000小时=41.66天。也就是说在关机时,消耗1%的电量需要41天多,如果按照POS机的仓储标准60%电量进行存储,那么消耗完60%的电量需要41.66*60=2499.6天=6.8年左右。如果是满电2000mAh那么关机时可以使用41.66*100=4166天=11.4年,满足POS机3年内不掉电触发的标准。
在一种可能的实现方式中,由于在电子设备关机时,第一电池10还是继续为充电管理模块20供电的,在电子设备关机时,充电管理模块20仍然可以继续运行。
充电管理模块20,还用于检测开机信号,其中,开机信号为作用在电子设备上的开机按键后生成的信号,或在电子设备上***外部电源后生成的信号。
充电管理模块20在检测到开机信号后,充电管理模块20接通充电管理模块20和***电路模块50,以及充电管理模块20和电量计60之间的通路,使第一电池10通过充电管理模块20为***电路模块50和电量计60供电,保证电子设备在开机后,各个设备可以正常运行。
在一种可能的实现方式中,处理器还可以用于检测重启信号,重启信号为作用在电子设备的重启按键或重启控件上生成的信号。例如,用户按压重启按键后生成重启信号。
处理器在检测到重启信号后,电子设备中的软件进行重启,电子设备中的各个硬件之间不断电。具体的,在电子设备重启过程中,第一电池10继续通过充电管理模块20为***电路模块50和电量计60供电。由于在重启过程中,电量计60没有断电,电量计60一直处于工作状态,电量计60可以实时计算电子设备的当前电量,因此,在电子设备开机后,电量计60中的电量是电子设备的当前电量,不用对电量计60中的电量进行校准。在电子设备重启时,处理器不会控制***电路模块50存储关机时间和关机剩余电量,因此,若是由于重启造成的电子设备关机,电子设备在开机后,从***电路模块50中读取不到关机时间和关机剩余电量。
在一种可能的实现方式中,充电管理模块20可以包括寄存器。寄存器在断电时进行初始化,寄存器中的数据可以恢复至初始数据,在本申请中,将寄存器中的数据记为第一数据,将初始数记为第二预设值,例如,第二预设值可以为0、2或4等。
在电子设备开机后,寄存器上电,寄存器中的数据仍然为第二预设值,直至处理器向充电管理模块20发送第二指令,充电管理模块20在接收到第二指令后,将初始数据更新为第一预设值,第一预设值表征充电管理模块20上电,例如,第一预设值可以为1、3或5等。
在电子设备运行过程中,若充电管理模块20不断电,充电管理模块20的寄存器中的 数据将保持第一预设值不变,直至充电管理模块20断电,充电管理模块20中的数据恢复第二预设值。
在一种可能的实现方式中,由于电子设备的关机可能还是由于第一电池松动或移除,导致电子设备关机。在由于第一电池10松动或移除导致电子设备关机时,处理器并没有将关机时间和关机剩余电量存储至***电路模块50,电子设备再次开机后,处理器无法得到最后一次关机时的关机时间和关机剩余电量。
如果电子设备是由于第一电池10的松动或移除导致的关机,电子设备在关机时,电子设备中的充电管理模块20、***电路模块50和电量计60均断电。充电管理模块20中的数据恢复至第二预设值。
在电子设备开机时,处理器可以先读取***电路模块50中的第一数据,根据第一数据可以确定最后一次关机是否是由于第一电池松动或移除导致的关机。
具体的,若第一数据为第一预设值,则确定最后一次关机不是由于第一电池10松动或移除导致的关机。具体的,在确定最后一次关机不是由于第一电池10松动或移除导致的关机后,获取***电路模块50中的第一信息,根据第一信息确定最后一次关机是否是通过关机按键或关机控件关机。若所述第一信息包括关机剩余电量和关机时间,则确定最后一次关机是通过关机按键或关机控件进行的关机,本申请中将通过关机按键或关机控件关机的关机方式记为第一类型。若第一信息不包括关机剩余电量和关机时间,则确定最后一次关机是通过重启按键或重启控件关机,不需要对电量进行校准。
在本实施例中,若第二数据为第二预设值,则确定最后一次关机是由于第一电池松动或移除导致的关机,本申请中将由于第一电池的电池松动或移除导致关机的关机方式记为第二类型。
在一种可能的实现方式中,处理器可以实现下述的电量校准方法中的电量校准,具体的电量校准的过程参照下述电量校准方法,在此不再赘述。
以下结合图1对本申请实施例的电量校准方法进行详细说明。
图2示出了本申请提供的电量校准方法的示意性流程图,参照图2,对该方法的详述如下:
S101,在所述电子设备开机后,获取电子设备最后一次关机时的关机类型。
在本实施例中,电子设备开机指电子设备开始运行时。电子设备的关机类型可以包括由于作用在关机按键或关机控件上后导致的电子设备关机、由于作用在重启按键或重启控件上后导致的电子设备关机或由于第一电池松动或移除导致电子设备关机。
具体的,若是由于作用在关机按键或关机控件上后导致的电子设备关机,在该种情况下,电子设备关机后,所述第一电池为所述充电管理模块供电,不为所述***电路模块和所述电量计供电,该种关机方式记为第一类型。
若是由于作用在重启按键或重启控件上后导致的电子设备关机,该种情况下,电子设备从关机到重启的过程中,第一电池始终为充电管理模块供电、***电路模块和电量计供电。电量计中的电量不用校准。
若是由于第一电池松动或移除导致电子设备关机,该种情况下,电子设备关机后,第一电池不会为充电管理模块供电、***电路模块和电量计供电。
S102,在所述关机类型为第一类型时,根据所述电子设备最后一次关机时的关机时间和关机剩余电量,得到所述电子设备的当前电量。
在本实施例中,第一类型包括:所述电子设备关机后,第一电池为所述充电管理模块供电,不为所述***电路模块和所述电量计供电。
具体的,关机时间和关机剩余电量从***电路模块中的FLASH芯片中获得。
具体的,步骤S102的实现过程可以包括:
S1021,计算当前时间减去关机时间的第一差值。
S1022,计算第一差值和关机时单位时间的耗电量的第一乘积。
S1023,基于所述第一乘积、所述关机剩余电量和预设的所述第一电池中电池的总容量,得到所述当前电量。
在本实施例中,电池的总容量可以根据使用的电池的类型进行设置,例如,七号电池与五号电池的电池容量不同。
在本实施例中,计算第一乘积与总容量的第一比值,得到关机耗电量。
计算关机剩余电量与第一比值的第二差值,得到当前电量。
具体的,可以采用电量计算模型计算当前电量。电量计算模型包括:
Figure PCTCN2022125964-appb-000001
其中,U为当前电量,U L为关机剩余电量,T D为当前时间,T L为关机时间,U A为关机时单位时间的耗电量,U 为总容量。
在本实施例中,得到当前电量后,可以向电量计发送当前电量,以使得电量计保存当前电量,并按照当前电量继续计算后续的电量。
在本实施例中,在计算完当前电量后,可以将***电路模块中的FLASH芯片中的关机 剩余电量和关机时间擦除,防止重启时读取到关机时间和关机剩余电量后对电量进行校准,导致重启后电子设备的电量不准确。
在本实施例中,在得到当前电量后,电子设备中的***正式启动。电子设备中的各个用电单元可以读取当前电量,并确定当前电量是否满足自身用电需求,若当前电量可以满足自身用电需求,则该用电单元可以正常工作;若当前电量不满足自身用电需求,则该用电单元不能正常工作。
作为举例,用电单元可以包括蓝牙单元和打印单元等。
本申请实施例中,在电子设备开机后,先获取电子设备最后一次关机时的关机类型;在关机类型为第一类型时,根据电子设备最后一次关机时的关机时间和关机剩余电量,得到电子设备的当前电量,其中,第一类型包括:电子设备关机后,第一电池为充电管理模块供电,不为***电路模块和电量计供电;本申请中使用最后一次关机是的关机时间和关机剩余电量得到当前电量,相较于现有技术中使用OCV曲线得到的当前电量更准确。
如图3所示,在一种可能的实现方式中,在步骤101之后,上述方法还可以包括:
S201,在关机类型为第二类型时,获取第一电池的当前电压值。
在本实施例中,第二类型包括所述电子设备关机后,所述第一电池不为所述***电路模块、所述充电管理模块和所述电量计供电。
在本实施例中,当电子设备为拔电池关机时,处理器无法提前预知,因此,***电路模块无法保存关机时的关机时间和关机剩余电量,因此,在关机类型为第二类型时,无法根据关机时间和关机剩余电量计算当前电量。
在电子设备开机后,电量计上电,电量计可以读取第一电池中电池的电压值,本申请中将电量计读取的电压值记为当前电压值。处理器可以从电量计中获得当前电压值。
S202,根据当前电压值,得到电子设备的当前电量。
具体的,获取预存的OCV曲线图;查找OCV曲线图中的当前电压值对应的第一电量值,第一电量值为所述POS机的当前电量。
在本实施例中,OCV曲线图为表征电压与电量关系的曲线图,曲线图中每个电压值对应一个电量值。
在本实施例中,在得到当前电量后,将当前电量发送至电量计中,电量计根据当前电量进行后续电量计算。
本申请实施例中,采用电池的当前电压值和OCV曲线图得到当前电量,可以保证在关机类型为第二类型时,获取不到关机时间和关机剩余电量的情况下,仍然可以对电量进行校准。
如图4所示,在一种可能的实现方式中,步骤S101的实现过程可以包括:
S1011,获取所述充电管理模块中的第一数据。
在本实施例中,在电子设备开机后,先读取充电管理模块中的第一数据。具体的,从充电管理模块中的寄存器中读取第一数据。由于在正常关机时,充电管理模块不断电,一直处于上电状态。只有在第一电池松动或拔掉后,充电管理模块才会断电。因此,可以在充电管理模块中设置寄存器,在充电管理模块下电后,寄存器中的数据恢复为默认数据(初始数据),也就是第二预设值。在充电管理模块上电后,处理器可以控制寄存器中的第二预设值更新为第一预设值。基于以上设置,在电子设备上电后,可以先从寄存器中读取第一数据,基于第一数据判断最后一次关机的关机类型。
在本实施例中,正常关机为按压关机按键或关机控件关机,或者是按压重启按键或重启控件关机。
S1012,若所述第一数据为第一预设值,获取所述***电路模块中的第一信息。
在本实施例中,第一预设值表征在所述电子设备开机之前所述充电管理模块为上电状态。
在本实施例中,若第一数据为第一预设值,则可以确定最后一次关机为正常关机,充电管理模块在最后一次关机后没有断电。
S1013,若所述第一信息包括所述关机剩余电量和所述关机时间,则确定所述关机类型为所述第一类型。
S1014,若所述第一信息不包括所述关机剩余电量和所述关机时间,则不用校准电量。
在本实施例中,由于在按压关机按键或关机控件关机时,才需要对电量进行校准。若最后一次关机是通过按压重启按键或重启控件进行关机,由于该种情况电量计不断电,则不需要对电量进行校准。
因此,在确定最后一次关机为正常关机后,还需要确定上次关机是否为按压关机按键或关机控件关机。
在本实施例中,由于按压关机按键或关机控件关机时,在关机时已经将关机时间和关机剩余电量存储在***电路模块中,因此,可以根据***电路中是否存在关机剩余电量和关机时间确定最后一次关机的是否为通过作用在关机按键或关机控件后的关机。若所述第一信息包括关机剩余电量和关机时间,则确定关机类型为所述第一类型。
S1015若第一数据为第二预设值,则确定关机类型为所述第二类型。
在本实施例中,第二预设值表征在电子设备开机之前充电管理模块为下电状态。
在本实施例中,由于充电管理模块在下电后,充电管理模块中的第一数据更新为第二 预设值,因此,在电子设备开机后,可以先根据充电管理模块中的确定关机类型是否为第二类型,若第一数据为第二预设值,则确定关机类型为第二类型。
在本实施例中,在确定关机类型后,处理器向充电管理模块发送第二指令,充电管理模块在接收到第二指令后,将第二预设值更新为第一预设值,并保持第一预设值不变,直至充电管理模块下电后,充电管理模块中的第一预设值变为第二预设值。
如图5所示,在一种可能的实现方式中,上述方法还可以包括:
S301,在接收到第一信号后,获取电子设备的当前电量值。
在本实施例中,第一信号为作用在电子设备的关机按键或关机控件上生成的信号。
在本实施例中,当前电量值用于表征本次关机时电子设备的关机剩余电量,也就是本次关机时电子设备的剩余电量。
具体的,从电量计中获取电子设备的当前电量值。
S302,将所述当前电量值和当前时间写入所述***电路模块,其中,当前时间用于本次关机的关机时间。
S303,向所述充电管理模块发送第一指令,第一指令用于指示充电管理模块控制第一电池停止为所述电量计和***电路模块供电。
具体的,在将所述当前电量值和当前时间写入所述***电路模块之后,向所述充电管理模块发送第一指令。
本申请实施例中,在关机之前,将当前时间和当前电量值保存在***电路模块中,以便于下次关机时,根据保存的上次关机是的关机时间和关机剩余电量对电量进行校准。
在一种可能的实现方式中,上述方法还可以包括:
S401,获取充电管理模块的寄存器中的第一数据。
S402,若第一数据为第一预设值,获取***电路模块的FLASH芯片中的第一信息。向充电管理模块发送第二指令,第二指令用于指示充电管理模块将第一数据更新为第二预设值。
S403,若所述第一信息包括关机剩余电量和关机时间,则确定关机类型为第一类型。根据电子设备最后一次关机时的关机时间和关机剩余电量,得到电子设备的当前电量。第一类型包括:所述电子设备关机后,所述第一电池为所述充电管理模块供电,不为所述***电路模块和所述电量计供电。在计算后,向充电管理模块发送第一指令。第一指令用于指示充电管理模块控制第一电池停止为***电路模块和电量计供电。
S404,若第一信息不包括所述关机剩余电量和所述关机时间,则不用校准电量。
S405,若第一数据为第二预设值,确定关机类型为第二类型。获取电量计读取的第一 电池的当前电压值。第二类型包括所述电子设备关机后,所述第一电池不为所述***电路模块、所述充电管理模块和所述电量计供电。
S406,根据所述当前电压值,得到所述电子设备的当前电量。
S407,向电量计发送当前电量。
S408,获取关机信号,并判断关机信号是否为按压关机按键产生的信号。
S409,若关机信号为按关机按键产生的信号。读取电量计的当前电量值,并将当前电量值和当前时间保存至FLASH芯片中。
S410,电子设备关机。
应理解,上述实施例中各步骤的序号的大小并不意味着执行顺序的先后,各过程的执行顺序应以其功能和内在逻辑确定,而不应对本申请实施例的实施过程构成任何限定。
本申请实施例还提供了一种电子设备,参见图6,该电子设备500可以包括:至少一个处理器510、存储器520以及存储在所述存储器520中并可在所述至少一个处理器510上运行的计算机程序,所述处理器510执行所述计算机程序时实现上述任意各个方法实施例中的步骤,例如图2所示实施例中的步骤S101至步骤S102。
示例性的,计算机程序可以被分割成一个或多个模块/单元,一个或者多个模块/单元被存储在存储器520中,并由处理器510执行,以完成本申请。所述一个或多个模块/单元可以是能够完成特定功能的一系列计算机程序段,该程序段用于描述计算机程序在电子设备500中的执行过程。
本领域技术人员可以理解,图6仅仅是电子设备的示例,并不构成对电子设备的限定,可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件,例如输入输出设备、网络接入设备、总线等。
处理器510可以是中央处理单元(Central Processing Unit,CPU),还可以是其他通用处理器、数字信号处理器(Digital Signal Processor,DSP)、专用集成电路(Application Specific Integrated Circuit,ASIC)、现成可编程门阵列(Field-Programmable Gate Array,FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件等。通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。
存储器520可以是电子设备的内部存储单元,也可以是电子设备的外部存储设备,例如插接式硬盘,智能存储卡(Smart Media Card,SMC),安全数字(Secure Digital,SD)卡,闪存卡(Flash Card)等。所述存储器520用于存储所述计算机程序以及电子设备所需的其他程序和数据。所述存储器520还可以用于暂时地存储已经输出或者将要输出的数 据。
总线可以是工业标准体系结构(Industry Standard Architecture,ISA)总线、外部设备互连(Peripheral Component,PCI)总线或扩展工业标准体系结构(Extended Industry Standard Architecture,EISA)总线等。总线可以分为地址总线、数据总线、控制总线等。为便于表示,本申请附图中的总线并不限定仅有一根总线或一种类型的总线。
本申请实施例提供的电量校准方法可以应用于计算机、平板电脑、笔记本电脑、上网本、个人数字助理(personal digital assistant,PDA)等终端设备上,本申请实施例对终端设备的具体类型不作任何限制。
在上述实施例中,对各个实施例的描述都各有侧重,某个实施例中没有详述或记载的部分,可以参见其它实施例的相关描述。
本领域普通技术人员可以意识到,结合本文中所公开的实施例描述的各示例的单元及算法步骤,能够以电子硬件、或者计算机软件和电子硬件的结合来实现。这些功能究竟以硬件还是软件方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本申请的范围。
在本申请所提供的实施例中,应该理解到,所揭露的终端设备、装置和方法,可以通过其它的方式实现。例如,以上所描述的终端设备实施例仅仅是示意性的,例如,所述模块或单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个***,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通讯连接可以是通过一些接口,装置或单元的间接耦合或通讯连接,可以是电性,机械或其它的形式。
所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。
另外,在本申请各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。
所述集成的单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本申请实现上述实施例方法中的全部或部分流程,也可以通过计算机程序来指令相关的硬件来完成,所述的计算机程序可存储于一计算机可读存储介质中,该计算机程序在被一个或多个处理器执行时,可实现 上述各个方法实施例的步骤。
所述集成的单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本申请实现上述实施例方法中的全部或部分流程,也可以通过计算机程序来指令相关的硬件来完成,所述的计算机程序可存储于一计算机可读存储介质中,该计算机程序在被一个或多个处理器执行时,可实现上述各个方法实施例的步骤。
同样,作为一种计算机程序产品,当计算机程序产品在终端设备上运行时,使得终端设备执行时实现可实现上述各个方法实施例中的步骤。
其中,所述计算机程序包括计算机程序代码,所述计算机程序代码可以为源代码形式、对象代码形式、可执行文件或某些中间形式等。所述计算机可读介质可以包括:能够携带所述计算机程序代码的任何实体或装置、记录介质、U盘、移动硬盘、磁碟、光盘、计算机存储器、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,Random Access Memory)、电载波信号、电信信号以及软件分发介质等。需要说明的是,所述计算机可读介质包含的内容可以根据司法管辖区内立法和专利实践的要求进行适当的增减,例如在某些司法管辖区,根据立法和专利实践,计算机可读介质不包括是电载波信号和电信信号。
以上所述实施例仅用以说明本申请的技术方案,而非对其限制;尽管参照前述实施例对本申请进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本申请各实施例技术方案的精神和范围,均应包含在本申请的保护范围之内。

Claims (10)

  1. 一种电量校准方法,其特征在于,应用于电子设备,所述电子设备包括第一电池、充电管理模块、***电路模块和用于监测所述电子设备电量的电量计,在所述电子设备开机后,所述第一电池通过所述充电管理模块为所述电量计和所述***电路模块供电;
    所述方法包括:
    在所述电子设备开机后,获取所述电子设备最后一次关机时的关机类型;
    在所述关机类型为第一类型时,根据所述电子设备最后一次关机时的关机时间和关机剩余电量,得到所述电子设备的当前电量,其中,所述第一类型包括:所述电子设备关机后,所述第一电池为所述充电管理模块供电,不为所述***电路模块和所述电量计供电。
  2. 如权利要求1所述的电量校准方法,其特征在于,在获取所述电子设备最后一次关机时的关机类型之后,所述方法还包括:
    在所述关机类型为第二类型时,获取所述第一电池的当前电压值,其中,所述第二类型包括所述电子设备关机后,所述第一电池不为所述***电路模块、所述充电管理模块和所述电量计供电;
    根据所述当前电压值,得到所述电子设备的当前电量。
  3. 如权利要求2所述的电量校准方法,其特征在于,所述获取所述电子设备最后一次关机时的关机类型,包括:
    获取所述充电管理模块中的第一数据;
    若所述第一数据为第一预设值,获取所述***电路模块中的第一信息,其中,所述第一预设值表征在所述电子设备开机之前所述充电管理模块为上电状态;
    若所述第一信息包括所述关机剩余电量和所述关机时间,则确定所述关机类型为所述第一类型;
    若所述第一信息不包括所述关机剩余电量和所述关机时间,则不用校准电量。
  4. 如权利要求3所述的电量校准方法,其特征在于,在获取所述充电管理模块中的第一数据之后,包括:
    若所述第一数据为第二预设值,则确定所述关机类型为所述第二类型,其中,所述第二预设值表征在所述电子设备开机之前所述充电管理模块为下电状态。
  5. 如权利要求1所述的电量校准方法,其特征在于,所述根据所述电子设备最后一次关机时的关机时间和关机剩余电量,得到所述电子设备的当前电量,包括:
    计算所述当前时间减去所述关机时间的第一差值;
    计算第一差值和关机时单位时间的耗电量的第一乘积;
    基于所述第一乘积、所述关机剩余电量和预设的所述第一电池的总容量,得到所述当前电量。
  6. 如权利要求2所述的电量校准方法,其特征在于,所述根据所述当前电压值,得到所述电子设备的当前电量,包括:
    获取预存的OCV曲线图;
    查找所述OCV曲线图中的所述当前电压值对应的第一电量值,所述第一电量值为所述电子设备的当前电量。
  7. 如权利要求1至6任一项所述的电量校准方法,其特征在于,所述方法还包括:
    在接收到第一信号后,获取所述电子设备的当前电量值,其中,所述第一信号为作用在所述电子设备的关机按键或关机控件上生成的信号,所述当前电量值用于表征本次关机时所述电子设备的关机剩余电量;
    将所述当前电量值和当前时间写入所述***电路模块,其中,所述当前时间用于表征本次关机的关机时间;
    向所述充电管理模块发送第一指令,其中,所述第一指令用于指示所述充电管理模块控制所述第一电池停止为所述电量计和所述***电路模块供电。
  8. 如权利要求1至6任一项所述的电量校准方法,其特征在于,所述电子设备还包括第二电池和安全CPU模块;所述第一电池和所述第二电池均与所述安全CPU模块相连,在所述电子设备关机或开机时,所述第一电池和所述第二电池中的至少一个为所述安全CPU供电。
  9. 一种电子设备,其特征在于,包括:第一电池、充电管理模块、***电路模块和用于监测所述电子设备电量的电量计,在所述电子设备开机后,所述第一电池通过所述充电管理模块为所述电量计和所述***电路模块供电,所述***电路模块包括处理器;
    所述处理器用于实现上述权利要求1至权利要求8任一项所述的电量校准方法。
  10. 一种计算机可读存储介质,所述计算机可读存储介质存储有计算机程序,其特征在于,所述计算机程序被处理器执行时实现如权利要求1至8任一项所述的电量校准方法。
PCT/CN2022/125964 2021-12-17 2022-10-18 一种电量校准方法、电子设备及存储介质 WO2023109300A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202111556687.3 2021-12-17
CN202111556687.3A CN114236461B (zh) 2021-12-17 2021-12-17 一种电量校准方法、电子设备及存储介质

Publications (1)

Publication Number Publication Date
WO2023109300A1 true WO2023109300A1 (zh) 2023-06-22

Family

ID=80758538

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/125964 WO2023109300A1 (zh) 2021-12-17 2022-10-18 一种电量校准方法、电子设备及存储介质

Country Status (2)

Country Link
CN (1) CN114236461B (zh)
WO (1) WO2023109300A1 (zh)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114236461B (zh) * 2021-12-17 2023-11-21 深圳市百富智能新技术有限公司 一种电量校准方法、电子设备及存储介质
CN116707052A (zh) * 2022-10-31 2023-09-05 荣耀终端有限公司 一种关机方法及电子设备

Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6463545B1 (en) * 1999-10-01 2002-10-08 Compaq Information Technologies Group, L.P. Battery calibration system for discharging a rechargeable battery and generating an ac detect signal to power management logic to maintain normal computer operation even when battery is below certain level
CN103605093A (zh) * 2013-11-05 2014-02-26 广东欧珀移动通信有限公司 显示电量值的校准方法和***
CN105975879A (zh) * 2016-04-29 2016-09-28 宇龙计算机通信科技(深圳)有限公司 一种终端显示电量的控制方法及装置
CN106371019A (zh) * 2015-07-22 2017-02-01 国基电子(上海)有限公司 电量显示***与方法
CN107290674A (zh) * 2017-05-19 2017-10-24 深圳市金立通信设备有限公司 一种显示电量值的校准方法及终端
CN107561446A (zh) * 2016-07-01 2018-01-09 中兴通讯股份有限公司 一种终端电池电量计算方法和装置
CN108663623A (zh) * 2017-04-01 2018-10-16 惠州市新思为电子科技有限公司 超长待机***中锂锰一次性电池电量计算方法及***
CN109040467A (zh) * 2018-09-26 2018-12-18 Oppo广东移动通信有限公司 界面电量确定方法、装置、存储介质及移动终端
CN109239611A (zh) * 2018-11-26 2019-01-18 努比亚技术有限公司 终端电池电量校准方法、终端和计算机可读存储介质
CN114236461A (zh) * 2021-12-17 2022-03-25 深圳市百富智能新技术有限公司 一种电量校准方法、电子设备及存储介质

Family Cites Families (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103033758A (zh) * 2012-10-25 2013-04-10 北京君正集成电路股份有限公司 一种显示电量值的校准方法及装置
CN103747131A (zh) * 2013-12-03 2014-04-23 上海斐讯数据通信技术有限公司 监控移动终端的电源状态的方法及移动终端
CN103647877B (zh) * 2013-12-10 2015-09-23 Tcl通讯(宁波)有限公司 一种提高移动终端开机时电量显示精度的方法及移动终端
CN104267795B (zh) * 2014-09-11 2019-02-05 联想(北京)有限公司 电量管理方法、电量管理装置和电子设备
CN104301547B (zh) * 2014-10-15 2016-03-02 深圳市中兴移动通信有限公司 电池电量的管理方法和移动终端
CN105259508A (zh) * 2015-10-14 2016-01-20 惠州Tcl移动通信有限公司 一种终端及计算其初始电量的方法
CN107843844A (zh) * 2017-10-19 2018-03-27 深圳市金立通信设备有限公司 一种校准电量值的方法、终端及计算机可读存储介质
EP3709471B1 (en) * 2017-11-10 2023-12-20 Kabushiki Kaisha Toshiba Storage battery system, method, and program
CN111836347B (zh) * 2020-06-16 2024-07-16 厦门汉印电子技术有限公司 一种电量显示方法、装置、设备及可读存储介质
CN112650643B (zh) * 2020-12-21 2022-11-29 展讯通信(上海)有限公司 电量校准方法、装置和电子设备
CN113254304A (zh) * 2021-04-28 2021-08-13 中国长城科技集团股份有限公司 一种服务器关机类型的确定方法、服务器及存储介质

Patent Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6463545B1 (en) * 1999-10-01 2002-10-08 Compaq Information Technologies Group, L.P. Battery calibration system for discharging a rechargeable battery and generating an ac detect signal to power management logic to maintain normal computer operation even when battery is below certain level
CN103605093A (zh) * 2013-11-05 2014-02-26 广东欧珀移动通信有限公司 显示电量值的校准方法和***
CN106371019A (zh) * 2015-07-22 2017-02-01 国基电子(上海)有限公司 电量显示***与方法
CN105975879A (zh) * 2016-04-29 2016-09-28 宇龙计算机通信科技(深圳)有限公司 一种终端显示电量的控制方法及装置
CN107561446A (zh) * 2016-07-01 2018-01-09 中兴通讯股份有限公司 一种终端电池电量计算方法和装置
CN108663623A (zh) * 2017-04-01 2018-10-16 惠州市新思为电子科技有限公司 超长待机***中锂锰一次性电池电量计算方法及***
CN107290674A (zh) * 2017-05-19 2017-10-24 深圳市金立通信设备有限公司 一种显示电量值的校准方法及终端
CN109040467A (zh) * 2018-09-26 2018-12-18 Oppo广东移动通信有限公司 界面电量确定方法、装置、存储介质及移动终端
CN109239611A (zh) * 2018-11-26 2019-01-18 努比亚技术有限公司 终端电池电量校准方法、终端和计算机可读存储介质
CN114236461A (zh) * 2021-12-17 2022-03-25 深圳市百富智能新技术有限公司 一种电量校准方法、电子设备及存储介质

Also Published As

Publication number Publication date
CN114236461A (zh) 2022-03-25
CN114236461B (zh) 2023-11-21

Similar Documents

Publication Publication Date Title
WO2023109300A1 (zh) 一种电量校准方法、电子设备及存储介质
US10007507B2 (en) Method for updating firmware of a battery included in a rechargeable battery module, portable electronic device, and rechargeable battery module
JP6018113B2 (ja) 不揮発性メモリのデータ消失を防止する方法、コンピュータおよびホスト装置。
US5714870A (en) Method for measuring suspend-time power consumption in a battery-powered electronic device
US8775704B2 (en) Method and system for communication between a secondary processor and an auxiliary display subsystem of a notebook
US10891062B2 (en) Managing host communication with a regulator in a low power mode
US20130185789A1 (en) Method and apparatus for protecting a password of a computer having a non-volatile memory
US20080215868A1 (en) Bios management device and method for manging bios setting value
US20170052794A1 (en) Systems and methods to optimize boot for information handling system comprising persistent memory
CN111352038A (zh) 用于电池膨胀检测的方法、信息处理设备及可读存储介质
US20170052716A1 (en) Systems and methods for persistent memory timing characterization
CN109040467A (zh) 界面电量确定方法、装置、存储介质及移动终端
US11216053B2 (en) Systems, apparatus, and methods for transitioning between multiple operating states
US20090249087A1 (en) Power Event Indicator for Managed Memory Device
US20040225874A1 (en) Method for reduced BIOS boot time
US6691049B1 (en) Method and apparatus to detect that the battery gauge is out of calibration
US10387306B2 (en) Systems and methods for prognosticating likelihood of successful save operation in persistent memory
JP4410215B2 (ja) 消費電力の制御方法およびコンピュータ装置
WO2020113469A1 (zh) 开机检测方法、开机检测装置及移动终端
CN109298992B (zh) 电子装置以及开机时间计算方法
US20210096624A1 (en) Electronic apparatus and operation information output method
CN115113719A (zh) 低电量的开机方法、装置、设备及计算机可读存储介质
JP2003092839A (ja) 電気機器、コンピュータ装置、インテリジェント電池、電池診断方法、プログラム、および記憶媒体
US9465428B2 (en) Computer device
CN117395544B (zh) 电池状态数据上报方法、终端设备及存储介质

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 22906052

Country of ref document: EP

Kind code of ref document: A1