Application program processing method and device and electronic equipment

By monitoring the CPU load rate and user operation status of background applications and dynamically adjusting priorities, it solves the problem of background applications being accidentally killed and improves killing efficiency and user experience.

CN118568720APending Publication Date: 2024-08-30VIVO MOBILE COMM CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410619831.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-05-17
Publication Date
2024-08-30

AI Technical Summary

Technical Problem

In the existing system, when users frequently switch multiple applications, the background applications are accidentally killed due to too long time, resulting in low efficiency of killing and affecting the user experience.

Method used

By monitoring the CPU load rate and user operation status of background applications, it dynamically adjusts the priority of applications, improves the priority of applications that are executing tasks or have not been used, and avoids being checked and killed by the system.

Benefits of technology

It improves the survival rate and killing efficiency of background applications, avoids the problem of being accidentally killed due to insufficient priority, and improves the user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118568720A
    Figure CN118568720A
Patent Text Reader

Abstract

The invention discloses an application program processing method and device and electronic equipment, and belongs to the technical field of communication. The method comprises the steps that central processing unit load rates of N application programs running in the background of the electronic equipment are obtained, and / or user operation states of the N application programs before the N application programs are switched to run in the background are obtained respectively, and N is a positive integer; obtaining priorities corresponding to the N application programs according to the CPU load rates and / or the user operation states of the N application programs; and searching and killing the N application programs according to the priorities of the N application programs.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application belongs to the field of communication technology, and specifically relates to an application processing method, device and electronic device. Background Art

[0002] Currently, when using electronic devices, users often switch back and forth between multiple applications. For example, while using a video playback application to watch a video, they switch to an instant messaging application to reply to a communication message. When users switch back and forth between multiple applications, the application switched to the background may be killed by the system due to too many background applications.

[0003] Currently, when the system detects and kills applications, it detects and kills them according to the time when the applications are switched to the background. Specifically, the applications that are switched to the background first are killed first. This causes the problem of applications being killed by mistake, and the detection efficiency is low. Summary of the invention

[0004] The purpose of the embodiments of the present application is to provide an application processing method, device and electronic device to improve the efficiency of detection and killing.

[0005] In a first aspect, an embodiment of the present application provides an application processing method, the method comprising:

[0006] Obtaining the central processing unit (CPU) load rate of N applications running in the background of the electronic device, and / or respectively obtaining the user operation status before the N applications are switched to the background, where N is a positive integer;

[0007] Obtaining priorities corresponding to the N applications respectively according to the CPU load rates and / or user operation states of the N applications;

[0008] According to the priorities of the N applications, the N applications are checked and killed.

[0009] In a second aspect, an embodiment of the present application provides an application processing device, the device comprising:

[0010] A first acquisition module is used to acquire the CPU load rate of N applications running in the background of the electronic device, and / or to respectively acquire the user operation status before the N applications are switched to run in the background, where N is a positive integer;

[0011] A classification module, used for obtaining priorities corresponding to the N applications respectively according to the CPU load rates and / or user operation states of the N applications;

[0012] The processing module is used to check and kill the N applications according to the priorities of the N applications.

[0013] In a third aspect, an embodiment of the present application provides an electronic device, which includes a processor and a memory, wherein the memory stores programs or instructions that can be run on the processor, and when the program or instructions are executed by the processor, the steps of the method described in the first aspect are implemented.

[0014] In a fourth aspect, an embodiment of the present application provides a readable storage medium, on which a program or instruction is stored, and when the program or instruction is executed by a processor, the steps of the method described in the first aspect are implemented.

[0015] In a fifth aspect, an embodiment of the present application provides a chip, comprising a processor and a communication interface, wherein the communication interface is coupled to the processor, and the processor is used to run a program or instruction to implement the method described in the first aspect.

[0016] In a sixth aspect, an embodiment of the present application provides a computer program product, which is stored in a storage medium and is executed by at least one processor to implement the method described in the first aspect.

[0017] In an embodiment of the present application, by monitoring the CPU load rate of N applications running in the background, the progress of task execution of these applications can be determined. By obtaining the user's operating status of the application when it enters the background, it can be determined whether these applications are applications that the user has not completed. In this way, through the above two methods, the priority of the N applications running in the background can be dynamically adjusted, so that the priority of applications that are in the process of executing tasks and / or applications that the user has not completed is increased to avoid being killed by the system, thereby achieving the goal of keeping the application alive and improving the killing efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] Figure 1 It is a flowchart of a keep-alive solution for an application program provided by the prior art;

[0019] Figure 2 is a flowchart of an application processing method provided by some embodiments of the present application;

[0020] Figure 3 It is a schematic diagram of the principle of conversion between information in the system memory of an electronic device and information in the ZRAM area provided by some embodiments of the present application;

[0021] Figure 4 is a flowchart of an application processing method provided by some embodiments of the present application;

[0022] Figure 5is a flowchart of an application processing method provided by some embodiments of the present application;

[0023] Figure 6 is a schematic diagram of the structure of an application processing device shown in some embodiments of the present application;

[0024] Figure 7 is a schematic diagram of the structure of an electronic device shown in some embodiments of the present application;

[0025] Figure 8 It is a schematic diagram of the hardware structure of an electronic device shown in some embodiments of the present application. DETAILED DESCRIPTION

[0026] The following will be combined with the drawings in the embodiments of the present application to clearly describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, rather than all the embodiments. All other embodiments obtained by ordinary technicians in this field based on the embodiments in the present application belong to the scope of protection of this application.

[0027] The terms "first", "second", etc. in the specification and claims of the present application are used to distinguish similar objects, and are not used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable under appropriate circumstances, so that the embodiments of the present application can be implemented in an order other than those illustrated or described here, and the objects distinguished by "first", "second", etc. are generally of one type, and the number of objects is not limited. For example, the first object can be one or more. In addition, "and / or" in the specification and claims represents at least one of the connected objects, and the character " / " generally indicates that the objects associated with each other are in an "or" relationship.

[0028] Before introducing the technical solution of the embodiment of the present application, the background technology of the embodiment of the present application is first introduced:

[0029] At present, when using electronic devices, users often switch back and forth between multiple applications. For example, while watching videos in a video playback application, they will switch to an instant messaging application to reply to communication messages or check takeout orders. When users switch back and forth between multiple applications, the application switched to the background may be killed by the system due to insufficient background memory or the number of applications running in the background, which causes inconvenience to the user. For example, when a user fills in information in application A, he needs to refer to the information in application B. When the user switches from application A to application B, if application A is killed by the system due to insufficient background memory, when the user switches back to application A again, he will find that all the information previously filled in is lost, and the user needs to fill it in again, which causes inconvenience to the user.

[0030] Currently, in order to prevent an application that a user wants to keep alive from being killed by the system, the user usually manually locks the priority of the application to be kept alive, thereby preventing the application from being killed in the background. However, the priority is fixed after being locked, unless the user manually releases the priority of the application. Otherwise, if the user subsequently uses the application again, the priority of the application will always remain at a high level. However, at this time, the application may not require such a high level of priority to be kept alive, thus causing other applications in the background to be mistakenly killed.

