[go: up one dir, main page]

CN106603861A - Power display method, device and terminal - Google Patents

Power display method, device and terminal Download PDF

Info

Publication number
CN106603861A
CN106603861A CN201611257917.5A CN201611257917A CN106603861A CN 106603861 A CN106603861 A CN 106603861A CN 201611257917 A CN201611257917 A CN 201611257917A CN 106603861 A CN106603861 A CN 106603861A
Authority
CN
China
Prior art keywords
electric quantity
electricity
battery
current
terminal
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201611257917.5A
Other languages
Chinese (zh)
Inventor
张强
孔凡红
廖福椿
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guangdong Oppo Mobile Telecommunications Corp Ltd
Original Assignee
Guangdong Oppo Mobile Telecommunications Corp Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Guangdong Oppo Mobile Telecommunications Corp Ltd filed Critical Guangdong Oppo Mobile Telecommunications Corp Ltd
Priority to CN201611257917.5A priority Critical patent/CN106603861A/en
Publication of CN106603861A publication Critical patent/CN106603861A/en
Pending legal-status Critical Current

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04MTELEPHONIC COMMUNICATION
    • H04M1/00Substation equipment, e.g. for use by subscribers
    • H04M1/72Mobile telephones; Cordless telephones, i.e. devices for establishing wireless links to base stations without route selection
    • H04M1/724User interfaces specially adapted for cordless or mobile telephones
    • H04M1/72403User interfaces specially adapted for cordless or mobile telephones with means for local support of applications that increase the functionality

Landscapes

  • Engineering & Computer Science (AREA)
  • Human Computer Interaction (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Charge And Discharge Circuits For Batteries Or The Like (AREA)

Abstract

The embodiment of the invention provides an electric quantity display method, an electric quantity display device and a terminal, wherein the electric quantity display method writes first electric quantity of a battery into a memory; when the terminal is restarted, acquiring the current second electric quantity of the battery; judging whether the absolute value of the difference value of the first electric quantity and the second electric quantity is smaller than a preset threshold value or not to obtain a judgment result; and displaying the current electric quantity of the battery according to the judgment result. According to the scheme, after the terminal is restarted, whether the absolute value of the difference value between the first electric quantity and the second electric quantity is smaller than the preset threshold value or not is judged, the current electric quantity of the battery is displayed according to the judgment result, the situation that the electric quantity of the battery jumps before and after the terminal is restarted can be reduced, and therefore the stability of electric quantity display of the terminal can be improved.

Description

电量显示方法、装置及终端Power display method, device and terminal

技术领域technical field

本发明涉及终端技术领域,特别涉及一种电量显示方法、装置及终端。The present invention relates to the technical field of terminals, in particular to a power display method, device and terminal.

背景技术Background technique

当前,移动终端在显示电池电量时,是通过检测电池电压,然后转换为电量百分比实现的。Currently, when the mobile terminal displays the battery power, it detects the battery voltage and then converts it into a percentage of the battery power.

根据电池电压转换为电量百分比,然后显示电池电量时,存在一定的误差,特别是在大电流充放电时误差会更大。There is a certain error when converting the battery voltage to the percentage of battery power and then displaying the battery power, especially when charging and discharging with a large current.

例如,移动终端在重新启动时,开机电流比较大,此时电池电压会被拉低,移动终端显示的电量也会低于重新启动前的电量。也即,移动终端重新启动之前的显示电量与重新启动之后的显示电量存在跳变的情况,由此造成移动终端的电量显示不稳定。For example, when the mobile terminal is restarted, the power-on current is relatively high. At this time, the battery voltage will be pulled down, and the power displayed by the mobile terminal will also be lower than the power before restarting. That is, there is a jump between the displayed battery capacity before the mobile terminal is restarted and the displayed battery capacity after the restart, which causes the battery capacity display of the mobile terminal to be unstable.

发明内容Contents of the invention

本发明实施例提供一种电量显示方法、装置及终端,可以提高终端电量显示的稳定性。Embodiments of the present invention provide a power display method, device, and terminal, which can improve the stability of terminal power display.

本发明实施例提供一种电量显示方法,应用于终端中,该终端包括电池和存储器,该电量显示方法包括:An embodiment of the present invention provides a power display method, which is applied to a terminal. The terminal includes a battery and a memory. The power display method includes:

将该电池的第一电量写入该存储器中;writing the first electric quantity of the battery into the memory;

当该终端重新启动后,获取该电池的当前第二电量;After the terminal is restarted, obtain the current second electric quantity of the battery;

判断该第一电量与该第二电量的差值的绝对值是否小于预设阈值,以得到判断结果;judging whether the absolute value of the difference between the first electric quantity and the second electric quantity is smaller than a preset threshold to obtain a judgment result;

根据该判断结果显示该电池的当前电量。According to the judgment result, the current electric quantity of the battery is displayed.

相应的,本发明实施例还提供一种电量显示装置,应用于终端中,该终端包括电池和存储器,该电量显示装置包括:Correspondingly, an embodiment of the present invention also provides a power display device, which is applied to a terminal, the terminal includes a battery and a memory, and the power display device includes:

写入模块,用于将该电池的第一电量写入该存储器中;a writing module, configured to write the first electric quantity of the battery into the memory;

第一获取模块,用于当该终端重新启动后,获取该电池的当前第二电量;The first obtaining module is used to obtain the current second electric quantity of the battery after the terminal restarts;

第一判断模块,用于判断该第一电量与该第二电量的差值的绝对值是否小于预设阈值,以得到判断结果;The first judging module is used to judge whether the absolute value of the difference between the first electric quantity and the second electric quantity is less than a preset threshold, so as to obtain a judgment result;

显示模块,用于根据该判断结果显示该电池的当前电量。The display module is used for displaying the current electric quantity of the battery according to the judgment result.

相应的,本发明实施例还提供一种终端,包括:Correspondingly, the embodiment of the present invention also provides a terminal, including:

电池,用于为该终端供电;a battery for powering the terminal;

存储器,用于存储数据和可执行程序代码;memory for storing data and executable program code;

与该存储器耦合的处理器;a processor coupled to the memory;

该处理器调用该存储器中存储的该可执行程序代码,执行上述电量显示方法。The processor invokes the executable program code stored in the memory to execute the above power display method.

本发明实施例提供的电量显示方法,将电池的第一电量写入存储器中;当终端重新启动后,获取该电池的当前第二电量;判断该第一电量与该第二电量的差值的绝对值是否小于预设阈值,以得到判断结果;根据该判断结果显示该电池的当前电量。该方案在终端重新启动后,判断第一电量与第二电量的差值的绝对值是否小于预设阈值,根据判断结果来显示电池的当前电量,能够减少终端重新启动前后电池电量跳变的情况发生,因此可以提高终端电量显示的稳定性。In the power display method provided by the embodiment of the present invention, the first power level of the battery is written into the memory; after the terminal is restarted, the current second power level of the battery is obtained; the difference between the first power level and the second power level is judged Whether the absolute value is less than the preset threshold value is used to obtain the judgment result; the current power capacity of the battery is displayed according to the judgment result. This solution judges whether the absolute value of the difference between the first power and the second power is less than the preset threshold after the terminal is restarted, and displays the current power of the battery according to the judgment result, which can reduce the battery power jump before and after the terminal restarts. Occurs, so the stability of the terminal power display can be improved.

附图说明Description of drawings

为了更清楚地说明本发明实施例中的技术方案,下面将对实施例描述中所需要使用的附图作简单地介绍。显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to illustrate the technical solutions in the embodiments of the present invention more clearly, the following will briefly introduce the drawings that need to be used in the description of the embodiments. Obviously, the drawings in the following description are only some embodiments of the present invention, and those skilled in the art can also obtain other drawings according to these drawings without creative work.

图1是本发明实施例提供的电量显示方法的流程示意图。Fig. 1 is a schematic flowchart of a power display method provided by an embodiment of the present invention.

图2是本发明实施例提供的电量显示方法的另一流程示意图。Fig. 2 is another schematic flow chart of the power display method provided by the embodiment of the present invention.

图3是本发明实施例终端上的电量显示示意图。Fig. 3 is a schematic diagram of the power display on the terminal according to the embodiment of the present invention.

图4是本发明实施例提供的电量显示装置的结构示意图。Fig. 4 is a schematic structural diagram of a power display device provided by an embodiment of the present invention.

图5是本发明实施例提供的电量显示装置的另一结构示意图。Fig. 5 is another schematic structural view of the power display device provided by the embodiment of the present invention.

图6是本发明实施例提供的电量显示装置的又一结构示意图。Fig. 6 is another schematic structural diagram of the power display device provided by the embodiment of the present invention.

图7是本发明实施例提供的终端的结构示意图。FIG. 7 is a schematic structural diagram of a terminal provided by an embodiment of the present invention.

图8是本发明实施例提供的终端的另一结构示意图。FIG. 8 is another schematic structural diagram of a terminal provided by an embodiment of the present invention.

具体实施方式detailed description

下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述。显然,所描述的实施例仅仅是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。The following will clearly and completely describe the technical solutions in the embodiments of the present invention with reference to the drawings in the embodiments of the present invention. Apparently, the described embodiments are only some of the embodiments of the present invention, but not all of them. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative efforts fall within the protection scope of the present invention.

本发明的说明书和权利要求书以及上述附图中的术语“第一”、“第二”、“第三”等(如果存在)是用于区别类似的对象,而不必用于描述特定的顺序或先后次序。应当理解,这样描述的对象在适当情况下可以互换。此外,术语“包括”和“具有”以及他们的任何变形,意图在于覆盖不排他的包含。例如,包含了一系列步骤的过程、方法或包含了一系列模块或单元的装置、终端、系统不必限于清楚地列出的那些步骤或模块或单元,还可以包括没有清楚地列出的步骤或模块或单元,也可以包括对于这些过程、方法、装置、终端或系统固有的其它步骤或模块或单元。The terms "first", "second", "third", etc. (if any) in the description and claims of the present invention and the above drawings are used to distinguish similar objects and not necessarily to describe a specific order or sequentially. It should be understood that the items so described are interchangeable under appropriate circumstances. Furthermore, the terms "comprising" and "having", as well as any variations thereof, are intended to cover a non-exclusive inclusion. For example, a process, a method comprising a series of steps, or a device, a terminal, a system comprising a series of modules or units are not necessarily limited to those steps or modules or units clearly listed, and may also include steps or units not clearly listed. A module or unit may also include other steps or modules or units inherent to these processes, methods, apparatuses, terminals or systems.

本发明实施例提供一种电量显示方法、装置及终端,以下将分别进行详细说明。Embodiments of the present invention provide a power display method, device, and terminal, which will be described in detail below.

一种电量显示方法,该电量显示方法可以应用于终端中。该终端包括电池和存储器。该终端可以是智能手机、平板电脑等设备。A power display method, which can be applied to a terminal. The terminal includes a battery and a memory. The terminal may be a device such as a smart phone or a tablet computer.

如图1所示,该电量显示方法,可以包括以下步骤:As shown in FIG. 1, the power display method may include the following steps:

S110,将电池的第一电量写入存储器中。S110. Write the first electric quantity of the battery into the memory.

实际应用中,终端可以实时检测电池剩余电量,并周期性地将电池当前剩余电量写入存储器中。例如,终端可以每隔一分钟更新写入存储器中的电量信息。该剩余电量为第一电量。In practical applications, the terminal can detect the remaining power of the battery in real time, and periodically write the current remaining power of the battery into the memory. For example, the terminal may update the power information written in the memory every minute. The remaining power is the first power.

该存储器可以是非易失性存储器,也即存储器断电后,存储器中存储的数据不会丢失。The memory may be a non-volatile memory, that is, the data stored in the memory will not be lost after the memory is powered off.

该剩余电量可以是电池的实际剩余容量(例如2000mAh),也可以是电池实际剩余容量与电池总容量的百分比(例如80%),还可以是该百分比中的分子(例如,百分比为80%时,取数值80)。The remaining capacity can be the actual remaining capacity of the battery (for example, 2000mAh), or the percentage of the actual remaining capacity of the battery to the total capacity of the battery (for example, 80%), or a numerator in the percentage (for example, when the percentage is 80%) , take the value 80).

