WO2020094125A1 - Application control method, device, terminal, and computer-readable storage medium - Google Patents

Application control method, device, terminal, and computer-readable storage medium Download PDF

Info

Publication number
WO2020094125A1
WO2020094125A1 PCT/CN2019/116611 CN2019116611W WO2020094125A1 WO 2020094125 A1 WO2020094125 A1 WO 2020094125A1 CN 2019116611 W CN2019116611 W CN 2019116611W WO 2020094125 A1 WO2020094125 A1 WO 2020094125A1
Authority
WO
WIPO (PCT)
Prior art keywords
application
preset
managed
candidate
frozen
Prior art date
Application number
PCT/CN2019/116611
Other languages
French (fr)
Chinese (zh)
Inventor
吴鹏
Original Assignee
中兴通讯股份有限公司
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 中兴通讯股份有限公司 filed Critical 中兴通讯股份有限公司
Publication of WO2020094125A1 publication Critical patent/WO2020094125A1/en

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
    • 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/3234Power saving characterised by the action undertaken
    • G06F1/329Power saving characterised by the action undertaken by task scheduling

Definitions

  • the present invention relates to the field of communication technology, and in particular, to an application control method, device, terminal, and computer-readable storage medium.
  • the terminal supports diversified applications and powerful functions, during the use of the terminal, the following situations are often found: the more applications installed on the terminal, even if some applications are not used, you can feel the battery of the terminal The consumption is getting faster and faster, and the memory is getting less and less. This is because some applications frequently use system resources such as CPU in the background even if they are not used, resulting in a large power consumption of the terminal; hardware resources such as the battery capacity and memory of the terminal are stretched in front of colorful applications. Thus affecting the user experience.
  • An application control method, device, terminal, and storage medium provided by embodiments of the present invention mainly solve the technical problem of how to accurately determine the applications to be managed on the terminal.
  • an application control method including:
  • an embodiment of the present invention also provides an application control device, including: a monitoring module, a primary determination module, and a processing module;
  • the monitoring module is used to monitor each application currently running on the terminal;
  • the determining module is configured to determine the candidate application according to a preset recognition rule when the monitoring module detects a candidate application that satisfies a preset first power consumption condition to determine whether the candidate application is an application to be managed ;
  • the processing module is configured to control energy saving of the application to be managed when the determination module determines that the candidate application is an application to be managed.
  • an embodiment of the present invention also provides a terminal, including a processor, a memory, and a communication bus;
  • the communication bus is used to connect the processor and the memory
  • the processor is used to execute a computer program stored in the memory to implement the steps of the application control method as described above.
  • embodiments of the present invention also provide a computer-readable storage medium, where the computer-readable storage medium stores one or more computer programs, and the one or more computer programs may be used by one or more The processor executes to implement the steps of the application control method as described above.
  • FIG. 1 is a schematic flowchart of an application control method according to Embodiment 1 of the present invention.
  • FIG. 2 is a schematic diagram of a system framework according to Embodiment 2 of the present invention.
  • FIG. 3 is a schematic diagram of a process for performing layered freezing of applications according to Embodiment 2 of the present invention.
  • FIG. 4 is a schematic structural diagram of an application control device according to Embodiment 3 of the present invention.
  • FIG. 5 is a schematic structural diagram of a terminal according to Embodiment 4 of the present invention.
  • This embodiment provides an application control method, which can accurately monitor whether the power consumption of each application currently running on the terminal is abnormal, and control the energy saving of the monitored applications with abnormal power consumption, and further It can improve the endurance and resource utilization of the terminal without affecting the user's normal use of the terminal, and improve the satisfaction of the user experience.
  • An application control method provided in this embodiment, as shown in FIG. 1, includes:
  • S102 When a candidate application that satisfies a preset first power consumption condition is monitored, determine the candidate application according to a preset identification rule to determine whether the candidate application is an application to be managed;
  • the terminal in this embodiment may be various smart terminals that support application operation, such as but not limited to smart phones, notebook computers, digital broadcast receivers, personal digital assistants (PDAs), and tablet computers (PADs) , Portable multimedia players (PMP), mobile devices such as navigation devices, and fixed terminals such as digital TVs, desktop computers, and so on.
  • the system running on the terminal in this embodiment may include, but not limited to, Android, iOS, windows, Symbian, BlackBerry OS, windows mobile, and Microsoft Windows series systems applied to PCs, and Apple ’s MAC series systems. Including linux system, etc.
  • each application currently running on the terminal includes various applications that are started on the terminal and run in the background, and may also include various applications that run in the foreground, or include applications that run in both the background and the foreground according to requirements. .
  • all applications currently running on the terminal can be comprehensively monitored to avoid monitoring only for applications running in the background, which can cause timely, abnormal, Accurate discovery.
  • the related process is maintained in the terminal foreground of the terminal, so that it can escape from the abnormal monitoring range, resulting in the abnormal application monitoring on the terminal, but the abnormal application situation cannot be detected.
  • the application running in the foreground generally has only one or two applications, and the application running in the foreground is generally the application currently being used by the user. Therefore, for these application scenarios, it is possible to monitor only the applications currently running in the background on the terminal.
  • the preset first power consumption condition may be directly set to include that the application is currently running in the background (that is, the terminal will still monitor all applications in the foreground and background at this time, but The foreground application must not satisfy the preset first power consumption condition); in another feasible manner of this embodiment, the monitoring conditions can also be directly set so that the terminal will only monitor the background application, while the foreground application monitoring Skip directly.
  • the first power consumption condition may include: the application is currently running in the background, and has a preset high power consumption behavior.
  • the first power consumption condition may only include: the application has a preset high power consumption behavior, and does not limit whether the application runs in the foreground or background.
  • the applications running on the terminal can be determined from various aspects which of the applications running on the terminal have high power consumption behaviors, such as but not limited to slave processor occupancy, memory occupancy, and wake lock At least aspects of the occupancy status of the application, the occupancy status of the positioning resource, and the occupancy status of the sensor determine whether the application is currently an application with high power consumption to determine whether it needs to be included in the candidate application set.
  • high power consumption behaviors such as but not limited to slave processor occupancy, memory occupancy, and wake lock
  • the preset high power consumption behavior may include but is not limited to at least one of the following:
  • the processor occupancy state conforms to the preset first state; in this embodiment, the processor may include at least one of a central processing unit and a graphics processor (Graphics, Processing, Unit, GPU); the processor occupancy state in this embodiment It can be the processor occupancy time, it can also be the processor resource occupancy, or it can also include the processor occupancy time (which can be a continuous time, it can also be the total duration of the processor occupied in a cycle), or the processor resources Occupancy value; correspondingly, the first state may include a preset threshold of processor occupation time, and / or a threshold of processor resource occupation; for example, in one example, the processor occupation state includes processor occupation time, then process If the processor occupancy time is greater than or equal to the processor occupancy time threshold, the processor occupancy state is considered to be in accordance with the preset first state; correspondingly, in other examples, the processor occupancy state includes the processor resource occupancy value (which may be the resource occupancy) When the proportional or absolute value, etc.), the processor resource occupancy value is greater than or equal to the processor resource occupancy threshold, it
  • the memory occupancy state conforms to the preset second state; in this embodiment, the memory occupancy state may be the change trend of the memory resource occupied by the application, and the second state at this time may be an increase or a gradual increase in resource occupancy; etc.
  • the state can also be the amount of memory occupied by the application (which can be the proportion of occupied resources (the proportion can be the current ranking of the proportion of resources occupied by each application) or absolute value, etc.), and the second state at this time can include memory resources Occupation threshold, when the memory occupancy value is greater than or equal to the memory resource occupancy threshold, the memory occupancy state of the application may be considered to conform to the preset second state;
  • the occupancy state of the wake lock conforms to the preset third state; in this embodiment, the occupancy state of the wake lock may be the occupancy time of the awaken lock (may be a continuous duration, or may be the total duration of the processor occupied in a cycle)
  • the third state may include a preset wake lock occupation time threshold, for example, in an example, the wake lock occupation state includes the wake lock occupation time, then the wake lock occupation time is greater than or equal to the wake lock occupation time threshold, It is considered that the wake lock occupation state conforms to the preset third state;
  • the occupancy state of the positioning resources conforms to the preset fourth state;
  • the positioning resources in this embodiment include various resources for implementing terminal positioning, such as, but not limited to, a global positioning system (Global Positioning System, GPS is English); this embodiment
  • the location resource occupancy status in can be the location resource occupancy duration (which can be a continuous duration, or the total duration of the processor occupied in a cycle), or it can be the frequency of location resource occupancy application; correspondingly, the fourth status can include The preset positioning resource occupation time threshold and / or positioning resource occupation application frequency threshold; for example, in one example, the positioning resource occupation state includes the positioning resource occupation time, when the positioning resource occupation time is greater than or equal to the positioning resource occupation time threshold , It is considered that the location resource occupancy state conforms to the preset fourth state; for example, in other examples, when the location resource occupancy state includes the location resource occupancy application frequency, the location resource occupancy application frequency value is greater than or equal to the location resource occupancy application frequency threshold , It is considered that the location resource occupancy status meets The fourth state is provided;
  • the sensor resource occupation state conforms to the preset fifth state.
  • the sensor in this embodiment may be any sensor other than the GPS sensor for positioning on the terminal, such as a proximity sensor, a gravity sensor, an image acquisition sensor, etc .; in this embodiment, The sensor resource occupancy status can be the sensor resource occupancy duration (which can be a continuous duration or the total duration of the processor occupied in a cycle), or it can apply for the sensor resource occupancy frequency; correspondingly, the fifth status can include The set threshold of sensor resource occupation duration and / or the threshold of sensor resource occupation application frequency; for example, in an example, the sensor resource occupation status includes the sensor resource occupation duration, then the sensor resource occupation duration is greater than or equal to the sensor resource occupation duration threshold, It is considered that the sensor resource occupation state conforms to the preset fourth state; for another example, in other examples, when the sensor resource occupation state includes the sensor resource occupation application frequency, the sensor resource occupation application frequency value is greater than or equal to the sensor resource occupation application frequency When the threshold is reached, it is considered that the location resource occupation state conforms to the preset
  • the preset high power consumption behavior in this embodiment may include any one of the behaviors of the above examples, or may include two or more of the above behaviors; when the two behaviors of the above examples are included
  • an application can be determined as a candidate application as long as it satisfies any of the above behaviors.
  • an application may also be set according to a specific application scenario to satisfy more than two of the above-mentioned behaviors at the same time to confirm that it is a candidate application.
  • the preset high power consumption behavior in this embodiment is not limited to the above-mentioned exemplary behaviors, and can be flexibly set and updated according to requirements. And in some examples, users and / or manufacturers can support customization and update.
  • the preset identification rule is used to further determine whether the candidate application is an application that needs to be managed with abnormal power consumption. Therefore, the preset recognition rule may be any recognition rule that can achieve the above effect.
  • determining the candidate application according to the preset recognition rule may include: determining an application screening condition corresponding to the application type according to the application type corresponding to the candidate application; and further consuming the candidate application The electrical behavior is compared with the determined application screening conditions, and the candidate application is determined according to the comparison result.
  • the application types may include but are not limited to at least one of normal positioning applications, normal multimedia applications, normal game applications, and normal download applications; accordingly, this implementation
  • the preset identification rules in the example may include but are not limited to at least one of the following rules:
  • Rule 1 When the application type of the candidate application is a normal positioning application, and when the candidate application has positioning information interaction, and the interactive positioning information meets the preset positioning information filtering conditions, it is determined that the candidate application belongs to the normal positioning application; otherwise, It can be determined that the candidate application is an application to be managed.
  • the positioning information in this embodiment may include messages generated during various positioning processes, and may also select information generated during specific positioning processes according to requirements, such as, but not limited to, positioning data used to determine the location, and may also include broadcast Or reminder voice information, etc .; in an example, when the application type of the candidate application is a normal positioning application, the preset positioning information filtering condition may include but is not limited to at least one of the following:
  • the positions corresponding to the interactive positioning data within the preset time period are not the same position.
  • the time period can be flexibly set according to specific application requirements, for example, set to 5 minutes, 10 minutes, etc.
  • the location corresponding to the positioning data at different times can be performed For comparison, when the distance difference is less than or equal to the set distance difference threshold, it can be determined that it is the same position, of course, it can also be determined in any other way;
  • Voice data is not included in the interactive positioning information.
  • the candidate application when it is determined that the interaction information includes voice data, the candidate application may be determined as a multimedia application; it may not be determined as a positioning application; of course, in some other application scenarios It can also be further determined whether it is a positioning type or a multimedia type according to the voice data content (for example, related voice content such as navigation broadcasts);
  • the interactive positioning information in this embodiment may be positioning information within a preset duration after the application is determined as a candidate application, or positioning information within a preset duration before the application is determined as a candidate application, or combined with the application before and as a candidate application. Positioning information within the total preset duration after candidate application.
  • the preset multimedia information filtering conditions in this embodiment are mainly used to determine whether the multimedia application is in a normal use state; specific judgment rules can be flexibly set. For example, suppose that the candidate application is a video-type multimedia application, and it is detected that it is playing video, but it is in the background running state, it can be considered that it is not normally used and belongs to a high-power-consuming application to be managed; for example, suppose that the current candidate application is Voice multimedia applications, but the interactive voice data is silent data, it can also be considered that it is not normally used, and belongs to the application of high power consumption to be managed;
  • the preset multimedia information filtering condition may include but is not limited to at least one of the following:
  • the video data does not include video playback data in the background running state
  • the voice data does not include the voice data in the mute state.
  • the interactive multimedia information in this embodiment may be the interactive multimedia information within the preset time period after the application is determined as the candidate application, or the interactive multimedia information within the preset time period before the application is determined as the candidate application, or determined as a candidate in combination with the application Interactive multimedia information within the total preset duration before application and after being determined as a candidate application.
  • Rule 3 When the application type of the candidate application is a normal download application, and when the candidate application has a download data stream and the download data stream meets the preset download conditions, it is determined that the candidate application belongs to a normal multimedia application; otherwise, it can be determined The candidate application is an application to be managed.
  • the preset download conditions include:
  • the download rate of the download data stream is greater than or equal to the preset download rate value; the preset download rate value can be flexibly set, for example, it can be flexibly set according to the current network environment of the terminal or the real-time remaining resources of the terminal.
  • Rule 4 When the application type of the candidate application is a normal game application, and when there is an interaction control instruction in the candidate application, and the interaction control instruction meets the preset interaction instruction screening conditions, it is determined that the candidate application belongs to the normal game application; otherwise, it can be The candidate application is determined to be an application to be managed.
  • the preset interactive instruction filtering condition in this embodiment is used to determine whether the candidate application belongs to a normally used game application, so the preset interactive instruction filtering condition may be an interactive control instruction to determine whether the candidate application has various game categories, For example, direction control instructions, skill release control instructions, etc .; if it exists, it can be flexibly determined as a game application.
  • the above-mentioned four rules in this embodiment are only rules that are exemplified for ease of understanding, and the preset identification rules in this embodiment are not limited to the above-mentioned types of rules.
  • the preset recognition rule may include any one of the above rules, or may include two or more of the above rules. When two or more of the above rules are included, the candidate application only needs to meet any one of the rules.
  • the execution timing between each rule can be flexibly set, for example, it can be executed in parallel or sequentially in accordance with a preset order; and In some application scenarios, at least two of the above rules can also be used flexibly in combination, and after a candidate application can be set to satisfy any rule, the candidate application is no longer brought into other rules for judgment.
  • step S101 before performing step S101, that is, before monitoring each application currently running on the terminal, each application currently running on the terminal and the preset application can be white. The list is compared to determine which of the applications currently running on the terminal are not in the application whitelist, and then monitor the currently running applications that are not in the application whitelist.
  • the candidate application when determining the candidate application according to the preset identification rule, if it is determined that the candidate application is not an application to be managed, the candidate application may be added to the preset application In the white list, to avoid the need to continuously monitor each application currently running on the terminal in the later monitoring process, resulting in a waste of terminal resources.
  • the candidate application may be quit running (for example, when a user voluntarily quits the application so that the application is no longer being run, Or the terminal is powered off), the candidate application may be removed from the preset application whitelist.
  • various application identification information that can uniquely identify an application can be stored in the application whitelist to reflect which applications are included in the list for subsequent comparison and screening, such as including but not including Limited to at least one of the application's package name, UID (unique identifier, such as a global 32-bit unique number), and so on.
  • the application to be managed is used for energy-saving control, and various methods for energy-saving control of the application may be adopted.
  • it includes but is not limited to freezing the application to be managed, or shutting down the process that consumes much power of the target application.
  • the method of freezing can be to make the application unavailable through system interface functions such as "pm disable” and “am force-stop", or to force the application to close to “freeze” "Effect.
  • this embodiment is not limited to these two exemplary freezing methods.
  • corresponding thawing conditions may also be set for the frozen application, and when it is detected that the thawing conditions of a frozen application are satisfied, the application is defrosted.
  • system services related to the application in the system are not actually frozen, for example, broadcast distribution of the application, Application service components, etc. These services may cause ANR (Application Not Responding) when the application is frozen.
  • system services related to the frozen application may be frozen.
  • the broadcast distribution of the frozen application may be discarded, and / or the service component that starts the frozen application may be stopped.
  • the terminal will propose an ANR box to notify the user, and the pop-up of the ANR box will undoubtedly reduce the user experience.
  • the management application After freezing, if an ANR about the application to be managed is detected, the ANR box is automatically blocked so that it does not pop up, thereby avoiding impact on the user.
  • calls between various processes of the system may involve calls involving applications that have been frozen.
  • the method is: when a system call operation for a frozen application is detected, the frozen application is unfrozen, and the system call operation is performed. Thereafter, after the execution of the call operation is completed, the application can be restarted. Freeze.
  • the frozen application will be unfrozen for all system call operations, which will result in increased system overhead, but in the actual application process, not all involve freezing.
  • the system call operation of the application will cause a system failure.
  • the preset operation abandonment conditions should be designed in accordance with the following principles: try to allow the terminal to complete the system operation (such as the binder operation) as much as possible to avoid the application logic of the frozen application causing terminal operation. Coherence.
  • various known system call operations of each application that do not need to be thawed, not executed, or cause system failures can be summarized in a table.
  • This table is the preset operation abandonment condition. If the system call operation for a frozen application is the system call operation corresponding to the application record in the table, the system call operation can be discarded.
  • the application with higher power consumption among the applications currently running on the terminal can be determined in real time according to the type of application to which it belongs to whether it is currently a normally used application to determine Whether it is necessary to control energy saving and power consumption; it is not simply relying on the preset application list or terminal working mode to directly determine an application that is currently running outside the application list or the working mode as abnormal power consumption application.
  • the application may indeed be an application with abnormal power consumption in some specific application scenarios, but in some application scenarios it is an application with normal power consumption, that is, an application that runs normally.
  • the application that belongs to the list is directly determined as an application with abnormal power consumption according to a preset application list or working mode, which has a large error, and it is easy to mistake a normal running application as an application with abnormal power consumption ; And its judgment depends to a large extent on the accurate settings of the application in the list, and users often cannot adjust the list accurately or in real time to keep the list accurate, which also leads to the application list based on the preset
  • the obtained judgment result has a large error, which further reduces the user experience satisfaction.
  • the application control method provided in this embodiment dynamically determines real-time and dynamically determined applications to be managed that require energy-saving control according to the actual power consumption of the application currently running on the terminal and the application type corresponding to the application.
  • the corresponding service provider settings or the corresponding application list of the service have better practicability and intelligence, higher accuracy, better versatility and intelligence, and can further improve user experience satisfaction.
  • this embodiment takes the control of saving energy as the way to freeze the application as an example to further explain the embodiment of the present invention.
  • the present invention includes five logical layers, namely a detection layer, a decision layer, a freezing layer, a defrosting layer, and an exception handling layer.
  • the exception handling layer is divided into framework exception handling layer and driving exception handling layer.
  • the detection layer is used to detect the state of the terminal turning on and off the screen, and the abnormal power consumption behavior of the system background. If the abnormal power consumption behavior is satisfied, the application information is reported to the decision module. At the same time, it also cooperates with the defrosting module to detect applications suitable for defrosting.
  • the decision layer is used to determine whether it is necessary to perform a freeze operation according to the specific type and status of the current application. If freezing is required, a freeze instruction is issued to the freeze execution layer. If freezing is not required, the abnormal monitoring strategy of the detection layer can be adjusted to let The detection layer no longer monitors the application.
  • the freezing layer is used to freeze the application to be frozen according to the application information to be frozen provided by the freezing decision layer.
  • the thawing layer is used for thawing applications that require thawing.
  • the framework exception handling layer is used to handle exceptions that may occur after the application is frozen, such as discarding the broadcast distribution of the frozen application to avoid ANR, stopping the service component that starts the frozen application to avoid ANR, and at the same time, ANR that has occurred for the frozen application Make circumvention to prevent the system from terminating frozen applications due to ANR. At the same time, it cooperates with the thaw module to restore and cancel some exception handling strategies, such as canceling the broadcast discarding of the frozen application, and restoring the broadcast distribution to the unfrozen application.
  • the driver exception handling layer is used when a binder (a means of communication between processes) calls a frozen application to take the action of giving up freezing or abandoning operations to ensure that the system is normal, and let it complete the binder operation normally as much as possible to avoid freezing Possible inconsistencies in the application logic of the application, more importantly, to avoid system failure caused by binder blocking.
  • FIG. 3 is a schematic diagram of a process for performing layered freezing of applications provided by this embodiment, including:
  • Step S301 When the application switches to the background, the detection layer monitors the activities of these applications in the background.
  • Step S302 When detecting that an application has abnormal power consumption behavior, report the abnormal power consumption behavior and the application type of the application to the decision layer;
  • the detection layer continuously monitors the application for abnormal power consumption in the background. If there is abnormal power consumption behavior, it will be reported to the decision-making layer. The next step is to comprehensively judge the conditions of the application and determine whether to report to the frozen layer.
  • Step S303 The decision layer comprehensively decides whether to freeze the application according to the reported abnormal power consumption behavior and application type.
  • the decision layer can adjust the abnormal monitoring strategy of the detection layer so that the detection layer no longer monitors the application.
  • Step S304 When the decision layer thinks that the application needs to be frozen, the freezing layer is notified to perform the freezing operation.
  • Step S305 After receiving the instruction from the decision layer, the freezing layer freezes the application.
  • the framework exception handling layer discards the broadcast distribution to the frozen application, stops the service component that starts the frozen application, and at the same time makes circumvention on the ANR that has occurred in the frozen application.
  • the framework exception handling layer is responsible for handling the exceptions that may occur after the application is frozen, such as discarding the broadcast distribution of the frozen application to avoid ANR, stopping the service components that start the frozen application to avoid ANR, and at the same time, making the ANR of the frozen application. Avoid processing and avoid the system from terminating frozen applications due to ANR.
  • the driver exception handling layer will take actions such as giving up freezing or abandoning operations to ensure that the system is normal.
  • the detection layer detects that the thawing conditions are met, it will notify the thawing layer to defrost the application.
  • the framework exception handling layer cooperates with the unfreeze layer to cancel some exception handling strategies, such as canceling the broadcast discarding of the frozen application and restoring the broadcast distribution to the unfrozen application, and restoring the normal startup of service components.
  • the application control method provided in this embodiment can flexibly and accurately determine the applications that need to perform energy-saving control on the terminal with abnormal power consumption, and perform control processing on these applications through energy-saving processing methods such as freezing, etc. Freeze and unfreeze applications under conditions that affect users' real needs, saving system resources such as CPU, memory, and battery, improving terminal endurance performance and resource utilization, and improving user experience.
  • This embodiment provides an application control device, which can be installed in various terminals, as shown in FIG. 4, including: a monitoring module 41, a determination module 42, and a processing module 43; wherein:
  • the monitoring module 41 is used to monitor each application currently running on the terminal;
  • the determining module 42 is configured to determine the candidate application according to the preset identification rule when the monitoring module 41 detects the candidate application that satisfies the preset first power consumption condition, to determine whether the candidate application is an application to be managed; specifically determine the application For the process of satisfying the preset first power consumption condition and the process of determining the candidate application according to the preset identification rule, reference may be made to the relevant parts described in the foregoing embodiments, and details are not described herein again.
  • the preset first power consumption condition in this embodiment may include: the application is currently running in the background and has a preset high power consumption behavior.
  • the processing module 43 is used to control energy saving of the application to be managed when the determination module 42 determines that the candidate application is an application to be managed.
  • various methods of energy-saving control of the application may be adopted. Examples include, but are not limited to, freezing applications to be managed.
  • the processing module 43 is further configured to: after freezing the application to be managed, freeze the system service related to the frozen application. For example, the broadcast distribution of the frozen application may be discarded, and / or the service component that starts the frozen application may be stopped.
  • the terminal will propose an ANR box to notify the user, and the pop-up of the ANR box will undoubtedly reduce the user experience.
  • the processing module 43 may freeze the application to be managed After that, if an ANR about the application to be managed is detected, the ANR box is automatically shielded so that it does not pop up, thereby avoiding impact on the user.
  • a feasible implementation method is: When a system call operation for a frozen application is detected, the processing module 43 unfreezes the frozen application and executes the system call operation. After that, the processing module 43 can re-apply the application after the execution of the call operation is completed Freeze.
  • the frozen application will be unfrozen for all system call operations, which will result in increased system overhead, but in the actual application process, not all involve freezing.
  • the system call operation of the application will cause a system failure.
  • the processing module 43 determines the system call operation Whether the preset operation abandonment condition is satisfied; if it is satisfied, the system call operation is abandoned; otherwise, the frozen application is defrosted and the system call operation is performed. Of course, afterwards, the processing module 43 may freeze the application again after the calling operation is completed.
  • the preset operation abandon condition should be designed in accordance with the following principle: try to allow the terminal to complete the system operation (such as binder operation) as much as possible to avoid the application logic of the frozen application causing terminal operation. Incoherence.
  • various known system call operations of each application that do not need to be thawed, not executed, or cause system failures can be summarized in a table.
  • This table is the preset operation abandonment condition. If the system call operation for a frozen application is the system call operation corresponding to the application record in the table, the system call operation can be discarded.
  • This embodiment also provides a terminal, which includes but is not limited to a smart phone, a notebook computer, a digital broadcast receiver, a personal digital assistant (PDA), a tablet computer (PAD), a portable multimedia player (PMP), and a navigation device Mobile terminals, etc. and fixed terminals such as digital TVs, desktop computers, etc.
  • a terminal which includes but is not limited to a smart phone, a notebook computer, a digital broadcast receiver, a personal digital assistant (PDA), a tablet computer (PAD), a portable multimedia player (PMP), and a navigation device Mobile terminals, etc. and fixed terminals such as digital TVs, desktop computers, etc.
  • PDA personal digital assistant
  • PAD tablet computer
  • PMP portable multimedia player
  • FIG. 5 it includes a processor 501, a memory 502, and a communication bus 503;
  • the communication bus 503 is used to realize the communication connection between the processor 501 and the memory 502;
  • the processor 501 may be used to execute one or more computer programs stored in the memory 502 to implement the steps of the application control method in the above embodiments.
  • This embodiment also provides a computer-readable storage medium, which is implemented in any method or technology for storing information (such as computer-readable instructions, data structures, computer program modules, or other data) Volatile or non-volatile, removable or non-removable media.
  • Computer-readable storage media include but are not limited to RAM (Random Access Memory, random access memory), ROM (Read-Only Memory, read-only memory), EEPROM (Electrically Erasable Programmable read only memory, live erasable programmable read-only memory ), Flash memory or other memory technology, CD-ROM (Compact Disc Read-Only Memory, CD-ROM), digital versatile disk (DVD) or other optical disk storage, magnetic box, magnetic tape, magnetic disk storage or other magnetic storage devices, Or any other medium that can be used to store desired information and can be accessed by a computer.
  • RAM Random Access Memory
  • ROM Read-Only Memory
  • EEPROM Electrically Erasable Programmable read only memory
  • live erasable programmable read-only memory Flash
  • the computer-readable storage medium may be used to store one or more computer programs, and the one or more computer programs may be executed by one or more processors to implement the steps of the application control method in the above embodiments .
  • This embodiment also provides a computer program (or computer software), which can be distributed on a computer-readable medium and executed by a computable device to implement at least the application control method shown in the above embodiments One step; and in some cases, at least one step shown or described may be performed in an order different from that described in the above embodiment.
  • a computer program or computer software
  • This embodiment also provides a computer program product, which includes a computer-readable device, and the computer program as shown above is stored on the computer-readable device.
  • the computer-readable device may include the computer-readable storage medium shown above.
  • communication media generally contains computer readable instructions, data structures, computer program modules, or other data in a modulated data signal such as a carrier wave or other transmission mechanism, and may include any information delivery medium. Therefore, the present invention is not limited to any specific combination of hardware and software.
  • each application currently running on the terminal can be monitored, and when it is detected that the preset first power consumption is satisfied
  • the candidate application is determined according to a preset recognition rule to determine whether the candidate application is an application to be managed; if the candidate application is determined to be an application to be managed, energy savings can be made for the application to be managed Consume control.
  • two screenings are substantially realized, thereby improving the monitoring accuracy of applications with abnormal power consumption.
  • the energy-saving processing of the selected applications to be managed including but not limited to freezing processing, it can improve the endurance and resource utilization of the terminal without affecting the user's normal use of the terminal, thereby improving the user Satisfaction of experience.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Telephone Function (AREA)
  • Stored Programmes (AREA)

