WO2017156676A1 - 一种针对应用的处理方法、装置及智能终端 - Google Patents

一种针对应用的处理方法、装置及智能终端 Download PDF

Info

Publication number
WO2017156676A1
WO2017156676A1 PCT/CN2016/076255 CN2016076255W WO2017156676A1 WO 2017156676 A1 WO2017156676 A1 WO 2017156676A1 CN 2016076255 W CN2016076255 W CN 2016076255W WO 2017156676 A1 WO2017156676 A1 WO 2017156676A1
Authority
WO
WIPO (PCT)
Prior art keywords
application
task
running
terminal
abnormal
Prior art date
Application number
PCT/CN2016/076255
Other languages
English (en)
French (fr)
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 华为技术有限公司
Priority to PCT/CN2016/076255 priority Critical patent/WO2017156676A1/zh
Priority to CN201680024971.7A priority patent/CN107615250B/zh
Publication of WO2017156676A1 publication Critical patent/WO2017156676A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W52/00Power management, e.g. TPC [Transmission Power Control], power saving or power classes
    • H04W52/02Power saving arrangements
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D30/00Reducing energy consumption in communication networks
    • Y02D30/70Reducing energy consumption in communication networks in wireless communication networks

Definitions

  • the present application relates to the field of computer application technologies, and in particular, to a processing method, an apparatus, and an intelligent terminal for an application.
  • the operating system (Operating System, OS for short) is used to manage and control the hardware and software resources.
  • OS Operating System
  • the popular intelligent terminal operating system includes a variety of features, and some systems allow the application process only in the foreground of the application. Running; while some processes running the application are running in the foreground, they can also run in the background. Even if the user does not currently use the application or even the user has locked the screen and no longer uses it, the corresponding process of the application is still executing download data, navigation, Processing such as pushing push messages, synchronizing network data, receiving broadcasts, and the like.
  • the automatic processing generated for the application causes the smart terminal to generate higher power consumption.
  • the present application provides a processing method, an apparatus, and an intelligent terminal for an application, which can limit automatic processing that satisfies the limited processing conditions.
  • the present application provides a processing method for an application, in which an application task currently being executed in an intelligent terminal may be separately processed for all or part of the application tasks.
  • the processing step includes: determining, according to the running feature of the application task of the application and the preset task abnormality determining condition, when the running time of the application in the background of the operating system reaches a preset duration, It is a running abnormal task; if it is the running abnormal task, the processing of the running abnormal task is restricted; the specific limiting processing manner may be stopping execution of the running abnormal task, or delaying processing the running abnormal task.
  • the operation abnormal task mainly refers to some application tasks that satisfy the conditions, for example, the operation of the terminal resources is more occupied during the executed process. Tasks, or tasks that are added to the blacklist by the user, etc., rather than running the wrong task.
  • restrictions such as delay or stop can be performed on the running abnormal tasks, which saves the processor and power resources of the terminal, and improves the performance of the terminal.
  • the application when the application continues to run in the background of the operating system for a preset duration, before determining whether the application task is an abnormal task, First determine which applications in the terminal are running abnormal applications.
  • the specific step may be: determining whether the application belongs to the running abnormal application according to the running feature of the application running on the terminal and the preset application abnormality determining condition; if the application belongs to the running abnormal application, the performing may be further performed. Whether the application task of the application is the judgment of the operation of the abnormal task.
  • the processing of data collection and processing of the application task can be effectively reduced, and the identification of the abnormal task of the above operation is improved.
  • the processing efficiency further saves the terminal's processor and power and other resources, and improves the terminal performance.
  • the limiting the processing of the running abnormal task may specifically limit the message in the Looper message queue of the running abnormal task.
  • the specific step may be: stopping processing the message of the running abnormal task in the looper Looper's message queue; or delaying sending the message of the running abnormal task in the looper Looper's message queue to the corresponding processor. Handler.
  • the embodiment of the present application further provides another processing method for an application, where the application runs on an operating system of the terminal.
  • the application task that may need to be restricted may be determined first, and then the application corresponding to the application task is determined to determine whether to limit the application task that may need to be restricted.
  • the specific step may be: determining, according to the running feature of the application task of the application, and the preset task abnormality determining condition, whether the application task belongs to the running abnormal task; if it is determined that the application task belongs to the running abnormal task, further Determining whether the application belongs to the running abnormal application according to the running feature of the application running on the terminal and the preset application abnormality determining condition; if it is determined that the application belongs to the running abnormal application, the running abnormal task is Perform limit processing.
  • the specific restriction processing manner may be to stop executing the running abnormal task, or delay processing the running abnormal task.
  • the processor that saves the terminal can be quickly and accurately determined to limit the running of the abnormal task and perform the delay or stop of the running abnormal task. And the purpose of resources such as electric energy to improve terminal performance.
  • the performing the limiting processing on the running abnormal task includes: stopping processing, in the message queue of the looper Looper, the message that runs the abnormal task; or The delay sends the message of the running exception task in the looper Looper's message queue to the corresponding handler Handler.
  • the embodiment of the present application further provides a computer readable storage medium, where the program code of the program is stored.
  • the program code includes instructions for performing the method in the first aspect.
  • the embodiment of the present application further provides another computer readable storage medium, where the program code of the program is stored.
  • the program code includes instructions for performing the method in the second aspect.
  • the present application also provides a processing device for an application, the module for the application includes a module that can perform the method described in the above first aspect.
  • the present application also provides a processing device for an application, the module for the application includes a module that can perform the method described in the second aspect above.
  • the present application further provides an intelligent terminal, comprising: a processor and a memory, wherein the memory is used to store an instruction, and the processor is configured to execute the instruction when the processor is executing
  • the method of the above first aspect may be performed in accordance with the instructions at the time of the instruction.
  • the present application further provides an intelligent terminal, comprising: a processor and a memory, wherein the memory is used to store an instruction, and the processor is configured to execute the instruction when the processor is executing
  • an intelligent terminal comprising: a processor and a memory, wherein the memory is used to store an instruction, and the processor is configured to execute the instruction when the processor is executing
  • the method of the second aspect described above may be performed in accordance with the instructions at the time of the instruction.
  • the running characteristics of the application running on the terminal include: an running characteristic of the application and/or an running characteristic of the terminal; and the running characteristics of the application include: foreground running, background running, important level, whether It is recorded in the restriction processing list, the resource occupation information of the application running time, and any one or more of the durations of the application non-operation; the running characteristics of the terminal include: the status feature of the terminal (such as whether it is a power saving state, etc.), The terminal has no one of operation duration, terminal remaining power, and terminal heating characteristics.
  • the running characteristics of the application task include: the application task is executed The speed or number of times it is executed, or the hardware resource consumption of the application task.
  • one or more running abnormal tasks capable of satisfying the limiting processing conditions can be comprehensively obtained, and then these running abnormal tasks are processed to better More comprehensively meet the needs of various users or meet the needs of improving terminal performance.
  • the message corresponding to the running abnormal task includes module indication information, where the module indication information is used to indicate a Handler that processes the message, and the limiting processing of the running abnormal task specifically refers to: stopping or Delaying sending a message corresponding to the running abnormal task to the Handler indicated by the module indication information in the message.
  • the message of the abnormal operation task that is restricted to be processed may cancel the restriction process when the recovery condition is satisfied, and the recovery condition includes: the abnormal operation task that is restricted to be processed is dependent on one or more tasks, the other Or multiple tasks are not running abnormal tasks.
  • the user is completely shut down, or the application runs crashing, or the application is temporarily occupied with excessive memory and is forced to exit.
  • the processing of the running abnormal task can be resumed, so that the corresponding process of the application is normally closed.
  • the embodiment of the present application can quickly and accurately limit the processing of the abnormal task and perform the delay or stop of the running abnormal task, thereby better saving the processor and power resources of the terminal, and improving the terminal performance.
  • FIG. 1 is a schematic structural diagram of a message processing mechanism according to an embodiment of the present disclosure
  • FIG. 2 is a schematic structural diagram of another message processing mechanism according to an embodiment of the present disclosure.
  • FIG. 3 is a schematic diagram of log log information provided by an embodiment of the present application.
  • FIG. 4 is a schematic flowchart of a processing method for an application provided by an implementation of the present application.
  • FIG. 5 is a schematic flowchart of another processing method for an application according to an embodiment of the present disclosure.
  • FIG. 6 is a schematic flowchart of still another processing method for an application according to an embodiment of the present application.
  • FIG. 7 is a schematic structural diagram of a processing device for an application according to an embodiment of the present disclosure.
  • FIG. 8 is a schematic structural diagram of another processing device for an application according to an embodiment of the present disclosure.
  • FIG. 9 is a schematic structural diagram of an intelligent terminal according to an embodiment of the present disclosure.
  • FIG. 10 is a schematic structural diagram of another smart terminal according to an embodiment of the present application.
  • the application configured on the smart terminal runs on the operating system platform of the smart terminal, and specifically, can run in the foreground or background of the operating system.
  • the smart terminal can process the application task corresponding to the application by using hardware resources such as a processor according to the indication of the application, such as downloading a data task, a navigation task, processing a push message task, synchronizing a network data task, receiving a broadcast task, updating an interface task, and drawing a task. and many more.
  • the operating system platform of the intelligent terminal includes but is not limited to Android Android, Symbian Symbian, iOS, Windows Phone, Blackberry OS.
  • Android is a software platform of a smart terminal, which includes a multi-layer structure: application layer applications, application framework layer application framework, runtime library Liberaries, and kernel Kernel. System applications and third-party developed applications are located at the application layer.
  • the application framework layer includes various processing mechanisms and system resources provided by the Android operating system. These processing mechanisms or system resources are encapsulated into an Application Programming Interface (API) to supply layer calls.
  • API Application Programming Interface
  • the application running on the Android operating system platform implements the corresponding application task by calling the API provided by the Android operating system application framework layer.
  • FIG. 1 is a schematic flowchart of a message processing mechanism provided by an application framework layer of an Android operating system.
  • the application task can be implemented by calling the message processing mechanism.
  • the message processing mechanism includes three core modules: a looper (hereinafter referred to as Looper), a handler (hereinafter referred to as a Handler), and a task or message (hereinafter referred to as Message).
  • the Message encapsulates the information of the application task initiated by the application layer and the indication information of the Handler that processes the Message.
  • the thread Thread includes Looper and Handler.
  • Looper is designed to make a normal thread a Looper thread.
  • the Looper thread refers to a thread that works in a loop.
  • the message queue Message Queue is encapsulated inside the Looper. Multiple Messages have been added to the Message Queue Message Queue. The multiple Messages are queued in chronological order in the message queue Message Queue for execution.
  • the role of the Handler includes: adding a message Message to the Message Queue in the Looper. Looper will take the Message according to the order of Message Queue and send it to the Message. The corresponding Handler. The Handler processes the Message after receiving the Message. The addition and processing of Messages can be synchronous or asynchronous. The Handler is associated with a Looper when it is created. The default constructor will be associated with the Looper of the current thread.
  • an application task is triggered to implement related functions.
  • the message corresponding to the application task is generated by the Handler corresponding to the application, and the message includes information of the application task and information of the Handler.
  • the Handler passes the Message to the Looper. Messages in Looper can be queued in order of execution time (Message Queue). When the looper checks that the message in the queue needs to be released, for example, the message arrives at the execution time, it is fetched and sent to the corresponding Hander to process the message to implement the application task.
  • the message queue of FIG. 1 includes four messages, namely Message1, Message2, Message3, and Message4.
  • the four messages may be messages generated for different tasks of an application, or may be messages generated for application tasks of different applications.
  • Looper can run in the main thread or in a separate thread. The four messages are queued in order of execution time. The Looper checks the execution time of each Message in the message queue so that they can be processed when the message reaches the execution time.
  • the application can still trigger the application task periodically, and invoke the API of the Android operating system application framework layer to implement the application task. For example, the application initiates a page refresh task every second, and the page refresh task can be implemented by calling an API.
  • the app has been switched to the background for a long time, the user may no longer use the app but forget to quit completely. At this time, if the application still performs some unnecessary application tasks periodically, the power consumption of the terminal is wasted.
  • FIG. 2 is a schematic structural diagram of a message processing mechanism according to an embodiment of the present disclosure.
  • the framework used by the message processing mechanism includes the Looper, Handler, and Message mentioned above, and also includes a scene recognition module and a decision module.
  • the scene recognition module can be used to collect the running characteristics of the application during the operation of the terminal.
  • the running characteristics of the application during the operation of the terminal specifically include the running characteristics of the application and/or the running characteristics of the intelligent terminal when the application is running.
  • the decision module determines whether to limit the application task of the application according to the collected features.
  • the scene recognition module and the decision module may be located at an application layer or an application framework layer of the Android operating system.
  • the running characteristics of the application include: foreground running, background running, important level, whether it is recorded in the limit Any one or more of the characteristics of the processing list, the resource occupation information of the application runtime, and the duration of the application no operation.
  • the operating characteristics of the smart terminal include any one or more of the characteristics of the state of the terminal (whether it is a power saving state, etc.), the duration of no operation of the terminal, the remaining power of the terminal, and the heating feature of the terminal.
  • the scene recognition module transmits the collected operational characteristics to the decision module.
  • the decision module determines the running abnormal application according to each running characteristic and the preset application abnormality determining condition.
  • the decision module notifies the scene recognition module to obtain an operation feature of the application task running the abnormal application, and determines whether the task belongs to the abnormal operation task according to the running characteristic of the application task.
  • the decision module may determine the running abnormal application according to the running characteristics of the application, the running characteristics of the smart terminal, or the combination of the running characteristics of the application and the running characteristics of the intelligent terminal. Specifically, the decision module may determine whether an application belongs to the running abnormal application according to the application abnormality determining condition, and the application abnormality determining condition specifically includes one or more of the following combinations: whether the application is running in the foreground or in the background, and the usage of the application task is performed.
  • the category of the application (belonging to games, instant messaging, news, etc.) or whether the application is a system application or a third-party application, the CPU share of the application runtime and / Or the consumption of power, whether the application is in the restricted processing list (recording a blacklist of applications that need to be restricted, recording a whitelist of applications that do not need to be restricted), whether the terminal is in a power saving mode, or the user has no activity (no touch The status of the screen, no button events, no input data, etc.
  • the method for acquiring the running feature of the application task running the abnormal application includes, but is not limited to, acquiring the speed at which the application task running the abnormal application is executed or the number of times executed, or acquiring hardware for executing the application task of the running abnormal application. Resource consumption, etc.
  • the specific acquisition manner of the speed or the number of times the application task is executed may be: obtaining the speed or the number of times the message corresponding to the application task is executed by the Handler within a certain period of time.
  • the consumption of hardware resources by the application task can be obtained by recording the power loss or CPU usage when the application task is executed separately, or by counting the power consumption or CPU when the message of the application task is separately executed by the Handler. Occupancy rate.
  • the method for determining whether the application task belongs to the running abnormal task includes, but is not limited to, a combination of one or more of the following: whether the application task is executed at a speed greater than a preset Whether the speed threshold, the number of times the application task is executed is greater than a preset number of times threshold, whether the hardware resource consumption of the application task is greater than a preset consumption threshold, for example, greater than a preset power consumption threshold and/or greater than a preset CPU Occupancy rate.
  • the abnormality determination condition may correspond to, but is not limited to, a combination of one or more of the following: the speed is greater than the speed threshold, the number of times is greater than the number of times threshold, and the hardware resource consumption is greater than the corresponding consumption threshold.
  • the method for obtaining the speed or the number of times the message generated by the application task is executed by the Handler in a certain period of time includes, but is not limited to, first determining the number of messages corresponding to the application task processed within a certain duration ( That is, the number of executions).
  • the speed at which the message generated for the application task is executed can be further calculated based on the number and duration.
  • the smart terminal adopts the Android operating system the number of messages generated by the application task and the processing time can be counted according to the type of the message and the target Handler directly through the log information of the Android system, and processed according to each message. The time is determined by the time.
  • the log information in the Android system includes a content part of the content of the message about the application task, and the part describes a user identifier UID, a process ID (PID), and a message msg of a message executed by the Handler.
  • the msg part includes: when to execute what, what to do, and the target that represents the target Handler.
  • the type of the message can be determined by the PID, when and what, and the Handler executing the message can be determined by the target.
  • the record in the log information is shown in Figure 3.
  • the processing time is determined to be 50 ms (from 230 ms to 280 ms).
  • it can be finally determined that the application task of the timing refresh interface is processed at a speed of 120 times/second.
  • the log information shown in FIG. 3 is only an example, and the specific manifestation of the log information may refer to the description of the log information in the existing Android system.
  • the determining module determines that the application task of the running abnormal application is a running abnormal task according to the running feature of the application task of the running abnormal application collected by the scenario identifying module, the determining module performs a limit processing on the running abnormal task.
  • the decision and inform Looper After receiving the notification, the looper may perform a restriction process on the message generated for the running abnormal task to achieve the purpose of limiting processing of the running abnormal task.
  • the method of limiting the operation of the abnormal task includes stopping execution of the task and/or delaying execution of the task. Specifically, but not limited to the following methods:
  • Looper when the message corresponding to the running abnormal task needs to be executed, Looper will stop processing the message. For example, after Looper takes out the message that runs the abnormal task, it directly discards the message and does not send it to the Handler corresponding to the message. Therefore, the running exception task that generated the message will not be executed. Further, since the Handler does not receive the message of the running abnormal task sent by the Looper, the Handler cannot generate a new message again and adds it to the Looper's message queue, so that the running abnormal task stops and is not executed.
  • the application 1 that has been switched to the background for ten minutes is found to have a CPU occupation ratio higher than the preset CPU occupation rate, it is determined that the application 1 is an abnormal running application, and the application task of the application 1 is further collected to determine whether the application is abnormally running. The task exists. After collecting, it is found that the application 1 performs a page refresh task every 100 ms. Since the application 1 has been continuously placed in the background for a preset time, for example, ten minutes, the page refresh task is considered to be running an abnormal task. It is determined that the page refresh task is stopped, thereby reducing the power consumption of the terminal.
  • the Looper thread is notified to discard the message corresponding to the page refresh task, so that the Handler that executes the page refresh task cannot receive the message, and therefore cannot regenerate the message of the new page refresh task and add the message to the Looper. In the queue.
  • the page refresh task of application 1 is terminated.
  • Delay execution of the abnormal task When the message generated for the running abnormal task needs to be executed as the target message, Looper delays sending the target message to the Handler corresponding to the target message.
  • the processing step of the delay includes: delaying the fetched target message to a corresponding Handler after a predetermined length of time, and of course, notifying the Handler of the target message to modify the processing duration of the target message configuration of the type, and configuring the processing duration Lengthen up.
  • the decision module determines that the application task of the running abnormal application is not the running abnormal task according to the running feature of the application task of the running abnormal application collected by the scenario identification module, the decision module does not send the limit processing notification for the application task.
  • the looper normally executes the target message of the application task.
  • the decision module decides not to perform the restriction processing on the application task, it may also notify the Looper, so that the Looper normally sends the target message of the application task to the corresponding Handler, and is executed by the corresponding Handler. The target message to perform the application task normally.
  • the news application After the user clicks and runs the news application, the news application generates an application task of periodically refreshing the message, and the Handler corresponding to the application generates the message of the application task of the type that is periodically refreshed to periodically complete the task, and the content of the message includes the above.
  • the application task type information, message execution time, and Handler information the Handler sends the message to the Looper, and the Looper follows the settings in the message.
  • the message execution time sorts it into the message queue.
  • the scene recognition module collects the running features of the news application, and the collected running features include: the remaining power of the terminal, the news application running in the background, and the CPU usage of the news application. rate.
  • the scene recognition module sends the collected operational characteristics to the decision module.
  • the decision module judges the news application based on these operational characteristics. At this time, if the decision module determines that the news application is running in the background, the remaining battery power of the terminal is lower than the power threshold, and the CPU usage of the news application is higher than the occupancy threshold, the decision module may determine that the news application is an abnormal application.
  • the decision module After determining that the news application is running an abnormal application, the decision module notifies the scene recognition module to collect the running characteristics of the application task of the news application. Of course, the decision module can also notify the scene recognition module to search for the running characteristics of certain specified application tasks of the news application. It is assumed that the application task collected by the scene recognition module is a task for periodically refreshing information, and the running characteristics of the task include: a speed at which the task for refreshing the information is executed, and a CPU usage of the task for refreshing the information.
  • the scene recognition module sends the collected operational characteristics to the decision module.
  • the decision module determines that the speed at which the task of periodically refreshing the information is executed is greater than the preset speed threshold, and the CPU usage rate is greater than the preset occupancy threshold. At this time, the decision module determines that the task of periodically refreshing the information is to run an abnormal task.
  • the decision module determines the restriction processing for stopping the task of periodically refreshing the information, and notifies the Looper.
  • the looper After receiving the notification of the decision processing of the task of the timing refresh information, the looper monitors the message generated by the task for periodically refreshing the information, and when the message reaches the processing time and needs to be processed, the message is sent from the message. The message is taken out and discarded in the queue to achieve the purpose of stopping the task of stopping the timing refresh message of the news application, so that the terminal does not periodically refresh the news information.
  • a method of limiting processing such as delay or stop may be performed on the running abnormal task, thereby saving the processor and power resources of the terminal, and improving the performance of the terminal.
  • the running abnormal task in the running abnormal application is determined, and then the limiting operation is performed for the running abnormal task.
  • the task may be directly determined to be a running abnormal task for the running feature of a certain task, and further according to the running abnormal task.
  • the application should determine whether the application is an application that can be restricted, and if so, the restriction processing for the running abnormal task can be performed.
  • the scene recognition module is configured to collect running characteristics of the application task.
  • the decision module determines whether to limit the application task according to the collected features.
  • the scene recognition module and the decision module may be located at an application layer or an application framework layer.
  • the scene recognition module collects the running characteristics of the application task, and the method for obtaining the application task running feature of the running abnormal application includes, but is not limited to, obtaining the speed at which the application task running the abnormal application is executed or executed.
  • the specific acquisition manner of the speed or the number of times the application task is executed may be: obtaining the speed or the number of times the message generated by the application task is executed by the Handler within a certain period of time.
  • the consumption of hardware resources by the application task can be obtained by recording the power loss or CPU usage when the application task is executed separately, or can also be lost during the process of executing the message of the application task by the Handler alone. Or CPU usage.
  • determining whether the application task belongs to the running abnormal task includes, but is not limited to, the application task being executed at a speed greater than a preset speed threshold, or the application task is The number of times of execution is greater than a preset number of times threshold, or the hardware resource consumption of the application task is greater than a preset consumption threshold, for example, greater than a preset power consumption threshold and/or greater than a preset CPU usage.
  • the notification scene identification module collects the running characteristics of the application corresponding to the running abnormal task during the running of the terminal.
  • the operational characteristics of the application during the operation of the terminal specifically include the operational characteristics of the application and/or the operational characteristics of the intelligent terminal.
  • the running characteristics of the application include: one of the front-end running, the background running, the important level, whether it is recorded in the restricted processing list, the resource occupation information of the application running time, and the duration of the application no operation.
  • the operating characteristics of the smart terminal include any one or more of the characteristics of the state of the terminal (whether it is a power saving state), the duration of no operation of the terminal, the remaining power of the terminal, and the heating characteristics of the terminal.
  • the decision module can determine whether the application is a running abnormal application according to the running characteristics of the application, the running characteristics of the smart terminal, or the combination of the running characteristics of the application and the running characteristics of the intelligent terminal, and according to the application abnormality determining condition. Specifically, the decision module may determine whether an application is a running abnormal application based on the application abnormality determining condition.
  • the application abnormality judgment condition specifically includes one or more of the following Combination: whether the application is running in the foreground or in the background, the usage of the application task (including the frequency and importance of statistical usage), the category of the application (belonging to games, instant messaging, news, etc.) or the application Whether it is a system application or a third-party application, the CPU usage and/or power consumption of the application runtime, whether the application is in the restricted processing list (recording a blacklist of applications that need to be restricted, and recording applications that do not require restriction processing) White list), whether the terminal is in the power saving mode or the user has no activity (no touch screen, no button event, no input data).
  • Combination specifically includes one or more of the following Combination: whether the application is running in the foreground or in the background, the usage of the application task (including the frequency and importance of statistical usage), the category of the application (belonging to games, instant messaging, news, etc.) or the application Whether it is a system application or a third-party application, the
  • the decision module determines that the application task is an abnormal task and the application corresponding to the application task is also a running abnormal application, the decision module performs an abnormality on the running task according to the running feature of the application task collected by the scenario identification module.
  • the task makes a decision to limit the processing and notifies Looper. After receiving the notification, the looper may limit the processing of the message generated by running the abnormal task to achieve the purpose of limiting the processing of the abnormal task.
  • the method for limiting the operation of the abnormal task includes stopping the execution of the running abnormal task and/or delaying the execution of the running abnormal task.
  • stopping processing or delay processing refer to the description of the previous embodiment.
  • the decision module identifies the running characteristics of the application task collected by the scenario identification module, it is determined that the application task is not an abnormal task. Then the decision module does not need to send a notification about the decision to limit the processing, and Looper normally executes the message generated by the task. Of course, the decision module can also notify the Looper to execute the message that the abnormal task is running normally.
  • the embodiment of the present application can quickly and accurately limit the processing of determining the running abnormal task and performing delay or stop on the running abnormal task, thereby saving the terminal processing. Resources such as power and power improve terminal performance.
  • FIG. 4 is a schematic flowchart of a processing method for an application according to an implementation of the present application.
  • the method in the embodiment of the present application may be implemented by a terminal processor, where the method includes the following steps.
  • S401 Determine whether the application is currently running in the background. After the application is opened, the Android system will call onResume and other methods to make the application's activity run. After the activity of the application is started, the activity includes: running the Resumed state, pausing the paused state, and stopping the Stopped state. If the activity of the application is in the Resumed state, the application may be considered to be in the foreground running state, and if the activity of the application is in the Paused state, the application is considered to be running in the background. If the application is switched to run in the background, then S402 described below is performed. If the result of the judgment is that the foreground is running, the process may be directly ended, or the related steps in the corresponding embodiment of FIG. 6 described below may be performed. Further, after the S401 is judged to be running in the background, the After determining that the application is switched to the background for a certain period of time, the S402 described below is executed.
  • whether the application is an application that is abnormal in operation may be determined according to an operation characteristic of the application, and if yes, the S401 is executed.
  • the running characteristics of the application during the running may be further collected, so as to be based on the collected operating characteristics.
  • the preset application abnormality determining condition determines whether the application is a running abnormal application, and if so, performs the following S402.
  • S402 Acquire a speed at which an application task of the application is processed.
  • the processing speed of the application task can be obtained by counting the number of messages and the processing duration corresponding to the application task in the log information.
  • S403 Determine whether the acquired speed is greater than a preset speed threshold. If the result of the determination is YES, the following S404 is executed. Otherwise, it ends, or the target message can be processed normally, and the target message is sent to the corresponding Handler.
  • S404 Obtain the resource occupation information of the application task to the terminal, where the resource occupation information includes the resource occupancy rate and the occupation time.
  • S405 Determine whether the resource occupancy rate is greater than a preset threshold, and whether the occupied duration is greater than a preset duration threshold. If the resource usage is greater than the preset threshold, and the occupation duration is greater than the preset duration threshold, the application task may be determined to be an abnormal task, and S406 described below is performed. Otherwise, it ends, or the target message can be processed normally, and the target message is sent to the corresponding Handler.
  • the important level of the application may be that after the user installs the application, the usage frequency of the application is counted, and according to the statistical result, it may be marked as an important application. It can also be that the user directly marks the application as an important level. Or critical applications for the system can be directly marked as important. Specifically, the important level of the application may be determined according to a preset policy.
  • S407 Determine whether the application is an important application. It is determined whether the application is an important application based on the importance level, and if not, the following S408 is performed. Otherwise, it ends, or the target message can be processed normally, and the target message is sent to the corresponding Handler.
  • the S407 and the S408 are optional steps. In a specific implementation, after the S406 determines that the resource occupancy rate is greater than a preset threshold, the application task is directly determined to be an abnormal operation task, and the following S409 is performed.
  • S408 Perform restriction processing on the application task.
  • Restricting the processing of an abnormal task includes stopping or delaying sending the message of the running abnormal task to the corresponding Handler.
  • the stop processing method of stopping or delay can be pre-configured according to user requirements and/or terminal requirements. This configuration can be either a default configuration or manually configured by the user.
  • the processing speed of the application task is higher than a threshold, the resource occupancy rate of the application task is high, and the application is a non-critical application
  • the configured policy can be restricted by the execution of the restriction.
  • the processing speed of the application task is higher than a threshold, the resource occupancy of the application task is high, and the application is a non-critical application,
  • the limited processing method of the delay processing may be adopted.
  • the method in this embodiment may further include the step of limiting the processing when the running abnormal task of the restricted processing can cancel the limiting processing when the recovery condition is satisfied.
  • the embodiment of the present application can perform processing such as delaying or stopping the application task according to the running characteristics of the application and the task, thereby better saving the processor and power resources of the terminal, and improving the performance of the terminal.
  • FIG. 5 is a schematic flowchart of another processing method for an application according to an embodiment of the present application.
  • the method in the embodiment of the present application may be implemented by a terminal processor, where the application runs in an operating system of a terminal, and the method is Including the following steps.
  • S501 Determine whether the application task of the application is an abnormal task. Specifically, whether the application task belongs to a running abnormal task is determined according to an running feature of the application task of the application and a preset task abnormality determining condition.
  • S502 Determine whether the application is currently running in the background. After the application is opened, the Android system will call onResume and other methods to make the application's activity run. After the activity of the application is started, the activity includes: running the Resumed state, pausing the paused state, and stopping the Stopped state. If the activity of the application is in the Resumed state, the application may be considered to be in the foreground running state, and if the activity of the application is in the Paused state, the application is considered to be running in the background. If yes, the following S503 is performed. Otherwise, it may end, or the S501 may be executed again.
  • S503 Determine whether the duration of running in the background reaches a preset duration. If so, S504 described below is executed, otherwise it may be received, or S502 described above may be executed again. Further optionally, After determining that the duration of the application running in the background reaches a preset duration, the running characteristics of the application during the running process may be further collected, so as to be judged according to the collected running features and the preset application abnormality. The condition is to more accurately determine whether the application is a running abnormal application, and if so, the following S504 is executed.
  • S504 Determine that the application belongs to the running abnormal application, and perform limiting processing on the running abnormal task; wherein, the limiting the processing the abnormal running task includes stopping execution of the running abnormal task, or delaying processing the running Abnormal task.
  • the method in this embodiment may further include the step of limiting the processing when the running abnormal task of the restricted processing can cancel the limiting processing when the recovery condition is satisfied.
  • the embodiments of the present application can perform processing such as delaying or stopping the application task according to the running characteristics of the application and the task, thereby better saving the processor and power resources of the terminal, and improving the performance of the terminal.
  • FIG. 6 is a schematic flowchart of a processing method for an application according to an embodiment of the present disclosure.
  • the method in the embodiment of the present application may be implemented by a terminal processor, where the method includes the following steps.
  • S601 Determine whether the application is currently running in the foreground. If it is running in the foreground, execute S602 described below. If the result of the determination is that the background is running, the related steps in the corresponding embodiment of FIG. 4 may be executed, or the step may be continued.
  • the Android system will call onResume and other methods to make the application's activity run. After the activity of the application is started, the activity includes: running the Resumed state, pausing the paused state, and stopping the Stopped state. If the activity of the application is in the Resumed state, the application may be considered to be in the foreground running state, and if the activity of the application is in the Paused state, the application is considered to be running in the background.
  • S602 Acquire a current running feature of the terminal.
  • the operating characteristics of the terminal obtained in this embodiment include: one or more of the characteristics of the state of the terminal (whether it is a power saving state), the duration of no operation of the terminal, the remaining power of the terminal, and the heating feature of the terminal. .
  • S603 Determine whether the terminal is in a power-saving state, and whether the duration of the operation of the terminal is greater than a preset duration threshold. If it is in the power saving state and exceeds the duration threshold, if it is determined that the application is a running abnormal application, then S604 described below is executed, otherwise, the target message is processed normally, and the target message is sent to the corresponding Handler.
  • the application may be determined to be an abnormal application.
  • S604 Acquire a speed at which an application task corresponding to the application is processed.
  • the processing speed of the application task can be obtained by counting the number of messages corresponding to the application task and the processing duration in the log information.
  • S605 Determine whether the acquired speed is greater than a preset speed threshold. If the result of the determination is YES, S606 described below is executed. Otherwise, it ends, or the message of the application task can be processed normally, and the message of the application task is sent to the corresponding Handler.
  • S606 Delay processing the application task. Specifically, the application task may be delayed by one or more times of processing time.
  • FIG. 4 and FIG. 6 described above describe two ways to determine the running abnormal application and the running abnormal task, but there may be other determining manners, such as the application occupying the resource and whether the application is specified by the user in the blacklist. In the middle of the way.
  • the embodiments of the present application can be applied, and the running characteristics of the task are limited to the execution of the application task, such as delay or stop, thereby better saving the processor and power resources of the terminal, and improving the performance of the terminal.
  • FIG. 7 is a schematic structural diagram of a processing device for an application according to an embodiment of the present application.
  • the device in the embodiment of the present application may be disposed in a smart terminal, for example, in a smart phone, a tablet computer, a smart wearable device, and the like.
  • the device includes the following structure.
  • the abnormal task determining module 701 is configured to determine, according to an running characteristic of the application task of the application and a preset task abnormality determining condition, when the running time of the application in the background of the operating system reaches a preset duration Whether the application task belongs to the running abnormal task; the processing module 702 is configured to, when the abnormal task determining module 701 determines that the application task belongs to the running abnormal task, perform limit processing on the running abnormal task; The processing module 702 is configured to perform a limiting process on the running abnormal task, including stopping execution of the running abnormal task, or delay processing the running abnormal task, when the limiting operation is performed on the running abnormal task.
  • the apparatus of the embodiment of the present application further includes: an abnormal application determining module 703, according to the application, when the running time of the application in the background of the operating system reaches a preset duration
  • the running feature and the preset application abnormality determining condition determine whether the application belongs to the running abnormal application
  • the notification module 704 is configured to notify the abnormality when the abnormal application determining module 703 determines that the application is a running abnormal application.
  • the task determining module 701 starts the abnormal task determining module 701 to start determining whether the application task belongs to the function of running an abnormal task according to the running feature of the application task of the application and the preset task abnormality determining condition.
  • the running features of the application running on the terminal include: an running feature of the application and/or an operating feature of the terminal; and the running features of the application include: foreground running, background running, important level, whether Recording in the restricted processing list, the resource occupation information of the application running time, and any one or more of the durations of the application non-operation; the running characteristics of the terminal include: the status feature of the terminal (whether it is a power saving state, etc.), and no Any one or more of the duration of the operation, the remaining power of the terminal, and the heating characteristics of the terminal.
  • processing module 702 is specifically configured to stop processing the message that runs the abnormal task in the message queue of the looper Looper; or delay the operation of the abnormal task in the message queue of the looper Looper The message is sent to the corresponding handler Handler.
  • the running characteristics of the application task include: a speed at which the application task is executed or a number of times executed, or a hardware resource consumption amount of the application task. Including power consumption, or CPU usage.
  • the abnormal task determining module 701, the processing module 702, the abnormal application determining module 703, and the notification module 704 may correspond to the decision module mentioned in the foregoing embodiment.
  • the abnormal task determining module 701 and the abnormality application determining module 703 can obtain related operating features by using the scenario recognition module.
  • Each module may include other functions performed by the scene recognition module and the decision module in addition to the functions mentioned in the embodiment.
  • the processing module 702 may perform an abnormal operation on the restricted processing as part of the decision module. Recovery processing of tasks and so on.
  • a method of limiting processing such as delay or stop may be performed on the running abnormal task, thereby saving the processor and power resources of the terminal, and improving the performance of the terminal.
  • FIG. 8 is a schematic structural diagram of a processing device for an application according to an embodiment of the present disclosure.
  • the device in the embodiment of the present application may be disposed in a smart terminal, for example, in a smart phone, a tablet computer, a smart wearable device, and the like.
  • the device includes the following structure.
  • the abnormal task determining module 801 is configured to determine, according to the running feature of the application task of the application, and the preset task abnormality determining condition, whether the application task belongs to a running abnormal task, and the abnormal application determining module 802 is configured to use the abnormality
  • the task determining module 801 determines that the application task belongs to the running abnormal task, further determines the condition according to the running feature of the application and the preset application abnormality. Determine if the application belongs to a running exception application.
  • the processing module 803 is configured to perform a limiting process on the running abnormal task when the abnormality application determining module 802 determines that the application is an abnormal running application; wherein the processing module 803 is configured to perform the operation When the abnormal task performs the limit processing, it is specifically used to stop executing the running abnormal task or delay processing the running abnormal task.
  • the running features of the application running on the terminal include: an running feature of the application and/or an operating feature of the terminal; and the running features of the application include: foreground running, background running, important level, whether Recording in the restricted processing list, the resource occupation information of the application running time, and any one or more of the durations of the application non-operation; the running characteristics of the terminal include: the status feature of the terminal (whether it is a power saving state, etc.), and no Any one or more of the duration of the operation, the remaining power of the terminal, and the heating characteristics of the terminal.
  • the processing module 803 is specifically configured to stop processing the message that runs the abnormal task in the message queue of the looper Looper; or delay the operation of the abnormal task in the message queue of the looper Looper.
  • the message is sent to the corresponding handler Handler.
  • the running feature of the application task includes: a speed at which the application task is executed or a number of times executed, or a hardware resource consumption of the application task.
  • the abnormal task determining module 801, the processing module 803, and the abnormal application determining module 803 may correspond to the decision module mentioned in the foregoing embodiment.
  • the relevant operating features can be obtained through the scene recognition module described above.
  • Each module may include other functions performed by the scene recognition module and the decision module described above, in addition to the functions mentioned in the embodiment.
  • the processing module 803 may perform an abnormal operation on the restricted processing as part of the decision module. Recovery processing of tasks, etc.
  • the limitation processing such as determining the running abnormal task and performing the delay or stopping of the running abnormal task can be quickly and accurately performed, thereby saving the terminal processor and the electric energy, etc. Resources improve terminal performance.
  • FIG. 9 is a schematic structural diagram of an intelligent terminal according to an embodiment of the present disclosure.
  • the smart terminal in the embodiment of the present application may be a terminal such as a smart phone, a tablet computer, or an intelligent wearable device, and may include: a user interface according to the terminal type thereof.
  • 906 display screen, key keyboard, etc.
  • power module processor 901, memory 902 and other structures such as network interface 905, camera, wearable mechanism (such as strap).
  • the various structures can be connected by a bus 903.
  • the processor 901 may be a central processing unit (CPU), a network processor (NP) or a combination of a CPU and an NP.
  • CPU central processing unit
  • NP network processor
  • the processor 901 may further include a hardware chip.
  • the hardware chip may be an application-specific integrated circuit (ASIC), a programmable logic device (PLD) or a combination thereof.
  • the PLD may be a complex programmable logic device (CPLD), a field-programmable gate array (FPGA), a general array logic (GAL) or any combination.
  • the memory 902 may include a volatile memory, such as a random-access memory (RAM); the memory 902 may also include a non-volatile memory, such as a flash.
  • RAM random-access memory
  • non-volatile memory such as a flash.
  • the bus 903 may be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus.
  • PCI peripheral component interconnect
  • EISA extended industry standard architecture
  • the bus 903 can be divided into an address bus, a data bus, a control bus, and the like. For ease of representation, only one thick line is shown in Figure 9, but it does not mean that there is only one bus or one type of bus.
  • the memory 902 of the smart terminal in the embodiment of the present application is configured to store related data of an application, an operating system, a user interface module, and a network interface module installed in the smart terminal, and store the application for the application.
  • Processing instructions ie, handlers for the application.
  • the application runs on an operating system of the terminal.
  • the processor 901 is connected to the memory 902 and invokes processing instructions for the application stored in the memory 902 for performing the following steps:
  • the limiting processing of the running abnormal task includes stopping execution of the running abnormality Task, or delay processing of the running exception task.
  • processor 901 is configured to invoke a processing instruction for the application stored in the memory 902, and is further configured to perform the following steps:
  • the application belongs to the running abnormal application, performing the running function of the application task and the preset task abnormality determining condition according to the application of the application in the running abnormal application, and determining whether the application task belongs to the running The steps of the abnormal task.
  • processor 901 is configured to invoke a processing instruction for the application stored in the memory 902, and is further configured to perform the following steps:
  • the running characteristics of the application running on the terminal include: an running characteristic of the application and/or an operating characteristic of the terminal;
  • the running characteristics of the application include: foreground running, background running, important level, whether it is recorded in the restricted processing list, resource occupation information of the application running time, and any one or more of the duration of the application no operation;
  • the operating characteristics of the terminal include: one or more of a status characteristic of the terminal (whether it is a power saving state, etc.), a duration of no operation of the terminal, a remaining power of the terminal, and a heating characteristic of the terminal.
  • the running characteristics of the application task include: a speed at which the application task is executed or the number of times executed, or a hardware resource consumption amount of the application task.
  • processor 901 for a specific implementation of the processor 901 in the embodiment of the present application, reference may be made to the specific description of the related functions and steps in the corresponding embodiments in FIG. 1 to FIG.
  • a method of limiting processing such as delay or stop may be performed on the running abnormal task, thereby saving the processor and power resources of the terminal, and improving the performance of the terminal.
  • FIG. 10 is a schematic structural diagram of an intelligent terminal according to an embodiment of the present application.
  • the smart terminal may be a terminal such as a smart phone, a tablet computer, or a smart wearable device, and may include: a user interface 1004 (display screen, a key keyboard, etc.), a power module, a processor 1001, a memory 1002, and the like according to the terminal type thereof.
  • a user interface 1004 display screen, a key keyboard, etc.
  • a power module a processor 1001, a memory 1002, and the like according to the terminal type thereof.
  • the various structures can be connected by a bus 1003.
  • the memory 1002 of the smart terminal in the embodiment of the present application is configured to store related data of an application, an operating system, a user interface module, and a network interface module installed in the smart terminal, and store the application for the application.
  • Processing instructions ie, handlers for the application.
  • the application runs on an operating system of the terminal.
  • the processor 1001 is connected to the memory 1002 and invokes processing instructions for the application stored in the memory 1002 for performing the following steps:
  • the limiting the processing of the running abnormal task includes stopping execution of the running abnormal task, or delaying processing the running abnormal task.
  • the processor 1001 invokes a processing instruction for the application stored in the memory 1002 to perform the following steps:
  • the running characteristics of the application running on the terminal include: an running characteristic of the application and/or an operating characteristic of the terminal;
  • the running characteristics of the application include: foreground running, background running, important level, whether it is recorded in the restricted processing list, resource occupation information of the application running time, and any one or more of the duration of the application no operation;
  • the operating characteristics of the terminal include: the state characteristics of the terminal (whether it is a power saving state, etc.), and no Any one or more of the duration of the operation, the remaining power of the terminal, and the heating characteristics of the terminal.
  • the running characteristics of the application task include: a speed at which the application task is executed or the number of times executed, or a hardware resource consumption amount of the application task.
  • the limitation processing such as determining the running abnormal task and performing the delay or stopping of the running abnormal task can be quickly and accurately performed, thereby saving the terminal processor and the electric energy, etc. Resources improve terminal performance.
  • the embodiment of the present application first acquires the associated message of the target message, and performs a delay or stop restriction process on the target message that meets the limit processing condition based on the associated message. It saves the terminal's processor and power and other resources, and improves the terminal performance.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Debugging And Monitoring (AREA)
  • Stored Programmes (AREA)
  • Telephone Function (AREA)