S120,当终端重新启动后,获取该电池的当前第二电量。S120, after the terminal restarts, acquire the current second electric quantity of the battery.

实际应用中,当终端重新启动后,获取电池当前电量。电池当前电量为第二电量。In practical applications, when the terminal is restarted, the current battery power is obtained. The current battery level is the second level.

同时参考图2,在一些实施例中,当终端重新启动后,获取该电池的当前第二电量可以包括以下步骤:Referring to FIG. 2 at the same time, in some embodiments, after the terminal is restarted, obtaining the current second power level of the battery may include the following steps:

S121,当终端重新启动后,获取该电池的当前电压;S121, after the terminal restarts, obtain the current voltage of the battery;

S122,根据该当前电压以及预设映射关系获取该电池的当前第二电量,该预设映射关系为电池电压与电池电量之间的映射关系。S122. Acquire the current second electrical quantity of the battery according to the current voltage and a preset mapping relationship, where the preset mapping relationship is a mapping relationship between the battery voltage and the battery electrical quantity.

实际应用中,终端中可以预先存储电池电压与电池电量之间的映射关系。该映射关系可以是线性关系,也可以是非线性关系。该映射关系可以通过实验检测多个相同规格电池的电压与剩余电量之间的对应关系来建立。例如,电池电压为3.9V时,对应的电池剩余电量为70%;电池电压为3.8V时,对应的电池剩余电量为65%。In practical applications, the terminal may pre-store the mapping relationship between the battery voltage and the battery power. The mapping relationship can be a linear relationship or a nonlinear relationship. The mapping relationship can be established by experimentally detecting the correspondence between the voltage and the remaining power of multiple batteries of the same specification. For example, when the battery voltage is 3.9V, the corresponding remaining battery capacity is 70%; when the battery voltage is 3.8V, the corresponding remaining battery capacity is 65%.

当终端重新启动后,终端可以检测电池当前电压。然后根据检测到的电池电压以及预先存储的映射关系来获取电池当前剩余电量。例如,终端检测到电池当前电压为3.8V时,即可确定电池当前剩余电量为65%。After the terminal restarts, the terminal can detect the current voltage of the battery. Then the current remaining battery capacity is obtained according to the detected battery voltage and the pre-stored mapping relationship. For example, when the terminal detects that the current voltage of the battery is 3.8V, it can determine that the current remaining power of the battery is 65%.

S130,判断该第一电量与该第二电量的差值的绝对值是否小于预设阈值,以得到判断结果。S130, judging whether the absolute value of the difference between the first electric quantity and the second electric quantity is smaller than a preset threshold, so as to obtain a judgment result.

实际应用中,终端获取到电池的当前第二电量后,将存储器中存储的第一电量(以下用soc1表示)与该第二电量(以下用soc2表示)进行比较。比较过程中,可以判断soc1与soc2的差值的绝对值是否小于预设阈值(以下用K表示),即判断|soc1-soc2|<K是否成立,得到判断结果。预设阈值K可以是预先存储在终端中的数值,例如,K可以取值10%。In practical applications, after the terminal acquires the current second electric quantity of the battery, it compares the first electric quantity stored in the memory (represented by soc1 hereinafter) with the second electric quantity (represented by soc2 hereinafter). During the comparison process, it can be judged whether the absolute value of the difference between soc1 and soc2 is smaller than a preset threshold (hereinafter denoted by K), that is, judge whether |soc1-soc2|<K holds true, and obtain the judgment result. The preset threshold K may be a value pre-stored in the terminal, for example, K may take a value of 10%.

在一些实施例中,判断该第一电量与该第二电量的差值的绝对值是否小于预设阈值,以得到判断结果的步骤前,该电量显示方法还可以包括以下步骤:In some embodiments, before the step of determining whether the absolute value of the difference between the first electric quantity and the second electric quantity is less than a preset threshold to obtain the judgment result, the electric quantity display method may further include the following steps:

S150,从该存储器中获取该第一电量,以得到获取的第一电量;S150. Obtain the first electric quantity from the memory to obtain the obtained first electric quantity;

S160,判断该获取的第一电量是否满足预设条件。S160. Determine whether the acquired first electric quantity satisfies a preset condition.

实际应用中,终端获取到电池当前第二电量后,从存储器中调取存储的第一电量,以得到获取的第一电量。In practical applications, after the terminal obtains the current second electric quantity of the battery, it retrieves the stored first electric quantity from the memory to obtain the obtained first electric quantity.

理论上,获取到的第一电量应该与存储器中存储的第一电量相同。但是,由于可能存在系统故障、存储器故障等客观因素,终端获取的第一电量也可能与存储器中存储的第一电量不相同。Theoretically, the obtained first electric quantity should be the same as the first electric quantity stored in the memory. However, due to possible objective factors such as system failure and memory failure, the first power quantity acquired by the terminal may also be different from the first power quantity stored in the memory.