Abstract

Provided are an application control method, device, terminal, and computer-readable storage medium; during use of a terminal, it is possible to monitor applications currently running on the terminal (S101), and if a candidate application meeting a preset first power consumption condition is detected, determine the candidate application according to a preset recognition rule and determine whether the candidate application is an application to be managed (S102); if it is determined that the candidate application is an application to be managed, then power consumption control may be performed on the application to be managed (S103).

Description

应用控制方法、装置、终端及计算机可读存储介质Application control method, device, terminal and computer readable storage medium
相关申请的交叉引用Cross-reference of related applications
本申请基于申请号为201811330814.6、申请日为2018年11月9日的中国专利申请提出,并要求该中国专利申请的优先权,该中国专利申请的全部内容在此引入本申请作为参考。This application is based on a Chinese patent application with an application number of 201811330814.6 and an application date of November 9, 2018, and claims the priority of the Chinese patent application. The entire content of the Chinese patent application is hereby incorporated by reference.
技术领域Technical field
本发明涉及通信技术领域,尤其涉及一种应用控制方法、装置、终端及计算机可读存储介质。The present invention relates to the field of communication technology, and in particular, to an application control method, device, terminal, and computer-readable storage medium.
背景技术Background technique
随着智能终端技术的发展以及在人们的生活和工作中充当着越来越重要的角色,在终端上所安装的应用越来越多,应用的功能也越来越丰富和强大,以满足用户在生活和工作中的各种应用需求。With the development of smart terminal technology and playing an increasingly important role in people's lives and work, more and more applications are installed on the terminal, and the functions of the applications are becoming more and more rich and powerful to satisfy users Various application requirements in life and work.
但是,随着终端支持应用的多样化和功能的强大,在终端使用过程中,往往会发现存在以下情况:终端上安装的应用越多,即使某些应用没有使用,也能感觉到终端的电池消耗越来越快,内存越来越少。这是因为有些应用即使没有使用,这些应用也会在后台频繁的占用CPU等系统资源,导致终端的耗电量较大;终端电池能力、内存等硬件资源在丰富多彩的应用面前就显得捉襟见肘,从而影响用户体验。However, as the terminal supports diversified applications and powerful functions, during the use of the terminal, the following situations are often found: the more applications installed on the terminal, even if some applications are not used, you can feel the battery of the terminal The consumption is getting faster and faster, and the memory is getting less and less. This is because some applications frequently use system resources such as CPU in the background even if they are not used, resulting in a large power consumption of the terminal; hardware resources such as the battery capacity and memory of the terminal are stretched in front of colorful applications. Thus affecting the user experience.
因此,对于终端上所安装的众多应用中,如何准确的确定出需要进行管理的应用进行功耗管理就显得尤为重要。Therefore, for many applications installed on the terminal, how to accurately determine the applications that need to be managed for power consumption management is particularly important.
发明内容Summary of the invention
本发明实施例提供的一种应用控制方法、装置、终端及存储介质,主要解决的技术问题是:如何准确的确定出终端上需要进行管理的应用。An application control method, device, terminal, and storage medium provided by embodiments of the present invention mainly solve the technical problem of how to accurately determine the applications to be managed on the terminal.
为解决上述技术问题,本发明实施例提供一种应用控制方法,包括:To solve the above technical problems, embodiments of the present invention provide an application control method, including:
对终端上当前运行的各应用进行监测;Monitor each application currently running on the terminal;
在监测到满足预设第一功耗条件的候选应用时,根据预设识别规则对所述候选应用进行判定,以确定所述候选应用是否为待管理应用;When a candidate application that satisfies the preset first power consumption condition is monitored, determine the candidate application according to a preset recognition rule to determine whether the candidate application is an application to be managed;
在确定所述候选应用为待管理应用时,对所述待管理应用进行节省能耗的控制。When it is determined that the candidate application is an application to be managed, energy saving control is performed on the application to be managed.
为解决上述技术问题,本发明实施例还提供一种应用控制装置,包括:监测模块、初级确定模块和处理模块;To solve the above technical problems, an embodiment of the present invention also provides an application control device, including: a monitoring module, a primary determination module, and a processing module;
所述监测模块用于对终端上当前运行的各应用进行监测;The monitoring module is used to monitor each application currently running on the terminal;
所述确定模块用于在所述监测模块监测到满足预设第一功耗条件的候选应用时,根据预设识别规则对所述候选应用进行判定,以确定所述候选应用是否为待管理应用;The determining module is configured to determine the candidate application according to a preset recognition rule when the monitoring module detects a candidate application that satisfies a preset first power consumption condition to determine whether the candidate application is an application to be managed ;
所述处理模块用于在所述确定模块确定所述候选应用为待管理应用时,对所述待管理应用进行节省能耗的控制。The processing module is configured to control energy saving of the application to be managed when the determination module determines that the candidate application is an application to be managed.
为解决上述技术问题,本发明实施例还提供一种终端,包括处理器、存储器和通信总线;To solve the above technical problems, an embodiment of the present invention also provides a terminal, including a processor, a memory, and a communication bus;
所述通信总线用于将所述处理器和存储器连接;The communication bus is used to connect the processor and the memory;
所述处理器用于执行所述存储器中存储的计算机程序,以实现如上所述的应用控制方法的步骤。The processor is used to execute a computer program stored in the memory to implement the steps of the application control method as described above.
为解决上述技术问题,本发明实施例还提供一种计算机可读存储介质,所述计算机可读存储介质存储有一个或者多个计算机程序,所述一个或者多个计算机程序可被一个或者多个处理器执行,以实现如上所述的应用控制方法的步骤。To solve the above technical problems, embodiments of the present invention also provide a computer-readable storage medium, where the computer-readable storage medium stores one or more computer programs, and the one or more computer programs may be used by one or more The processor executes to implement the steps of the application control method as described above.
本发明其他特征和相应的有益效果在说明书的后面部分进行阐述说明,且应当理解,至少部分有益效果从本发明说明书中的记载变的显而易见。Other features and corresponding beneficial effects of the present invention are explained in the later part of the description, and it should be understood that at least part of the beneficial effects will become apparent from the description in the description of the present invention.
附图说明BRIEF DESCRIPTION
图1为本发明实施例一的应用控制方法流程示意图;1 is a schematic flowchart of an application control method according to Embodiment 1 of the present invention;
图2为本发明实施例二的系统框架示意图;2 is a schematic diagram of a system framework according to Embodiment 2 of the present invention;
图3为本发明实施例二的一种对应用分层执行冻结的流程示意图;3 is a schematic diagram of a process for performing layered freezing of applications according to Embodiment 2 of the present invention;
图4为本发明实施例三的应用控制装置结构示意图;4 is a schematic structural diagram of an application control device according to Embodiment 3 of the present invention;
图5为本发明实施例四的终端结构示意图。5 is a schematic structural diagram of a terminal according to Embodiment 4 of the present invention.
具体实施方式detailed description
为了使本发明的目的、技术方案及优点更加清楚明白,下面通过具体实施方式结合附图对本发明实施例作进一步详细说明。应当理解,此处所描述的具体实施例仅仅用以解释本发明,并不用于限定本发明。In order to make the objectives, technical solutions and advantages of the present invention clearer, the embodiments of the present invention will be further described in detail below through specific implementations in conjunction with the accompanying drawings. It should be understood that the specific embodiments described herein are only used to explain the present invention, and are not intended to limit the present invention.
实施例一:Example one:
本实施例提供了一种应用控制方法,可以实现对终端上当前运行的各应用的功耗是否异常进行准确的监测,并对监测到的存在功耗异常的应用进行节省能耗的控制,进而实现在不影响用户正常使用终端的同时,提升终端续航能力和资源利用率,提升用户体验的满意度。This embodiment provides an application control method, which can accurately monitor whether the power consumption of each application currently running on the terminal is abnormal, and control the energy saving of the monitored applications with abnormal power consumption, and further It can improve the endurance and resource utilization of the terminal without affecting the user's normal use of the terminal, and improve the satisfaction of the user experience.
本实施例提供的一种应用控制方法,参见图1所示,包括:An application control method provided in this embodiment, as shown in FIG. 1, includes:
S101:对终端上当前运行的各应用进行监测;S101: Monitor each application currently running on the terminal;
S102:在监测到满足预设第一功耗条件的候选应用时,根据预设识别规则对该候选应用进行判定,以确定该候选应用是否为待管理应用;S102: When a candidate application that satisfies a preset first power consumption condition is monitored, determine the candidate application according to a preset identification rule to determine whether the candidate application is an application to be managed;
S103:在确定该候选应用为待管理应用时,对该待管理应用进行节省能耗的控制。S103: When determining that the candidate application is an application to be managed, perform energy saving control on the application to be managed.
应当理解的是,本实施例中的终端可以是支持应用运行的各种智能终端,例如包括但不限于智能电话、笔记本电脑、数字广播接收器、个人数字助理(PDA)、平板电脑(PAD),便携式多媒体播放器(PMP)、导航装置等等的移动终端以及诸如数字TV、台式计算机等等的固定终端。且本实施例中终端上运行的系统可包括但不限于Android、iOS、windows phone、Symbian、BlackBerry OS、windows mobile、以及微软的应用于PC机上的windows系列系统、苹果的MAC系列系统,还可包括linux系统等。It should be understood that the terminal in this embodiment may be various smart terminals that support application operation, such as but not limited to smart phones, notebook computers, digital broadcast receivers, personal digital assistants (PDAs), and tablet computers (PADs) , Portable multimedia players (PMP), mobile devices such as navigation devices, and fixed terminals such as digital TVs, desktop computers, and so on. In addition, the system running on the terminal in this embodiment may include, but not limited to, Android, iOS, windows, Symbian, BlackBerry OS, windows mobile, and Microsoft Windows series systems applied to PCs, and Apple ’s MAC series systems. Including linux system, etc.
本实施例中,终端上当前运行的各应用包括在终端上启动,运行于后台的各种应用,也可包括运行于前台的各种应用,或者根据需求同时包括运行于后台和前台的各应用。当同时包括运行于前台和后台的各种应用时,可以对终端上当前运行的所有应用进行全面的监测,避免仅针对后台运行的应用进行监测,而导致前台运行的应用发生异常时不能及时、准确的发现。尤其是针对恶意应用针对该漏洞将相关进程维持在终端前台运行,从而可逃出异常监测范围,导致终端上明明进行了异常应用监测,却监测不到异常应用情况的发生,因此,在一种示例中,当同时对终端上前台和后台的各种应用是否满足第一功耗条件进行监测时,可以实现对终端当前运行的所有应用进行监测,避免前台运行的异常应用因相关技术未将其纳入监测范围而导致漏监测的情况发生,可进一步提升用户体验满意度。In this embodiment, each application currently running on the terminal includes various applications that are started on the terminal and run in the background, and may also include various applications that run in the foreground, or include applications that run in both the background and the foreground according to requirements. . When including various applications running in the foreground and background, all applications currently running on the terminal can be comprehensively monitored to avoid monitoring only for applications running in the background, which can cause timely, abnormal, Accurate discovery. Especially for malicious applications, the related process is maintained in the terminal foreground of the terminal, so that it can escape from the abnormal monitoring range, resulting in the abnormal application monitoring on the terminal, but the abnormal application situation cannot be detected. Therefore, in a In the example, when monitoring whether the various applications in the foreground and background on the terminal meet the first power consumption condition at the same time, it is possible to monitor all the applications currently running on the terminal to avoid abnormal applications running in the foreground because the related technology does not Incorporating monitoring into the scope and resulting in missing monitoring can further improve user experience satisfaction.
在本实施例的另一示例中,也可以仅针对获取终端上当前运行于后台的各应用进行监测。因为一些应用场景中,例如各种智能手机、IPAD等终端,运行于前台的应用一般只有一款或两款应用,且运行于前台的应用一般为用户当前正在使用的应用。因此,针对这些应用场景,可以仅针对终端上当前运行于后台的各应用进行监测。在本实施例的一种可行方式中,可以直接在预设第一功耗条件中设定包括有应用当前处于后台运行状态(即此时终端仍会对前台和后台的所有应用进行监测,只是前台应用必然不满足预设第一功耗条件);在本实施例的另一种可行方式中,也可以直接设定监测条件,使得终端仅会针对后台应用进行监测,对于前台应用的监测则直接跳过。In another example of this embodiment, it is also possible to monitor only the applications currently running in the background on the acquisition terminal. Because in some application scenarios, such as various smart phones, IPAD and other terminals, the application running in the foreground generally has only one or two applications, and the application running in the foreground is generally the application currently being used by the user. Therefore, for these application scenarios, it is possible to monitor only the applications currently running in the background on the terminal. In a feasible manner of this embodiment, the preset first power consumption condition may be directly set to include that the application is currently running in the background (that is, the terminal will still monitor all applications in the foreground and background at this time, but The foreground application must not satisfy the preset first power consumption condition); in another feasible manner of this embodiment, the monitoring conditions can also be directly set so that the terminal will only monitor the background application, while the foreground application monitoring Skip directly.
在本实施例的一种可行实施方式中,第一功耗条件可以包括:应用当前处于后台运行状态,且具有预设高耗电行为。当然,如上分析所示,在一些应用场景中,第一功耗条件可以仅包括:应用具有预设高耗电行为,对应用是在前台运行还是后台运行并不做限制。In a feasible implementation manner of this embodiment, the first power consumption condition may include: the application is currently running in the background, and has a preset high power consumption behavior. Of course, as shown in the above analysis, in some application scenarios, the first power consumption condition may only include: the application has a preset high power consumption behavior, and does not limit whether the application runs in the foreground or background.
应当理解的是,在本实施例中,可以从各方面确定终端运行的应用中,哪些应用存在高耗电行为,例如可包括但不限于从处理器的占用情况、内存的占用情况、唤醒锁的占用情况、定位资源的占用情况以及传感器的占用情况中的至少方面确定应用当前是否为耗电 较高的应用,以确定是否需要将其纳入候选应用集合中。It should be understood that, in this embodiment, it can be determined from various aspects which of the applications running on the terminal have high power consumption behaviors, such as but not limited to slave processor occupancy, memory occupancy, and wake lock At least aspects of the occupancy status of the application, the occupancy status of the positioning resource, and the occupancy status of the sensor determine whether the application is currently an application with high power consumption to determine whether it needs to be included in the candidate application set.
例如,在一种示例中,预设高耗电行为可包括但不限于以下中的至少一种:For example, in one example, the preset high power consumption behavior may include but is not limited to at least one of the following:
处理器占用状态符合预设第一状态;在本实施例中,处理器可以包括中央处理器和图形处理器(Graphics Processing Unit,GPU)中的至少一种;本实施例中的处理器占用状态可以为处理器占用时长,也可以为处理器的资源占用情况,或者同时包括处理器占用时长(可以是连续时长,也可以是在一个周期内占用处理器的总时长),或处理器的资源占用量值;相应的,第一状态可以包括预设的处理器占用时长阈值,和/或处理器资源占用阈值;例如,在一种示例中,处理器占用状态包括处理器占用时长,则处理器占用时长大于等于处理器占用时长阈值时,则认为处理器占用状态符合预设第一状态;相应的,在其他示例中,处理器占用状态包括处理器资源占用量值(可以是占用资源的比例值或绝对值等)时,则处理器资源占用量值大于等于处理器资源占用阈值时,则认为处理器占用状态符合预设第一状态;The processor occupancy state conforms to the preset first state; in this embodiment, the processor may include at least one of a central processing unit and a graphics processor (Graphics, Processing, Unit, GPU); the processor occupancy state in this embodiment It can be the processor occupancy time, it can also be the processor resource occupancy, or it can also include the processor occupancy time (which can be a continuous time, it can also be the total duration of the processor occupied in a cycle), or the processor resources Occupancy value; correspondingly, the first state may include a preset threshold of processor occupation time, and / or a threshold of processor resource occupation; for example, in one example, the processor occupation state includes processor occupation time, then process If the processor occupancy time is greater than or equal to the processor occupancy time threshold, the processor occupancy state is considered to be in accordance with the preset first state; correspondingly, in other examples, the processor occupancy state includes the processor resource occupancy value (which may be the resource occupancy) When the proportional or absolute value, etc.), the processor resource occupancy value is greater than or equal to the processor resource occupancy threshold, it is recognized Processor occupancy status conforms to a predetermined first state;
内存占用状态符合预设第二状态;本实施例中内存占用状态可以是应用占用内存资源的变化趋势,此时的第二状态可以是资源占用量增加或逐渐增加等;本实施例中内存占用状态也可以是应用占用的内存占用量值(可以是占用资源的比例值(该比例值可以是当前各应用占用资源比例的排名)或绝对值等),此时的第二状态可以包括内存资源占用阈值,当内存占用量值大于等于该内存资源占用阈值时,可认为该应用的内存占用状态符合预设第二状态;The memory occupancy state conforms to the preset second state; in this embodiment, the memory occupancy state may be the change trend of the memory resource occupied by the application, and the second state at this time may be an increase or a gradual increase in resource occupancy; etc. The state can also be the amount of memory occupied by the application (which can be the proportion of occupied resources (the proportion can be the current ranking of the proportion of resources occupied by each application) or absolute value, etc.), and the second state at this time can include memory resources Occupation threshold, when the memory occupancy value is greater than or equal to the memory resource occupancy threshold, the memory occupancy state of the application may be considered to conform to the preset second state;
唤醒锁占用状态符合预设第三状态;在本实施例中,该唤醒锁的占用状态可以为唤醒锁的占用时长(可以是连续时长,也可以是在一个周期内占用处理器的总时长);相应的,第三状态可以包括预设的唤醒锁占用时长阈值,例如,在一种示例中,唤醒锁占用状态包括唤醒锁占用时长,则唤醒锁占用时长大于等于唤醒锁占用时长阈值时,则认为唤醒锁占用状态符合预设第三状态;The occupancy state of the wake lock conforms to the preset third state; in this embodiment, the occupancy state of the wake lock may be the occupancy time of the awaken lock (may be a continuous duration, or may be the total duration of the processor occupied in a cycle) Correspondingly, the third state may include a preset wake lock occupation time threshold, for example, in an example, the wake lock occupation state includes the wake lock occupation time, then the wake lock occupation time is greater than or equal to the wake lock occupation time threshold, It is considered that the wake lock occupation state conforms to the preset third state;
定位资源占用状态符合预设第四状态;本实施例中的定位资源包括各种用于实现终端定位的资源,例如包括但不限于全球定位系统(Global Positioning System,GPS是英文);本实施例中的定位资源占用状态可以为定位资源占用时长(可以是连续时长,也可以是在一个周期内占用处理器的总时长),也可以为定位资源占用申请频率;相应的,第四状态可以包括预设的定位资源占用时长阈值,和/或定位资源占用申请频率阈值;例如,在一种示例中,定位资源占用状态包括定位资源占用时长,则定位资源占用时长大于等于定位资源占用时长阈值时,则认为定位资源占用状态符合预设第四状态;又例如,在其他示例中,定位资源占用状态包括定位资源占用申请频率时,则定位资源占用申请频率值大于等于定位资源占用申请频率阈值时,则认为定位资源占用状态符合预设第四状态;The occupancy state of the positioning resources conforms to the preset fourth state; the positioning resources in this embodiment include various resources for implementing terminal positioning, such as, but not limited to, a global positioning system (Global Positioning System, GPS is English); this embodiment The location resource occupancy status in can be the location resource occupancy duration (which can be a continuous duration, or the total duration of the processor occupied in a cycle), or it can be the frequency of location resource occupancy application; correspondingly, the fourth status can include The preset positioning resource occupation time threshold and / or positioning resource occupation application frequency threshold; for example, in one example, the positioning resource occupation state includes the positioning resource occupation time, when the positioning resource occupation time is greater than or equal to the positioning resource occupation time threshold , It is considered that the location resource occupancy state conforms to the preset fourth state; for example, in other examples, when the location resource occupancy state includes the location resource occupancy application frequency, the location resource occupancy application frequency value is greater than or equal to the location resource occupancy application frequency threshold , It is considered that the location resource occupancy status meets The fourth state is provided;
传感器资源占用状态符合预设第五状态,本实施例中的传感器可以是终端上除定位用 的GPS传感器之外的其他任意传感器,例如接近传感器、重力传感器、图像采集传感器等;本实施例中的传感器资源占用状态可以为传感器资源占用时长(可以是连续时长,也可以是在一个周期内占用处理器的总时长),也可以为传感器资源占用申请频率;相应的,第五状态可以包括预设的传感器资源占用时长阈值,和/或传感器资源占用申请频率阈值;例如,在一种示例中,传感器资源占用状态包括传感器资源占用时长,则传感器资源占用时长大于等于传感器资源占用时长阈值时,则认为传感器资源占用状态符合预设第四状态;又例如,在其他示例中,传感器资源占用状态包括传感器资源占用申请频率时,则传感器资源占用申请频率值大于等于传感器资源占用申请频率阈值时,则认为定位资源占用状态符合预设第五状态。The sensor resource occupation state conforms to the preset fifth state. The sensor in this embodiment may be any sensor other than the GPS sensor for positioning on the terminal, such as a proximity sensor, a gravity sensor, an image acquisition sensor, etc .; in this embodiment The sensor resource occupancy status can be the sensor resource occupancy duration (which can be a continuous duration or the total duration of the processor occupied in a cycle), or it can apply for the sensor resource occupancy frequency; correspondingly, the fifth status can include The set threshold of sensor resource occupation duration and / or the threshold of sensor resource occupation application frequency; for example, in an example, the sensor resource occupation status includes the sensor resource occupation duration, then the sensor resource occupation duration is greater than or equal to the sensor resource occupation duration threshold, It is considered that the sensor resource occupation state conforms to the preset fourth state; for another example, in other examples, when the sensor resource occupation state includes the sensor resource occupation application frequency, the sensor resource occupation application frequency value is greater than or equal to the sensor resource occupation application frequency When the threshold is reached, it is considered that the location resource occupation state conforms to the preset fifth state.
如上分析所示,本实施例中预设高耗电行为可以包括上述示例的各行为中的任意一种,也可包括上述各行为中的两种以上;当包括上述示例的各行为的两种以上时,某一应用只要满足上述行为中的任意一种,即可将其确定为候选应用。当然,在一些应用示例中,根据具体应用场景也可设置某一应用需要同时满足两种以上的上述行为才确认其为候选应用。且应当理解的是,本实施例中的预设高耗电行为并不限于上述示例的几种行为,具体可根据需求灵活设置和更新。且在一些示例中,可支持用户和/或厂家自定义和更新。As shown in the above analysis, the preset high power consumption behavior in this embodiment may include any one of the behaviors of the above examples, or may include two or more of the above behaviors; when the two behaviors of the above examples are included In the above case, an application can be determined as a candidate application as long as it satisfies any of the above behaviors. Of course, in some application examples, an application may also be set according to a specific application scenario to satisfy more than two of the above-mentioned behaviors at the same time to confirm that it is a candidate application. And it should be understood that the preset high power consumption behavior in this embodiment is not limited to the above-mentioned exemplary behaviors, and can be flexibly set and updated according to requirements. And in some examples, users and / or manufacturers can support customization and update.
在本实施例中,预设识别规则是用于进一步确定候选应用是否为功耗异常的需要管理的应用。因此该预设识别规则可以为采用任意能实现上述效果的识别规则。In this embodiment, the preset identification rule is used to further determine whether the candidate application is an application that needs to be managed with abnormal power consumption. Therefore, the preset recognition rule may be any recognition rule that can achieve the above effect.
在本实施例的一种可行实施方式中,根据预设识别规则对候选应用进行判定可以包括:根据候选应用对应的应用类型确定该应用类型对应的应用筛选条件;进而将该候选应用的高耗电行为与该确定出的应用筛选条件进行比对,根据比对结果来对候选应用进行判定。例如,在本实施例的一种应用示例中,应用类型可包括但不限于正常定位类应用、正常多媒体类应用、正常游戏类应用以及正常下载类应用中的至少一种;相应的,本实施例中的预设识别规则可包括但不限于以下规则中的至少一种:In a feasible implementation manner of this embodiment, determining the candidate application according to the preset recognition rule may include: determining an application screening condition corresponding to the application type according to the application type corresponding to the candidate application; and further consuming the candidate application The electrical behavior is compared with the determined application screening conditions, and the candidate application is determined according to the comparison result. For example, in an application example of this embodiment, the application types may include but are not limited to at least one of normal positioning applications, normal multimedia applications, normal game applications, and normal download applications; accordingly, this implementation The preset identification rules in the example may include but are not limited to at least one of the following rules:
规则一:在候选应用的应用类型为正常定位类应用,且当候选应用存在定位信息交互,且交互的定位信息符合预设定位信息筛选条件时,确定该候选应用属于正常定位类应用;否则,即可判定该候选应用为待管理应用。Rule 1: When the application type of the candidate application is a normal positioning application, and when the candidate application has positioning information interaction, and the interactive positioning information meets the preset positioning information filtering conditions, it is determined that the candidate application belongs to the normal positioning application; otherwise, It can be determined that the candidate application is an application to be managed.
本实施例中的定位信息可以包括各种定位过程中所产生的消息,也可以根据需求挑选特定的定位过程中产生的信息,例如包括但不限于用于确定位置的定位数据、还可包括播报或提醒的语音信息等;在一种示例中,在候选应用的应用类型为正常定位类应用时,预设定位信息筛选条件可包括但不限于以下中的至少一种:The positioning information in this embodiment may include messages generated during various positioning processes, and may also select information generated during specific positioning processes according to requirements, such as, but not limited to, positioning data used to determine the location, and may also include broadcast Or reminder voice information, etc .; in an example, when the application type of the candidate application is a normal positioning application, the preset positioning information filtering condition may include but is not limited to at least one of the following:
在预设时间段内交互的定位数据所对应的位置为非同一位置。该时间段可以根据具体应用需求灵活设置,例如设置为5分钟、10分钟等;本实施例中判断定位数据所对应的位置是否为同一位置时,可以将不同时刻的定位数据所对应的位置进行比较,当距离差小于 等于设定距离差阈值时,可判定其为同一位置,当然也可采用其他任意方式判定;The positions corresponding to the interactive positioning data within the preset time period are not the same position. The time period can be flexibly set according to specific application requirements, for example, set to 5 minutes, 10 minutes, etc. In this embodiment, when determining whether the location corresponding to the positioning data is the same location, the location corresponding to the positioning data at different times can be performed For comparison, when the distance difference is less than or equal to the set distance difference threshold, it can be determined that it is the same position, of course, it can also be determined in any other way;
交互的定位信息中不包括语音数据。在实施例的一种示例中,可以设置当确定交互信息中包括语音数据时,将该候选应用确定为多媒体类的应用;而不将其确定为定位类应用;当然,在其他的一些应用场景中,也可根据语音数据内容(例如为导航播报等相关语音内容)进一步确定其是为定位类还是多媒体类;Voice data is not included in the interactive positioning information. In an example of the embodiment, when it is determined that the interaction information includes voice data, the candidate application may be determined as a multimedia application; it may not be determined as a positioning application; of course, in some other application scenarios It can also be further determined whether it is a positioning type or a multimedia type according to the voice data content (for example, related voice content such as navigation broadcasts);
本实施例中交互的定位信息可以是应用确定为候选应用后预设时长内的定位信息,也可是应用确定为候选应用之前预设时长内的定位信息,或者结合应用确定为候选应用之前和确定为候选应用之后的总的预设时长内的定位信息等。The interactive positioning information in this embodiment may be positioning information within a preset duration after the application is determined as a candidate application, or positioning information within a preset duration before the application is determined as a candidate application, or combined with the application before and as a candidate application. Positioning information within the total preset duration after candidate application.
规则二:在候选应用的应用类型为正常多媒体类应用,且当该候选应用存在多媒体信息交互,且交互的多媒体信息符合预设多媒体信息筛选条件时,确定该候选应用属于正常多媒体类应用;否则,即可判定该候选应用为待管理应用。Rule 2: When the application type of the candidate application is a normal multimedia application, and when there is multimedia information interaction with the candidate application, and the interacted multimedia information meets the preset multimedia information screening conditions, it is determined that the candidate application belongs to the normal multimedia application; otherwise To determine that the candidate application is an application to be managed.
本实施例中的预设多媒体信息筛选条件主要用于确定多媒体类应用是否处于正常使用状态;具体判断规则可以灵活设置。例如假设候选应用为视频类多媒体应用,且检测到其在播放视频,但其处于后台运行状态,则可认为其未正常使用,属于高耗电的待管理应用;又例如假设当前的候选应用为语音类多媒体应用,但其交互的语音数据为静音数据,则也可认为其未正常使用,属于高耗电的待管理应用;The preset multimedia information filtering conditions in this embodiment are mainly used to determine whether the multimedia application is in a normal use state; specific judgment rules can be flexibly set. For example, suppose that the candidate application is a video-type multimedia application, and it is detected that it is playing video, but it is in the background running state, it can be considered that it is not normally used and belongs to a high-power-consuming application to be managed; for example, suppose that the current candidate application is Voice multimedia applications, but the interactive voice data is silent data, it can also be considered that it is not normally used, and belongs to the application of high power consumption to be managed;
因此,在本实施例的一种示例中,在候选应用的应用类型为正常多媒体类应用时,预设多媒体信息筛选条件可包括但不限于以下中的至少一种:Therefore, in an example of this embodiment, when the application type of the candidate application is a normal multimedia application, the preset multimedia information filtering condition may include but is not limited to at least one of the following:
当交互的多媒体信息包括视频数据时,该视频数据不包括处于后台运行状态的视频播放数据;When the interactive multimedia information includes video data, the video data does not include video playback data in the background running state;
当交互的多媒体信息包括语音数据时,该语音数据不包括静音状态的语音数据。When the interactive multimedia information includes voice data, the voice data does not include the voice data in the mute state.
本实施例中交互的多媒体信息可以是应用确定为候选应用后预设时长内的交互的多媒体信息,也可是应用确定为候选应用之前预设时长内的交互的多媒体信息,或者结合应用确定为候选应用之前和确定为候选应用之后的总的预设时长内的交互的多媒体信息等。The interactive multimedia information in this embodiment may be the interactive multimedia information within the preset time period after the application is determined as the candidate application, or the interactive multimedia information within the preset time period before the application is determined as the candidate application, or determined as a candidate in combination with the application Interactive multimedia information within the total preset duration before application and after being determined as a candidate application.
规则三:在候选应用的应用类型为正常下载类应用,且当候选应用存在下载数据流,且下载数据流符合预设下载条件时,确定该候选应用属于正常多媒体类应用;否则,即可判定该候选应用为待管理应用。Rule 3: When the application type of the candidate application is a normal download application, and when the candidate application has a download data stream and the download data stream meets the preset download conditions, it is determined that the candidate application belongs to a normal multimedia application; otherwise, it can be determined The candidate application is an application to be managed.
例如,在一些应用场景中,在候选应用的应用类型为正常下载类应用时,所述预设下载条件包括:For example, in some application scenarios, when the application type of the candidate application is a normal download application, the preset download conditions include:
下载数据流的下载速率大于等于预设下载速率值;该预设下载速率值可以灵活设定,例如可以根据终端当前的网络环境或终端实时剩余资源情况等灵活设置。The download rate of the download data stream is greater than or equal to the preset download rate value; the preset download rate value can be flexibly set, for example, it can be flexibly set according to the current network environment of the terminal or the real-time remaining resources of the terminal.
规则四:在候选应用的应用类型为正常游戏类应用,且当候选应用存在交互控制指令, 且交互控制指令符合预设交互指令筛选条件时,确定候选应用属于正常游戏类应用;否则,即可判定该候选应用为待管理应用。Rule 4: When the application type of the candidate application is a normal game application, and when there is an interaction control instruction in the candidate application, and the interaction control instruction meets the preset interaction instruction screening conditions, it is determined that the candidate application belongs to the normal game application; otherwise, it can be The candidate application is determined to be an application to be managed.
本实施例中的预设交互指令筛选条件是用于确定候选应用是否属于正常使用的游戏类应用,因此该预设交互指令筛选条件可以是确定候选应用是否存在各种游戏类的交互控制指令,例如方向控制指令、技能释放控制指令等;如存在,则可灵活的确定其为游戏类应用。The preset interactive instruction filtering condition in this embodiment is used to determine whether the candidate application belongs to a normally used game application, so the preset interactive instruction filtering condition may be an interactive control instruction to determine whether the candidate application has various game categories, For example, direction control instructions, skill release control instructions, etc .; if it exists, it can be flexibly determined as a game application.
应当理解的是,本实施例中的上述四种规则仅仅是便于理解而示例的规则,本实施例中的预设识别规则并不限于上述示例的几种规则。且本实施例中预设识别规则可以包括上述规则中的任意一种,也可包括上述规则中的两种以上,当包括上述规则中的两种以上时,候选应用只要符合任意一种规则,即可确定其为正常运行的应用;在当包括上述规则中的两种以上时,各规则之间的执行时序可以灵活设置,例如可以并行的执行,也可按照预设的顺序依次执行;且在一些应用场景中,上述规则中的至少两种还可灵活的结合使用,且可设置候选应用满足任一规则之后,则不再将该候选应用带入其他规则进行判断。It should be understood that the above-mentioned four rules in this embodiment are only rules that are exemplified for ease of understanding, and the preset identification rules in this embodiment are not limited to the above-mentioned types of rules. Moreover, in this embodiment, the preset recognition rule may include any one of the above rules, or may include two or more of the above rules. When two or more of the above rules are included, the candidate application only needs to meet any one of the rules. It can be determined that it is a normally running application; when two or more of the above rules are included, the execution timing between each rule can be flexibly set, for example, it can be executed in parallel or sequentially in accordance with a preset order; and In some application scenarios, at least two of the above rules can also be used flexibly in combination, and after a candidate application can be set to satisfy any rule, the candidate application is no longer brought into other rules for judgment.
需要说明的是,在本实施例中,考虑到某些应用(例如用户常用的应用或实现某一些特殊功能的应用)基本不会是需要进行节能管理的应用,同时为了提升应用检测的效率和准确性,可以设置一个应用白名单(也可称之为特殊类应用),将不需要进行节能管理的各应用添加到该应用白名单中,且可选地,该应用白名单可支持用户手动更新,也可支持机器自动学习动态更新。这样,在本实施例的一种可行示例中,可以在执行步骤S101之前,即可以在对终端上当前运行的各应用进行监测之前,先对终端上当前运行的各应用与预设的应用白名单进行比对,进而确定出终端上当前运行的各应用中哪些应用没在该应用白名单中,进而针对这些没在应用白名单中的当前运行的应用进行监测。It should be noted that in this embodiment, considering that certain applications (such as applications commonly used by users or applications that implement certain special functions) are basically not applications that require energy-saving management, in order to improve the efficiency of application detection and Accuracy, you can set an application whitelist (also called special applications), add applications that do not require energy-saving management to the application whitelist, and optionally, the application whitelist can support user manual Update can also support the machine to automatically learn dynamic updates. In this way, in a feasible example of this embodiment, before performing step S101, that is, before monitoring each application currently running on the terminal, each application currently running on the terminal and the preset application can be white. The list is compared to determine which of the applications currently running on the terminal are not in the application whitelist, and then monitor the currently running applications that are not in the application whitelist.
还需要说明的是,在本实施例中,在根据预设识别规则对该候选应用进行判定时,若判定出该候选应用不为待管理应用时,可以将该候选应用加入到预设的应用白名单中,从而避免后期对终端上当前运行的各应用的监测过程中还需要不断对其进行监测,从而造成的终端资源的浪费。It should also be noted that, in this embodiment, when determining the candidate application according to the preset identification rule, if it is determined that the candidate application is not an application to be managed, the candidate application may be added to the preset application In the white list, to avoid the need to continuously monitor each application currently running on the terminal in the later monitoring process, resulting in a waste of terminal resources.
应当理解的是,在实际应用中,可能会存在某一应用上一次监测时虽然被判定为非待管理应用,但是在下一次监测时由于满足预设第一功耗条件的高耗电行为不同的,从而导致其应当被判定为待管理应用的情况。例如应用A在上一次监测时由于处理器的占用情况满足了预设第一功耗条件,但是由于其应用类型的特点,预设识别规则判定其为非待管理应用;而在下一次监测时,应用A可能是由于内存占用情况满足了预设第一功耗条件,此时根据预设识别规则则应当判定其为待管理应用。在这种情况下,由于其在上一次监测过程中被加入了应用白名单,从而导致其在下一次运行时应当被判定为待管理应用却直接躲过了监测,为了避免这种情况,在本实施例的一种可行实施方式中,在将候选应用加入到 预设的应用白名单中后,可以在该候选应用退出运行(例如用户主动退出该应用,使得该应用不再被运行的情况,或终端关机的情况)之后,可以将该候选应用从预设的应用白名单中移除。It should be understood that in an actual application, there may be an application that is determined to be not an application to be managed when it was last monitored, but due to high power consumption behavior that satisfies the preset first power consumption condition at the next monitoring. , Resulting in a situation where it should be determined as an application to be managed. For example, application A met the preset first power consumption condition due to processor occupancy during the last monitoring, but due to the characteristics of its application type, the preset recognition rule determines that it is not an application to be managed; and during the next monitoring, Application A may be due to the fact that the memory occupancy condition satisfies the preset first power consumption condition. At this time, it should be determined that it is an application to be managed according to the preset identification rule. In this case, because it was added to the application whitelist in the previous monitoring process, it should be judged as an application to be managed but evaded monitoring directly in the next run. In order to avoid this situation, in this book, In a feasible implementation manner of the embodiment, after the candidate application is added to the preset application whitelist, the candidate application may be quit running (for example, when a user voluntarily quits the application so that the application is no longer being run, Or the terminal is powered off), the candidate application may be removed from the preset application whitelist.
应当理解的是,本实施例中的应用白名单中可以通过保存各种能唯一识别一个应用的应用识别信息,来体现该名单中包括哪些应用,以供后续比对筛选,例如可包括但不限于应用的包名、UID(惟一标识符,例如全球32位惟一性数字)等中的至少一种。It should be understood that, in the application whitelist in this embodiment, various application identification information that can uniquely identify an application can be stored in the application whitelist to reflect which applications are included in the list for subsequent comparison and screening, such as including but not including Limited to at least one of the application's package name, UID (unique identifier, such as a global 32-bit unique number), and so on.
特别需要说明的是,本实施例中对待管理应用进行节省能耗的控制,可以采用各种对应用进行节能控制的方式。例如包括但不限于将待管理应用冻结,或关闭目标应用功耗较大的进程等。In particular, it should be noted that, in this embodiment, the application to be managed is used for energy-saving control, and various methods for energy-saving control of the application may be adopted. For example, it includes but is not limited to freezing the application to be managed, or shutting down the process that consumes much power of the target application.
将待管理应用进行冻结处理时,以Android智能平台为例,冻结的方法可以是通过“pm disable”、“am force-stop”等系统接口函数来使得应用不可用,或强制关闭应用达到“冻结”的效果。当然,本实施例中并不限于这两种示例的冻结方法。且可选地,在本实施例的一些示例中,还可针对被冻结的应用设置相应的解冻条件,并在检测某一备冻结的应用的解冻条件满足时,将该应用进行解冻处理。When freezing the application to be managed, take the Android smart platform as an example. The method of freezing can be to make the application unavailable through system interface functions such as "pm disable" and "am force-stop", or to force the application to close to "freeze" "Effect. Of course, this embodiment is not limited to these two exemplary freezing methods. And optionally, in some examples of this embodiment, corresponding thawing conditions may also be set for the frozen application, and when it is detected that the thawing conditions of a frozen application are satisfied, the application is defrosted.
应当理解的是,在实际应用中,对应用进行了冻结之后,实际冻结的是该应用的功能,对于系统中与该应用相关的系统服务其实是并未被冻结的,例如应用的广播分发、应用的服务组件等。而这些服务在该应用被冻结的情况下,可能会引起ANR(Application Not Responding,应用程序无响应)。为了避免这种情况的出现,在本实施例的一种可行实施方式中,可以将与该被冻结的应用相关的系统服务冻结。例如,可以丢弃对该被冻结的应用的广播分发,和/或停止启动该被冻结的应用的服务组件。还应当理解的是,对于已经引起的ANR,终端会提出ANR框来通知用户,而ANR框的弹出无疑会降低用户体验,为了避免这种情况,在本实施例中,可以在对待管理应用进行冻结之后,若检测到了关于该待管理应用的ANR,则自动屏蔽该ANR框,使之不弹出,从而避免对用户造成影响。It should be understood that in an actual application, after the application is frozen, what is actually frozen is the function of the application, and system services related to the application in the system are not actually frozen, for example, broadcast distribution of the application, Application service components, etc. These services may cause ANR (Application Not Responding) when the application is frozen. To avoid this situation, in a feasible implementation manner of this embodiment, system services related to the frozen application may be frozen. For example, the broadcast distribution of the frozen application may be discarded, and / or the service component that starts the frozen application may be stopped. It should also be understood that for the ANR that has been caused, the terminal will propose an ANR box to notify the user, and the pop-up of the ANR box will undoubtedly reduce the user experience. In order to avoid this situation, in this embodiment, the management application After freezing, if an ANR about the application to be managed is detected, the ANR box is automatically blocked so that it does not pop up, thereby avoiding impact on the user.
还应当理解的是,在实际应用中,系统各进程间的调用可能会存在涉及到已被冻结的应用的调用,此时为保证系统的有效运行,不至于出现系统故障,一种可行的实施方式是:在检测到针对某一被冻结的应用的系统调用操作时,即将该被冻结的应用进行解冻,并执行所述系统调用操作,此后可以在该调用操作执行完毕之后,重新对该应用进行冻结。但是需要说明的是,在该实施方式中,对于所有的系统调用操作都会对被冻结的应用进行解冻,这就会导致系统开销变大,但是在实际应用过程中,并不是所有涉及到被冻结的应用的系统调用操作都会引发系统故障,因此在本实施例的另一种可行实施方式中,可以在检测到针对某一被冻结的应用的系统调用操作时,判断该系统调用操作是否满足预设的操作抛弃条件;若满足,则抛弃该系统调用操作;否则,对该被冻结的应用进行解冻处理,并执行系统调用操作。当然,此后可以在该调用操作执行完毕之后,重新对该应用进行冻结。 在本实施例中,预设的操作抛弃条件应当遵循以下原则设计:在尽可能让终端正常完成此次系统操作(如binder操作),以避免被冻结的应用在应用逻辑上造成终端操作的不连贯性。例如,可以将各应用的各种已知的不需要解冻、不执行也不会导致系统故障的系统调用操作归纳到一个表中,该表即为预设的操作抛弃条件,此时在检测到针对某一被冻结的应用的系统调用操作为该表中该应用对应记录的系统调用操作,则可以抛弃该系统调用操作。It should also be understood that in actual applications, calls between various processes of the system may involve calls involving applications that have been frozen. In this case, to ensure the effective operation of the system, system failures do not occur, and a feasible implementation The method is: when a system call operation for a frozen application is detected, the frozen application is unfrozen, and the system call operation is performed. Thereafter, after the execution of the call operation is completed, the application can be restarted. Freeze. However, it should be noted that in this embodiment, the frozen application will be unfrozen for all system call operations, which will result in increased system overhead, but in the actual application process, not all involve freezing. The system call operation of the application will cause a system failure. Therefore, in another feasible implementation manner of this embodiment, when a system call operation for a frozen application is detected, it can be determined whether the system call operation meets the pre- The set operation abandonment condition; if it is satisfied, the system call operation is abandoned; otherwise, the frozen application is defrosted and the system call operation is performed. Of course, after that, the application can be frozen again after the calling operation is completed. In this embodiment, the preset operation abandonment conditions should be designed in accordance with the following principles: try to allow the terminal to complete the system operation (such as the binder operation) as much as possible to avoid the application logic of the frozen application causing terminal operation. Coherence. For example, various known system call operations of each application that do not need to be thawed, not executed, or cause system failures can be summarized in a table. This table is the preset operation abandonment condition. If the system call operation for a frozen application is the system call operation corresponding to the application record in the table, the system call operation can be discarded.
可见,在本实施例中,可实时对终端上(前台和/或后台)当前运行的各应用中功耗较高的应用根据其所属的应用类型确定其当前是否属于正常使用的应用,以确定是否需要对其进行节能功耗控制;并不是简单的依靠预先设置的应用清单或终端工作模式,将当前运行的属于该应用清单或该工作模式之外的某一个应用直接确定为功耗异常的应用。因为应用在某些具体应用场景下可能确实是功耗异常的应用,但在某些应用场景下则是属于功耗正常的应用,也即属于正常运行的应用。相关技术中依据预先设置好的应用清单或工作模式直接将属于该清单中的应用确定为功耗异常应用的方式,存在较大的误差,容易将正常运行的应用误判为功耗异常的应用;且其判断结果在很大程度上也依赖于清单中应用的准确设置,而用户往往并不能精准或实时的调整该清单以使得该清单保持精确,这也导致依据该预先设置的应用清单所得到的判断结果存在较大误差,进而降低了用户体验的满意度。It can be seen that, in this embodiment, the application with higher power consumption among the applications currently running on the terminal (foreground and / or background) can be determined in real time according to the type of application to which it belongs to whether it is currently a normally used application to determine Whether it is necessary to control energy saving and power consumption; it is not simply relying on the preset application list or terminal working mode to directly determine an application that is currently running outside the application list or the working mode as abnormal power consumption application. Because the application may indeed be an application with abnormal power consumption in some specific application scenarios, but in some application scenarios it is an application with normal power consumption, that is, an application that runs normally. In the related art, the application that belongs to the list is directly determined as an application with abnormal power consumption according to a preset application list or working mode, which has a large error, and it is easy to mistake a normal running application as an application with abnormal power consumption ; And its judgment depends to a large extent on the accurate settings of the application in the list, and users often cannot adjust the list accurately or in real time to keep the list accurate, which also leads to the application list based on the preset The obtained judgment result has a large error, which further reduces the user experience satisfaction.
而本实施例提供的应用控制方法,根据终端上当前运行的应用的实际功耗情况结合应用对应的应用类型来实时动态的确定出存在异常需要进行节能控制的待管理应用,并不需要用户或相应的服务商设置或服务相应的应用清单,实用性和智能性更好,且准确性更高,且具有更好的通用性和智能性,能进一步提升用户体验满意度。The application control method provided in this embodiment dynamically determines real-time and dynamically determined applications to be managed that require energy-saving control according to the actual power consumption of the application currently running on the terminal and the application type corresponding to the application. The corresponding service provider settings or the corresponding application list of the service have better practicability and intelligence, higher accuracy, better versatility and intelligence, and can further improve user experience satisfaction.
实施例二:Example 2:
本实施例在实施例一的基础上,以进行节省能耗的控制为对应用进行冻结的方式为例,对本发明实施例作进一步释义说明。On the basis of the first embodiment, this embodiment takes the control of saving energy as the way to freeze the application as an example to further explain the embodiment of the present invention.
参见图2所示,本发明包括五个逻辑层,分别是检测层、决策层,冻结层、解冻层,异常处理层。其中异常处理层分为框架异常处理层和驱动异常处理层。As shown in FIG. 2, the present invention includes five logical layers, namely a detection layer, a decision layer, a freezing layer, a defrosting layer, and an exception handling layer. The exception handling layer is divided into framework exception handling layer and driving exception handling layer.
其中,检测层用于检测终端亮灭屏状态、系统后台异常耗电行为等。满足异常耗电行为的,上报应用信息给决策模块。同时也配合解冻模块检测适合解冻的应用。Among them, the detection layer is used to detect the state of the terminal turning on and off the screen, and the abnormal power consumption behavior of the system background. If the abnormal power consumption behavior is satisfied, the application information is reported to the decision module. At the same time, it also cooperates with the defrosting module to detect applications suitable for defrosting.
决策层用于根据当前应用的具体类型和状态来判断是否需要对其执行冻结操作,如果需要冻结则向冻结执行层发起冻结指令,如果不需要冻结,则可以调整检测层的异常监听策略,让检测层不再对该应用进行监听。The decision layer is used to determine whether it is necessary to perform a freeze operation according to the specific type and status of the current application. If freezing is required, a freeze instruction is issued to the freeze execution layer. If freezing is not required, the abnormal monitoring strategy of the detection layer can be adjusted to let The detection layer no longer monitors the application.
冻结层用于根据冻结决策层提供的待冻结应用信息对该待冻结应用进行冻结。The freezing layer is used to freeze the application to be frozen according to the application information to be frozen provided by the freezing decision layer.
解冻层用于解冻需要解冻的应用。The thawing layer is used for thawing applications that require thawing.
框架异常处理层用于负责对应用冻结后可能出现的异常进行处理,比如丢弃对冻结应用的广播分发以免引发ANR,停止启动冻结应用的服务组件以免引发ANR,同时,对冻结应用已发生的ANR做出规避处理,避免系统因ANR而终结冻结应用。同时配合解冻模块恢复取消一些异常处理策略,例如取消对冻结应用的广播丢弃,恢复给解冻应用的广播分发等。The framework exception handling layer is used to handle exceptions that may occur after the application is frozen, such as discarding the broadcast distribution of the frozen application to avoid ANR, stopping the service component that starts the frozen application to avoid ANR, and at the same time, ANR that has occurred for the frozen application Make circumvention to prevent the system from terminating frozen applications due to ANR. At the same time, it cooperates with the thaw module to restore and cancel some exception handling strategies, such as canceling the broadcast discarding of the frozen application, and restoring the broadcast distribution to the unfrozen application.
驱动异常处理层用于在有binder(一种进程间的通信手段)调用冻结应用时,采取放弃冻结或者抛弃操作等行为来保证系统正常,尽可能让其正常完成此次binder操作,以避免冻结应用在应用逻辑上可能的不连贯性,更重要的,避免binder阻塞引发系统故障。The driver exception handling layer is used when a binder (a means of communication between processes) calls a frozen application to take the action of giving up freezing or abandoning operations to ensure that the system is normal, and let it complete the binder operation normally as much as possible to avoid freezing Possible inconsistencies in the application logic of the application, more importantly, to avoid system failure caused by binder blocking.
参见图3所示,图3为本实施例提供的一种对应用分层执行冻结的流程示意图,包括:Referring to FIG. 3, FIG. 3 is a schematic diagram of a process for performing layered freezing of applications provided by this embodiment, including:
步骤S301:当应用切到后台时,检测层监控这些处于后台的应用的活动行为。Step S301: When the application switches to the background, the detection layer monitors the activities of these applications in the background.
步骤S302:在检测到某一应用有异常耗电行为时,将所述异常耗电行为和该应用的应用类型汇报给决策层;Step S302: When detecting that an application has abnormal power consumption behavior, report the abnormal power consumption behavior and the application type of the application to the decision layer;
检测层在后台持续监控应用是否有异常耗电行为。如果有异常耗电行为则汇报给决策层下一步综合判断应用所处条件,确定是否上报给冻结层。The detection layer continuously monitors the application for abnormal power consumption in the background. If there is abnormal power consumption behavior, it will be reported to the decision-making layer. The next step is to comprehensively judge the conditions of the application and determine whether to report to the frozen layer.
监控异常耗电行为的类别有几种方式:CPU持续高占、持锁时间长、内存占用高、异常持续定位、异常使用sensor等。任何一种成立,都认为是异常耗电行为。There are several ways to monitor the abnormal power consumption behaviors: continuous high CPU occupation, long lock holding time, high memory occupation, abnormal continuous positioning, abnormal use of sensors, etc. Any kind of establishment is considered to be abnormal power consumption behavior.
步骤S303:决策层根据上报的异常耗电行为和应用类型综合决定是否需要冻结应用。Step S303: The decision layer comprehensively decides whether to freeze the application according to the reported abnormal power consumption behavior and application type.
决策层可以调整检测层的异常监听策略,让检测层不再对该应用进行监听。The decision layer can adjust the abnormal monitoring strategy of the detection layer so that the detection layer no longer monitors the application.
步骤S304:在决策层认为需要冻结应用时,通知冻结层进行执行冻结操作。Step S304: When the decision layer thinks that the application needs to be frozen, the freezing layer is notified to perform the freezing operation.
步骤S305:冻结层在收到决策层的指令后,对该应用进行冻结。Step S305: After receiving the instruction from the decision layer, the freezing layer freezes the application.
在该应用冻结后,框架异常处理层丢弃对冻结应用的广播分发,停止启动冻结应用的服务组件,同时对冻结应用已发生的ANR做出规避处理。After the application is frozen, the framework exception handling layer discards the broadcast distribution to the frozen application, stops the service component that starts the frozen application, and at the same time makes circumvention on the ANR that has occurred in the frozen application.
框架异常处理层负责对应用冻结后可能出现的异常进行处理,比如丢弃对冻结应用的广播分发以免引发ANR,停止启动冻结应用的服务组件以免引发ANR,同时,对冻结应用已发生的ANR做出规避处理,避免系统因ANR而终结冻结应用。The framework exception handling layer is responsible for handling the exceptions that may occur after the application is frozen, such as discarding the broadcast distribution of the frozen application to avoid ANR, stopping the service components that start the frozen application to avoid ANR, and at the same time, making the ANR of the frozen application. Avoid processing and avoid the system from terminating frozen applications due to ANR.
此外,在应用冻结后,如果有binder调用冻结应用时,驱动异常处理层会采取放弃冻结或者抛弃操作等行为来保证系统正常。In addition, after the application is frozen, if there is a binder call to freeze the application, the driver exception handling layer will take actions such as giving up freezing or abandoning operations to ensure that the system is normal.
此外,在检测层检测到满足解冻条件时,会通知解冻层把应用进行解冻处理。In addition, when the detection layer detects that the thawing conditions are met, it will notify the thawing layer to defrost the application.
应用解冻后,框架异常处理层配合解冻层取消一些异常处理策略,例如取消对冻结应用的广播丢弃恢复给解冻应用的广播分发,恢复服务组件的正常启动等。After the application is unfrozen, the framework exception handling layer cooperates with the unfreeze layer to cancel some exception handling strategies, such as canceling the broadcast discarding of the frozen application and restoring the broadcast distribution to the unfrozen application, and restoring the normal startup of service components.
可见,通过本实施例提供的应用控制方法,可以灵活且准确的确定出终端上存在功耗异常的需要进行节能控制的应用,并通过冻结等节能处理方式对这些应用进行控制处理, 可以在不影响用户真正需求使用的情况下对应用进行冻结、解冻,节省了CPU、内存、电池等系统资源,提升了终端续航性能和资源利用率,提升了用户体验。It can be seen that the application control method provided in this embodiment can flexibly and accurately determine the applications that need to perform energy-saving control on the terminal with abnormal power consumption, and perform control processing on these applications through energy-saving processing methods such as freezing, etc. Freeze and unfreeze applications under conditions that affect users' real needs, saving system resources such as CPU, memory, and battery, improving terminal endurance performance and resource utilization, and improving user experience.
实施例三:Example three:
本实施例提供了一种应用控制装置,其可设置于各种终端中,参见图4所示,包括:监测模块41、确定模块42和处理模块43;其中:This embodiment provides an application control device, which can be installed in various terminals, as shown in FIG. 4, including: a monitoring module 41, a determination module 42, and a processing module 43; wherein:
监测模块41用于对终端上当前运行的各应用进行监测;The monitoring module 41 is used to monitor each application currently running on the terminal;
确定模块42用于在监测模块41监测到满足预设第一功耗条件的候选应用时,根据预设识别规则对该候选应用进行判定,以确定该候选应用是否为待管理应用;具体确定应用满足预设第一功耗条件的过程以及具体根据预设识别规则对该候选应用进行判定的过程,可参见上述各实施例中所描述的相关部分,在此不再赘述。The determining module 42 is configured to determine the candidate application according to the preset identification rule when the monitoring module 41 detects the candidate application that satisfies the preset first power consumption condition, to determine whether the candidate application is an application to be managed; specifically determine the application For the process of satisfying the preset first power consumption condition and the process of determining the candidate application according to the preset identification rule, reference may be made to the relevant parts described in the foregoing embodiments, and details are not described herein again.
需要说明的是,本实施例中预设第一功耗条件可以包括:应用当前处于后台运行状态,且具有预设高耗电行为。It should be noted that the preset first power consumption condition in this embodiment may include: the application is currently running in the background and has a preset high power consumption behavior.
处理模块43用于在确定模块42确定该候选应用为待管理应用时,对待管理应用进行节省能耗的控制。The processing module 43 is used to control energy saving of the application to be managed when the determination module 42 determines that the candidate application is an application to be managed.
本实施例中对待管理应用进行节省能耗的控制,可以采用各种对应用进行节能控制的方式。例如包括但不限于将待管理应用冻结。In this embodiment, to control the energy saving of the application to be managed, various methods of energy-saving control of the application may be adopted. Examples include, but are not limited to, freezing applications to be managed.
在进行节省能耗的控制包括将待管理应用冻结时,处理模块43还用于:在对待管理应用进行冻结之后,将与该被冻结的应用相关的系统服务冻结。例如,可以丢弃对该被冻结的应用的广播分发,和/或停止启动该被冻结的应用的服务组件。此外,对于已经引起的ANR,终端会提出ANR框来通知用户,而ANR框的弹出无疑会降低用户体验,为了避免这种情况,在本实施例中,处理模块43可以在对待管理应用进行冻结之后,若检测到了关于该待管理应用的ANR,则自动屏蔽该ANR框,使之不弹出,从而避免对用户造成影响。When the control for saving energy consumption includes freezing the application to be managed, the processing module 43 is further configured to: after freezing the application to be managed, freeze the system service related to the frozen application. For example, the broadcast distribution of the frozen application may be discarded, and / or the service component that starts the frozen application may be stopped. In addition, for the ANR that has been caused, the terminal will propose an ANR box to notify the user, and the pop-up of the ANR box will undoubtedly reduce the user experience. In order to avoid this situation, in this embodiment, the processing module 43 may freeze the application to be managed After that, if an ANR about the application to be managed is detected, the ANR box is automatically shielded so that it does not pop up, thereby avoiding impact on the user.
此外,在实际应用中,系统各进程间的调用可能会存在涉及到已被冻结的应用的调用,此时为保证系统的有效运行,不至于出现系统故障,一种可行的实施方式是:在检测到针对某一被冻结的应用的系统调用操作时,处理模块43即将该被冻结的应用进行解冻,并执行系统调用操作,此后处理模块43可以在该调用操作执行完毕之后,重新对该应用进行冻结。但是需要说明的是,在该实施方式中,对于所有的系统调用操作都会对被冻结的应用进行解冻,这就会导致系统开销变大,但是在实际应用过程中,并不是所有涉及到被冻结的应用的系统调用操作都会引发系统故障,因此在本实施例的另一种可行实施方式中,可以在检测到针对某一被冻结的应用的系统调用操作时,处理模块43判断该系统调用操作是否满足预设的操作抛弃条件;若满足,则抛弃该系统调用操作;否则,对该被冻结的应用进行解冻处理,并执行系统调用操作。当然,此后处理模块43可以在该调用操作执行完毕之后,重新对该应用进行冻结。在本实施例中,预设的操作抛弃条件应当遵循以下 原则设计:在尽可能让终端正常完成此次系统操作(如binder操作),以避免被冻结的应用在应用逻辑上造成终端操作的的不连贯性。例如,可以将各应用的各种已知的不需要解冻、不执行也不会导致系统故障的系统调用操作归纳到一个表中,该表即为预设的操作抛弃条件,此时在检测到针对某一被冻结的应用的系统调用操作为该表中该应用对应记录的系统调用操作,则可以抛弃该系统调用操作。In addition, in actual applications, there may be calls between processes in the system that involve frozen applications. At this time, to ensure the effective operation of the system and avoid system failures, a feasible implementation method is: When a system call operation for a frozen application is detected, the processing module 43 unfreezes the frozen application and executes the system call operation. After that, the processing module 43 can re-apply the application after the execution of the call operation is completed Freeze. However, it should be noted that in this embodiment, the frozen application will be unfrozen for all system call operations, which will result in increased system overhead, but in the actual application process, not all involve freezing. The system call operation of the application will cause a system failure. Therefore, in another feasible implementation manner of this embodiment, when a system call operation for a frozen application is detected, the processing module 43 determines the system call operation Whether the preset operation abandonment condition is satisfied; if it is satisfied, the system call operation is abandoned; otherwise, the frozen application is defrosted and the system call operation is performed. Of course, afterwards, the processing module 43 may freeze the application again after the calling operation is completed. In this embodiment, the preset operation abandon condition should be designed in accordance with the following principle: try to allow the terminal to complete the system operation (such as binder operation) as much as possible to avoid the application logic of the frozen application causing terminal operation. Incoherence. For example, various known system call operations of each application that do not need to be thawed, not executed, or cause system failures can be summarized in a table. This table is the preset operation abandonment condition. If the system call operation for a frozen application is the system call operation corresponding to the application record in the table, the system call operation can be discarded.
实施例四:Example 4:
本实施例还提供了一种终端,该终端包括但不限于智能电话、笔记本电脑、数字广播接收器、个人数字助理(PDA)、平板电脑(PAD),便携式多媒体播放器(PMP)、导航装置等等的移动终端以及诸如数字TV、台式计算机等等的固定终端。参见图5所示,其包括处理器501、存储器502以及通信总线503;This embodiment also provides a terminal, which includes but is not limited to a smart phone, a notebook computer, a digital broadcast receiver, a personal digital assistant (PDA), a tablet computer (PAD), a portable multimedia player (PMP), and a navigation device Mobile terminals, etc. and fixed terminals such as digital TVs, desktop computers, etc. As shown in FIG. 5, it includes a processor 501, a memory 502, and a communication bus 503;
通信总线503用于实现处理器501与存储器502之间的通信连接;The communication bus 503 is used to realize the communication connection between the processor 501 and the memory 502;
处理器501可用于执行存储器502中存储的一个或者多个计算机程序,以实现如上各实施例中的应用控制方法的步骤。The processor 501 may be used to execute one or more computer programs stored in the memory 502 to implement the steps of the application control method in the above embodiments.
本实施例还提供了一种计算机可读存储介质,该计算机可读存储介质包括在用于存储信息(诸如计算机可读指令、数据结构、计算机程序模块或其他数据)的任何方法或技术中实施的易失性或非易失性、可移除或不可移除的介质。计算机可读存储介质包括但不限于RAM(Random Access Memory,随机存取存储器),ROM(Read-Only Memory,只读存储器),EEPROM(Electrically Erasable Programmable read only memory,带电可擦可编程只读存储器)、闪存或其他存储器技术、CD-ROM(Compact Disc Read-Only Memory,光盘只读存储器),数字多功能盘(DVD)或其他光盘存储、磁盒、磁带、磁盘存储或其他磁存储装置、或者可以用于存储期望的信息并且可以被计算机访问的任何其他的介质。This embodiment also provides a computer-readable storage medium, which is implemented in any method or technology for storing information (such as computer-readable instructions, data structures, computer program modules, or other data) Volatile or non-volatile, removable or non-removable media. Computer-readable storage media include but are not limited to RAM (Random Access Memory, random access memory), ROM (Read-Only Memory, read-only memory), EEPROM (Electrically Erasable Programmable read only memory, live erasable programmable read-only memory ), Flash memory or other memory technology, CD-ROM (Compact Disc Read-Only Memory, CD-ROM), digital versatile disk (DVD) or other optical disk storage, magnetic box, magnetic tape, magnetic disk storage or other magnetic storage devices, Or any other medium that can be used to store desired information and can be accessed by a computer.
本实施例中,计算机可读存储介质可用于存储一个或者多个计算机程序,该一个或者多个计算机程序可被一个或者多个处理器执行,以实现如上各实施例中的应用控制方法的步骤。In this embodiment, the computer-readable storage medium may be used to store one or more computer programs, and the one or more computer programs may be executed by one or more processors to implement the steps of the application control method in the above embodiments .
本实施例还提供了一种计算机程序(或称计算机软件),该计算机程序可以分布在计算机可读介质上,由可计算装置来执行,以实现如上各实施例所示的应用控制方法的至少一个步骤;并且在某些情况下,可以采用不同于上述实施例所描述的顺序执行所示出或描述的至少一个步骤。This embodiment also provides a computer program (or computer software), which can be distributed on a computer-readable medium and executed by a computable device to implement at least the application control method shown in the above embodiments One step; and in some cases, at least one step shown or described may be performed in an order different from that described in the above embodiment.
本实施例还提供了一种计算机程序产品,包括计算机可读装置,该计算机可读装置上存储有如上所示的计算机程序。本实施例中该计算机可读装置可包括如上所示的计算机可读存储介质。This embodiment also provides a computer program product, which includes a computer-readable device, and the computer program as shown above is stored on the computer-readable device. In this embodiment, the computer-readable device may include the computer-readable storage medium shown above.
可见,本领域的技术人员应该明白,上文中所公开方法中的全部或某些步骤、系统、装置中的功能模块/单元可以被实施为软件(可以用计算装置可执行的计算机程序代码来 实现)、固件、硬件及其适当的组合。在硬件实施方式中,在以上描述中提及的功能模块/单元之间的划分不一定对应于物理组件的划分;例如,一个物理组件可以具有多个功能,或者一个功能或步骤可以由若干物理组件合作执行。某些物理组件或所有物理组件可以被实施为由处理器,如中央处理器、数字信号处理器或微处理器执行的软件,或者被实施为硬件,或者被实施为集成电路,如专用集成电路。It can be seen that those skilled in the art should understand that all or some of the steps, systems, and functional modules / units in the method disclosed above can be implemented as software (which can be implemented by computer program code executable by a computing device) ), Firmware, hardware and their appropriate combinations. In a hardware implementation, the division between the functional modules / units mentioned in the above description does not necessarily correspond to the division of physical components; for example, one physical component may have multiple functions, or one function or step may be composed of several physical The components are executed in cooperation. Some or all physical components may be implemented as software executed by a processor, such as a central processing unit, digital signal processor, or microprocessor, or as hardware, or as an integrated circuit, such as an application specific integrated circuit .
此外,本领域普通技术人员公知的是,通信介质通常包含计算机可读指令、数据结构、计算机程序模块或者诸如载波或其他传输机制之类的调制数据信号中的其他数据,并且可包括任何信息递送介质。所以,本发明不限制于任何特定的硬件和软件结合。In addition, it is well known to those of ordinary skill in the art that communication media generally contains computer readable instructions, data structures, computer program modules, or other data in a modulated data signal such as a carrier wave or other transmission mechanism, and may include any information delivery medium. Therefore, the present invention is not limited to any specific combination of hardware and software.
根据本发明实施例提供的应用控制方法、装置、终端及计算机可读存储介质,在终端使用过程中,可对终端上当前运行的各应用进行监测,并在监测到满足预设第一功耗条件的候选应用时,根据预设识别规则对该候选应用进行判定,以确定出该候选应用是否为待管理应用;若确定该候选应用为待管理应用,则可以对该待管理应用进行节省能耗的控制。这样,通过第一功耗条件和预设识别规则即实质实现了两次筛选,从而可提升存在功耗异常的应用的监测准确性。同时,由于对筛选出的待管理应用进行了节省能耗的处理,例如包括但不限于冻结处理,从而可以在不影响用户正常使用终端的同时,提升终端续航能力和资源利用率,进而提升用户体验的满意度。According to the application control method, device, terminal, and computer-readable storage medium provided by the embodiments of the present invention, during the use of the terminal, each application currently running on the terminal can be monitored, and when it is detected that the preset first power consumption is satisfied When a candidate application for a condition is selected, the candidate application is determined according to a preset recognition rule to determine whether the candidate application is an application to be managed; if the candidate application is determined to be an application to be managed, energy savings can be made for the application to be managed Consume control. In this way, through the first power consumption condition and the preset identification rule, two screenings are substantially realized, thereby improving the monitoring accuracy of applications with abnormal power consumption. At the same time, due to the energy-saving processing of the selected applications to be managed, including but not limited to freezing processing, it can improve the endurance and resource utilization of the terminal without affecting the user's normal use of the terminal, thereby improving the user Satisfaction of experience.
以上内容是结合具体的实施方式对本发明实施例所作的进一步详细说明,不能认定本发明的具体实施只局限于这些说明。对于本发明所属技术领域的普通技术人员来说,在不脱离本发明构思的前提下,还可以做出若干简单推演或替换,都应当视为属于本发明的保护范围。The above is a further detailed description of the embodiments of the present invention in conjunction with specific implementations, and it cannot be assumed that the specific implementation of the present invention is limited to these descriptions. For a person of ordinary skill in the technical field to which the present invention belongs, without deviating from the concept of the present invention, several simple deductions or replacements can be made, which should be regarded as falling within the protection scope of the present invention.

Claims (17)

  1. 一种应用控制方法,包括:An application control method, including:
    对终端上当前运行的各应用进行监测;Monitor each application currently running on the terminal;
    在监测到满足预设第一功耗条件的候选应用时,根据预设识别规则对所述候选应用进行判定,以确定所述候选应用是否为待管理应用;When a candidate application that satisfies the preset first power consumption condition is monitored, determine the candidate application according to a preset recognition rule to determine whether the candidate application is an application to be managed;
    在确定所述候选应用为待管理应用时,对所述待管理应用进行节省能耗的控制。When it is determined that the candidate application is an application to be managed, energy saving control is performed on the application to be managed.
  2. 如权利要求1所述的应用控制方法,在所述对终端上当前运行的各应用进行监测之前,还包括:The application control method according to claim 1, before the monitoring each application currently running on the terminal, further comprising:
    确定被监测的各应用不在预设的应用白名单中。It is determined that the monitored applications are not in the preset application whitelist.
  3. 如权利要求2所述的应用控制方法,还包括:在确定所述候选应用不为待管理应用时,将所述候选应用加入到预设的所述应用白名单中。The application control method according to claim 2, further comprising: when it is determined that the candidate application is not an application to be managed, adding the candidate application to the preset application whitelist.
  4. 如权利要求1所述的应用控制方法,其中,所述预设第一功耗条件包括:The application control method of claim 1, wherein the preset first power consumption condition comprises:
    应用当前处于后台运行状态,且具有预设高耗电行为。The application is currently running in the background and has a preset high power consumption behavior.
  5. 如权利要求4所述的应用控制方法,其中,所述预设高耗电行为包括以下中的至少一种:The application control method according to claim 4, wherein the preset high power consumption behavior includes at least one of the following:
    处理器占用状态符合预设第一状态;The processor occupancy state conforms to the preset first state;
    内存占用状态符合预设第二状态;The memory occupation state conforms to the preset second state;
    唤醒锁占用状态符合预设第三状态;The wake lock occupation state conforms to the preset third state;
    定位资源占用状态符合预设第四状态;The occupancy status of positioning resources conforms to the preset fourth status;
    传感器资源占用状态符合预设第五状态。The sensor resource occupation state conforms to the preset fifth state.
  6. 如权利要求4所述的应用控制方法,其中,所述根据预设识别规则对所述候选应用进行判定包括:The application control method according to claim 4, wherein the determining the candidate application according to a preset recognition rule includes:
    根据所述候选应用对应的应用类型确定所述应用类型对应的应用筛选条件;Determine the application screening conditions corresponding to the application type according to the application type corresponding to the candidate application;
    将所述候选应用的高耗电行为与所述应用筛选条件进行比对,根据比对结果来对所述候选应用进行判定。Comparing the high power consumption behavior of the candidate application with the application screening condition, and determining the candidate application according to the comparison result.
  7. 如权利要求1-6任一项所述的应用控制方法,其中,所述对所述待管理应用进行节省能耗的控制包括:The application control method according to any one of claims 1 to 6, wherein the control of saving energy consumption of the application to be managed includes:
    对所述待管理应用进行冻结。Freeze the application to be managed.
  8. 如权利要求7所述的应用控制方法,其中,在对所述待管理应用进行冻结之后,还包括:The application control method according to claim 7, wherein after freezing the application to be managed, further comprising:
    将与该被冻结的应用相关的系统服务冻结。Freeze system services related to the frozen application.
  9. 如权利要求8所述的应用控制方法,其中,所述将与该被冻结的应用相关的系统服务冻结包括:The application control method according to claim 8, wherein the freezing of system services related to the frozen application comprises:
    丢弃对该被冻结的应用的广播分发;和/或,Discard the broadcast distribution of the frozen application; and / or,
    停止启动该被冻结的应用的服务组件。Stop starting the service component of the frozen application.
  10. 如权利要求7所述的应用控制方法,其中,在对所述待管理应用进行冻结之后,还包括:The application control method according to claim 7, wherein after freezing the application to be managed, further comprising:
    在检测到针对某一被冻结的应用的系统调用操作时,判断所述系统调用操作是否满足预设的操作抛弃条件;若满足,则抛弃所述系统调用操作;否则,对所述被冻结的应用进行解冻处理,并执行所述系统调用操作。When a system call operation for a frozen application is detected, it is determined whether the system call operation satisfies the preset operation abandonment condition; if it is satisfied, the system call operation is abandoned; otherwise, the frozen The application performs thawing processing and executes the system call operation.
  11. 一种应用控制装置,包括:监测模块、确定模块和处理模块;其中An application control device, including: a monitoring module, a determination module and a processing module; wherein
    所述监测模块用于对终端上当前运行的各应用进行监测;The monitoring module is used to monitor each application currently running on the terminal;
    所述确定模块用于在所述监测模块监测到满足预设第一功耗条件的候选应用时,根据预设识别规则对所述候选应用进行判定,以确定所述候选应用是否为待管理应用;The determining module is configured to determine the candidate application according to a preset recognition rule when the monitoring module detects a candidate application that satisfies a preset first power consumption condition to determine whether the candidate application is an application to be managed ;
    所述处理模块用于在所述确定模块确定所述候选应用为待管理应用时,对所述待管理应用进行节省能耗的控制。The processing module is configured to control energy saving of the application to be managed when the determination module determines that the candidate application is an application to be managed.
  12. 如权利要求11所述的应用控制装置,其中,所述预设第一功耗条件包括:The application control device according to claim 11, wherein the preset first power consumption condition includes:
    应用当前处于后台运行状态,且具有预设高耗电行为。The application is currently running in the background and has a preset high power consumption behavior.
  13. 如权利要求11或12所述的应用控制装置,其中,所述处理模块对所述待管理应用进行节省能耗的控制具体包括:The application control device according to claim 11 or 12, wherein the processing module for controlling the energy saving of the application to be managed specifically includes:
    所述处理模块对所述待管理应用进行冻结。The processing module freezes the application to be managed.
  14. 如权利要求13所述的应用控制装置,其中,所述处理模块还用于:在对所述待管理应用进行冻结之后,将与该被冻结的应用相关的系统服务冻结。The application control device according to claim 13, wherein the processing module is further configured to: after freezing the application to be managed, freeze a system service related to the frozen application.
  15. 如权利要求13所述的应用控制装置,其中,所述处理模块还用于:在对所述待管理应用进行冻结之后,在检测到针对某一被冻结的应用的系统调用操作时,判断所述系统调用操作是否满足预设的操作抛弃条件;若满足,则抛弃所述系统调用操作;否则,对所述被冻结的应用进行解冻处理,并执行所述系统调用操作。The application control device of claim 13, wherein the processing module is further configured to: after freezing the application to be managed, when detecting a system call operation for a frozen application, determine Whether the system call operation satisfies the preset operation abandon condition; if it is met, the system call operation is abandoned; otherwise, the frozen application is defrosted and the system call operation is performed.
  16. 一种终端,包括处理器、存储器和通信总线;其中A terminal, including a processor, a memory, and a communication bus; where
    所述通信总线用于将所述处理器和存储器连接;The communication bus is used to connect the processor and the memory;
    所述处理器用于执行所述存储器中存储的计算机程序,以实现如权利要求1-10任一项所述的应用控制方法的步骤。The processor is used to execute a computer program stored in the memory to implement the steps of the application control method according to any one of claims 1-10.
  17. 一种计算机可读存储介质,所述计算机可读存储介质存储有一个或者多个计算机 程序,所述一个或者多个计算机程序可被一个或者多个处理器执行,以实现如权利要求1-10任一项所述的应用控制方法的步骤。A computer-readable storage medium storing one or more computer programs, the one or more computer programs may be executed by one or more processors to implement claims 1-10 Any one of the steps of the application control method.
PCT/CN2019/116611 2018-11-09 2019-11-08 Application control method, device, terminal, and computer-readable storage medium WO2020094125A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201811330814.6 2018-11-09
CN201811330814.6A CN111176416A (en) 2018-11-09 2018-11-09 Application control method, device, terminal and computer readable storage medium

Publications (1)

Publication Number Publication Date
WO2020094125A1 true WO2020094125A1 (en) 2020-05-14

Family

ID=70612251

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2019/116611 WO2020094125A1 (en) 2018-11-09 2019-11-08 Application control method, device, terminal, and computer-readable storage medium

Country Status (2)

Country Link
CN (1) CN111176416A (en)
WO (1) WO2020094125A1 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112256354B (en) * 2020-11-25 2023-05-16 Oppo(重庆)智能科技有限公司 Application starting method and device, storage medium and electronic equipment

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106793027A (en) * 2016-11-30 2017-05-31 努比亚技术有限公司 The processing method and terminal of abnormal power consumption
CN107622004A (en) * 2016-07-14 2018-01-23 中兴通讯股份有限公司 Power consumption based reminding method and device
CN108024239A (en) * 2017-11-29 2018-05-11 深圳创维数字技术有限公司 Remote terminal and its control method, computer-readable recording medium
CN108536547A (en) * 2018-03-30 2018-09-14 广东欧珀移动通信有限公司 Information processing method, device, computer equipment and computer readable storage medium
CN108616653A (en) * 2018-03-30 2018-10-02 广东欧珀移动通信有限公司 Information processing method, device, mobile terminal and computer readable storage medium

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103037108A (en) * 2012-12-10 2013-04-10 乐蛙科技(上海)有限公司 Power saving method for smart mobile terminal
CN108037818A (en) * 2017-10-31 2018-05-15 努比亚技术有限公司 A kind of background application management method, terminal and computer-readable recording medium

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107622004A (en) * 2016-07-14 2018-01-23 中兴通讯股份有限公司 Power consumption based reminding method and device
CN106793027A (en) * 2016-11-30 2017-05-31 努比亚技术有限公司 The processing method and terminal of abnormal power consumption
CN108024239A (en) * 2017-11-29 2018-05-11 深圳创维数字技术有限公司 Remote terminal and its control method, computer-readable recording medium
CN108536547A (en) * 2018-03-30 2018-09-14 广东欧珀移动通信有限公司 Information processing method, device, computer equipment and computer readable storage medium
CN108616653A (en) * 2018-03-30 2018-10-02 广东欧珀移动通信有限公司 Information processing method, device, mobile terminal and computer readable storage medium

