CN109521865A - Detection method, device, storage medium and the mobile terminal of power consumption application - Google Patents
Detection method, device, storage medium and the mobile terminal of power consumption application Download PDFInfo
- Publication number
- CN109521865A CN109521865A CN201811289676.1A CN201811289676A CN109521865A CN 109521865 A CN109521865 A CN 109521865A CN 201811289676 A CN201811289676 A CN 201811289676A CN 109521865 A CN109521865 A CN 109521865A
- Authority
- CN
- China
- Prior art keywords
- duration
- section
- lock
- application
- target application
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F1/00—Details not covered by groups G06F3/00 - G06F13/00 and G06F21/00
- G06F1/26—Power supply means, e.g. regulation thereof
- G06F1/32—Means for saving power
- G06F1/3203—Power management, i.e. event-based initiation of a power-saving mode
- G06F1/3206—Monitoring of events, devices or parameters that trigger a change in power modality
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Telephone Function (AREA)
Abstract
The disclosure is directed to detection method, device, storage medium and the mobile terminals of a kind of power consumption application, this method comprises: when apply first within the current detection period always hold lock duration be less than preset duration threshold value when, determine this first always hold lock duration in the group of duration section locating for duration section;When this first always hold lock duration and be in the first duration section for having minimum maximum time limit when, holding lock number and averagely hold lock duration within the current detection period is applied according to this, determines whether the application is that the exception of high power consumption is applied;When this first always hold lock duration and be in the second duration section in addition to the first duration section when, according to obtained in all detection cycles of application experience it is multiple always hold to lock duration and be in the section number in the second duration section determine whether the application is that the exception is applied.Lock status and power consumption condition progress comprehensive detection can be held to application by always holding lock duration, holding lock number and averagely holding lock duration, improve the accuracy of power consumption application detection.
Description
Technical field
This disclosure relates to mobile terminal application management field more particularly to a kind of power consumption application detection method, device, deposit
Storage media and mobile terminal.
Background technique
WakeLock (wake up lock) is a kind of lock mechanism applied in linux system and Android (Android) system, when having
When holding WakeLock using (or application program), processor will be constantly in working condition, without entering suspend mode shape
State.For example, mobile terminal screen, when screen is closed, some applications still need to wake up screen prompt user message.This
When just need to make to apply by WakeLock lock mechanism and can still be run in the case where mobile terminal screen is closed.But
In the various application of quantity abuse WakeLock lock mechanism also can for mobile terminal bring high power consumption the problem of, it is not necessary to or
Lock status is held in the abnormal application of person, for example, it is excessively frequent using holding lock overlong time whithin a period of time and/or holding lock number,
The electricity that will lead to mobile terminal is consumed excessively.In the related technology, usually with a length of foundation when holding lock of application, to power consumption
Higher abnormal application is detected and is handled.
Summary of the invention
To overcome the problems in correlation technique, the disclosure provides a kind of detection method of power consumption application, device, storage
Medium and mobile terminal.
According to the first aspect of the embodiments of the present disclosure, a kind of detection method of power consumption application is provided, which comprises
Obtain target application first always holding lock and duration and hold lock number within the current detection period;
When described first, which always holds lock duration, is less than preset duration threshold value, determine that described first always holds lock duration in duration area
Between duration section locating in group, duration section group includes multiple duration sections for having maximum time limit and duration lower limit;
When described first, which always holds lock duration, be in the first duration section, locks number and the target according to described hold and answer
Being averaged within the current detection period holds lock duration, determines whether the target application is that the exception of high power consumption is answered
With first duration section is the duration section for having minimum maximum time limit in the group of the duration section;
When described first, which always holds lock duration, is in the second duration section, according to the corresponding section in second duration section
Number determines whether the target application is the abnormal application, and second duration section is in the group of the duration section except institute
State any duration section outside the first duration section, the section number be the target application the current detection period with
And multiple first got in history detection cycle always hold the total degree that lock duration is in second duration section, it is described to go through
History detection cycle include the current detection period before multiple detection cycles.
Optionally, it is described when described first always hold lock duration be in the first duration section when, according to it is described hold lock number with
And lock duration is averagely held, determine whether the target application is that the abnormal of high power consumption is applied, comprising:
According to described first always hold lock duration and it is described hold lock number and determine described averagely hold lock duration;
When it is described hold lock number be greater than or equal to it is preset hold lock frequency threshold value, and it is described averagely hold lock duration be greater than or
Equal to it is preset averagely hold lock duration threshold value when, determine that the target application is the abnormal application.
Optionally, described when described first always holds lock duration and be in the second duration section, according to second duration area
Between corresponding section number determine whether the target application is the abnormal application, comprising:
The multiple lock durations of always holding for obtaining that the target application gets in the history detection cycle are in described the
The history section number in two duration sections;
Determine that the section number is that history section number adds one;
When the section number is less than preset section frequency threshold value, the section number is recorded, as current detection
The corresponding history section number in second duration section in detection cycle after period;
When the section number is greater than or equal to preset section frequency threshold value, determine that the target application is described different
Often application.
Optionally, the method also includes:
When described first, which always holds lock duration, is greater than or equal to the preset duration threshold value, determine the target application for institute
State abnormal application.
Optionally, the method also includes:
When determine the target application be it is described abnormal in application, according to preset implementation strategy to the abnormal application into
Row processing.
According to the second aspect of an embodiment of the present disclosure, a kind of detection device of power consumption application is provided, described device includes:
Hold lock detection module, for obtain target application within the current detection period first always hold lock duration and hold lock time
Number;
Section determining module, for determining described first when described first always holds lock duration and be less than preset duration threshold value
Always hold lock duration duration section locating in the group of duration section, duration section group include it is multiple have maximum time limit and when
The duration section of long lower limit;
First abnormality detection module, for when described first always hold lock duration be in the first duration section when, according to described
It holds lock number and the target application being averaged within the current detection period and holds lock duration, determine that the target application is
The no abnormal application for high power consumption, first duration section be have in the group of the duration section minimum maximum time limit when
Long section;
Second abnormality detection module, for when described first always hold lock duration be in the second duration section when, according to described
The corresponding section number in second duration section determines whether the target application is the abnormal application, second duration section
For any duration section in the group of the duration section in addition to first duration section, the section number is that the target is answered
The multiple lock durations of always holding got within the current detection period and history detection cycle are in second duration
The total degree in section, the history detection cycle include the current detection period before multiple detection cycles.
Optionally, the first abnormality detection module, comprising:
Duration determines submodule, for according to described first always hold lock duration and it is described hold lock number and determine described averagely hold
Lock duration;
First abnormal determining submodule, for when it is described hold lock number and be greater than or equal to hold lock frequency threshold value, and it is described
When averagely holding lock duration more than or equal to lock duration threshold value is averagely held, determine that the target application is the abnormal application.
Optionally, the second abnormality detection module, comprising:
First time number determines submodule, gets for obtaining the target application in the history detection cycle more
A history section number always held lock duration and be in second duration section;
Second time number determines submodule, for determining that the section number is that history section number adds one;
Number record sub module, for recording the area when the section number is less than preset section frequency threshold value
Between number, as the corresponding history section number in the second duration section described in the detection cycle after the current detection period;
Second abnormal determining submodule is used for when the section number is greater than or equal to preset section frequency threshold value,
Determine that the target application is the abnormal application.
Optionally, described device further include:
Third abnormality detection module always holds lock duration more than or equal to the preset duration threshold value for working as described first
When, determine that the target application is the abnormal application.
Optionally, described device further include:
Exception processing module, for being the exception in application, according to preset execution plan when the determining target application
Slightly the abnormal application is handled.
According to the third aspect of an embodiment of the present disclosure, a kind of computer readable storage medium is provided, calculating is stored thereon with
Machine program instruction realizes the detection side of the application of power consumption provided by the disclosure first aspect when program instruction is executed by processor
The step of method.
According to a fourth aspect of embodiments of the present disclosure, a kind of mobile terminal is provided, comprising: disclosure second aspect is provided
Power consumption application detection device.
Technical solution provided by embodiment of the disclosure can obtain first of target application within the current detection period
It always holds lock duration and holds lock number;When this first always hold lock duration and be less than preset duration threshold value when, determine this first when always holding lock
Grow in the group of duration section locating duration section, the duration section group include it is multiple have maximum time limit and duration lower limit when
Long section;When this first always hold lock duration and be in the first duration section when, held according to this and lock number and the target application at this
Being averaged in the current detection period holds lock duration, determine the target application whether be high power consumption abnormal application, this first when
Long section is the duration section for having minimum maximum time limit in the duration section group;When this first always hold lock duration be in second when
When long section, according to the second duration section, corresponding section number determines whether the target application is exception application, this
Two duration sections are any duration section in the duration section group in addition to the first duration section, which is the target
Using multiple first got in detection cycle in this prior and history detection cycle always hold lock duration be in this second when
The total degree in long section, the history detection cycle include the current detection cycle before multiple detection cycles.It can be by total
Lock duration is held, lock number is held and averagely holds lock duration, lock status and power consumption condition progress comprehensive detection are held to application, improved
The accuracy of power consumption application detection.
It should be understood that above general description and following detailed description be only it is exemplary and explanatory, not
The disclosure can be limited.
Detailed description of the invention
The drawings herein are incorporated into the specification and forms part of this specification, and shows the implementation for meeting the disclosure
Example, and together with specification for explaining the principles of this disclosure.
Fig. 1 is a kind of flow chart of the detection method of power consumption application shown according to an exemplary embodiment;
Fig. 2 is according to a kind of flow chart for the detection method that power consumption is applied extremely shown in fig. 1;
Fig. 3 is the flow chart for the detection method applied extremely according to another power consumption shown in fig. 1;
Fig. 4 is the flow chart according to the detection method of another power consumption application shown in fig. 1;
Fig. 5 is the flow chart according to the detection method of another power consumption application shown in Fig. 4;
Fig. 6 is a kind of block diagram of the detection device of power consumption application shown according to an exemplary embodiment;
Fig. 7 is the block diagram according to one kind the first abnormality detection module shown in Fig. 6;
Fig. 8 is the block diagram according to one kind the second abnormality detection module shown in Fig. 6;
Fig. 9 is the block diagram according to the detection device of another power consumption application shown in Fig. 6;
Figure 10 is the block diagram according to the detection device of another power consumption application shown in Fig. 9;
Figure 11 is the block diagram of a kind of electronic equipment shown according to an exemplary embodiment.
Specific embodiment
Example embodiments are described in detail here, and the example is illustrated in the accompanying drawings.Following description is related to
When attached drawing, unless otherwise indicated, the same numbers in different drawings indicate the same or similar elements.Following exemplary embodiment
Described in embodiment do not represent all implementations consistent with this disclosure.On the contrary, they be only with it is such as appended
The example of the consistent device and method of some aspects be described in detail in claims, the disclosure.
Before introducing the detection method of power consumption application of disclosure offer, first to involved by embodiment each in the disclosure
And target application scene be introduced, the target application scene include a mobile terminal, the mobile terminal be can run
The mobile terminal of linux system and Android (Android) system and application WakeLock (waking up lock) mechanism.The mobile terminal can
Think, for example, smart phone, tablet computer, smart television, smartwatch, PDA (English: Personal Digital
Assistant, Chinese: personal digital assistant) etc. mobile terminals.
Fig. 1 is a kind of flow chart of the detection method of power consumption application shown according to an exemplary embodiment, such as Fig. 1 institute
Show, applied to mobile terminal described in above-mentioned application scenarios, method includes the following steps:
In a step 101, target application first always holding lock and duration and hold lock number within the current detection period is obtained.
Illustratively, an a length of detection cycle is (due to user when can be with used in mobile terminal one lattice electricity of every consumption
Be to mobile terminal use it is irregular, the time used in one lattice electricity of every consumption is not quite similar, therefore with this rule setting
The duration of each detection cycle is also not quite similar), or the when a length of detection cycle to set in advance.In a detection cycle
In, which may hold lock repeatedly and decontrol again.Therefore, this first always holds when lock a length of target application in current detection
The summation for repeatedly holding the lasting duration of lock status in period, it is the target application within the current detection period that this, which holds lock number,
In holding lock status number.It should be noted that the detection method of power consumption application can be simultaneously to the institute in the mobile terminal
Have application hold lock status detect and and then determine it is each using power consumption condition, in the present embodiment, only to answer one
It is illustrated for being detected with the power consumption of (i.e. target application).
In a step 102, when this first always hold lock duration and be less than preset duration threshold value when, determine that this first always holds lock duration
The locating duration section in the group of duration section.
Wherein, which includes multiple duration sections for having maximum time limit and duration lower limit.This first is always held
To lock duration can be a specific time span, for example, 1 minute, or be time span detection cycle in this prior
Shared ratio in duration, for example, the current detection cycle when it is 30 minutes a length of, this holds the total of the lasting duration of lock status
Be 15 minutes, at this point, this first always hold lock duration can be for 50%.Likewise, the preset duration threshold value may be one
It is preset to hold lock duration or ratio.
Illustratively, when this first always hold lock duration be greater than or equal to preset duration threshold value when, can directly assert the target
Lock status is held using there is exception, and determines that the target application is the abnormal application of high power consumption in turn.But some are applied
It is above-mentioned based on the detection step for holding lock duration to get around that developer can hold lock number by increase, the scheme of lock duration is held in shortening
Suddenly, to avoid corresponding power consumption control.Therefore, even if determining that this first always holds lock duration less than preset duration threshold value,
It can lock duration or duration section by holding lock number and averagely holding (as described in the following steps 103 and 104) and continue to the mesh
The lock status of holding of mark application is determined.
Specifically, the duration minimum value (i.e. 0) that can will likely occur is divided to the duration between the preset duration threshold value
For multiple duration sections (i.e. the duration section group).For example, the preset duration threshold value be 50%, can be set (50%, 40%),
(40%, 30%), (30%, 20%), (20%, 10%) and (10%, 0) this five duration sections, in this way, when this is first total
When a length of 35% when holding lock, it is believed that this first always hold lock duration be in duration section (40%, 30%), wherein this 40%
For above-mentioned maximum time limit, this 30% is above-mentioned duration lower limit.
In step 103, when this first always hold lock duration be in the first duration section when, according to this hold lock number and this
Being averaged in detection cycle holds lock duration to target application in this prior, determines whether the target application is that the exception of high power consumption is answered
With.
Wherein, which is the duration section for having minimum maximum time limit in the duration section group.For example,
In above-mentioned example, duration section (10%, 0) is the first duration section, and practical the first duration section is always to hold lock duration
An abnormal criterion.When this first always hold lock duration be not in the first duration section when, it is believed that the target
Using there may be abnormal the case where holding lock.When this first always hold lock duration be in the first duration section when, it is believed that
The lock status of holding of the target application is normal at least on holding lock this standard of duration.And in order to cope with bypass as described above
It, can detection cycle holds lock in this prior according to the target application based on the application and development scheme for the detecting step for holding lock duration
Number and hold every time lock duration average value, the lock status of holding of the target application is further detected.
At step 104, when this first always hold lock duration be in the second duration section when, according to the second duration section pair
The section number answered determines whether the target application is exception application.
Wherein, which is any duration section in the duration section group in addition to the first duration section,
It is multiple when always holding lock to be that the target application is got in detection cycle and history detection cycle in this prior for the section number
The long total degree for being in the second duration section, multiple detections before which includes the current detection cycle are all
Phase.
Illustratively, when this first always hold lock duration be not in the first duration section when, it is believed that the target application
There may be abnormal the case where holding lock.Lock status is held in passing detection cycle according to the target application, to above situation
Further detected.Specifically, for example, the duration section in the duration section group in addition to the first duration section includes:
(50%, 40%), (40%, 30%), (30%, 20%) and (20%, 10%) this four duration sections, wherein each duration
Section corresponds to a section number, also, each duration section also corresponds to a preset section frequency threshold value.The section number
For in the target application all detection cycles (including the current detection cycle) experienced, what is got always holds lock duration
Number in some duration section.When the section number is greater than or equal to the section frequency threshold value, it is believed that determine
The target application is abnormal application.
In conclusion technical solution provided by embodiment of the disclosure, can obtain target application in current detection week
First in phase always holds lock duration and holds lock number;When this first always hold lock duration and be less than preset duration threshold value when, determine this
One always holds lock duration duration section locating in the group of duration section, the duration section group include it is multiple have maximum time limit and when
The duration section of long lower limit;When this first always hold lock duration and be in the first duration section when, held according to this and lock number and the mesh
Being averaged in detection cycle holds lock duration in this prior for mark application, determines whether the target application is that the exception of high power consumption is answered
With the first duration section is the duration section for having minimum maximum time limit in the duration section group;When this first always hold lock when
When length is in the second duration section, according to the second duration section, corresponding section number determines whether the target application is that this is different
Often application, the second duration section are any duration section in the duration section group in addition to the first duration section, the section
Number be the target application get in detection cycle and history detection cycle in this prior multiple first always hold lock duration
Total degree in the second duration section, multiple detections before which includes the current detection cycle are all
Phase.Lock status and power consumption condition progress can be held to application by always holding lock duration, holding lock number and averagely holding lock duration
Comprehensive detection improves the accuracy of power consumption application detection.
Fig. 2 is according to a kind of flow chart for the detection method that power consumption is applied extremely shown in fig. 1, as shown in Fig. 2, the step
103, comprising: step 1031 and 1032.
In step 1031, according to this first always hold lock duration and this hold lock number determine that this averagely holds lock duration.
In step 1032, lock frequency threshold value is held more than or equal to preset when this holds lock number, and this averagely holds lock
Duration be greater than or equal to it is preset averagely hold lock duration threshold value when, determine the target application be the exception apply.
Illustratively, this averagely hold lock duration be this first always hold lock duration divided by this hold lock number calculated result.When
This hold lock number be greater than or equal to it is preset hold lock frequency threshold value and this averagely hold lock duration be greater than or equal to it is preset average
When holding lock the two conditions of duration threshold value while meeting, the target application can be determined for exception application.When above-mentioned two
When having at least one to be unsatisfactory in part, can determine the target application not is exception application.
Fig. 3 is the flow chart for the detection method applied extremely according to another power consumption shown in fig. 1, as shown in figure 3, the step
Rapid 104, comprising: step 1041-1043 or step 1041,1042 and 1044.
In step 1041, multiple strong points when always holding lock for obtaining that the target application gets in the history detection cycle
History section number in the second duration section.
In step 1042, determine that the section number is that the history section number adds one.
In step 1043, when the section number is less than preset section frequency threshold value, the section number is recorded, as
The corresponding history section number in the second duration section in detection cycle after the current detection period.
In step 1044, when the section number is greater than or equal to preset section frequency threshold value, determine that the target is answered
It is applied extremely with for this.
Illustratively, which is recorded in the storage module of mobile terminal, when
This first always holds lock duration when being in the second duration section, obtains the history section number, the area from the storage module first
Between number be then that the history section number adds one.For example, the history section number in the second duration section (50%, 40%) is 3
Secondary, which is 4 times.The section frequency threshold value is set as 4 times, then can determine the section number 4 times and be equal to the section
Frequency threshold value, and then determine that the target application is that this is applied extremely.Alternatively, being less than preset section when the section number (4 times)
When frequency threshold value (5 times), the section number (4 times) is recorded, specially by the history section stored originally in the storage module time
Number (3 times) is updated to the section number (4 times).In this way, if what is got in detection cycle hereafter always holds lock duration again
In the second duration section, then it can be counted and be judged on the basis of history section number (4 times).
It should be noted that can be according to the maximum time limit in duration section and the size sequence of duration lower limit to the section time
Number threshold value is configured, and the maximum time limit and the duration lower limit are bigger, and the section frequency threshold value is smaller for example, duration section
(50%, 40%), (40%, 30%), (30%, 20%) and (20%, 10%) corresponding section frequency threshold value is respectively 2 times, 3
It is secondary, 4 times and 5 times.As can be seen that longer always holds lock duration, the number for allowing it to occur is fewer.
Fig. 4 is according to the flow chart of the detection method of another power consumption application shown in fig. 1, as shown in figure 4, in above-mentioned step
After rapid 101, this method further include:
In step 105, when this first always hold lock duration be greater than or equal to the preset duration threshold value when, determine that the target is answered
It is applied extremely with for this.
Fig. 5 is according to the flow chart of the detection method of another power consumption application shown in Fig. 4, as shown in figure 4, in above-mentioned step
After rapid 103,104 and 105, this method further include:
In step 106, when determine the target application be the exception in application, according to preset implementation strategy to the exception
Using being handled.
Illustratively, after determining that the target application is that this is applied extremely according to above-mentioned steps 103,104 and 105, Ke Yigen
According to preset implementation strategy to detecting that abnormal conditions handle, to mitigate the power consumption burden of mobile terminal.The implementation strategy
It may include: to cancel the exception to be somebody's turn to do using the relevant process of lock, the running background permission for forbidding this to apply extremely or output is held
The abnormal prompt information etc. excessive using power consumption.
In conclusion technical solution provided by embodiment of the disclosure, can obtain target application in current detection week
First in phase always holds lock duration and holds lock number;When this first always hold lock duration and be less than preset duration threshold value when, determine this
One always holds lock duration duration section locating in the group of duration section, the duration section group include it is multiple have maximum time limit and when
The duration section of long lower limit;When this first always hold lock duration and be in the first duration section when, held according to this and lock number and the mesh
Being averaged in detection cycle holds lock duration in this prior for mark application, determines whether the target application is that the exception of high power consumption is answered
With the first duration section is the duration section for having minimum maximum time limit in the duration section group;When this first always hold lock when
When length is in the second duration section, according to the second duration section, corresponding section number determines whether the target application is that this is different
Often application, the second duration section are any duration section in the duration section group in addition to the first duration section, the section
Number be the target application get in detection cycle and history detection cycle in this prior multiple first always hold lock duration
Total degree in the second duration section, multiple detections before which includes the current detection cycle are all
Phase.Lock status and power consumption condition progress can be held to application by always holding lock duration, holding lock number and averagely holding lock duration
Comprehensive detection, and then the abnormal application detected is handled, the accuracy of power consumption application detection is improved, to mobile terminal
Power consumption effectively managed, improve user experience.
Fig. 6 is a kind of block diagram of the detection device of power consumption application shown according to an exemplary embodiment, as shown in fig. 6,
Applied to mobile terminal described in above-mentioned application scenarios, which includes:
Lock detection module 610 is held, for obtaining target application first always holding lock and duration and hold within the current detection period
Lock number;
Section determining module 620, for when this first always hold lock duration and be less than preset duration threshold value when, determine that this is first total
Lock duration duration section locating in the group of duration section is held, which has under maximum time limit and duration comprising multiple
The duration section of limit;
First abnormality detection module 630, for when this first always hold lock duration be in the first duration section when, held according to this
Being averaged in detection cycle holds lock duration in this prior for lock number and the target application, determines whether the target application is high consumption
The abnormal application of electricity, the first duration section are the duration section for having minimum maximum time limit in the duration section group;
Second abnormality detection module 640, for when this first always hold lock duration and be in the second duration section when, according to this
The corresponding section number in two duration sections determines whether the target application is exception application, which is the duration
Any duration section in the group of section in addition to the first duration section, the section number are that the target application detects week in this prior
The multiple total degrees always held lock duration and be in the second duration section got in phase and history detection cycle, history inspection
Survey the period include the current detection cycle before multiple detection cycles.
Fig. 7 is according to the block diagram of one kind the first abnormality detection module shown in Fig. 6, as shown in fig. 7, first abnormality detection
Module 530, comprising:
Duration determines submodule 531, for according to this first always hold lock duration and this hold lock number determine that this averagely holds lock
Duration;
First abnormal determining submodule 532, for holding lock frequency threshold value when this is held lock number and is greater than or equal to, and this is flat
When holding lock duration more than or equal to lock duration threshold value is averagely held, determine the target application for exception application.
Fig. 8 is according to the block diagram of one kind the second abnormality detection module shown in Fig. 6, as shown in figure 8, second abnormality detection
Module 640, comprising:
First time number determines submodule 641, gets for obtaining the target application in the history detection cycle more
A history section number always held lock duration and be in the second duration section;
Second time number determines submodule 642, for determining that the section number is that the history section number adds one;
Number record sub module 643, for recording the section when the section number is less than preset section frequency threshold value
Number, as the corresponding history section number in the second duration section in the detection cycle after the current detection period;
Second abnormal determining submodule 644 is used for when the section number is greater than or equal to preset section frequency threshold value,
Determine the target application for exception application.
Fig. 9 is according to the block diagram of the detection device of another power consumption application shown in Fig. 6, as shown in figure 9, the device 600
Further include:
Third abnormality detection module 650, for when this first always hold lock duration be greater than or equal to the preset duration threshold value when,
Determine the target application for exception application.
Figure 10 is according to the block diagram of the detection device of another power consumption application shown in Fig. 9, as shown in Figure 10, the device
600 further include:
Exception processing module 660, for being that this is abnormal in application, according to preset implementation strategy when the determining target application
Exception application is handled.
In conclusion technical solution provided by embodiment of the disclosure, can obtain target application in current detection week
First in phase always holds lock duration and holds lock number;When this first always hold lock duration and be less than preset duration threshold value when, determine this
One always holds lock duration duration section locating in the group of duration section, the duration section group include it is multiple have maximum time limit and when
The duration section of long lower limit;When this first always hold lock duration and be in the first duration section when, held according to this and lock number and the mesh
Being averaged in detection cycle holds lock duration in this prior for mark application, determines whether the target application is that the exception of high power consumption is answered
With the first duration section is the duration section for having minimum maximum time limit in the duration section group;When this first always hold lock when
When length is in the second duration section, according to the second duration section, corresponding section number determines whether the target application is that this is different
Often application, the second duration section are any duration section in the duration section group in addition to the first duration section, the section
Number be the target application get in detection cycle and history detection cycle in this prior multiple first always hold lock duration
Total degree in the second duration section, multiple detections before which includes the current detection cycle are all
Phase.Lock status and power consumption condition progress can be held to application by always holding lock duration, holding lock number and averagely holding lock duration
Comprehensive detection, and then the abnormal application detected is handled, the accuracy of power consumption application detection is improved, to mobile terminal
Power consumption effectively managed, improve user experience.
Figure 11 is the block diagram of a kind of electronic equipment shown according to an exemplary embodiment.The electronic equipment 1100 is movement
Terminal, the electronic equipment 1100 include the detection method of power consumption application shown in above-mentioned Fig. 1 to Fig. 5 is any.
Referring to Fig.1 1, electronic equipment 1100 may include following one or more components: processing component 1102, memory
1104, electric power assembly 1106, multimedia component 1108, audio component 1110, the interface 1112 of input/output (I/O), sensor
Component 1114 and communication component 11111.
The integrated operation of the usual control device 1100 of processing component 1102, such as with display, telephone call, data communication,
Camera operation and record operate associated operation.Processing component 1102 may include one or more processors 1120 to execute
Instruction, to complete all or part of the steps of the detection method of above-mentioned power consumption application.In addition, processing component 1102 may include
One or more modules, convenient for the interaction between processing component 1102 and other assemblies.For example, processing component 1102 may include
Multi-media module, to facilitate the interaction between multimedia component 1108 and processing component 1102.
Memory 1104 is configured as storing various types of data to support the operation in device 1100.These data
Example includes the instruction for any destination application operated on device 1100 or method, contact data, telephone directory
Data, message, picture, video etc..Memory 1104 can by any kind of volatibility or non-volatile memory device or
Their combination realizes that, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM) can
Erasable programmable read-only memory (EPROM) (EPROM), programmable read only memory (PROM), read-only memory (ROM), magnetic memory,
Flash memory, disk or CD.
Electric power assembly 1106 provides electric power for the various assemblies of device 1100.Electric power assembly 11011 may include power supply pipe
Reason system, one or more power supplys and other with for device 1100 generate, manage, and distribute the associated component of electric power.
Multimedia component 1108 includes the screen of one output interface of offer between described device 1100 and user.?
In some embodiments, screen may include liquid crystal display (LCD) and touch panel (TP).If screen includes touch panel,
Screen may be implemented as touch screen, to receive input signal from the user.Touch panel includes that one or more touch passes
Sensor is to sense the gesture on touch, slide, and touch panel.The touch sensor can not only sense touch or sliding is dynamic
The boundary of work, but also detect duration and pressure associated with the touch or slide operation.In some embodiments, more
Media component 1108 includes a front camera and/or rear camera.When device 1100 is in operation mode, as shot mould
When formula or video mode, front camera and/or rear camera can receive external multi-medium data.Each preposition camera shooting
Head and rear camera can be a fixed optical lens system or have focusing and optical zoom capabilities.
Audio component 1110 is configured as output and/or input audio signal.For example, audio component 1110 includes a wheat
Gram wind (MIC), when device 1100 is in operation mode, when such as call mode, recording mode, and voice recognition mode, microphone quilt
It is configured to receive external audio signal.The received audio signal can be further stored in memory 1104 or via communication
Component 11111 is sent.In some embodiments, audio component 1110 further includes a loudspeaker, is used for output audio signal.
I/O interface 1112 provides interface, above-mentioned peripheral interface module between processing component 1102 and peripheral interface module
It can be keyboard, click wheel, button etc..These buttons may include, but are not limited to: home button, volume button, start button and
Locking press button.
Sensor module 1114 includes one or more sensors, and the state for providing various aspects for device 1100 is commented
Estimate.For example, sensor module 1114 can detecte the state that opens/closes of device 1100, the relative positioning of component, such as institute
The display and keypad that component is device 1100 are stated, sensor module 1114 can be with detection device 1100 or device 1,100 1
The position change of a component, the existence or non-existence that user contacts with device 1100,1100 orientation of device or acceleration/deceleration and dress
Set 1100 temperature change.Sensor module 1114 may include proximity sensor, be configured in not any physics
It is detected the presence of nearby objects when contact.Sensor module 1114 can also include optical sensor, as CMOS or ccd image are sensed
Device, for being used in imageable target is applied.In some embodiments, which can also include that acceleration passes
Sensor, gyro sensor, Magnetic Sensor, pressure sensor or temperature sensor.
Communication component 1116 is configured to facilitate the communication of wired or wireless way between device 1100 and other equipment.Dress
The wireless network based on communication standard, such as WiFi can be accessed by setting 1100,2G or 11G or their combination.It is exemplary at one
In embodiment, communication component 1116 receives broadcast singal or broadcast correlation from external broadcasting management system via broadcast channel
Information.In one exemplary embodiment, the communication component 1116 further includes near-field communication (NFC) module, to promote short distance
Communication.For example, radio frequency identification (RFID) technology, Infrared Data Association (IrDA) technology, ultra wide band can be based in NFC module
(UWB) technology, bluetooth (BT) technology and other technologies are realized.
In the exemplary embodiment, device 1100 can by one or more target application specific integrated circuits (ASIC),
Digital signal processor (DSP), digital signal processing appts (DSPD), programmable logic device (PLD), field-programmable gate array
It arranges (FPGA), controller, microcontroller, microprocessor or other electronic components to realize, for executing the inspection of above-mentioned power consumption application
Survey method.
In the exemplary embodiment, a kind of non-transitorycomputer readable storage medium including instruction, example are additionally provided
It such as include the memory 1104 of instruction, above-metioned instruction can be executed by the processor 1120 of device 1100 to complete above-mentioned power consumption application
Detection method.For example, the non-transitorycomputer readable storage medium can be ROM, random access memory (RAM),
CD-ROM, tape, floppy disk and optical data storage devices etc..The disclosure can be reduced when positioning wlan device position to WLAN
The dependence of the signal strength of equipment keeps the error precision of positioning controllable, improves the accuracy of positioning.
Those skilled in the art will readily occur to other embodiment party of the disclosure after considering specification and practicing the disclosure
Case.This application is intended to cover any variations, uses, or adaptations of the disclosure, these modifications, purposes or adaptability
Variation follows the general principles of this disclosure and including the undocumented common knowledge or usual skill in the art of the disclosure
Art means.The description and examples are only to be considered as illustrative, and the true scope and spirit of the disclosure are by following claim
It points out.
It should be understood that the present disclosure is not limited to the precise structures that have been described above and shown in the drawings, and
And various modifications and changes may be made without departing from the scope thereof.The scope of the present disclosure is only limited by the accompanying claims.
Claims (12)
1. a kind of detection method of power consumption application, which is characterized in that the described method includes:
Obtain target application first always holding lock and duration and hold lock number within the current detection period;
When described first, which always holds lock duration, is less than preset duration threshold value, determine that described first always holds lock duration in duration section group
In locating duration section, duration section group includes multiple duration sections for having maximum time limit and duration lower limit;
When described first, which always holds lock duration, be in the first duration section, locks number and the target application according to described hold and exist
Being averaged in the current detection period holds lock duration, determines whether the target application is that the abnormal of high power consumption is applied, institute
Stating the first duration section is the duration section for having minimum maximum time limit in the group of the duration section;
When described first, which always holds lock duration, is in the second duration section, according to the corresponding section number in second duration section
Determine whether the target application is the abnormal application, second duration section is in the group of the duration section except described the
Any duration section outside one duration section, the section number are that the target application in the current detection period and is gone through
The multiple total degrees always held lock duration and be in second duration section got in history detection cycle, the history detection week
Phase include the current detection period before multiple detection cycles.
2. the method according to claim 1, wherein it is described when described first always hold lock duration be in the first duration
When section, according to it is described hold lock number and the target application being averaged within the current detection period hold lock duration, really
Whether the fixed target application is that the abnormal of high power consumption is applied, comprising:
According to described first always hold lock duration and it is described hold lock number and determine described averagely hold lock duration;
When it is described hold lock number be greater than or equal to it is preset hold lock frequency threshold value, and it is described averagely hold lock duration be greater than or equal to
It is preset when averagely holding lock duration threshold value, determine that the target application is the abnormal application.
3. the method according to claim 1, wherein it is described when described first always hold lock duration be in the second duration
When section, determine whether the target application is the abnormal application according to the corresponding section number in second duration section,
Include:
Obtain that the target application gets in the history detection cycle is multiple when always holding lock duration and being in described second
The history section number in long section;
Determine that the section number is that history section number adds one;
When the section number is less than preset section frequency threshold value, the section number is recorded, as the current detection period
The corresponding history section number in second duration section in detection cycle later;
When the section number is greater than or equal to preset section frequency threshold value, determine that the target application is that the exception is answered
With.
4. the method according to claim 1, wherein the method also includes:
When described first, which always holds lock duration, is greater than or equal to the preset duration threshold value, determine that the target application is described different
Often application.
5. the method according to any one of claim 2-4, which is characterized in that the method also includes:
When determine the target application be it is described abnormal in application, according to preset implementation strategy to the abnormal application at
Reason.
6. a kind of detection device of power consumption application, which is characterized in that described device includes:
Lock detection module is held, for obtaining target application first always holding lock and duration and hold lock number within the current detection period;
Section determining module, for determining that described first always holds when described first always holds lock duration and be less than preset duration threshold value
Duration duration section locating in the group of duration section is locked, duration section group has under maximum time limit and duration comprising multiple
The duration section of limit;
First abnormality detection module, for holding lock according to described when described first always holds lock duration and be in the first duration section
Number and the target application being averaged within the current detection period hold lock duration, determine the target application whether be
The abnormal application of high power consumption, first duration section are the duration area for having minimum maximum time limit in the group of the duration section
Between;
Second abnormality detection module, for when described first always hold lock duration be in the second duration section when, according to described second
The corresponding section number in duration section determines whether the target application is the abnormal application, and second duration section is institute
Any duration section in the group of duration section in addition to first duration section is stated, the section number is that the target application exists
The multiple lock durations of always holding got in the current detection period and history detection cycle are in second duration section
Total degree, the history detection cycle include the current detection period before multiple detection cycles.
7. device according to claim 6, which is characterized in that the first abnormality detection module, comprising:
Duration determines submodule, for according to described first always hold lock duration and it is described hold lock number determine it is described averagely hold lock when
It is long;
First abnormal determining submodule, for when it is described hold lock number and be greater than or equal to hold lock frequency threshold value, and it is described average
When holding lock duration more than or equal to lock duration threshold value is averagely held, determine that the target application is the abnormal application.
8. device according to claim 6, which is characterized in that the second abnormality detection module, comprising:
First time number determines submodule, multiple total for obtain that the target application gets in the history detection cycle
Hold the history section number that lock duration is in second duration section;
Second time number determines submodule, for determining that the section number is that history section number adds one;
Number record sub module, for recording the section time when the section number is less than preset section frequency threshold value
Number, as the corresponding history section number in the second duration section described in the detection cycle after the current detection period;
Second abnormal determining submodule, for determining when the section number is greater than or equal to preset section frequency threshold value
The target application is the abnormal application.
9. device according to claim 6, which is characterized in that described device further include:
Third abnormality detection module, for when described first always hold lock duration be greater than or equal to the preset duration threshold value when, really
The fixed target application is the abnormal application.
10. the device according to any one of claim 7-9, which is characterized in that described device further include:
Exception processing module, for being the exception in application, according to preset implementation strategy pair when the determining target application
The abnormal application is handled.
11. a kind of computer readable storage medium, is stored thereon with computer program instructions, which is characterized in that the program instruction
The step of any one of claim 1-5 the method is realized when being executed by processor.
12. a kind of mobile terminal characterized by comprising the detection of the application of power consumption described in any one of claim 6-10
Device.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811289676.1A CN109521865B (en) | 2018-10-31 | 2018-10-31 | Power consumption application detection method and device, storage medium and mobile terminal |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811289676.1A CN109521865B (en) | 2018-10-31 | 2018-10-31 | Power consumption application detection method and device, storage medium and mobile terminal |
Publications (2)
Publication Number | Publication Date |
---|---|
CN109521865A true CN109521865A (en) | 2019-03-26 |
CN109521865B CN109521865B (en) | 2020-07-03 |
Family
ID=65773066
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201811289676.1A Active CN109521865B (en) | 2018-10-31 | 2018-10-31 | Power consumption application detection method and device, storage medium and mobile terminal |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN109521865B (en) |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
GB2446168A (en) * | 2007-01-30 | 2008-08-06 | Third Sense Ltd | Reducing the power consumed from a battery |
CN103412636A (en) * | 2013-08-05 | 2013-11-27 | Tcl通讯(宁波)有限公司 | Power saving system and power saving method of intelligent terminal |
CN103729052A (en) * | 2013-12-31 | 2014-04-16 | 贝壳网际(北京)安全技术有限公司 | Processing method and system for power consumption of application program and mobile terminal |
CN106020415A (en) * | 2016-05-09 | 2016-10-12 | 深圳市万普拉斯科技有限公司 | Application control method and apparatus for intelligent device in standby state |
CN107450704A (en) * | 2016-05-31 | 2017-12-08 | 中兴通讯股份有限公司 | A kind of control method, device and the terminal of terminal abnormal power consumption |
CN107506019A (en) * | 2017-08-07 | 2017-12-22 | 北京小米移动软件有限公司 | Management method and device, terminal, the storage medium of application program |
-
2018
- 2018-10-31 CN CN201811289676.1A patent/CN109521865B/en active Active
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
GB2446168A (en) * | 2007-01-30 | 2008-08-06 | Third Sense Ltd | Reducing the power consumed from a battery |
CN103412636A (en) * | 2013-08-05 | 2013-11-27 | Tcl通讯(宁波)有限公司 | Power saving system and power saving method of intelligent terminal |
CN103729052A (en) * | 2013-12-31 | 2014-04-16 | 贝壳网际(北京)安全技术有限公司 | Processing method and system for power consumption of application program and mobile terminal |
CN106020415A (en) * | 2016-05-09 | 2016-10-12 | 深圳市万普拉斯科技有限公司 | Application control method and apparatus for intelligent device in standby state |
CN107450704A (en) * | 2016-05-31 | 2017-12-08 | 中兴通讯股份有限公司 | A kind of control method, device and the terminal of terminal abnormal power consumption |
CN107506019A (en) * | 2017-08-07 | 2017-12-22 | 北京小米移动软件有限公司 | Management method and device, terminal, the storage medium of application program |
Non-Patent Citations (1)
Title |
---|
常媛: "基于安卓系统的恶意行为检测方法研究", 《中国优秀硕士学位论文全文数据库 信息科技辑(月刊)》 * |
Also Published As
Publication number | Publication date |
---|---|
CN109521865B (en) | 2020-07-03 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN106454336B (en) | The method and device and terminal that detection terminal camera is blocked | |
CN104376239B (en) | The unlocking method and a device of terminal | |
CN106547663B (en) | Key management method and device | |
CN105554255B (en) | Method of controlling operation thereof and device for terminal device | |
CN107608561A (en) | Touch-screen control method and device | |
CN108132813B (en) | Function locking method and device of application program and electronic equipment | |
CN109375967A (en) | Application Program Interface display methods and device, mobile terminal and storage medium | |
CN107515749A (en) | Starting-up method, device and the electronic equipment of electronic equipment | |
CN106407079A (en) | Mobile terminal charging prompting method, device and equipment | |
CN104980662A (en) | Method for adjusting imaging style in shooting process, device thereof and imaging device | |
CN107426489A (en) | Processing method, device and terminal during shooting image | |
CN108958574A (en) | Briefing method, apparatus and storage medium | |
CN106299515B (en) | Charging method and device | |
CN105653903B (en) | The management method and device of application program permission | |
CN106775240B (en) | Triggering method, device and the terminal of application program | |
CN106228077B (en) | It handles image and shows the method, apparatus and terminal of image | |
CN105607979A (en) | Network interconnection control method and device | |
CN108153488A (en) | Data increase method and device certainly | |
CN106101372B (en) | Using prompting setting method and device | |
CN105957011B (en) | Image processing method and device | |
CN111651441A (en) | Data processing method and device and computer storage medium | |
CN106201738A (en) | System broadcasts call method and device | |
CN106293717A (en) | The processing method of the setting of terminal, device and terminal | |
CN105677435A (en) | Function invoking method, apparatus and terminal | |
CN109521865A (en) | Detection method, device, storage medium and the mobile terminal of power consumption application |
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 | ||
GR01 | Patent grant | ||
GR01 | Patent grant |