终端获取到第一电量后,判断该获取的第一电量是否满足预设条件。其中,预设条件可以为校验获取的第一电量(以下用soc10表示)是否正常的条件。例如,当第一电量为百分比时,该预设条件可以为0<soc10<100%是否成立。当0<soc10<100%成立时,判断结果为获取的第一电量满足预设条件,随后执行步骤S130;当0<soc10<100%不成立时,判断结果为获取的第一电量不满足预设条件,随后终端可以终止流程。After the terminal obtains the first electric quantity, it judges whether the obtained first electric quantity satisfies a preset condition. Wherein, the preset condition may be a condition for checking whether the obtained first electric quantity (represented by soc1 0 hereinafter) is normal. For example, when the first electric quantity is a percentage, the preset condition may be whether 0<soc1 0 <100% is established. When 0<soc1 0 <100% is established, the judgment result is that the obtained first power meets the preset condition, and then step S130 is executed; when 0<soc1 0 <100% is not established, the judgment result is that the obtained first power does not satisfy Preset conditions, the terminal can then terminate the process.

S140,根据该判断结果显示该电池的当前电量。S140, displaying the current electric quantity of the battery according to the determination result.

实际应用中,当终端得到第一电量与第二电量的差值的绝对值是否小于预设阈值的判断结果后,根据该判断结果显示电池的当前电量。终端上显示电池电量的示意图如图3所示。In practical application, after the terminal obtains the judgment result of whether the absolute value of the difference between the first electric quantity and the second electric quantity is less than a preset threshold, the terminal displays the current electric quantity of the battery according to the judgment result. A schematic diagram of displaying battery power on the terminal is shown in FIG. 3 .

在一些实施例中,根据该判断结果显示该电池的当前电量可以包括以下步骤:In some embodiments, displaying the current charge of the battery according to the judgment result may include the following steps:

S141,当判断为是时,将该第一电量确定为当前电量;S141, when the judgment is yes, determine the first electric quantity as the current electric quantity;

S142,显示该当前电量。S142, displaying the current electric quantity.

实际应用中,当S130中判断结果为|soc1-soc2|<K成立时,终端将该第一电量确定为电池的当前电量,并显示该当前电量。例如,K取值为10%,|soc1-soc2|=5%时,终端将第一电量确定为当前电量,并显示该当前电量。In practical application, when the judgment result in S130 is that |soc1-soc2|<K is established, the terminal determines the first electric quantity as the current electric quantity of the battery, and displays the current electric quantity. For example, when the value of K is 10%, and |soc1-soc2|=5%, the terminal determines the first electric quantity as the current electric quantity, and displays the current electric quantity.

在一些实施例中,根据该判断结果显示该电池的当前电量可以包括以下步骤:In some embodiments, displaying the current charge of the battery according to the judgment result may include the following steps:

S143,当判断为否时,将该第二电量确定为当前电量;S143, when the judgment is no, determine the second electric quantity as the current electric quantity;

S144,显示该当前电量。S144, displaying the current electric quantity.

实际应用中,当S130中判断结果为|soc1-soc2|<K不成立时,终端将该第二电量确定为电池的当前电量,并显示该当前电量。例如,K取值为10%,|soc1-soc2|=15%时,终端将第二电量确定为当前电量,并显示该当前电量。In practical applications, when the judgment result in S130 is that |soc1-soc2|<K does not hold, the terminal determines the second power level as the current power level of the battery, and displays the current power level. For example, when the value of K is 10%, and |soc1-soc2|=15%, the terminal determines the second electric quantity as the current electric quantity, and displays the current electric quantity.

在一些实施例中,将第一电量确定为当前电量,并显示该当前电量后,该电量显示方法还可以包括以下步骤:In some embodiments, after determining the first electric quantity as the current electric quantity and displaying the current electric quantity, the electric quantity display method may further include the following steps:

S170,获取预设的电量调整量和预设的电量调整时间间隔;S170, acquiring a preset power adjustment amount and a preset power adjustment time interval;

S180,根据该电量调整量和该电量调整时间间隔调整该当前电量,以使得该当前电量与该第二电量相等。S180. Adjust the current power according to the power adjustment amount and the power adjustment time interval, so that the current power is equal to the second power.

实际应用中,终端的启动过程会消耗一部分电量。因此终端重新启动后,终端获取的第二电量为此时电池的实际电量,而终端显示的电量也即第一电量不是此时电池的实际电量。为了使得终端显示的电量与电池的实际电量保持一致,需要对终端显示的电量进行调整。该调整可以是调大,也可以是调小。In practical applications, the startup process of the terminal consumes a part of power. Therefore, after the terminal is restarted, the second electric quantity obtained by the terminal is the actual electric quantity of the battery at this time, but the electric quantity displayed by the terminal, that is, the first electric quantity is not the actual electric quantity of the battery at this time. In order to make the power displayed on the terminal consistent with the actual power of the battery, it is necessary to adjust the power displayed on the terminal. This adjustment can be adjusted up or down.

终端将第一电量(soc1)确定为当前电量,并显示该当前电量后,获取预设的电量调整量和预设的电量调整时间间隔,并根据该电量调整量和电量调整时间间隔对当前电量进行调整,以使得当前电量与第二电量(soc2)相等。The terminal determines the first electric quantity (soc1) as the current electric quantity, and after displaying the current electric quantity, obtains the preset electric quantity adjustment amount and the preset electric quantity adjustment time interval, and adjusts the current electric quantity according to the electric quantity adjustment amount and the electric quantity adjustment time interval Adjustment is made so that the current electric quantity is equal to the second electric quantity (soc2).

其中,电量调整量可以是每次进行调整的幅度,电量调整时间间隔可以为一段时长。例如,当显示的电量为百分比时,电量调整量可以为电池总容量的1%,预设时间间隔可以为1分钟。也即,当soc1大于soc2时,每隔1分钟将显示的电池电量调小1%;当soc1小于soc2时,每隔1分钟将显示的电池电量调大1%。当终端显示的电池电量与第二电量(soc2)相等时,结束调整。Wherein, the power adjustment amount may be an adjustment range each time, and the power adjustment time interval may be a period of time. For example, when the displayed power is a percentage, the power adjustment amount can be 1% of the total battery capacity, and the preset time interval can be 1 minute. That is, when soc1 is greater than soc2, the displayed battery capacity is decreased by 1% every minute; when soc1 is smaller than soc2, the displayed battery capacity is increased by 1% every minute. When the battery power displayed on the terminal is equal to the second power (soc2), the adjustment ends.

具体实施时,本发明不受所描述的各个步骤的执行顺序的限制,在不产生冲突的情况下,某些步骤还可以采用其它顺序进行或者同时进行。During specific implementation, the present invention is not limited by the execution order of the described steps, and some steps may be performed in other orders or simultaneously if no conflict arises.

由上可知,本发明实施例提供的电量显示方法,将电池的第一电量写入存储器中;当终端重新启动后,获取该电池的当前第二电量;判断该第一电量与该第二电量的差值的绝对值是否小于预设阈值,以得到判断结果;根据该判断结果显示该电池的当前电量。该方案在终端重新启动后,判断第一电量与第二电量的差值的绝对值是否小于预设阈值,根据判断结果来显示电池的当前电量,能够减少终端重新启动前后电池电量跳变的情况发生,因此可以提高终端电量显示的稳定性。It can be seen from the above that the power display method provided by the embodiment of the present invention writes the first power level of the battery into the memory; when the terminal is restarted, obtains the current second power level of the battery; judges the first power level and the second power level Whether the absolute value of the difference is less than the preset threshold value is used to obtain the judgment result; the current power capacity of the battery is displayed according to the judgment result. This solution judges whether the absolute value of the difference between the first power and the second power is less than the preset threshold after the terminal is restarted, and displays the current power of the battery according to the judgment result, which can reduce the battery power jump before and after the terminal restarts. Occurs, so the stability of the terminal power display can be improved.

本发明实施例还提供一种电量显示装置,该装置可以集成在终端中。该终端包括电池和存储器。该终端可以是智能手机、平板电脑等设备。The embodiment of the present invention also provides a power display device, which can be integrated into a terminal. The terminal includes a battery and a memory. The terminal may be a device such as a smart phone or a tablet computer.