[0031] In one example, reference Figure 1 , Figure 1 This is a keep-alive solution for an application in the prior art, and the solution includes steps 1 to 9.

[0032] Step 1: User opens application A.

[0033] In this step 1, after the user opens application A, application A is, for example, an application for executing a time-consuming function, such as a video playback application, and the user uses application A to cache the video.

[0034] Step 2: Determine whether to turn on the priority lock switch of application A. If yes, go to step 3; if no, go to step 5.

[0035] In this step 2, the priority lock switch may be a switch for locking the priority of application A. When the priority lock switch is turned on, the priority of application A is locked. Here, locking the priority of application A may be locking the priority of application A as a high priority. If the priority lock switch is not turned on, the priority of application A is not locked, and the priority of application A is determined according to the current existing scheme.

[0036] Currently, when determining the priority of each application, the priority of the application can be sorted in the following manner:

[0037] Foreground focus -> Visible applications -> Foreground services -> Recently used -> User requirements -> User habits -> Heavyweight applications > Application classification.

[0038] The foreground focus here may be an application being used in the foreground. For example, if a user is using an instant messaging application to send a communication message, the instant messaging application is the application with the foreground focus.

[0039] The above-mentioned visible application can be an application that is in the background but is running in the foreground, but is not the foreground focus. For example, the application on the notification bar is a visible application. For another example, if the user is using an instant messaging application to send communication information, but using a music player to play music, then the music player application is a visible application.

[0040] The foreground service mentioned above may be a service corresponding to a visible application, such as a service corresponding to an application in a notification bar.

[0041] The above-mentioned heavyweight applications may be applications that are frequently used by users. For example, people generally need to use instant messaging applications to obtain messages and communicate with others, and instant messaging applications may be heavyweight applications.

[0042] Step 3: Application A is always at high priority.

[0043] In step 3, when application A no longer executes tasks, application A will still be at a high priority.

[0044] Step 4: The memory occupied by application A cannot be released, which affects the survival of other background applications.

[0045] Step 5. Switch from application A to application B.

[0046] In step 5, since the priority lock switch of application A is not turned on, but application A needs to spend a long time in caching the video, the user switches from application A to application B to kill time.

[0047] Step 6: Application A enters the background.

[0048] In step 6, application A continues to cache the video after entering the background.

[0049] Step 7: The user opens multiple other applications.

[0050] Step 8: The priority of application A is gradually reduced.

[0051] While waiting for Application A to cache the video, the user opens multiple applications, which causes the priority of Application A to become lower and lower.

[0052] Step 9: Application A task was not completed and was killed.

[0053] In step 9, when the user opens multiple applications, there are more and more applications in the background, which causes insufficient system memory. Some applications need to be killed to free up memory. Since application A has been in the background for a long time, although the task of application A has not been completed at this time, since application A has a lower priority, the system will kill application A, resulting in application A being killed before it is completed, affecting the user experience.

[0054] In order to solve the above problems, the embodiments of the present application provide an application processing method, device and electronic device. By monitoring the CPU load rate of N applications running in the background, the progress of task execution of these applications can be determined. By obtaining the user's operation status of the application when it enters the background, it can be determined whether these applications are applications that the user has not completed. In this way, through the above two methods, the priority of the N applications running in the background can be dynamically adjusted, so that the priority of applications that are in the process of executing tasks and / or applications that the user has not completed is increased to avoid being killed by the system, thereby achieving the goal of keeping the application alive and improving the killing efficiency.

[0055] The technical solution of the embodiment of the present application can be applied to the keep-alive scenario of the application program running in the background.

[0056] The following is a detailed description of the application processing method provided by the embodiment of the present application through specific embodiments and their application scenarios in conjunction with the accompanying drawings.

[0057] Figure 2 It is a flowchart of an application processing method provided in an embodiment of the present application. The execution subject of the application processing method may be an electronic device, which may be, but is not limited to, a personal computer (PC), a smart phone, a tablet computer or a personal digital assistant (PDA). It should be noted that the above execution subject is not a limitation on the embodiments of the present application.

[0058] like Figure 2 As shown, the application processing method provided in the embodiment of the present application may include steps 210 to 230.

[0059] Step 210: obtaining the CPU load rates of N applications running in the background of the electronic device, and / or obtaining the user operation states before the N applications are switched to run in the background.

[0060] Wherein, N is a positive integer.

[0061] In some embodiments of the present application, the higher the CPU load rate of an application, the more it indicates that the application is still executing tasks, so the user generally wants to keep the application active in the background.

[0062] The user operation status can be the operation status of the user on the application before it enters the background, such as whether the application is in an editing state or a non-editing state. For example, before application A enters the background, the user is filling in information in application A, but needs to refer to the information in application B, so application A will exit the foreground and enter the background. The operation status of application A before entering the background is an editing state. After the user has finished referring to the information of application B, application B will exit the foreground and enter the background. The operation status of application B before entering the background is a non-editing state.

[0063] Step 220: Obtain priorities corresponding to the N applications according to the CPU load rates and / or operation states of the N applications.

[0064] In some embodiments of the present application, the priorities corresponding to N applications can be determined based on the CPU load rates and / or user operation status of the N applications. Specifically, the N applications can be prioritized based on the CPU load rates and / or user operation status of the N applications. For example, the N applications can be classified according to their priorities, that is, some applications are classified as high-priority types, and some applications are classified as low-priority types.

[0065] In some embodiments of the present application, in order to accurately determine the priorities corresponding to the N applications, step 220 may specifically include:

[0066] When it is determined that the CPU load rate of the first application is greater than a first threshold, and / or the user operation state of the first application is an editing state, determining the priority of the first application to be a first priority;

[0067] When it is determined that the CPU load rate of the first application is less than or equal to the first threshold, and / or the user operation state of the first application is a non-editing state, the priority of the first application is determined to be the second priority.

[0068] The first application may be any one of the N applications.

[0069] The first threshold may be a threshold of the CPU load rate of an application program that is preset in order to prioritize the application program. When the CPU load rate of the application program is higher than the threshold, the priority of the application program is the first priority. When the CPU load rate of the application program is lower than the threshold, the priority of the application program is the second priority.

[0070] It should be noted that the first threshold can be set according to user needs and is not limited in the embodiments of the present application.

[0071] It should be noted that the second priority here is lower than the first priority. The first priority and the second priority here can be understood as priority types, the second priority is a low priority type, and the first priority is a high priority type.

[0072] It should be noted that the above-mentioned determination methods of the first priority and the second priority are mutually exclusive, that is, if the CPU load rate of an application is greater than the first threshold, the priority of the application is the first priority; if the CPU load rate of the application is less than or equal to the first threshold, the priority of the application is the second priority; if the user operation status of the application is an editing status, the priority of the application is the first priority; if the user operation status of the application is a non-editing status, the priority of the application is the second priority; there is no situation where the CPU load rate of the application is greater than the first threshold and the user operation status of the application is a non-editing status, because generally if the user operation status of an application is an editing status, its CPU load rate must be greater than the first threshold.