Abstract

本申请提供了一种针对应用的处理方法、装置及智能终端,其中的方法包括:当所述应用在所述操作系统的后台持续运行时间达到预设持续时间时,根据所述应用的应用任务的运行特征和预设的任务异常判断条件,确定所述应用任务是否属于运行异常任务;如果确定所述应用任务属于所述运行异常任务,则对所述运行异常任务进行限制处理;其中,所述对所述运行异常任务进行限制处理包括停止执行所述运行异常任务、或延迟处理所述运行异常任务。本申请可较好地节省终端的处理器以及电能等资源,提升终端性能。

Description

一种针对应用的处理方法、装置及智能终端 技术领域
本申请涉及计算机应用技术领域,尤其涉及一种针对应用的处理方法、装置及智能终端。
背景技术
随着电子技术以及计算机技术的不断发展,各种智能终端,诸如智能手机、平板电脑、智能可穿戴设备等终端,已得到普及。通过开发的各种适于在智能终端中安装并允许的各种应用可以帮助用户实现各种各样的功能。
智能终端上通过安装操作系统(Operating System,简称OS)来管理和控制硬件与软件资源,目前流行的智能终端操作系统包括多种,各具特色,有的系统允许应用的进程仅在该应用前台运行;而有的运行应用的进程在前台运行外,还可以在后台运行,即使用户当前并未使用该应用甚至用户已经锁屏不再使用,该应用对应的进程仍然在执行下载数据、导航、处理推送push消息、同步网络数据、接收广播等处理。
在某些情况下,例如应用已被切换到后台运行一段时间的情况下,针对该应用所产生的自动处理会使智能终端产生较高的功耗。
发明内容
本申请提供了一种针对应用的处理方法、装置及智能终端,可对满足限制处理条件的自动处理进行限制。
第一方面,本申请提供了一种针对应用的处理方法,该方法中,针对智能终端中当前正在执行的应用任务,可以针对其中的所有或部分应用任务分别进行处理。处理步骤包括:当所述应用在所述操作系统的后台持续运行时间达到预设持续时间时,根据所述应用的应用任务的运行特征和预设的任务异常判断条件,确定所述应用任务是否属于运行异常任务;如果是所述运行异常任务,则对所述运行异常任务进行限制处理;具体的限制处理方式可以为停止执行所述运行异常任务、或延迟处理所述运行异常任务。所述运行异常任务主要是指一些满足所述条件的应用任务,例如被执行的过程中对终端资源占用较多的任 务,或被用户添加到黑名单中的任务等等,而并非运行出错的任务。
针对终端当前执行的应用任务,可以对其中的运行异常任务执行延迟或停止等限制处理,较好地节省终端的处理器以及电能等资源,提升了终端性能。
结合第一方面,在第一种可能的实现方式中,当所述应用在所述操作系统的后台持续运行时间达到预设持续时间时,在确定所述应用任务是否为运行异常任务之前,可以先确定终端中有哪些应用为运行异常应用。具体步骤可以为:根据应用在终端上运行过程中的运行特征和预设的应用异常判断条件,确定所述应用是否属于运行异常应用;若所述应用属于运行异常应用,则可以进一步执行所述应用的应用任务是否为运行异常任务的判断等步骤。
通过先确定出运行异常的应用,以便于后续对这些运行异常的应用所对应的任务进行处理,能够有效减少对应用任务的数据收集以及处理的处理量,提高了对上述运行异常任务的识别以及处理效率,进一步地节省终端的处理器以及电能等资源,提升了终端性能。
结合第一种可能的实现方式,在第二种可能的实现方式中,所述对所述运行异常任务进行限制处理具体可以针对该运行异常任务的在Looper的消息队列中的消息进行限制处理来实现,具体步骤可以为:停止对循环者Looper的消息队列中所述运行异常任务的消息进行处理;或者,延迟将循环者Looper的消息队列中所述运行异常任务的消息发送给对应的处理者Handler。
通过对运行异常任务的消息进行暂停或延迟处理可以简单、快速地完成对运行异常任务的限制处理。
第二方面,本申请实施例还提供了另一种针对应用的处理方法,所述应用运行于终端的操作系统上。在所述方法中,可以先确定出可能需要限制处理的应用任务,然后再根据对该应用任务对应的应用进行判断来确定是否对该可能需要限制处理的应用任务进行限制处理。具体步骤可以为:根据所述应用的应用任务的运行特征和预设的任务异常判断条件,确定所述应用任务是否属于运行异常任务;如果确定所述应用任务属于所述运行异常任务,则进一步根据所述应用在终端上运行过程中的运行特征和预设的应用异常判断条件,确定所述应用是否属于运行异常应用;如果确定出所述应用属于运行异常应用,则对所述运行异常任务进行限制处理。具体的限制处理方式可以为停止执行所述运行异常任务、或延迟处理所述运行异常任务。
根据应用任务的运行特征和对应应用在终端上运行过程中的运行特征,可以快速、准确地针对确定出运行异常任务并执行对运行异常任务的延迟或停止等限制处理,达到节省终端的处理器以及电能等资源的目的,提升终端性能。
结合第二方面,在第一种可能的实现方式中,所述对所述运行异常任务进行限制处理,包括:停止对循环者Looper的消息队列中所述运行异常任务的消息进行处理;或者,延迟将循环者Looper的消息队列中所述运行异常任务的消息发送给对应的处理者Handler。
相应地,本申请实施例还提供了一种计算机可读存储介质,所述计算机可读存储介质存储了程序的程序代码。所述程序代码包括用于执行在第一方面中的方法的指令。
相应地,本申请实施例还提供了另一种计算机可读存储介质,所述计算机可读存储介质存储了程序的程序代码。所述程序代码包括用于执行在第二方面中的方法的指令。
相应地,本申请还提供了一种针对应用的处理装置,该针对应用的处理装置包括的模块可以执行上述第一方面所述的方法。
相应地,本申请还提供了一种针对应用的处理装置,该针对应用的处理装置包括的模块可以执行上述第二方面所述的方法。
相应地,本申请还提供了一种智能终端,其特征在于,包括:处理器和存储器,所述存储器用于存储指令,所述处理器用于执行所述指令,当所述处理器在执行所述指令时可根据所述指令执行上述第一方面的方法。
相应地,本申请还提供了一种智能终端,其特征在于,包括:处理器和存储器,所述存储器用于存储指令,所述处理器用于执行所述指令,当所述处理器在执行所述指令时可根据所述指令执行上述第二方面的方法。
在一些实施方式中,所述应用在终端上运行过程中的运行特征包括:应用的运行特征和/或终端的运行特征;所述应用的运行特征包括:前台运行、后台运行、重要等级、是否被记录于限制处理名单、应用运行时的资源占用信息、应用无操作的持续时长中的任意一个或多个;终端的运行特征包括:终端的状态特征(如是否为省电状态等)、对终端无操作的持续时长、终端剩余电量、终端发热特征中的任意一种或多种。
在一些实施方式中,所述应用任务的运行特征包括:所述应用任务被执行 的速度或者被执行的次数,或执行所述应用任务的硬件资源消耗。
通过上述的应用的运行特征、终端的运行特征以及任务的运行特征,可以较为全面地得出能够满足限制处理条件的一个或者多个运行异常任务,进而对这些运行异常任务进行处理,以便更好更为全面地满足各种用户需求或者满足提高终端性能的需求。
在一些实施方式中,所述运行异常任务对应的消息中包括模块指示信息,所述模块指示信息用于指示处理所述消息的Handler,对所述运行异常任务进行限制处理具体是指:停止或延迟将所述运行异常任务对应的消息发送给该消息中所述模块指示信息所指示的Handler。
在一些实施方式中,被限制处理的运行异常任务的消息在满足恢复条件时可以取消限制处理,满足恢复条件包括:被限制处理的运行异常任务被另一个或多个任务所依赖,该另一个或多个任务不是运行异常任务。
在一些实施方式中,如果被执行限制处理的运行异常任务所对应的应用完全退出,具体的在用户完全关闭该应用、或该应用运行崩溃、或该应用长期占有内存过高被强制退出等情况下会被完全退出时,可以恢复对该运行异常任务的处理,以便于该应用对应的进程被正常关闭。
本申请实施例可以快速、准确地针对确定出运行异常任务并执行对运行异常任务的延迟或停止等限制处理,从而较好地节省终端的处理器以及电能等资源,提升了终端性能。
附图说明
图1为本申请实施例提供的其中一种消息处理机制的结构示意图;
图2为本申请实施例提供的其中另一种消息处理机制的结构示意图
图3为本申请实施例提供的一种日志log信息的示意图;
图4为本申请实施提供的一种针对应用的处理方法流程示意图;
图5为本申请实施例提供的另一种针对应用的处理方法流程示意图;
图6为本申请实施例提供的再一种针对应用的处理方法流程示意图;
图7为本申请实施例提供的一种针对应用的处理装置的结构示意图;
图8为本申请实施例提供的另一种针对应用的处理装置的结构示意图;
图9为本申请实施例提供的一种智能终端的结构示意图;
图10为本申请实施例提供的另一种智能终端的结构示意图。
具体实施方式
配置在智能终端上的应用运行于智能终端的操作系统平台上,具体地,可以运行于操作系统的前台或后台中。智能终端可以根据应用的指示通过处理器等硬件资源对应用对应的应用任务进行处理,例如下载数据任务、导航任务、处理push消息任务、同步网络数据任务、接收广播任务、更新界面任务、绘图任务等等。
智能终端的操作系统平台包括但不限于安卓Android、塞班Symbian、iOS、Windows Phone、Blackberry OS。以安卓Android操作系统为例,Android是智能终端的软件平台,其包括多层结构:应用层applications、应用框架层application framework、运行库Liberaries、以及内核Kernel。系统应用和第三方开发的应用位于应用层。而应用框架层则包括安卓操作系统提供的各类处理机制和系统资源,这些处理机制或系统资源被封装为应用程序编程接口(Application Programming Interface,以下简称API),以供应用层调用。运行于安卓操作系统平台上的应用,通过调用安卓操作系统应用框架层提供的API实现相应的应用任务。
图1为安卓操作系统的应用框架层提供的一种消息处理机制的流程示意图,当应用层的应用发起一个应用任务时,可通过调用该消息处理机制实现该应用任务。如图1所示,该消息处理机制包括三个核心模块:循环者(以下称之为Looper)、处理者(以下称之为Handler),以及任务或者消息(以下称之为Message)。
Message中封装了应用层发起的应用任务的信息和处理该Message的Handler的指示信息。
线程Thread中包括Looper和Handler。Looper被设计用来使一个普通线程变成Looper线程。所述Looper线程是指循环工作的线程。消息队列Message Queue封装在Looper里面。消息队列Message Queue中被添加了多个Message。该多个Message按时间顺序在消息队列Message Queue中排队等待执行。
Handler的作用包括:往Looper中的Message Queue上添加消息Message。Looper会根据Message Queue的顺序将Message取出,并发送给与该Message 对应的Handler。Handler收到该Message后对该Message进行处理。Message的添加和处理过程可以是同步或异步的。Handler创建时会关联一个Looper,默认的构造方法将关联当前线程的Looper。
安装在智能终端中的应用程序运行后,为了实现某些应用功能,会触发执行应用任务以实现相关功能。具体地,由该应用对应的Handler生成针对应用任务的消息Message,该Message中包括该应用任务的信息和该Handler的信息。Handler将Message传递给Looper。Looper中的Message可以按照执行时间顺序排队(消息队列Message Queue)。Looper检查队列中的消息需要释放时,例如消息到达执行时间,则取出来发给对应的Hander处理该消息,实现该应用任务。
在图1的消息队列中包括4个消息,即Message1、Message2、Message3以及Message4。4个消息可以是为某一个应用的不同任务生成的消息,也可以是为不同应用的应用任务生成的消息。Looper可以运行在主线程或者单独的一个线程中。4个消息会按照执行时间顺序排队。Looper会检查消息队列中的各Message的执行时间,以便于在消息到达执行时间时对这些Message进行处理。
当应用运行于后台时,该应用仍可以定期触发应用任务,调用安卓操作系统应用框架层的API实现该应用任务。例如应用每隔一秒钟发起一次页面刷新任务,该页面刷新任务可通过调用API来实现。但如果应用已被用户长时间切换至后台,则可能用户已不再使用该应用但忘记完全退出。此时如果应用仍定期执行某些不必要的应用任务,则会造成终端的功耗浪费。
图2为本申请实施例提供的一种消息处理机制的结构示意图。如图2所示,该消息处理机制所采用的框架包括上述提到的Looper、Handler以及Message,还包括场景识别模块和决策模块。场景识别模块可以用于收集应用在终端运行过程中的运行特征。应用在终端运行过程中的运行特征具体包括应用的运行特征和/或应用运行时智能终端的运行特征。决策模块根据收集到的以上特征确定是否对该应用的应用任务进行限制处理。其中,当智能终端采用Android操作系统时,场景识别模块和决策模块可以位于安卓操作系统的应用层或应用框架层。
应用的运行特征包括:前台运行、后台运行、重要等级、是否被记录于限 制处理名单、应用运行时的资源占用信息、应用无操作的持续时长等特征中的任意一个或多个。智能终端的运行特征包括:终端的状态特征(是否为省电状态等)、对终端无操作的持续时长、终端剩余电量、终端发热特征等特征中的任意一种或多种。
场景识别模块将收集到的运行特征传输给决策模块。决策模块根据各运行特征和预设的应用异常判断条件,确定出运行异常应用。决策模块通知场景识别模块获取运行异常应用的应用任务的运行特征,并根据该应用任务的运行特征确定该任务是否属于运行异常任务。
其中,决策模块可以单独根据应用的运行特征、智能终端的运行特征,或者应用的运行特征和智能终端的运行特征的组合来确定出运行异常应用。具体地,决策模块可以基于应用异常判断条件,确定某应用是否属于运行异常应用,应用异常判断条件具体包括以下一个或多个的组合:该应用是处于前台还是后台运行、该应用任务的使用情况(包括统计使用的频繁程度、重要性),该应用的类别(属于游戏类、即时通讯类、新闻类等)或者该应用是系统应用还是第三方应用,该应用运行时CPU的占有率和/或电量的消耗,该应用是否处于限制处理名单(记录有需要限制处理的应用的黑名单,记录有不需要限制处理的应用的白名单),终端是否处于省电模式或者用户无活动(无触屏、没有按键事件,无输入数据)的状态等。
具体地,获取运行异常应用的应用任务的运行特征的方法包括但不限于:获取运行异常应用的应用任务被执行的速度或者被执行的次数,或者,获取执行该运行异常应用的应用任务的硬件资源消耗等。其中,应用任务被执行的速度或者次数的具体获取方式可以为:获取一定时间内应用任务对应的消息被Handler执行的速度或者次数。而应用任务对硬件资源的消耗可以通过记录该应用任务被单独执行时的电量损耗或CPU占用率的方式来获取,或者也可以通过统计该应用任务的消息单独被Handler执行时的电量损耗或CPU占用率。
根据该应用任务运行特征和预设的任务异常判断条件,确定该应用任务是否属于运行异常任务的方法包括但不限于以下一个或多个的组合:该应用任务被执行的速度是否大于预设的速度阈值、该应用任务被执行的次数是否大于预设的次数阈值、执行该应用任务的硬件资源消耗是否大于预设的消耗阈值,例如大于预设的电量消耗阈值和/或大于预设的CPU占用率。而满足预设的任务 异常判断条件则可以对应包括但不限于以下一个或多个的组合:速度大于速度阈值、次数大于次数阈值、硬件资源消耗量大于对应的消耗阈值。
进一步具体的,上述获取一定时间内该应用任务生成的消息被Handler执行的速度或者次数的方法包括但不限于:首先确定出一定时长范围内所处理的所述应用任务对应的消息的个数(即执行的次数)。根据个数和时长可以进一步计算得到为该应用任务生成的消息被执行的速度。其中,当智能终端采用Android操作系统时,可以根据消息的类型和目标Handler直接通过Android系统的日志log信息来统计出为该应用任务生成的消息的个数及处理时间,并根据各个消息被处理的时间确定出时长。
具体的,在Android系统的log信息,包括了关于应用任务的消息的内容Text部分,该部分描述了某个被Handler执行的消息的用户标识UID、进程ID(PID)和消息msg。msg部分包括:何时执行when、执行什么what、表示目标Handler的target。通过其中的PID、when和what可以确定该消息的类型,通过target可以确定执行该消息的Handler。例如,对于某个应用Application的定时刷新界面的应用任务,该应用任务的消息中记录的类型为:pid:6442,msg中的when=0、what=1。目标Handler为:target=com.b.a.as。log信息中的记录具体如图3所示。统计其中的pid:6442,msg中的when=0、what=1、target=com.b.a.as的消息的个数为6。再根据每条记录中的执行时间Time确定出处理时长为50ms(从230ms到280ms)。那么可以最终确定出该定时刷新界面的应用任务被处理的速度为120次/秒。需要说明的是,图3示出的log信息仅为举例,log信息的具体表现形式可参考现有的Android系统中关于log信息的描述。
如果决策模块根据场景识别模块收集到的运行异常应用的应用任务的运行特征,确定所述运行异常应用的应用任务为运行异常任务,则所述决策模块会做出对该运行异常任务进行限制处理的决定,并通知Looper。Looper在接收到该通知后,可以对为该运行异常任务生成的消息进行限制处理,以达到对所述运行异常任务的限制处理的目的。
具体地,对运行异常任务进行限制处理的方法包括停止执行该任务和/或延迟执行该任务。具体包括但不限于以下方法:
1、停止执行运行异常任务:当运行异常任务对应的消息需要被执行时, Looper会停止处理该消息。例如Looper取出运行异常任务的消息后,直接丢弃该消息,不再向该消息对应的Handler发送。因此,生成该消息的所述运行异常任务不会被执行。且进一步,由于Handler没有收到Looper发送的所述运行异常任务的消息,因此Handler也无法再次生成新的消息并添加至Looper的消息队列中,从而使得运行异常任务停止,不再执行。例如已被用户切换至后台十分钟的应用1被发现其CPU占有率高于预设CPU占有率,则确定应用1为异常运行应用,进一步收集应用1的应用任务,以确定是否有异常运行应用任务存在。经收集发现应用1在每100ms执行一次页面刷新任务。由于应用1已被持续置于后台达预设时间,例如十分钟,因此认为该页面刷新任务为运行异常任务。确定停止执行该页面刷新任务,从而降低终端的功耗。具体地,可以是通知Looper线程丢弃页面刷新任务所对应的消息,使得执行该页面刷新任务的Handler无法接收到该消息,因此也无法再重新生成新的页面刷新任务的消息并添加至Looper的消息队列中。应用1的页面刷新任务被终止。
2、延迟执行运行异常任务:在为该运行异常任务生成的消息作为目标消息需要被执行时,Looper延迟向该目标消息对应的Handler发送所述目标消息。延迟的处理步骤包括:将取出的目标消息延迟预定的时长后发送给对应的Handler,当然也可以通知该目标消息的Handler后续对该类型的目标消息配置的处理时长进行修改,将配置的处理时长加长。
如果决策模块根据场景识别模块收集到的运行异常应用的应用任务的运行特征,确定所述运行异常应用的应用任务不是运行异常任务,则决策模块并不会发送针对该应用任务的限制处理通知。Looper正常执行该应用任务的目标消息。当然,在其他实施例中,如果决策模块决定不对所述应用任务进行限制处理,也可以通知给Looper,使Looper正常地将该应用任务的目标消息发给对应的Handler,由对应的Handler来执行该目标消息,以正常执行所述应用任务。
下面以智能终端中安装的新闻应用为例来对本申请的方案进行说明。用户在点击运行新闻应用后,新闻应用会产生定时刷新消息的应用任务,该应用对应的Handler通过产生一个类型为定时进行消息刷新的应用任务的消息以便定时完成该任务,该消息的内容包括上述应用任务的类型信息、消息执行时间和Handler信息,Handler将该消息发送给Looper,Looper按照该消息中设置的 消息执行时间将其排列到消息队列中。
在用户将新闻应用切换至后台的持续时间达到预设时间之后,场景识别模块收集该新闻应用的运行特征,所收集的运行特征包括:终端剩余电量、新闻应用为后台运行、新闻应用的CPU占用率。场景识别模块将收集到的运行特征发送给决策模块。决策模块再根据这些运行特征对新闻应用进行判断。此时,如果决策模块根据运行特征确定出新闻应用处于后台运行、终端剩余电量低于电量阈值、新闻应用的CPU占用率高于占用阈值,则决策模块可以确定该新闻应用为运行异常应用。
在确定该新闻应用为运行异常应用后,决策模块通知场景识别模块收集该新闻应用的应用任务的运行特征。当然决策模块还可以通知场景识别模块搜索新闻应用的某些指定应用任务的运行特征。假设场景识别模块收集到新闻应用的应用任务为定时刷新信息的任务,该任务的运行特征包括:该定时刷新信息的任务被执行的速度,该定时刷新信息的任务的CPU占用率。场景识别模块将收集到的这些运行特征发送给决策模块。决策模块判断出其中定时刷新信息的任务被执行的速度V次/秒大于预设的速度阈值,且CPU占用率为N%大于预设的占用率阈值。此时,决策模块确定该定时刷新信息的任务为运行异常任务。决策模块决定对该定时刷新信息的任务进行停止的限制处理,并通知给Looper。
Looper在接收到决策模块的关于对定时刷新信息的任务进行限制处理的通知后,对为定时刷新信息的任务生成的消息进行监控,当该消息达到处理时间需要进行处理时,将该消息从消息队列中取出并丢弃该消息,以实现停止对所述新闻应用的定时刷新消息的任务进行处理的目的,使得终端不会再定时刷新的新闻信息。
针对终端当前执行的应用任务,可以对其中的运行异常任务执行延迟或停止等限制处理的方式,从而较好地节省终端的处理器以及电能等资源,提升了终端性能。
上述实施例中描述了先根据应用和/或智能终端的运行特征确定出应用为运行异常应用后,再确定出该运行异常应用中的运行异常任务,进而针对运行异常任务进行限制处理。在本申请的另一实施例中,还可以先针对某个任务的运行特征直接确定该任务为运行异常任务,再进一步根据该运行异常任务所对 应的应用来判断该应用是否为可以被限制处理的应用,如果是则可以执行针对该运行异常任务的限制处理。
具体的,场景识别模块用于收集应用任务的运行特征。决策模块根据收集到的以上特征确定是否对该应用任务进行限制处理。其中,场景识别模块和决策模块可以位于应用层或应用框架层。
针对智能终端当前运行的应用任务,场景识别模块收集应用任务的运行特征,获取运行异常应用的应用任务运行特征的方法包括但不限于:获取运行异常应用的应用任务被执行的速度或者被执行的次数,或者,获取执行该运行异常应用的应用任务的硬件资源消耗等。其中,应用任务被执行的速度或者次数的具体获取方式可以为:获取一定时间内该应用任务生成的消息被Handler执行的速度或者次数。而该应用任务对硬件资源的消耗可以通过记录该应用任务被单独执行时的电量损耗或CPU占用率的方式来获取,或者也可以通过统计该应用任务的消息单独被Handler执行的过程中电量损耗或CPU占用率。根据该应用任务运行特征和预设的任务异常判断条件,确定该应用任务是否属于运行异常任务的方法包括但不限于:该应用任务被执行的速度大于预设的速度阈值、或该应用任务被执行的次数大于预设的次数阈值、或执行该应用任务的硬件资源消耗大于预设的消耗阈值,例如大于预设的电量消耗阈值和/或大于预设的CPU占用率。
在决策模块确定了该应用任务为运行异常任务后,通知场景识别模块收集该运行异常任务所对应的应用在终端运行过程中的运行特征。应用在终端运行过程中的运行特征具体包括应用的运行特征和/或智能终端的运行特征。其中,应用的运行特征包括:前台运行、后台运行、重要等级、是否被记录于限制处理名单、应用运行时的资源占用信息、应用无操作的持续时长等特征中的任意一个或多个。智能终端的运行特征包括:终端的状态特征(是否为省电状态)、对终端无操作的持续时长、终端剩余电量、终端发热特征等特征中的任意一种或多种。
决策模块可以单独根据应用的运行特征、智能终端的运行特征,或者应用的运行特征和智能终端的运行特征的组合,并根据应用异常判断条件,来确定该应用是否为运行异常应用。具体地,决策模块可以基于应用异常判断条件,确定某应用是否为运行异常应用。应用异常判断条件具体包括以下一个或多个 的组合:该应用是处于前台还是后台运行、该应用任务的使用情况(包括统计使用的频繁程度、重要性),该应用的类别(属于游戏类、即时通讯类、新闻类等)或者该应用是系统应用还是第三方应用,该应用运行时CPU的占有率和/或电量的消耗,该应用是否处于限制处理名单(记录有需要限制处理的应用的黑名单,记录有不需要限制处理的应用的白名单),终端是否处于省电模式或者用户无活动(无触屏、没有按键事件,无输入数据)的状态等。
如果决策模块根据场景识别模块收集到的应用任务的运行特征,确定该应用任务为运行异常任务,且该应用任务对应的应用也为运行异常应用,则所述决策模块会做出对该运行异常任务进行限制处理的决定,并通知Looper。Looper在接收到该通知后,可以通过对该运行异常任务生成的消息进行限制处理,以达到对所述运行异常任务的限制处理的目的。
具体地,对运行异常任务进行限制处理的方法包括停止执行该运行异常任务和/或延迟执行该运行异常任务,具体的停止处理或延迟处理的方式可参考上一实施例的描述。如果决策模块根据场景识别模块收集到的应用任务的运行特征,确定该应用任务不是运行异常任务。则决策模块无需发送关于限制处理的决定的通知,Looper正常执行该任务生成的消息。当然决策模块也可以通知Looper正常执行该运行异常任务的消息。
本申请实施例根据应用任务的运行特征和对应应用的运行特征,可以快速、准确地针对确定出运行异常任务并执行对运行异常任务的延迟或停止等限制处理,从而较好地节省终端的处理器以及电能等资源,提升了终端性能。
图4为本申请实施提供的一种针对应用的处理方法流程示意图,本申请实施例的所述方法可以由终端处理器来实现,所述方法包括如下步骤。
S401:判断应用当前是否为后台运行。所述应用被打开后,Android系统会调用onResume等方法来使该应用的activity处于运行状态。在该应用的activity启动后,activity包括:运行Resumed状态、暂停Paused状态以及停止Stopped状态。如果所述应用的activity处于Resumed状态,则可以认为所述应用处于前台运行状态,而如果所述应用的activity处于Paused状态,则认为所述应用处于后台运行。如果应用被切换到后台运行,则执行下述的S402。而如果判断结果为前台运行时,则可以直接结束,或可以执行下述图6对应实施例中的相关步骤。进一步地,对于所述S401判断在后台运行后,还可以进 一步地在确定该应用被切换到后台运行一定时长后,再执行下述的S402。
另外,在所述S401之前,还可以根据所述应用的运行特征,判断所述应用是否为运行异常的应用,若是则执行所述S401。
更进一步可选地,在确定所述应用为后台运行且持续运行时间达到预设的持续时间后,可以再进一步地收集该应用在运行过程中的运行特征,以便于在根据收集到的运行特征和预设的应用异常判断条件,确定该应用是否为运行异常应用,如果是,才执行下述的S402。
S402:获取该应用的应用任务被处理的速度。在Android系统中,通过统计log信息中该应用任务对应的消息的个数和处理时长,可以得到所述应用任务的处理速度。
S403:判断获取到的速度是否大于预设的速度阈值。若判断结果为是,则执行下述的S404。否则,结束,或者可以正常处理所述目标消息,将该目标消息发送给对应的Handler。
S404:获取所述应用任务对终端的资源占用信息,资源占用信息中包括了资源占用率和占用时长。具体获取该应用任务被执行过程中对CPU的占用信息,包括对CPU的占用率、占用时长等。
S405:判断资源占用率是否大于预设阈值,且占用时长是否大于预设时长阈值。若资源占用率大于预设阈值,且占用时长大于预设时长阈值,可以确定出所述应用任务为运行异常任务,执行下述的S406。否则,结束,或者可以正常处理所述目标消息,将该目标消息发送给对应的Handler。
S406:获取所述应用的重要等级。该应用的重要等级可以是在用户安装了该应用后,针对该应用的使用频繁程度进行统计,根据统计结果可以将其标记为重要应用。也可以是用户直接标记应用为重要等级。或对系统关键应用也可以直接标记为重要等级。具体可以根据预置的策略为确定应用的重要等级。
S407:判断该应用是否为重要应用。基于重要等级来确定该应用是否为重要应用,若不是,则执行下述S408。否则,结束,或者可以正常处理所述目标消息,将该目标消息发送给对应的Handler。本申请实施例中,所述S407和S408为可选步骤。在具体实施时,还可以在所述S406判断得出所述资源占用率大于预设阈值后,直接将所述应用任务确定为运行异常任务,执行下述的S409。
S408:对所述应用任务进行限制处理。通过上述一系列的判断,可以确定所述应用为运行异常应用,所述应用任务为运行异常任务。对运行异常任务的限制处理包括停止或延迟将所述运行异常任务的消息发送给对应的Handler。具体是采用停止还是延迟的限制处理方式,可以根据用户需求、和/或终端需求进行预先配置。该配置可以为默认配置也可以由用户手动配置。
例如,在本实施例中,由于所述应用被切换到后台运行、所述应用任务的处理速度高于阈值、该应用任务的资源占用率高、且所述应用为非重要应用,那么根据预先配置的策略可以采用停止执行的限制处理方式。而基于在其他实施例中配置的策略,如果所述应用被切换到后台运行、所述应用任务的处理速度高于阈值、该应用任务的资源占用率高、且所述应用为非重要应用,但智能终端当前的电量充足,则可以采用延迟处理的限制处理方式。
同样该实施例中的所述方法还可以包括被限制处理的运行异常任务在满足恢复条件时可以取消限制处理的步骤。
本申请实施例可以根据应用、任务的运行特征对应用任务执行延迟或停止等限制处理,较好地节省了终端的处理器以及电能等资源,提升了终端性能。
图5是本申请实施例提供的另一种针对应用的处理方法流程示意图,本申请实施例的所述方法可以由终端处理器来实现,所述应用运行于终端的操作系统中,所述方法包括如下步骤。
S501:判断所述应用的应用任务是否为运行异常任务。具体可以根据所述应用的应用任务的运行特征和预设的任务异常判断条件,确定所述应用任务是否属于运行异常任务。
S502:判断应用当前是否为后台运行。所述应用被打开后,Android系统会调用onResume等方法来使该应用的activity处于运行状态。在该应用的activity启动后,activity包括:运行Resumed状态、暂停Paused状态以及停止Stopped状态。如果所述应用的activity处于Resumed状态,则可以认为所述应用处于前台运行状态,而如果所述应用的activity处于Paused状态,则认为所述应用处于后台运行。如果是,则执行下述的S503。否则,可以结束,或再次执行所述S501。
S503:判断在后台运行的持续时间是否达到预设的持续时间。如果是则执行下述的S504,否则可以接收,或者再次执行上述的S502。进一步可选地, 在确定出应用在后台运行的持续时间达到预设的持续时间后,还可以再进一步地收集该应用在运行过程中的运行特征,以便于再根据收集到的运行特征和预设的应用异常判断条件,更为准确地确定该应用是否为运行异常应用,如果是,才执行下述的S504。
S504:确定出所述应用属于运行异常应用,对所述运行异常任务进行限制处理;其中,所述对所述运行异常任务进行限制处理包括停止执行所述运行异常任务、或延迟处理所述运行异常任务。
同样该实施例中的所述方法还可以包括被限制处理的运行异常任务在满足恢复条件时可以取消限制处理的步骤。
本申请实施例可以根据应用、任务的运行特征,对应用任务执行延迟或停止等限制处理,较好地节省了终端的处理器以及电能等资源,提升了终端性能。
图6为本申请实施例提供的再一种针对应用的处理方法流程示意图,本申请实施例的所述方法可以由终端处理器来实现,所述方法包括如下步骤。
S601:判断应用当前是否为前台运行。若为前台运行,执行下述的S602。而如果判断结果为后台运行时,则可以执行上述图4对应实施例中的相关步骤,或者继续执行本步骤。所述应用被打开后,Android系统会调用onResume等方法来使该应用的activity处于运行状态。在该应用的activity启动后,activity包括:运行Resumed状态、暂停Paused状态以及停止Stopped状态。如果所述应用的activity处于Resumed状态,则可以认为所述应用处于前台运行状态,而如果所述应用的activity处于Paused状态,则认为所述应用处于后台运行。
S602:获取终端当前的运行特征。本实施例中所获取的终端的运行特征包括:终端的状态特征(是否为省电状态)、对终端无操作的持续时长、终端剩余电量、终端发热特征等特征中的任意一种或多种。
S603:判断终端是否处于省电状态、且对终端无操作的持续时长是否大于预设的时长阈值。若处于省电状态且超过时长阈值,则确定该应用为运行异常应用,则执行下述的S604,否则,结束,或者可以正常处理所述目标消息,将该目标消息发送给对应的Handler。在终端处于省电状态,且应用为前台运行时,如果检测到终端长时间没有接收到用户的操作,也可以将该应用确定为运行异常应用。
S604:获取该应用所对应的应用任务被处理的速度。在Android系统中, 通过统计log信息中该应用任务对应的消息的个数和处理时长,可以得到所述应用任务的处理速度。
S605:判断获取到的速度是否大于预设的速度阈值。若判断结果为是,则执行下述的S606。否则,结束,或者可以正常处理所述应用任务的消息,将该应用任务的消息发送给对应的Handler
S606:延迟处理所述应用任务。具体可以针对所述应用任务延迟一倍或多倍处理时长。
上述图4和图6对应的实施例描述了两种确定运行异常应用和运行异常任务的方式,但还可以有其他的确定方式,比如应用对资源的占用情况、应用是否被用户指定在黑名单中等等方式。
本申请实施例可以应用、任务的运行特征对应用任务执行延迟或停止等限制处理,较好地节省了终端的处理器以及电能等资源,提升了终端性能。
下面再对本申请实施例的针对应用的处理装置及智能终端进行详细描述。
图7为本申请实施例提供的一种针对应用的处理装置的结构示意图,本申请实施例的所述装置可设置在智能终端中,例如设置在智能手机、平板电脑、智能可穿戴设备等终端中,具体的,所述装置包括以下结构。
异常任务确定模块701,用于当所述应用在所述操作系统的后台持续运行时间达到预设持续时间时,根据所述应用的应用任务的运行特征和预设的任务异常判断条件,确定所述应用任务是否属于运行异常任务;处理模块702,用于在所述异常任务确定模块701确定出所述应用任务属于所述运行异常任务,则对所述运行异常任务进行限制处理;其中,所述处理模块702,在用于对所述运行异常任务进行限制处理时,具体用于对所述运行异常任务进行限制处理包括停止执行所述运行异常任务、或延迟处理所述运行异常任务。
进一步可选地,当所述应用在所述操作系统的后台持续运行时间达到预设持续时间时,本申请实施例的所述装置还包括:异常应用确定模块703,用于根据所述应用的运行特征和预设的应用异常判断条件,确定所述应用是否属于运行异常应用;通知模块704,用于在所述异常应用确定模块703确定出该应用为运行异常应用时,通知给所述异常任务确定模块701,使所述异常任务确定模块701开始根据所述应用的应用任务的运行特征和预设的任务异常判断条件,确定所述应用任务是否属于运行异常任务的功能。
其中可选地,所述应用在终端上运行过程中的运行特征包括:应用的运行特征和/或终端的运行特征;所述应用的运行特征包括:前台运行、后台运行、重要等级、是否被记录于限制处理名单、应用运行时的资源占用信息、应用无操作的持续时长中的任意一个或多个;终端的运行特征包括:终端的状态特征(是否为省电状态等)、对终端无操作的持续时长、终端剩余电量、终端发热特征中的任意一种或多种。
进一步可选地,所述处理模块702,具体用于停止对循环者Looper的消息队列中所述运行异常任务的消息进行处理;或者,延迟将循环者Looper的消息队列中所述运行异常任务的消息发送给对应的处理者Handler。
进一步可选地,所述应用任务的运行特征包括:所述应用任务被执行的速度或者被执行的次数,或执行所述应用任务的硬件资源消耗量。包括电能消耗量,或CPU占用率等。
具体的,所述异常任务确定模块701、处理模块702、异常应用确定模块703以及通知模块704则可以对应于上述实施例中提到的决策模块。所述异常任务确定模块701、异常应用确定模块703可以通过上述的场景识别模块获取到相关的运行特征。各模块除了包括本实施例中提及的功能外,还可以包括上述场景识别模块和决策模块执行的其他功能,例如,所述处理模块702作为决策模块的一部分可以执行对被限制处理的运行异常任务的恢复处理等等。具体的,所述装置中各个模块的具体实现可参考图1至图6所对应的实施例中相关内容的描述,在此不赘述。
针对终端当前执行的应用任务,可以对其中的运行异常任务执行延迟或停止等限制处理的方式,从而较好地节省终端的处理器以及电能等资源,提升了终端性能。
图8为本申请实施例提供的一种针对应用的处理装置的结构示意图,本申请实施例的所述装置可设置在智能终端中,例如设置在智能手机、平板电脑、智能可穿戴设备等终端中,具体的,所述装置包括以下结构。
异常任务确定模块801,用于根据所述应用的应用任务的运行特征和预设的任务异常判断条件,确定所述应用任务是否属于运行异常任务;异常应用确定模块802,用于在所述异常任务确定模块801确定出所述应用任务属于运行异常任务时,则进一步根据所述应用的运行特征和预设的应用异常判断条件, 确定所述应用是否属于运行异常应用。处理模块803,用于在所述异常应用确定模块802确定出所述应用为运行异常应用时,对所述运行异常任务进行限制处理;其中,所述处理模块803,在用于对所述运行异常任务进行限制处理时,具体用于停止执行所述运行异常任务、或延迟处理所述运行异常任务。
其中可选地,所述应用在终端上运行过程中的运行特征包括:应用的运行特征和/或终端的运行特征;所述应用的运行特征包括:前台运行、后台运行、重要等级、是否被记录于限制处理名单、应用运行时的资源占用信息、应用无操作的持续时长中的任意一个或多个;终端的运行特征包括:终端的状态特征(是否为省电状态等)、对终端无操作的持续时长、终端剩余电量、终端发热特征中的任意一种或多种。
其中可选地,所述处理模块803,具体用于停止对循环者Looper的消息队列中所述运行异常任务的消息进行处理;或者,延迟将循环者Looper的消息队列中所述运行异常任务的消息发送给对应的处理者Handler。
其中可选地,所述应用任务的运行特征包括:所述应用任务被执行的速度或者被执行的次数,或执行所述应用任务的硬件资源消耗。
具体的,所述异常任务确定模块801、处理模块803、异常应用确定模块803则可以对应于上述实施例中提到的决策模块。可以通过上述的场景识别模块来获取相关的运行特征。各模块除了包括本实施例中提及的功能外,还可以包括上述场景识别模块和决策模块执行的其他功能,例如,所述处理模块803作为决策模块的一部分可以执行对被限制处理的运行异常任务的恢复处理等。具体的,所述装置中各个模块的具体实现可参考图1至图6所对应的实施例中相关内容的描述,在此不赘述。
根据应用任务的运行特征和对应应用的运行特征,可以快速、准确地针对确定出运行异常任务并执行对运行异常任务的延迟或停止等限制处理,从而较好地节省终端的处理器以及电能等资源,提升了终端性能。
图9为本申请实施例提供的一种智能终端的结构示意图,本申请实施例的所述智能终端可以为智能手机、平板电脑、智能可穿戴设备等终端,根据其终端类型可以包括:用户接口906(显示屏、按键键盘等),电源模块,处理器901,存储器902以及其他的诸如网络接口905、摄像头、穿戴机构(如表带)等结构。各个结构之间可以通过总线903相连。
所述处理器901可以是中央处理器(central processing unit,简称CPU),网络处理器(network processor,简称NP)或者CPU和NP的组合。
所述处理器901还可以进一步包括硬件芯片。上述硬件芯片可以是专用集成电路(application-specific integrated circuit,简称ASIC),可编程逻辑器件(programmable logic device,简称PLD)或其组合。上述PLD可以是复杂可编程逻辑器件(complex programmable logic device,简称CPLD),现场可编程逻辑门阵列(field-programmable gate array,简称FPGA),通用阵列逻辑(generic array logic,简称GAL)或其任意组合。
所述存储器902可以包括易失性存储器(volatile memory),例如随机存取存储器(random-access memory,简称RAM);存储器902也可以包括非易失性存储器(non-volatile memory),例如快闪存储器(flash memory),硬盘(hard disk drive,简称HDD)或固态硬盘(solid-state drive,简称SSD);存储器902还可以包括上述种类的存储器902的组合。
所述总线903 可以是外设部件互连标准(peripheral component interconnect,简称PCI)总线或扩展工业标准结构(extended industry standard architecture,简称EISA)总线等。所述总线903可以分为地址总线、数据总线、控制总线等。为便于表示,图9中仅用一条粗线表示,但并不表示仅有一根总线或一种类型的总线。
具体的,本申请实施例中所述智能终端的所述存储器902用于存储安装在所述智能终端中的应用、操作系统、用户接口模块、网络接口模块的相关数据,并存储了针对应用的处理指令(即针对应用的处理程序)。所述应用运行于终端的操作系统上。
所述处理器901,与所述存储器902相连,调用所述存储器902中存储的针对应用的处理指令,用于执行如下步骤:
当所述应用在所述操作系统的后台持续运行时间达到预设持续时间时,根据所述应用的应用任务的运行特征和预设的任务异常判断条件,确定所述应用任务是否属于运行异常任务;
如果确定所述应用任务属于所述运行异常任务,则对所述运行异常任务进行限制处理;
其中,所述对所述运行异常任务进行限制处理包括停止执行所述运行异常 任务、或延迟处理所述运行异常任务。
进一步可选地,所述处理器901,调用所述存储器902中存储的针对应用的处理指令,还用于执行如下步骤:
当所述应用在所述操作系统的后台持续运行时间达到预设持续时间时,所述根据所述应用的应用任务的运行特征和预设的任务异常判断条件,确定所述应用任务是否属于运行异常任务之前,根据所述应用在终端上运行过程中的运行特征和预设的应用异常判断条件,确定所述应用是否属于运行异常应用;
若所述应用属于运行异常应用,则对所述运行异常应用中的应用任务执行所述根据所述应用的应用任务的运行特征和预设的任务异常判断条件,确定所述应用任务是否属于运行异常任务的步骤。
进一步可选地,所述处理器901,调用所述存储器902中存储的针对应用的处理指令,还用于执行如下步骤:
停止对循环者Looper的消息队列中所述运行异常任务的消息进行处理;或者,延迟将循环者Looper的消息队列中所述运行异常任务的消息发送给对应的处理者Handler。
其中,所述应用在终端上运行过程中的运行特征包括:应用的运行特征和/或终端的运行特征;
所述应用的运行特征包括:前台运行、后台运行、重要等级、是否被记录于限制处理名单、应用运行时的资源占用信息、应用无操作的持续时长中的任意一个或多个;
终端的运行特征包括:终端的状态特征(是否为省电状态等)、对终端无操作的持续时长、终端剩余电量、终端发热特征中的任意一种或多种。
所述应用任务的运行特征包括:所述应用任务被执行的速度或者被执行的次数,或执行所述应用任务的硬件资源消耗量。
具体的,本申请实施例的所述处理器901的具体实现可参考图1至图6所对应实施例中相关功能及步骤的具体描述,在此不赘述。
针对终端当前执行的应用任务,可以对其中的运行异常任务执行延迟或停止等限制处理的方式,从而较好地节省终端的处理器以及电能等资源,提升了终端性能。
图10为本申请实施例提供的一种智能终端的结构示意图,本申请实施例 的所述智能终端可以为智能手机、平板电脑、智能可穿戴设备等终端,根据其终端类型可以包括:用户接口1004(显示屏、按键键盘等),电源模块,处理器1001,存储器1002以及其他的诸如网络接口1005、摄像头、穿戴机构(如表带)等结构。各个结构之间可以通过总线1003相连。
具体的,本申请实施例中所述智能终端的所述存储器1002用于存储安装在所述智能终端中的应用、操作系统、用户接口模块、网络接口模块的相关数据,并存储了针对应用的处理指令(即针对应用的处理程序)。所述应用运行于终端的操作系统上。
所述处理器1001,与所述存储器1002相连,调用所述存储器1002中存储的针对应用的处理指令,用于执行如下步骤:
根据所述应用的应用任务的运行特征和预设的任务异常判断条件,确定所述应用任务是否属于运行异常任务;
如果确定所述应用任务属于所述运行异常任务,则进一步根据所述应用在终端上运行过程中的运行特征和预设的应用异常判断条件,确定所述应用是否属于运行异常应用;
如果确定出所述应用属于运行异常应用,则对所述运行异常任务进行限制处理;
其中,所述对所述运行异常任务进行限制处理包括停止执行所述运行异常任务、或延迟处理所述运行异常任务。
进一步可选地,所述处理器1001,调用所述存储器1002中存储的针对应用的处理指令,用于执行如下步骤:
停止对循环者Looper的消息队列中所述运行异常任务的消息进行处理;或者,延迟将循环者Looper的消息队列中所述运行异常任务的消息发送给对应的处理者Handler。
其中,所述应用在终端上运行过程中的运行特征包括:应用的运行特征和/或终端的运行特征;
所述应用的运行特征包括:前台运行、后台运行、重要等级、是否被记录于限制处理名单、应用运行时的资源占用信息、应用无操作的持续时长中的任意一个或多个;
终端的运行特征包括:终端的状态特征(是否为省电状态等)、对终端无 操作的持续时长、终端剩余电量、终端发热特征中的任意一种或多种。
所述应用任务的运行特征包括:所述应用任务被执行的速度或者被执行的次数,或执行所述应用任务的硬件资源消耗量。
具体的,本申请实施例的所述处理器1001的具体实现可参考图1至图6所对应实施例中相关功能及步骤的具体描述,在此不赘述。
根据应用任务的运行特征和对应应用的运行特征,可以快速、准确地针对确定出运行异常任务并执行对运行异常任务的延迟或停止等限制处理,从而较好地节省终端的处理器以及电能等资源,提升了终端性能。
本申请实施例在需要对某个应用生成的目标消息进行处理时,先获取该目标消息的关联消息,并基于该关联消息来对满足限制处理条件的目标消息执行延迟或停止等限制处理,较好地节省了终端的处理器以及电能等资源,较好地提升了终端性能。
以上所揭露的仅为本申请较佳实施例而已,当然不能以此来限定本申请之权利范围,因此依本申请权利要求所作的等同变化,仍属本申请所涵盖的范围。