如图4所示,电量显示装置200可以包括:写入模块201、第一获取模块202、第一判断模块203以及显示模块204。As shown in FIG. 4 , the power display device 200 may include: a writing module 201 , a first obtaining module 202 , a first judging module 203 and a display module 204 .

该写入模块201,用于将电池的第一电量写入存储器中。The writing module 201 is configured to write the first electric quantity of the battery into the memory.

实际应用中,终端可以实时检测电池剩余电量,并由写入模块201周期性地将电池当前剩余电量写入存储器中。例如,写入模块201可以每隔一分钟更新写入存储器中的电量信息。该剩余电量为第一电量。In practical applications, the terminal can detect the remaining battery power in real time, and the writing module 201 periodically writes the current remaining battery power into the memory. For example, the writing module 201 may update the power information written in the memory every minute. The remaining power is the first power.

该存储器可以是非易失性存储器,也即存储器断电后,存储器中存储的数据不会丢失。The memory may be a non-volatile memory, that is, the data stored in the memory will not be lost after the memory is powered off.

该剩余电量可以是电池的实际剩余容量(例如2000mAh),也可以是电池实际剩余容量与电池总容量的百分比(例如80%),还可以是该百分比中的分子(例如,百分比为80%时,取数值80)。The remaining capacity can be the actual remaining capacity of the battery (for example, 2000mAh), or the percentage of the actual remaining capacity of the battery to the total capacity of the battery (for example, 80%), or a numerator in the percentage (for example, when the percentage is 80%) , take the value 80).

该第一获取模块202,用于当终端重新启动后,获取该电池的当前第二电量。The first obtaining module 202 is configured to obtain the current second electric quantity of the battery after the terminal restarts.

实际应用中,当终端重新启动后,第一获取模块202获取电池当前电量。电池当前电量为第二电量。In practical application, after the terminal restarts, the first obtaining module 202 obtains the current battery power. The current battery level is the second level.

在一些实施例中,第一获取模块202用于执行以下步骤:In some embodiments, the first acquiring module 202 is configured to perform the following steps:

当终端重新启动后,获取该电池的当前电压;After the terminal is restarted, obtain the current voltage of the battery;

根据该当前电压以及预设映射关系获取该电池的当前第二电量,该预设映射关系为电池电压与电池电量之间的映射关系。The current second electrical quantity of the battery is acquired according to the current voltage and a preset mapping relationship, where the preset mapping relationship is a mapping relationship between the battery voltage and the battery electrical quantity.

实际应用中,终端中可以预先存储电池电压与电池电量之间的映射关系。该映射关系可以是线性关系,也可以是非线性关系。该映射关系可以通过实验检测多个相同规格电池的电压与剩余电量之间的对应关系来建立。例如,电池电压为3.9V时,对应的电池剩余电量为70%;电池电压为3.8V时,对应的电池剩余电量为65%。In practical applications, the terminal may pre-store the mapping relationship between the battery voltage and the battery power. The mapping relationship can be a linear relationship or a nonlinear relationship. The mapping relationship can be established by experimentally detecting the correspondence between the voltage and the remaining power of multiple batteries of the same specification. For example, when the battery voltage is 3.9V, the corresponding remaining battery capacity is 70%; when the battery voltage is 3.8V, the corresponding remaining battery capacity is 65%.

当终端重新启动后,第一获取模块202可以检测电池当前电压。然后根据检测到的电池电压以及预先存储的映射关系来获取电池当前剩余电量。例如,终端检测到电池当前电压为3.8V时,即可确定电池当前剩余电量为65%。After the terminal restarts, the first acquiring module 202 can detect the current voltage of the battery. Then the current remaining battery capacity is obtained according to the detected battery voltage and the pre-stored mapping relationship. For example, when the terminal detects that the current voltage of the battery is 3.8V, it can determine that the current remaining power of the battery is 65%.

该第一判断模块203,用于判断该第一电量与该第二电量的差值的绝对值是否小于预设阈值,以得到判断结果。The first judging module 203 is used for judging whether the absolute value of the difference between the first electric quantity and the second electric quantity is smaller than a preset threshold, so as to obtain a judgment result.

实际应用中,第一获取模块202获取到电池的当前第二电量后,第一判断模块203将存储器中存储的第一电量(以下用soc1表示)与该第二电量(以下用soc2表示)进行比较。比较过程中,可以判断soc1与soc2的差值的绝对值是否小于预设阈值(以下用K表示),即判断|soc1-soc2|<K是否成立,得到判断结果。预设阈值K可以是预先存储在终端中的数值,例如,K可以取值10%。In practical applications, after the first obtaining module 202 acquires the current second electric quantity of the battery, the first judging module 203 compares the first electric quantity stored in the memory (represented by soc1 below) with the second electric quantity (represented by soc2 below) Compare. During the comparison process, it can be judged whether the absolute value of the difference between soc1 and soc2 is smaller than a preset threshold (hereinafter denoted by K), that is, judge whether |soc1-soc2|<K holds true, and obtain the judgment result. The preset threshold K may be a value pre-stored in the terminal, for example, K may take a value of 10%.

在一些实施例中,如图5所示,电量显示装置200还可以包括:第三获取模块205、第二判断模块206。In some embodiments, as shown in FIG. 5 , the power display device 200 may further include: a third acquiring module 205 and a second judging module 206 .

该第三获取模块205,用于从该存储器中获取该第一电量,以得到获取的第一电量;The third obtaining module 205 is configured to obtain the first electric quantity from the memory, so as to obtain the obtained first electric quantity;

该第二判断模块206,用于判断该获取的第一电量是否满足预设条件;The second judging module 206 is configured to judge whether the obtained first electric quantity satisfies a preset condition;

该第一判断模块203,用于在该第二判断模块206判断为是时,判断该第一电量与该第二电量的差值的绝对值是否小于预设阈值,以得到判断结果。The first judging module 203 is configured to judge whether the absolute value of the difference between the first electric quantity and the second electric quantity is less than a preset threshold when the second judging module 206 judges yes, to obtain a judgment result.

实际应用中,第一获取模块202获取到电池当前第二电量后,第三获取模块205从存储器中调取存储的第一电量,以得到获取的第一电量。In practical application, after the first obtaining module 202 obtains the current second electric quantity of the battery, the third obtaining module 205 retrieves the stored first electric quantity from the memory to obtain the obtained first electric quantity.

理论上,获取到的第一电量应该与存储器中存储的第一电量相同。但是,由于可能存在系统故障、存储器故障等客观因素,终端获取的第一电量也可能与存储器中存储的第一电量不相同。Theoretically, the obtained first electric quantity should be the same as the first electric quantity stored in the memory. However, due to possible objective factors such as system failure and memory failure, the first power quantity acquired by the terminal may also be different from the first power quantity stored in the memory.

第三获取模块205获取到第一电量后,第二判断模块206判断该获取的第一电量是否满足预设条件。其中,预设条件可以为校验获取的第一电量(以下用soc10表示)是否正常的条件。例如,当第一电量为百分比时,该预设条件可以为0<soc10<100%是否成立。当0<soc10<100%成立时,第二判断模块206的判断结果为获取的第一电量满足预设条件,随后该第一判断模块203判断该第一电量与该第二电量的差值的绝对值是否小于预设阈值,以得到判断结果;当0<soc10<100%不成立时,第二判断模块206的判断结果为获取的第一电量不满足预设条件,随后终端可以终止流程。After the third obtaining module 205 obtains the first electric quantity, the second judging module 206 judges whether the obtained first electric quantity satisfies a preset condition. Wherein, the preset condition may be a condition for checking whether the obtained first electric quantity (represented by soc1 0 hereinafter) is normal. For example, when the first electric quantity is a percentage, the preset condition may be whether 0<soc1 0 <100% is established. When 0<soc1 0 <100% is established, the judgment result of the second judging module 206 is that the obtained first electric quantity satisfies the preset condition, and then the first judging module 203 judges the difference between the first electric quantity and the second electric quantity Whether the absolute value of is less than the preset threshold to obtain the judgment result; when 0<soc1 0 <100% is not established, the judgment result of the second judgment module 206 is that the obtained first power does not meet the preset condition, and then the terminal can terminate the process .

该显示模块204,用于根据该判断结果显示该电池的当前电量。The display module 204 is configured to display the current battery capacity according to the judgment result.

实际应用中,当第一判断模块203得到第一电量与第二电量的差值的绝对值是否小于预设阈值的判断结果后,显示模块204根据该判断结果显示电池的当前电量。In practical applications, when the first judging module 203 obtains the judging result of whether the absolute value of the difference between the first power and the second power is smaller than a preset threshold, the display module 204 displays the current power of the battery according to the judging result.

在一些实施例中,显示模块204用于执行以下步骤:In some embodiments, the display module 204 is configured to perform the following steps:

当判断为是时,将该第一电量确定为当前电量;When the judgment is yes, determine the first electric quantity as the current electric quantity;

显示该当前电量。Displays the current battery level.

实际应用中,当第一判断模块203的判断结果为|soc1-soc2|<K成立时,显示模块204将该第一电量确定为电池的当前电量,并显示该当前电量。例如,K取值为10%,|soc1-soc2|=5%时,显示模块204将第一电量确定为当前电量,并显示该当前电量。In practical application, when the judgment result of the first judging module 203 is that |soc1-soc2|<K is established, the display module 204 determines the first electric quantity as the current electric quantity of the battery, and displays the current electric quantity. For example, when the value of K is 10%, and |soc1-soc2|=5%, the display module 204 determines the first electric quantity as the current electric quantity, and displays the current electric quantity.

在一些实施例中,显示模块204用于执行以下步骤:In some embodiments, the display module 204 is configured to perform the following steps:

当判断为否时,将该第二电量确定为当前电量;When the judgment is no, determine the second electric quantity as the current electric quantity;

显示该当前电量。Displays the current battery level.

实际应用中,当第一判断模块203的判断结果为|soc1-soc2|<K不成立时,显示模块204将该第二电量确定为电池的当前电量,并显示该当前电量。例如,K取值为10%,|soc1-soc2|=15%时,显示模块204将第二电量确定为当前电量,并显示该当前电量。In practical applications, when the judgment result of the first judging module 203 is that |soc1-soc2|<K is not established, the display module 204 determines the second electric quantity as the current electric quantity of the battery, and displays the current electric quantity. For example, when the value of K is 10%, and |soc1-soc2|=15%, the display module 204 determines the second electric quantity as the current electric quantity, and displays the current electric quantity.

在一些实施例中,如图6所示,电量显示装置200还可以包括:第二获取模块207、调整模块208。In some embodiments, as shown in FIG. 6 , the power display device 200 may further include: a second acquiring module 207 and an adjusting module 208 .

该第二获取模块207,用于获取预设的电量调整量和预设的电量调整时间间隔;The second acquiring module 207 is configured to acquire a preset power adjustment amount and a preset power adjustment time interval;

该调整模块208,用于根据该电量调整量和该电量调整时间间隔调整该当前电量,以使得该当前电量与该第二电量相等。The adjustment module 208 is configured to adjust the current power according to the power adjustment amount and the power adjustment time interval, so that the current power is equal to the second power.

实际应用中,终端的启动过程会消耗一部分电量。因此终端重新启动后,第一获取模块202获取的第二电量为此时电池的实际电量,而显示模块204显示的电量也即第一电量不是此时电池的实际电量。为了使得显示模块204显示的电量与电池的实际电量保持一致,需要对显示模块204显示的电量进行调整。该调整可以是调大,也可以是调小。In practical applications, the startup process of the terminal consumes a part of power. Therefore, after the terminal is restarted, the second electric quantity acquired by the first acquiring module 202 is the actual electric quantity of the battery at this time, but the electric quantity displayed by the display module 204 ie the first electric quantity is not the actual electric quantity of the battery at this moment. In order to make the power displayed by the display module 204 consistent with the actual power of the battery, the power displayed by the display module 204 needs to be adjusted. This adjustment can be adjusted up or down.

显示模块204将第一电量(soc1)确定为当前电量,并显示该当前电量后,第二获取模块207获取预设的电量调整量和预设的电量调整时间间隔,并由调整模块208根据该电量调整量和电量调整时间间隔对当前电量进行调整,以使得当前电量与第二电量(soc2)相等。The display module 204 determines the first electric quantity (soc1) as the current electric quantity, and after displaying the current electric quantity, the second acquisition module 207 obtains the preset electric quantity adjustment amount and the preset electric quantity adjustment time interval, and the adjustment module 208 according to the The power adjustment amount and the power adjustment time interval adjust the current power, so that the current power is equal to the second power (soc2).

其中,电量调整量可以是每次进行调整的幅度,电量调整时间间隔可以为一段时长。例如,当显示的电量为百分比时,电量调整量可以为电池总容量的1%,预设时间间隔可以为1分钟。也即,当soc1大于soc2时,调整模块208每隔1分钟将显示的电池电量调小1%;当soc1小于soc2时,调整模块208每隔1分钟将显示的电池电量调大1%。当显示模块204显示的电池电量与第二电量(soc2)相等时,结束调整。Wherein, the power adjustment amount may be an adjustment range each time, and the power adjustment time interval may be a period of time. For example, when the displayed power is a percentage, the power adjustment amount can be 1% of the total battery capacity, and the preset time interval can be 1 minute. That is, when soc1 is greater than soc2, the adjustment module 208 decreases the displayed battery power by 1% every minute; when soc1 is smaller than soc2, the adjustment module 208 increases the displayed battery power by 1% every one minute. When the battery level displayed by the display module 204 is equal to the second level (soc2), the adjustment ends.

具体实施时,以上各个模块可以作为独立的实体来实现,也可以进行任意组合,作为同一或若干个实体来实现。During specific implementation, each of the above modules may be implemented as an independent entity, or may be combined arbitrarily to be implemented as the same or several entities.

由上可知,本发明实施例提供的电量显示装置200,通过写入模块201将电池的第一电量写入存储器中;当终端重新启动后,第一获取模块202获取该电池的当前第二电量;第一判断模块203判断该第一电量与该第二电量的差值的绝对值是否小于预设阈值,以得到判断结果;显示模块204根据该判断结果显示该电池的当前电量。该方案在终端重新启动后,判断第一电量与第二电量的差值的绝对值是否小于预设阈值,根据判断结果来显示电池的当前电量,能够减少终端重新启动前后电池电量跳变的情况发生,因此可以提高终端电量显示的稳定性。It can be seen from the above that the power display device 200 provided by the embodiment of the present invention writes the first power level of the battery into the memory through the writing module 201; after the terminal restarts, the first acquisition module 202 acquires the current second power level of the battery The first judging module 203 judges whether the absolute value of the difference between the first electric quantity and the second electric quantity is less than a preset threshold to obtain a judgment result; the display module 204 displays the current electric quantity of the battery according to the judgment result. This solution judges whether the absolute value of the difference between the first power and the second power is less than the preset threshold after the terminal is restarted, and displays the current power of the battery according to the judgment result, which can reduce the battery power jump before and after the terminal restarts. Occurs, so the stability of the terminal power display can be improved.

本发明实施例还提供一种终端,该终端可以是智能手机、平板电脑等设备。The embodiment of the present invention also provides a terminal, and the terminal may be a device such as a smart phone or a tablet computer.

如图7所示,终端300可以包括:写入模块301、第一获取模块302、第一判断模块303、显示模块304。As shown in FIG. 7 , the terminal 300 may include: a writing module 301 , a first obtaining module 302 , a first judging module 303 , and a display module 304 .

该写入模块301,用于将电池的第一电量写入存储器中;The writing module 301 is configured to write the first electric quantity of the battery into the memory;

该第一获取模块302,用于当终端重新启动后,获取该电池的当前第二电量;The first obtaining module 302 is configured to obtain the current second electric quantity of the battery after the terminal restarts;

该第一判断模块303,用于判断该第一电量与该第二电量的差值的绝对值是否小于预设阈值,以得到判断结果;The first judging module 303 is configured to judge whether the absolute value of the difference between the first electric quantity and the second electric quantity is smaller than a preset threshold, so as to obtain a judgment result;

该显示模块304,用于根据该判断结果显示该电池的当前电量。The display module 304 is configured to display the current battery capacity according to the judgment result.

在一些实施例中,显示模块304用于:In some embodiments, the display module 304 is used to:

当该判断结果为是时,将该第一电量确定为当前电量;When the judgment result is yes, determining the first electric quantity as the current electric quantity;

显示该当前电量。Displays the current battery level.

在一些实施例中,终端300还包括:第二获取模块、调整模块。In some embodiments, the terminal 300 further includes: a second acquiring module and an adjusting module.

该第二获取模块,用于获取预设的电量调整量和预设的电量调整时间间隔;The second acquisition module is used to acquire a preset power adjustment amount and a preset power adjustment time interval;

该调整模块,用于根据该电量调整量和该电量调整时间间隔调整该当前电量,以使得该当前电量与该第二电量相等。The adjustment module is configured to adjust the current power according to the power adjustment amount and the power adjustment time interval, so that the current power is equal to the second power.

在一些实施例中,显示模块304用于:In some embodiments, the display module 304 is used to:

当该判断结果为否时,将该第二电量确定为当前电量;When the judgment result is no, determine the second electric quantity as the current electric quantity;

显示该当前电量。Displays the current battery level.

在一些实施例中,第一获取模块302用于:In some embodiments, the first obtaining module 302 is used for:

当终端重新启动后,获取电池的当前电压;When the terminal restarts, obtain the current voltage of the battery;

根据该当前电压以及预设映射关系获取该电池的当前第二电量,该预设映射关系为电池电压与电池电量之间的映射关系。The current second electrical quantity of the battery is acquired according to the current voltage and a preset mapping relationship, where the preset mapping relationship is a mapping relationship between the battery voltage and the battery electrical quantity.

在一些实施例中,终端300还包括:第三获取模块、第二判断模块。In some embodiments, the terminal 300 further includes: a third obtaining module and a second judging module.

该第三获取模块,用于从该存储器中获取该第一电量,以得到获取的第一电量;The third obtaining module is configured to obtain the first electric quantity from the memory to obtain the obtained first electric quantity;

该第二判断模块,用于判断该获取的第一电量是否满足预设条件;The second judging module is used to judge whether the obtained first electric quantity satisfies a preset condition;

该第一判断模块,用于在该第二判断模块判断为是时,判断该第一电量与该第二电量的差值的绝对值是否小于预设阈值,以得到判断结果。The first judging module is used for judging whether the absolute value of the difference between the first electric quantity and the second electric quantity is smaller than a preset threshold when the second judging module judges yes, so as to obtain a judgment result.

本发明实施例还提供另一种终端。如图8所示,终端400可以包括射频(RF,RadioFrequency)电路401、包括有一个或一个以上计算机可读存储介质的存储器402、输入单元403、显示单元404、传感器405、音频电路406、无线保真(WiFi,Wireless Fidelity)模块407、包括有一个或者一个以上处理核心的处理器408、以及电源409等部件。本领域技术人员可以理解,图8中示出的终端结构并不构成对终端的限定,可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件布置。The embodiment of the present invention also provides another terminal. As shown in FIG. 8, the terminal 400 may include a radio frequency (RF, Radio Frequency) circuit 401, a memory 402 including one or more computer-readable storage media, an input unit 403, a display unit 404, a sensor 405, an audio circuit 406, a wireless A fidelity (WiFi, Wireless Fidelity) module 407 includes a processor 408 with one or more processing cores, a power supply 409 and other components. Those skilled in the art can understand that the terminal structure shown in FIG. 8 does not constitute a limitation on the terminal, and may include more or less components than those shown in the figure, or combine some components, or arrange different components.

射频电路401可以通过无线通信与网络设备或其他电子设备通信,完成与网络设备或其他电子设备之间的信息收发。The radio frequency circuit 401 can communicate with network equipment or other electronic equipment through wireless communication, and complete information sending and receiving between the network equipment or other electronic equipment.

存储器402可用于存储应用程序和数据。存储器402存储的应用程序中包含有可执行程序代码。应用程序可以组成各种功能模块。处理器408通过运行存储在存储器402的应用程序,从而执行各种功能应用以及数据处理。存储器402可主要包括存储程序区和存储数据区。其中,存储程序区可存储操作系统、至少一个功能所需的应用程序(比如电量管理功能、图像播放功能等)等;存储数据区可存储根据终端的使用所创建的数据(比如电池电量信息、电话本等)等。此外,存储器402可以包括高速随机存取存储器,还可以包括非易失性存储器,例如至少一个磁盘存储器件、闪存器件、或其他易失性固态存储器件。相应地,存储器402还可以包括存储器控制器,以提供处理器408和输入单元403对存储器402的访问。Memory 402 may be used to store applications and data. The application programs stored in the memory 402 include executable program codes. Applications can be composed of various functional modules. The processor 408 executes various functional applications and data processing by running the application programs stored in the memory 402 . The memory 402 may mainly include an area for storing programs and an area for storing data. Among them, the storage program area can store the operating system, at least one application program required by the function (such as power management function, image playback function, etc.); the storage data area can store data created according to the use of the terminal (such as battery power information, phone book, etc.). In addition, the memory 402 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid-state storage devices. Correspondingly, the memory 402 may further include a memory controller to provide the processor 408 and the input unit 403 with access to the memory 402 .

输入单元403可用于接收输入的数字、字符信息或用户特征信息(比如指纹),以及产生与用户设置以及功能控制有关的键盘、鼠标、操作杆、光学或者轨迹球信号输入。其中,输入单元403可以包括指纹识别模组。The input unit 403 can be used to receive input numbers, character information or user characteristic information (such as fingerprints), and generate keyboard, mouse, joystick, optical or trackball signal input related to user settings and function control. Wherein, the input unit 403 may include a fingerprint identification module.

显示单元404可用于显示由用户输入的信息或提供给用户的信息以及终端的各种图形用户接口,这些图形用户接口可以由图形、文本、图标、视频和其任意组合来构成。The display unit 404 can be used to display information input by or provided to the user and various graphical user interfaces of the terminal. These graphical user interfaces can be composed of graphics, text, icons, videos and any combination thereof.

终端还可包括至少一种传感器405,比如光传感器、运动传感器以及其他传感器。The terminal may also include at least one sensor 405, such as a light sensor, a motion sensor, and other sensors.

音频电路406可通过扬声器、传声器提供用户与终端之间的音频接口。The audio circuit 406 can provide an audio interface between the user and the terminal through a speaker or a microphone.

无线保真(WiFi)属于短距离无线传输技术,终端通过无线保真模块407可以与其他终端或服务器进行通信。Wireless Fidelity (WiFi) belongs to the short-distance wireless transmission technology, and the terminal can communicate with other terminals or servers through the WiFi module 407 .

处理器408是终端的控制中心,利用各种接口和线路连接整个终端的各个部分,通过运行或执行存储在存储器402内的应用程序,以及调用存储在存储器402内的数据,执行终端的各种功能和处理数据,从而对终端进行整体监控。The processor 408 is the control center of the terminal. It uses various interfaces and lines to connect various parts of the entire terminal. By running or executing the application program stored in the memory 402 and calling the data stored in the memory 402, various functions of the terminal are executed. function and process data, so as to monitor the terminal as a whole.

终端还包括给各个部件供电的电源409(比如电池)。在一些实施例中,电源可以通过电源管理系统与处理器408逻辑相连,从而通过电源管理系统实现管理充电、放电、以及功耗管理等功能。The terminal also includes a power source 409 (such as a battery) for powering various components. In some embodiments, the power supply can be logically connected to the processor 408 through a power management system, so that functions such as charging, discharging, and power consumption management can be implemented through the power management system.

尽管图8中未示出,终端还可以包括摄像头、蓝牙模块等,在此不再赘述。Although not shown in FIG. 8 , the terminal may also include a camera, a Bluetooth module, etc., which will not be repeated here.

在本实施例中,终端中的处理器408会按照如下的指令,将一个或一个以上的应用程序的进程对应的可执行程序代码加载到存储器402中,并由处理器408来运行存储在存储器402中的应用程序,从而实现各种功能:In this embodiment, the processor 408 in the terminal loads the executable program code corresponding to the process of one or more application programs into the memory 402 according to the following instructions, and the processor 408 runs the executable program code stored in the memory 402 in the application, so as to achieve various functions:

将电池的第一电量写入存储器中;Write the first electric quantity of the battery into the memory;

当终端重新启动后,获取该电池的当前第二电量;After the terminal is restarted, obtain the current second power level of the battery;

判断该第一电量与该第二电量的差值的绝对值是否小于预设阈值,以得到判断结果;judging whether the absolute value of the difference between the first electric quantity and the second electric quantity is smaller than a preset threshold to obtain a judgment result;

根据该判断结果显示该电池的当前电量。According to the judgment result, the current electric quantity of the battery is displayed.

在一些实施例中,处理器408根据该判断结果显示该电池的当前电量时,用于执行以下步骤:当该判断结果为是时,将该第一电量确定为当前电量;显示该当前电量。In some embodiments, when the processor 408 displays the current power level of the battery according to the judgment result, it is configured to perform the following steps: when the judgment result is yes, determine the first power capacity as the current power capacity; and display the current power capacity.

