CN109521865B - Power consumption application detection method and device, storage medium and mobile terminal - Google Patents

Power consumption application detection method and device, storage medium and mobile terminal Download PDF

Info

Publication number
CN109521865B
CN109521865B CN201811289676.1A CN201811289676A CN109521865B CN 109521865 B CN109521865 B CN 109521865B CN 201811289676 A CN201811289676 A CN 201811289676A CN 109521865 B CN109521865 B CN 109521865B
Authority
CN
China
Prior art keywords
duration
interval
lock holding
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.)
Active
Application number
CN201811289676.1A
Other languages
Chinese (zh)
Other versions
CN109521865A (en
Inventor
陈俊国
赵璐璐
邱峰
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Xiaomi Mobile Software Co Ltd
Original Assignee
Beijing Xiaomi Mobile Software Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Xiaomi Mobile Software Co Ltd filed Critical Beijing Xiaomi Mobile Software Co Ltd
Priority to CN201811289676.1A priority Critical patent/CN109521865B/en
Publication of CN109521865A publication Critical patent/CN109521865A/en
Application granted granted Critical
Publication of CN109521865B publication Critical patent/CN109521865B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F1/00Details not covered by groups G06F3/00 - G06F13/00 and G06F21/00
    • G06F1/26Power supply means, e.g. regulation thereof
    • G06F1/32Means for saving power
    • G06F1/3203Power management, i.e. event-based initiation of a power-saving mode
    • G06F1/3206Monitoring of events, devices or parameters that trigger a change in power modality

Abstract

The present disclosure relates to a method, an apparatus, a storage medium, and a mobile terminal for detecting a power consuming application, the method including: when the first total lock holding duration applied in the current detection period is smaller than a preset duration threshold, determining a duration interval of the first total lock holding duration in a duration interval group; when the first total lock holding duration is in a first time duration interval with the minimum duration upper limit, determining whether the application is an abnormal application with high power consumption or not according to the lock holding times and the average lock holding duration of the application in the current detection period; and when the first total lock holding duration is in a second duration interval except the first duration interval, determining whether the application is the abnormal application according to the number of times of intervals of which the plurality of total lock holding durations are in the second duration interval, acquired in all detection periods of the application. The lock holding state and the power consumption condition of the application can be comprehensively detected through the total lock holding time length, the lock holding times and the average lock holding time length, and the detection accuracy of the power consumption application is improved.

Description

Power consumption application detection method and device, storage medium and mobile terminal
Technical Field
The present disclosure relates to the field of application management of mobile terminals, and in particular, to a method and an apparatus for detecting a power consuming application, a storage medium, and a mobile terminal.
Background
WakeLock is a lock mechanism for applications in Linux systems and Android systems, and when an application (or called application program) holds WakeLock, a processor is always in a working state and cannot enter a sleep state. For example, when the screen of the mobile terminal is closed, some applications still need to wake up the screen to prompt the user for a message. At this time, the application needs to be still able to run under the condition that the screen of the mobile terminal is closed through the WakeLock locking mechanism. However, abusing the WakeLock locking mechanism in a large number of applications may also cause a problem of high power consumption of the mobile terminal, and unnecessary or abnormal application lock-holding states, for example, an application may be locked for too long and/or locked for too many times within a period of time, which may result in excessive power consumption of the mobile terminal. In the related art, an abnormal application with high power consumption is usually detected and processed based on the lock duration of the application.
Disclosure of Invention
To overcome the problems in the related art, the present disclosure provides a method and apparatus for detecting a power consuming application, a storage medium, and a mobile terminal.
According to a first aspect of embodiments of the present disclosure, there is provided a method for detecting a power consuming application, the method including:
acquiring a first total lock holding duration and lock holding times of a target application in a current detection period;
when the first total lock holding duration is smaller than a preset duration threshold, determining a duration interval of the first total lock holding duration in a duration interval group, wherein the duration interval group comprises a plurality of duration intervals with a duration upper limit and a duration lower limit;
when the first total lock holding duration is in a first duration interval, determining whether the target application is an abnormal application with high power consumption or not according to the lock holding times and the average lock holding duration of the target application in the current detection period, wherein the first duration interval is a duration interval with a minimum duration upper limit in the duration interval group;
when the first total lock holding duration is in a second duration interval, determining whether the target application is the abnormal application according to an interval number corresponding to the second duration interval, wherein the second duration interval is any duration interval except the first duration interval in the duration interval group, the interval number is the total number of times that a plurality of first total lock holding durations acquired by the target application in the current detection period and the historical detection period are in the second duration interval, and the historical detection period comprises a plurality of detection periods before the current detection period.
Optionally, when the first total lock holding duration is in a first duration interval, determining whether the target application is an abnormal application with high power consumption according to the lock holding times and the average lock holding duration, including:
determining the average lock holding duration according to the first total lock holding duration and the lock holding times;
and when the lock holding times are larger than or equal to a preset lock holding time threshold value, and the average lock holding duration is larger than or equal to a preset average lock holding duration threshold value, determining that the target application is the abnormal application.
Optionally, when the first total lock holding duration is in a second duration interval, determining whether the target application is the abnormal application according to the number of intervals corresponding to the second duration interval, including:
acquiring the number of times of a history interval in which a plurality of total lock holding durations acquired by the target application in the history detection period are in the second duration interval;
determining the interval times as the number of the historical intervals plus one;
when the interval times are smaller than a preset interval time threshold, recording the interval times as historical interval times corresponding to the second duration interval in a detection period after the current detection period;
and when the interval times are larger than or equal to a preset interval time threshold value, determining that the target application is the abnormal application.
Optionally, the method further includes:
and when the first total holding lock duration is greater than or equal to the preset duration threshold, determining that the target application is the abnormal application.
Optionally, the method further includes:
and when the target application is determined to be the abnormal application, processing the abnormal application according to a preset execution strategy.
According to a second aspect of embodiments of the present disclosure, there is provided a detection apparatus for a power consuming application, the apparatus comprising:
the lock holding detection module is used for acquiring a first total lock holding duration and lock holding times of the target application in a current detection period;
the interval determining module is used for determining a duration interval of the first total lock holding duration in a duration interval group when the first total lock holding duration is smaller than a preset duration threshold, wherein the duration interval group comprises a plurality of duration intervals with a duration upper limit and a duration lower limit;
a first anomaly detection module, configured to determine whether the target application is an anomalous application with high power consumption according to the lock holding times and an average lock holding duration of the target application in the current detection period when the first total lock holding duration is in a first duration interval, where the first duration interval is a duration interval with a minimum duration upper limit in the duration interval group;
and the second abnormity detection module is used for determining whether the target application is the abnormal application or not according to the interval times corresponding to the second duration interval when the first total lock holding duration is in the second duration interval, wherein the second duration interval is any duration interval except the first duration interval in the duration interval group, the interval times are the total times of the target application in the second duration interval of a plurality of total lock holding durations acquired in the current detection period and the historical detection period, and the historical detection period comprises a plurality of detection periods before the current detection period.
Optionally, the first anomaly detection module includes:
the time length determining submodule is used for determining the average lock holding time length according to the first total lock holding time length and the lock holding times;
the first abnormity determining submodule is used for determining that the target application is the abnormal application when the lock holding times are larger than or equal to a lock holding time threshold value and the average lock holding duration is larger than or equal to an average lock holding duration threshold value.
Optionally, the second anomaly detection module includes:
the first time number determining submodule is used for obtaining the number of times of a history interval in which a plurality of total lock holding durations obtained by the target application in the history detection period are in the second duration interval;
a second number of times determination submodule, configured to determine that the interval number is the number of times of the historical interval plus one;
the time recording submodule is used for recording the interval times as the historical interval times corresponding to the second duration interval in the detection period after the current detection period when the interval times are smaller than a preset interval time threshold;
and the second abnormity determining submodule is used for determining the target application as the abnormal application when the interval times is larger than or equal to a preset interval time threshold value.
Optionally, the apparatus further comprises:
and the third anomaly detection module is used for determining that the target application is the anomalous application when the first total lock holding duration is greater than or equal to the preset duration threshold.
Optionally, the apparatus further comprises:
and the exception handling module is used for handling the exception application according to a preset execution strategy when the target application is determined to be the exception application.
According to a third aspect of embodiments of the present disclosure, there is provided a computer-readable storage medium having stored thereon computer program instructions, which when executed by a processor, implement the steps of the detection method of a power consuming application provided by the first aspect of the present disclosure.
According to a fourth aspect of the embodiments of the present disclosure, there is provided a mobile terminal including: the second aspect of the present disclosure provides a detection apparatus for power consuming applications.
According to the technical scheme provided by the embodiment of the disclosure, the first total lock holding duration and the lock holding times of the target application in the current detection period can be obtained; when the first total lock holding duration is smaller than a preset duration threshold, determining a duration interval of the first total lock holding duration in a duration interval group, wherein the duration interval group comprises a plurality of duration intervals with a duration upper limit and a duration lower limit; when the first total lock holding duration is in a first duration interval, determining whether the target application is an abnormal application with high power consumption or not according to the lock holding times and the average lock holding duration of the target application in the current detection period, wherein the first duration interval is a duration interval with the minimum duration upper limit in the duration interval group; when the first total lock holding duration is in a second duration interval, determining whether the target application is the abnormal application according to an interval number corresponding to the second duration interval, wherein the second duration interval is any duration interval except the first duration interval in the duration interval group, the interval number is the total number of times that a plurality of first total lock holding durations acquired by the target application in the current detection period and a historical detection period are in the second duration interval, and the historical detection period comprises a plurality of detection periods before the current detection period. The lock holding state and the power consumption condition of the application can be comprehensively detected through the total lock holding time length, the lock holding times and the average lock holding time length, and the detection accuracy of the power consumption application is improved.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and together with the description, serve to explain the principles of the disclosure.
FIG. 1 is a flow chart illustrating a method of detection of a power consuming application in accordance with an exemplary embodiment;
fig. 2 is a flow chart of a detection method according to one power consumption abnormality application shown in fig. 1;
fig. 3 is a flowchart of a detection method according to another power consumption abnormality application shown in fig. 1;
FIG. 4 is a flow chart of a detection method according to another power consuming application shown in FIG. 1;
FIG. 5 is a flow chart of a method of detecting a further power consuming application according to FIG. 4;
FIG. 6 is a block diagram illustrating a detection arrangement for a power consuming application in accordance with an exemplary embodiment;
FIG. 7 is a block diagram of a first anomaly detection module shown in FIG. 6;
FIG. 8 is a block diagram of a second anomaly detection module shown in FIG. 6;
fig. 9 is a block diagram of a detection arrangement according to another power consuming application shown in fig. 6;
fig. 10 is a block diagram of a detection arrangement according to yet another power consuming application shown in fig. 9;
FIG. 11 is a block diagram illustrating an electronic device in accordance with an example embodiment.
Detailed Description
Reference will now be made in detail to the exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, like numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the exemplary embodiments below are not intended to represent all implementations consistent with the present disclosure. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present disclosure, as detailed in the appended claims.
Before introducing the detection method for the power consumption application provided by the present disclosure, a target application scenario related to each embodiment in the present disclosure is first introduced, where the target application scenario includes a mobile terminal, and the mobile terminal is a mobile terminal capable of running a Linux system and an Android system and applying a WakeLock (wake-up lock) mechanism. The mobile terminal may be, for example, a smart phone, a tablet computer, a smart television, a smart watch, a PDA (Personal digital assistant, chinese), and other mobile terminals.
Fig. 1 is a flowchart illustrating a method for detecting a power consuming application according to an exemplary embodiment, where the method is applied to a mobile terminal described in the above application scenario, as shown in fig. 1, and the method includes the following steps:
in step 101, a first total lock holding duration and lock holding times of a target application in a current detection period are obtained.
For example, the time length of each cell of power consumed by the mobile terminal may be taken as a detection period (since the usage of the mobile terminal by the user is irregular, the time length of each cell of power consumed is different, and therefore the time length of each detection period set by the rule is also different), or the preset time length may be taken as a detection period. During a detection period, the target application may repeatedly hold the lock and release the lock. Therefore, the first total lock holding duration is the sum of the durations of the multiple lock holding states of the target application in the current detection period, and the lock holding times are the times that the target application is in the lock holding state in the current detection period. It should be noted that, the detection method of the power consumption application can detect the lock holding states of all applications in the mobile terminal at the same time and further determine the power consumption situation of each application, and in this embodiment, only the power consumption detection of one application (i.e. the target application) is taken as an example for description.
In step 102, when the first total lock holding duration is smaller than the preset duration threshold, a duration interval in which the first total lock holding duration is located in the duration interval group is determined.
The duration interval group comprises a plurality of duration intervals with duration upper limits and duration lower limits. The first total lock holding duration may be a specific duration, for example, 1 minute, or a ratio of the duration to the duration of the current detection period, for example, the duration of the current detection period is 30 minutes, and the sum of the durations of the lock holding statuses is 15 minutes, in which case, the first total lock holding duration may be 50%. Similarly, the preset duration threshold may be a preset lock-holding duration or rate.
For example, when the first total lock holding duration is greater than or equal to the preset duration threshold, it may be directly determined that the target application has an abnormal lock holding state, and thus it is determined that the target application is an abnormal application with high power consumption. However, some application developers may bypass the above detection step based on the lock duration by increasing the number of lock holding times and shortening the lock holding duration, thereby avoiding the corresponding power consumption management and control. Therefore, even if it is determined that the first total lock holding duration is smaller than the preset duration threshold, the lock holding state of the target application may be continuously determined (as described in the following steps 103 and 104) through the lock holding times and the average lock holding duration or duration interval.
Specifically, the time length between the minimum value of the time length (i.e., 0) that may occur and the preset time length threshold may be divided into a plurality of time length intervals (i.e., the time length interval group). For example, the preset duration threshold is 50%, five duration intervals (50%, 40%), (40%, 30%), (30%, 20%), (20%, 10%) and (10%, 0) may be set, so that when the first total lock duration is 35%, the first total lock duration may be considered to be in the duration interval (40%, 30%), wherein 40% is the upper duration limit and 30% is the lower duration limit.
In step 103, when the first total lock holding duration is within the first duration interval, it is determined whether the target application is an abnormal application with high power consumption according to the lock holding times and the average lock holding duration of the target application in the current detection period.
The first time interval is a time interval with the minimum time upper limit in the time interval group. For example, in the above example, the duration interval (10%, 0) is the first duration interval, which is actually a determination criterion of the abnormality of the total lock holding duration. When the first total lock holding duration is not within the first duration interval, it may be considered that the target application may have an abnormal lock holding condition. When the first total lock holding duration is within the first duration interval, the lock holding state of the target application may be considered normal at least on the criterion of lock holding duration. In order to cope with the application development scheme that bypasses the detection step based on the lock duration, the lock duration of the target application may be further detected according to the average value of the lock duration and the lock number of the current detection period of the target application.
In step 104, when the first total holding lock duration is in a second duration interval, determining whether the target application is the abnormal application according to the interval times corresponding to the second duration interval.
The second duration interval is any duration interval in the duration interval group except the first duration interval, the interval times are the total times that a plurality of total lock holding durations acquired by the target application in the current detection period and a historical detection period are in the second duration interval, and the historical detection period comprises a plurality of detection periods before the current detection period.
For example, when the first total lock holding duration is not within the first duration interval, it may be considered that the target application may have an abnormal lock holding condition. The situation is further detected according to the lock holding state of the target application in the past detection period. Specifically, for example, the duration intervals in the duration interval group except the first duration interval include: the time duration interval comprises four time duration intervals (50%, 40%), (40%, 30%), (30%, 20%) and (20%, 10%), wherein each time duration interval corresponds to one interval time, and each time duration interval also corresponds to a preset interval time threshold. The interval number is the number of times that the acquired total lock holding duration is in a certain duration interval in all detection periods (including the current detection period) that the target application undergoes. When the number of intervals is greater than or equal to the threshold number of intervals, the target application may be determined to be an abnormal application.
In summary, the technical solution provided in the embodiments of the present disclosure can obtain a first total lock holding duration and lock holding times of a target application in a current detection period; when the first total lock holding duration is smaller than a preset duration threshold, determining a duration interval of the first total lock holding duration in a duration interval group, wherein the duration interval group comprises a plurality of duration intervals with a duration upper limit and a duration lower limit; when the first total lock holding duration is in a first duration interval, determining whether the target application is an abnormal application with high power consumption or not according to the lock holding times and the average lock holding duration of the target application in the current detection period, wherein the first duration interval is a duration interval with the minimum duration upper limit in the duration interval group; when the first total lock holding duration is in a second duration interval, determining whether the target application is the abnormal application according to an interval number corresponding to the second duration interval, wherein the second duration interval is any duration interval except the first duration interval in the duration interval group, the interval number is the total number of times that a plurality of first total lock holding durations acquired by the target application in the current detection period and a historical detection period are in the second duration interval, and the historical detection period comprises a plurality of detection periods before the current detection period. The lock holding state and the power consumption condition of the application can be comprehensively detected through the total lock holding time length, the lock holding times and the average lock holding time length, and the detection accuracy of the power consumption application is improved.
Fig. 2 is a flowchart of a method for detecting a power consumption abnormality application shown in fig. 1, where step 103, shown in fig. 2, includes: steps 1031 and 1032.
In step 1031, the average lock holding duration is determined according to the first total lock holding duration and the lock holding times.
In step 1032, when the lock holding times are greater than or equal to a preset lock holding time threshold, and the average lock holding time length is greater than or equal to a preset average lock holding time length threshold, it is determined that the target application is the abnormal application.
For example, the average lock holding duration is a calculation result of dividing the first total lock holding duration by the lock holding times. When the lock holding times are greater than or equal to a preset lock holding time threshold and the average lock holding duration is greater than or equal to a preset average lock holding duration threshold, the target application can be determined as the abnormal application. When at least one of the above two conditions is not satisfied, it may be determined that the target application is not the anomalous application.
Fig. 3 is a flowchart of another detection method for a power consumption abnormality application shown in fig. 1, and as shown in fig. 3, the step 104 includes: step 1041, step 1043, or steps 1041, 1042, and 1044.
In step 1041, the number of times of the history interval in which the total lock holding time lengths obtained by the target application in the history detection period are in the second time length interval is obtained.
In step 1042, the interval number is determined as the historical interval number plus one.
In step 1043, when the interval number is smaller than the preset interval number threshold, the interval number is recorded as the history interval number corresponding to the second duration interval in the detection period after the current detection period.
In step 1044, when the interval number is greater than or equal to the preset interval number threshold, determining that the target application is the abnormal application.
Illustratively, the number of times of the history interval corresponding to the second duration interval is recorded in a storage module of the mobile terminal, and when the first total holding lock duration is in the second duration interval, the number of times of the history interval is first obtained from the storage module, and the number of times of the history interval is added by one. For example, the history section count of the second time period section (50%, 40%) is 3 times, and the section count is 4 times. Setting the threshold of the interval number of times as 4 times, it may be determined that the interval number of times 4 times is equal to the threshold of the interval number of times, and then it is determined that the target application is the abnormal application. Or, when the interval number (4) is smaller than a preset interval number threshold (5), recording the interval number (4), specifically, updating the history interval number (3) originally stored in the storage module to the interval number (4). In this way, if the total lock holding time period acquired in the detection period thereafter is again in the second time period, counting and judgment can be performed on the basis of the number of times (4 times) of the history period.
It should be noted that the interval time threshold may be set according to the order of the upper and lower duration limits of the duration interval, where the larger the upper and lower duration limits are, the smaller the interval time threshold is, for example, the interval time thresholds corresponding to the duration intervals (50%, 40%), (40%, 30%), (30%, 20%) and (20%, 10%) are 2 times, 3 times, 4 times and 5 times, respectively. It can be seen that the longer the total lock holding time, the fewer times it is allowed to occur.
Fig. 4 is a flow chart of a method for detecting a power consuming application according to another embodiment shown in fig. 1, which, as shown in fig. 4, after the step 101, further comprises:
in step 105, when the first total holding lock duration is greater than or equal to the preset duration threshold, it is determined that the target application is the abnormal application.
Fig. 5 is a flowchart of a method for detecting a further power consuming application according to fig. 4, which method further comprises, after the above steps 103, 104 and 105, as shown in fig. 4:
in step 106, when it is determined that the target application is the abnormal application, the abnormal application is processed according to a preset execution policy.
For example, after determining that the target application is the abnormal application according to the above steps 103, 104 and 105, the detected abnormal situation may be processed according to a preset execution policy, so as to reduce the power consumption burden of the mobile terminal. The enforcement policy may include: canceling the process related to locking of the abnormal application, prohibiting the background operation authority of the abnormal application or outputting a prompt message of excessive power consumption of the abnormal application, and the like.
In summary, the technical solution provided in the embodiments of the present disclosure can obtain a first total lock holding duration and lock holding times of a target application in a current detection period; when the first total lock holding duration is smaller than a preset duration threshold, determining a duration interval of the first total lock holding duration in a duration interval group, wherein the duration interval group comprises a plurality of duration intervals with a duration upper limit and a duration lower limit; when the first total lock holding duration is in a first duration interval, determining whether the target application is an abnormal application with high power consumption or not according to the lock holding times and the average lock holding duration of the target application in the current detection period, wherein the first duration interval is a duration interval with the minimum duration upper limit in the duration interval group; when the first total lock holding duration is in a second duration interval, determining whether the target application is the abnormal application according to an interval number corresponding to the second duration interval, wherein the second duration interval is any duration interval except the first duration interval in the duration interval group, the interval number is the total number of times that a plurality of first total lock holding durations acquired by the target application in the current detection period and a historical detection period are in the second duration interval, and the historical detection period comprises a plurality of detection periods before the current detection period. Can hold lock state and the power consumptive condition of holding of using to carry out the comprehensive detection through length of holding lock always, hold the lock number of times and length of holding lock averagely, and then handle the unusual application that detects out, improve the accuracy that power consumptive application detected to carry out effective management and control to mobile terminal's power consumption, improve user experience.
Fig. 6 is a block diagram illustrating an apparatus for detecting a power consuming application according to an exemplary embodiment, as shown in fig. 6, applied to a mobile terminal described in the above application scenario, where the apparatus 600 includes:
the lock holding detection module 610 is configured to obtain a first total lock holding duration and lock holding times of the target application in a current detection period;
an interval determining module 620, configured to determine, when the first total lock holding duration is smaller than a preset duration threshold, a duration interval in which the first total lock holding duration is located in a duration interval group, where the duration interval group includes a plurality of duration intervals having an upper duration limit and a lower duration limit;
a first anomaly detection module 630, configured to determine whether the target application is an anomalous application with high power consumption according to the lock holding times and an average lock holding duration of the target application in the current detection period when the first total lock holding duration is within a first duration interval, where the first duration interval is a duration interval with a minimum duration upper limit in the duration interval group;
a second anomaly detection module 640, configured to determine whether the target application is the anomalous application according to an interval number corresponding to a second duration interval when the first total lock holding duration is in the second duration interval, where the second duration interval is any duration interval of the duration interval group except the first duration interval, the interval number is a total number of times that a plurality of total lock holding durations acquired in the current detection period and a historical detection period of the target application are in the second duration interval, and the historical detection period includes a plurality of detection periods before the current detection period.
Fig. 7 is a block diagram of a first anomaly detection module according to fig. 6, and as shown in fig. 7, the first anomaly detection module 530 includes:
a time length determining submodule 531, configured to determine the average lock holding time length according to the first total lock holding time length and the lock holding times;
the first exception determining sub-module 532 is configured to determine that the target application is the exception application when the lock holding times are greater than or equal to the lock holding times threshold and the average lock holding time is greater than or equal to the average lock holding time threshold.
Fig. 8 is a block diagram of a second abnormality detection module according to fig. 6, and as shown in fig. 8, the second abnormality detection module 640 includes:
the first time number determining submodule 641 is configured to obtain the number of times that the target application has a history interval in which the multiple total lock holding durations obtained in the history detection period are in the second duration interval;
a second time number determining submodule 642, configured to determine that the interval time number is the historical interval time number plus one;
the number-of-times recording sub-module 643, configured to record, when the number of times of the interval is smaller than a preset interval number threshold, the number of times of the interval, as the number of times of the history interval corresponding to the second duration interval in the detection period after the current detection period;
the second anomaly determination submodule 644 is configured to determine that the target application is the anomalous application when the interval number is greater than or equal to a preset interval number threshold.
Fig. 9 is a block diagram of another detection apparatus for power consuming applications according to fig. 6, as shown in fig. 9, the apparatus 600 further comprising:
a third anomaly detection module 650, configured to determine that the target application is the anomalous application when the first total lock holding duration is greater than or equal to the preset duration threshold.
Fig. 10 is a block diagram of a detection device according to yet another power consuming application shown in fig. 9, as shown in fig. 10, the device 600 further comprising:
and the exception handling module 660 is configured to, when it is determined that the target application is the exception application, handle the exception application according to a preset execution policy.
In summary, the technical solution provided in the embodiments of the present disclosure can obtain a first total lock holding duration and lock holding times of a target application in a current detection period; when the first total lock holding duration is smaller than a preset duration threshold, determining a duration interval of the first total lock holding duration in a duration interval group, wherein the duration interval group comprises a plurality of duration intervals with a duration upper limit and a duration lower limit; when the first total lock holding duration is in a first duration interval, determining whether the target application is an abnormal application with high power consumption or not according to the lock holding times and the average lock holding duration of the target application in the current detection period, wherein the first duration interval is a duration interval with the minimum duration upper limit in the duration interval group; when the first total lock holding duration is in a second duration interval, determining whether the target application is the abnormal application according to an interval number corresponding to the second duration interval, wherein the second duration interval is any duration interval except the first duration interval in the duration interval group, the interval number is the total number of times that a plurality of first total lock holding durations acquired by the target application in the current detection period and a historical detection period are in the second duration interval, and the historical detection period comprises a plurality of detection periods before the current detection period. Can hold lock state and the power consumptive condition of holding of using to carry out the comprehensive detection through length of holding lock always, hold the lock number of times and length of holding lock averagely, and then handle the unusual application that detects out, improve the accuracy that power consumptive application detected to carry out effective management and control to mobile terminal's power consumption, improve user experience.
FIG. 11 is a block diagram illustrating an electronic device in accordance with an example embodiment. The electronic device 1100 is a mobile terminal, and the electronic device 1100 includes the method for detecting the power consuming application shown in any one of fig. 1 to 5.
Referring to fig. 11, electronic device 1100 may include one or more of the following components: processing component 1102, memory 1104, power component 1106, multimedia component 1108, audio component 1110, input/output (I/O) interface 1112, sensor component 1114, and communication component 11111.
The processing component 1102 generally controls the overall operation of the device 1100, such as operations associated with display, telephone calls, data communications, camera operations, and recording operations. The processing component 1102 may include one or more processors 1120 to execute instructions to perform all or a portion of the steps of the power consuming application detection method described above. Further, the processing component 1102 may include one or more modules that facilitate interaction between the processing component 1102 and other components. For example, the processing component 1102 may include a multimedia module to facilitate interaction between the multimedia component 1108 and the processing component 1102.
The memory 1104 is configured to store various types of data to support operations at the apparatus 1100. Examples of such data include instructions for any target application or method operating on device 1100, contact data, phonebook data, messages, pictures, videos, and so forth. The memory 1104 may be implemented by any type or combination of volatile or non-volatile memory devices such as Static Random Access Memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic or optical disks.
Power components 1106 provide power to the various components of device 1100. The power components 11011 may include a power management system, one or more power sources, and other components associated with generating, managing, and distributing power for the apparatus 1100.
The multimedia component 1108 includes a screen that provides an output interface between the device 1100 and a user. In some embodiments, the screen may include a Liquid Crystal Display (LCD) and a Touch Panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive an input signal from a user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundary of a touch or slide action, but also detect the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 1108 includes a front facing camera and/or a rear facing camera. The front camera and/or the rear camera may receive external multimedia data when the device 1100 is in an operating mode, such as a shooting mode or a video mode. Each front camera and rear camera may be a fixed optical lens system or have a focal length and optical zoom capability.
The audio component 1110 is configured to output and/or input audio signals. For example, the audio component 1110 includes a Microphone (MIC) configured to receive external audio signals when the apparatus 1100 is in operating modes, such as a call mode, a recording mode, and a voice recognition mode. The received audio signal may further be stored in the memory 1104 or transmitted via the communication component 11111. In some embodiments, the audio assembly 1110 further includes a speaker for outputting audio signals.
The I/O interface 1112 provides an interface between the processing component 1102 and peripheral interface modules, which may be keyboards, click wheels, buttons, etc. These buttons may include, but are not limited to: a home button, a volume button, a start button, and a lock button.
The sensor assembly 1114 includes one or more sensors for providing various aspects of state assessment for the apparatus 1100. For example, the sensor assembly 1114 may detect an open/closed state of the apparatus 1100, the relative positioning of components, such as a display and keypad of the apparatus 1100, the sensor assembly 1114 may also detect a change in position of the apparatus 1100 or a component of the apparatus 1100, the presence or absence of user contact with the apparatus 1100, orientation or acceleration/deceleration of the apparatus 1100, and a change in temperature of the apparatus 1100. The sensor assembly 1114 may include a proximity sensor configured to detect the presence of a nearby object without any physical contact. The sensor assembly 1114 may also include a light sensor, such as a CMOS or CCD image sensor, for use in imaging target applications. In some embodiments, the sensor assembly 1114 may also include an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.
The communication component 1116 is configured to facilitate wired or wireless communication between the apparatus 1100 and other devices. The apparatus 1100 may access a wireless network based on a communication standard, such as WiFi, 2G or 11G, or a combination thereof. In an exemplary embodiment, the communication component 1116 receives broadcast signals or broadcast related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 1116 also includes a Near Field Communication (NFC) module to facilitate short-range communications. For example, the NFC module may be implemented based on Radio Frequency Identification (RFID) technology, infrared data association (IrDA) technology, Ultra Wideband (UWB) technology, Bluetooth (BT) technology, and other technologies.
In an exemplary embodiment, the apparatus 1100 may be implemented by one or more target Application Specific Integrated Circuits (ASICs), Digital Signal Processors (DSPs), Digital Signal Processing Devices (DSPDs), Programmable Logic Devices (PLDs), Field Programmable Gate Arrays (FPGAs), controllers, micro-controllers, microprocessors or other electronic components for performing the above-described detection methods of power consuming applications.
In an exemplary embodiment, a non-transitory computer-readable storage medium comprising instructions, such as the memory 1104 comprising instructions, executable by the processor 1120 of the apparatus 1100 to perform the above-described method of detecting a power consuming application is also provided. For example, the non-transitory computer readable storage medium may be a ROM, a Random Access Memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, and the like. The method and the device can reduce the dependence on the signal intensity of the WLAN equipment when the position of the WLAN equipment is positioned, enable the positioning error precision to be controllable, and improve the positioning accuracy.
Other embodiments of the disclosure will be apparent to those skilled in the art from consideration of the specification and practice of the disclosure. This application is intended to cover any variations, uses, or adaptations of the disclosure following, in general, the principles of the disclosure and including such departures from the present disclosure as come within known or customary practice within the art to which the disclosure pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the disclosure being indicated by the following claims.
It will be understood that the present disclosure is not limited to the precise arrangements described above and shown in the drawings and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.

Claims (12)

1. A method of detecting a power consuming application, the method comprising:
acquiring a first total lock holding duration and lock holding times of a target application in a current detection period;
when the first total lock holding duration is smaller than a preset duration threshold, determining a duration interval of the first total lock holding duration in a duration interval group, wherein the duration interval group comprises a plurality of duration intervals with a duration upper limit and a duration lower limit;
when the first total lock holding duration is in a first duration interval, determining whether the target application is an abnormal application with high power consumption or not according to the lock holding times and the average lock holding duration of the target application in the current detection period, wherein the first duration interval is a duration interval with a minimum duration upper limit in the duration interval group;
when the first total lock holding duration is in a second duration interval, determining whether the target application is the abnormal application according to an interval number corresponding to the second duration interval, wherein the second duration interval is any duration interval except the first duration interval in the duration interval group, the interval number is the total number of times that a plurality of total lock holding durations acquired by the target application in the current detection period and the historical detection period are in the second duration interval, and the historical detection period comprises a plurality of detection periods before the current detection period.
2. The method according to claim 1, wherein the determining whether the target application is an abnormal application with high power consumption according to the lock holding times and the average lock holding duration of the target application in the current detection period when the first total lock holding duration is in a first duration interval comprises:
determining the average lock holding duration according to the first total lock holding duration and the lock holding times;
and when the lock holding times are larger than or equal to a preset lock holding time threshold value, and the average lock holding duration is larger than or equal to a preset average lock holding duration threshold value, determining that the target application is the abnormal application.
3. The method according to claim 1, wherein when the first total lock holding duration is in a second duration interval, determining whether the target application is the abnormal application according to an interval number corresponding to the second duration interval includes:
acquiring the number of times of a history interval in which a plurality of total lock holding durations acquired by the target application in the history detection period are in the second duration interval;
determining the interval times as the number of the historical intervals plus one;
when the interval times are smaller than a preset interval time threshold, recording the interval times as historical interval times corresponding to the second duration interval in a detection period after the current detection period;
and when the interval times are larger than or equal to a preset interval time threshold value, determining that the target application is the abnormal application.
4. The method of claim 1, further comprising:
and when the first total holding lock duration is greater than or equal to the preset duration threshold, determining that the target application is the abnormal application.
5. The method according to any one of claims 2-4, further comprising:
and when the target application is determined to be the abnormal application, processing the abnormal application according to a preset execution strategy.
6. A detection device for an electrical consumption application, the device comprising:
the lock holding detection module is used for acquiring a first total lock holding duration and lock holding times of the target application in a current detection period;
the interval determining module is used for determining a duration interval of the first total lock holding duration in a duration interval group when the first total lock holding duration is smaller than a preset duration threshold, wherein the duration interval group comprises a plurality of duration intervals with a duration upper limit and a duration lower limit;
a first anomaly detection module, configured to determine whether the target application is an anomalous application with high power consumption according to the lock holding times and an average lock holding duration of the target application in the current detection period when the first total lock holding duration is in a first duration interval, where the first duration interval is a duration interval with a minimum duration upper limit in the duration interval group;
and the second abnormity detection module is used for determining whether the target application is the abnormal application or not according to the interval times corresponding to the second duration interval when the first total lock holding duration is in the second duration interval, wherein the second duration interval is any duration interval except the first duration interval in the duration interval group, the interval times are the total times of the target application in the second duration interval of a plurality of total lock holding durations acquired in the current detection period and the historical detection period, and the historical detection period comprises a plurality of detection periods before the current detection period.
7. The apparatus of claim 6, wherein the first anomaly detection module comprises:
the time length determining submodule is used for determining the average lock holding time length according to the first total lock holding time length and the lock holding times;
the first abnormity determining submodule is used for determining that the target application is the abnormal application when the lock holding times are larger than or equal to a lock holding time threshold value and the average lock holding duration is larger than or equal to an average lock holding duration threshold value.
8. The apparatus of claim 6, wherein the second anomaly detection module comprises:
the first time number determining submodule is used for obtaining the number of times of a history interval in which a plurality of total lock holding durations obtained by the target application in the history detection period are in the second duration interval;
a second number of times determination submodule, configured to determine that the interval number is the number of times of the historical interval plus one;
the time recording submodule is used for recording the interval times as the historical interval times corresponding to the second duration interval in the detection period after the current detection period when the interval times are smaller than a preset interval time threshold;
and the second abnormity determining submodule is used for determining the target application as the abnormal application when the interval times is larger than or equal to a preset interval time threshold value.
9. The apparatus of claim 6, further comprising:
and the third anomaly detection module is used for determining that the target application is the anomalous application when the first total lock holding duration is greater than or equal to the preset duration threshold.
10. The apparatus according to any one of claims 7-9, wherein the apparatus further comprises:
and the exception handling module is used for handling the exception application according to a preset execution strategy when the target application is determined to be the exception application.
11. A computer-readable storage medium, on which computer program instructions are stored, which program instructions, when executed by a processor, carry out the steps of the method according to any one of claims 1 to 5.
12. A mobile terminal, comprising: detection device for a power consuming application according to any of claims 6-10.
CN201811289676.1A 2018-10-31 2018-10-31 Power consumption application detection method and device, storage medium and mobile terminal Active CN109521865B (en)

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 CN109521865A (en) 2019-03-26
CN109521865B true 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)

Family Cites Families (6)

* Cited by examiner, † Cited by third party
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
CN106020415B (en) * 2016-05-09 2019-01-29 深圳市万普拉斯科技有限公司 Application control method and device under smart machine standby mode
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

Also Published As

Publication number Publication date
CN109521865A (en) 2019-03-26

Similar Documents

Publication Publication Date Title
EP2993584B1 (en) Method and device for controlling background application
EP3188066B1 (en) A method and an apparatus for managing an application
US9860844B2 (en) Method and apparatus of temperature control
US10409684B2 (en) Method, device and storage medium for cleaning memory
EP3151117B1 (en) Method and device for delaying information broadcasting
CN106766022B (en) Sensor control method and device
EP3046212B1 (en) Method and apparatus for controlling charging of terminal device
CN108538258B (en) Method and device for adjusting backlight current and display equipment
CN107885307B (en) Equipment control method and device
CN106201738B (en) System broadcast calling method and device
CN105786561B (en) Method and device for calling process
CN111104001B (en) Method and device for preventing screen from being touched mistakenly, mobile terminal and storage medium
CN109521865B (en) Power consumption application detection method and device, storage medium and mobile terminal
CN109922203B (en) Terminal, screen off method and device
CN107273173B (en) Fingerprint sensor control method and device and storage medium
CN108989457B (en) Information processing method, server and terminal
CN116089025A (en) Processor frequency control method, device and storage medium
CN106874749A (en) A kind of method and apparatus for managing root authority
CN106776204B (en) Method and device for determining power consumption application
CN108427582B (en) Method and device for determining stuck state and computer readable storage medium
CN113806741A (en) Information processing method and device
CN114724196A (en) False touch prevention method and device, electronic equipment and storage medium
CN107277905B (en) System management method and device
CN112231132A (en) Application program jamming positioning method and device, electronic equipment and medium
CN107894902B (en) Equipment control method and device

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