CN107315673A - Power consumption monitoring method, mobile terminal and computer-readable recording medium - Google Patents

Power consumption monitoring method, mobile terminal and computer-readable recording medium Download PDF

Info

Publication number
CN107315673A
CN107315673A CN201710515822.7A CN201710515822A CN107315673A CN 107315673 A CN107315673 A CN 107315673A CN 201710515822 A CN201710515822 A CN 201710515822A CN 107315673 A CN107315673 A CN 107315673A
Authority
CN
China
Prior art keywords
mobile terminal
power consumption
current
current flow
consumption monitoring
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201710515822.7A
Other languages
Chinese (zh)
Inventor
谢良良
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Nubia Technology Co Ltd
Original Assignee
Nubia 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 Nubia Technology Co Ltd filed Critical Nubia Technology Co Ltd
Priority to CN201710515822.7A priority Critical patent/CN107315673A/en
Publication of CN107315673A publication Critical patent/CN107315673A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/3058Monitoring arrangements for monitoring environmental properties or parameters of the computing system or of the computing system component, e.g. monitoring of power, currents, temperature, humidity, position, vibrations
    • G06F11/3062Monitoring arrangements for monitoring environmental properties or parameters of the computing system or of the computing system component, e.g. monitoring of power, currents, temperature, humidity, position, vibrations where the monitored property is the power consumption
    • 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

  • Engineering & Computer Science (AREA)
  • Computing Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Mobile Radio Communication Systems (AREA)

Abstract

The invention discloses a kind of power consumption monitoring method, this method includes:The current flow of mobile terminal is obtained every time interval △ t;Acquired current flow is added up according to testing time section T, total current I is obtainedsum;The power consumption P and average current I of the mobile terminal are calculated according to preset formulaavg.By technical scheme of the embodiment of the present invention, the power consumption of mobile terminal can be monitored simple and effectively.

Description