在一些实施例中,显示该当前电量后,处理器408还用于:获取预设的电量调整量和预设的电量调整时间间隔;根据该电量调整量和该电量调整时间间隔调整该当前电量,以使得该当前电量与该第二电量相等。In some embodiments, after the current power is displayed, the processor 408 is further configured to: acquire a preset power adjustment amount and a preset power adjustment time interval; adjust the current power according to the power adjustment amount and the power adjustment time interval , so that the current electric quantity is equal to the second electric quantity.

在一些实施例中,处理器408根据该判断结果显示该电池的当前电量时,用于执行以下步骤:当该判断结果为否时,将该第二电量确定为当前电量;显示该当前电量。In some embodiments, when the processor 408 displays the current power level of the battery according to the judgment result, it is configured to perform the following steps: when the judgment result is no, determine the second power capacity as the current power capacity; and display the current power capacity.

在一些实施例中,当终端重新启动后,获取该电池的当前第二电量时,处理器408用于执行以下步骤:当该终端重新启动后,获取该电池的当前电压;根据该当前电压以及预设映射关系获取该电池的当前第二电量,该预设映射关系为电池电压与电池电量之间的映射关系。In some embodiments, when the terminal is restarted and the current second electric quantity of the battery is obtained, the processor 408 is configured to perform the following steps: after the terminal is restarted, obtain the current voltage of the battery; according to the current voltage and The preset mapping relationship obtains the current second electric quantity of the battery, and the preset mapping relationship is a mapping relationship between the battery voltage and the battery electric quantity.

在一些实施例中,判断该第一电量与该第二电量的差值的绝对值是否小于预设阈值,以得到判断结果前,处理器408还用于执行以下步骤:从该存储器中获取该第一电量,以得到获取的第一电量;判断该获取的第一电量是否满足预设条件;当判断为是时,则判断该第一电量与该第二电量的差值的绝对值是否小于预设阈值,以得到判断结果。In some embodiments, before judging whether the absolute value of the difference between the first electric quantity and the second electric quantity is less than a preset threshold, and obtaining the judgment result, the processor 408 is further configured to perform the following steps: obtain the The first electric quantity to obtain the first electric quantity obtained; judge whether the first electric quantity obtained satisfies the preset condition; Preset thresholds to obtain judgment results.

上述实施例中,对各个实施例的描述都各有侧重,某些实施例中没有详细描述的部分,可以参见前面对电量显示方法的详细描述,在此不再赘述。In the above-mentioned embodiments, the description of each embodiment has its own emphases. For some parts that are not described in detail in some embodiments, please refer to the detailed description of the power display method above, and will not be repeated here.

由上可知,本发明实施例提供了一种终端,将电池的第一电量写入存储器中;当终端重新启动后,获取该电池的当前第二电量;判断该第一电量与该第二电量的差值的绝对值是否小于预设阈值,以得到判断结果;根据该判断结果显示该电池的当前电量。该方案在终端重新启动后,判断第一电量与第二电量的差值的绝对值是否小于预设阈值,根据判断结果来显示电池的当前电量,能够减少终端重新启动前后电池电量跳变的情况发生,因此可以提高终端电量显示的稳定性。It can be seen from the above that the embodiment of the present invention provides a terminal that writes the first power level of the battery into the memory; when the terminal is restarted, obtains the current second power level of the battery; and judges the first power level and the second power level Whether the absolute value of the difference is less than the preset threshold value is used to obtain the judgment result; the current power capacity of the battery is displayed according to the judgment result. This solution judges whether the absolute value of the difference between the first power and the second power is less than the preset threshold after the terminal is restarted, and displays the current power of the battery according to the judgment result, which can reduce the jump of battery power before and after the terminal restarts. Occurs, so the stability of the terminal power display can be improved.

需要说明的是,本领域普通技术人员可以理解上述实施例的各种方法中的全部或部分步骤是可以通过程序来指令相关的硬件来完成,该程序可以存储于计算机可读存储介质中,存储介质可以包括:只读存储器(ROM,Read Only Memory)、随机存取存储器(RAM,Random Access Memory)、磁盘或光盘等。It should be noted that those skilled in the art can understand that all or part of the steps in the various methods of the above-mentioned embodiments can be completed by instructing related hardware through a program, and the program can be stored in a computer-readable storage medium. The medium may include: a read only memory (ROM, Read Only Memory), a random access memory (RAM, Random Access Memory), a magnetic disk or an optical disk, and the like.

以上对本发明实施例所提供的一种电量显示方法、装置及终端进行了详细介绍,本文中应用了具体个例对本发明的原理及实施方式进行了阐述,以上实施例的说明只是用于帮助理解本发明的方法及其核心思想;同时,对于本领域的技术人员,依据本发明的思想,在具体实施方式及应用范围上均会有改变之处,综上所述,本说明书内容不应理解为对本发明的限制。The above is a detailed introduction to a power display method, device and terminal provided by the embodiments of the present invention. In this paper, specific examples are used to illustrate the principle and implementation of the present invention. The description of the above embodiments is only for helping understanding The method of the present invention and its core idea; at the same time, for those skilled in the art, according to the idea of the present invention, there will be changes in the specific implementation and scope of application. In summary, the content of this specification should not be understood To limit the present invention.

Claims (13)

1. a kind of electric quantity display method, in being applied to terminal, the terminal includes battery and memorizer, it is characterised in that described Electric quantity display method includes:
First electricity of the battery is write in the memorizer;
After the terminal restarts, current second electricity of the battery is obtained;
Judge whether first electricity is less than predetermined threshold value with the absolute value of the difference of second electricity, to obtain judging knot Really;
The current electric quantity of battery according to the judgment result displays.
2. electric quantity display method according to claim 1, it is characterised in that described according to the judgment result displays The step of current electric quantity of battery, includes:
When the judged result is that first electricity is less than the predetermined threshold value with the absolute value of the difference of second electricity When, first electricity is defined as into current electric quantity;
Show the current electric quantity.
3. electric quantity display method according to claim 2, it is characterised in that the step of the display current electric quantity Afterwards, the electric quantity display method also includes:
Obtain default electricity adjustment amount and default electricity adjustment time interval;
According to the electricity adjustment amount and the electricity adjustment time interval adjustment current electric quantity, so that the current electricity Amount is equal with second electricity.
4. electric quantity display method according to claim 1, it is characterised in that described according to the judgment result displays The step of current electric quantity of battery, includes:
When the judged result is that first electricity is not less than the default threshold with the absolute value of the difference of second electricity During value, second electricity is defined as into current electric quantity;
Show the current electric quantity.
5. electric quantity display method according to any one of claim 1 to 4, it is characterised in that described when the terminal weight It is new start after, include the step of current second electricity for obtaining the battery:
After the terminal restarts, the current voltage of the battery is obtained;
Current second electricity of the battery is obtained according to the current voltage and default mapping relations, the default mapping is closed It is for the mapping relations between cell voltage and battery electric quantity.
6. electric quantity display method according to any one of claim 1 to 4, it is characterised in that the judgement described first Whether the absolute value of electricity and the difference of second electricity is less than predetermined threshold value, the step of to obtain judged result before, it is described Electric quantity display method also includes:
First electricity is obtained from the memorizer, with the first electricity for obtaining obtaining;
Whether the first electricity for judging the acquisition meets pre-conditioned;
If the first electricity of the acquisition meets pre-conditioned, judge first electricity with the difference of second electricity Whether absolute value is less than predetermined threshold value, to obtain judged result.
7. a kind of electric quantity display device, in being applied to terminal, the terminal includes battery and memorizer, it is characterised in that described Electric quantity display device includes:
Writing module, for the first electricity of the battery to be write in the memorizer;
First acquisition module, for after the terminal restarts, obtaining current second electricity of the battery;
First judge module, for judging first electricity with the absolute value of the difference of second electricity whether less than default Threshold value, to obtain judged result;
Display module, for the current electric quantity of the battery according to the judgment result displays.
8. electric quantity display device according to claim 7, it is characterised in that the display module is used for:
When the judged result is that first electricity is less than the predetermined threshold value with the absolute value of the difference of second electricity When, first electricity is defined as into current electric quantity;
Show the current electric quantity.
9. electric quantity display device according to claim 8, it is characterised in that also include:
Second acquisition module, for obtaining default electricity adjustment amount and default electricity adjustment time interval;
Adjusting module, for adjusting the current electric quantity according to the electricity adjustment amount and electricity adjustment time interval, with So that the current electric quantity is equal with second electricity.
10. electric quantity display device according to claim 7, it is characterised in that the display module is used for:
When the judged result is that first electricity is not less than the default threshold with the absolute value of the difference of second electricity During value, second electricity is defined as into current electric quantity;
Show the current electric quantity.
11. electric quantity display devices according to any one of claim 7 to 10, it is characterised in that described first obtains mould Block is used for:
After the terminal restarts, the current voltage of the battery is obtained;
Current second electricity of the battery is obtained according to the current voltage and default mapping relations, the default mapping is closed It is for the mapping relations between cell voltage and battery electric quantity.
12. electric quantity display devices according to any one of claim 7 to 10, it is characterised in that also include:
3rd acquisition module, for obtaining first electricity from the memorizer, with the first electricity for obtaining obtaining;
Second judge module, for judging whether the first electricity of the acquisition meets pre-conditioned;
First judge module, for being judged as that the first electricity of the acquisition meets default bar in second judge module During part, judge whether first electricity is less than predetermined threshold value with the absolute value of the difference of second electricity, to be judged As a result.
13. a kind of terminals, it is characterised in that include:
Battery, for powering for the terminal;
Memorizer, for data storage and executable program code;
The processor coupled with the memorizer;
The processor calls the executable program code stored in the memorizer, performs as appointed in claim 1 to 6 Electric quantity display method described in one.
CN201611257917.5A 2016-12-30 2016-12-30 Power display method, device and terminal Pending CN106603861A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201611257917.5A CN106603861A (en) 2016-12-30 2016-12-30 Power display method, device and terminal

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201611257917.5A CN106603861A (en) 2016-12-30 2016-12-30 Power display method, device and terminal