Claims (20)

  1. 一种针对应用的处理方法,其特征在于,所述应用运行于终端的操作系统上,所述方法包括:
    当所述应用在所述操作系统的后台持续运行时间达到预设持续时间时,根据所述应用的应用任务的运行特征和预设的任务异常判断条件,确定所述应用任务是否属于运行异常任务;
    如果确定所述应用任务属于所述运行异常任务,则对所述运行异常任务进行限制处理;
    其中,所述对所述运行异常任务进行限制处理包括停止执行所述运行异常任务、或延迟处理所述运行异常任务。
  2. 如权利要求1所述的方法,其特征在于,当所述应用在所述操作系统的后台持续运行时间达到预设持续时间时,在所述根据所述应用的应用任务的运行特征和预设的任务异常判断条件,确定所述应用任务是否属于运行异常任务之前,还包括:
    根据所述应用在终端上运行过程中的运行特征和预设的应用异常判断条件,确定所述应用是否属于运行异常应用;
    若所述应用属于运行异常应用,则对所述运行异常应用中的应用任务执行:根据所述应用的应用任务的运行特征和预设的任务异常判断条件,确定所述应用任务是否属于运行异常任务的步骤。
  3. 如权利要求2所述的方法,其特征在于,所述应用在终端上运行过程中的运行特征包括:应用的运行特征和/或终端的运行特征;
    所述应用的运行特征包括:前台运行、后台运行、重要等级、是否被记录于限制处理名单、应用运行时的资源占用信息、应用无操作的持续时长中的任意一个或多个;
    终端的运行特征包括:终端的状态特征、对终端无操作的持续时长、终端剩余电量、终端发热特征中的任意一种或多种。
  4. 如权利要求1至3任一项所述的方法,其特征在于,所述对所述运行异常任务进行限制处理,包括:
    停止对循环者Looper的消息队列中所述运行异常任务的消息进行处理;或者,
    延迟将循环者Looper的消息队列中所述运行异常任务的消息发送给对应的处理者Handler。
  5. 如权利要求1至4任一项所述的方法,其特征在于,所述应用任务的运行特征包括:所述应用任务被执行的速度或者被执行的次数,或执行所述应用任务的硬件资源消耗量。
  6. 一种针对应用的处理方法,其特征在于,所述应用运行于终端的操作系统上,所述方法包括:
    根据所述应用的应用任务的运行特征和预设的任务异常判断条件,确定所述应用任务是否属于运行异常任务;
    如果确定所述应用任务属于所述运行异常任务,则根据所述应用在终端上运行过程中的运行特征和预设的应用异常判断条件,确定所述应用是否属于运行异常应用;
    如果确定出所述应用属于运行异常应用,则对所述运行异常任务进行限制处理;
    其中,所述对所述运行异常任务进行限制处理包括停止执行所述运行异常任务、或延迟处理所述运行异常任务。
  7. 如权利要求6所述的方法,其特征在于,所述应用在终端上运行过程中的运行特征包括:应用的运行特征和/或终端的运行特征;
    所述应用的运行特征包括:前台运行、后台运行、重要等级、是否被记录于限制处理名单、应用运行时的资源占用信息、应用无操作的持续时长中的任意一个或多个;
    终端的运行特征包括:终端的状态特征、对终端无操作的持续时长、终端剩余电量、终端发热特征中的任意一种或多种。
  8. 如权利要求6或7所述的方法,其特征在于,所述对所述运行异常任务进行限制处理,包括:
    停止对循环者Looper的消息队列中所述运行异常任务的消息进行处理;或者,
    延迟将循环者Looper的消息队列中所述运行异常任务的消息发送给对应的处理者Handler。
  9. 如权利要求6至8任一项所述的方法,其特征在于,所述应用任务的运行特征包括:所述应用任务被执行的速度或者被执行的次数,或执行所述应用任务的硬件资源消耗。
  10. 一种针对应用的处理装置,其特征在于,所述应用运行于终端的操作系统上,所述装置包括:
    异常任务确定模块,用于当所述应用在所述操作系统的后台持续运行时间达到预设持续时间时,根据所述应用的应用任务的运行特征和预设的任务异常判断条件,确定所述应用任务是否属于运行异常任务;
    处理模块,用于在所述异常任务确定模块确定出所述应用任务属于所述运行异常任务,则对所述运行异常任务进行限制处理;
    其中,所述处理模块,在用于对所述运行异常任务进行限制处理时,具体用于停止执行所述运行异常任务、或延迟处理所述运行异常任务。
  11. 如权利要求10所述的装置,其特征在于,还包括:
    异常应用确定模块,用于根据所述应用在终端上运行过程中的运行特征和预设的应用异常判断条件,确定所述应用是否属于运行异常应用;
    通知模块,用于在所述异常应用确定模块确定出所述应用为运行异常应用时,通知所述异常任务确定模块。
  12. 如权利要求11所述的装置,其特征在于,所述应用在终端上运行过程中的运行特征包括:应用的运行特征和/或终端的运行特征;
    所述应用的运行特征包括:前台运行、后台运行、重要等级、是否被记录于限制处理名单、应用运行时的资源占用信息、应用无操作的持续时长中的任意一个或多个;
    终端的运行特征包括:终端的状态特征、对终端无操作的持续时长、终端剩余电量、终端发热特征中的任意一种或多种。
  13. 如权利要求10至12任一项所述的装置,其特征在于,
    所述处理模块,具体用于停止对循环者Looper的消息队列中所述运行异常任务的消息进行处理;或者,延迟将循环者Looper的消息队列中所述运行异常任务的消息发送给对应的处理者Handler。
  14. 如权利要求10至13任一项所述的装置,其特征在于,所述应用任务的运行特征包括:所述应用任务被执行的速度或者被执行的次数,或执行所述应用任务的硬件资源消耗量。
  15. 一种针对应用的处理装置,其特征在于,所述应用运行于终端的操作系统上,所述装置包括:
    异常任务确定模块,用于根据所述应用的应用任务的运行特征和预设的任务异常判断条件,确定所述应用任务是否属于运行异常任务;
    异常应用确定模块,用于在所述异常任务确定模块确定出所述应用任务属于所述运行异常任务,则进一步根据所述应用在终端上运行过程中的运行特征和预设的应用异常判断条件,确定所述应用是否属于运行异常应用;
    处理模块,用于在所述异常应用确定模块确定出所述应用属于运行异常应用时,对所述运行异常任务进行限制处理;
    其中,所述处理模块,在用于对所述运行异常任务进行限制处理时,具体用于停止执行所述运行异常任务、或延迟处理所述运行异常任务。
  16. 如权利要求15所述的装置,其特征在于,所述应用在终端上运行过程中的运行特征包括:应用的运行特征和/或终端的运行特征;
    所述应用的运行特征包括:前台运行、后台运行、重要等级、是否被记录 于限制处理名单、应用运行时的资源占用信息、应用无操作的持续时长中的任意一个或多个;
    终端的运行特征包括:终端的状态特征、对终端无操作的持续时长、终端剩余电量、终端发热特征中的任意一种或多种。
  17. 如权利要求15或16所述的装置,其特征在于,
    所述处理模块,具体用于停止对循环者Looper的消息队列中所述运行异常任务的消息进行处理;或者,延迟将循环者Looper的消息队列中所述运行异常任务的消息发送给对应的处理者Handler。
  18. 如权利要求15至17任一项所述的装置,其特征在于,所述应用任务的运行特征包括:所述应用任务被执行的速度或者被执行的次数,或执行所述应用任务的硬件资源消耗。
  19. 一种智能终端,其特征在于,包括:处理器和存储器,所述存储器用于存储指令,所述处理器用于执行所述指令,当所述处理器在执行所述指令时根据所述指令执行如权利要求1至5任一项所述的方法。
  20. 一种智能终端,其特征在于,包括:处理器和存储器,所述存储器用于存储指令,所述处理器用于执行所述指令,当所述处理器在执行所述指令时根据所述指令执行如权利要求6至9任一项所述的方法。