[0073] In an embodiment of the present application, when it is determined that the CPU load rate of the first application is greater than a first threshold value, and / or the user operation state of the first application is an editing state, the priority of the first application is determined to be the first priority; when it is determined that the CPU load rate of the first application is less than or equal to the first threshold value, and / or the user operation state of the first application is a non-editing state, the priority of the first application is determined to be the second priority. In this way, the priority of the application is dynamically determined according to the CPU load rate of the application and / or the operation state before entering the background, rather than locking the priority of the application, thereby improving the flexibility of determining the priority of the application.

[0074] Step 230: Check and kill the N applications according to their priorities.

[0075] In some embodiments of the present application, N applications may be checked and killed according to their priorities.

[0076] Optionally, the killing here does not necessarily mean killing the application from the background. If the priority level of a certain application is high and the user wants to keep the application alive, the application will not be killed in the background.

[0077] In some embodiments of the present application, in order to improve the accuracy of the killing process of N applications, step 230 may specifically include:

[0078] According to the priorities of the N applications and the first ranking of the N applications, the N applications are checked and killed.

[0079] Among them, the first sorting can be the priority sorting of N pre-set applications. Specifically, the priorities of N applications running in the background can be sorted according to the priority sorting rules of currently existing applications, that is, according to the sorting rules of "foreground focus->visible application->foreground service->recent use->user requirement->user habit->heavyweight application>application classification", the priorities of N applications running in the background are sorted to obtain the first sorting of N applications.

[0080] In some embodiments of the present application, the priorities of the N applications and the first ranking of the N applications may be comprehensively considered to perform a check and kill process on the N applications.

[0081] In the embodiment of the present application, the priorities of the N applications and the first ranking of the N applications are comprehensively considered to perform a detection and killing process on the N applications, thereby improving the accuracy of the detection and killing process on the N applications.

[0082] In some embodiments of the present application, in order to further prevent the application that the user wants to keep alive from being killed by the system, the killing process of the N applications according to the priorities of the N applications and the first ranking of the N applications may specifically include:

[0083] Obtaining the priority of the second application program at the i-th position in the first ranking;

[0084] In the case where the priority of the second application is the first priority, the second application is not killed, the value of i is updated to make i=i+1, and the second application at the i-th position in the first sorting is selected for execution;

[0085] When it is determined that the priority of the second application is the second priority, the second application is killed, the value of i is updated to make i=i+1, and execution is returned to select the second application at the i-th position in the first sorting.

[0086] The N applications may include a second application.

[0087] The N applications may be sorted in the first sorting order from low to high priority, so the initial value of i here is 1.

[0088] In some embodiments of the present application, the second application with the lowest priority is first obtained from the first sorting, and then it is determined whether the priority of the second application is the first priority or the second priority. If the priority of the second application is the first priority, the second application is skipped, that is, the second application is not blocked, and the second lowest priority application is obtained from the first sorting again, and it is determined whether the priority of the re-acquired application is the first priority or the second priority, and so on.

[0089] When the priority of the second application is the second priority, the second application is killed, and then it is determined whether the system memory of the electronic device is less than the second threshold. If it is not, the killing of background applications is stopped. If it is, the second lowest priority application is continued to be obtained from the first sorting, and it is determined whether the priority of the newly obtained application is the first priority or the second priority, and so on, until the system memory of the electronic device is not less than the second threshold.

[0090] The second threshold here can be a threshold of the system memory of the electronic device set by the threshold. When the system memory of the electronic device is less than the second threshold, some applications need to be killed to free up memory. When the system memory of the electronic device is greater than or equal to the second threshold, there is no need to kill the application. The second threshold can be set according to user needs and is not limited in the embodiments of the present application.

[0091] In an example, assuming that N is 5, 5 applications are sorted in the first sorting in order of priority from low to high, and the initial value of i is 1. In the first sorting, the 5 applications are sorted in order of priority from low to high as follows: Application 3 -> Application 2 -> Application 5 -> Application 1 -> Application 4, wherein the priority classification result of the 5 applications is determined based on the CPU load rate of the 5 applications and / or the user operation status of the 5 applications before entering the background: the priority of Application 2 and Application 1 is the second priority, that is, the priority of Application 2 and Application 1 is low priority, and the priority of Application 3, Application 4 and Application 5 is the first priority, that is, the priority of Application 3, Application 4 and Application 5 is high priority.

[0092] Continuing with the above example, first select application 3 ranked first from the first sort, determine if the priority of application 3 is the first priority, then skip application 3, i.e. do not kill application 3, and continue to select application 2 ranked second from the first sort, and the priority of application 2 is the second priority, then kill application 2, if the system memory of the electronic device is not less than the second threshold after application 2 is killed, stop checking and killing background applications, if the system memory of the electronic device is less than the second threshold after application 2 is killed, then continue to select application 5 ranked third from the first sort, determine if the priority of application 5 is the first priority or the second priority, and so on, until the system memory of the electronic device is not less than the second threshold.

[0093] In an embodiment of the present application, a second application with the lowest priority is selected from the first sorting, and the priority of the second application is determined. If the priority of the second application is the first priority, the second application is not killed. If the priority of the second application is the second priority, the second application is killed. In this way, the application is checked and killed based on the pre-set first sorting, the CPU load rate of the application, and / or the user operation status of the application before entering the background, thereby preventing the application from being mistakenly killed because it has been in the background for too long and has not completed the task but has a low priority. This improves the flexibility of keeping background applications alive and improves the killing efficiency.

[0094] In some embodiments of the present application, in order to further improve the flexibility of keeping background applications alive, after it is determined that all applications with the second priority level are killed, the above method may further include:

[0095] When it is determined that the system memory is less than the second threshold, the third application program with the first priority is compressed into a preset memory space of the system memory.

[0096] The third application may be an application among the applications with the first priority level, for which no user response is detected within the first preset period after the CPU load rate is reduced, and the N applications may include the third application.

[0097] The first preset period here can be a period of time after the CPU load rate of each application program of the first priority is reduced. The first preset period can be set according to user needs and is not limited in the embodiment of the present application.

[0098] The third application may also be an application that is at the top of the first ranking among the applications having the first priority.

[0099] The preset memory space may be a portion of a memory area divided from the system memory, for example, the preset memory space may be a ZRAM area.

[0100] In some embodiments of the present application, after all second-priority applications are killed, if the system memory of the electronic device is still less than the second threshold, that is, the system memory of the electronic device is still insufficient and the system memory needs to be cleaned up, then all first-priority applications whose user responses have not been detected within a first preset period of time after the CPU load rate is reduced can be compressed into a preset memory space of the system memory.

[0101] Continuing to refer to the above example, taking the preset memory space as the ZRAM area as an example, after the second type of application 1 and application 2 are both killed, among application 3, application 4 and application 5 with the first priority, the task execution of application 3 is completed, then the CPU load rate of application 3 will be reduced or even zero. If the user does not perform any other operations on application 3 within the first preset time period after the CPU load rate of application 3 is reduced, such as 10 minutes, that is, the user does not switch application 3 from the background to the foreground for operation, then application 3 will be compressed into the ZRAM area.

[0102] In some embodiments of the present application, when no user response is detected within a first preset time period after the CPU load rate of at least two first-priority applications is reduced, applications with lower priorities in the first priority sorting among the at least two first-priority applications are preferentially compressed into a preset memory space of the system memory.

[0103] Continuing to refer to the above example, taking the preset memory space as the ZRAM area as an example, after the second priority application 1 and application 2 are both killed, among the first priority application 3, application 4 and application 5, the tasks of application 3 and application 4 are all executed, then the CPU load rate of application 3 and application 4 will be reduced or even zero. If within the first preset time period after the CPU load rate of application 3 and application 4 is reduced, such as 10 minutes, the user does not perform any other operations on application 3 and application 4, that is, the user does not switch application 3 and application 4 from the background to the foreground for operation, but only one application needs to be compressed to free up the system memory. Since application 3 has a lower priority than application 4 in the first sorting, application 3 needs to be compressed into the ZRAM area, and application 4 is not compressed.

[0104] In some embodiments of the present application, after the CPU load rate of the third application is reduced, a prompt message can also be output, which prompts the user that the task of the third application has been completed, so that the user can view the task execution status of the third application in a timely and intuitive manner.

[0105] In some embodiments of the present application, after all second-priority applications are killed, if the system memory of the electronic device is still less than the second threshold, that is, the system memory of the electronic device is still insufficient and the system memory needs to be cleaned up, then the application ranked first in the first sort among the first-priority applications can be compressed into the preset memory space of the system memory.

[0106] Continuing to refer to the above example, after applications 1 and 2 of the second priority are both killed, if the system memory of the electronic device is still less than the second threshold, since applications 3, 4, and 5 of the first priority are sorted in the first sorting as: application 3->application 5->application 4, then application 3 that is at the first place in the first sorting among applications 3, 4, and 5 of the first priority is compressed into the preset memory space of the system memory.

[0107] In some embodiments of the present application, when the third application is the first application in the first sorting among the applications with the first priority, after determining that the third application is compressed into the preset memory space of the system memory, if the system memory is less than the second threshold, the fourth application with the first priority is updated to the third application, and the process returns to compressing the third application with the first priority into the preset memory space of the system memory until the system memory is greater than or equal to the second threshold.

[0108] The fourth application here may be an application that is one level behind the third application in the first ranking among the applications having the first priority.

[0109] Continuing to refer to the above example, the order of application 3, application 4 and application 5 with the first priority in the first sorting is: application 3->application 5->application 4. If the third application is application 3, the fourth application is application 5.

[0110] Continuing to refer to the above example, if after application 3 is compressed into the preset memory space of the system memory, the system memory of the electronic device is not less than the second threshold, the process ends. If after application 3 is compressed into the preset memory space of the system memory, the system memory of the electronic device is still less than the second threshold, then among application 3, application 4 and application 5, application 5 that is located after application 3 in the first sorting is compressed into the preset memory space of the system memory, and then it is determined whether the system memory of the electronic device is less than the second threshold, and so on, until the system memory of the electronic device is not less than the second threshold.

[0111] In an embodiment of the present application, after determining that all applications with a second priority level are killed, when determining that the system memory is less than a second threshold, among the applications with a first priority level, the applications for which no user response is detected within a first preset period of time after the CPU load rate is reduced are compressed into a preset memory space of the system memory. In this way, by compressing the applications that have completed task execution and for which no user response is detected for a period of time into the preset memory space of the system memory, it is avoided that applications that have not completed tasks are mistakenly killed due to their low priority, thereby improving the flexibility of keeping background applications alive. Alternatively, among the applications with a first priority level, the application that is at the top of the first sort is compressed into the preset memory space of the system memory. In this way, the compressed applications of the same type are determined according to their priorities in the first priority sort, thereby avoiding that applications of the same type that are at a higher priority in the first priority sort are killed, thereby improving the flexibility of keeping background applications alive and improving the killing efficiency.

[0112] It should be noted that after it is determined that all applications with the second priority level are killed, when it is determined that the system memory is less than the second threshold, among the applications with the first priority level, the applications for which no user response is detected within the first preset period after the CPU load rate is reduced are compressed into the preset memory space of the system memory. If the system memory is still less than the second threshold, but if the CPU load rates of the remaining applications with the first priority level have not been reduced, then among the remaining applications with the second priority level, the application that is ranked first in the first sorting can also be compressed into the preset memory space of the system memory. Alternatively, among the remaining applications with the first priority level, the application for which no user response is detected for the longest time can also be compressed into the preset memory space of the system memory. In this way, the flexibility of keeping background applications alive is further improved.

[0113] In some embodiments of the present application, after it is determined that all applications with a first priority are compressed into a preset memory space, the method may further include:

[0114] When it is determined that the system memory is less than the second threshold, the applications of the first priority are moved from the preset memory space to the local storage space of the electronic device for storage in the order in which the applications of the first priority are compressed until the system memory is greater than or equal to the first threshold.

[0115] In some embodiments of the present application, after determining that all first-priority applications are compressed into a preset memory space, when determining that the system memory is less than a second threshold, the first-priority applications are moved from the preset memory space to the local storage space of the electronic device for storage in the order in which the first-priority applications are compressed until the system memory is greater than or equal to the first threshold.

[0116] Continuing to refer to the above example, after applications 3, 4 and 5 with the first priority are all compressed into the preset memory space, if the system memory is still less than the second threshold, applications 3, 4 and 5 can be moved from the preset memory space to the local storage space of the electronic device for storage in the order in which they are compressed until the system memory is greater than or equal to the first threshold. That is, since when applications 3, 4 and 5 are all compressed into the preset memory space, application 3 is compressed first, then application 5 is compressed, and finally application 4, when applications 3, 4 and 5 are moved from the preset memory space to the local storage space of the electronic device for storage, application 3 is also first moved from the preset memory space to the local storage space of the electronic device for storage, and then it is determined whether the system memory is still less than the second threshold. If so, application 5 continues to be moved from the preset memory space to the local storage space of the electronic device for storage. If not, the process ends, and so on, until the system memory is not less than the second threshold.

[0117] In an embodiment of the present application, after determining that all first-priority applications are compressed into a preset memory space, when determining that the system memory is less than a second threshold, the first-priority applications are moved from the preset memory space to the local storage space of the electronic device for storage in the order in which the first-priority applications are compressed until the system memory is greater than or equal to the first threshold. In this way, by transferring the applications to the local storage space for storage, the system memory can be freed up to avoid insufficient system memory, and the first-priority applications can be killed, thereby improving the detection efficiency.

[0118] In some embodiments of the present application, after determining that all first-priority applications are compressed into a preset memory space, when determining that the system memory is less than a second threshold, in addition to moving each first-priority application from the preset memory space to the local storage space of the electronic device for storage in the order in which the first-priority applications are compressed, each first-priority application may also be moved from the preset memory space to the local storage space of the electronic device for storage according to the application for which no user response is detected. That is, for each first-priority application, the application for which no user response is detected for the longest time may first be moved from the preset memory space to the local storage space of the electronic device for storage, and then a determination is made as to whether the system memory is still less than the second threshold; if so, the application for which no user response is detected for the second longest time may continue to be moved from the preset memory space to the local storage space of the electronic device for storage; if not, the process ends, and so on, until the system memory is no less than the second threshold.

[0119] In some embodiments of the present application, the above method may further include:

[0120] When it is determined that the local storage space is less than the third threshold and no user response is detected within a second preset period of time after the sixth application in the local storage space is stored in the local storage space, the sixth application is deleted from the local storage space.

[0121] Among them, the third threshold can be a pre-set storage threshold of the local storage space. When the local storage space is less than the third threshold, it means that the information stored in the local storage space needs to be cleaned up. When the local storage space is not less than the third threshold, there is no need to clean up the information stored in the local storage space.

[0122] The sixth application may be an application of the first priority level stored in the local storage space, which is the first application for which no user response is detected within the second preset period of time.

[0123] The second preset period can be a preset period after the sixth application is stored in the local storage space. The second preset period can be set according to user needs and is not limited in the embodiment of the present application.

[0124] In some embodiments of the present application, when it is determined that the local storage space is less than the third threshold value, and no user response is detected for the sixth application in the local storage space within the second preset period of time after it is stored in the local storage space, the sixth application can be deleted from the local storage space. Since the applications stored in the local storage space are in a sequential order, there is also a sequential order when cleaning up the applications in the local storage space, that is, the applications that are first not detected with a user response within the second preset period of time after being stored in the local storage space are deleted first.

[0125] Continuing to refer to the above example, taking the second preset time period of 10 minutes as an example, in the process of moving application 3, application 4 and application 5 from the preset memory space to the local storage space of the electronic device for storage, if the local storage space is less than the third threshold, and application 3 does not detect a user response within 10 minutes after being stored in the local storage space, application 3 is deleted from the local storage space, and then a determination is made as to whether the local storage space is still less than the third threshold. If so, if application 5 does not detect a user response within 10 minutes after being stored in the local storage space, application 5 is deleted from the local storage space. If not, the process ends until the local storage space is no less than the third threshold.

[0126] In an embodiment of the present application, when it is determined that the local storage space is less than the third threshold and no user response is detected within a second preset time period after the sixth application in the local storage space is stored in the local storage space, the sixth application is deleted from the local storage space. This can avoid insufficient local storage space, which may lead to the inability to move the application from the preset storage space in the system memory to the local storage space of the electronic device, thereby causing the first type of application to be detected and killed, thereby improving the detection efficiency.

[0127] In some embodiments of the present application, after compressing the third application of the first priority into a preset memory space of the system memory, the method involved above may further include:

[0128] In the case where it is determined that the third application is to be accessed, the third application is decompressed from the preset memory space to obtain the decompressed third application;

[0129] The decompressed third application is moved from the preset memory space to the system memory.

[0130] In some embodiments of the present application, when it is determined that the system memory needs to access a third application, the third application can be decompressed from the preset memory space to obtain the decompressed third application, and then the decompressed third application can be moved from the preset memory space to the system memory.

[0131] In some embodiments of the present application, taking the preset storage space as a ZRAM area as an example, the ZRAM area here is a portion of the system memory separated out and used to specifically place compressed memory data.

[0132] The following is a detailed description of the principle of information conversion between system memory and ZRAM area. Figure 3 , Figure 3 The schematic diagram is a schematic diagram of the principle of converting information in the system memory of an electronic device and information in the ZRAM area. The process includes the following steps 310 to 340:

[0133] Step 310: The system periodically traverses the data in the system memory, compresses the data that has not been accessed within a preset period of time, and places the compressed data in the ZRAM area.

[0134] In step 310, the preset time period may be a preset time period before the current moment, for example, one week before the current moment.

[0135] The system periodically traverses the data in the system memory and compresses the data that has not been accessed recently into the ZRAM area to reduce the space occupied by the system memory.

[0136] Step 320: When the data accessed by the CPU is stored in the ZRAM area, the CPU decompresses the data in the ZRAM area, removes the data from the ZRAM area, and places the data in the system memory.

[0137] Step 330: When the data in the ZRAM area is continuously not accessed or the capacity of the ZRAM area reaches a threshold, the data in the ZRAM area is written to the local storage space.

[0138] Step 340: When the data accessed by the CPU is stored in the local storage space, read the data in the local storage space into the system memory.

[0139] In some embodiments of the present application, it can be simply considered that the application data frequently accessed by the CPU is hot data, and hot data will not be compressed into the ZRAM area. Only the data that has not been accessed by the CPU recently is cold data, and the probability of this part of data being accessed again is low. Therefore, in order to improve the efficiency of the use of system memory, this part of cold data will be compressed and placed in a special area, namely the ZRAM area, and the space occupied by the system memory will be reduced after the data is compressed. However, the data compressed into the ZRAM area may be accessed by the CPU next time. At that time, the ZRAM area will be removed after decompressing this part of data and put back into the system memory. If the system memory is insufficient or the memory of the ZRAM area is not accessed by the CPU within a certain period of time, the data in the ZRAM area will be written to the local storage to make room for storing new compressed data.

[0140] In an embodiment of the present application, when it is determined that a third application needs to be accessed, the third application is decompressed from the preset memory space to obtain the decompressed third application, and then the decompressed third application is moved from the preset memory space to the system memory. In this way, according to user needs, if the third application needs to be accessed again, the third application can be moved from the preset memory space to the system memory, thereby improving the user's access flexibility to the applications placed in the preset memory space.

[0141] In some embodiments of the present application, in order to more clearly understand the application processing method provided in the embodiments of the present application, Figure 4 It is a flowchart of an application processing method provided in an embodiment of the present application. The application processing method may include steps 410 to 460.

[0142] Step 410: obtaining the CPU load rates of N applications running in the background of the electronic device, and / or obtaining the user operation states before the N applications are switched to run in the background.

[0143] Step 420: Obtain priorities corresponding to the N applications according to the CPU load rates and / or user operation states of the N applications.

[0144] The above steps 410 to 420 are consistent with the steps 210 to 220 in the above embodiment, and are not described again here.

[0145] Step 430: according to the priorities of the N applications and the preset first ranking of the N applications, kill the application with the second priority.

[0146] In step 430, based on the priorities of the N applications and the pre-set first sort of the N applications, the application with the second priority is killed. Specifically, refer to the above embodiment, and obtain the second application in the i-th position in the first sort; when it is determined that the priority of the second application is the first priority, update the value of i so that i=i+1, and return to execute the second application in the i-th position in the first sort; when it is determined that the priority of the second application is the second priority, kill the second application; when it is determined that the system memory of the electronic device is less than the second threshold, update the value of i so that i=i+1, and return to execute the second application in the i-th position in the first sort, until the system memory is greater than or equal to the second threshold, the process will not be repeated here.

[0147] Step 440: compress the first priority application into a preset memory space of the system memory.

[0148] In step 440, after all second-priority applications are killed, if the system memory is still less than the second threshold, the first-priority applications are compressed into the preset memory space of the system memory. The specific compression process can refer to the process of compressing the first-priority applications into the preset memory space of the system memory in the above embodiment, and will not be repeated here.

[0149] Step 450: Move the first-priority applications from the preset memory space to the local storage space of the electronic device for storage in the order in which the first-priority applications are compressed.

[0150] In step 450, after determining that all first-priority applications are compressed into the preset memory space, if the system memory is still less than the second threshold, the first-priority applications are moved from the preset memory space to the local storage space of the electronic device for storage in the order in which the first-priority applications are compressed. Specifically, for moving the first-priority applications from the preset memory space to the local storage space of the electronic device for storage in the order in which the first-priority applications are compressed, refer to the process in the above embodiment, which will not be repeated here.

[0151] Step 460: Delete the application in the local storage space.

[0152] In step 460, during the process of moving the application from the preset memory space to the local storage space of the electronic device for storage, if the local storage space is less than a third threshold and no user response is detected from the application in the local storage space within a second preset time period after the application is stored in the local storage space, the application is deleted from the local storage space.

[0153] In some embodiments of the present application, Figure 1 The scenario shown in FIG. 1 is used to describe in detail how to flexibly keep the application running in the background alive by using the application processing method of the embodiment of the present application, such as Figure 5 As shown, the application processing method may include steps 501 to 512.

[0154] Step 501: The user opens application A.

[0155] In this step 501, after the user opens application A, application A is, for example, an application for executing a time-consuming function, such as a video playback application, and the user uses application A to cache the video.

[0156] Step 502: Switch from application A to application B.

[0157] In step 502, since application A needs to spend a long time to cache the video, the user switches from application A to application B to kill time.

[0158] Step 503: Application A enters the background.

[0159] In step 503, application A continues to cache videos after entering the background.

[0160] Step 504: The user opens multiple other application programs.

[0161] In step 504, while waiting for application A to cache the video, the user opens multiple other applications.

[0162] Step 505: monitor the CPU load rate of each application in the background, and / or the user operation status of each application before entering the background.

[0163] Step 506: Obtain the priority level corresponding to each application program according to the CPU load rate of each application program and / or the user operation status before entering the background.

[0164] In step 506, if the CPU load rate of an application is high, it means that the application is still executing tasks at this time, and / or, if the application is in editing state before entering the background, the application is added to the keep-alive list, that is, the priority of the application is higher.

[0165] Step 507: according to the priority of each application and the preset first ranking of each application, kill the application with the second priority.

[0166] Step 508: The CPU load rate of a certain application program is reduced.

[0167] Step 509 , determine whether a user response is detected within the first preset period of time after the CPU load rate of the application is reduced, if so, execute step 510 , if not, return to execute step 505 .

[0168] Step 510: When it is determined that the system memory is less than the second threshold, compress the application into a preset storage space.

[0169] Step 511: If the system memory is still less than the second threshold and no user response is detected within a second preset period of time after the application is compressed into the preset storage space, move the application to the local storage space.

[0170] Step 512: If it is determined that no user response to the application in the local storage space is detected and the local storage space is less than a third threshold, delete the application from the local storage space.

[0171] The application processing method provided in the embodiment of the present application can be executed by an application processing device. In the embodiment of the present application, the application processing device provided in the embodiment of the present application is described by taking the application processing method executed by the application processing device as an example.

[0172] Figure 6 The diagram is a schematic diagram of the structure of an application processing device according to an exemplary embodiment.

[0173] like Figure 6 As shown, the application processing device 600 may include:

[0174] The first acquisition module 610 is used to acquire the CPU load rate of N applications running in the background of the electronic device, and / or to respectively acquire the user operation status before the N applications are switched to the background, where N is a positive integer;

[0175] A first determination module 620, configured to obtain priorities corresponding to the N applications respectively according to the CPU load rates and / or user operation states of the N applications;

[0176] The processing module 630 is used to perform a check and kill process on the N applications according to the priorities of the N applications.

[0177] In an embodiment of the present application, by monitoring the CPU load rate of N applications running in the background, the progress of task execution of these applications can be determined. By obtaining the user's operating status of the application when it enters the background, it can be determined whether these applications are applications that the user has not completed. In this way, through the above two methods, the priority of the N applications running in the background can be dynamically adjusted, so that the priority of applications that are in the process of executing tasks and / or applications that the user has not completed is increased to avoid being killed by the system, thereby achieving the goal of keeping the application alive and improving the killing efficiency.

[0178] In some embodiments of the present application, the first determining module 620 is specifically used to:

[0179] When it is determined that the CPU load rate of the first application is greater than a first threshold, and / or the user operation state of the first application is an editing state, determining the priority of the first application to be a first priority, wherein the first application is any one of the N applications;

[0180] When it is determined that the CPU load rate of the first application is less than or equal to the first threshold, and / or the user operation state of the first application is a non-editing state, the priority of the first application is determined to be a second priority, and the second priority is lower than the first priority.

[0181] In some embodiments of the present application, the processing module 630 is specifically used to:

[0182] According to the priorities of the N applications and the first ranking of the N applications, the N applications are checked and killed.

[0183] In some embodiments of the present application, the processing module 630 is specifically used to:

[0184] Obtaining the priority of a second application program that is at the i-th position in the first ranking, wherein an initial value of i is 1, and wherein the N applications program include the second application program;

[0185] In the case where it is determined that the priority of the second application is the first priority, the second application is not killed, the value of i is updated so that i=i+1, and the execution returns to obtain the second application at the i-th position in the first sorting;

[0186] When it is determined that the priority of the second application is the second priority, the second application is killed, the value of i is updated so that i=i+1, and execution is returned to obtain the second application at the i-th position in the first sorting.

[0187] In some embodiments of the present application, the above-mentioned device may further include:

[0188] The first compression module is used to compress a third application with the first priority level into a preset memory space of the system memory when it is determined that the system memory is less than a second threshold value, wherein the third application is an application with the first priority level that has not detected a user response within a first preset period of time after the CPU load rate is reduced, or the third application is an application with the first priority level that is ranked first in the first sorting among the applications with the first priority level, and the N applications include the third application.

[0189] The application processing device in the embodiment of the present application can be an electronic device, or a component in the electronic device, such as an integrated circuit or a chip. The electronic device can be a terminal, or it can be other devices other than a terminal. Exemplarily, the electronic device can be a mobile phone, a tablet computer, a laptop computer, a PDA, a vehicle-mounted electronic device, a mobile Internet device (Mobile Internet Device, MID), an augmented reality (augmented reality, AR) / virtual reality (virtual reality, VR) device, a robot, a wearable device, an ultra-mobile personal computer (ultra-mobile personal computer, UMPC), a netbook or a personal digital assistant (personal digital assistant, PDA), etc., and can also be a server, a network attached storage (Network Attached Storage, NAS), a personal computer (personal computer, PC), a television (television, TV), a teller machine or a self-service machine, etc., which is not specifically limited in the embodiment of the present application.

[0190] The application processing device in the embodiment of the present application may be a device having an operating system. The operating system may be an Android operating system, an iOS operating system, or other possible operating systems, which are not specifically limited in the embodiment of the present application.

[0191] The application processing device provided in the embodiment of the present application can realize Figure 2 To avoid repetition, the various processes implemented by the method embodiment are not described here.

[0192] Alternatively, if Figure 7 As shown, an embodiment of the present application also provides an electronic device 700, including a processor 701 and a memory 702, wherein the memory 702 stores programs or instructions that can be executed on the processor 701, and when the program or instructions are executed by the processor 701, the various steps of the above-mentioned application processing method embodiment are implemented, and the same technical effect can be achieved. To avoid repetition, they are not described here.

[0193] It should be noted that the electronic devices in the embodiments of the present application include the mobile electronic devices and non-mobile electronic devices mentioned above.

[0194] Figure 8 A schematic diagram of the hardware structure of an electronic device to implement an embodiment of the present application.

[0195] The electronic device 800 includes but is not limited to: a radio frequency unit 801, a network module 802, an audio output unit 803, an input unit 804, a sensor 805, a display unit 806, a user input unit 807, an interface unit 808, a memory 809, and a processor 810 and other components.

[0196] Those skilled in the art will appreciate that the electronic device 800 may also include a power source (such as a battery) for supplying power to each component, and the power source may be logically connected to the processor 810 through a power management system, thereby implementing functions such as managing charging, discharging, and power consumption management through the power management system. Figure 8 The electronic device structure shown in the figure does not constitute a limitation on the electronic device. The electronic device may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently, which will not be described in detail here.

[0197] Among them, processor 810 is used to obtain the central processing unit CPU load rate of N applications running in the background of the electronic device, and / or, respectively obtain the user operation status of the N applications before switching to the background operation, N is a positive integer; according to the CPU load rate and / or user operation status of the N applications, obtain the priorities corresponding to the N applications respectively; according to the priorities of the N applications, check and kill the N applications.

[0198] In this way, by monitoring the CPU load rate of N applications running in the background, the progress of task execution of these applications can be determined. By obtaining the user's operation status of the application when it enters the background, it can be determined whether these applications are applications that the user has not completed. In this way, through the above two methods, the priority of the N applications running in the background can be dynamically adjusted, so that the priority of applications that are in the process of executing tasks and / or applications that the user has not completed is increased to avoid being killed by the system, thereby achieving the goal of keeping the application alive and improving the killing efficiency.

[0199] Optionally, the processor 810 is further used to determine that the priority of the first application is a first priority when it is determined that the CPU load rate of the first application is greater than a first threshold and / or that the user operation state of the first application is an editing state, wherein the first application is any one of the N applications; and to determine that the priority of the first application is a second priority when it is determined that the CPU load rate of the first application is less than or equal to the first threshold and / or that the user operation state of the first application is a non-editing state, and the second priority is lower than the first priority.

[0200] In this way, when it is determined that the CPU load rate of the first application is greater than the first threshold, and / or the user operation state of the first application is an editing state, the priority of the first application is determined to be the first priority; when it is determined that the CPU load rate of the first application is less than or equal to the first threshold, and / or the user operation state of the first application is a non-editing state, the priority of the first application is determined to be the second priority. In this way, the priority of the application is dynamically determined according to the CPU load rate of the application and the user operation state before entering the background, rather than locking the priority of the application, thereby improving the flexibility of determining the priority of the application.

[0201] Optionally, the processor 810 is further configured to perform a check and kill process on the N applications according to the priorities of the N applications and the first ranking of the N applications.

[0202] In this way, the N applications are checked and killed by comprehensively considering the priorities of the N applications and the first ranking of the N applications, thereby improving the accuracy of the checking and killing of the N applications.

[0203] Optionally, the processor 810 is further used to obtain the priority of a second application that is ranked i-th in the first sorting, wherein the initial value of i is 1, and the N applications include the second application; when it is determined that the priority of the second application is the first priority, the second application is not killed, the value of i is updated so that i=i+1, and the process of obtaining the second application that is ranked i-th in the first sorting is returned; when it is determined that the priority of the second application is the second priority, the second application is killed, the value of i is updated so that i=i+1, and the process of obtaining the second application that is ranked i-th in the first sorting is returned.

[0204] In this way, the second application with the lowest priority is selected from the first sorting, and the priority of the second application is determined. If the priority of the second application is the first priority, the second application is not killed. If the priority of the second application is the second priority, the second application is killed. In this way, the application is checked and killed based on the pre-set first sorting, the CPU load rate of the application, and / or the user operation status of the application before entering the background, thereby avoiding the application being mistakenly killed because it has entered the background for too long and has not completed the task but has a low priority. This improves the flexibility of keeping background applications alive and improves the killing efficiency.

[0205] Optionally, the processor 810 is further used to compress a third application with the first priority level into a preset memory space of the system memory when it is determined that the system memory is less than a second threshold value, wherein the third application is an application with the first priority level that has not detected a user response within a first preset time period after the CPU load rate is reduced, among the applications with the first priority level, or the third application is an application with the first priority level that is ranked first in the first sorting, and the N applications include the third application.

[0206] In this way, after it is determined that all applications with the second priority level have been killed, when it is determined that the system memory is less than the second threshold, among the applications with the first priority level, the applications for which no user response is detected within the first preset period after the CPU load rate is reduced are compressed into the preset memory space of the system memory. In this way, by compressing the applications that have completed task execution and for which no user response is detected for a period of time into the preset memory space of the system memory, it is avoided that applications that have not completed tasks are mistakenly killed due to their low priority, thereby improving the flexibility of keeping background applications alive. Alternatively, among the applications with the first priority level, the application that ranks first in the first sort is compressed into the preset memory space of the system memory. In this way, the compressed applications of the same type are determined according to their priorities in the first priority sort, thereby avoiding that applications of the same type that are at a higher priority in the first priority sort are killed, thereby improving the flexibility of keeping background applications alive and improving the killing efficiency.

[0207] It should be understood that in the embodiment of the present application, the input unit 804 may include a graphics processor (Graphics Processing Unit, GPU) 8041 and a microphone 8042, and the graphics processor 8041 processes the image data of the static picture or video obtained by the image capture device (such as a color camera) in the video capture mode or the image capture mode. The display unit 806 may include a display panel 8061, and the display panel 8061 may be configured in the form of a liquid crystal display, an organic light emitting diode, etc. The user input unit 807 includes a touch panel 8071 and at least one of other input devices 8072. The touch panel 8071 is also called a touch screen. The touch panel 8071 may include two parts: a touch detection device and a touch controller. Other input devices 8072 may include, but are not limited to, a physical keyboard, function keys (such as volume control keys, switch keys, etc.), a trackball, a mouse, and a joystick, which will not be repeated here.

[0208] The memory 809 can be used to store software programs and various data. The memory 809 may mainly include a first storage area for storing programs or instructions and a second storage area for storing data, wherein the first storage area may store an operating system, an application program or instructions required for at least one function (such as a sound playback function, an image playback function, etc.), etc. In addition, the memory 809 may include a volatile memory or a non-volatile memory, or the memory 809 may include both volatile and non-volatile memories. Among them, the non-volatile memory may be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory may be a random access memory (RAM), a static random access memory (SRAM), a dynamic random access memory (DRAM), a synchronous dynamic random access memory (SDRAM), a double data rate synchronous dynamic random access memory (DDRSDRAM), an enhanced synchronous dynamic random access memory (ESDRAM), a synchronous link dynamic random access memory (SLDRAM) and a direct memory bus random access memory (DRRAM). The memory 809 in the embodiment of the present application includes but is not limited to these and any other suitable types of memory.

[0209] The processor 810 may include one or more processing units; optionally, the processor 810 integrates an application processor and a modem processor, wherein the application processor mainly processes operations related to an operating system, a user interface, and application programs, and the modem processor mainly processes wireless communication signals, such as a baseband processor. It is understandable that the modem processor may not be integrated into the processor 810.

[0210] An embodiment of the present application also provides a readable storage medium, on which a program or instruction is stored. When the program or instruction is executed by a processor, each process of the above-mentioned application processing method embodiment is implemented, and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.

[0211] The processor is the processor in the electronic device described in the above embodiment. The readable storage medium includes a computer readable storage medium, such as a computer read-only memory ROM, a random access memory RAM, a magnetic disk or an optical disk.

[0212] An embodiment of the present application further provides a chip, which includes a processor and a communication interface, wherein the communication interface is coupled to the processor, and the processor is used to run programs or instructions to implement the various processes of the above-mentioned application processing method embodiment, and can achieve the same technical effect. To avoid repetition, it will not be repeated here.

[0213] It should be understood that the chip mentioned in the embodiments of the present application can also be called a system-level chip, a system chip, a chip system or a system-on-chip chip, etc.

[0214] An embodiment of the present application provides a computer program product, which is stored in a storage medium. The program product is executed by at least one processor to implement the various processes of the above-mentioned application processing method embodiment and can achieve the same technical effect. To avoid repetition, it will not be repeated here.

[0215] It should be noted that, in this article, the terms "comprise", "include" or any other variant thereof are intended to cover non-exclusive inclusion, so that the process, method, article or device including a series of elements includes not only those elements, but also includes other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise one..." do not exclude the presence of other identical elements in the process, method, article or device including the element. In addition, it should be pointed out that the scope of the methods and devices in the embodiments of the present application is not limited to performing functions in the order shown or discussed, and may also include performing functions in a substantially simultaneous manner or in reverse order according to the functions involved, for example, the described method may be performed in an order different from that described, and various steps may also be added, omitted, or combined. In addition, the features described with reference to certain examples may be combined in other examples.

[0216] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a computer software product, which is stored in a storage medium (such as ROM / RAM, a disk, or an optical disk), and includes a number of instructions for a terminal (which can be a mobile phone, a computer, a server, or a network device, etc.) to execute the methods described in each embodiment of the present application.

[0217] The embodiments of the present application are described above in conjunction with the accompanying drawings, but the present application is not limited to the above-mentioned specific implementation methods. The above-mentioned specific implementation methods are merely illustrative and not restrictive. Under the guidance of the present application, ordinary technicians in this field can also make many forms without departing from the purpose of the present application and the scope of protection of the claims, all of which are within the protection of the present application.

Claims

1. A method for processing an application program, It is characterized in that The method comprises: Obtaining the CPU load rates of the central processing units (CPUs) corresponding to the N applications running in the background of the electronic device, and / or obtaining the user operation states before the N applications are switched to the background, where N is a positive integer; Obtaining priorities corresponding to the N applications respectively according to the CPU load rates and / or user operation states of the N applications; According to the priorities of the N applications, the N applications are checked and killed.

2. The method according to claim 1, It is characterized in that The obtaining priorities respectively corresponding to the N applications according to the CPU load rates and / or operation states of the N applications comprises: When it is determined that the CPU load rate of the first application is greater than a first threshold, and / or the user operation state of the first application is an editing state, determining the priority of the first application to be a first priority, wherein the first application is any one of the N applications; When it is determined that the CPU load rate of the first application is less than or equal to the first threshold, and / or the user operation state of the first application is a non-editing state, the priority of the first application is determined to be a second priority, and the second priority is lower than the first priority.

3. The method according to claim 2, It is characterized in that The step of performing a check and kill process on the N applications according to the priorities of the N applications comprises: According to the priorities of the N applications and the first ranking of the N applications, the N applications are checked and killed.

4. The method according to claim 3, It is characterized in that The step of performing a check and kill process on the N applications according to the priorities of the N applications and the first ranking of the N applications includes: Obtaining the priority of a second application program that is at the i-th position in the first ranking, where an initial value of i is 1, and the N applications program include the second application program; In the case where the priority of the second application is the first priority, the second application is not killed, the value of i is updated so that i=i+1, and the execution returns to obtain the priority of the second application at the i-th position in the first sorting; When it is determined that the priority of the second application is the second priority, the second application is killed, the value of i is updated so that i=i+1, and the execution returns to obtain the priority of the second application at the i-th position in the first sorting.

5. The method according to claim 3, It is characterized in that After determining that all applications with the second priority level are killed, the method further includes: When it is determined that the system memory is less than a second threshold, a third application with the first priority level is compressed into a preset memory space of the system memory, wherein the third application is an application with the first priority level that has not detected a user response within a first preset period of time after the CPU load rate is reduced, or the third application is an application with the first priority level that is ranked first in the first sorting, and the N applications include the third application.

6. An application processing device, It is characterized in that The device comprises: A first acquisition module is used to acquire the CPU load rate of N applications running in the background of the electronic device, and / or to respectively acquire the user operation status before the N applications are switched to the background, where N is a positive integer; A first determination module, configured to obtain priorities corresponding to the N applications respectively according to the CPU load rates and / or user operation states of the N applications; The processing module is used to detect and kill the N applications according to the priorities of the N applications.

7. The device according to claim 6, It is characterized in that The first determining module is specifically used for: When it is determined that the CPU load rate of the first application is greater than a first threshold, and / or the user operation state of the first application is an editing state, determining the priority of the first application to be a first priority, wherein the first application is any one of the N applications; When it is determined that the CPU load rate of the first application is less than or equal to the first threshold, and / or the user operation state of the first application is a non-editing state, the priority of the first application is determined to be a second priority, and the second priority is lower than the first priority.

8. The device according to claim 7, It is characterized in that The processing module is specifically used for: According to the priorities of the N applications and the first ranking of the N applications, the N applications are checked and killed.

9. The device according to claim 8, It is characterized in that The processing module is specifically used for: Obtaining the priority of a second application program that is at the i-th position in the first ranking, wherein an initial value of i is 1, and the N applications program include the second application program; In the case where the priority of the second application is the first priority, the second application is not killed, the value of i is updated to make i=i+1, and the execution returns to obtain the second application at the i-th position in the first sorting; When it is determined that the priority of the second application is the second priority, the second application is killed, the value of i is updated so that i=i+1, and the execution returns to obtain the priority of the second application at the i-th position in the first sorting.

10. The device according to claim 8, It is characterized in that The device also includes: The first compression module is used to compress a third application with the first priority level into a preset memory space of the system memory when it is determined that the system memory is less than a second threshold value, wherein the third application is an application with the first priority level that has not been detected with a user response within a first preset period of time after the CPU load rate is reduced, or the third application is an application with the first priority level that is ranked first in the first sorting among the applications with the first priority level, and the N applications include the third application.

11. An electronic device, It is characterized in that The method comprises a processor and a memory, wherein the memory stores programs or instructions that can be run on the processor, and when the programs or instructions are executed by the processor, the steps of the application processing method according to any one of claims 1 to 5 are implemented.