CN104281513A - Application power consumption detection method and system - Google Patents

Application power consumption detection method and system Download PDF

Info

Publication number
CN104281513A
CN104281513A CN201310282738.7A CN201310282738A CN104281513A CN 104281513 A CN104281513 A CN 104281513A CN 201310282738 A CN201310282738 A CN 201310282738A CN 104281513 A CN104281513 A CN 104281513A
Authority
CN
China
Prior art keywords
power consumption
application
time
foreground application
time interval
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.)
Granted
Application number
CN201310282738.7A
Other languages
Chinese (zh)
Other versions
CN104281513B (en
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.)
Beijing Kingsoft Internet Security Software Co Ltd
Conew Network Technology Beijing Co Ltd
Shell Internet Beijing Security Technology Co Ltd
Zhuhai Juntian Electronic Technology Co Ltd
Beijing Kingsoft Internet Science and Technology Co Ltd
Original Assignee
Beijing Kingsoft Internet Security Software Co Ltd
Conew Network Technology Beijing Co Ltd
Shell Internet Beijing Security Technology Co Ltd
Zhuhai Juntian Electronic Technology Co Ltd
Beijing Kingsoft Internet Science and Technology Co 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 Beijing Kingsoft Internet Security Software Co Ltd, Conew Network Technology Beijing Co Ltd, Shell Internet Beijing Security Technology Co Ltd, Zhuhai Juntian Electronic Technology Co Ltd, Beijing Kingsoft Internet Science and Technology Co Ltd filed Critical Beijing Kingsoft Internet Security Software Co Ltd
Priority to CN201310282738.7A priority Critical patent/CN104281513B/en
Publication of CN104281513A publication Critical patent/CN104281513A/en
Application granted granted Critical
Publication of CN104281513B publication Critical patent/CN104281513B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Charge And Discharge Circuits For Batteries Or The Like (AREA)
  • Power Sources (AREA)

Abstract

The invention discloses a method and a system for detecting power consumption of an application program1And closing time t4Then, according to the equal amount preset electric quantity and the starting time t1And closing time t4And determining the power consumption Q of the foreground application at the position of the coordinate axis formed by the time interval. By the method and the system, the user can know the power consumption situation of each application program in the foreground in real time, the application with less power consumption can be selected and used as required, and the service time of the battery power is prolonged. In addition, the power consumption is calculated by detecting the time for consuming the equivalent power and the starting and closing time of the foreground application, the consumed power is distributed according to the time, the power consumption in each application unit time is prevented from being averaged, and the power consumption detection precision is improved.

Description

A kind of application program power consumption detection method and system
Technical field
The present invention relates to power consumption detection technique field, be specifically related to a kind of application program power consumption detection method and system.
Background technology
Due to the convenience of mobile device, increasing user likes using mobile device to replace PC to carry out operating (as surf the web webpage or play games), the thing followed is that increasing application is mounted on the mobile apparatus, correspondingly, applying more power consumption more is also the problem of the most headache of user.At present mobile electronic device used on the market all has battery dump energy Presentation Function, but user do not know the power consumption condition of each application on the mobile apparatus, and user can not from the less application of main separation power consumption.
Existing detection application power consumption technology can only be completed by hardware, namely runs the application of certain money on the mobile apparatus, and on equipment, loads power consumption checkout equipment.This equipment can show mobile device electric quantity consumption situation in real time.This kind of mode can accurately detect certain money be applied in the lower consumes power of certain operation number.But the program needs expensive power consumption checkout equipment, and needs tester to have certain physics knowledge, cannot popularize domestic consumer.The operating system had at present also has the function of checking that power consumption is ranked, and can check that each applies the number percent of relative power consumption, but not have the numerical value of concrete power consumption, and its account form does not meet user's expection yet, causes this function cannot by users to trust.
Summary of the invention
For the defect existed in prior art, the method and system that the object of the present invention is to provide a kind of application program power consumption to detect, can determine the power consumption of each application program by the method.
For achieving the above object, the technical solution used in the present invention is as follows:
A kind of application program power consumption detection method, comprises the following steps:
The also record move equipment that obtains often consumes single-candidate and presets electricity time interval used;
The Startup time t of monitoring foreground application 1with close moment t 4;
Electricity, described Startup time t is preset according to described single-candidate 1with close moment t 4the position of the coordinate axis that the described time interval be positioned at is formed, determines the power consumption Q of described foreground application.
Further, application program power consumption detection method as above, describedly presets electricity, described Startup time t according to described single-candidate 1with close moment t 4the position of the coordinate axis that the described time interval be positioned at is formed, determine the power consumption Q of described foreground application, comprising:
Obtain described Startup time t 1with close moment t 4the number n of the complete time interval crossed over;
Preset quantitatively and the value of the number n of the complete time interval crossed over according to described single-candidate, calculate the power consumption Q of described foreground application.
Further, application program power consumption detection method as above, the formula of the power consumption Q of the described foreground application of described calculating is:
The power consumption Q=(n+1 of foreground application) × q,
Wherein, q is that described single-candidate presets electricity.
Further, application program power consumption detection method as above, describedly presets electricity, described Startup time t according to described single-candidate 1with close moment t 4the position of the coordinate axis that the described time interval be positioned at is formed, determine the power consumption Q of described foreground application, comprising:
Carve t upon start up 1with close moment t 4when being in interval at the same time, the power consumption Q=(t of foreground application 4-t 1)/(t 3-t 2)] × q,
Wherein, t 2represent the initial time of the time interval at foreground application Startup time place, t 3represent the end time of the time interval at foreground application Startup time place, q is that described single-candidate presets electricity.
Further, application program power consumption detection method as above, describedly presets electricity, described Startup time t according to described single-candidate 1with close moment t 4the position of the coordinate axis that the described time interval be positioned at is formed, determine the power consumption Q of described foreground application, comprising:
Carve t upon start up 1with close moment t 4when being in different time intervals, power consumption the Q=[(t of foreground application 3-t 1)/(t 3-t 2)+n+ (t 4-t 5)/(t 6-t 5)] × q;
Wherein, t 2represent the initial time of the time interval at foreground application Startup time place, t 3represent the end time of the time interval at foreground application Startup time place, t 5represent the initial time of the time interval at foreground application close moment place, t 6represent the end time of time interval at foreground application close moment place, the number of the complete time interval that the coordinate axis that n is formed at time interval for foreground application is crossed over, q is that described single-candidate presets electricity.
Further, application program power consumption detection method as above, is characterized in that, it is the number percent a% taking mobile device battery total capacity that described single-candidate presets electricity, wherein, and 0<a≤50.
Further, application program power consumption detection method as above, it is the single-candidate charge value q consumed that described single-candidate presets electricity 1, wherein, 0<q 1≤ battery total capacity.
Further, application program power consumption detection method as above, when the number of the background application of mobile device is greater than setting threshold value, described method also comprises:
A. all background application are closed, the power consumption Q of record foreground application in setting-up time before;
B. keep the mobile device running status identical with during all background application of described closedown, open the background application of setting quantitative range, record foreground application and the background application total power consumption Q at setting-up time always;
C. the power consumption calculating the background application of setting quantitative range accounts for the number percent of total power consumption, and computing formula is (Q always-q before)/Q always;
D. judge to calculate the number of times that the power consumption of background application accounts for the number percent of total power consumption and whether reach setting value, if then enter next step, then return step a if not, repeat step a ~ c;
E. the power consumption of the background application repeatedly calculated is accounted for the mean value of the number percent of total power consumption, account for the end value p of total power consumption number percent as background application;
F. the accurate power consumption Q of foreground application is calculated according to the power consumption Q of foreground application and described end value p essence, computing formula is: Q essence=Q(1-p).
A kind of application program power consumption detection system, comprising:
Time interval logging modle, for obtain and record move equipment often consumes single-candidate and presets electricity time interval used;
Foreground application monitoring module, for monitoring the Startup time t of foreground application 1with close moment t 4;
Power consumption determination module, for presetting electricity, described Startup time t according to described single-candidate 1with close moment t 4the position of the coordinate axis that the described time interval be positioned at is formed, determines the power consumption Q of described foreground application.
Further, application program power consumption detection system as above, described power consumption determination module comprises:
Cross over interval number acquiring unit, for obtaining the Startup time t of described foreground application 1with close moment t 4the number n of the complete time interval crossed over;
Power consumption computing unit, for presetting according to described single-candidate quantitatively and the value of the number n of the complete time interval crossed over, calculates the power consumption Q of described foreground application.
Further, application program power consumption detection system as above, the formula that power consumption computing unit calculates the power consumption Q of foreground application is:
The power consumption Q=(n+1 of foreground application) × q,
Wherein, q is that single-candidate presets electricity.
Further, application program power consumption detection system as above, as the Startup time t of described foreground application 1with close moment t 4when being in interval at the same time, the formula that described power consumption determination module calculates the power consumption Q of foreground application is:
Power consumption Q=(the t of foreground application 4-t 1)/(t 3-t 2)] × q,
Wherein, t 2represent the initial time of the time interval at foreground application Startup time place, t 3represent the end time of the time interval at foreground application Startup time place, q is that single-candidate presets electricity.
Further, application program power consumption detection system as above, carves t upon start up 1with close moment t 4when being in different time intervals, the formula that described power consumption determination module calculates the power consumption Q of foreground application is:
Power consumption the Q=[(t of foreground application 3-t 1)/(t 3-t 2)+n+ (t 4-t 5)/(t 6-t 5)] × q;
Wherein, t 2represent the initial time of the time interval at foreground application Startup time place, t 3represent the end time of the time interval at foreground application Startup time place, t 5represent the initial time of the time interval at foreground application close moment place, t 6represent the end time of time interval at foreground application close moment place, the number of the complete time interval that the coordinate axis that n is formed at time interval for foreground application is crossed over, q is that single-candidate presets electricity.
Further, application program power consumption detection system as above, when the number of the background application of mobile device is greater than setting threshold value, this system also comprises:
Accurate power consumption determination module, for the accurate power consumption of the power consumption determination foreground application according to described foreground application.
Further, application program power consumption detection system as above, described accurate power consumption determination module comprises:
Foreground application power consumption test cell, for when closing all background application, the power consumption Q of record foreground application in setting-up time before;
Total power consumption test cell, for when keeping identical with during all background application of described closedown mobile device running status, opens the background application of setting quantitative range, records foreground application and the background application total power consumption Q at setting-up time always;
Backstage power consumption percentage calculation unit, the power consumption for the background application calculating setting quantitative range accounts for the number percent of total power consumption, and computing formula is (Q always-q before)/Q always;
Calculation times judging unit, for checking that whether calculate the number of times that the power consumption of background application accounts for the number percent of total power consumption reaches setting value, if then enter end value computing unit, then returns foreground application power consumption test cell if not;
End value computing unit, account for the end value p of total power consumption number percent for calculating background application, account form is: the mean value power consumption of the background application repeatedly calculated being accounted for the number percent of total power consumption accounts for the end value p of total power consumption number percent as background application;
Accurate power consumption computing unit, for calculating the accurate power consumption Q of foreground application according to the power consumption Q of foreground application and described end value p essence, computing formula is: Q essence=Q(1-p)
Beneficial effect of the present invention is: method and system of the present invention, by detecting the situation of battery power consumption, the power consumption of each application program can be determined, user is enable to understand the power consumption condition of each application program at front stage operation in real time, the application that the power consumption of choice for use as required that can be autonomous is less, extends the service time of battery electric quantity.
Accompanying drawing explanation
Fig. 1 is the structured flowchart of a kind of application program power consumption detection system in the specific embodiment of the invention;
Fig. 2 is the structured flowchart of a kind of application program power consumption detection system when considering background application power consumption in the specific embodiment of the invention;
A kind of process flow diagram of application program power consumption detection method in Fig. 3 specific embodiment of the invention;
Fig. 4 is the process flow diagram calculating the accurate power consumption of foreground application in the specific embodiment of the invention;
The corresponding relation schematic diagram in dump energy number percent and moment in Fig. 5 embodiment;
Fig. 6 is schematic diagram working time of foreground application in embodiment.
Embodiment
Below in conjunction with Figure of description and embodiment, the present invention is described in further detail.
The main thought of a kind of application program power consumption detection method of the present invention and system is: often consume single-candidate by record move equipment and preset electricity time interval used, build the coordinate axis of the time interval consuming single-candidate electricity, and according to the position of the Startup time of foreground application and the time interval coordinate axis at close moment place, determine the power consumption of foreground application.By the method and system of detection application program power consumption provided by the invention, user can understand the power consumption of each application program at front stage operation in real time, can the less application of independently choice for use power consumption.
Fig. 1 shows the structured flowchart of a kind of application program power consumption detection system in this embodiment, and as can be seen from Figure, this system mainly comprises time interval logging modle 11, foreground application monitoring module 12 and power consumption determination module 13.
Time interval logging modle 11 is for obtain and record move equipment often consumes single-candidate and presets electricity time interval used;
Foreground application monitoring module 12 is for monitoring the Startup time t of foreground application 1with close moment t 4;
Power consumption determination module 13 is for presetting electricity, described Startup time t according to described single-candidate 1with close moment t 4the position of the coordinate axis that the described time interval be positioned at is formed, determines the power consumption Q of described foreground application.
Wherein, power consumption determination module 13 comprises crosses over interval number acquiring unit and power consumption computing unit, crosses over interval number acquiring unit for obtaining the Startup time t of described foreground application 1with close moment t 4the number n of the complete time interval crossed over;
Power consumption computing unit is used for presetting quantitatively and the value of the number n of the complete time interval crossed over according to described single-candidate, and calculate the power consumption Q of described foreground application, computing formula is:
The power consumption Q=(n+1 of foreground application) × q,
Wherein, q is that single-candidate presets electricity.
As the Startup time t of described foreground application 1with close moment t 4when being in interval at the same time, i.e. the Startup time t of foreground application 1with close moment t 4when the number of the complete time interval crossed over is zero, the formula that power consumption determination module calculates the power consumption Q of foreground application is:
Power consumption Q=(the t of foreground application 4-t 1)/(t 3-t 2)] × q,
Wherein, t 2represent the initial time of the time interval at foreground application Startup time place, t 3represent the end time of the time interval at foreground application Startup time place, q is that single-candidate presets electricity.
Carve t upon start up 1with close moment t 4when being in different time intervals, the formula that power consumption determination module calculates the power consumption Q of foreground application is:
Power consumption the Q=[(t of foreground application 3-t 1)/(t 3-t 2)+n+ (t 4-t 5)/(t 6-t 5)] × q;
Wherein, t 2represent the initial time of the time interval at foreground application Startup time place, t 3represent the end time of the time interval at foreground application Startup time place, t 5represent the initial time of the time interval at foreground application close moment place, t 6represent the end time of time interval at foreground application close moment place, the number of the complete time interval that the coordinate axis that n is formed at time interval for foreground application is crossed over, q is that single-candidate presets electricity.
Described foreground application, namely current operation, program that user can see and operate, background application is that user can't see but the program run.Although the power consumption of background application is very little compared with foreground application, but when the application of running background is more, the proportion that the electricity of background application consumption accounts for total power consumption is still larger, therefore in order to improve the precision of the power consumption detecting each foreground application, a threshold value (as 3-5) can be set, when the number of the application of running background is greater than threshold value time, consider the power consumption of the application of running background, the power consumption of background application can not be considered when the number of the application of running background is less than threshold value time.
Fig. 2 shows when considering the power consumption of background application, a kind of structured flowchart of application program power consumption detection system in present embodiment, as can be seen from Figure, this system is except comprising time interval logging modle 11, foreground application monitoring module 12 and power consumption determination module 13, also comprise the accurate power consumption determination module 14 of the accurate power consumption for the power consumption determination foreground application according to described foreground application, this module comprises foreground application power consumption test cell 141, total power consumption test cell 142, backstage power consumption percentage calculation unit 143, calculation times judging unit 144, end value computing unit 145 and accurate power consumption computing unit 146, wherein,
Foreground application power consumption test cell 141, for when closing all background application, records the power consumption Q of foreground application in setting-up time before;
Total power consumption test cell 142, for when keeping identical with during all background application of described closedown mobile device running status, opens the background application of setting quantitative range, records foreground application and the background application total power consumption Q at setting-up time always;
Backstage power consumption percentage calculation unit 143 accounts for the number percent of total power consumption for the power consumption calculating the background application setting quantitative range, and computing formula is (Q always-q before)/Q always;
Calculation times judging unit 144 is for checking that whether calculate the number of times that the power consumption of background application accounts for the number percent of total power consumption reaches setting value, if then enter end value computing unit, then returns foreground application power consumption test cell if not;
End value computing unit 145 accounts for the end value p of total power consumption number percent for calculating background application, account form is: the mean value power consumption of the background application repeatedly calculated being accounted for the number percent of total power consumption accounts for the end value p of total power consumption number percent as background application;
Accurate power consumption computing unit 146 is for calculating the accurate power consumption Q of foreground application according to the power consumption Q of foreground application and described end value p essence, computing formula is: Q essence=Q(1-p).
In order to realize object of the present invention, a kind of detection method of a kind of application program power consumption based on system shown in Fig. 1 is additionally provided in present embodiment, Fig. 3 shows the process flow diagram of a kind of application program power consumption detection method in this embodiment, and the method mainly comprises the following steps:
Step S21: record move equipment often consumes the time interval that single-candidate presets electricity;
The situation of change of monitoring mobile device battery electric quantity, the also record move equipment that obtains often consumes single-candidate and presets the quantitative moment, battery capacity value is divided into multiple time interval, the power consumption of the mobile device after dividing corresponding to each time interval is identical, and power consumption is that single-candidate presets electricity.
Each time interval has an initial time and end time, i.e. moment of terminating of moment (start time in current time interval) of terminating of previous time interval and current time interval.
Consider the flash-over characteristic of battery, battery discharge is not Uniform Discharge, and the speed of that is application program power consumption in the process run not is equal, and the time therefore consuming single-candidate electricity used is probably different.The situation of change of monitoring battery electric quantity, single-candidate is preset electricity and can be represented with the number percent taking mobile device battery total capacity, such as a%, wherein, 0<a≤50, if the value of a is 1, electricity record time interval of every consuming cells total volume 1%; Single-candidate is preset and quantitatively also can be represented with the single-candidate charge value consumed, and such as single-candidate charge value is q 1, 0<q 1≤ battery total capacity, if q 1when value is 20mAh, often consume electricity record time interval of 20mAh.
Such as, the battery capacity of the mobile phone of an Android system is 2000mAh, beginning timing is established by cable from being full of, 40 minutes post consumptions 1% of battery capacity, namely consume the electricity of 20mAh, dump energy is 99% of battery capacity, 1% is consumed again after 30 minutes, 1% is consumed again after 20 minutes, 1%...... is consumed again after 30 minutes, as shown in Figure 5, first time interval is the time period (electricity is depleted to the interval at 99% place by 100%) of 0-40 minute, the time period (electricity is depleted to the interval at 98% place by 99%) that second single-candidate interval is 40-70 minute.Represent that the single-candidate of consumption presets electricity by the form of number percent (a%) in the present embodiment.
After battery capacity value being divided into the multiple time intervals often consuming and preset quota electricity, multiple time interval forms the coordinate axis of a time interval, as shown in Figure 5.
Step S22: the Startup time of monitoring mobile device foreground application and close moment;
Monitor the Startup time t of each foreground application 1with close moment t 4monitoring concrete grammar is: (as 1-30S) once monitors at set intervals, can system API(application programming interfaces be passed through) obtain current Activity storehouse, and obtain the application of storehouse stack top, the application being positioned at storehouse stack top is foreground application.Contrast with the foreground application to obtain before after obtaining, if the application that obtains of current monitoring moment is with previous to monitor the application that the moment obtains different, then currently monitor the end time that the moment is previous foreground application, be the start time applied below simultaneously.As shown in Figure 6, application A brings into operation from during 0s, and become B to foreground application when the 3rd second, then think that A has run 3S, when the 4th second, foreground application becomes C, then B has run 1S.As shown in Figure 5, foreground application D at front stage operation, terminates front stage operation to 110min from when 20min, that is the initial time t of foreground application D 1for this moment of 20min, finish time is this moment of 110min, and this foreground application is the 90min at front stage operation altogether.
Step S23: the power consumption Q calculating foreground application.
The Startup time t of electricity and foreground application is preset according to the single-candidate described in step S21 1with close moment t 4the position of the coordinate axis of the time interval formation at place, determines the power consumption of described foreground application.
Wherein, electricity, Startup time t is preset according to single-candidate 1with close moment t 4the position of the coordinate axis that the described time interval be positioned at is formed, determine the power consumption Q of described foreground application, comprising:
I. the Startup time t of foreground application is obtained 1with close moment t 4the number n of the complete time interval crossed over;
Ii. preset quantitatively and the value of the number n of the complete time interval crossed over according to described single-candidate, calculate the power consumption Q of foreground application, the formula calculating the power consumption Q of described foreground application is:
The power consumption Q=(n+1 of foreground application) × q, wherein, q is that single-candidate presets electricity.
As the Startup time t of foreground application 1with close moment t 4be in interval at the same time, i.e. the Startup time t of foreground application 1with close moment t 4when the number of the complete time interval crossed over is zero, the formula that power consumption determination module calculates the power consumption Q of foreground application is:
Power consumption Q=(the t of foreground application 4-t 1)/(t 3-t 2)] × q,
Wherein, t 2represent the initial time of the time interval at foreground application Startup time place, t 3represent the end time of the time interval at foreground application Startup time place, q is that single-candidate presets electricity.
Carve t upon start up 1with close moment t 4when being in different time intervals, the formula that power consumption determination module calculates the power consumption Q of foreground application is:
Power consumption the Q=[(t of foreground application 3-t 1)/(t 3-t 2)+n+ (t 4-t 5)/(t 6-t 5)] × q;
Wherein, t 2represent the initial time of the time interval at foreground application Startup time place, t 3represent the end time of the time interval at foreground application Startup time place, t 5represent the initial time of the time interval at foreground application close moment place, t 6represent the end time of time interval at foreground application close moment place, the number of the complete time interval that the coordinate axis that n is formed at time interval for foreground application is crossed over, q is that single-candidate presets electricity.
For the foreground application D in Fig. 5, foreground application D within the 90min time period of front stage operation, span the time interval that two (second and the 3rd) is complete, this application D started (t in the 20th minute 1=20), the 110th minute time terminate front stage operation (t 4=110), suppose that the total volume of battery is 2000mAh, single-candidate preset that electricity is battery total capacity 1%, the electricity that so this application D consumes in front stage operation process is:
The power consumption Q of foreground application D d=[(t 3-t 1)/(t 3-t 2)+n+ (t 4-t 5)/(t 6-t 5)] × q=[(40-20)/(40-0)+2+ (110-90)/(120-90)] × 1% × 2000=63.4mAh.
Due to foreground application start time, the electricity of its Startup time mobile device may be full of electricity, also may not be full of electricity, if be full of the state of electricity and electricity is 100%, can determine that foreground application starts the single-candidate at place easily according to the time interval divided in step S21 interval; If when foreground application starts, the electricity of equipment is discontented state, the electricity of mobile device when also needing to monitor and record the startup of this foreground application, determines the time interval at foreground application Startup time place according to this electricity.Determine according to the electricity of mobile device Startup time in present embodiment that the mode in the single-candidate interval at Startup time place is: the single-candidate that first time interval entered when Startup time electricity consumes again is designated as foreground application Startup time place is interval.
Such as, when a certain foreground application starts in the present embodiment, the electricity monitoring equipment is 98%, when determining that the single-candidate at foreground application Startup time place is interval, due to when foreground application starts 98% electricity uncertain be just fallen 98% by 99%, or be about to fall 97% by 98%, when adopting above-mentioned side to determine formula, according to the time interval that step S21 divides, for the situation of Startup time electricity 98%, when the electricity of 98% consumes again, its first time interval entered is the time interval at 97%-96% place, so, the time interval at the Startup time place of this foreground application is a single-candidate interval, the 3rd shown in Fig. 5.After the time interval determining Startup time place, power consumption can be confirmed according to divided time interval and aforesaid way.
Certainly, after the power consumption calculating a foreground application, also can estimate the electricity of foreground application at unit interval internal consumption, total electricity of a period of time internal consumption is the electricity of unit interval internal consumption, i.e. foreground application unit interval power consumption Q'=Q/(t divided by the time run 4-t 1).
Because the power consumption of background application is little compared with the power consumption of foreground application, the power consumption of background application therefore can not be considered when the application of running background is few.When above-mentioned steps S21 ~ step S23 is and does not consider background application power consumption, detect the method for each foreground application power consumption.But when the application of running background is more, the proportion that the electricity consumed accounts for total power consumption is still larger, therefore in order to improve the precision of the power consumption detecting each foreground application, a setting threshold value (as 3-5) can be set, when the number of the application of running background is greater than setting threshold value time, consider the power consumption of the application of running background, the power consumption of background application can not be considered when the number of the application of running background is less than or equal to threshold value time.
When considering the power consumption of background application, a kind of application program power consumption detection method described in present embodiment also comprises the step calculating the accurate power consumption of foreground application according to the power consumption of described foreground application, and this accurate power consumption refers to that the number when the background application of mobile device is greater than the power consumption of foreground application when setting threshold value.
The method of monitoring running background time (Startup time and the closedown of background application) can be identical with the method for monitoring front stage operation time, namely can obtain current Activity storehouse by system API at set intervals, the application except being positioned at storehouse stack top is background application.Due in time being applied in running background, its power consumption is very low, so cannot directly test.Give in present embodiment and a kind ofly mode by experiment can measure the mode that background application power consumption accounts for total power consumption number percent, its process flow diagram as shown in Figure 4:
A. first, all background application of mobile device are closed, the power consumption Q of record foreground application in setting-up time before;
B. keep the mobile device running status identical with during all background application of described closedown, open the background application of setting quantitative range, record foreground application and the background application total power consumption Q at setting-up time always.Wherein, identical mobile device running status refers to identical with the running status of equipment in step a, and the charge condition foreground application that is identical, that run comprising battery is mutually equal.Background application in setting quantitative range refers to and divides certain interval to the number of background application, and as shown in table 1,1-5 background application is an interval range, and 6-10 is an interval range.
C. the power consumption calculating the background application of setting quantitative range accounts for the number percent of total power consumption, and computing formula is (Q always-q before)/Q always;
D. judge to calculate the number of times that the power consumption of background application accounts for the number percent of total power consumption and whether reach setting value, if then enter next step, then return step a if not, repeat step a ~ c;
E. the power consumption of the background application repeatedly calculated is accounted for the mean value of the number percent of total power consumption, account for the end value p of total power consumption number percent as background application;
F. the accurate power consumption Q of foreground application is calculated according to the power consumption Q of foreground application and described end value p essence, computing formula is: Q essence=Q(1-p).
Table 1
Step a ~ f is by repeatedly testing the number that can obtain the application of running background and the corresponding relation accounting for the number percent of total power consumption (total power consumption of foreground application and background application) at the power consumption of the application of running background, as shown by the results in tablei, the number percent that the power consumption of 1-5 background application accounts for total power consumption is the number percent that the power consumption of 5%, 6-10 background application accounts for total power consumption is 10%.
Application D as shown in Figure 5 is in the process of front stage operation, if backstage also has 6 to apply simultaneously in operation, so the accurate power consumption of foreground application D in operational process is:
Q d essence=Q d=63.4mAh-10% × 63.4mAh=56.06mAh.
It should be noted that, just schematically, the size of concrete data needs experimentally to measure the data in the specific embodiment of the invention, and it is not only relevant with the model of battery and mobile device, also relevant with the service time of battery and mobile device.
The method of detection application program power consumption provided by the present invention, the problem that user cannot obtain the power consumption of each application can be solved, user can autonomous which application program of choice for use by the power consumption condition understanding each application, like this can by the service time of the management prolongation battery electric quantity of user.As, Fetion, QQ and micro-letter all have the function of chat, when user needs to use chat tool chat, when there is no charger especially at one's side, can unload or close the larger chat tool of power consumption, and the chat tool selecting power consumption few, so just can extend the service time of battery electric quantity.
The flash-over characteristic of battery is considered in the application program power consumption detection method that the present embodiment provides, because battery discharge is not Uniform Discharge, the speed being namely applied in power consumption in the process of operation is not equal, by detecting the startup that consumes equal electricity time used and be applied in front stage operation and the shut-in time calculates power consumption, by the electricity of consumption according to time devided modulation, can avoid averaging power consumption condition in each application units' time, improve the precision detecting application power consumption.
Obviously, those skilled in the art can carry out various change and modification to the present invention and not depart from the spirit and scope of the present invention.Like this, if these amendments of the present invention and modification belong within the scope of the claims in the present invention and equivalent technology thereof, then the present invention is also intended to comprise these change and modification.