PCT/CN2016/076255 2016-03-14 2016-03-14 一种针对应用的处理方法、装置及智能终端 WO2017156676A1 (zh)

Priority Applications (2)

Application Number Priority Date Filing Date Title
PCT/CN2016/076255 WO2017156676A1 (zh) 2016-03-14 2016-03-14 一种针对应用的处理方法、装置及智能终端
CN201680024971.7A CN107615250B (zh) 2016-03-14 2016-03-14 一种针对应用的处理方法、装置及智能终端

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2016/076255 WO2017156676A1 (zh) 2016-03-14 2016-03-14 一种针对应用的处理方法、装置及智能终端

Publications (1)

Publication Number Publication Date
WO2017156676A1 true WO2017156676A1 (zh) 2017-09-21

Family

ID=59851411

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2016/076255 WO2017156676A1 (zh) 2016-03-14 2016-03-14 一种针对应用的处理方法、装置及智能终端

Country Status (2)

Country Link
CN (1) CN107615250B (zh)
WO (1) WO2017156676A1 (zh)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108717376A (zh) * 2018-03-23 2018-10-30 河源市美晨智能研究院 后台应用的管理方法、电子设备及具有存储功能的装置
CN109992087A (zh) * 2019-04-09 2019-07-09 努比亚技术有限公司 可穿戴设备数据显示的优化方法、可穿戴设备及存储介质
CN111095221A (zh) * 2017-10-09 2020-05-01 华为技术有限公司 一种刷新显示异常处理的方法及终端
CN112346831A (zh) * 2019-08-09 2021-02-09 华为技术有限公司 管理异常应用的方法和装置
CN114428546A (zh) * 2022-01-25 2022-05-03 惠州Tcl移动通信有限公司 后台应用清理方法、装置、存储介质及终端设备

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110163155B (zh) * 2019-05-23 2021-07-09 北京旷视科技有限公司 人脸数据的处理方法、装置、电子设备及可读存储介质

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20100331057A1 (en) * 2008-01-30 2010-12-30 Kyocera Corporation Portable Electronic Device and Wireless Communication Device
EP2339429A2 (en) * 2009-12-07 2011-06-29 Yggdra Solutions Power management
WO2013167022A2 (zh) * 2013-02-22 2013-11-14 中兴通讯股份有限公司 实现移动终端节电的方法及装置及移动终端
CN104298569A (zh) * 2014-09-30 2015-01-21 北京金山安全软件有限公司 应用程序运行异常的检测方法、装置和移动终端
CN104636236A (zh) * 2014-12-30 2015-05-20 深圳天珑无线科技有限公司 终端高温异常的检测方法及移动终端
CN105718028A (zh) * 2016-01-22 2016-06-29 青岛海信移动通信技术股份有限公司 一种基于识别耗电应用的省电方法及装置

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104298335B (zh) * 2013-07-19 2017-11-21 贝壳网际(北京)安全技术有限公司 移动终端的应用程序进程清理方法、装置和移动终端
CN105373419A (zh) * 2014-08-26 2016-03-02 阿里巴巴集团控股有限公司 一种后台应用的操作方法及装置

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20100331057A1 (en) * 2008-01-30 2010-12-30 Kyocera Corporation Portable Electronic Device and Wireless Communication Device
EP2339429A2 (en) * 2009-12-07 2011-06-29 Yggdra Solutions Power management
WO2013167022A2 (zh) * 2013-02-22 2013-11-14 中兴通讯股份有限公司 实现移动终端节电的方法及装置及移动终端
CN104298569A (zh) * 2014-09-30 2015-01-21 北京金山安全软件有限公司 应用程序运行异常的检测方法、装置和移动终端
CN104636236A (zh) * 2014-12-30 2015-05-20 深圳天珑无线科技有限公司 终端高温异常的检测方法及移动终端
CN105718028A (zh) * 2016-01-22 2016-06-29 青岛海信移动通信技术股份有限公司 一种基于识别耗电应用的省电方法及装置

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111095221A (zh) * 2017-10-09 2020-05-01 华为技术有限公司 一种刷新显示异常处理的方法及终端
CN111095221B (zh) * 2017-10-09 2023-11-03 华为技术有限公司 一种刷新显示异常处理的方法及终端
CN108717376A (zh) * 2018-03-23 2018-10-30 河源市美晨智能研究院 后台应用的管理方法、电子设备及具有存储功能的装置
CN109992087A (zh) * 2019-04-09 2019-07-09 努比亚技术有限公司 可穿戴设备数据显示的优化方法、可穿戴设备及存储介质
CN109992087B (zh) * 2019-04-09 2023-10-17 努比亚技术有限公司 可穿戴设备数据显示的优化方法、可穿戴设备及存储介质
CN112346831A (zh) * 2019-08-09 2021-02-09 华为技术有限公司 管理异常应用的方法和装置
CN114428546A (zh) * 2022-01-25 2022-05-03 惠州Tcl移动通信有限公司 后台应用清理方法、装置、存储介质及终端设备
CN114428546B (zh) * 2022-01-25 2024-04-09 惠州Tcl移动通信有限公司 后台应用清理方法、装置、存储介质及终端设备

Also Published As

Publication number Publication date
CN107615250A (zh) 2018-01-19
CN107615250B (zh) 2020-12-15

Similar Documents

Publication Publication Date Title
WO2017156676A1 (zh) 一种针对应用的处理方法、装置及智能终端
US11283724B2 (en) Broadcast message management method and apparatus
WO2017070894A1 (zh) 基于终端的唤醒锁控制方法、装置及终端
US20160048682A1 (en) Method and Apparatus for Clearing Malicious Power-Consuming Application, and User Terminal
JP5863217B2 (ja) アプリケーション通信を同期化するためのシステムおよび方法
WO2014117653A1 (zh) 内存清理方法、装置和终端设备
CN108132735B (zh) 终端与应用控制方法
WO2017211226A1 (zh) 展示媒体文件的方法、终端和存储介质
CN111045810B (zh) 一种任务调度处理方法及装置
CN109981737B (zh) 一种网络请求的处理方法、装置、终端及存储介质
CN107943269B (zh) 调度作业控制方法、装置、终端设备及存储介质
WO2020228289A1 (zh) 日志获取方法、装置、终端及存储介质
JP2018515822A (ja) コンピューティングデバイス内の複数のsocの間における動作状態の協調のための方法およびシステム
EP3418892B1 (en) Method and device for managing and controlling broadcast, and terminal
CN106951314B (zh) 面向Android系统后台服务自动唤醒的切断方法
CN112383585A (zh) 消息处理系统、方法及电子设备
WO2020220748A1 (zh) 应用控制方法、装置、终端及计算机可读存储介质
WO2021042934A1 (zh) 数据扫描方法、移动终端和非易失性计算机可读存储介质
JP6189545B2 (ja) 電力消費の低減のためのネットワークアプリケーション並行スケジューリング
CN111078441A (zh) 一种系统运行状态监测方法、装置及电子设备
WO2023193527A1 (zh) 线程执行方法、装置、电子设备及计算机可读存储介质
CN108804152B (zh) 配置参数的调节方法及装置
CN109426563B (zh) 一种进程管理方法及装置
Banerjee et al. Energy-aware design patterns for mobile application development (invited talk)
CN112162626A (zh) 一种应用程序处理方法及装置

Legal Events

Date Code Title Description
NENP Non-entry into the national phase

Ref country code: DE

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

Ref document number: 16893841

Country of ref document: EP

Kind code of ref document: A1

122 Ep: pct application non-entry in european phase

Ref document number: 16893841

Country of ref document: EP

Kind code of ref document: A1