Publications (1)

Publication Number Publication Date
CN106603861A true CN106603861A (en) 2017-04-26

Family

ID=58581501

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201611257917.5A Pending CN106603861A (en) 2016-12-30 2016-12-30 Power display method, device and terminal

Country Status (1)

Country Link
CN (1) CN106603861A (en)

Cited By (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107295175A (en) * 2017-06-23 2017-10-24 广东欧珀移动通信有限公司 A method, device, storage medium and mobile terminal for displaying and controlling power of a mobile terminal
CN107390126A (en) * 2017-06-06 2017-11-24 广州视源电子科技股份有限公司 Battery power display control method and display control device of electronic equipment
CN107436410A (en) * 2017-07-19 2017-12-05 上海与德科技有限公司 A kind of electric quantity controlling method, device, equipment and storage medium
CN109040467A (en) * 2018-09-26 2018-12-18 Oppo广东移动通信有限公司 Interface electric quantity determination method and device, storage medium and mobile terminal
CN109031130A (en) * 2018-05-31 2018-12-18 轻客智能科技(江苏)有限公司 A kind of electricity calibration method and device
CN109633447A (en) * 2019-01-09 2019-04-16 福建联迪商用设备有限公司 Residual quantity display method and computer readable storage medium
CN110632522A (en) * 2019-10-09 2019-12-31 赣州得辉达科技有限公司 Sound box electric quantity display method
CN111781507A (en) * 2020-06-04 2020-10-16 珠海格力电器股份有限公司 SOC value display method and device and energy storage system
CN118838659A (en) * 2024-09-24 2024-10-25 荣耀终端有限公司 Startup control method, electronic equipment and computer readable storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103033758A (en) * 2012-10-25 2013-04-10 北京君正集成电路股份有限公司 Display electric quantity value calibration method and device
CN103344918A (en) * 2013-06-21 2013-10-09 广东欧珀移动通信有限公司 A mobile terminal battery power display method and system
US20140024416A1 (en) * 2012-07-19 2014-01-23 Shell Internet (Beijing) Security Technology Co. Ltd. Method and apparatus for power management on mobile devices and associated mobile devices
CN103761179A (en) * 2014-01-28 2014-04-30 广东欧珀移动通信有限公司 Method and system for displaying electric quantity left after terminal restart

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20140024416A1 (en) * 2012-07-19 2014-01-23 Shell Internet (Beijing) Security Technology Co. Ltd. Method and apparatus for power management on mobile devices and associated mobile devices
CN103033758A (en) * 2012-10-25 2013-04-10 北京君正集成电路股份有限公司 Display electric quantity value calibration method and device
CN103344918A (en) * 2013-06-21 2013-10-09 广东欧珀移动通信有限公司 A mobile terminal battery power display method and system
CN103761179A (en) * 2014-01-28 2014-04-30 广东欧珀移动通信有限公司 Method and system for displaying electric quantity left after terminal restart

Cited By (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107390126A (en) * 2017-06-06 2017-11-24 广州视源电子科技股份有限公司 Battery power display control method and display control device of electronic equipment
CN107295175A (en) * 2017-06-23 2017-10-24 广东欧珀移动通信有限公司 A method, device, storage medium and mobile terminal for displaying and controlling power of a mobile terminal
CN107436410A (en) * 2017-07-19 2017-12-05 上海与德科技有限公司 A kind of electric quantity controlling method, device, equipment and storage medium
CN109031130B (en) * 2018-05-31 2021-04-09 轻客小觅机器人科技(成都)有限公司 Electric quantity calibration method and device
CN109031130A (en) * 2018-05-31 2018-12-18 轻客智能科技(江苏)有限公司 A kind of electricity calibration method and device
CN109040467A (en) * 2018-09-26 2018-12-18 Oppo广东移动通信有限公司 Interface electric quantity determination method and device, storage medium and mobile terminal
CN109633447A (en) * 2019-01-09 2019-04-16 福建联迪商用设备有限公司 Residual quantity display method and computer readable storage medium
CN109633447B (en) * 2019-01-09 2022-02-11 福建联迪商用设备有限公司 Remaining power display method and computer-readable storage medium
CN110632522A (en) * 2019-10-09 2019-12-31 赣州得辉达科技有限公司 Sound box electric quantity display method
WO2021244085A1 (en) * 2020-06-04 2021-12-09 珠海格力电器股份有限公司 Soc value display method and display device, and energy storage system
CN111781507A (en) * 2020-06-04 2020-10-16 珠海格力电器股份有限公司 SOC value display method and device and energy storage system
CN111781507B (en) * 2020-06-04 2022-05-10 珠海格力电器股份有限公司 SOC value display method and device and energy storage system
CN118838659A (en) * 2024-09-24 2024-10-25 荣耀终端有限公司 Startup control method, electronic equipment and computer readable storage medium

Similar Documents

Publication Publication Date Title
CN106603861A (en) Power display method, device and terminal
US20220043067A1 (en) Charging method and device, charging system, electronic equipment and storage medium
CN106786962B (en) Charging control method and device and terminal
CN106655388A (en) Charging control method and device and terminal
CN110085934A (en) A charging method for a terminal battery and a mobile terminal
US9723408B2 (en) Electronic device and method of preventing erroneous recognizing inserting connector into earphone jack
US20150007161A1 (en) Information processing apparatus, method for controlling the same, and storage medium
US20130290762A1 (en) Methods and apparatuses to wake computer systems from sleep states
CN112540304B (en) Battery power management method, electronic device and computer storage medium
CN106505699B (en) Charging control method and device and terminal
WO2018129991A1 (en) Charging method, charging device and terminal
KR20200100404A (en) Electronic device for adaptive power management
CN105068959A (en) A charging method and device for a terminal and a terminal with a data exchange function
CN106532876B (en) Power supply control method and device and computer equipment
KR102500690B1 (en) Battery status based charging control method and appratus thereof
CN108681514A (en) Equipment detection method, device, storage medium and electronic equipment
CN106786959B (en) Charging control method and device and terminal
CN107436410A (en) A kind of electric quantity controlling method, device, equipment and storage medium
CN107291213B (en) Mode selection method, apparatus, terminal, and computer-readable storage medium
CN110994052B (en) Method and device for prolonging battery endurance, storage medium and terminal equipment
CN107451037A (en) Remaining operation time prompting method and device for mobile terminal
CN110896240A (en) Charging control method and device, computer readable storage medium and terminal
CN112486350B (en) Detection method and device for touch screen of mobile terminal, storage medium and mobile terminal
CN111384754B (en) Charging method, charging device, storage medium and mobile terminal
US11363133B1 (en) Battery health-based power management

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20170426