Claims (15)

1. an application program power consumption detection method, is characterized in that, the method comprises the following steps:
The also record move equipment that obtains often consumes single-candidate and presets electricity time interval used;
The Startup time t of monitoring foreground application 1with close moment t 4;
Electricity, described Startup time t is preset according to described single-candidate 1with close moment t 4the position of the coordinate axis that the described time interval be positioned at is formed, determines the power consumption Q of described foreground application.
2. application program power consumption detection method as claimed in claim 1, is characterized in that: describedly preset electricity, described Startup time t according to described single-candidate 1with close moment t 4the position of the coordinate axis that the described time interval be positioned at is formed, determine the power consumption Q of described foreground application, comprising:
Obtain described Startup time t 1with close moment t 4the number n of the complete time interval crossed over;
Preset quantitatively and the value of the number n of the complete time interval crossed over according to described single-candidate, calculate the power consumption Q of described foreground application.
3. application program power consumption detection method as claimed in claim 2, is characterized in that: the formula of the power consumption Q of the described foreground application of described calculating is:
The power consumption Q=(n+1 of foreground application) × q,
Wherein, q is that described single-candidate presets electricity.
4. application program power consumption detection method as claimed in claim 1, is characterized in that: describedly preset electricity, described Startup time t according to described single-candidate 1with close moment t 4the position of the coordinate axis that the described time interval be positioned at is formed, determine the power consumption Q of described foreground application, comprising:
Carve t upon start up 1with close moment t 4when being in interval at the same time, the power consumption Q=(t of foreground application 4-t 1)/(t 3-t 2)] × q,
Wherein, t 2represent the initial time of the time interval at foreground application Startup time place, t 3represent the end time of the time interval at foreground application Startup time place, q is that described single-candidate presets electricity.
5. application program power consumption detection method as claimed in claim 1, is characterized in that: describedly preset electricity, described Startup time t according to described single-candidate 1with close moment t 4the position of the coordinate axis that the described time interval be positioned at is formed, determine the power consumption Q of described foreground application, comprising:
Carve t upon start up 1with close moment t 4when being in different time intervals, power consumption the Q=[(t of foreground application 3-t 1)/(t 3-t 2)+n+ (t 4-t 5)/(t 6-t 5)] × q;
Wherein, t 2represent the initial time of the time interval at foreground application Startup time place, t 3represent the end time of the time interval at foreground application Startup time place, t 5represent the initial time of the time interval at foreground application close moment place, t 6represent the end time of time interval at foreground application close moment place, the number of the complete time interval that the coordinate axis that n is formed at time interval for foreground application is crossed over, q is that described single-candidate presets electricity.
6. the application program power consumption detection method as described in claim 1-5 any one, is characterized in that, it is the number percent a% taking mobile device battery total capacity that described single-candidate presets electricity, wherein, and 0<a≤50.
7. the application program power consumption detection method as described in claim 1-5 any one, is characterized in that, it is the single-candidate charge value q consumed that described single-candidate presets electricity 1, wherein, 0<q 1≤ battery total capacity.
8. the application program power consumption detection method as described in claim 1-5 any one, is characterized in that, when the number of the background application of mobile device is greater than setting threshold value, described method also comprises:
A. all background application are closed, the power consumption Q of record foreground application in setting-up time before;
B. keep the mobile device running status identical with during all background application of described closedown, open the background application of setting quantitative range, record foreground application and the background application total power consumption Q at setting-up time always;
C. the power consumption calculating the background application of setting quantitative range accounts for the number percent of total power consumption, and computing formula is (Q always-q before)/Q always;
D. judge to calculate the number of times that the power consumption of background application accounts for the number percent of total power consumption and whether reach setting value, if then enter next step, then return step a if not, repeat step a ~ c;
E. the power consumption of the background application repeatedly calculated is accounted for the mean value of the number percent of total power consumption, account for the end value p of total power consumption number percent as background application;
F. the accurate power consumption Q of foreground application is calculated according to the power consumption Q of foreground application and described end value p essence, computing formula is: Q essence=Q(1-p).
9. an application program power consumption detection system, comprising:
Time interval logging modle, for obtain and record move equipment often consumes single-candidate and presets electricity time interval used;
Foreground application monitoring module, for monitoring the Startup time t of foreground application 1with close moment t 4;
Power consumption determination module, for presetting electricity, described Startup time t according to described single-candidate 1with close moment t 4the position of the coordinate axis that the described time interval be positioned at is formed, determines the power consumption Q of described foreground application.
10. application program power consumption detection system as claimed in claim 9, is characterized in that: described power consumption determination module comprises:
Cross over interval number acquiring unit, for obtaining the Startup time t of described foreground application 1with close moment t 4the number n of the complete time interval crossed over;
Power consumption computing unit, for presetting according to described single-candidate quantitatively and the value of the number n of the complete time interval crossed over, calculates the power consumption Q of described foreground application.
11. application program power consumption detection systems as claimed in claim 10, is characterized in that: the formula that power consumption computing unit calculates the power consumption Q of foreground application is:
The power consumption Q=(n+1 of foreground application) × q,
Wherein, q is that described single-candidate presets electricity.
12. application program power consumption detection systems as claimed in claim 9, is characterized in that: as the Startup time t of described foreground application 1with close moment t 4when being in interval at the same time, the formula that described power consumption determination module calculates the power consumption Q of foreground application is:
Power consumption Q=(the t of foreground application 4-t 1)/(t 3-t 2)] × q,
Wherein, t 2represent the initial time of the time interval at foreground application Startup time place, t 3represent the end time of the time interval at foreground application Startup time place, q is that described single-candidate presets electricity.
13. application program power consumption detection systems as claimed in claim 9, is characterized in that: carve t upon start up 1with close moment t 4when being in different time intervals, the formula that described power consumption determination module calculates foreground application power consumption Q is:
Power consumption the Q=[(t of foreground application 3-t 1)/(t 3-t 2)+n+ (t 4-t 5)/(t 6-t 5)] × q;
Wherein, t 2represent the initial time of the time interval at foreground application Startup time place, t 3represent the end time of the time interval at foreground application Startup time place, t 5represent the initial time of the time interval at foreground application close moment place, t 6represent the end time of time interval at foreground application close moment place, the number of the complete time interval that the coordinate axis that n is formed at time interval for foreground application is crossed over, q is that described single-candidate presets electricity.
14. application program power consumption detection systems as described in claim 9 to 13 any one, is characterized in that: when the number of the background application of mobile device is greater than setting threshold value, this system also comprises:
Accurate power consumption determination module, for the accurate power consumption of the power consumption determination foreground application according to described foreground application.
15. application program power consumption detection systems as claimed in claim 14, is characterized in that, described accurate power consumption determination module comprises:
Foreground application power consumption test cell, for when closing all background application, the power consumption Q of record foreground application in setting-up time before;
Total power consumption test cell, for when keeping identical with during all background application of described closedown mobile device running status, opens the background application of setting quantitative range, records foreground application and the background application total power consumption Q at setting-up time always;
Backstage power consumption percentage calculation unit, the power consumption for the background application calculating setting quantitative range accounts for the number percent of total power consumption, and computing formula is (Q always-q before)/Q always;
Calculation times judging unit, whether the number of times that the power consumption for judging to calculate background application accounts for the number percent of total power consumption reaches setting value, if then enter end value computing unit, then returns foreground application power consumption test cell if not;
End value computing unit, account for the end value p of total power consumption number percent for calculating background application, account form is: the mean value power consumption of the background application repeatedly calculated being accounted for the number percent of total power consumption accounts for the end value p of total power consumption number percent as background application;
Accurate power consumption computing unit, for calculating the accurate power consumption Q of foreground application according to the power consumption Q of foreground application and described end value p essence, computing formula is: Q essence=Q(1-p).
CN201310282738.7A 2013-07-05 2013-07-05 Application power consumption detection method and system Active CN104281513B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201310282738.7A CN104281513B (en) 2013-07-05 2013-07-05 Application power consumption detection method and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201310282738.7A CN104281513B (en) 2013-07-05 2013-07-05 Application power consumption detection method and system