Also Published As

Publication number Publication date
CN111176416A (en) 2020-05-19

Similar Documents

Publication Publication Date Title
WO2020052471A1 (en) Method and apparatus for detecting application to be managed, method and apparatus for controlling application, terminal, and storage medium
JP4060322B2 (en) Application management apparatus and storage medium storing software thereof
US20180150324A1 (en) Idle Time Service
US8752060B2 (en) Multi-CPU domain mobile electronic device and operation method thereof
US20180113764A1 (en) Hypervisor Based Watchdog Timer
WO2020220748A1 (en) Application control method and apparatus, terminal, and computer-readable storage medium
EP2979182B1 (en) On-demand scalable timer wheel
WO2020094125A1 (en) Application control method, device, terminal, and computer-readable storage medium
CN110727473B (en) Resource control method, device, system, storage medium and electronic equipment
CN109298772A (en) Electricity-saving control method, device and mobile terminal and computer readable storage medium
WO2020052472A1 (en) Method and device for detecting and controlling abnormal application, terminal, and storage medium
JP5801331B2 (en) Task controller
JP2009176139A (en) Apparatus and program for changing os priority
WO2020220868A1 (en) Broadcast control method, terminal and computer readable storage medium
WO2020224381A1 (en) Application state control method apparatus, and terminal and computer-readable storage medium
WO2020224417A1 (en) Method and apparatus for controlling power consumption of terminal, terminal, and computer-readable storage medium
US20220244985A1 (en) Application management method and device, terminal and readable storage medium
WO2018227355A1 (en) Application program management system and management method for smart terminal
US8832708B2 (en) Process pool of empty application hosts to improve user perceived launch time of applications
WO2020052493A1 (en) Application freezing method and apparatus, storage medium and electronic apparatus
CN112256118B (en) Application program freezing control method, device, terminal and readable storage medium
US10642981B2 (en) Checking method, checking device and checking system for processor
WO2020093888A1 (en) Power saving method and apparatus, and storage medium
WO2020206701A1 (en) Data processing method and apparatus, storage medium, and electronic device

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 19881343

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 19881343

Country of ref document: EP

Kind code of ref document: A1

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 17.09.2021)

122 Ep: pct application non-entry in european phase

Ref document number: 19881343

Country of ref document: EP

Kind code of ref document: A1