Power consumption monitoring method, mobile terminal and computer-readable recording medium
Technical field
The present invention relates to technical field of mobile terminals, more particularly to a kind of power consumption monitoring method, mobile terminal and computer Readable storage medium storing program for executing.
Background technology
With mobile terminal function it is perfect, the popularization of mobile interchange, smart mobile phone has become user's routine use Frequency very high mobile instrument.Smart mobile phone is limited to the factors such as lithium battery technology development and mobile phone safe, and battery capacity has Limit, the cell phone standby time turns into the key of influence Consumer's Experience.Therefore, when developing the technology of smart mobile phone, mobile telephone power consumption is asked Topic needs are paid close attention to.At present, the monitoring topmost means of mobile telephone power consumption are to utilize the instruments such as PowerMonitor, but the instrument It is expensive, resource-constrained.
The content of the invention
It is a primary object of the present invention to propose a kind of power consumption monitoring method and corresponding mobile terminal, it is intended to which how is solution Monitor the technical problem of the power consumption of mobile terminal.
To achieve the above object, a kind of power consumption monitoring method that the present invention is provided, the method comprising the steps of:Every between the time The current flow of the mobile terminal is obtained every △ t;Acquired current flow is added up according to testing time section T, obtained To total current Isum;And the power consumption P and average current I of the mobile terminal are calculated according to preset formulaavg
Preferably, the preset formula is:Power consumption P=Isum* △ t*1.0/ (1000*3600), average current Iavg=P/ T。
Preferably, current flow built-in power in the mobile terminal manages the high precision electro flowmeter of integrated circuit Measurement is obtained.
Preferably, the time interval △ t are two seconds.
Preferably, this method also includes step:The testing time section T and time interval △ t is set;Set and obtain described The interface of the current flow of mobile terminal.
Preferably, this method also includes step:Each current flow and corresponding testing time are encapsulated to one In array, and timing is transferred to file destination;Data in the file destination draw the electric current fortune of the mobile terminal Row curve;According to the power consumption feelings of electric current operation curve mobile terminal with reference to described in the Operations Analyst to the mobile terminal Condition.
In addition, to achieve the above object, the present invention also proposes a kind of mobile terminal, and the mobile terminal includes:Memory, Processor and the power consumption monitoring program that can be run on the memory and on the processor is stored in, the power consumption monitors journey Sequence is by the computing device step:The current flow of the mobile terminal is obtained every time interval △ t;According to the testing time Section T is added up acquired current flow, obtains total current Isum;And the mobile terminal is calculated according to preset formula Power consumption P and average current Iavg
Preferably, the preset formula is:Power consumption P=Isum* △ t*1.0/ (1000*3600), average current Iavg=P/ T。
Preferably, the power consumption monitoring program by the computing device when also realize step:Will each current electricity Stream and corresponding testing time are encapsulated into an array, and timing is transferred to file destination;According in the file destination Data draw the electric current operation curve of the mobile terminal;According to the electric current operation curve with reference to the behaviour to the mobile terminal Perform an analysis the power consumption condition of the mobile terminal.
Further, to achieve the above object, the present invention also provides a kind of computer-readable recording medium, the computer The power consumption that is stored with readable storage medium storing program for executing monitoring program, the power consumption monitoring program realizes work(described above when being executed by processor The step of consuming monitoring method.
Power consumption monitoring method proposed by the present invention, mobile terminal and computer-readable recording medium, can be using movement eventually Hold the high precision electro flowmeter carried to obtain current flow in real time, and current power consumption value is obtained using integration method calculating, so that simple Just the power consumption of mobile terminal is effectively monitored.
Brief description of the drawings
Fig. 1 is the hardware architecture diagram for the mobile terminal for realizing each embodiment of the invention;
Fig. 2 is the wireless communication system schematic diagram of mobile terminal as shown in Figure 1;
Fig. 3 is a kind of flow chart for power consumption monitoring method that first embodiment of the invention is proposed;
Fig. 4 for the present invention in current value curve schematic diagram;
Fig. 5 is a kind of flow chart for power consumption monitoring method that second embodiment of the invention is proposed;
Fig. 6 is a kind of flow chart for power consumption monitoring method that third embodiment of the invention is proposed;
Fig. 7 is a kind of module diagram for mobile terminal that fourth embodiment of the invention is proposed.
The realization, functional characteristics and advantage of the object of the invention will be described further referring to the drawings in conjunction with the embodiments.
Embodiment
It should be appreciated that the specific embodiments described herein are merely illustrative of the present invention, it is not intended to limit the present invention.
In follow-up description, the suffix using such as " module ", " part " or " unit " for representing element is only Be conducive to the explanation of the present invention, itself there is no a specific meaning.Therefore, " module ", " part " or " unit " can be mixed Ground is used.
Terminal can be implemented in a variety of manners.For example, the terminal described in the present invention can include such as mobile phone, flat board Computer, notebook computer, palm PC, personal digital assistant (Personal Digital Assistant, PDA), portable Media player (Portable Media Player, PMP), guider, wearable device, Intelligent bracelet, pedometer etc. are moved Move the fixed terminals such as terminal, and numeral TV, desktop computer.
It will be illustrated in subsequent descriptions by taking mobile terminal as an example, it will be appreciated by those skilled in the art that except special Outside element for moving purpose, construction according to the embodiment of the present invention can also apply to the terminal of fixed type.
Referring to Fig. 1, its hardware architecture diagram for a kind of mobile terminal of realization each embodiment of the invention, the shifting Dynamic terminal 100 can include:RF (Radio Frequency, radio frequency) unit 101, WiFi module 102, audio output unit 103rd, A/V (audio/video) input block 104, sensor 105, display unit 106, user input unit 107, interface unit 108th, the part such as memory 109, processor 110 and power supply 111.It will be understood by those skilled in the art that shown in Fig. 1 Mobile terminal structure does not constitute the restriction to mobile terminal, and mobile terminal can be included than illustrating more or less parts, Either combine some parts or different parts arrangement.
The all parts of mobile terminal are specifically introduced with reference to Fig. 1:
Radio frequency unit 101 can be used for receiving and sending messages or communication process in, the reception and transmission of signal, specifically, by base station Downlink information receive after, handled to processor 110;In addition, up data are sent into base station.Generally, radio frequency unit 101 Including but not limited to antenna, at least one amplifier, transceiver, coupler, low-noise amplifier, duplexer etc..In addition, penetrating Frequency unit 101 can also be communicated by radio communication with network and other equipment.Above-mentioned radio communication can use any communication Standard or agreement, including but not limited to GSM (Global System of Mobile communication, global system for mobile telecommunications System), GPRS (General Packet Radio Service, general packet radio service), CDMA2000 (Code Division Multiple Access 2000, CDMA 2000), WCDMA (Wideband Code Division Multiple Access, WCDMA), TD-SCDMA (Time Division-Synchronous Code Division Multiple Access, TD SDMA), FDD-LTE (Frequency Division Duplexing-Long Term Evolution, FDD Long Term Evolution) and TDD-LTE (Time Division Duplexing-Long Term Evolution, time division duplex Long Term Evolution) etc..
WiFi belongs to short range wireless transmission technology, and mobile terminal can help user's transmitting-receiving electricity by WiFi module 102 Sub- mail, browse webpage and access streaming video etc., it has provided the user wireless broadband internet and accessed.Although Fig. 1 shows Go out WiFi module 102, but it is understood that, it is simultaneously not belonging to must be configured into for mobile terminal, completely can be according to need To be omitted in the essential scope for do not change invention.
Audio output unit 103 can be in call signal reception pattern, call mode, record mould in mobile terminal 1 00 When under the isotypes such as formula, speech recognition mode, broadcast reception mode, it is that radio frequency unit 101 or WiFi module 102 are received or The voice data stored in memory 109 is converted into audio signal and is output as sound.Moreover, audio output unit 103 The audio output related to the specific function that mobile terminal 1 00 is performed can also be provided (for example, call signal receives sound, disappeared Breath receives sound etc.).Audio output unit 103 can include loudspeaker, buzzer etc..
A/V input blocks 104 are used to receive audio or video signal.A/V input blocks 104 can include graphics processor (Graphics Processing Unit, GPU) 1041 and microphone 1042,1041 pairs of graphics processor is in video acquisition mode Or the view data progress of the static images or video obtained in image capture mode by image capture apparatus (such as camera) Reason.Picture frame after processing may be displayed on display unit 106.Picture frame after being handled through graphics processor 1041 can be deposited Storage is transmitted in memory 109 (or other storage mediums) or via radio frequency unit 101 or WiFi module 102.Mike Wind 1042 can connect in telephone calling model, logging mode, speech recognition mode etc. operational mode via microphone 1042 Quiet down sound (voice data), and can be voice data by such acoustic processing.Audio (voice) data after processing can To be converted to the form output that mobile communication base station can be sent to via radio frequency unit 101 in the case of telephone calling model. Microphone 1042 can implement various types of noises and eliminate (or suppression) algorithm to eliminate (or suppression) in reception and send sound The noise produced during frequency signal or interference.
Mobile terminal 1 00 also includes at least one sensor 105, such as optical sensor, motion sensor and other biographies Sensor.Specifically, optical sensor includes ambient light sensor and proximity transducer, wherein, ambient light sensor can be according to environment The light and shade of light adjusts the brightness of display panel 1061, and proximity transducer can close when mobile terminal 1 00 is moved in one's ear Display panel 1061 and/or backlight.As one kind of motion sensor, accelerometer sensor can detect in all directions (general For three axles) size of acceleration, size and the direction of gravity are can detect that when static, the application available for identification mobile phone posture (such as horizontal/vertical screen switching, dependent game, magnetometer pose calibrating), Vibration identification correlation function (such as pedometer, percussion) etc.; The fingerprint sensor that can also configure as mobile phone, pressure sensor, iris sensor, molecule sensor, gyroscope, barometer, The other sensors such as hygrometer, thermometer, infrared ray sensor, will not be repeated here.
Display unit 106 is used for the information for showing the information inputted by user or being supplied to user.Display unit 106 can be wrapped Display panel 1061 is included, liquid crystal display (Liquid Crystal Display, LCD), Organic Light Emitting Diode can be used Forms such as (Organic Light-Emitting Diode, OLED) configures display panel 1061.
User input unit 107 can be used for the numeral or character information for receiving input, and produce the use with mobile terminal The key signals input that family is set and function control is relevant.Specifically, user input unit 107 may include contact panel 1071 with And other input equipments 1072.Contact panel 1071, also referred to as touch-screen, collect touch operation of the user on or near it (such as user is using any suitable objects such as finger, stylus or annex on contact panel 1071 or in contact panel 1071 Neighbouring operation), and corresponding attachment means are driven according to formula set in advance.Contact panel 1071 may include touch detection Two parts of device and touch controller.Wherein, touch detecting apparatus detects the touch orientation of user, and detects touch operation band The signal come, transmits a signal to touch controller;Touch controller receives touch information from touch detecting apparatus, and by it It is converted into contact coordinate, then gives processor 110, and the order sent of reception processing device 110 and can be performed.In addition, can To realize contact panel 1071 using polytypes such as resistance-type, condenser type, infrared ray and surface acoustic waves.Except contact panel 1071, user input unit 107 can also include other input equipments 1072.Specifically, other input equipments 1072 can be wrapped Include but be not limited to physical keyboard, in function key (such as volume control button, switch key etc.), trace ball, mouse, action bars etc. One or more, do not limit herein specifically.
Further, contact panel 1071 can cover display panel 1061, detect thereon when contact panel 1071 or After neighbouring touch operation, processor 110 is sent to determine the type of touch event, with preprocessor 110 according to touch thing The type of part provides corresponding visual output on display panel 1061.Although in Fig. 1, contact panel 1071 and display panel 1061 be input and the output function that mobile terminal is realized as two independent parts, but in certain embodiments, can By contact panel 1071 and the input that is integrated and realizing mobile terminal of display panel 1061 and output function, not do specifically herein Limit.
Interface unit 108 is connected the interface that can pass through as at least one external device (ED) with mobile terminal 1 00.For example, External device (ED) can include wired or wireless head-band earphone port, external power source (or battery charger) port, wired or nothing Line FPDP, 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..Interface unit 108 can be used for receiving the input from external device (ED) (for example, number It is believed that breath, electric power etc.) and the input received is transferred to one or more elements in mobile terminal 1 00 or can be with For transmitting data between mobile terminal 1 00 and external device (ED).
Memory 109 can be used for storage software program and various data.Memory 109 can mainly include storing program area And storage data field, wherein, application program (the such as sound that storing program area can be needed for storage program area, at least one function Sound playing function, image player function etc.) etc.;Storage data field can be stored uses created data (such as according to mobile phone Voice data, phone directory etc.) etc..In addition, memory 109 can include high-speed random access memory, it can also include non-easy The property lost memory, for example, at least one disk memory, flush memory device or other volatile solid-state parts.
Processor 110 is the control centre of mobile terminal, utilizes each of various interfaces and the whole mobile terminal of connection Individual part, by operation or performs and is stored in software program and/or module in memory 109, and calls and be stored in storage Data in device 109, perform the various functions and processing data of mobile terminal, so as to carry out integral monitoring to mobile terminal.Place Reason device 110 may include one or more processing units;It is preferred that, processor 110 can integrated application processor and modulatedemodulate mediate Device is managed, wherein, application processor mainly handles operating system, user interface and application program etc., and modem processor is main Handle radio communication.It is understood that above-mentioned modem processor can not also be integrated into processor 110.
Mobile terminal 1 00 can also include the power supply 111 (such as battery) powered to all parts, it is preferred that power supply 111 Can be logically contiguous by power-supply management system and processor 110, so as to realize management charging by power-supply management system, put The function such as electricity and power managed.
Although Fig. 1 is not shown, mobile terminal 1 00 can also will not be repeated here including bluetooth module etc..
For the ease of understanding the embodiment of the present invention, the communications network system that the mobile terminal of the present invention is based on is entered below Row description.
Referring to Fig. 2, Fig. 2 is a kind of communications network system Organization Chart provided in an embodiment of the present invention, the communication network system Unite as the LTE system of universal mobile communications technology, UE (User Equipment, use of the LTE system including communicating connection successively Family equipment) 201, E-UTRAN (Evolved UMTS Terrestrial Radio Access Network, evolved UMTS lands Ground wireless access network) 202, EPC (Evolved Packet Core, evolved packet-based core networks) 203 and operator IP operation 204。
Specifically, UE201 can be above-mentioned terminal 100, and here is omitted.
E-UTRAN202 includes eNodeB2021 and other eNodeB2022 etc..Wherein, eNodeB2021 can be by returning Journey (backhaul) (such as X2 interface) is connected with other eNodeB2022, and eNodeB2021 is connected to EPC203, ENodeB2021 can provide UE201 to EPC203 access.
EPC203 can include MME (Mobility Management Entity, mobility management entity) 2031, HSS (Home Subscriber Server, home subscriber server) 2032, other MME2033, SGW (Serving Gate Way, Gateway) 2034, PGW (PDN Gate Way, grouped data network gateway) 2035 and PCRF (Policy and Charging Rules Function, policy and rate functional entity) 2036 etc..Wherein, MME2031 be processing UE201 and There is provided carrying and connection management for the control node of signaling between EPC203.HSS2032 is all to manage for providing some registers Such as function of attaching position register (not shown) etc, and some are preserved about the use such as service features, data rate The special information in family.All customer data can be transmitted by SGW2034, and PGW2035 can provide UE 201 IP Address is distributed and other functions, and PCRF2036 is strategy and the charging control strategic decision-making of business data flow and IP bearing resources Point, it selects and provided available strategy and charging control decision-making with charge execution function unit (not shown) for strategy.
IP operation 204 can include internet, Intranet, IMS (IP Multimedia Subsystem, IP multimedia System) or other IP operations etc..
Although above-mentioned be described by taking LTE system as an example, those skilled in the art it is to be understood that the present invention not only Suitable for LTE system, be readily applicable to other wireless communication systems, such as GSM, CDMA2000, WCDMA, TD-SCDMA with And following new network system etc., do not limit herein.
Based on above-mentioned mobile terminal hardware configuration and communications network system, each embodiment of the inventive method is proposed.
A kind of power consumption monitoring method proposed by the present invention, applied in mobile terminal, for it is simple and effective monitor it is described The power consumption of mobile terminal.
Embodiment one
As shown in figure 3, first embodiment of the invention proposes a kind of power consumption monitoring method, this method comprises the following steps:
S300, is spaced the current flow that △ t obtain the mobile terminal at predetermined time intervals.
Specifically, a time interval △ t, such as two seconds can be pre-set.The current flow is by mobile terminal The high-precision current measurement of middle built-in power management integrated circuit (Power Management IC, PMIC) is measured.In this reality Apply in example, the mobile terminal is mobile phone.
S302, is added up acquired current flow according to section T of default testing time.
Specifically, in section T of default testing time, △ t are spaced at predetermined time intervals can obtain a current flow, Obtain multiple current flow I1, I2..., In.Acquired multiple current flows are added up, total current I is obtainedsum= I1+I2+…+In
S304, the power consumption P and average current I of the mobile terminal are calculated according to preset formulaavg
Specifically, the preset formula is:
Power consumption P=Isum* △ t*1.0/ (1000*3600),
Average current Iavg=P/T.
Wherein, for the power consumption P, industry generally uses mAH as unit.
The derivation principle of the preset formula is:
Generally, power consumption calculation formula is UIt, and wherein U is voltage, and I is electric current, and t is the time.By mobile phone (institute State mobile terminal) voltage substantially constant is 4.8V, therefore industry represents power consumption using It.
Assuming that current value curve is as shown in Figure 4 in period T, then the power consumption in period T is area under a curve, often Every time interval t sampling primary current values, the work(of consumption in the area, as described period T can be obtained by integration Consumption.Power consumption divided by time are average current, and average current can reflect the power consumption degree of the mobile terminal.
Assuming that there is t1、t2Two sampled points of moment, then it is considered that its area is with t1The electric current I at moment1For top, t2When The electric current I at quarter2For bottom, t2-t1To be high trapezoidal, i.e., its area is (I1+I2)*(t2-t1)/2.If having several in period T Time interval △ t, it is (I that can derive period T inner area1+I2*2+I3*2+…+In)*△t/2.If time interval △ t Unlimited small sample is infinitely great, and its power consumption formula can be considered as It=(I1+I2+…In) * △ t, average current is It/T.
The power consumption monitoring method that the present embodiment is proposed, the high precision electro flowmeter that can be carried using mobile terminal is obtained in real time Current flow, and current power consumption value is obtained using integration method calculating, so as to monitor the power consumption of mobile terminal simple and effectively.
Embodiment two
As shown in figure 5, second embodiment of the invention proposes a kind of power consumption monitoring method.In a second embodiment, the work( The step S504-S508 of consumption monitoring method and the step S300-S304 of first embodiment are similar, and difference is that this method is also wrapped Include step S500-S502.
This method comprises the following steps:
S500, sets the testing time section T of the power consumption monitoring and the time for the current flow for obtaining the mobile terminal It is spaced △ t.
Specifically, before the power consumption of the mobile terminal is monitored, it is necessary to pre-set testing time section T, that is, monitor It is the power consumption that the mobile terminal is consumed in testing time section T.Also need to set a time interval △ t, be subsequently The power consumption of the monitoring mobile terminal, can obtain once the current flow of the mobile terminal every the time interval △ t.
S502, sets the interface for the current flow for obtaining the mobile terminal.
Specifically, defining interface getCurrentNow () obtains the current flow, especially by readTextFile (new File ("/sys/class/power_supply/battery/current_now "), 0, null) it is to obtain. Should/data of sys/class/power_supply/battery/current_now catalogue files storage be it is described it is mobile eventually The present current value at end.Built-in PMIC high-precision current measurement is measured after the current flow in mobile terminal, is preserved Into the catalogue file.
S504, the current flow of the mobile terminal is obtained every the time interval △ t.
Specifically, every the time interval △ t, by the interface, the current flow in the catalogue file is read Value.
S506, is added up acquired current flow according to testing time section T.
Specifically, in testing time section T, a current flow can be obtained every the time interval △ t, is obtained To multiple current flow I1, I2..., In.Acquired multiple current flows are added up, total current I is obtainedsum=I1 +I2+…+In
S508, the power consumption P and average current I of the mobile terminal are calculated according to preset formulaavg
Specifically, the preset formula is:
Power consumption P=Isum* △ t*1.0/ (1000*3600),
Average current Iavg=P/T.
Wherein, for the power consumption P, industry generally uses mAH as unit.
The power consumption monitoring method that the present embodiment is proposed, the high precision electro flowmeter that can be carried using mobile terminal is obtained in real time Current flow, and current power consumption value is obtained using integration method calculating, so as to monitor the power consumption of mobile terminal simple and effectively.
Embodiment three
As shown in fig. 6, third embodiment of the invention proposes a kind of power consumption monitoring method.In the third embodiment, the work( The step S600-S608 of consumption monitoring method and the step S500-S508 of second embodiment are similar, and difference is that this method is also wrapped Include step S610-S614.
This method comprises the following steps:
S600, sets the testing time section T of the power consumption monitoring and the time for the current flow for obtaining the mobile terminal It is spaced △ t.
Specifically, before the power consumption of the mobile terminal is monitored, it is necessary to pre-set testing time section T, that is, monitor It is the power consumption that the mobile terminal is consumed in testing time section T.Also need to set a time interval △ t, be subsequently The power consumption of the monitoring mobile terminal, can obtain once the current flow of the mobile terminal every the time interval △ t.
S602, sets the interface for the current flow for obtaining the mobile terminal.
Specifically, defining interface getCurrentNow () obtains the current flow, especially by readTextFile (new File ("/sys/class/power_supply/battery/current_now "), 0, null) it is to obtain. Should/data of sys/class/power_supply/battery/current_now catalogue files storage be it is described it is mobile eventually The present current value at end.Built-in PMIC high-precision current measurement is measured after the current flow in mobile terminal, is preserved Into the catalogue file.
S604, the current flow of the mobile terminal is obtained every the time interval △ t.
Specifically, every the time interval △ t, by the interface, the current flow in the catalogue file is read Value.
S606, is added up acquired current flow according to testing time section T.
Specifically, in testing time section T, a current flow can be obtained every the time interval △ t, is obtained To multiple current flow I1, I2..., In.Acquired multiple current flows are added up, total current I is obtainedsum=I1 +I2+…+In
S608, the power consumption P and average current I of the mobile terminal are calculated according to preset formulaavg
Specifically, the preset formula is:
Power consumption P=Isum* △ t*1.0/ (1000*3600),
Average current Iavg=P/T.
Wherein, for the power consumption P, industry generally uses mAH as unit.
S610, each current flow and corresponding testing time are encapsulated into an array, and timing is transferred to File destination.
Specifically, data type CurrentNow is defined, two changes of the current flow and corresponding testing time are included Amount.A List array is initialized, a present current value is often obtained, while recording the corresponding testing time, and encapsulates Into a CurrentNow data, it is added in the List arrays.Also, will every several described CurrentNow data In mono- file destination of all data Cun Chudao in the List arrays, while emptying the List arrays.
S612, the data in the file destination draw the electric current operation curve of the mobile terminal.
Specifically, each current flow and corresponding testing time data can be read from the file destination, Then the electric current operation curve of the mobile terminal is drawn according to the data read by data analysis tool.
S614, according to the consumption of electric current operation curve mobile terminal with reference to described in the Operations Analyst to the mobile terminal Electric situation.
Specifically, after the electric current operation curve of the mobile terminal is drawn out, it can be seen that the mobile terminal is at which A little moment current values are higher, and which moment current value is relatively low.Then, it is ongoing to the mobile terminal according to these moment Operation, you can analyze the specific power consumption condition of the mobile terminal.For example, the mobile terminal is being started shooting and called Current value is higher during operation, and power consumption is big, and current value is relatively low when standby, and power consumption is small.
The power consumption monitoring method that the present embodiment is proposed, it may be possible to which the high precision electro flowmeter carried using mobile terminal is real-time Current flow is obtained, and current power consumption value is obtained using integration method calculating, so as to monitor the work(of mobile terminal simple and effectively Consumption.Furthermore it is also possible to electric current operation curve be drawn out according to the current flow and correspondence testing time recorded in real time, with to described The power consumption condition of mobile terminal is made a concrete analysis of.
The present invention further provides a kind of mobile terminal, the mobile terminal includes memory, processor and power consumption monitoring System.The power consumption monitoring system is used for the power consumption for monitoring the mobile terminal simple and effectively.
Example IV
As shown in fig. 7, fourth embodiment of the invention proposes a kind of mobile terminal 7.The mobile terminal 7 includes memory 70th, processor 72, power consumption monitoring system 74 and galvanometer 76.In the present embodiment, the mobile terminal 7 is mobile phone.
In the present embodiment, the power consumption monitoring system 74 includes:
Acquisition module 700, the current flow of the mobile terminal 7 is obtained for being spaced △ t at predetermined time intervals.
Specifically, the current flow is obtained by the galvanometer 76 measurement.Wherein, the galvanometer 76 is built-in PMIC High precision electro flowmeter.
Computing module 702, for acquired current flow to be added up according to default testing time section T.
Specifically, in section T of default testing time, △ t are spaced at predetermined time intervals can obtain a current flow, Obtain multiple current flow I1, I2..., In.Acquired multiple current flows are added up, total current I is obtainedsum= I1+I2+…+In
The computing module 702 is additionally operable to calculate the power consumption P and average current of the mobile terminal according to preset formula Iavg
Specifically, the preset formula is:
Power consumption P=Isum* △ t*1.0/ (1000*3600),
Average current Iavg=P/T.
Wherein, for the power consumption P, industry generally uses mAH as unit.
Further, the power consumption monitoring system 74 also includes setup module 704, for setting the testing time section T With time interval △ t.
Specifically, before the power consumption of the mobile terminal 7 is monitored, it is necessary to pre-set testing time section T, that is, monitor It is the power consumption that the mobile terminal 7 is consumed in testing time section T.Also need to the △ t that set interval, such as two seconds Clock.
The setup module 706 is additionally operable to set the interface for the current flow for obtaining the mobile terminal 7.
Specifically, defining interface getCurrentNow () obtains the current flow, especially by readTextFile (new File ("/sys/class/power_supply/battery/current_now "), 0, null) it is to obtain. Should/data of sys/class/power_supply/battery/current_now catalogue files storage be it is described it is mobile eventually The present current value at end 7.Obtained after the current flow, preserved into the catalogue file by the galvanometer 76 measurement.
Further, the power consumption monitoring system 74 also includes logging modle 706 and analysis module 708.
The logging modle 706 is used to encapsulate each current flow and corresponding testing time to an array In, and timing is transferred to file destination.
Specifically, data type CurrentNow is defined, two changes of the current flow and corresponding testing time are included Amount.A List array is initialized, a present current value is often obtained, while recording the corresponding testing time, and encapsulates Into a CurrentNow data, it is added in the List arrays.Also, will every several described CurrentNow data In mono- file destination of all data Cun Chudao in the List arrays, while emptying the List arrays.
The data that the analysis module 708 is used in the file destination draw the electric current fortune of the mobile terminal 7 Row curve.
Specifically, each current flow and corresponding testing time data can be read from the file destination, Then the electric current operation curve of the mobile terminal 7 is drawn according to the data read by data analysis tool.
The analysis module 708 is additionally operable to according to the electric current operation curve with reference to the operation point to the mobile terminal 7 Analyse the power consumption condition of the mobile terminal 7.
Specifically, after the electric current operation curve of the mobile terminal 7 is drawn out, it can be seen that the mobile terminal 7 exists Which moment current value is higher, and which moment current value is relatively low.Then, the mobile terminal 7 is being entered according to these moment Capable operation, you can analyze the specific power consumption condition of the mobile terminal 7.For example, the mobile terminal 7 is being started shooting and dialed Current value is higher when phone etc. is operated, and power consumption is big, and current value is relatively low when standby, and power consumption is small.
It should be noted that herein, term " comprising ", "comprising" or its any other variant are intended to non-row His property is included, so that process, method, article or device including a series of key elements not only include those key elements, and And also including other key elements being not expressly set out, or also include for this process, method, article or device institute inherently Key element.In the absence of more restrictions, the key element limited by sentence "including a ...", it is not excluded that including this Also there is other identical element in process, method, article or the device of key element.
The embodiments of the present invention are for illustration only, and the quality of embodiment is not represented.
Through the above description of the embodiments, those skilled in the art can be understood that above-described embodiment side Method can add the mode of required general hardware platform to realize by software, naturally it is also possible to by hardware, but in many cases The former is more preferably embodiment.Understood based on such, technical scheme is substantially done to prior art in other words Going out the part of contribution can be embodied in the form of software product, and the computer software product is stored in a storage medium In (such as ROM/RAM, magnetic disc, CD), including some instructions are to cause a station terminal (can be mobile phone, computer, service Device, air conditioner, or network equipment etc.) perform method described in each of the invention embodiment.
Embodiments of the invention are described above in conjunction with accompanying drawing, but the invention is not limited in above-mentioned specific Embodiment, above-mentioned embodiment is only schematical, rather than restricted, one of ordinary skill in the art Under the enlightenment of the present invention, in the case of present inventive concept and scope of the claimed protection is not departed from, it can also make a lot Form, these are belonged within the protection of the present invention.

Claims (10)

1. a kind of power consumption monitoring method, applied in mobile terminal, it is characterised in that the method comprising the steps of:
The current flow of the mobile terminal is obtained every time interval △ t;
Acquired current flow is added up according to testing time section T, total current I is obtainedsum;And
The power consumption P and average current I of the mobile terminal are calculated according to preset formulaavg
2. power consumption monitoring method according to claim 1, it is characterised in that the preset formula is:Power consumption P=Isum*△ T*1.0/ (1000*3600), average current Iavg=P/T.
3. power consumption monitoring method according to claim 2, it is characterised in that the current flow is in the mobile terminal The high-precision current measurement of built-in power management integrated circuit is measured.
4. power consumption monitoring method according to claim 2, it is characterised in that the time interval △ t are two seconds.
5. power consumption monitoring method according to claim 2, it is characterised in that this method is described every time interval △ t Also include step before the step of obtaining the current flow of the mobile terminal:
The testing time section T and time interval △ t is set;
The interface for the current flow for obtaining the mobile terminal is set.
6. power consumption monitoring method according to claim 5, it is characterised in that this method is calculating the mobile terminal Power consumption P and average current IavgAlso include step afterwards:
Each current flow and corresponding testing time are encapsulated into an array, and timing is transferred to file destination;
Data in the file destination draw the electric current operation curve of the mobile terminal;
According to the power consumption condition of electric current operation curve mobile terminal with reference to described in the Operations Analyst to the mobile terminal.
7. a kind of mobile terminal, it is characterised in that the mobile terminal includes:Memory, processor and it is stored in the storage On device and the power consumption monitoring program that can run on the processor, the power consumption monitoring program is by real during the computing device Existing step:
The current flow of the mobile terminal is obtained every time interval △ t;
Acquired current flow is added up according to testing time section T, total current I is obtainedsum;And
The power consumption P and average current I of the mobile terminal are calculated according to preset formulaavg
8. mobile terminal according to claim 7, it is characterised in that the preset formula is:Power consumption P=Isum*△t* 1.0/ (1000*3600), average current Iavg=P/T.
9. mobile terminal according to claim 8, it is characterised in that the power consumption monitoring program is by the computing device When also realize step:
Each current flow and corresponding testing time are encapsulated into an array, and timing is transferred to file destination;
Data in the file destination draw the electric current operation curve of the mobile terminal;
According to the power consumption condition of electric current operation curve mobile terminal with reference to described in the Operations Analyst to the mobile terminal.
10. a kind of computer-readable recording medium, it is characterised in that the power consumption that is stored with the computer-readable recording medium is supervised Ranging sequence, realizes the power consumption monitoring as any one of claim 1 to 6 when the power consumption monitoring program is executed by processor The step of method.
CN201710515822.7A 2017-06-29 2017-06-29 Power consumption monitoring method, mobile terminal and computer-readable recording medium Pending CN107315673A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710515822.7A CN107315673A (en) 2017-06-29 2017-06-29 Power consumption monitoring method, mobile terminal and computer-readable recording medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710515822.7A CN107315673A (en) 2017-06-29 2017-06-29 Power consumption monitoring method, mobile terminal and computer-readable recording medium

Publications (1)

Publication Number Publication Date
CN107315673A true CN107315673A (en) 2017-11-03

Family

ID=60180083

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710515822.7A Pending CN107315673A (en) 2017-06-29 2017-06-29 Power consumption monitoring method, mobile terminal and computer-readable recording medium

Country Status (1)

Country Link
CN (1) CN107315673A (en)

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108120803A (en) * 2017-12-20 2018-06-05 珠海高凌信息科技股份有限公司 A kind of air negative oxgyen ion concentration on-line monitoring method and its device
CN109298139A (en) * 2018-10-29 2019-02-01 中国农业大学 Quality of tobacco evaluation method and device
WO2020237717A1 (en) * 2019-05-31 2020-12-03 苏州大学 Kink current calculation method and apparatus for soi device
CN112148544A (en) * 2020-10-20 2020-12-29 广东小天才科技有限公司 Terminal device testing method, smart watch and system
WO2023130567A1 (en) * 2022-01-06 2023-07-13 长鑫存储技术有限公司 Memory power consumption determination method and apparatus, storage medium and electronic device
CN116736076A (en) * 2023-05-12 2023-09-12 珠海妙存科技有限公司 Chip dormancy state detection method and system, electronic equipment and storage medium

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20110252261A1 (en) * 2010-04-13 2011-10-13 Samsung Electronics Co., Ltd. Method and apparatus for displaying power consumption
CN102306118A (en) * 2011-08-31 2012-01-04 中兴通讯股份有限公司 Method and device for monitoring power consumption of application program at Android terminal
CN102521107A (en) * 2011-12-13 2012-06-27 惠州Tcl移动通信有限公司 Mobile terminal and power consumption information display method and device thereof
CN102590609A (en) * 2012-02-16 2012-07-18 惠州Tcl移动通信有限公司 Mobile terminal and method for measuring power consumption of mobile terminal
US20130289789A1 (en) * 2009-06-25 2013-10-31 Server Technology, Inc. Power distribution apparatus with input and output power sensing and method of use
CN105467202A (en) * 2014-08-22 2016-04-06 深圳市中兴微电子技术有限公司 Method, device and terminal for power detection
CN106706997A (en) * 2016-11-15 2017-05-24 捷开通讯(深圳)有限公司 Current dynamic detection method and device

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20130289789A1 (en) * 2009-06-25 2013-10-31 Server Technology, Inc. Power distribution apparatus with input and output power sensing and method of use
US20110252261A1 (en) * 2010-04-13 2011-10-13 Samsung Electronics Co., Ltd. Method and apparatus for displaying power consumption
CN102306118A (en) * 2011-08-31 2012-01-04 中兴通讯股份有限公司 Method and device for monitoring power consumption of application program at Android terminal
CN102521107A (en) * 2011-12-13 2012-06-27 惠州Tcl移动通信有限公司 Mobile terminal and power consumption information display method and device thereof
CN102590609A (en) * 2012-02-16 2012-07-18 惠州Tcl移动通信有限公司 Mobile terminal and method for measuring power consumption of mobile terminal
CN105467202A (en) * 2014-08-22 2016-04-06 深圳市中兴微电子技术有限公司 Method, device and terminal for power detection
CN106706997A (en) * 2016-11-15 2017-05-24 捷开通讯(深圳)有限公司 Current dynamic detection method and device

Cited By (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108120803A (en) * 2017-12-20 2018-06-05 珠海高凌信息科技股份有限公司 A kind of air negative oxgyen ion concentration on-line monitoring method and its device
CN108120803B (en) * 2017-12-20 2020-08-07 珠海高凌信息科技股份有限公司 Online monitoring method and device for concentration of negative oxygen ions in air
CN109298139A (en) * 2018-10-29 2019-02-01 中国农业大学 Quality of tobacco evaluation method and device
WO2020237717A1 (en) * 2019-05-31 2020-12-03 苏州大学 Kink current calculation method and apparatus for soi device
CN112148544A (en) * 2020-10-20 2020-12-29 广东小天才科技有限公司 Terminal device testing method, smart watch and system
CN112148544B (en) * 2020-10-20 2023-02-24 广东小天才科技有限公司 Terminal device testing method, smart watch and system
WO2023130567A1 (en) * 2022-01-06 2023-07-13 长鑫存储技术有限公司 Memory power consumption determination method and apparatus, storage medium and electronic device
CN116736076A (en) * 2023-05-12 2023-09-12 珠海妙存科技有限公司 Chip dormancy state detection method and system, electronic equipment and storage medium
CN116736076B (en) * 2023-05-12 2024-04-09 珠海妙存科技有限公司 Chip dormancy state detection method and system, electronic equipment and storage medium

Similar Documents

Publication Publication Date Title
CN107315673A (en) Power consumption monitoring method, mobile terminal and computer-readable recording medium
CN107027114A (en) A kind of SIM card switching method, equipment and computer-readable recording medium
CN107517494A (en) A kind of display methods of terminal battery electricity quantity, terminal and computer-readable recording medium
CN107463481A (en) Data interactive method, mobile terminal and storage medium
CN107343083A (en) One kind lifting game experiencing method, apparatus and computer-readable recording medium
CN107704571A (en) Information intelligent recommends method, apparatus and computer-readable recording medium
CN107566635A (en) Screen intensity method to set up, mobile terminal and computer-readable recording medium
CN107169150A (en) Picture method for pushing, mobile terminal and computer-readable medium
CN107885665A (en) With case script method of testing, mobile terminal and computer-readable recording medium
CN107613489A (en) A kind of wireless charging method, hotspot equipment, terminal and storage medium
CN107145385A (en) A kind of multitask interface display methods, mobile terminal and computer-readable storage medium
CN107682547A (en) A kind of voice messaging regulation and control method, equipment and computer-readable recording medium
CN107182097A (en) A kind of method for switching network, terminal and computer-readable recording medium
CN106953684A (en) A kind of method for searching star, mobile terminal and computer-readable recording medium
CN107181700A (en) Control method, mobile terminal and the storage medium of application program for mobile terminal
CN107193779A (en) Residue charging duration calculation method, terminal and computer-readable recording medium
CN107273035A (en) Application program recommends method and mobile terminal
CN109005574A (en) Cell selecting method, mobile terminal and computer readable storage medium
CN110007816A (en) A kind of display area determines method, terminal and computer readable storage medium
CN107566605A (en) A kind of interactive interface processing method, equipment and computer-readable recording medium
CN107181865A (en) Processing method, terminal and the computer-readable recording medium of unread short messages
CN107463324A (en) A kind of image display method, mobile terminal and computer-readable recording medium
CN107222853A (en) A kind of application management method, equipment and computer-readable recording medium
CN107390856A (en) A kind of method, mobile terminal and storage medium for reducing mobile terminal power consumption
CN107197101A (en) Audio regulation method, mobile terminal and computer-readable recording medium

Legal Events

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

Application publication date: 20171103