WO2018000827A1 - Method and apparatus for calculating terminal battery power - Google Patents

Method and apparatus for calculating terminal battery power Download PDF

Info

Publication number
WO2018000827A1
WO2018000827A1 PCT/CN2017/073746 CN2017073746W WO2018000827A1 WO 2018000827 A1 WO2018000827 A1 WO 2018000827A1 CN 2017073746 W CN2017073746 W CN 2017073746W WO 2018000827 A1 WO2018000827 A1 WO 2018000827A1
Authority
WO
WIPO (PCT)
Prior art keywords
terminal
battery
power
battery power
turned
Prior art date
Application number
PCT/CN2017/073746
Other languages
French (fr)
Chinese (zh)
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 WO2018000827A1 publication Critical patent/WO2018000827A1/en

Links

Images

Classifications

    • GPHYSICS
    • G01MEASURING; TESTING
    • G01RMEASURING ELECTRIC VARIABLES; MEASURING MAGNETIC VARIABLES
    • G01R31/00Arrangements for testing electric properties; Arrangements for locating electric faults; Arrangements for electrical testing characterised by what is being tested not provided for elsewhere
    • G01R31/36Arrangements for testing, measuring or monitoring the electrical condition of accumulators or electric batteries, e.g. capacity or state of charge [SoC]

Abstract

Provided are a terminal battery power calculation method and a device, and a computer storage medium. By accurately calculating the initial battery power when the terminal device is turned off and then on, the accuracy of the battery power calculation can be effectively improved, also user experience of the battery power display is enhanced, without increasing the cost.

Description

一种终端电池电量计算方法和装置Terminal battery power calculation method and device 技术领域Technical field
本发明涉及终端电池电量技术领域,尤其涉及一种终端电池电量计算方法和装置。The present invention relates to the field of terminal battery power, and in particular, to a terminal battery power calculation method and apparatus.
背景技术Background technique
目前的终端产品一般都带有电池,需要计算电池电量并显示给用户,电池电量的计算方法可以分为两种,一种是使用硬件上的电量计芯片计算出相对准确的电池电量,另一种是硬件上不带电量计芯片,通过软件方法对电池电量进行计算。软件方法一般是通过采集电池电压、电流和温度状态通过查表法计算得到一个电池电量值,再加入时间的系数,结合电池的充放电实验数据,计算得出较为准确的电池电量。Current terminal products generally have a battery, and need to calculate the battery power and display it to the user. The calculation method of the battery power can be divided into two types. One is to calculate a relatively accurate battery power using a power meter chip on the hardware, and the other is to calculate a relatively accurate battery power. The kind of hardware is not equipped with a fuel gauge chip, and the battery power is calculated by a software method. The software method generally calculates the battery power value by collecting the battery voltage, current and temperature state through the look-up table method, and then adding the time coefficient, combined with the battery charge and discharge experimental data, to calculate a more accurate battery power.
但是软件方法计算电池电量带来的问题就是,设备在关机后软件不再工作,重新开机后设备的工作状态有差异,功耗电流、电池电压以及温度方面都可能与关机之前有较大差异,因此很难保证初始电池电量计算的准确性。初始电池电量的准确性直接关系到计算电量软件的性能,对初始电池电量的计算过程,是计算电量软件的一个重要组成部分。而且若设备在关机重启后计算出的电量和关机前的电量有一定差异,也给用户一种开关机会导致电量跳变的用户体验。此外,对于电池可拆卸的终端设备来说,传统的软件电量算法也没有办法区分开关机前后的电量差异是因为初始电量计算不准确还是更换了电池。However, the problem caused by the software method to calculate the battery power is that the software does not work after the device is turned off. After the power is turned on, the working state of the device is different. The power consumption current, battery voltage and temperature may be quite different from those before the shutdown. Therefore, it is difficult to ensure the accuracy of the initial battery power calculation. The accuracy of the initial battery power is directly related to the performance of the calculation power software. The calculation process of the initial battery power is an important part of the calculation of the power software. Moreover, if the calculated power of the device after the shutdown and restart is different from the power before the shutdown, the user experience is also given to a user who has a switching opportunity to cause a power jump. In addition, for the battery detachable terminal device, the traditional software power algorithm has no way to distinguish the difference between the power before and after the power switch is because the initial power calculation is inaccurate or the battery is replaced.
发明内容Summary of the invention
本发明实施例提供的终端电池电量计算方法和装置,主要要解决的技术问题是终端设备在带电池关机后再开机,利用软件方法计算初始电池电量不准确的问题。The method and device for calculating the battery power of the terminal provided by the embodiment of the present invention mainly solve the technical problem that the terminal device is turned on after the battery is turned off, and the software method is used to calculate the problem that the initial battery power is inaccurate.
为解决上述技术问题,采用如下技术方案: In order to solve the above technical problems, the following technical solutions are adopted:
一种终端电池电量计算方法,包括:A terminal battery power calculation method includes:
如果终端从关机后到再开机之间没有更换电池,所述终端再开机后,计算所述终端从关机到再开机这一过程中的电池损耗电量;If the terminal does not replace the battery from after the power is turned off, and after the terminal is turned on again, calculate the battery power consumption during the process from the shutdown to the restart of the terminal;
获取所述终端关机前记录的电池剩余电量,并根据所述电池剩余电量和所述电池损耗电量计算得到初始电池电量;Obtaining a remaining battery power recorded before the terminal is turned off, and calculating an initial battery power according to the remaining battery power and the battery power consumption;
按照预设规则根据所述初始电池电量计算电池剩余电量。The remaining battery power is calculated based on the initial battery power according to a preset rule.
可选地,所述计算所述终端从关机到再开机这一过程中的电池损耗电量的步骤包括:Optionally, the step of calculating the battery power consumption of the terminal from the shutdown to the restarting process includes:
获取所述终端的关机时长;及,Obtaining the shutdown time of the terminal; and,
根据所述关机时长、所述终端的关机漏电流和电池的自放电速率计算所述电池损耗电量。The battery power consumption is calculated according to the shutdown time, the shutdown leakage current of the terminal, and the self-discharge rate of the battery.
可选地,所述获取所述终端的关机时长的步骤包括:Optionally, the step of acquiring the shutdown duration of the terminal includes:
根据所述当前时间信息和所述终端关机前记录的终端时间信息计算所述终端的关机时长。And calculating a shutdown duration of the terminal according to the current time information and terminal time information recorded before the terminal is shut down.
可选地,所述根据所述关机时长、所述关机漏电流和电池的自放电速率计算所述电池损耗电量的步骤包括:Optionally, the step of calculating the battery power loss according to the shutdown duration, the shutdown leakage current, and the self-discharge rate of the battery includes:
用所述关机时长乘以所述关机漏电流得到所述终端的关机漏电电量Pt1;Using the shutdown duration multiplied by the shutdown leakage current to obtain the shutdown leakage power Pt1 of the terminal;
用所述关机时长乘以所述电池的自放电速率计算出电池自放电电量Pt2;Calculating the battery self-discharge power Pt2 by multiplying the shutdown time by the self-discharge rate of the battery;
将所述关机漏电电量Pt1和电池自放电电量Pt2相加得到所述电池损耗电量。The battery leakage power Pt1 and the battery self-discharge power Pt2 are added to obtain the battery power consumption.
可选地,所述根据所述电池剩余电量和所述电池损耗电量计算得到初始电池电量的步骤包括:Optionally, the step of calculating the initial battery power according to the remaining battery power and the battery power consumption includes:
将所述电池剩余电量减去所述电池损耗电量得到所述初始电池电量。The initial battery power is obtained by subtracting the battery power loss from the remaining battery power.
可选地,所述当前时间信息通过所述终端的硬件实时时钟读取;Optionally, the current time information is read by a hardware real time clock of the terminal;
所述终端关机前记录的终端时间信息通过所述终端的硬件实时时钟读取并记录在所述终端。The terminal time information recorded before the terminal is turned off is read by the hardware real time clock of the terminal and recorded in the terminal.
可选地,该方法还包括:通过以下方式识别所述终端从关机后到再开机 之间是否更换电池:Optionally, the method further includes: identifying, by the following, the terminal from after being powered off to restarting Whether to replace the battery between:
获取所述终端的当前时间信息以及所述终端关机前记录的终端时间信息;Obtaining current time information of the terminal and terminal time information recorded before the terminal is turned off;
如果所述当前时间信息大于所述终端关机前记录的终端时间信息,则识别为所述终端从关机后到再开机之间没有更换电池。If the current time information is greater than the terminal time information recorded before the terminal is turned off, it is recognized that the terminal does not replace the battery from after the power is turned off to when the power is turned on.
可选地,所述识别所述终端从关机后到再开机之间是否更换电池的步骤还包括:Optionally, the step of identifying whether the terminal replaces the battery between after the power is turned off and then when the power is turned on further includes:
如果所述当前时间信息小于所述终端关机前记录的终端时间信息,则识别为所述终端从关机后到再开机之间更换了电池。If the current time information is smaller than the terminal time information recorded before the terminal is turned off, it is recognized that the terminal replaces the battery from after the power is turned off to when the power is turned on.
可选地,该方法还包括:Optionally, the method further includes:
如果所述终端从关机后到再开机之间更换了电池,则按照如下方法计算所述初始电池电量:If the terminal replaces the battery from after the power is turned off to when the power is turned on, the initial battery power is calculated as follows:
所述终端再开机后,根据当前电池电压、电流和温度状态,通过查表法计算得到所述初始电池电量。After the terminal is powered on again, the initial battery power is calculated by a look-up table method according to the current battery voltage, current, and temperature state.
可选地,该方法还包括:Optionally, the method further includes:
每一次按照预设规则根据所述初始电池电量计算出新的电池剩余电量后,记录最新的电池剩余电量,以及记录所述最新的电池剩余电量对应的终端时间信息。After calculating the new remaining battery power according to the initial battery power according to the preset rule, the latest battery remaining power is recorded, and the terminal time information corresponding to the latest battery remaining power is recorded.
一种终端电池电量计算装置,包括:第一计算模块、获取模块、第二计算模块和第三计算模块,其中A terminal battery power calculation device includes: a first calculation module, an acquisition module, a second calculation module, and a third calculation module, wherein
所述第一计算模块设置成:在终端从关机后到再开机之间没有更换电池,所述终端再开机的情况下,计算所述终端从关机到再开机这一过程中的电池损耗电量;The first computing module is configured to: when the terminal does not replace the battery from the time when the terminal is turned off, and when the terminal is powered on again, calculate the battery power consumption during the process from the shutdown to the restart of the terminal;
所述获取模块设置成:获取所述终端关机前记录的电池剩余电量;The obtaining module is configured to: acquire a remaining battery power recorded before the terminal is turned off;
所述第二计算模块设置成:根据所述电池剩余电量和所述电池损耗电量计算初始电池电量; The second calculating module is configured to: calculate an initial battery power according to the remaining battery power and the battery power consumption;
所述第三计算模块设置成:按照预设规则根据所述初始电池电量计算电池剩余电量。The third calculating module is configured to: calculate a remaining battery power according to the initial battery power according to a preset rule.
可选地,所述第一计算模块设置成按照如下方式计算所述终端从关机到再开机这一过程中的电池损耗电量:Optionally, the first calculating module is configured to calculate the battery power consumption of the terminal during the process from shutdown to restart:
计算所述终端的关机时长;Calculating a shutdown time of the terminal;
根据所述关机时长、所述终端的关机漏电流和电池的自放电速率计算所述电池损耗电量。The battery power consumption is calculated according to the shutdown time, the shutdown leakage current of the terminal, and the self-discharge rate of the battery.
可选地,所述第一计算模块设置成按照如下方式获取所述终端的关机时长:Optionally, the first computing module is configured to obtain the shutdown duration of the terminal as follows:
根据所述当前时间信息和所述终端关机前记录的终端时间信息计算所述终端的关机时长。And calculating a shutdown duration of the terminal according to the current time information and terminal time information recorded before the terminal is shut down.
可选地,所述第一计算模块设置成按照如下方式根据所述关机时长、所述关机漏电流和电池的自放电速率计算所述电池损耗电量:Optionally, the first calculating module is configured to calculate the battery power consumption according to the shutdown duration, the shutdown leakage current, and a self-discharge rate of the battery according to the following manner:
用所述关机时长乘以所述关机漏电流得到所述终端的关机漏电电量Pt1;Using the shutdown duration multiplied by the shutdown leakage current to obtain the shutdown leakage power Pt1 of the terminal;
用所述关机时长乘以所述电池的自放电速率计算出电池自放电电量Pt2;Calculating the battery self-discharge power Pt2 by multiplying the shutdown time by the self-discharge rate of the battery;
将所述关机漏电电量Pt1和电池自放电电量Pt2相加得到所述电池损耗电量。The battery leakage power Pt1 and the battery self-discharge power Pt2 are added to obtain the battery power consumption.
可选地,所述第二计算模块设置成按照如下方式根据所述电池剩余电量和所述电池损耗电量计算初始电池电量:Optionally, the second calculating module is configured to calculate an initial battery power according to the remaining battery power and the battery power consumption according to the following manner:
将所述电池剩余电量减去所述电池损耗电量得到所述初始电池电量。The initial battery power is obtained by subtracting the battery power loss from the remaining battery power.
可选地,所述当前时间信息通过所述终端的硬件实时时钟读取;Optionally, the current time information is read by a hardware real time clock of the terminal;
所述终端关机前记录的终端时间信息通过所述终端的硬件实时时钟读取并记录在所述终端中。The terminal time information recorded before the terminal is turned off is read by the hardware real time clock of the terminal and recorded in the terminal.
可选地,该装置还包括识别模块,该识别模块设置成按照如下方式识别所述终端从关机后到再开机之间是否更换电池:Optionally, the apparatus further includes an identification module configured to identify whether the terminal replaces the battery between after the power is turned off and after the power is turned on as follows:
获取所述终端当前时间信息以及所述终端关机前记录的终端时间信息;Obtaining current time information of the terminal and terminal time information recorded before the terminal is turned off;
当所述当前时间信息大于所述终端关机前记录的终端时间信息的情况 下,识别为当前所述终端从关机后到再开机之间没有更换电池。When the current time information is greater than the terminal time information recorded before the terminal is powered off Next, it is identified that the current terminal has not replaced the battery from after being turned off to when the power is turned on again.
可选地,所述识别模块还设置成设置成按照如下方式识别所述终端从关机后到再开机之间是否更换电池:Optionally, the identification module is further configured to: identify whether the terminal replaces the battery between after the power is turned off and after the power is turned on as follows:
当所述当前时间信息小于所述终端关机前记录的终端时间信息的情况下,则识别为所述终端从关机后到再开机之间更换了电池。When the current time information is smaller than the terminal time information recorded before the terminal is turned off, it is recognized that the terminal replaces the battery from after the power is turned off to when the power is turned on.
可选地,所述第二计算模块还设置成:所述终端再开机后,根据当前电池电压、电流和温度状态,通过查表法计算得到初始电池电量。Optionally, the second calculating module is further configured to: after the terminal is powered on, calculate an initial battery power according to a current battery voltage, a current, and a temperature state by using a look-up table method.
可选地,该装置还包括记录模块,其中Optionally, the device further includes a recording module, wherein
所述记录模块设置成:在每一次按照预设规则根据所述初始电池电量计算出新的电池剩余电量后,记录最新的电池剩余电量,以及记录所述最新的电池剩余电量对应的终端时间信息。The recording module is configured to: after calculating a new remaining battery power according to the initial battery power according to a preset rule, record the latest remaining battery power, and record the terminal time information corresponding to the latest remaining battery power .
本发明技术方案的有益效果是:The beneficial effects of the technical solution of the present invention are:
根据本发明实施例提供的终端电池电量计算方法、装置以及计算机存储介质,通过准确计算终端设备在带电池关机后再开机时的初始电池电量,在不增加成本的前提下,有效提高了电池电量计算的准确性,也提升了电池电量显示方面的用户体验。The method and device for calculating the battery power of the terminal according to the embodiment of the present invention, and the computer storage medium, by accurately calculating the initial battery power when the terminal device is turned on after the battery is turned off, effectively improving the battery power without increasing the cost. The accuracy of the calculations also enhances the user experience in battery display.
附图概述BRIEF abstract
图1为本发明实施例一提供的一种终端电池电量计算方法的流程图;1 is a flowchart of a method for calculating a battery power of a terminal according to Embodiment 1 of the present invention;
图2为本发明实施例二提供的一种终端电池电量计算方法的流程图;2 is a flowchart of a method for calculating a battery power of a terminal according to Embodiment 2 of the present invention;
图3为本发明实施例三提供的一种终端电池电量计算方法的流程图;3 is a flowchart of a method for calculating a battery power of a terminal according to Embodiment 3 of the present invention;
图4为本发明实施例四提供的一种终端电池电量计算装置的示意图。FIG. 4 is a schematic diagram of a terminal battery power calculation device according to Embodiment 4 of the present invention.
详述Detailed
以下是对本文详细描述的主题的概述。本概述并非是为了限制权利要求的保护范围。 The following is an overview of the topics detailed in this document. This Summary is not intended to limit the scope of the claims.
下面通过具体实施方式结合附图对本发明实施例作进一步详细说明。The embodiments of the present invention are further described in detail below with reference to the accompanying drawings.
实施例一:Embodiment 1:
为了准确计算终端设备在开机时的初始电池电量,本实施例提供一种在终端从关机后到再开机之间没有更换电池的情况下,计算终端电池电量的方法,方法流程图请参见图1,具体为:In order to accurately calculate the initial battery power of the terminal device at the time of power-on, the embodiment provides a method for calculating the battery power of the terminal in the case that the terminal does not replace the battery after the terminal is turned off, and the method flow chart is shown in FIG. 1 . ,Specifically:
S101,终端设备开机。S101. The terminal device is powered on.
终端从关机后到再开机之间没有更换过电池。终端开机后开始计算电池电量即电池剩余电量。The terminal has not been replaced between the battery and the power-on. After the terminal is turned on, it starts to calculate the battery power, that is, the remaining battery power.
S102,计算终端从关机到再开机这一过程中的电池损耗电量。S102. Calculate the battery power consumption of the terminal during the process from shutdown to restart.
在终端设备关机没有使用的过程中,电池有一定的自然放电、漏电等过程,会损失一部分电量。终端可以通过软件计算关机到再开机这一过程中的电池损耗电量。In the process that the terminal device is not used for shutdown, the battery has a certain process of natural discharge, leakage, etc., and a part of the power is lost. The terminal can calculate the battery power consumption during the process of shutting down to restarting by software.
S103,获取终端关机前记录的电池剩余电量。S103. Acquire a remaining battery capacity recorded before the terminal is powered off.
获取在关机前计算并记录在终端上的电池剩余电量。Obtain the remaining battery power calculated and recorded on the terminal before shutting down.
S104,根据电池剩余电量和电池损耗电量计算得到初始电池电量。S104. Calculate the initial battery power according to the remaining battery power and the battery power consumption.
将电池剩余电量减去电池损耗电量得到初始电池电量。The initial battery power is obtained by subtracting the battery power from the remaining battery power.
S105,按照预设规则根据初始电池电量计算电池剩余电量。S105. Calculate the remaining battery power according to the initial battery power according to a preset rule.
根据初始电池电量和终端计算电池电量的预设规则计算电池在之后运行过程中的剩余电量。The remaining battery power during the subsequent operation is calculated based on the initial battery power and a preset rule for the terminal to calculate the battery power.
本发明实施例提供的终端电池电量计算方法,通过准确计算终端设备在带电池关机后再开机时的初始电池电量,在不增加成本的前提下,有效提高了计算电池电量的准确性,提升了电池电量显示方面的用户体验。The method for calculating the battery power of the terminal provided by the embodiment of the invention improves the accuracy of calculating the battery power and improves the accuracy of the calculation of the battery power by accurately calculating the initial battery power of the terminal device after the battery is turned off and then turning on the power. User experience with battery level display.
显然,本领域的技术人员应该明白,上述本发明实施例通过准确计算终端设备在带电池关机后再开机这一过程中的电量损失,来校准开机后的初始电池电量。若将本发明实施例的方案运用到别的场景时,对上述步骤进行增减或更改,也应当属于本发明的保护范围。Obviously, those skilled in the art should understand that the above embodiment of the present invention calibrates the initial battery power after power-on by accurately calculating the power loss of the terminal device during the process of turning the battery off and then on. If the solution of the embodiment of the present invention is applied to another scenario, it is also within the scope of the present invention to add, subtract, or modify the above steps.
实施例二: Embodiment 2:
为了准确计算终端设备在开机时的初始电池电量,本实施例提供一种计算终端首次开机和关机后再次开机的电池电量的方法,方法流程图请参见图2,具体为:In order to accurately calculate the initial battery power of the terminal device at the time of power-on, the embodiment provides a method for calculating the battery power of the terminal after the first power-on and power-off, and the method flow chart is shown in FIG. 2 , specifically:
S201,终端设备带电池首次开机时,启动RTC(Real-time Clock,硬件实时时钟)和软件电量计。S201: When the terminal device is powered on for the first time, the RTC (Real-time Clock) and the software fuel gauge are started.
终端设备一般都会具有RTC功能,使用RTC功能可以为操作系统提供一个可靠的时间。这个时间是可以被其他软件读取的,读取的时间称为硬件系统时间。Terminal devices generally have an RTC function, and the RTC function can provide a reliable time for the operating system. This time can be read by other software, and the time of reading is called hardware system time.
终端设备在开机情况下,运行程序计算电池电量,此程序称为软件电量计。软件电量计运行需要一个电池电量值作为初始条件,这个电池电量值称为初始电池电量。When the terminal device is powered on, the running program calculates the battery power. This program is called a software fuel gauge. The software fuel gauge operation requires a battery charge value as the initial condition. This battery charge value is called the initial battery charge.
S202,计算初始电池电量和初始电量时间。S202. Calculate initial battery power and initial power time.
终端在启动软件电量计后,软件电量计会根据当前电池电压、电流和温度状态通过查表法计算出当前的电池电量,这个电池电量称为初始电池电量。这里查表指的是电池在出厂前,通过采集电池电压、电流和温度状态和时间,进行电池充放电过程中得到的实验数据。同时软件电量计通过RTC功能读取得到当前硬件系统时间作为初始电量时间。After the terminal starts the software fuel gauge, the software fuel gauge calculates the current battery power according to the current battery voltage, current and temperature status. This battery power is called the initial battery power. The lookup table here refers to the experimental data obtained during the charging and discharging process of the battery by collecting the voltage, current and temperature status and time of the battery before leaving the factory. At the same time, the software fuel gauge reads the current hardware system time as the initial power time through the RTC function.
S203,创建电量文件。S203. Create a power file.
软件电量计将初始电池电量和初始电量时间记录记录到终端设备软件系统的一个文件或者标识中,这个文件称为电量文件。终端首次启动之前不存在电量文件,软件电量计会创建电量文件。The software fuel gauge records the initial battery power and initial power time record into a file or logo of the terminal device software system. This file is called a power file. The power file does not exist until the terminal is first started, and the software fuel gauge creates a power file.
S204,按照预设规则计算并更新电量文件。S204. Calculate and update the power file according to a preset rule.
预设规则是在终端开机时,软件电量计会对电池电量值进行实时监测计算,得到的电池剩余电量值称为电池电量。计算方法是通过采集电池电压、电流和温度状态通过查表法计算得到一个电池电量值,再加入时间的系数,结合电池的充放电实验数据和初始电池电量,得到电池电量。The preset rule is that when the terminal is powered on, the software fuel gauge performs real-time monitoring and calculation on the battery power value, and the obtained battery residual power value is called battery power. The calculation method is to calculate the battery electric quantity value by collecting the battery voltage, current and temperature state by the look-up table method, and then adding the time coefficient, combining the battery charging and discharging experimental data and the initial battery power to obtain the battery power.
当计算得到的电池电量有变化时,软件电量计使用RTC功能获取当前的硬件系统时间作为此次电量更新时间,这个更新时间称为电量时间。软件电 量计会在电池电量变化时修改电量文件,将新的电池电量和电量时间记录在电量文件中。When the calculated battery power changes, the software fuel gauge uses the RTC function to obtain the current hardware system time as the power update time. This update time is called the power time. Software The meter will modify the battery file when the battery level changes, and record the new battery level and battery time in the battery file.
S205,终端设备带电池关机,软件电量计记录当前电池电量和电量时间。S205, the terminal device is powered off, and the software fuel gauge records the current battery power and power time.
终端关机前,软件电量计读取当前电池电量和电量时间,修改电量文件并记录。Before the terminal is shut down, the software fuel gauge reads the current battery power and power time, modifies the power file and records.
终端带电池关机的情况下终端设备仍然连接电池,虽然软件电量计已经停止运行,但是RTC功能仍然在运行,从而保证了硬件系统时间一直在更新。When the terminal is powered off, the terminal device is still connected to the battery. Although the software fuel gauge has stopped running, the RTC function is still running, thus ensuring that the hardware system time is always updated.
S206,终端设备再次开机。S206. The terminal device is powered on again.
启动RTC和软件电量计。Start RTC and software fuel gauge.
S207,运行软件电量计,得到临时初始电量P1和临时初始电量时间T1。S207. Run a software fuel gauge to obtain a temporary initial power P1 and a temporary initial power time T1.
软件电量计通过查表法计算出当前的电池电量,作为临时初始电量。同时软件电量计通过RTC功能读取得到当前系统时间作为临时初始电量时间。The software fuel gauge calculates the current battery power as a temporary initial power by looking up the table. At the same time, the software fuel gauge reads the current system time as the temporary initial power time through the RTC function.
S208,读取电量文件。S208. Read the power file.
软件电量计读取电量文件中的文件电池电量P2和文件电量时间T2。文件电池电量和文件电量时间指的是文件中记录的电池电量和电量时间。The software fuel gauge reads the file battery power P2 and the file power time T2 in the power file. File battery power and file power time refer to the battery power and battery time recorded in the file.
S209,软件电量计计算得到关机时长。S209, the software fuel gauge calculates the shutdown time.
软件电量计比较文件电量时间和临时电量时间,临时电量时间T1减去文件电量时间T2即为关机时长。The software fuel gauge compares the file power time and the temporary power time, and the temporary power time T1 minus the file power time T2 is the shutdown time.
S210,计算并记录新的初始电池电量P0。S210, calculate and record a new initial battery power P0.
通过关机时间长和文件电池电量可以计算出新的初始电池电量P0。计算方法是用关机时长乘以终端设备的关机漏电流S1得到终端设备的关机漏电电量Pt1,并用关机时长乘以终端设备所带电池的自放电速率S2计算出电池自放电电量Pt2。用文件电池电量P2减去关机漏电电量Pt1和电池自放电电量Pt2即可得到新的初始电量P0。终端设备的关机漏电流S1和电池的自放电速率S2是通过电池的充放电实验得到的数据。软件电量计将新的初始电池电量P0记录在电量文件中。The new initial battery charge P0 can be calculated by the long shutdown time and the file battery level. The calculation method is that the shutdown leakage current Pt1 of the terminal device is obtained by multiplying the shutdown duration by the shutdown leakage current S1 of the terminal device, and the battery self-discharge power Pt2 is calculated by multiplying the shutdown duration by the self-discharge rate S2 of the battery of the terminal device. The new initial charge P0 can be obtained by subtracting the shutdown leakage power Pt1 and the battery self-discharge power Pt2 from the file battery power P2. The shutdown leakage current S1 of the terminal device and the self-discharge rate S2 of the battery are data obtained by the charge and discharge experiments of the battery. The software fuel gauge records the new initial battery charge P0 in the charge file.
S211,获取并记录新的初始电量时间。转到S204。 S211, acquiring and recording a new initial power time. Go to S204.
软件电量计使用RTC功能获取当前的硬件系统时间,作为新的初始电量时间,记录在电量文件中。在终端开机时,软件电量计会持续更新电量文件。The software fuel gauge uses the RTC function to obtain the current hardware system time as a new initial power time, recorded in the power file. When the terminal is powered on, the software fuel gauge will continuously update the power file.
本发明实施例提供的终端电池电量计算方法,通过准确计算终端设备在带电池关机后再开机时的初始电池电量,在不增加成本的前提下,有效提高了用软件计算电池电量准确性,也提升了电池电量显示方面的用户体验。The method for calculating the battery power of the terminal provided by the embodiment of the present invention can accurately calculate the accuracy of the battery power by using the software to accurately calculate the initial battery power when the terminal device is turned on after the battery is turned off. Improved user experience in battery power display.
显然,本领域的技术人员应该明白,上述本发明实施例通过准确计算终端设备在带电池关机后再开机这一过程中的电量损失,来校准开机后的初始电池电量。若将本发明实施例的方案运用到别的场景时,对上述步骤进行增减或更改,也应当属于本发明的保护范围。Obviously, those skilled in the art should understand that the above embodiment of the present invention calibrates the initial battery power after power-on by accurately calculating the power loss of the terminal device during the process of turning the battery off and then on. If the solution of the embodiment of the present invention is applied to another scenario, it is also within the scope of the present invention to add, subtract, or modify the above steps.
实施例三:Embodiment 3:
本实施例为终端开机计算初始电池电量的方法,具体流程请参见图3。This embodiment is a method for calculating the initial battery power when the terminal is powered on. For the specific process, refer to FIG. 3.
S301,终端设备开机。S301. The terminal device is powered on.
终端设备开机之前有两种关机情况,一种是带电池关机,这种情况下终端设备仍然连接电池,虽然软件电量计已经停止运行,但是RTC功能仍然在运行,从而保证了硬件系统时间一直在更新;另一种是不带电池关机或更换过电池,这种情况下,终端设备和电池的连接断开,软件电量计停止运行,RTC功能也停止运行,硬件系统时间会清零。There are two kinds of shutdown conditions before the terminal device is turned on. One is to turn off the battery. In this case, the terminal device is still connected to the battery. Although the software fuel gauge has stopped running, the RTC function is still running, thus ensuring that the hardware system time has been The other is to turn off the battery without battery or replace the battery. In this case, the connection between the terminal device and the battery is disconnected, the software fuel gauge stops running, the RTC function stops running, and the hardware system time is cleared.
S302,运行软件电量计,计算得到临时初始电量P1。S302, running a software fuel gauge, and calculating a temporary initial power P1.
软件电量计通过查表法计算出当前的电池电量,作为临时初始电池电量P1。The software fuel gauge calculates the current battery power by the look-up table method as the temporary initial battery power P1.
S303,通过RTC获取临时初始电量时间T1。S303. Acquire a temporary initial power time T1 through the RTC.
若终端设备开机前是带电池关机,RTC功能正常运行,硬件系统时间一直在更新,即T1一直在更新;若终端设备开机前更换了电池,终端设备和电池的连接会断开,RTC功能停止运行,硬件系统时间会清零,即T1为0。If the terminal device is powered off before the power is turned on, the RTC function is running normally, the hardware system time is always updated, that is, T1 is always updated; if the battery is replaced before the terminal device is turned on, the connection between the terminal device and the battery is disconnected, and the RTC function is stopped. When running, the hardware system time will be cleared, that is, T1 is 0.
S304,判断电量文件是否存在。若不存在,则转到S305;若存在,则转到S306。S304. Determine whether a power file exists. If not, go to S305; if yes, go to S306.
电量文件存在,说明之前终端开机运行过;电量文件不存在,说明终端 首次开机运行。The power file exists, indicating that the terminal has been turned on before; the power file does not exist, indicating that the terminal Start up for the first time.
S305,创建电量文件。转到S312。S305, create a power file. Go to S312.
将之前计算得到临时初始电池电量P1和获取临时初始电量时间T1,记为初始电池电量P0和初始电量时间T0。The temporary initial battery power P1 and the acquisition temporary initial power time T1 are calculated as the initial battery power P0 and the initial power time T0.
S306,读取文件电池电量P2和文件电量时间T2。S306, reading the file battery power P2 and the file power time T2.
软件电量计从电量文件中读取文件电池电量P2和文件电量时间T2,文件电池电量P2和文件电量时间T2为之前关机时候记录的电池电量和电量时间。The software fuel gauge reads the file battery power P2 and the file power time T2 from the power file, and the file battery power P2 and the file power time T2 are the battery power and power time recorded before the shutdown.
S307,判断T1是否大于T2。若否,则转到S308;若是,则转到S309。S307, determining whether T1 is greater than T2. If no, go to S308; if yes, go to S309.
T1大于T2,说明T1一直在更新,即终端设备开机前是带电池关机且没有更换电池;T1小于T2,说明T1为0,终端设备开机前曾经与电池断开过连接,说明终端设备更换过电池。T1 is greater than T2, indicating that T1 is always updated, that is, the battery is turned off and the battery is not replaced before the terminal device is turned on; T1 is less than T2, indicating that T1 is 0, and the terminal device has been disconnected from the battery before booting, indicating that the terminal device has been replaced. battery.
S308,保存P1和T1到电量文件。转到S312。S308, save P1 and T1 to the power file. Go to S312.
电池更换过后,之前电量文件中记录的文件电池电量P2和文件电量时间T2不再有效。将之前计算得到临时初始电池电量P1和获取临时初始电量时间T1,记为初始电池电量P0和初始电量时间T0。After the battery is replaced, the file battery power P2 and the file power time T2 recorded in the previous battery file are no longer valid. The temporary initial battery power P1 and the acquisition temporary initial power time T1 are calculated as the initial battery power P0 and the initial power time T0.
S309,计算关机时长。S309, calculating the shutdown time.
软件电量计计算关机时长,将临时初始电量时间T1减去文件电量时间T2即为关机时长。The software fuel gauge calculates the shutdown time, and the temporary initial power time T1 minus the file power time T2 is the shutdown time.
S310,计算关机时间内的电池损耗电量。S310, calculating the battery power consumption during the shutdown time.
计算方法是用关机时长乘以终端设备的关机漏电流S1得到终端设备的关机漏电电量Pt1,并用关机时长乘以终端设备所带电池的自放电速率S2计算出电池自放电电量Pt2。终端设备的关机漏电流S1和电池的自放电速率S2是通过电池的充放电实验得到的数据。关机漏电电量Pt1和电池自放电电量Pt2的和即为电池损耗电量。The calculation method is that the shutdown leakage current Pt1 of the terminal device is obtained by multiplying the shutdown duration by the shutdown leakage current S1 of the terminal device, and the battery self-discharge power Pt2 is calculated by multiplying the shutdown duration by the self-discharge rate S2 of the battery of the terminal device. The shutdown leakage current S1 of the terminal device and the self-discharge rate S2 of the battery are data obtained by the charge and discharge experiments of the battery. The sum of the shutdown leakage current Pt1 and the battery self-discharge power Pt2 is the battery loss.
S311,计算并记录新的初始电池电量P0和初始电量时间T0。S311, calculate and record a new initial battery power P0 and an initial power time T0.
用文件电池电量P2减去电池损耗电量即可得到新的初始电量P0。临时 初始电量时间T1即为初始电量时间T0。软件电量计将新的初始电池电量P0和初始电量时间T0记录在电量文件中。The new initial charge P0 is obtained by subtracting the battery drain from the file battery charge P2. Temporary The initial power time T1 is the initial power time T0. The software fuel gauge records the new initial battery power P0 and the initial power time T0 in the power file.
S312,按照预设规则更新电量文件。S312. Update the power file according to a preset rule.
软件电量计会按照预设规则对电池电量值进行实时监测计算,并更新电量文件。计算方法是通过采集电池电压、电流和温度状态通过查表法计算得到一个电池电量值,再加入时间的系数,结合电池的充放电实验数据和初始电池电量,得到电池电量。The software fuel gauge will perform real-time monitoring and calculation of the battery power value according to the preset rules, and update the power storage file. The calculation method is to calculate the battery electric quantity value by collecting the battery voltage, current and temperature state by the look-up table method, and then adding the time coefficient, combining the battery charging and discharging experimental data and the initial battery power to obtain the battery power.
本发明实施例提供的终端电池电量计算方法,通过准确计算终端设备在不同情况下的初始电池电量,在不增加成本的前提下,有效提高了用软件计算电池电量准确性,也提升了电池电量显示方面的用户体验。The terminal battery power calculation method provided by the embodiment of the invention can accurately calculate the battery power accuracy and improve the battery power by accurately calculating the initial battery power of the terminal device under different conditions without increasing the cost. User experience in display.
显然,本领域的技术人员应该明白,上述本发明实施例通过比较文件电量时间和临时初始电量时间来判断终端是否更换过电池。若将本发明实施例的方案运用到别的场景时,对上述步骤进行增减或更改,也应当属于本发明的保护范围。Obviously, those skilled in the art should understand that the above embodiment of the present invention determines whether the terminal replaces the battery by comparing the file power time and the temporary initial power time. If the solution of the embodiment of the present invention is applied to another scenario, it is also within the scope of the present invention to add, subtract, or modify the above steps.
实施例四:Embodiment 4:
本发明实施例提供一种终端电池电量计算装置,请参见图4。下面对各模块及功能进行进一步说明,包括:The embodiment of the invention provides a terminal battery power calculation device, which is shown in FIG. 4 . The following describes each module and function further, including:
识别模块401,设置成:识别所述终端从关机后到再开机之间是否有更换电池。具体识别过程为:The identification module 401 is configured to: identify whether the terminal has a battery replacement after being turned off and then restarted. The specific identification process is:
通过终端RTC读取临时初始电量时间T1;通过电量文件读取文件电量时间T2。The temporary initial power time T1 is read by the terminal RTC; the file power time T2 is read by the power file.
比较终端当前时间信息即临时初始电量时间T1以及终端关机前记录的终端时间信息即文件电量时间T2。The current time information of the terminal is compared with the temporary initial power time T1 and the terminal time information recorded before the terminal is turned off, that is, the file power time T2.
当T1大于T2的情况下,识别为当前终端从关机后到再开机之间没有更换电池;当T1小于T2的情况下,则识别为当前终端从关机后到再开机之间更换了电池。When T1 is greater than T2, it is recognized that the current terminal does not replace the battery from after shutdown to re-boot; when T1 is less than T2, it is recognized that the current terminal has replaced the battery from after shutdown to re-boot.
第一计算模块402,设置成:在终端关机后没有更换电池再开机的情况下,计算终端从关机到再开机这一过程中的电池损耗电量。具体计算过程为: The first calculating module 402 is configured to: calculate the battery power consumption of the terminal during the process from shutdown to restart after the terminal is powered off without replacing the battery and then turning on the power. The specific calculation process is:
用临时初始电量时间T1减去文件电量时间T2得到关机时长。The shutdown time is obtained by subtracting the file power time T2 from the temporary initial power time T1.
用关机时长乘以终端设备的关机漏电流S1得到终端设备的关机漏电电量Pt1,并用关机时长乘以终端设备所带电池的自放电速率S2计算出电池自放电电量Pt2。终端设备的关机漏电流S1和电池的自放电速率S2是通过电池的充放电实验得到的数据。关机漏电电量Pt1和电池自放电电量Pt2的和即为电池损耗电量。The shutdown leakage current Pt1 of the terminal device is obtained by multiplying the shutdown time by the shutdown leakage current S1 of the terminal device, and the battery self-discharge power Pt2 is calculated by multiplying the shutdown duration by the self-discharge rate S2 of the battery of the terminal device. The shutdown leakage current S1 of the terminal device and the self-discharge rate S2 of the battery are data obtained by the charge and discharge experiments of the battery. The sum of the shutdown leakage current Pt1 and the battery self-discharge power Pt2 is the battery loss.
获取模块403,设置成:获取终端关机前记录的电池剩余电量。The obtaining module 403 is configured to: obtain the remaining battery power recorded before the terminal is powered off.
终端关机前的电池剩余电量记录在电量文件中,电池剩余电量为文件电池电量P2。The remaining battery power before the terminal is turned off is recorded in the power file, and the remaining battery power is the file battery power P2.
第二计算模块404,设置成:计算初始电池电量。The second calculation module 404 is configured to: calculate an initial battery power.
在识别模块判断当前终端从关机后到再开机之间没有更换电池时,根据电池剩余电量和电池损耗电量计算初始电池电量;在当前终端从关机后到再开机之间更换了电池时,根据当前电池电压、电流和温度状态,通过查表法计算初始电池电量。After the identification module determines that the current terminal does not replace the battery from the time when the power is turned off and then restarts, the initial battery power is calculated according to the remaining battery power and the battery power consumption; when the current terminal is replaced from the power after the power is turned off, the battery is replaced according to the current Battery voltage, current and temperature status, the initial battery level is calculated by look-up table method.
第三计算模块405,设置成:根据初始电池电量按照预设规则计算电池剩余电量。The third calculating module 405 is configured to: calculate the remaining battery power according to a preset rule according to the initial battery power.
在终端开机时,软件电量计会对电池电量值进行实时监测计算,通过采集电池电压、电流和温度状态通过查表法计算得到一个电池电量值,再加入时间的系数,结合电池的充放电实验数据和初始电池电量,得到电池电量。When the terminal is powered on, the software fuel gauge will perform real-time monitoring and calculation on the battery power value. By collecting the battery voltage, current and temperature status, a battery power value is calculated by the look-up table method, and then the time coefficient is added, combined with the battery charge and discharge experiment. Data and initial battery power to get battery power.
记录模块406,设置成:在每一次按照预设规则根据初始电池电量计算出新的电池剩余电量后,记录最新的电池电量,以及对应的终端时间信息。The recording module 406 is configured to: after calculating the new remaining battery power according to the initial battery power according to the preset rule, record the latest battery power and the corresponding terminal time information.
软件电量计将电池电量和对应的电量时间记录记录到终端设备软件系统的电量文件中,在电池剩余电量有变化时,实时更新电池电量和对应的更新时间。The software fuel gauge records the battery power and the corresponding power time record in the power file of the terminal device software system, and updates the battery power and the corresponding update time in real time when the remaining battery power changes.
本发明实施例提供的终端电池电量计算装置,通过准确计算终端设备在不同情况下的初始电池电量,不用增加硬件成本,有效提高了计算电池电量的软件性能,也提升了电池电量显示方面的用户体验。The terminal battery power calculation device provided by the embodiment of the invention can accurately calculate the initial battery power of the terminal device under different conditions without increasing the hardware cost, effectively improving the software performance of calculating the battery power, and improving the user of the battery power display. Experience.
本发明实施例还公开了一种计算机程序,包括程序指令,当该程序指令 被终端执行时,使得该终端可执行上述任意的终端电池电量计算方法。The embodiment of the invention also discloses a computer program, including program instructions, when the program instruction When executed by the terminal, the terminal can perform any of the above-described terminal battery power calculation methods.
本发明实施例还公开了一种载有所述的计算机程序的载体。The embodiment of the invention also discloses a carrier carrying the computer program.
在阅读并理解了附图和详细描述后,可以明白其他方面。Other aspects will be apparent upon reading and understanding the drawings and detailed description.
本领域普通技术人员可以理解上述实施例的全部或部分步骤可以使用计算机程序流程来实现,所述计算机程序可以存储于一计算机可读存储介质中,所述计算机程序在相应的硬件平台上(如系统、设备、装置、器件等)执行,在执行时,包括方法实施例的步骤之一或其组合。One of ordinary skill in the art will appreciate that all or a portion of the steps of the above-described embodiments can be implemented using a computer program flow, which can be stored in a computer readable storage medium, such as on a corresponding hardware platform (eg, The system, device, device, device, etc. are executed, and when executed, include one or a combination of the steps of the method embodiments.
可选地,上述实施例的全部或部分步骤也可以使用集成电路来实现,这些步骤可以被分别制作成一个个集成电路模块,或者将它们中的多个模块或步骤制作成单个集成电路模块来实现。这样,本发明不限制于任何特定的硬件和软件结合。Alternatively, all or part of the steps of the above embodiments may also be implemented by using an integrated circuit. These steps may be separately fabricated into individual integrated circuit modules, or multiple modules or steps may be fabricated into a single integrated circuit module. achieve. Thus, the invention is not limited to any specific combination of hardware and software.
上述实施例中的各装置/功能模块/功能单元可以采用通用的计算装置来实现,它们可以集中在单个的计算装置上,也可以分布在多个计算装置所组成的网络上。The devices/function modules/functional units in the above embodiments may be implemented by a general-purpose computing device, which may be centralized on a single computing device or distributed over a network of multiple computing devices.
上述实施例中的各装置/功能模块/功能单元以软件功能模块的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。上述提到的计算机可读取存储介质可以是只读存储器,磁盘或光盘等。When each device/function module/functional unit in the above embodiment is implemented in the form of a software function module and sold or used as a stand-alone product, it can be stored in a computer readable storage medium. The above mentioned computer readable storage medium may be a read only memory, a magnetic disk or an optical disk or the like.
任何熟悉本技术领域的技术人员在本发明揭露的技术范围内,可轻易想到变化或替换,都应涵盖在本发明的保护范围之内。因此,本发明的保护范围应以权利要求所述的保护范围为准。Variations or substitutions are readily conceivable within the scope of the present invention by those skilled in the art and are within the scope of the present invention. Therefore, the scope of the invention should be determined by the scope of the claims.
工业实用性Industrial applicability
本发明实施例提供的终端电池电量计算方法、装置以及计算机存储介质,通过准确计算终端设备在带电池关机后再开机时的初始电池电量,在不增加成本的前提下,有效提高了电池电量计算的准确性,也提升了电池电量显示方面的用户体验。因此本发明具有很强的工业实用性。 The method and device for calculating the battery power of the terminal provided by the embodiment of the present invention, and the computer storage medium, can accurately calculate the initial battery power when the terminal device is turned on after the battery is turned off, and effectively improve the battery power calculation without increasing the cost. The accuracy also improves the user experience in battery power display. Therefore, the present invention has strong industrial applicability.

Claims (20)

  1. 一种终端电池电量计算方法,包括:A terminal battery power calculation method includes:
    如果终端从关机后到再开机之间没有更换电池,所述终端再开机后,计算所述终端从关机到再开机这一过程中的电池损耗电量;If the terminal does not replace the battery from after the power is turned off, and after the terminal is turned on again, calculate the battery power consumption during the process from the shutdown to the restart of the terminal;
    获取所述终端关机前记录的电池剩余电量,并根据所述电池剩余电量和所述电池损耗电量计算得到初始电池电量;Obtaining a remaining battery power recorded before the terminal is turned off, and calculating an initial battery power according to the remaining battery power and the battery power consumption;
    按照预设规则根据所述初始电池电量计算电池剩余电量。The remaining battery power is calculated based on the initial battery power according to a preset rule.
  2. 如权利要求1所述的终端电池电量计算方法,其中,所述计算所述终端从关机到再开机这一过程中的电池损耗电量的步骤包括:The terminal battery power calculation method according to claim 1, wherein the calculating the battery power consumption in the process from the shutdown to the restarting of the terminal comprises:
    获取所述终端的关机时长;及,Obtaining the shutdown time of the terminal; and,
    根据所述关机时长、所述终端的关机漏电流和电池的自放电速率计算所述电池损耗电量。The battery power consumption is calculated according to the shutdown time, the shutdown leakage current of the terminal, and the self-discharge rate of the battery.
  3. 如权利要求2所述的终端电池电量计算方法,其中,所述获取所述终端的关机时长的步骤包括:The terminal battery power calculation method according to claim 2, wherein the step of acquiring the shutdown time of the terminal comprises:
    根据所述当前时间信息和所述终端关机前记录的终端时间信息计算所述终端的关机时长。And calculating a shutdown duration of the terminal according to the current time information and terminal time information recorded before the terminal is shut down.
  4. 如权利要求2或3所述的终端电池电量计算方法,其中,所述根据所述关机时长、所述关机漏电流和电池的自放电速率计算所述电池损耗电量的步骤包括:The terminal battery power calculation method according to claim 2 or 3, wherein the calculating the battery power consumption according to the shutdown duration, the shutdown leakage current, and the self-discharge rate of the battery comprises:
    用所述关机时长乘以所述关机漏电流得到所述终端的关机漏电电量Pt1;Using the shutdown duration multiplied by the shutdown leakage current to obtain the shutdown leakage power Pt1 of the terminal;
    用所述关机时长乘以所述电池的自放电速率计算出电池自放电电量Pt2;Calculating the battery self-discharge power Pt2 by multiplying the shutdown time by the self-discharge rate of the battery;
    将所述关机漏电电量Pt1和电池自放电电量Pt2相加得到所述电池损耗电量。The battery leakage power Pt1 and the battery self-discharge power Pt2 are added to obtain the battery power consumption.
  5. 如权利要求4所述的终端电池电量计算方法,其中,所述根据所述电池剩余电量和所述电池损耗电量计算得到初始电池电量的步骤包括:The terminal battery power calculation method according to claim 4, wherein the step of calculating the initial battery power based on the remaining battery power and the battery power consumption comprises:
    将所述电池剩余电量减去所述电池损耗电量得到所述初始电池电量。 The initial battery power is obtained by subtracting the battery power loss from the remaining battery power.
  6. 如权利要求3所述的终端电池电量计算方法,其中,The terminal battery power calculation method according to claim 3, wherein
    所述当前时间信息通过所述终端的硬件实时时钟读取;The current time information is read by a hardware real time clock of the terminal;
    所述终端关机前记录的终端时间信息通过所述终端的硬件实时时钟读取并记录在所述终端。The terminal time information recorded before the terminal is turned off is read by the hardware real time clock of the terminal and recorded in the terminal.
  7. 如权利要求1所述的终端电池电量计算方法,该方法还包括:通过以下方式识别所述终端从关机后到再开机之间是否更换电池:The terminal battery power calculation method according to claim 1, further comprising: identifying whether the terminal replaces the battery between after the power is turned off and after the power is turned on by:
    获取所述终端的当前时间信息以及所述终端关机前记录的终端时间信息;Obtaining current time information of the terminal and terminal time information recorded before the terminal is turned off;
    如果所述当前时间信息大于所述终端关机前记录的终端时间信息,则识别为所述终端从关机后到再开机之间没有更换电池。If the current time information is greater than the terminal time information recorded before the terminal is turned off, it is recognized that the terminal does not replace the battery from after the power is turned off to when the power is turned on.
  8. 如权利要求7所述的终端电池电量计算方法,其中,所述识别所述终端从关机后到再开机之间是否更换电池的步骤还包括:The terminal battery power calculation method according to claim 7, wherein the step of identifying whether the terminal replaces the battery from after the power is turned off to when the power is turned on further comprises:
    如果所述当前时间信息小于所述终端关机前记录的终端时间信息,则识别为所述终端从关机后到再开机之间更换了电池。If the current time information is smaller than the terminal time information recorded before the terminal is turned off, it is recognized that the terminal replaces the battery from after the power is turned off to when the power is turned on.
  9. 如权利要求8所述的终端电池电量计算方法,该方法还包括:The terminal battery power calculation method according to claim 8, further comprising:
    如果所述终端从关机后到再开机之间更换了电池,则按照如下方法计算所述初始电池电量:If the terminal replaces the battery from after the power is turned off to when the power is turned on, the initial battery power is calculated as follows:
    所述终端再开机后,根据当前电池电压、电流和温度状态,通过查表法计算得到所述初始电池电量。After the terminal is powered on again, the initial battery power is calculated by a look-up table method according to the current battery voltage, current, and temperature state.
  10. 如权利要求1-9中任一项所述的终端电池电量计算方法,该方法还包括:The terminal battery power calculation method according to any one of claims 1 to 9, the method further comprising:
    每一次按照预设规则根据所述初始电池电量计算出新的电池剩余电量后,记录最新的电池剩余电量,以及记录所述最新的电池剩余电量对应的终端时间信息。After calculating the new remaining battery power according to the initial battery power according to the preset rule, the latest battery remaining power is recorded, and the terminal time information corresponding to the latest battery remaining power is recorded.
  11. 一种终端电池电量计算装置,包括:第一计算模块、获取模块、第二计算模块和第三计算模块,其中A terminal battery power calculation device includes: a first calculation module, an acquisition module, a second calculation module, and a third calculation module, wherein
    所述第一计算模块设置成:在终端从关机后到再开机之间没有更换电池, 所述终端再开机的情况下,计算所述终端从关机到再开机这一过程中的电池损耗电量;The first calculating module is configured to: the battery is not replaced after the terminal is turned off from the power-on to the power-on. In the case that the terminal is powered on again, calculate the battery power consumption during the process from the shutdown to the restart of the terminal;
    所述获取模块设置成:获取所述终端关机前记录的电池剩余电量;The obtaining module is configured to: acquire a remaining battery power recorded before the terminal is turned off;
    所述第二计算模块设置成:根据所述电池剩余电量和所述电池损耗电量计算初始电池电量;The second calculating module is configured to: calculate an initial battery power according to the remaining battery power and the battery power consumption;
    所述第三计算模块设置成:按照预设规则根据所述初始电池电量计算电池剩余电量。The third calculating module is configured to: calculate a remaining battery power according to the initial battery power according to a preset rule.
  12. 如权利要求11所述的终端电池电量计算装置,其中,所述第一计算模块设置成按照如下方式计算所述终端从关机到再开机这一过程中的电池损耗电量:The terminal battery power calculation device according to claim 11, wherein the first calculation module is configured to calculate a battery loss amount of the terminal during the process from shutdown to reboot according to the following manner:
    计算所述终端的关机时长;Calculating a shutdown time of the terminal;
    根据所述关机时长、所述终端的关机漏电流和电池的自放电速率计算所述电池损耗电量。The battery power consumption is calculated according to the shutdown time, the shutdown leakage current of the terminal, and the self-discharge rate of the battery.
  13. 如权利要求12所述的终端电池电量计算装置,其中,所述第一计算模块设置成按照如下方式获取所述终端的关机时长:The terminal battery power calculation device according to claim 12, wherein the first calculation module is configured to acquire a shutdown time of the terminal according to the following manner:
    根据所述当前时间信息和所述终端关机前记录的终端时间信息计算所述终端的关机时长。And calculating a shutdown duration of the terminal according to the current time information and terminal time information recorded before the terminal is shut down.
  14. 如权利要求12或13所述的终端电池电量计算装置,其中,所述第一计算模块设置成按照如下方式根据所述关机时长、所述关机漏电流和电池的自放电速率计算所述电池损耗电量:The terminal battery power calculation device according to claim 12 or 13, wherein the first calculation module is configured to calculate the battery loss according to the shutdown duration, the shutdown leakage current, and a self-discharge rate of the battery according to the following manner Electricity:
    用所述关机时长乘以所述关机漏电流得到所述终端的关机漏电电量Pt1;Using the shutdown duration multiplied by the shutdown leakage current to obtain the shutdown leakage power Pt1 of the terminal;
    用所述关机时长乘以所述电池的自放电速率计算出电池自放电电量Pt2;Calculating the battery self-discharge power Pt2 by multiplying the shutdown time by the self-discharge rate of the battery;
    将所述关机漏电电量Pt1和电池自放电电量Pt2相加得到所述电池损耗电量。The battery leakage power Pt1 and the battery self-discharge power Pt2 are added to obtain the battery power consumption.
  15. 如权利要求4所述的终端电池电量计算装置,其中,所述第二计算模块设置成按照如下方式根据所述电池剩余电量和所述电池损耗电量计算初始电池电量: The terminal battery power calculation device according to claim 4, wherein the second calculation module is configured to calculate an initial battery power according to the remaining battery power and the battery power consumption as follows:
    将所述电池剩余电量减去所述电池损耗电量得到所述初始电池电量。The initial battery power is obtained by subtracting the battery power loss from the remaining battery power.
  16. 如权利要求13所述的终端电池电量计算装置,其中,The terminal battery power calculation device according to claim 13, wherein
    所述当前时间信息通过所述终端的硬件实时时钟读取;The current time information is read by a hardware real time clock of the terminal;
    所述终端关机前记录的终端时间信息通过所述终端的硬件实时时钟读取并记录在所述终端中。The terminal time information recorded before the terminal is turned off is read by the hardware real time clock of the terminal and recorded in the terminal.
  17. 如权利要求11所述的终端电池电量计算装置,该装置还包括识别模块,该识别模块设置成按照如下方式识别所述终端从关机后到再开机之间是否更换电池:The terminal battery power calculation device according to claim 11, further comprising an identification module configured to identify whether the terminal replaces the battery between after the power is turned off and after the power is turned on as follows:
    获取所述终端当前时间信息以及所述终端关机前记录的终端时间信息;Obtaining current time information of the terminal and terminal time information recorded before the terminal is turned off;
    当所述当前时间信息大于所述终端关机前记录的终端时间信息的情况下,识别为当前所述终端从关机后到再开机之间没有更换电池。When the current time information is greater than the terminal time information recorded before the terminal is turned off, it is recognized that the current terminal does not replace the battery from after the power is turned off to when the power is turned on.
  18. 如权利要求17所述的终端电池电量计算装置,其中,所述识别模块还设置成设置成按照如下方式识别所述终端从关机后到再开机之间是否更换电池:The terminal battery power calculation device according to claim 17, wherein said identification module is further configured to set whether the battery is replaced between after the power is turned off and then restarted as follows:
    当所述当前时间信息小于所述终端关机前记录的终端时间信息的情况下,则识别为所述终端从关机后到再开机之间更换了电池。When the current time information is smaller than the terminal time information recorded before the terminal is turned off, it is recognized that the terminal replaces the battery from after the power is turned off to when the power is turned on.
  19. 如权利要求18所述的终端电池电量计算装置,其中,The terminal battery power calculation device according to claim 18, wherein
    所述第二计算模块还设置成:所述终端再开机后,根据当前电池电压、电流和温度状态,通过查表法计算得到初始电池电量。The second calculating module is further configured to: after the terminal is powered on, calculate the initial battery power by using a look-up table method according to the current battery voltage, current, and temperature state.
  20. 如权利要求11-19中任一项所述的终端电池电量计算装置,该装置还包括记录模块,其中A terminal battery power calculation device according to any one of claims 11 to 19, further comprising a recording module, wherein
    所述记录模块设置成:在每一次按照预设规则根据所述初始电池电量计算出新的电池剩余电量后,记录最新的电池剩余电量,以及记录所述最新的电池剩余电量对应的终端时间信息。 The recording module is configured to: after calculating a new remaining battery power according to the initial battery power according to a preset rule, record the latest remaining battery power, and record the terminal time information corresponding to the latest remaining battery power .
PCT/CN2017/073746 2016-07-01 2017-02-16 Method and apparatus for calculating terminal battery power WO2018000827A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201610519448.3A CN107561446A (en) 2016-07-01 2016-07-01 A kind of terminal battery electricity quantity computational methods and device
CN201610519448.3 2016-07-01

Publications (1)

Publication Number Publication Date
WO2018000827A1 true WO2018000827A1 (en) 2018-01-04

Family

ID=60785757

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2017/073746 WO2018000827A1 (en) 2016-07-01 2017-02-16 Method and apparatus for calculating terminal battery power

Country Status (2)

Country Link
CN (1) CN107561446A (en)
WO (1) WO2018000827A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108344952A (en) * 2018-02-26 2018-07-31 深圳市道通智能航空技术有限公司 Battery power amount calculation method and its device

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109239611A (en) * 2018-11-26 2019-01-18 努比亚技术有限公司 Terminal battery electricity quantity calibration method, terminal and computer readable storage medium
CN110687458A (en) * 2019-09-29 2020-01-14 北京四达时代软件技术股份有限公司 Terminal battery electric quantity determination method and device
CN111836347A (en) * 2020-06-16 2020-10-27 厦门汉印电子技术有限公司 Electric quantity display method, device and equipment and readable storage medium
CN112388674B (en) * 2020-10-13 2023-02-03 中铭谷智能机器人(广东)有限公司 Industrial robot battery clock method
CN114236461B (en) * 2021-12-17 2023-11-21 深圳市百富智能新技术有限公司 Electric quantity calibration method, electronic equipment and storage medium
CN116707052A (en) * 2022-10-31 2023-09-05 荣耀终端有限公司 Shutdown method and electronic equipment

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP1617316A2 (en) * 2004-07-15 2006-01-18 Samsung Electronics Co, Ltd Power management for a portable computer system
CN102736512A (en) * 2011-04-15 2012-10-17 国基电子(上海)有限公司 Electronic device and system time setting method thereof
CN103033758A (en) * 2012-10-25 2013-04-10 北京君正集成电路股份有限公司 Display electric quantity value calibration method and device
CN103529396A (en) * 2013-10-25 2014-01-22 重庆长安汽车股份有限公司 Estimating method for initial value of stage of charge of high-accuracy lithium ion battery
CN103647877A (en) * 2013-12-10 2014-03-19 Tcl通讯(宁波)有限公司 Method of increasing electric quantity display precision at the time of starting up of mobile terminal and the mobile terminal

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP4866187B2 (en) * 2006-09-05 2012-02-01 プライムアースEvエナジー株式会社 Battery control device, electric vehicle, and program for causing computer to execute processing for estimating charge state of secondary battery
JP2014038465A (en) * 2012-08-15 2014-02-27 Renesas Electronics Corp Semiconductor integrated circuit device
CN105049634A (en) * 2015-08-19 2015-11-11 Tcl移动通信科技(宁波)有限公司 Battery mobile terminal based on NFC recognition and recognition method
CN105259508A (en) * 2015-10-14 2016-01-20 惠州Tcl移动通信有限公司 Terminal and method for calculating initial electric energy thereof

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP1617316A2 (en) * 2004-07-15 2006-01-18 Samsung Electronics Co, Ltd Power management for a portable computer system
CN102736512A (en) * 2011-04-15 2012-10-17 国基电子(上海)有限公司 Electronic device and system time setting method thereof
CN103033758A (en) * 2012-10-25 2013-04-10 北京君正集成电路股份有限公司 Display electric quantity value calibration method and device
CN103529396A (en) * 2013-10-25 2014-01-22 重庆长安汽车股份有限公司 Estimating method for initial value of stage of charge of high-accuracy lithium ion battery
CN103647877A (en) * 2013-12-10 2014-03-19 Tcl通讯(宁波)有限公司 Method of increasing electric quantity display precision at the time of starting up of mobile terminal and the mobile terminal

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108344952A (en) * 2018-02-26 2018-07-31 深圳市道通智能航空技术有限公司 Battery power amount calculation method and its device

Also Published As

Publication number Publication date
CN107561446A (en) 2018-01-09

Similar Documents

Publication Publication Date Title
WO2018000827A1 (en) Method and apparatus for calculating terminal battery power
CN106772091B (en) Method and device for updating battery capacity value and terminal
CN101570087B (en) Information processing apparatus and method for controlling information processing apparatus
EP2851700A1 (en) Method and terminal for displaying capacity of battery
CN105100429A (en) Method and device for determining use time of residual electric quantity of mobile terminal
CN103823769A (en) Computer system and data recovery method
US20130290757A1 (en) Embedded controller with an internal timer
US20220099747A1 (en) Battery State Estimation
CN109040467A (en) Interface electricity determines method, apparatus, storage medium and mobile terminal
CN102315670B (en) Charging device and charge control method
CN113590444B (en) Recording method and system for first use time of electronic equipment
US11502529B2 (en) Battery charging method employing historical data
CN104298569A (en) Method and device for detecting abnormal operation of application program and mobile terminal
CN104375929A (en) Method for processing information and electronic equipment
CN114236461B (en) Electric quantity calibration method, electronic equipment and storage medium
CN108762789A (en) A kind of server node firmware update and relevant apparatus
TWI420724B (en) Battery activation
WO2019161677A1 (en) Battery level calculation method and device thereof
CN102566738B (en) A kind of starting-up method of server system and server system
JP2009230314A (en) Information processing apparatus, data saving program and data saving method
CN111836347A (en) Electric quantity display method, device and equipment and readable storage medium
CN111025223A (en) Clock correction method, device, equipment and storage medium of electric energy meter
JP2013003682A (en) Memory management device, memory management method and program
CN103069292A (en) Method for recognising a critical battery condition after a reset of a battery monitoring device
TWI540427B (en) A System and Method for Displaying Battery Capacity

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: 17818827

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 17818827

Country of ref document: EP

Kind code of ref document: A1