CN109040467A - Interface electricity determines method, apparatus, storage medium and mobile terminal - Google Patents

Interface electricity determines method, apparatus, storage medium and mobile terminal Download PDF

Info

Publication number
CN109040467A
CN109040467A CN201811123361.XA CN201811123361A CN109040467A CN 109040467 A CN109040467 A CN 109040467A CN 201811123361 A CN201811123361 A CN 201811123361A CN 109040467 A CN109040467 A CN 109040467A
Authority
CN
China
Prior art keywords
electricity
interface
mobile terminal
interface electricity
contact surface
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
CN201811123361.XA
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 CN201811123361.XA priority Critical patent/CN109040467A/en
Publication of CN109040467A publication Critical patent/CN109040467A/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
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/01Input arrangements or combined input and output arrangements for interaction between user and computer
    • G06F3/048Interaction techniques based on graphical user interfaces [GUI]
    • G06F3/0481Interaction techniques based on graphical user interfaces [GUI] based on specific properties of the displayed interaction object or a metaphor-based environment, e.g. interaction with desktop elements like windows or icons, or assisted by a cursor's changing behaviour or appearance

Landscapes

  • Engineering & Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Human Computer Interaction (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Power Sources (AREA)
  • Telephone Function (AREA)

Abstract

The embodiment of the present application discloses interface electricity and determines method, apparatus, storage medium and mobile terminal.This method comprises: when detecting mobile terminal-opening, obtain the first interface electricity stored in default memory space, wherein, the data stored in default memory space can be saved in the case where stopping power supply, and the first interface electricity includes mobile terminal the last time stopping the electricity showing in display screen interface before power supply;Obtain the first electricity obtained by the voltameter measurement in mobile terminal;The second contact surface electricity shown in display screen interface is currently used according to the first interface electricity and the determination of the first electricity.The embodiment of the present application is by using above-mentioned technical proposal, it can be in mobile terminal-opening, obtain the last interface electricity stopped before power supply, current electric quantity is integrated again measures the electricity measured, it determines the interface electricity for being currently used in display, can more accurately determine interface electricity when mobile terminal is just switched on.

Description

Interface electricity determines method, apparatus, storage medium and mobile terminal
Technical field
The invention relates to technical field of mobile terminals more particularly to interface electricity to determine that method, apparatus, storage are situated between Matter and mobile terminal.
Background technique
Quick with mobile terminal is popularized, and the mobile terminals such as mobile phone and tablet computer have become people's work and life Indispensable tool.
Portability is one of maximum feature of mobile terminal, and portable attribute also determines that mobile terminal is needed using electricity Pond powers.User is being increased using the frequency and duration of mobile terminal at present, and the capacity of battery is than relatively limited, generally It just needed within 1 day to fill mobile terminal primary electricity by 2 days.Understand the battery capacity of mobile terminal at any time in order to facilitate user, it is most Mobile terminal can all show that current battery capacity, this electricity are commonly referred to as interface electricity in display screen interface.However, mesh The method of determination of front interface electricity is still incomplete, it may appear that the situation for showing inaccuracy needs to improve.
Summary of the invention
The embodiment of the present application provides a kind of interface electricity and determines method, apparatus, storage medium and mobile terminal, can optimize Interface electricity in mobile terminal determines scheme.
In a first aspect, the embodiment of the present application, which provides a kind of interface electricity, determines method, comprising:
When detecting mobile terminal-opening, the first interface electricity stored in default memory space is obtained, wherein described pre- If the data stored in memory space can be saved in the case where stopping power supply, first interface electricity includes the movement Terminal the last time stops the electricity showing in display screen interface before power supply;
Obtain the first electricity obtained by the voltameter measurement in the mobile terminal;
Second contact surface electricity is determined according to first interface electricity and first electricity, wherein the second contact surface Electricity includes being currently used in the electricity shown in the display screen interface.
Second aspect, the embodiment of the present application provide a kind of interface electricity determining device, comprising:
First interface electricity obtains module, for when detecting mobile terminal-opening, obtaining default memory space memory First interface electricity of storage, wherein the data stored in the default memory space can be saved in the case where stopping power supply, First interface electricity includes described mobile terminal the last time stopping the electricity showing in display screen interface before power supply;
First electricity obtains module, for obtaining the first electricity obtained by the voltameter measurement in the mobile terminal Amount;
Second contact surface electricity determining module, for determining the second boundary according to first interface electricity and first electricity Face electricity, wherein the second contact surface electricity includes being currently used in the electricity shown in the display screen interface.
The third aspect, the embodiment of the present application provide a kind of computer readable storage medium, are stored thereon with computer journey Sequence realizes that the interface electricity as described in the embodiment of the present application determines method when the program is executed by processor.
Fourth aspect, the embodiment of the present application provide a kind of mobile terminal, including memory, processor and are stored in storage It can realize on device and when the computer program of processor operation, the processor execute the computer program as the application is real It applies interface electricity described in example and determines method.
The interface electricity provided in the embodiment of the present application determines scheme, when detecting mobile terminal-opening, obtains default deposit The the first interface electricity stored in space is stored up, the first electricity obtained by the voltameter measurement in mobile terminal is obtained, according to First interface electricity and the first electricity determine the second contact surface electricity for showing in display screen interface.By using above-mentioned skill Art scheme can obtain the last interface electricity stopped before power supply, then comprehensive current electric quantity in mobile terminal-opening The electricity measured is measured, the interface electricity for being currently used in display is determined, can more accurately determine that mobile terminal is just switched on When interface electricity.
Detailed description of the invention
Fig. 1 is the flow diagram that a kind of interface electricity provided by the embodiments of the present application determines method;
Fig. 2 is the flow diagram that another interface electricity provided by the embodiments of the present application determines method;
Fig. 3 is the flow diagram that another interface electricity provided by the embodiments of the present application determines method;
Fig. 4 is that interface electricity provided by the embodiments of the present application updates flow for displaying schematic diagram;
Fig. 5 is that voltameter provided by the embodiments of the present application drives median surface electricity schematic diagram of calculation flow;
Fig. 6 is a kind of structural block diagram of interface electricity determining device provided by the embodiments of the present application;
Fig. 7 is a kind of structural schematic diagram of mobile terminal provided by the embodiments of the present application;
Fig. 8 is the structural schematic diagram of another mobile terminal provided by the embodiments of the present application.
Specific embodiment
Further illustrate the technical solution of the application below with reference to the accompanying drawings and specific embodiments.It is understood that It is that specific embodiment described herein is used only for explaining the application, rather than the restriction to the application.It further needs exist for illustrating , part relevant to the application is illustrated only for ease of description, in attached drawing rather than entire infrastructure.
It should be mentioned that some exemplary embodiments are described as before exemplary embodiment is discussed in greater detail The processing or method described as flow chart.Although each step is described as the processing of sequence by flow chart, many of these Step can be implemented concurrently, concomitantly or simultaneously.In addition, the sequence of each step can be rearranged.When its operation The processing can be terminated when completion, it is also possible to have the additional step being not included in attached drawing.The processing can be with Corresponding to method, function, regulation, subroutine, subprogram etc..
Fig. 1 is the flow diagram that a kind of interface electricity provided by the embodiments of the present application determines method, and this method can be by Interface electricity determining device executes, and wherein the device can be implemented by software and/or hardware, and can generally integrate in the terminal. As shown in Figure 1, this method comprises:
Step 101 when detecting mobile terminal-opening, obtains the first interface electricity stored in default memory space.
Wherein, the data stored in the default memory space can be saved in the case where stopping power supply, and described first Interface electricity includes described mobile terminal the last time stopping the electricity showing in display screen interface before power supply.
Illustratively, the mobile terminal in the embodiment of the present application may include mobile phone, tablet computer and media player etc. Mobile device.Mobile terminal needs to power using battery, in the embodiment of the present application no to the material of battery, type and capacity etc. It limits.
In the related technology, understand the battery capacity of mobile terminal at any time in order to facilitate user, it all can be in display screen interface Show current battery capacity, this electricity is commonly referred to as interface electricity.Interface electricity can indicate in the form of percentage, Such as 95%, the remaining capacity of battery is indicated there are also the 95% of battery total capacity, and user can be by checking that interface electricity understands electricity The service condition in pond, the usage mode for mobile terminal of making rational planning for and charging time etc..Interface electricity is particularly shown position not It limits, illustratively, interface electricity may be displayed in the notification bar at mobile terminal display screen interface.
In general, be built-in with battery meter in mobile terminal, also known as voltameter, voltameter chip and battery management Chip etc., the electricity that voltameter measurement obtains can be described as electricity quantity calculation.The voltameter of the kernel spacing of bottom in mobile terminal Driving can generally obtain electricity quantity calculation, and reference electric quantity quantity calculation and current interface electricity, COMPREHENSIVE CALCULATING are to be shown out Interface electricity and be reported to user's space.The frequency for obtaining electricity quantity calculation can be according to the performance or battery of mobile terminal itself Performance etc. is determining, such as 5 seconds primary.In the related technology, interface electricity will not be recorded in real time, works as mobile terminal After stopping power supply while shutting down (such as power down), internal file system is canceled, and will lose information about power, after mobile terminal-opening, Interface electricity to be shown can only be determined according to current electricity quantity calculation, to be easy to cause interface electricity inaccurately determining Really, there is a situation where electricity to jump, and if the interface electricity before mobile terminal shutdown is 30%, and restarts rear interface electricity and becomes 25%, increase the puzzlement of user.Especially some mobile terminals are during fabrication, used due to manufacturing cost etc. The precision of voltameter is not high enough, is more easier that above-mentioned electricity jump situation occurs.
In the embodiment of the present application, the stopping power supply of mobile terminal the last time is stored in the default memory space of mobile terminal The electricity shown in display screen interface before, i.e. the first interface electricity.When detecting mobile terminal-opening, first is first obtained Interface electricity accurately determines second contact surface electricity to be shown for subsequent.It should be noted that the last stop power supply It at least may include two kinds of situations, the first situation is, when mobile terminal shuts down, and uncharged before booting, the first interface electricity It is exactly the interface electricity before mobile terminal shutdown;Second situation is, after mobile terminal shutdown, is connected to charger, into filling Electricity condition, at this time on mobile terminal screen also can display interface electricity stop charging then before mobile terminal-opening, first Interface electricity is just off the interface electricity before charging.
The default interior data stored of memory space can be saved in the case where stopping power supply, it can be ensured that mobile whole End after shutdown and booting, can successfully get the first interface electricity wherein stored.Default memory space can be deposited It is in built-in multimedia storage card (Embedded Multi Media Card, EMMC or eMMC).EMMC is generally using system Non-volatile flash memory, such as nand flash memory (NAND Flash) and MMC controller are encapsulated in one by one MMC standard interface In chip, be mobile terminal generally use solution is locally stored.Default memory space in the embodiment of the present application can be with It is reservation (persist) subregion in EMMC, persist subregion is generally used for saving factory reset protection (factory reset Protcect, FRP) the shielded information such as the account number used of function and password, it avoids being emptied after factory reset.This Sample setting is advantageous in that, can better ensure that the safety of the first interface electricity.
The first electricity that step 102, acquisition are obtained by the voltameter measurement in the mobile terminal.
Illustratively, voltameter generally passes through analog-to-digital conversion module (Analog-to-Digital Converter, ADC) Cell voltage is read, and calculates the remaining capacity of battery according to cell voltage, realizes the purpose of measurement battery capacity, voltameter Measure obtained electricity can be described as electricity quantity calculation as mentioned before, it will be appreciated that the practical electricity reported for voltameter.The application In embodiment, the first electricity can be regarded as current electricity quantity calculation.
Step 103 determines second contact surface electricity according to first interface electricity and first electricity, wherein described Second contact surface electricity includes being currently used in the electricity shown in the display screen interface.
In the embodiment of the present application, the first interface electricity shown before mobile terminal power-off and current electric quantity measurement are comprehensively considered The first electricity measured is determined eventually for the second contact surface electricity shown in display screen interface, compared to the relevant technologies In use merely electricity quantity calculation as interface electricity to be shown for, identified interface electricity is more accurate, can be effective The generation of mode electricity hopping phenomenon.
For specifically how according to the first interface electricity and the first electricity to determine second contact surface electricity, the embodiment of the present application is not It limits.Illustratively, it can be determined according to the size relation of the first interface electricity and the first electricity and determine which of the two For second contact surface electricity;Preset algorithm can also be used, second contact surface electricity is calculated according to the first interface electricity and the first electricity, Preset algorithm for example can be average value etc.;Apart from current time at the time of stopping powering see also mobile terminal the last time Time interval, determine second contact surface electricity etc. further according to the first interface electricity and the first electricity.
Illustratively, after determining second contact surface electricity according to first interface electricity and first electricity, also Can include: the second contact surface electricity is shown in the display screen interface of the mobile terminal.
The interface electricity provided in the embodiment of the present application determines scheme, when detecting mobile terminal-opening, obtains default deposit The the first interface electricity stored in space is stored up, the first electricity obtained by the voltameter measurement in mobile terminal is obtained, according to First interface electricity and the first electricity determine the second contact surface electricity for showing in display screen interface.By using above-mentioned skill Art scheme can obtain the last interface electricity stopped before power supply, then comprehensive current electric quantity in mobile terminal-opening The electricity measured is measured, the interface electricity for being currently used in display is determined, can more accurately determine that mobile terminal is just switched on When interface electricity.
In some embodiments, described that second contact surface electricity is determined according to first interface electricity and first electricity Amount, comprising: the difference for calculating first interface electricity and first electricity obtains the first difference;When first difference When more than or equal to preset threshold, second contact surface electricity is determined according to first electricity;Described in being less than when first difference When preset threshold, second contact surface electricity is determined according to first interface electricity.The advantages of this arrangement are as follows can quickly close Reason ground determines second contact surface electricity.Preset threshold is positive number, can be configured according to the actual situation, such as can be 15%.When First interface electricity is greater than the first electricity, and when the first interface electricity differs more with the first electricity, it may be possible to when due to shutting down Between it is longer and cause to consume more electricity, then current true electricity should differ more with the first interface electricity, institute Second contact surface electricity is determined so that the first electricity can be directlyed adopt, such as second contact surface electricity is directly determined as the first electricity.And When the first interface electricity is greater than or equal to the first electricity and the two difference is less, alternatively, when the first interface electricity is less than first When electricity (the first difference of the first interface electricity and the first electricity is negative at this time, certainly less than preset threshold), illustrate first Electricity is inaccurate, and needs to determine second contact surface electricity according to the first interface electricity.
In some embodiments, described that second contact surface electricity is determined according to first interface electricity, comprising: when described One electricity is greater than or equal to first interface electricity, alternatively, determining second contact surface when first interface electricity is 100% Electricity is the first interface electricity;When first electricity is less than first interface electricity, and first interface electricity is less than When 100%, determine that second contact surface electricity is the difference of the first interface electricity and default charge value.The advantages of this arrangement are as follows Second contact surface electricity can more quickly be reasonably determined.
When the first electricity is greater than or equal to the first interface electricity, after illustrating that voltameter error leads to mobile terminal-opening Electricity does not reduce not only, increases instead, then can illustrate electricity quantity calculation inaccuracy, can directly be determined as the second encryption electricity First interface electricity.
In general, mobile terminal manufacturer when charge cutoff point is set due to safety concerns, it will usually force down charging Cut off will stop filling when this threshold value is reached for judging whether the threshold value being full of in charge cutoff point, that is, charging process Electricity.And the above-mentioned way of manufacturer, it will lead to and just stop charging when electricity quantity calculation is also not up to 100%, such as 98%, and In order to let the user know that mobile terminal has been filled with electricity, then needing to set interface electricity to 100%, i.e. interface electricity can be floated Height will update interface electricity according to current electricity quantity calculation, interface electricity is caused to be less than if restarting mobile terminal at this time 100%, it allows user to take for mobile terminal and is not full of, bring unnecessary puzzlement to user.In the embodiment of the present application, in order to Following scheme can be used in the generation for avoiding above situation.When the first electricity is less than the first interface electricity and the first interface electricity is When 100%, determine that second contact surface electricity is that the first interface electricity can illustrate mobile terminal before power-off in this case Through fully charged, in order to avoid the illusion of underfill electricity occurs, second contact surface electricity can be determined as to the first interface electricity, i.e., 100%.When first electricity is less than first interface electricity and first interface electricity less than 100%, the is determined Second interface electricity is that the difference of the first interface electricity and default charge value illustrates mobile terminal before power-off in this case It is not fully charged state, and during shutdown is switched on again, a small amount of electricity may be consumed, so can be in second contact surface Default charge value is subtracted on the basis of electricity, obtains second contact surface electricity.Wherein, default charge value can be set according to the actual situation It sets, such as can be 1%.
In some embodiments, it may also include that the first moment when the first interface electricity described in record storage;In the inspection When measuring mobile terminal-opening, the second current moment is obtained;According to the time difference at second moment and first moment Determine the default charge value.The advantages of this arrangement are as follows default charge value can rationally be determined, and then more accurately really Determine second contact surface electricity.
In some embodiments, it is described detect mobile terminal-opening before, further includes: be in the mobile terminal When operating status, whether detection interface electricity changes;If changing, using current interface electricity as the first interface electricity In amount storage to the default memory space.The advantages of this arrangement are as follows the numerical value for the first interface electricity that can timely update, When ensuring mobile terminal power-off, the accuracy of the first interface electricity saved.Optionally, after mobile terminal shuts down, if inspection It measures mobile terminal and enters charged state, also can detect whether interface electricity changes;If changing, by current interface Electricity is stored as the first interface electricity into the default memory space.
In some embodiments, it if described change, is arrived current interface electricity as the first interface electricity storage In the default memory space, comprising: if changing, judge whether current boot-mode is user mode;If so, will Current interface electricity is stored as the first interface electricity into the default memory space.The advantages of this arrangement are as follows can be It is reduced when not needing to save the first interface electricity and saves operation, save electricity.In general, the power on mode of mobile terminal can Including normal (normal) mode namely user mode, may also include calibration mode and restore (recovery) mode etc., Other than normal mode, other modes contribute to mobile terminal factory before test or factory after maintenance situations such as, The case where with user's normal use, is unrelated, so not needing to save the first interface electricity.
Fig. 2 is the flow diagram that another interface electricity provided by the embodiments of the present application determines method, and this method includes Following steps:
Step 201, when mobile terminal is in operating status, if detecting, interface electricity changes, and will work as prezone Face electricity is stored as the first interface electricity into default memory space.
Illustratively, presetting memory space is the persist subregion in mobile terminal in EMMC, which is to be solidificated in Memory in EMMC will not be wiped free of system is powered down.
In the embodiment of the present application, at least one first interface electricity can be retained in default memory space, when detecting boundary When face electricity changes, current interface electricity is obtained, and using the current interface electricity as the first new interface electricity to pre- If existing first interface electricity is updated replacement in memory space.It, can be without updating if interface electricity is to change.
Step 202, detect mobile terminal shutdown after be switched on again when, obtain the first interface electricity.
Illustratively, newest first interface electricity in default memory space is obtained, for subsequent and the first electricity ratio Compared with.
The first electricity that step 203, acquisition are obtained by the voltameter measurement in mobile terminal.
Step 204, the difference for calculating the first interface electricity and first electricity, obtain the first difference.
Step 205 judges whether the first difference is less than preset threshold, if so, thening follow the steps 206;Otherwise, step is executed 210。
Illustratively, preset threshold can be 15%.
Step 206 judges the first electricity whether less than the first interface electricity, if so, thening follow the steps 207;Otherwise, it executes Step 208.
Step 207 judges whether the first interface electricity is 100%, if so, thening follow the steps 208;Otherwise, step is executed 209。
Step 208 determines that second contact surface electricity is the first interface electricity, executes step 211.
Step 209 determines that second contact surface electricity is the difference of the first interface electricity and default charge value, executes step 211.
Illustratively, default charge value can be pre-set fixed value, and such as 1%;Default charge value can also be root According to the numerical value that actual conditions determine, such as it is dynamically determined according to the time difference between booting moment and moment of shutting down.
Step 210 determines that second contact surface electricity is the first electricity, executes step 211.
Step 211 shows second contact surface electricity in the display screen interface of mobile terminal.
Interface electricity provided by the embodiments of the present application determines method, in the operational process of mobile terminal, updates at any time pre- If the first interface electricity in memory space, after standby communication terminal is restarted, obtains the first interface electricity and voltameter measures The first electricity arrived, according to the size relation between the first interface electricity and the first electricity, finally rapidly and accurately determination is used for The numerical value of the second contact surface electricity of display, second contact surface electricity is shown on mobile terminal screen, is checked for user.
Fig. 3 is the flow diagram that another interface electricity provided by the embodiments of the present application determines method, and Fig. 4 is the application The interface electricity that embodiment provides updates flow for displaying schematic diagram, and Fig. 5 is boundary in voltameter provided by the embodiments of the present application driving Face electricity schematic diagram of calculation flow, by taking Android (Android) operating system as an example, in conjunction with Fig. 3 to Fig. 5, this method comprises:
Step 301, when mobile terminal is in operating status, interface is detected by the default finger daemon of user's space Electricity changes, and current boot-mode is user mode, then obtains current interface electricity as the first interface electricity, and deposit In storage to default memory space.
Wherein, if interface electricity does not change, current interface electricity need not can temporarily be obtained.If current boot-mode For the mode other than user mode (normal), current interface electricity can also need not be obtained.
Illustratively, default finger daemon can be the healthd in user's space (user space).By healthd Detect whether current interface electricity (ui_soc) needs to change, if need to store interface electricity.It can be in user Increase interface electricity in space and obtain event, the event is triggered when needing to obtain current interface electricity, by healthd to the first boundary Face electricity is recorded, and can be denoted as the first interface electricity storing electricity (restore_soc), and soc therein indicates battery electricity Amount.
Illustratively, presetting memory space is the persist subregion in mobile terminal in EMMC, which is to be solidificated in Memory in EMMC will not be wiped free of system is powered down.
Step 302, when being switched on again after detecting mobile terminal shutdown, pass through the default finger daemon and obtain the first boundary Face electricity.
Illustratively, in mobile terminal-opening, healthd reads restore_ from EMMC during initialization Soc, the node restore_ when healthd successful initialization and after read successfully, in written document system (file system) Ready and restore_soc.Wherein, restore_ready is for indicating whether to read successfully, and restore_soc is used for table Show the specific value read.The voltameter driving (gauge driver) of bottom kernel spacing (kernel space) is receiving When to restore_ready==true, restore_soc is successfully read in expression, can start to calculate new ui_soc, i.e., this Apply for second contact surface electricity to be determined in embodiment.
Step 303 drives the first electricity for obtaining voltameter measurement and obtaining by voltameter.
Illustratively, it can be driven by voltameter and obtain electricity quantity calculation (gauge_soc).
Step 304 drives the difference for calculating the first interface electricity and the first electricity by voltameter, obtains the first difference.
Illustratively, the first difference is the numerical value that restore_soc subtracts gauge_soc.
Step 305 judges whether the first difference is less than preset threshold by voltameter driving, if so, thening follow the steps 306;Otherwise, step 310 is executed.
Judge whether restore_soc-gauge_soc is less than preset threshold threshold.Illustratively, threshold It can be 15%.
Step 306 judges the first electricity whether less than the first interface electricity, if so, executing step by voltameter driving Rapid 307;Otherwise, step 308 is executed.
In this step, continue to judge whether gauge_soc is less than restore_soc, if being not less than, can illustrate that chip misses Difference goes up not down after causing mobile terminal to be restarted, so step 308 is executed, using restore_soc as new ui_soc.
Step 307 judges whether the first interface electricity is 100% by voltameter driving, if so, thening follow the steps 308; Otherwise, step 309 is executed.
Step 308 drives determining second contact surface electricity to be the first interface electricity, execution step 311 by voltameter.
As gauge_soc < restore_soc and restore_soc==100, last time shutdown front interface electricity is illustrated It is full, use restore_soc as new ui_soc, the i.e. full electricity in holding interface at this time.
Step 309 drives the difference for determining that second contact surface electricity is the first interface electricity and default charge value by voltameter Value executes step 311.
Illustratively, default charge value can be pre-set fixed value, and such as 1%;Default charge value can also be root According to the numerical value that actual conditions determine, such as it is dynamically determined according to the time difference between booting moment and moment of shutting down.
As gauge_soc < restore_soc, and restore_soc!=100, restore_soc-1 conduct may be used New ui_soc only allows electricity to reduce 1, prevent electricity from larger jump occurs.It should be noted that just for written in code Percentage sign (%) is omitted here in benefit.
Step 310 drives determining second contact surface electricity to be the first electricity, execution step 311 by voltameter.
Illustratively, if executing this step after step 305, illustrate that restore_soc ratio gauge_soc is much larger, it may Since unused time long power down is more, need using gauge_soc as new ui_soc.
By voltameter driving corresponding interface electricity file system nodes are written in second contact surface electricity by step 311, are led to It crosses the default finger daemon and reads interface electricity file system nodes, and show the second boundary read in display screen interface Face electricity.
After new ui_soc has been determined, by the node ui_soc of the new ui_soc write-in file system, user's space Healthd read the node after be updated to display screen interface, to realize the purpose of accurate display interface electricity.
Interface electricity provided by the embodiments of the present application determines method, by taking Android operation system as an example, passes through user's space Healthd process realizes detection and the record of the interface electricity before mobile terminal shutdown, after mobile terminal-opening, then passes through Healthd process realizes the reading of interface electricity, and the calculating of interface electricity new after realizing booting is driven by voltameter, final real The accurate display of interface electricity after being now switched on can effectively prevent electricity after mobile terminal-opening that larger jump and full electric feelings occur The situation that restarting under condition causes electricity discontented occurs.
Fig. 6 is a kind of structural block diagram of interface electricity determining device provided by the embodiments of the present application, which can be by software And/or hardware realization, it is typically integrated in mobile terminal, can determine method by execution interface electricity to determine for display Interface electricity.As shown in fig. 6, the device includes:
First interface electricity obtains module 601, for when detecting mobile terminal-opening, obtaining in default memory space First interface electricity of storage, wherein the data stored in the default memory space can be protected in the case where stopping power supply It deposits, first interface electricity includes described mobile terminal the last time stopping the electricity showing in display screen interface before power supply Amount;
First electricity obtains module 602, for obtaining obtain by the voltameter measurement in the mobile terminal first Electricity;
Second contact surface electricity determining module 603, for determining according to first interface electricity and first electricity Second interface electricity, wherein the second contact surface electricity includes being currently used in the electricity shown in the display screen interface.
The interface electricity determining device provided in the embodiment of the present application when detecting mobile terminal-opening, obtains default deposit The the first interface electricity stored in space is stored up, the first electricity obtained by the voltameter measurement in mobile terminal is obtained, according to First interface electricity and the first electricity determine the second contact surface electricity for showing in display screen interface.By using above-mentioned skill Art scheme can obtain the last interface electricity stopped before power supply, then comprehensive current electric quantity in mobile terminal-opening The electricity measured is measured, the interface electricity for being currently used in display is determined, can more accurately determine that mobile terminal is just switched on When interface electricity.
It is optionally, described that second contact surface electricity is determined according to first interface electricity and first electricity, comprising:
The difference for calculating first interface electricity Yu first electricity, obtains the first difference;
When first difference is greater than or equal to preset threshold, second contact surface electricity is determined according to first electricity, Wherein, the preset threshold is positive number;
When first difference is less than the preset threshold, second contact surface electricity is determined according to first interface electricity Amount.
It is optionally, described that second contact surface electricity is determined according to first interface electricity, comprising:
When first electricity is greater than or equal to the first interface electricity, alternatively, when first electricity is less than institute When to state the first interface electricity and first interface electricity be 100%, determine that second contact surface electricity is the first interface electricity;
When first electricity is less than first interface electricity and first interface electricity less than 100%, determine Second contact surface electricity is the difference of first interface electricity and default charge value.
Optionally, the device further include:
First moment logging modle, for the first moment described in record storage when the first interface electricity;
Second moment obtain module, for it is described detect mobile terminal-opening when, obtain the second current moment;
Default charge value determining module, for according to the determination of the time difference at second moment and first moment Default charge value.
Optionally, the device further include:
Interface electric quantity change detection module, for it is described detect mobile terminal-opening before, in the mobile terminal When in operating status, whether detection interface electricity changes;
Interface electricity memory module, for when detecting that interface electricity changes, using current interface electricity as In the storage to the default memory space of one interface electricity.
Optionally, described when detecting that interface electricity changes, using current interface electricity as the first interface electricity It stores in the default memory space, comprising:
When detecting that interface electricity changes, judge whether current boot-mode is user mode;
If so, storing current interface electricity as the first interface electricity into the default memory space.
Optionally, the default memory space includes the reservation persist subregion in built-in multimedia storage card EMMC.
The embodiment of the present application also provides a kind of storage medium comprising computer executable instructions, and the computer is executable Instruction determines method for executing interface electricity when being executed by computer processor, this method comprises:
When detecting mobile terminal-opening, the first interface electricity stored in default memory space is obtained, wherein described pre- If the data stored in memory space can be saved in the case where stopping power supply, first interface electricity includes the movement Terminal the last time stops the electricity showing in display screen interface before power supply;
Obtain the first electricity obtained by the voltameter measurement in the mobile terminal;
Second contact surface electricity is determined according to first interface electricity and first electricity, wherein the second contact surface Electricity includes being currently used in the electricity shown in the display screen interface.
Storage medium --- any various types of memory devices or storage equipment.Term " storage medium " is intended to wrap It includes: install medium, such as CD-ROM, floppy disk or magnetic tape equipment;Computer system memory or random access memory, such as DRAM, DDRRAM, SRAM, EDORAM, blue Bath (Rambus) RAM etc.;Nonvolatile memory, such as flash memory, magnetic medium (example Such as hard disk or optical storage);Register or the memory component of other similar types etc..Storage medium can further include other types Memory or combinations thereof.In addition, storage medium can be located at program in the first computer system being wherein performed, or It can be located in different second computer systems, second computer system is connected to the first meter by network (such as internet) Calculation machine system.Second computer system can provide program instruction to the first computer for executing.Term " storage medium " can To include two or more that may reside in different location (such as in the different computer systems by network connection) Storage medium.Storage medium can store the program instruction that can be performed by one or more processors and (such as be implemented as counting Calculation machine program).
Certainly, a kind of storage medium comprising computer executable instructions, computer provided by the embodiment of the present application The interface electricity that executable instruction is not limited to the described above determines operation, can also be performed provided by the application any embodiment Interface electricity determines the relevant operation in method.
The embodiment of the present application provides a kind of mobile terminal, and boundary provided by the embodiments of the present application can be integrated in the mobile terminal Face electricity determining device.Fig. 7 is a kind of structural schematic diagram of mobile terminal provided by the embodiments of the present application.Mobile terminal 700 can To include: memory 701, processor 702 and it is stored in the computer program that can be run on memory 701 and in processor 702, Realize that the interface electricity as described in the embodiment of the present application determines method when the processor 702 executes the computer program.
Mobile terminal provided by the embodiments of the present application can obtain the last stopping power supply in mobile terminal-opening Interface electricity before, then comprehensive current electric quantity measure the electricity measured, determine the interface electricity for being currently used in display, can be with More accurately determine interface electricity when mobile terminal is just switched on.
Fig. 8 is the structural schematic diagram of another mobile terminal provided by the embodiments of the present application, which may include: Shell (not shown), memory 801, central processing unit (central processing unit, CPU) 802 (are also known as located Manage device, hereinafter referred to as CPU), circuit board (not shown) and power circuit (not shown).The circuit board is placed in institute State the space interior that shell surrounds;The CPU802 and the memory 801 are arranged on the circuit board;The power supply electricity Road, for each circuit or the device power supply for the mobile terminal;The memory 801, for storing executable program generation Code;The CPU802 is run and the executable journey by reading the executable program code stored in the memory 801 The corresponding computer program of sequence code, to perform the steps of
When detecting mobile terminal-opening, the first interface electricity stored in default memory space is obtained, wherein described pre- If the data stored in memory space can be saved in the case where stopping power supply, first interface electricity includes the movement Terminal the last time stops the electricity showing in display screen interface before power supply;
Obtain the first electricity obtained by the voltameter measurement in the mobile terminal;
Second contact surface electricity is determined according to first interface electricity and first electricity, wherein the second contact surface Electricity includes being currently used in the electricity shown in the display screen interface.
The mobile terminal further include: Peripheral Interface 803, RF (Radio Frequency, radio frequency) circuit 805, audio-frequency electric Road 806, loudspeaker 811, power management chip 808, input/output (I/O) subsystem 809, other input/control devicess 810, Touch screen 812, other input/control devicess 810 and outside port 804, these components pass through one or more communication bus Or signal wire 807 communicates.
It should be understood that illustrating the example that mobile terminal 800 is only mobile terminal, and mobile terminal 800 It can have than shown in the drawings more or less component, can combine two or more components, or can be with It is configured with different components.Various parts shown in the drawings can include one or more signal processings and/or dedicated It is realized in the combination of hardware, software or hardware and software including integrated circuit.
Just provided in this embodiment for determining that the mobile terminal of interface electricity is described in detail below, the movement is whole End takes the mobile phone as an example.
Memory 801, the memory 801 can be accessed by CPU802, Peripheral Interface 803 etc., and the memory 801 can It can also include nonvolatile memory to include high-speed random access memory, such as one or more disk memory, Flush memory device or other volatile solid-state parts.
The peripheral hardware that outputs and inputs of equipment can be connected to CPU802 and deposited by Peripheral Interface 803, the Peripheral Interface 803 Reservoir 801.
I/O subsystem 809, the I/O subsystem 809 can be by the input/output peripherals in equipment, such as touch screen 812 With other input/control devicess 810, it is connected to Peripheral Interface 803.I/O subsystem 809 may include 8091 He of display controller For controlling one or more input controllers 8092 of other input/control devicess 810.Wherein, one or more input controls Device 8092 processed receives electric signal from other input/control devicess 810 or sends electric signal to other input/control devicess 810, Other input/control devicess 810 may include physical button (push button, rocker buttons etc.), dial, slide switch, behaviour Vertical pole clicks idler wheel.It is worth noting that input controller 8092 can with it is following any one connect: keyboard, infrared port, The indicating equipment of USB interface and such as mouse.
Touch screen 812, the touch screen 812 are the input interface and output interface between customer mobile terminal and user, Visual output is shown to user, visual output may include figure, text, icon, video etc..
Display controller 8091 in I/O subsystem 809 receives electric signal from touch screen 812 or sends out to touch screen 812 Electric signals.Touch screen 812 detects the contact on touch screen, and the contact that display controller 8091 will test is converted to and is shown The interaction of user interface object on touch screen 812, i.e. realization human-computer interaction, the user interface being shown on touch screen 812 Object can be the icon of running game, the icon for being networked to corresponding network etc..It is worth noting that equipment can also include light Mouse, light mouse are the extensions for the touch sensitive surface for not showing the touch sensitive surface visually exported, or formed by touch screen.
RF circuit 805 is mainly used for establishing the communication of mobile phone Yu wireless network (i.e. network side), realizes mobile phone and wireless network The data receiver of network and transmission.Such as transmitting-receiving short message, Email etc..Specifically, RF circuit 805 receives and sends RF letter Number, RF signal is also referred to as electromagnetic signal, and RF circuit 805 converts electrical signals to electromagnetic signal or electromagnetic signal is converted to telecommunications Number, and communicated by the electromagnetic signal with communication network and other equipment.RF circuit 805 may include for executing The known circuit of these functions comprising but it is not limited to antenna system, RF transceiver, one or more amplifiers, tuner, one A or multiple oscillators, digital signal processor, CODEC (COder-DECoder, coder) chipset, user identifier mould Block (Subscriber Identity Module, SIM) etc..
Voicefrequency circuit 806 is mainly used for receiving audio data from Peripheral Interface 803, which is converted to telecommunications Number, and the electric signal is sent to loudspeaker 811.
Loudspeaker 811 is reduced to sound for mobile phone to be passed through RF circuit 805 from the received voice signal of wireless network And the sound is played to user.
Power management chip 808, the hardware for being connected by CPU802, I/O subsystem and Peripheral Interface are powered And power management.
It is any that the application can be performed in interface electricity determining device, storage medium and the mobile terminal provided in above-described embodiment Interface electricity provided by embodiment determines method, has and executes the corresponding functional module of this method and beneficial effect.Not upper The technical detail of detailed description in embodiment is stated, reference can be made to interface electricity provided by the application any embodiment determines method.
Note that above are only the preferred embodiment and institute's application technology principle of the application.It will be appreciated by those skilled in the art that The application is not limited to specific embodiment described here, be able to carry out for a person skilled in the art it is various it is apparent variation, The protection scope readjusted and substituted without departing from the application.Therefore, although being carried out by above embodiments to the application It is described in further detail, but the application is not limited only to above embodiments, in the case where not departing from the application design, also It may include more other equivalent embodiments, and scope of the present application is determined by the scope of the appended claims.

Claims (10)

1. a kind of interface electricity determines method characterized by comprising
When detecting mobile terminal-opening, the first interface electricity stored in default memory space is obtained, wherein described preset is deposited The data stored in storage space can be saved in the case where stopping power supply, and first interface electricity includes the mobile terminal The last time stops the electricity showing in display screen interface before power supply;
Obtain the first electricity obtained by the voltameter measurement in the mobile terminal;
Second contact surface electricity is determined according to first interface electricity and first electricity, wherein the second contact surface electricity Including being currently used in the electricity shown in the display screen interface.
2. the method according to claim 1, wherein it is described according to first interface electricity and it is described first electricity It measures and determines second contact surface electricity, comprising:
The difference for calculating first interface electricity Yu first electricity, obtains the first difference;
When first difference is greater than or equal to preset threshold, second contact surface electricity is determined according to first electricity, wherein The preset threshold is positive number;
When first difference is less than the preset threshold, second contact surface electricity is determined according to first interface electricity.
3. according to the method described in claim 2, it is characterized in that, described determine second contact surface according to first interface electricity Electricity, comprising:
When first electricity is greater than or equal to the first interface electricity, alternatively, when first electricity is less than described the When one interface electricity and first interface electricity are 100%, determine that second contact surface electricity is the first interface electricity;
When first electricity is less than first interface electricity and first interface electricity less than 100%, second is determined Interface electricity is the difference of first interface electricity and default charge value.
4. according to the method described in claim 3, it is characterized by further comprising:
The first moment described in record storage when the first interface electricity;
It is described detect mobile terminal-opening when, obtain the second current moment;
The default charge value is determined according to the time difference at second moment and first moment.
5. method according to claim 1 to 4, which is characterized in that it is described detect mobile terminal-opening before, Further include:
When the mobile terminal is in operating status, whether detection interface electricity changes;
If changing, store current interface electricity as the first interface electricity into the default memory space.
6. according to the method described in claim 5, it is characterized in that, if described change, using current interface electricity as In the storage to the default memory space of first interface electricity, comprising:
If changing, judge whether current boot-mode is user mode;
If so, storing current interface electricity as the first interface electricity into the default memory space.
7. the method according to claim 1, wherein the default memory space includes built-in multimedia storage Block the reservation persist subregion in EMMC.
8. a kind of interface electricity determining device characterized by comprising
First interface electricity obtains module, for when detecting mobile terminal-opening, obtaining storage in default memory space First interface electricity, wherein the data stored in the default memory space can be saved in the case where stopping power supply, described First interface electricity includes described mobile terminal the last time stopping the electricity showing in display screen interface before power supply;
First electricity obtains module, for obtaining the first electricity obtained by the voltameter measurement in the mobile terminal;
Second contact surface electricity determining module, for determining second contact surface electricity according to first interface electricity and first electricity Amount, wherein the second contact surface electricity includes being currently used in the electricity shown in the display screen interface.
9. a kind of computer readable storage medium, is stored thereon with computer program, which is characterized in that the program is held by processor Realize that the interface electricity as described in any in claim 1-7 determines method when row.
10. a kind of mobile terminal, which is characterized in that including memory, processor and storage are on a memory and can be in processor The computer program of operation, the processor realize boundary as claimed in claim 1 when executing the computer program Face electricity determines method.
CN201811123361.XA 2018-09-26 2018-09-26 Interface electricity determines method, apparatus, storage medium and mobile terminal Pending CN109040467A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811123361.XA CN109040467A (en) 2018-09-26 2018-09-26 Interface electricity determines method, apparatus, storage medium and mobile terminal

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811123361.XA CN109040467A (en) 2018-09-26 2018-09-26 Interface electricity determines method, apparatus, storage medium and mobile terminal

Publications (1)

Publication Number Publication Date
CN109040467A true CN109040467A (en) 2018-12-18

Family

ID=64618042

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811123361.XA Pending CN109040467A (en) 2018-09-26 2018-09-26 Interface electricity determines method, apparatus, storage medium and mobile terminal

Country Status (1)

Country Link
CN (1) CN109040467A (en)

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110213811A (en) * 2019-05-14 2019-09-06 惠州Tcl移动通信有限公司 Mobile terminal shutdown electricity control processing method, mobile terminal and storage medium
CN110650394A (en) * 2019-08-30 2020-01-03 广东思派康电子科技有限公司 Method for establishing corresponding relation between earphone battery electric quantity percentage interval and charging time, computer readable storage medium and wireless earphone
CN111836347A (en) * 2020-06-16 2020-10-27 厦门汉印电子技术有限公司 Electric quantity display method, device and equipment and readable storage medium
CN113232552A (en) * 2021-05-20 2021-08-10 中国第一汽车股份有限公司 Electric vehicle and calculation method, display method and device of residual electric quantity of electric vehicle
CN113452114A (en) * 2021-06-09 2021-09-28 厦门紫光展锐科技有限公司 Electric quantity distribution method and device
CN114047449A (en) * 2021-11-16 2022-02-15 深圳市广和通无线股份有限公司 Battery power display method and device, electronic equipment and storage medium
WO2023109300A1 (en) * 2021-12-17 2023-06-22 深圳市百富智能新技术有限公司 Battery level calibration method, electronic device, and storage medium
CN116298958A (en) * 2023-05-25 2023-06-23 深圳华一精品科技有限公司 Notebook battery electric quantity monitoring method based on calibration of using state

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
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
CN103685706A (en) * 2012-09-21 2014-03-26 中兴通讯股份有限公司 Method for correcting electric quantity of mobile terminal and mobile terminal
CN103761179A (en) * 2014-01-28 2014-04-30 广东欧珀移动通信有限公司 Method and system for displaying electric quantity left after terminal restart
CN106603861A (en) * 2016-12-30 2017-04-26 广东欧珀移动通信有限公司 Electric quantity display method and device, and terminal

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103685706A (en) * 2012-09-21 2014-03-26 中兴通讯股份有限公司 Method for correcting electric quantity of mobile terminal and mobile terminal
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
CN103761179A (en) * 2014-01-28 2014-04-30 广东欧珀移动通信有限公司 Method and system for displaying electric quantity left after terminal restart
CN106603861A (en) * 2016-12-30 2017-04-26 广东欧珀移动通信有限公司 Electric quantity display method and device, and terminal

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110213811A (en) * 2019-05-14 2019-09-06 惠州Tcl移动通信有限公司 Mobile terminal shutdown electricity control processing method, mobile terminal and storage medium
CN110650394A (en) * 2019-08-30 2020-01-03 广东思派康电子科技有限公司 Method for establishing corresponding relation between earphone battery electric quantity percentage interval and charging time, computer readable storage medium and wireless earphone
CN111836347A (en) * 2020-06-16 2020-10-27 厦门汉印电子技术有限公司 Electric quantity display method, device and equipment and readable storage medium
CN113232552A (en) * 2021-05-20 2021-08-10 中国第一汽车股份有限公司 Electric vehicle and calculation method, display method and device of residual electric quantity of electric vehicle
CN113452114A (en) * 2021-06-09 2021-09-28 厦门紫光展锐科技有限公司 Electric quantity distribution method and device
CN114047449A (en) * 2021-11-16 2022-02-15 深圳市广和通无线股份有限公司 Battery power display method and device, electronic equipment and storage medium
WO2023109300A1 (en) * 2021-12-17 2023-06-22 深圳市百富智能新技术有限公司 Battery level calibration method, electronic device, and storage medium
CN116298958A (en) * 2023-05-25 2023-06-23 深圳华一精品科技有限公司 Notebook battery electric quantity monitoring method based on calibration of using state

Similar Documents

Publication Publication Date Title
CN109040467A (en) Interface electricity determines method, apparatus, storage medium and mobile terminal
CN108475935B (en) Battery charging management method and terminal
US9785428B2 (en) Internal software updating method and system
KR101477179B1 (en) Method And Mobile Terminal For Determining and Displaying Power Efficiency of Application
US6429625B1 (en) Method and apparatus for indicating battery charge status
CN106772091B (en) Method and device for updating battery capacity value and terminal
US5714870A (en) Method for measuring suspend-time power consumption in a battery-powered electronic device
US8990038B2 (en) Method and apparatus for monitoring battery life
US20130132759A1 (en) Computer component power-consumption database
CN103455126A (en) Method and client device for determining residual service life of battery and mobile terminal
US20140067293A1 (en) Power sub-state monitoring
KR20180101930A (en) Electronic Apparatus for checking battery abnormality and the Control method thereof
CN104503565A (en) Power consumption management method and device for mobile device and mobile device
US10705585B2 (en) Battery charge leakage monitor
CN111052040A (en) Method for reducing power consumption of terminal and terminal
JP4846829B2 (en) Information processing apparatus and battery deterioration detection method
CN110225167B (en) Terminal and processing method
CN107843844A (en) A kind of method, terminal and computer-readable recording medium for calibrating charge value
WO2023109300A1 (en) Battery level calibration method, electronic device, and storage medium
CN103460063A (en) Battery voltage measurement
CN111836347A (en) Electric quantity display method, device and equipment and readable storage medium
CN103837835A (en) Method and device for detecting capacity decreasing degree of mobile device battery
CN107357620A (en) A kind of method of adjustment of application program, device, mobile terminal and storage medium
US10963359B2 (en) Battery management unit based runtime monitoring of power consumption
CN113156319B (en) Residual electric quantity determining method, device, vehicle, medium and program product

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

Application publication date: 20181218

RJ01 Rejection of invention patent application after publication