Publications (2)

Publication Number Publication Date
CN104281513A true CN104281513A (en) 2015-01-14
CN104281513B CN104281513B (en) 2017-06-06

Family

ID=52256412

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201310282738.7A Active CN104281513B (en) 2013-07-05 2013-07-05 Application power consumption detection method and system

Country Status (1)

Country Link
CN (1) CN104281513B (en)

Cited By (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105611080A (en) * 2016-02-24 2016-05-25 北京小米移动软件有限公司 Mobile terminal energy consumption control method and device and mobile terminal
CN105824740A (en) * 2015-11-26 2016-08-03 维沃移动通信有限公司 Method for determining power consumption of application and terminal
CN106021072A (en) * 2016-05-05 2016-10-12 北京小米移动软件有限公司 Information display method and device
WO2017028628A1 (en) * 2015-08-19 2017-02-23 中兴通讯股份有限公司 Terminal internal device power consumption data acquisition method and device
CN106708696A (en) * 2016-07-01 2017-05-24 腾讯科技(深圳)有限公司 Method and device for detecting power consumption of function in mobile terminal application program
CN106708697A (en) * 2016-09-29 2017-05-24 腾讯科技(深圳)有限公司 Method and device for detecting applications used by user
CN106714289A (en) * 2017-03-14 2017-05-24 西安电子科技大学 Smart phone dump energy management method based on application combination power consumption prediction
CN110134219A (en) * 2019-05-13 2019-08-16 深圳传音通讯有限公司 Application program backstage power consumption processing method and processing device
CN111768155A (en) * 2020-06-30 2020-10-13 上海木木聚枞机器人科技有限公司 Scheduling control method, intelligent mobile device, server and storage medium
CN113702834A (en) * 2021-08-10 2021-11-26 青岛峻海物联科技有限公司 Method for estimating residual battery capacity of Internet of things equipment

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2006134932A1 (en) * 2005-06-13 2006-12-21 Matsushita Electric Industrial Co., Ltd. Terminal device
WO2010007913A1 (en) * 2008-07-15 2010-01-21 ミツミ電機株式会社 Mobile device, cell pack, semiconductor device, display control method, and display control program
CN101808165A (en) * 2010-04-12 2010-08-18 中兴通讯股份有限公司 Method and device for constructing power model of mobile terminal
CN102369647A (en) * 2011-09-14 2012-03-07 华为技术有限公司 Power supply managment method and device of mobile terminal
CN102508761A (en) * 2011-11-17 2012-06-20 宇龙计算机通信科技(深圳)有限公司 Management method for terminal electric quantity and terminal

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2006134932A1 (en) * 2005-06-13 2006-12-21 Matsushita Electric Industrial Co., Ltd. Terminal device
WO2010007913A1 (en) * 2008-07-15 2010-01-21 ミツミ電機株式会社 Mobile device, cell pack, semiconductor device, display control method, and display control program
CN101808165A (en) * 2010-04-12 2010-08-18 中兴通讯股份有限公司 Method and device for constructing power model of mobile terminal
CN102369647A (en) * 2011-09-14 2012-03-07 华为技术有限公司 Power supply managment method and device of mobile terminal
CN102508761A (en) * 2011-11-17 2012-06-20 宇龙计算机通信科技(深圳)有限公司 Management method for terminal electric quantity and terminal

Cited By (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2017028628A1 (en) * 2015-08-19 2017-02-23 中兴通讯股份有限公司 Terminal internal device power consumption data acquisition method and device
CN105824740A (en) * 2015-11-26 2016-08-03 维沃移动通信有限公司 Method for determining power consumption of application and terminal
CN105611080A (en) * 2016-02-24 2016-05-25 北京小米移动软件有限公司 Mobile terminal energy consumption control method and device and mobile terminal
CN106021072A (en) * 2016-05-05 2016-10-12 北京小米移动软件有限公司 Information display method and device
CN106708696A (en) * 2016-07-01 2017-05-24 腾讯科技(深圳)有限公司 Method and device for detecting power consumption of function in mobile terminal application program
CN106708697A (en) * 2016-09-29 2017-05-24 腾讯科技(深圳)有限公司 Method and device for detecting applications used by user
CN106714289A (en) * 2017-03-14 2017-05-24 西安电子科技大学 Smart phone dump energy management method based on application combination power consumption prediction
CN106714289B (en) * 2017-03-14 2019-11-15 西安电子科技大学 Smart phone remaining capacity management method based on application combination power consumption prediction
CN110134219A (en) * 2019-05-13 2019-08-16 深圳传音通讯有限公司 Application program backstage power consumption processing method and processing device
CN110134219B (en) * 2019-05-13 2024-03-19 深圳传音通讯有限公司 Application program background power consumption processing method and device
CN111768155A (en) * 2020-06-30 2020-10-13 上海木木聚枞机器人科技有限公司 Scheduling control method, intelligent mobile device, server and storage medium
CN113702834A (en) * 2021-08-10 2021-11-26 青岛峻海物联科技有限公司 Method for estimating residual battery capacity of Internet of things equipment
CN113702834B (en) * 2021-08-10 2024-03-08 青岛峻海物联科技有限公司 Method for estimating residual battery capacity of equipment of Internet of things

Also Published As

Publication number Publication date
CN104281513B (en) 2017-06-06

Similar Documents

Publication Publication Date Title
CN104281513A (en) Application power consumption detection method and system
CN103163480B (en) The appraisal procedure of lithium battery health status
CN102508761B (en) The management method of terminal power and terminal
CN106786958B (en) Charging method, device and terminal
Xu et al. V-edge: Fast self-constructive power modeling of smartphones based on battery voltage dynamics
CN106646256B (en) Battery capacity calculating method
CN103823191B (en) A kind of Li-ion batteries piles that calculates can by the method for residual capacity
CN103091639A (en) Battery service life detecting method and detecting device
CN103440029A (en) Method for prolonging service life of mobile terminal in low battery mode and mobile terminal
CN101312293A (en) Power lithium battery intelligent management system
CN103033758A (en) Display electric quantity value calibration method and device
CN104656021B (en) The predictor method and device of a kind of remaining battery capacity
CN104635164A (en) Battery charging and discharging stability testing method of intelligent terminal and intelligent terminal
CN106338690A (en) Standby battery detection method, device and system and power supply method
CN104833919A (en) Detection method of power battery health state and system
CN104731301A (en) Mobile terminal, power-saving operation method of mobile terminal, power-saving operation system of mobile terminal
CN103391362B (en) A kind of application class method based on power consumption and mobile terminal
CN103761179A (en) Method and system for displaying electric quantity left after terminal restart
CN103942133B (en) A kind of information processing method and electronic equipment
CN103837835A (en) Method and device for detecting capacity decreasing degree of mobile device battery
CN205958716U (en) A system and electronic equipment that is arranged in accurate electronic equipment&#39;s of sureness battery state of charge
CN104849669B (en) A kind of charging method and system of the non-dismountable battery of mobile terminal
US20060132097A1 (en) Smart battery simulator
CN114744713B (en) Charging method, device, equipment and medium of energy storage power supply
CN109596989A (en) Display methods, device and the electronic equipment of electric quantity for electronic equipment

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant