CN104881346B - The detection method and device of a kind of mobile terminal and its application program power consumption - Google Patents
The detection method and device of a kind of mobile terminal and its application program power consumption Download PDFInfo
- Publication number
- CN104881346B CN104881346B CN201510218747.9A CN201510218747A CN104881346B CN 104881346 B CN104881346 B CN 104881346B CN 201510218747 A CN201510218747 A CN 201510218747A CN 104881346 B CN104881346 B CN 104881346B
- Authority
- CN
- China
- Prior art keywords
- application program
- power consumption
- electricity
- time
- indicates
- 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.)
- Active
Links
Classifications
-
- Y—GENERAL 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
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02D—CLIMATE 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/00—Energy efficient computing, e.g. low power processors, power management or thermal management
Landscapes
- Mobile Radio Communication Systems (AREA)
- Telephone Function (AREA)
Abstract
The invention discloses the detection methods and device of a kind of mobile terminal and its application program power consumption, belong to technical field of mobile terminals.The detection method of the application program power consumption is applied to mobile terminal, this method comprises: obtaining application program within a preset time period in the working time under different working condition and the electricity consumed under each working condition;According to the working time of acquisition and the electricity of consumption, the power consumption for calculating application program within a preset time period accounts for the percentage of total power consumption;When receiving the inquiry instruction of the power consumption of application program, the percentage of the power consumption of the correspondence application program of calculating is shown.The invention enables being accurately calculated for the power consumption to application program, and user is allowed to understand each newest power consumption information of application program, help user to determine whether to delete or unload corresponding application program, to increase the cruise duration of mobile terminal.
Description
Technical field
The present invention relates to technical field of mobile terminals, and in particular to the inspection of a kind of mobile terminal and its application program power consumption
Survey method and apparatus.
Background technique
With the development of mobile terminal, APP number of applications has arrived more surprising situations at present, and various applications are soft
The quality of part is also very different.Some APP are there is no very big use value and due to application itself, and power consumption is also
It is bigger, but user does not know the very fast of the electric quantity consumption for leading to terminal but but to this.
The detection method of the existing power consumption to application program causes it to detect since the factor of its consideration is very few
Power consumption is inaccurate.And there is no the power consumption of a certain application program within a certain period of time is shown, user is difficult to
Know its specific electric quantity consumption situation.
Summary of the invention
The present invention provides the detection method and device of a kind of mobile terminal and its application program power consumption, to reach more acurrate
Detection and present application program power consumption purpose, overcome the above-mentioned prior art to the test section of the power consumption of application program
Accurate defect.
The technical solution that the present invention solves above-mentioned technical problem is as follows.
According to an aspect of the present invention, the detection method of the application program power consumption provided, the method are applied to move
Dynamic terminal, this method comprises:
Obtain application program working time under different working condition and in each work within a preset time period
The electricity consumed under state;
According to the working time of acquisition and the electricity of consumption, the power consumption of the application program within a preset time period is calculated
Amount accounts for the percentage of total power consumption;
When receiving the inquiry instruction of the power consumption of application program, the hundred of the power consumption of the correspondence application program of calculating are shown
Divide ratio.
Preferably, the formula of the power consumption of the application program is calculated are as follows:
Q=T1*Q1+Q2+Q3+Q4;
Wherein, Q indicates the power consumption of application program, T1Indicate the total time that CPU is occupied during application program operation, Q1Table
Show the unit power consumption amount that application program is run under the current frequency range of CPU, Q2Indicate that application program consumes under wakelock state
Electricity, Q3Indicate that application program passes through the electricity of data transmission consumption, Q4Indicate that application program is consumed using all the sensors
Electricity.
Preferably, total time T1 that CPU is occupied during application program operation is that application program is run in linux kernel state
Time and the sum of time in the operation of Linux User space.
Preferably, it calculates the application program and passes through the formula of the electricity Q3 of data transmission consumption are as follows:
Q3=((B1+B2)*I1+(B3+B4-B1-B2)*I2)/(B1+B2+B3+B4);
Wherein, B1Indicate the data volume uploaded by data traffic, B2Indicate the data volume downloaded by data traffic, B3
Indicate the data volume uploaded by wifi network, B4Indicate the data volume downloaded by wifi network, I1It indicates to use data traffic
When electric current, I2Electric current when indicating using wifi network.
Preferably, the above-mentioned electricity Q consumed under wakelock state2It is run under wakelock state for application program
Time multiplied by the unit power consumption amount run under wakelock state.
Preferably, it calculates the application program and uses the formula of electricity Q4 consumed by all the sensors are as follows:
Q4=Ta*Qa+Tb*Qb+Tc*Qc+…+Tn*Qn;
Wherein, TaIndicate the time of application program take sensor a, QaIndicate the unit power consumption amount of sensor a, TbIt indicates
Indicate the time of application program take sensor b, QbIndicate the unit power consumption amount of sensor b, TcIndicate that application program occupies sensing
The time of device c, QcIndicate the unit power consumption amount of sensor c, TnIndicate the time of application program take sensor n, QnIndicate sensing
The unit power consumption amount of device n.
Preferably, the detection method of the application program power consumption further include:
Whether the time for judging the last power consumption percentage for calculating application program of current time distance is more than preset
Time threshold, if so, reacquire application program within a preset time period the working time under different working condition with
And the electricity consumed under each working condition;
According to the working time of newest acquisition and the electricity of consumption, the consumption of application program within a preset time period is calculated
Electricity accounts for the percentage of total power consumption.
According to another aspect of the present invention, the detection device of the application program power consumption provided, the device include:
First data acquisition module, for obtaining work of the application program within a preset time period under different working condition
The electricity making the time and being consumed under each working condition;
First computing module, for calculating in the preset period according to the working time of acquisition and the electricity of consumption
The power consumption of interior application program accounts for the percentage of total power consumption;
Display module when the inquiry instruction of the power consumption for receiving application program, shows the correspondence application journey of calculating
The percentage of the power consumption of sequence.
Preferably, the device further include:
Second data acquisition module, for judging the last power consumption percentage for calculating application program of current time distance
Time whether be more than preset time threshold, if so, reacquire application program within a preset time period in different works
The electricity making the working time under state and being consumed under each working condition;
Second computing module, for calculating when preset according to the working time of newest acquisition and the electricity of consumption
Between in section the power consumption of application program account for the percentage of total power consumption.
According to a further aspect of the invention, a kind of mobile terminal provided, the mobile terminal include above-mentioned application journey
The detection device of sequence power consumption.
The present invention provides the detection methods and device of a kind of mobile terminal and its application program power consumption, are calculating some
The various states and service condition run when the power consumption of application program are taken into account, so as to the consumption of application program
Electricity is accurately calculated, so that user in the power consumption for checking the application program, is made by display power consumption percentage
It is very clear, help user to determine whether to delete or unload corresponding application program, to increase the continuous of mobile terminal
ETS estimated time of sailing.
Detailed description of the invention
The hardware structural diagram of Fig. 1 mobile terminal of each embodiment to realize the present invention;
Fig. 2 is the wireless communication system schematic diagram of mobile terminal as shown in Figure 1;
Fig. 3 is the flow chart according to the detection method of the application program power consumption of one embodiment of the present of invention;
Fig. 4 is the flow chart according to the detection method of the application program power consumption of another embodiment of the present invention;
Fig. 5 is the demonstrative structure frame according to the detection device of the application program power consumption of one embodiment of the present of invention
Figure;
Fig. 6 is the demonstrative structure frame according to the detection device of the application program power consumption of one embodiment of the present of invention
Figure;
Fig. 7 is the exemplary block diagram according to the mobile terminal of one embodiment of the present of invention.
Specific embodiment
The principle and features of the present invention will be described below with reference to the accompanying drawings, and the given examples are served only to explain the present invention, and
It is non-to be used to limit the scope of the invention.
The mobile terminal of each embodiment of the present invention is realized in description with reference to the drawings.In subsequent description, use
For indicate element such as " module ", " component " or " unit " suffix only for being conducive to explanation of the invention, itself
There is no specific meanings.Therefore, " module " can be used mixedly with " component ".
Fig. 1 to realize the present invention the mobile terminal of each embodiment hardware configuration signal.
Mobile terminal 100 may include wireless communication unit 110, A/V (audio/video) input unit 120, user's input
Unit 130, sensing unit 140, output unit 150, memory 160, interface unit 170, controller 180 and power supply unit 190
Etc..Fig. 1 shows the mobile terminal with various assemblies, it should be understood that being not required for implementing all groups shown
Part.More or fewer components can alternatively be implemented.The element of mobile terminal will be discussed in more detail below.
Wireless communication unit 110 generally includes one or more components, allows mobile terminal 100 and wireless communication system
Or the radio communication between network.For example, wireless communication unit may include broadcasting reception module 111, mobile communication module
112, at least one of wireless Internet module 113, short range communication module 114 and location information module 115.
Broadcasting reception module 111 receives broadcast singal and/or broadcast from external broadcast management server via broadcast channel
Relevant information.Broadcast channel may include satellite channel and/or terrestrial channel.Broadcast management server, which can be, to be generated and sent
The broadcast singal and/or broadcast related information generated before the server or reception of broadcast singal and/or broadcast related information
And send it to the server of terminal.Broadcast singal may include TV broadcast singal, radio signals, data broadcasting
Signal etc..Moreover, broadcast singal may further include the broadcast singal combined with TV or radio signals.Broadcast phase
Closing information can also provide via mobile communications network, and in this case, broadcast related information can be by mobile communication mould
Block 112 receives.Broadcast singal can exist in a variety of manners, for example, it can be with the electronics of digital multimedia broadcasting (DMB)
Program guide (EPG), digital video broadcast-handheld (DVB-H) electronic service guidebooks (ESG) etc. form and exist.Broadcast
Receiving module 111 can receive signal broadcast by using various types of broadcast systems.Particularly, broadcasting reception module 111
It can be wide by using such as multimedia broadcasting-ground (DMB-T), digital multimedia broadcasting-satellite (DMB-S), digital video
It broadcasts-holds (DVB-H), the Radio Data System of forward link media (MediaFLO@), received terrestrial digital broadcasting integrated service
(ISDB-T) etc. digit broadcasting system receives digital broadcasting.Broadcasting reception module 111, which may be constructed such that, to be adapted to provide for extensively
Broadcast the various broadcast systems and above-mentioned digit broadcasting system of signal.Via the received broadcast singal of broadcasting reception module 111 and/
Or broadcast related information can store in memory 160 (or other types of storage medium).
Mobile communication module 112 sends radio signals to base station (for example, access point, node B etc.), exterior terminal
And at least one of server and/or receive from it radio signal.Such radio signal may include that voice is logical
Talk about signal, video calling signal or according to text and/or Multimedia Message transmission and/or received various types of data.
The Wi-Fi (Wireless Internet Access) of the support mobile terminal of wireless Internet module 113.The module can be internally or externally
It is couple to terminal.Wi-Fi (Wireless Internet Access) technology involved in the module may include WLAN (Wireless LAN) (Wi-Fi), Wibro
(WiMAX), Wimax (worldwide interoperability for microwave accesses), HSDPA (high-speed downlink packet access) etc..
Short range communication module 114 is the module for supporting short range communication.Some examples of short-range communication technology include indigo plant
Tooth TM, radio frequency identification (RFID), Infrared Data Association (IrDA), ultra wide band (UWB), purple honeybee TM etc..
Location information module 115 is the module for checking or obtaining the location information of mobile terminal.Location information module
Typical case be GPS (global positioning system).According to current technology, GPS module 115, which calculates, comes from three or more satellites
Range information and correct time information and the Information application triangulation for calculating, thus according to longitude, latitude
Highly accurately calculate three-dimensional current location information.Currently, it is defended for the method for calculating position and temporal information using three
Star and the error that calculated position and temporal information are corrected by using an other satellite.In addition, GPS module 115
It can be by Continuous plus current location information in real time come calculating speed information.
A/V input unit 120 is for receiving audio or video signal.A/V input unit 120 may include 121 He of camera
Microphone 1220, camera 121 is to the static map obtained in video acquisition mode or image capture mode by image capture apparatus
The image data of piece or video is handled.Treated, and picture frame may be displayed on display unit 151.At camera 121
Picture frame after reason can store in memory 160 (or other storage mediums) or carry out via wireless communication unit 110
It sends, two or more cameras 1210 can be provided according to the construction of mobile terminal.Microphone 122 can be in telephone relation mould
Sound (audio data) is received via microphone in formula, logging mode, speech recognition mode etc. operational mode, and can be incited somebody to action
Such acoustic processing is audio data.Audio that treated (voice) data can be converted in the case where telephone calling model
For the format output that can be sent to mobile communication base station via mobile communication module 112.Various types can be implemented in microphone 122
Noise eliminate (or inhibit) algorithm with eliminate noise that (or inhibition) generates during sending and receiving audio signal or
Person's interference.
The order that user input unit 130 can be inputted according to user generates key input data to control each of mobile terminal
Kind operation.User input unit 130 allows user to input various types of information, and may include keyboard, metal dome, touch
Plate (for example, the sensitive component of detection due to the variation of resistance, pressure, capacitor etc. caused by being contacted), idler wheel, rocking bar etc.
Deng.Particularly, when touch tablet is superimposed upon in the form of layer on display unit 151, touch screen can be formed.
Sensing unit 140 detects the current state of mobile terminal 100, (for example, mobile terminal 100 opens or closes shape
State), the position of mobile terminal 100, user is for the presence or absence of contact (that is, touch input) of mobile terminal 100, mobile terminal
100 orientation, the acceleration or deceleration movement of mobile terminal 100 and direction etc., and generate for controlling mobile terminal 100
The order of operation or signal.For example, sensing unit 140 can sense when mobile terminal 100 is embodied as sliding-type mobile phone
The sliding-type phone is to open or close.In addition, sensing unit 140 be able to detect power supply unit 190 whether provide electric power or
Whether person's interface unit 170 couples with external device (ED).Sensing unit 140 may include that proximity sensor 1410 will combine below
Touch screen is described this.
Interface unit 170 be used as at least one external device (ED) connect with mobile terminal 100 can by interface.For example,
External device (ED) may include wired or wireless headphone port, external power supply (or battery charger) port, wired or nothing
Line data port, memory card port, the port for connecting the device with identification module, audio input/output (I/O) end
Mouth, video i/o port, ear port etc..Identification module can be storage and use each of mobile terminal 100 for verifying user
It plants information and may include subscriber identification module (UIM), client identification module (SIM), Universal Subscriber identification module (USIM)
Etc..In addition, the device (hereinafter referred to as " identification device ") with identification module can take the form of smart card, therefore, know
Other device can be connect via port or other attachment devices with mobile terminal 100.Interface unit 170, which can be used for receiving, to be come from
The input (for example, data information, electric power etc.) of external device (ED) and the input received is transferred in mobile terminal 100
One or more elements can be used for transmitting data between mobile terminal and external device (ED).
In addition, when mobile terminal 100 is connect with external base, interface unit 170 may be used as allowing will be electric by it
Power, which is provided from pedestal to the path or may be used as of mobile terminal 100, allows the various command signals inputted from pedestal to pass through it
It is transferred to the path of mobile terminal.The various command signals or electric power inputted from pedestal, which may be used as mobile terminal for identification, is
The no signal being accurately fitted on pedestal.Output unit 150 is configured to provide with vision, audio and/or tactile manner defeated
Signal (for example, audio signal, vision signal, alarm signal, vibration signal etc.) out.Output unit 150 may include display
Unit 151, audio output module 152, alarm unit 153 etc..
Display unit 151 may be displayed on the information handled in mobile terminal 100.For example, when mobile terminal 100 is in electricity
When talking about call mode, display unit 151 can show and converse or other communicate (for example, text messaging, multimedia file
Downloading etc.) relevant user interface (UI) or graphic user interface (GUI).When mobile terminal 100 is in video calling mode
Or when image capture mode, display unit 151 can show captured image and/or received image, show video or figure
Picture and the UI or GUI of correlation function etc..
Meanwhile when display unit 151 and touch tablet in the form of layer it is superposed on one another to form touch screen when, display unit
151 may be used as input unit and output device.Display unit 151 may include liquid crystal display (LCD), thin film transistor (TFT)
In LCD (TFT-LCD), Organic Light Emitting Diode (OLED) display, flexible display, three-dimensional (3D) display etc. at least
It is a kind of.Some in these displays may be constructed such that transparence to allow user to watch from outside, this is properly termed as transparent
Display, typical transparent display can be, for example, TOLED (transparent organic light emitting diode) display etc..According to specific
Desired embodiment, mobile terminal 100 may include two or more display units (or other display devices), for example, moving
Dynamic terminal may include outernal display unit (not shown) and inner display unit (not shown).Touch screen can be used for detecting touch
Input pressure and touch input position and touch input area.
Audio output module 152 can mobile terminal be in call signal reception pattern, call mode, logging mode,
It is when under the isotypes such as speech recognition mode, broadcast reception mode, wireless communication unit 110 is received or in memory 160
The audio data transducing audio signal of middle storage and to export be sound.Moreover, audio output module 152 can provide and movement
The relevant audio output of specific function (for example, call signal receives sound, message sink sound etc.) that terminal 100 executes.
Audio output module 152 may include loudspeaker, buzzer etc..
Alarm unit 153 can provide output notifying event to mobile terminal 100.Typical event can be with
Including calling reception, message sink, key signals input, touch input etc..Other than audio or video output, alarm unit
153 can provide output in different ways with the generation of notification event.For example, alarm unit 153 can be in the form of vibration
Output is provided, when receiving calling, message or some other entrance communications (incomingcommunication), alarm list
Member 153 can provide tactile output (that is, vibration) to notify to user.By providing such tactile output, even if
When the mobile phone of user is in the pocket of user, user also can recognize that the generation of various events.Alarm unit 153
The output of the generation of notification event can be provided via display unit 151 or audio output module 152.
Memory 160 can store the software program etc. of the processing and control operation that are executed by controller 180, Huo Zheke
Temporarily to store oneself data (for example, telephone directory, message, still image, video etc.) through exporting or will export.And
And memory 160 can store about the vibrations of various modes and audio signal exported when touching and being applied to touch screen
Data.
Memory 160 may include the storage medium of at least one type, and the storage medium includes flash memory, hard disk, more
Media card, card-type memory (for example, SD or DX memory etc.), random access storage device (RAM), static random-access storage
Device (SRAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), programmable read only memory
(PROM), magnetic storage, disk, CD etc..Moreover, mobile terminal 100 can execute memory with by network connection
The network storage device of 160 store function cooperates.
The overall operation of the usually control mobile terminal of controller 180.For example, controller 180 executes and voice communication, data
Communication, video calling etc. relevant control and processing.In addition, controller 180 may include for reproducing (or playback) more matchmakers
The multi-media module 1810 of volume data, multi-media module 1810 can construct in controller 180, or can be structured as and control
Device 180 processed separates.Controller 180 can be with execution pattern identifying processing, by the handwriting input executed on the touchscreen or figure
Piece draws input and is identified as character or image.
Power supply unit 190 receives external power or internal power under the control of controller 180 and provides operation each member
Electric power appropriate needed for part and component.
Various embodiments described herein can be to use the calculating of such as computer software, hardware or any combination thereof
Machine readable medium is implemented.Hardware is implemented, embodiment described herein can be by using application-specific IC
(ASIC), digital signal processor (DSP), digital signal processing device (DSPD), programmable logic device (PLD), scene can
Programming gate array (FPGA), controller, microcontroller, microprocessor, is designed to execute function described herein processor
At least one of electronic unit is implemented, and in some cases, such embodiment can be implemented in controller 180.
For software implementation, the embodiment of such as process or function can with allow to execute the individual of at least one functions or operations
Software module is implemented.Software code can by the software application (or program) write with any programming language appropriate Lai
Implement, software code can store in memory 160 and be executed by controller 180.
So far, oneself is through describing mobile terminal according to its function.In the following, for the sake of brevity, will description such as folded form,
Slide type mobile terminal in various types of mobile terminals of board-type, oscillating-type, slide type mobile terminal etc., which is used as, to be shown
Example.Therefore, the present invention can be applied to any kind of mobile terminal, and be not limited to slide type mobile terminal.
Mobile terminal 100 as shown in Figure 1 may be constructed such that using via frame or grouping send data it is all if any
Line and wireless communication system and satellite-based communication system operate.
Referring now to Fig. 2 description communication system that wherein mobile terminal according to the present invention can operate.
Different air interface and/or physical layer can be used in such communication system.For example, used by communication system
Air interface includes such as frequency division multiple access (FDMA), time division multiple acess (TDMA), CDMA (CDMA) and universal mobile communications system
System (UMTS) (particularly, long term evolution (LTE)), global system for mobile communications (GSM) etc..As non-limiting example, under
The description in face is related to cdma communication system, but such introduction is equally applicable to other types of system.
With reference to Fig. 2, cdma wireless communication system may include multiple mobile terminals 100, multiple base stations (BS) 270, base station
Controller (BSC) 275 and mobile switching centre (MSC) 280.MSC280 is configured to and Public Switched Telephony Network (PSTN)
290 form interface.MSC280 is also structured to form interface with the BSC275 that can be couple to base station 270 via back haul link.
Back haul link can be constructed according to any in several known interfaces, and the interface includes such as E1/T1, ATM, IP,
PPP, frame relay, HDSL, ADSL or xDSL.It will be appreciated that system may include multiple BSC2750 as shown in Figure 2.
Each BS270 can service one or more subregions (or region), by multidirectional antenna or the day of direction specific direction
Each subregion of line covering is radially far from BS270.Alternatively, each subregion can be by two or more for diversity reception
Antenna covering.Each BS270, which may be constructed such that, supports multiple frequency distribution, and the distribution of each frequency has specific frequency spectrum
(for example, 1.25MHz, 5MHz etc.).
What subregion and frequency were distributed, which intersects, can be referred to as CDMA Channel.BS270 can also be referred to as base station transceiver
System (BTS) or other equivalent terms.In this case, term " base station " can be used for broadly indicating single
BSC275 and at least one BS270.Base station can also be referred to as " cellular station ".Alternatively, each subregion of specific BS270 can be claimed
For multiple cellular stations.
As shown in Figure 2, broadcast singal is sent to the mobile terminal operated in system by broadcsting transmitter (BT) 295
100.Broadcasting reception module 111 as shown in Figure 1 is arranged at mobile terminal 100 to receive the broadcast sent by BT295
Signal.In fig. 2 it is shown that several global positioning system (GPS) satellites 300.The help of satellite 300 positions multiple mobile terminals
At least one of 100.
In Fig. 2, multiple satellites 300 are depicted, it is understood that, it is useful to can use any number of satellite acquisition
Location information.GPS module 115 as shown in Figure 1 is generally configured to cooperate with satellite 300 to obtain desired positioning and believe
Breath.It substitutes GPS tracking technique or except GPS tracking technique, the other of the position that can track mobile terminal can be used
Technology.In addition, at least one 300 property of can choose of GPS satellite or extraly processing satellite dmb transmission.
As a typical operation of wireless communication system, BS270 receives the reverse link from various mobile terminals 100
Signal.Mobile terminal 100 usually participates in call, information receiving and transmitting and other types of communication.Certain base station 270 is received each anti-
It is handled in specific BS270 to link signal.The data of acquisition are forwarded to relevant BSC275.BSC provides call
The mobile management function of resource allocation and the coordination including the soft switching process between BS270.The number that BSC275 will also be received
According to MSC280 is routed to, the additional route service for forming interface with PSTN290 is provided.Similarly, PSTN290 with
MSC280 forms interface, and MSC and BSC275 form interface, and BSC275 controls BS270 correspondingly with by forward link signals
It is sent to mobile terminal 100.
Based on above-mentioned mobile terminal hardware configuration and communication system, each embodiment of the method for the present invention is proposed.
Embodiment one
Fig. 3 is to be tied below according to the flow chart of the detection method of the application program power consumption of one embodiment of the present of invention
Fig. 3 is closed to describe the detection method of application program power consumption according to an embodiment of the invention, as shown in figure 3, this method
Applied to mobile terminal, method includes the following steps:
S100, application program working time under different working condition and each within a preset time period is obtained
The electricity consumed under working condition;
S200, according to the working time of acquisition and the electricity of consumption, calculate application program within a preset time period
Power consumption accounts for the percentage of total power consumption;
S300, the power consumption for receiving application program inquiry instruction when, show the power consumption of the correspondence application program of calculating
The percentage of amount.
Wherein, the step of calculating the power consumption of application program within a preset time period are as follows:
Calculate single application program total electricity consumed by the initial time of the preset time period;
Calculate single application program total electricity consumed by the deadline of the preset time period;
The application program can be obtained within the preset period using journey as difference operation to two total electricities of calculating
The power consumption of sequence.
For example according to the present embodiment usage scenario: calculating wechat and consuming electricity in 9:00 is 100mah, is calculated
Consumption is 120mah when 9:30, then the consumption electricity in 9:00-9:30 this period is exactly 20mah.
Wherein, the formula of the power consumption of the application program is calculated are as follows:
Q=T1*Q1+Q2+Q3+Q4;
Wherein, Q indicates the total power consumption of application program, T1Indicate the total time that CPU is occupied during application program operation, Q1
Indicate the unit power consumption amount that application program is run under the current frequency range of CPU, Q2Indicate that application program disappears under wakelock state
The electricity of consumption, Q3Indicate that application program passes through the electricity of data transmission consumption, Q4Indicate that application program is disappeared using all the sensors
The electricity of consumption.
Further, total time T1 that CPU is occupied during application program operation is that application program is transported in linux kernel state
Capable time and the sum of the time in the operation of Linux User space.
It calculates the application program and passes through the electricity Q of data transmission consumption3Formula are as follows:
Q3=((B1+B2)*I1+(B3+B4-B1-B2)*I2)/(B1+B2+B3+B4);
Wherein, B1Indicate the data volume uploaded by data traffic, B2Indicate the data volume downloaded by data traffic, B3
Indicate the data volume uploaded by wifi network, B4Indicate the data volume downloaded by wifi network, I1It indicates to use data traffic
When electric current, I2Electric current when indicating using wifi network.
Further, the above-mentioned electricity Q consumed under wakelock state2It is transported under wakelock state for application program
The capable time is multiplied by the unit power consumption amount run under wakelock state.
Further, it calculates the application program and uses the formula of electricity Q4 consumed by all the sensors are as follows:
Q4=Ta*Qa+Tb*Qb+Tc*Qc+…+Tn*Qn;
Wherein, TaIndicate the time of application program take sensor a, QaIndicate the unit power consumption amount of sensor a, TbIt indicates
Indicate the time of application program take sensor b, QbIndicate the unit power consumption amount of sensor b, TcIndicate that application program occupies sensing
The time of device c, QcIndicate the unit power consumption amount of sensor c, TnIndicate the time of application program take sensor n, QnIndicate sensing
The unit power consumption amount of device n.Wherein, the unit power consumption amount of each sensor is provided by the manufacturer of respective sensor.
The various states and service condition that the present embodiment is run when calculating the power consumption of some application program are equal
Take into account, so that being accurately calculated to the power consumption of application program, so that user is in the power consumption for checking the application program
It when amount, is allowed to very clear by display power consumption percentage, user is helped to determine whether to delete or unload corresponding answer
With program, to increase the cruise duration of mobile terminal.
Embodiment two
Fig. 4 is according to the flow chart of the detection method of the application program power consumption of another embodiment of the present invention, such as Fig. 4 institute
Show, the detection method of application program power consumption provided in this embodiment is on the basis including above-mentioned steps S100, S200 and S300
On, further includes:
Whether S400, the time for judging the last power consumption percentage for calculating application program of current time distance are more than pre-
If time threshold, if so, reacquire application program within a preset time period work under different working condition when
Between and the electricity that is consumed under each working condition.
S500, according to the working time of newest acquisition and the electricity of consumption, calculate and apply journey within a preset time period
The power consumption of sequence accounts for the percentage of total power consumption.
Wherein, above-mentioned preset time threshold such as a week or one month, the time can be set by user oneself
It is fixed.
The present embodiment is by carrying out acquisition and calculating again to the power consumption of application program at regular intervals, so that working as
User can always obtain newest data in the power consumption for checking the application program, improve the experience of user.
Embodiment three
Fig. 5 is the demonstrative structure frame according to the detection device of the application program power consumption of one embodiment of the present of invention
Figure, the detection device of application program power consumption according to an embodiment of the invention is described below with reference to Fig. 5, such as Fig. 5 institute
Show, the detection device 11 of the application program power consumption includes:
First data acquisition module 10, for obtaining application program within a preset time period under different working condition
Working time and the electricity consumed under each working condition;
First computing module 20, for calculating in the preset time according to the working time of acquisition and the electricity of consumption
The power consumption of application program accounts for the percentage of total power consumption in section;
Display module 30 when the inquiry instruction of the power consumption for receiving application program, shows the corresponding application of calculating
The percentage of the power consumption of program.
Wherein, the first computing module 20 calculates the power consumption of single application program by following formula:
Q=T1*Q1+Q2+Q3+Q4;
Wherein, Q indicates the total power consumption of application program, T1Indicate the total time that CPU is occupied during application program operation, Q1
Indicate the unit power consumption amount that application program is run under the current frequency range of CPU, Q2Indicate that application program disappears under wakelock state
The electricity of consumption, Q3Indicate that application program passes through the electricity of data transmission consumption, Q4Indicate that application program is disappeared using all the sensors
The electricity of consumption.
Wherein, total time T1 for CPU being occupied during application program operation is what application program was run in linux kernel state
Time and the sum of the time in the operation of Linux User space.
First computing module 20 is calculated the application program by following formula and passes through the electricity Q of data transmission consumption3:
Q3=((B1+B2)*I1+(B3+B4-B1-B2)*I2)/(B1+B2+B3+B4);
Wherein, B1Indicate the data volume uploaded by data traffic, B2Indicate the data volume downloaded by data traffic, B3
Indicate the data volume uploaded by wifi network, B4Indicate the data volume downloaded by wifi network, I1It indicates to use data traffic
When electric current, I2Electric current when indicating using wifi network.
Further, the time which runs application program under wakelock state multiplied by
The electricity Q that the unit power consumption amount run under wakelock state consumes under wakelock state as the application program2。
Further, which is calculated the application program by following formula and uses all the sensors institute
The electricity Q4 of consumption:
Q4=Ta*Qa+Tb*Qb+Tc*Qc+…+Tn*Qn;
Wherein, TaIndicate the time of application program take sensor a, QaIndicate the unit power consumption amount of sensor a, TbIt indicates
Indicate the time of application program take sensor b, QbIndicate the unit power consumption amount of sensor b, TcIndicate that application program occupies sensing
The time of device c, QcIndicate the unit power consumption amount of sensor c, TnIndicate the time of application program take sensor n, QnIndicate sensing
The unit power consumption amount of device n.
Fig. 6 is the demonstrative structure frame according to the detection device of the application program power consumption of one embodiment of the present of invention
Figure, as shown in fig. 6, optionally, the detection device 11 of the application program power consumption further include:
Second data acquisition module 40, for judging the last power consumption percentage for calculating application program of current time distance
Whether the time of ratio is more than preset time threshold, if so, reacquiring application program within a preset time period in difference
Working time under working condition and the electricity consumed under each working condition;
Second computing module 50, for calculating preset according to the working time of newest acquisition and the electricity of consumption
The power consumption of application program accounts for the percentage of total power consumption in period.
The detection device of the power consumption of application program provided in this embodiment is consumed by operation and using above-mentioned application program
The detection method of electricity, so that being accurately calculated to the power consumption of application program, allows user to understand each application program most
New power consumption information.
Example IV
Fig. 7 is according to the exemplary block diagram of the mobile terminal of one embodiment of the present of invention, movement as shown in Figure 7
Terminal 100, the mobile terminal include the detection device 11 of above-mentioned application program power consumption.
Wherein, which can implement in a variety of manners.For example, terminal described in the present invention may include all
Such as mobile phone, smart phone, laptop, digit broadcasting receiver, PDA (personal digital assistant), PAD (plate electricity
Brain), PMP (portable media player), the mobile terminal of navigation device etc. and number TV, desktop computer etc.
Deng fixed terminal.Hereinafter it is assumed that terminal is mobile terminal.However, it will be understood by those skilled in the art that in addition to especially using
Except the element of mobile purpose, the construction of embodiment according to the present invention can also apply to the terminal of fixed type.
The various states and service condition that the present invention is run when calculating the power consumption of some application program are examined
Worry is entered, so that being accurately calculated to the power consumption of application program, so that user is in the power consumption for checking the application program
When, it is allowed to very clear by display power consumption percentage, user is helped to determine whether to delete or unload corresponding application
Program, to increase the cruise duration of mobile terminal.
It should be noted that, in this document, the terms "include", "comprise" or its any other variant are intended to non-row
His property includes, so that the process, method, article or the device that include a series of elements not only include those elements, and
And further include other elements that are not explicitly listed, or further include for this process, method, article or device institute it is intrinsic
Element.In the absence of more restrictions, the element limited by sentence "including a ...", it is not excluded that including being somebody's turn to do
There is also other identical elements in the process, method of element, article or device.
The serial number of the above embodiments of the invention is only for description, does not represent the advantages or disadvantages of the embodiments.
Through the above description of the embodiments, those skilled in the art can be understood that above-described embodiment side
Method can be realized by means of software and necessary general hardware platform, naturally it is also possible to by hardware, but in many cases
The former is more preferably embodiment.Based on this understanding, technical solution of the present invention substantially in other words does the prior art
The part contributed out can be embodied in the form of software products, which is stored in a storage medium
In (such as ROM/RAM, magnetic disk, CD), including some instructions are used so that a terminal device (can be mobile phone, computer, clothes
Business device, air conditioner or the network equipment etc.) execute method described in each embodiment of the present invention.
The foregoing is merely presently preferred embodiments of the present invention, is not intended to limit the invention, it is all in spirit of the invention and
Within principle, any modification, equivalent replacement, improvement and so on be should all be included in the protection scope of the present invention.
Claims (7)
1. the detection method of application program power consumption, the method is applied to mobile terminal, which is characterized in that the method packet
It includes:
Obtain application program working time under different working condition and in each working condition within a preset time period
The electricity of lower consumption;
According to the working time of acquisition and the electricity of consumption, the application program within the preset period is calculated
Power consumption account for the percentage of total power consumption;
Calculate the formula of the power consumption of the application program are as follows:
Q=T1*Q1+Q2+Q3+Q4;
Wherein, Q indicates that the power consumption of application program, T1 indicate the total time that CPU is occupied during application program operation, and Q1 indicates institute
The unit power consumption amount that application program is run under the current frequency range of CPU is stated, Q2 indicates the application program under wakelock state
The electricity of consumption, Q3 indicate the application program by the electricity of data transmission consumption, and Q4 indicates that the application program uses institute
There is electricity consumed by sensor;
When receiving the inquiry instruction of the power consumption of application program, the percentage of the power consumption of the correspondence application program of calculating is shown
Than;
The method also includes:
Whether the time for judging the last power consumption percentage for calculating the application program of current time distance is more than preset
Time threshold, if so, reacquire application program within a preset time period the working time under different working condition with
And the electricity consumed under each working condition;
According to the working time of newest acquisition and the electricity of consumption, the application within the preset period is calculated
The power consumption of program accounts for the percentage of total power consumption.
2. the detection method of application program power consumption according to claim 1, which is characterized in that the application program operation
Total time T1 that period occupies CPU is that the application program is run in the time that linux kernel state is run in Linux User space
The sum of time.
3. the detection method of application program power consumption according to claim 1, which is characterized in that calculate the application program
Pass through the formula of the electricity Q3 of data transmission consumption are as follows:
Q3=((B1+B2) * I1+ (B3+B4-B1-B2) * I2)/(B1+B2+B3+B4);
Wherein, B1 indicates the data volume uploaded by data traffic, and B2 indicates the data volume downloaded by data traffic, and B3 is indicated
The data volume uploaded by wifi network, B4 indicates the data volume downloaded by wifi network, when I1 is indicated using data traffic
Electric current, electric current when I2 is indicated using wifi network.
4. the detection method of application program power consumption according to claim 1, which is characterized in that under wakelock state
The electricity Q2 of consumption is to run multiplied by under wakelock state the time that the application program is run under wakelock state
Unit power consumption amount.
5. the detection method of application program power consumption according to claim 1, which is characterized in that calculate the application program
Use the formula of electricity Q4 consumed by all the sensors are as follows:
Q4=Ta*Qa+Tb*Qb+Tc*Qc+ ...+Tn*Qn;
Wherein, Ta indicates the time of the application program take sensor a, and Qa indicates the unit power consumption amount of the sensor a, Tb
Indicate the time of the application program take sensor b, Qb indicates the unit power consumption amount of the sensor b, and Tc indicates institute
The time of application program take sensor c is stated, Qc indicates the unit power consumption amount of the sensor c, and Tn indicates the application program
The time of take sensor n, Qn indicate the unit power consumption amount of the sensor n.
6. the detection device of application program power consumption, which is characterized in that described device includes:
First data acquisition module, for obtain application program within a preset time period work under different working condition when
Between and the electricity that is consumed under each working condition;
First computing module, for calculating when described preset according to the working time of acquisition and the electricity of consumption
Between in section the power consumption of the application program account for the percentage of total power consumption;
Wherein, first computing module calculates the power consumption of single application program by following formula:
Q=T1*Q1+Q2+Q3+Q4;
Wherein, Q indicates that the power consumption of application program, T1 indicate the total time that CPU is occupied during application program operation, and Q1 indicates institute
The unit power consumption amount that application program is run under the current frequency range of CPU is stated, Q2 indicates the application program under wakelock state
The electricity of consumption, Q3 indicate the application program by the electricity of data transmission consumption, and Q4 indicates that the application program uses institute
There is electricity consumed by sensor;
Display module when the inquiry instruction of the power consumption for receiving application program, shows the correspondence application program of calculating
The percentage of power consumption;
Described device further include:
Second data acquisition module, for judging the last power consumption percentage for calculating the application program of current time distance
Time whether be more than preset time threshold, if so, reacquire application program within a preset time period in different works
The electricity making the working time under state and being consumed under each working condition;
Second computing module, for calculating described default according to the working time of newest acquisition and the electricity of consumption
Period in the power consumption of the application program account for the percentage of total power consumption.
7. a kind of mobile terminal, which is characterized in that the mobile terminal includes application program power consumption described in the claims 6
The detection device of amount.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201510218747.9A CN104881346B (en) | 2015-04-30 | 2015-04-30 | The detection method and device of a kind of mobile terminal and its application program power consumption |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201510218747.9A CN104881346B (en) | 2015-04-30 | 2015-04-30 | The detection method and device of a kind of mobile terminal and its application program power consumption |
Publications (2)
Publication Number | Publication Date |
---|---|
CN104881346A CN104881346A (en) | 2015-09-02 |
CN104881346B true CN104881346B (en) | 2019-02-15 |
Family
ID=53948850
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201510218747.9A Active CN104881346B (en) | 2015-04-30 | 2015-04-30 | The detection method and device of a kind of mobile terminal and its application program power consumption |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN104881346B (en) |
Families Citing this family (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105467329B (en) * | 2016-01-25 | 2018-09-28 | 上海斐讯数据通信技术有限公司 | A kind of terminal continuation of the journey test system and method |
CN105764085A (en) * | 2016-02-15 | 2016-07-13 | 努比亚技术有限公司 | Abnormal electricity consumption detection method and terminal |
CN105891719B (en) * | 2016-03-28 | 2019-07-26 | 联想(北京)有限公司 | The method of electronic equipment and expected battery cruise duration |
CN106708696B (en) * | 2016-07-01 | 2020-04-28 | 腾讯科技(深圳)有限公司 | Method and device for detecting power consumption of function in application program of mobile terminal |
CN107729236A (en) * | 2017-09-30 | 2018-02-23 | 努比亚技术有限公司 | Management method, device, mobile terminal and the storage medium of application program |
CN108647127B (en) * | 2018-05-04 | 2022-03-11 | 腾讯科技(深圳)有限公司 | Application power consumption monitoring method and device |
CN110134219B (en) * | 2019-05-13 | 2024-03-19 | 深圳传音通讯有限公司 | Application program background power consumption processing method and device |
CN113268131B (en) * | 2020-02-14 | 2024-01-09 | 北京小米移动软件有限公司 | Method, device and medium for predicting endurance information |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103425577A (en) * | 2012-05-25 | 2013-12-04 | 腾讯科技(深圳)有限公司 | Test method and device |
CN104298335A (en) * | 2013-07-19 | 2015-01-21 | 贝壳网际(北京)安全技术有限公司 | Application program process cleaning method and device of mobile terminal and mobile terminal |
CN104320751A (en) * | 2014-10-14 | 2015-01-28 | 浙江大学 | Article searching method based on Bluetooth signal strength |
Family Cites Families (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US8898321B2 (en) * | 2008-01-09 | 2014-11-25 | Microsoft Corporation | Remote device communication platform user interface |
-
2015
- 2015-04-30 CN CN201510218747.9A patent/CN104881346B/en active Active
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103425577A (en) * | 2012-05-25 | 2013-12-04 | 腾讯科技(深圳)有限公司 | Test method and device |
CN104298335A (en) * | 2013-07-19 | 2015-01-21 | 贝壳网际(北京)安全技术有限公司 | Application program process cleaning method and device of mobile terminal and mobile terminal |
CN104320751A (en) * | 2014-10-14 | 2015-01-28 | 浙江大学 | Article searching method based on Bluetooth signal strength |
Non-Patent Citations (2)
Title |
---|
Android应用的电量消耗和优化的策略;初级码农;《安卓巴士》;20141012;第2-3页 |
谁是电池杀手30款Android主流app耗电量大揭;现代快报;《和讯科技》;20111220;第1-2页 |
Also Published As
Publication number | Publication date |
---|---|
CN104881346A (en) | 2015-09-02 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN104881346B (en) | The detection method and device of a kind of mobile terminal and its application program power consumption | |
CN106502693B (en) | A kind of image display method and device | |
CN106231087B (en) | A kind of method and apparatus of front and back sides dual-screen display device false-touch prevention | |
CN105100476B (en) | A kind of mobile terminal unlocking device and method | |
CN105101366B (en) | Method for controlling mobile terminal and mobile terminal | |
CN105979095B (en) | Mobile terminal and apply power consumption control method | |
CN105704282B (en) | Camera detection method and device | |
CN105282245B (en) | Cross-server message push system and method | |
CN104850443B (en) | A kind of method and mobile terminal for closing error starting application program | |
CN104850799B (en) | The method and mobile terminal of a kind of data in hiding mobile terminal | |
CN105099870B (en) | A kind of information push method and device | |
CN104967573B (en) | A kind of monitoring method and terminal of data traffic | |
CN104916270B (en) | A kind of method and apparatus adjusting screen intensity | |
CN104917891B (en) | A kind of mobile terminal and its flipping-over control method | |
CN106557291B (en) | Split screen processing method and processing device | |
CN106803860A (en) | The storage processing method and device of a kind of terminal applies | |
CN105975052A (en) | Screen switching method and device | |
CN104735254B (en) | terminal screen locking method and system | |
CN105049582B (en) | A kind of save set of calling record, method and display methods | |
CN104834473B (en) | The method and device of input | |
CN104866095B (en) | Mobile terminal and its desktop management method and apparatus | |
CN105100408B (en) | A kind of method and apparatus controlling mobile terminal | |
CN105187621B (en) | The method, apparatus and terminal of message notifying | |
CN105183346B (en) | Image display apparatus and method | |
CN104935731B (en) | A kind of method and apparatus for protecting battery |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |