A method and device for optimizing process resources of a computer system

By determining the optimization conditions of the process resources of the computer system, obtain system resource information, and perform resource optimization operations on the background process based on the optimization threshold, solve the problem of poor optimization of the process resources in the existing technology, improve the efficiency of system resource utilization and user experience, and user experience. Essence

CN114356551BActive Publication Date: 2025-01-28ALLWINNER TECH CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202111508927.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-10
Publication Date
2025-01-28
Estimated Expiration
2041-12-10

AI Technical Summary

Technical Problem

The prior art has poor flexibility when optimizing process resources of computer systems, resulting in low efficiency in system resource utilization and affecting user experience.

Method used

By determining whether the computer system meets the process resource optimization conditions, obtains system resource information, and according to different resource categories and its corresponding optimization threshold relationship, the background process performs resource optimization operations, including memory recovery and priority adjustment to avoid killing processes.

Benefits of technology

With the process of not killing the process, it accurately and effectively restricts and control the background process resources, improves the efficiency of system resources, and improves the user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114356551B_ABST
    Figure CN114356551B_ABST
Patent Text Reader

Abstract

The present invention discloses a method and device for optimizing process resources of a computer system, the method comprising: determining whether the computer system meets the determined process resource optimization conditions; when it is determined that the computer system meets the process resource optimization conditions, obtaining system resource information of the computer system, the system resource information including at least one category of system resource information; and performing resource optimization operations on target background processes according to the relationship between each category of system resource information and the optimization threshold corresponding to each category of system resource information. It can be seen that the present invention can perform corresponding resource optimization operations on background processes according to the usage scenarios and load conditions of system resources when it is identified that the system meets the process resource optimization conditions, accurately and effectively limit and control background process resources, and can improve the utilization efficiency of system resources and the user experience without killing the process.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and in particular to a method and device for optimizing process resources of a computer system. Background Art

[0002] With the rapid development of computer technology, the system complexity is getting higher and higher, and the background process occupies more and more system resources such as memory and CPU. The resulting memory and CPU preemption directly affects the running performance of the foreground process.

[0003] In actual applications, the system resource management of background processes is usually performed by managing the OOM-ADJ value of the foreground and background processes, and the Kill process operation is triggered by setting the OOM or LMKD threshold to release system resources for the foreground process. However, this method of optimizing system resources by killing low-priority processes has poor flexibility and reduces the utilization efficiency of system resources.

[0004] It can be seen that it is particularly important to provide an effective method for optimizing process resources of a computer system to improve the utilization efficiency of system resources. Summary of the invention

[0005] The present invention provides a method and device for optimizing process resources of a computer system. When it is identified that the system meets the process resource optimization conditions, the method and device can perform corresponding resource optimization operations on the background process according to the usage scenario and load conditions of the system resources, accurately and effectively limit and control the background process resources, and improve the utilization efficiency of the system resources and the user experience without killing the process.

[0006] In order to solve the above technical problems, the first aspect of the present invention discloses a process resource optimization method for a computer system, the method comprising:

[0007] Determining whether the computer system meets the determined process resource optimization condition;

[0008] When it is determined that the computer system meets the process resource optimization condition, obtaining system resource information of the computer system, the system resource information including at least one category of system resource information;

[0009] According to the relationship between each category of system resource information and the optimization threshold corresponding to each category of system resource information, a resource optimization operation is performed on the target background process.

[0010] As an optional implementation manner, in the first aspect of the present invention, the determining whether the computer system satisfies the determined process resource optimization condition includes:

[0011] Determine whether the computer system is in an idle state, and when it is determined that the computer system is in the idle state, determine that the computer system meets the determined process resource optimization condition; wherein the idle state includes one or more combinations of screen off, standby, hibernation, when the interval between the current moment and the last refresh end moment is greater than or equal to a first preset time threshold, the service process for driving the display in the computer system has no refresh operation, the CPU utilization rate of the computer system is lower than a preset threshold, and the foreground process of the computer system is an Idle process; and / or,

[0012] Determine whether the computer system has a scene switching operation. When it is determined that the computer system has the scene switching operation, determine that the computer system meets the determined process resource optimization conditions; wherein the scene switching operation includes any one of a foreground and background process switching operation and a new process startup operation.

[0013] As an optional implementation, in the first aspect of the present invention, performing a resource optimization operation on a target background process according to a relationship between each category of system resource information and an optimization threshold value corresponding to each category of system resource information includes:

[0014] Performing a scoring operation on all background processes to obtain scoring values ​​of all the background processes;

[0015] According to the scoring values ​​of all the background processes, all target background processes are screened out from all the background processes, wherein all the target background processes are background processes for which resource optimization operations need to be performed;

[0016] According to the relationship between the system resource information of each category and the optimization threshold corresponding to the system resource information of each category, all the target background processes are divided into at least one target background process subset, and corresponding resource optimization operations are performed on each target background process subset.

[0017] As an optional implementation, in the first aspect of the present invention, all of the categories include a total memory idle rate category;

[0018] The method of dividing all the target background processes into at least one target background process subset according to the relationship between the system resource information of each category and the optimization threshold corresponding to the system resource information of each category, and performing a corresponding resource optimization operation on each target background process subset includes:

[0019] According to the relationship between the total memory idle rate category and the optimization threshold corresponding to the system resource information of the total memory idle rate category, all the target background processes are divided into at least one target background process subset, and a memory recovery method corresponding to each of the target background process subsets is determined;

[0020] According to the memory recovery mode corresponding to each of the target background process subsets, a corresponding memory recovery operation is performed on each of the target background process subsets.

[0021] As an optional implementation, in the first aspect of the present invention, the optimization threshold corresponding to the system resource information of the total memory idle rate category includes a first memory optimization threshold and a second memory optimization threshold;

[0022] According to the relationship between the total memory idle rate category and the optimization threshold corresponding to the system resource information of the total memory idle rate category, all the target background processes are divided into at least one target background process subset, and the memory recovery method corresponding to each target background process subset is determined, including:

[0023] When it is determined that the idle rate of the system resource information of the total memory idle rate category is less than or equal to the first memory optimization threshold and greater than the second memory optimization threshold, all the target background processes are divided into at least one first target background process subset, and a first memory recovery method corresponding to each of the first target background process subsets is determined; wherein the first memory recovery method includes one or more combinations of a Heap-GC recovery method, a File page recovery method, and an anonymous page recovery method;

[0024] When it is determined that the idle rate of the system resource information of the total memory idle rate category is less than or equal to the second memory optimization threshold, all the target background processes are divided into at least one second target background process subset, and a second memory recovery method corresponding to each second target background process subset is determined; wherein the second memory recovery method includes one or more combinations of the Heap-GC recovery method, the File page recovery method, the anonymous page recovery method, and the Swap partition replacement method.

[0025] As an optional implementation, in the first aspect of the present invention, all of the categories include a CPU total utilization category, and the optimization threshold corresponding to the system resource information of the CPU total utilization category includes a first CUP optimization threshold and a second CUP optimization threshold;

[0026] The method of dividing all the target background processes into at least one target background process subset according to the relationship between the system resource information of each category and the optimization threshold corresponding to the system resource information of each category, and performing a corresponding resource optimization operation on each target background process subset includes:

[0027] According to the relationship between the first CUP optimization threshold and the second CUP optimization threshold corresponding to the CPU total utilization category and the system resource information of the CPU total utilization category, all the target background processes are divided into at least one target background process subset, and a priority adjustment method corresponding to each of the target background process subsets is determined;

[0028] According to the priority adjustment mode corresponding to each of the target background process subsets, a corresponding priority adjustment operation is performed on each of the target background process subsets.

[0029] As an optional implementation manner, in the first aspect of the present invention, the scoring operation for all background processes to obtain the scoring values ​​of all the background processes includes:

[0030] Determine the process information of each of the background processes among all the background processes, wherein the process information of each of the background processes includes one or more combinations of the process memory occupancy rate, the process CPU utilization rate, the process survival time, and the process priority of each of the background processes;

[0031] Determine a weight coefficient corresponding to each factor indicator included in the process information of each of the background processes;

[0032] For each of the background processes, weighted calculation is performed on each of the factor indicators in all of the process information and the weight coefficient corresponding to the factor indicator to calculate the score value of each of the background processes.

[0033] As an optional implementation, in the first aspect of the present invention, after performing the resource optimization operation on the target background process according to the relationship between the system resource information of each category and the optimization threshold corresponding to the system resource information of each category, the method further includes:

[0034] Acquire a queue of pending processes of the computer system, wherein the queue of pending processes is used to represent processes to be executed within a second preset time range from a current moment;

[0035] Determine whether there is a target to-be-executed process in the to-be-executed process queue that is associated with the target background process on which the resource optimization operation has been executed;

[0036] When the judgment result is yes, obtaining the target system resource information optimized by the target background process during the resource optimization operation;

[0037] A resource recovery operation is performed on the target system resource information.

[0038] A second aspect of the present invention discloses a process resource optimization device for a computer system, the device comprising:

[0039] A first judgment module, used to judge whether the computer system meets the determined process resource optimization condition;

[0040] A first acquisition module, configured to acquire system resource information of the computer system when the first determination module determines that the computer system meets the process resource optimization condition, wherein the system resource information includes at least one category of system resource information;

[0041] The resource optimization module is used to perform resource optimization operations on the target background process according to the relationship between each category of system resource information and the optimization threshold corresponding to each category of system resource information.

[0042] As an optional implementation manner, in the second aspect of the present invention, the first determination module is specifically configured to:

[0043] Determine whether the computer system is in an idle state, and when it is determined that the computer system is in the idle state, determine that the computer system meets the determined process resource optimization condition; wherein the idle state includes one or more combinations of screen off, standby, hibernation, when the interval between the current moment and the last refresh end moment is greater than or equal to a first preset time threshold, the service process for driving the display in the computer system has no refresh operation, the CPU utilization rate of the computer system is lower than a preset threshold, and the foreground process of the computer system is an Idle process; and / or,

[0044] Determine whether the computer system has a scene switching operation. When it is determined that the computer system has the scene switching operation, determine that the computer system meets the determined process resource optimization conditions; wherein the scene switching operation includes any one of a foreground and background process switching operation and a new process startup operation.

[0045] As an optional implementation, in the second aspect of the present invention, the resource optimization module includes:

[0046] The scoring submodule is used to score all background processes and obtain the scoring values ​​of all the background processes;

[0047] A screening submodule, used for screening out all target background processes from all the background processes according to the scoring values ​​of all the background processes, wherein all the target background processes are background processes for which resource optimization operations need to be performed;

[0048] The resource optimization submodule is used to divide all the target background processes into at least one target background process subset according to the relationship between the system resource information of each category and the optimization threshold corresponding to the system resource information of each category, and perform corresponding resource optimization operations on each target background process subset.

[0049] As an optional implementation, in the second aspect of the present invention, all the categories include a total memory idle rate category; the resource optimization submodule is specifically used to:

[0050] According to the relationship between the total memory idle rate category and the optimization threshold corresponding to the system resource information of the total memory idle rate category, all the target background processes are divided into at least one target background process subset, and a memory recovery method corresponding to each of the target background process subsets is determined;

[0051] According to the memory recovery mode corresponding to each of the target background process subsets, a corresponding memory recovery operation is performed on each of the target background process subsets.

[0052] As an optional implementation, in the second aspect of the present invention, the optimization threshold corresponding to the system resource information of the total memory idle rate category includes a first memory optimization threshold and a second memory optimization threshold; the resource optimization submodule divides all the target background processes into at least one target background process subset according to the relationship between the total memory idle rate category and the optimization threshold corresponding to the system resource information of the total memory idle rate category, and determines the specific method of the memory recovery method corresponding to each of the target background process subsets as follows:

[0053] When it is determined that the idle rate of the system resource information of the total memory idle rate category is less than or equal to the first memory optimization threshold and greater than the second memory optimization threshold, all the target background processes are divided into at least one first target background process subset, and a first memory recovery method corresponding to each of the first target background process subsets is determined; wherein the first memory recovery method includes one or more combinations of a Heap-GC recovery method, a File page recovery method, and an anonymous page recovery method;

[0054] When it is determined that the idle rate of the system resource information of the total memory idle rate category is less than or equal to the second memory optimization threshold, all the target background processes are divided into at least one second target background process subset, and a second memory recovery method corresponding to each second target background process subset is determined; wherein the second memory recovery method includes one or more combinations of the Heap-GC recovery method, the File page recovery method, the anonymous page recovery method, and the Swap partition replacement method.

[0055] As an optional implementation, in the second aspect of the present invention, all of the categories include a CPU total utilization category, and the optimization threshold corresponding to the system resource information of the CPU total utilization category includes a first CUP optimization threshold and a second CUP optimization threshold; the resource optimization submodule is specifically used to:

[0056] According to the relationship between the first CUP optimization threshold and the second CUP optimization threshold corresponding to the CPU total utilization category and the system resource information of the CPU total utilization category, all the target background processes are divided into at least one target background process subset, and a priority adjustment method corresponding to each of the target background process subsets is determined;

[0057] According to the priority adjustment mode corresponding to each of the target background process subsets, a corresponding priority adjustment operation is performed on each of the target background process subsets.

[0058] As an optional implementation, in the second aspect of the present invention, the scoring submodule is specifically used for:

[0059] Determine the process information of each of the background processes among all the background processes, wherein the process information of each of the background processes includes one or more combinations of the process memory occupancy rate, the process CPU utilization rate, the process survival time, and the process priority of each of the background processes;

[0060] Determine a weight coefficient corresponding to each factor indicator included in the process information of each of the background processes;

[0061] For each of the background processes, weighted calculation is performed on each of the factor indicators in all of the process information and the weight coefficient corresponding to the factor indicator to calculate the score value of each of the background processes.

[0062] As an optional implementation, in the second aspect of the present invention, the device further includes:

[0063] A second acquisition module is used to acquire a queue of pending processes of the computer system after the resource optimization module performs a resource optimization operation on the target background process according to the relationship between the system resource information of each category and the optimization threshold corresponding to the system resource information of each category, wherein the queue of pending processes is used to represent processes to be executed within a second preset time range from a current moment;

[0064] A second determination module is used to determine whether there is a target to-be-executed process associated with the target background process on which the resource optimization operation has been executed in the to-be-executed process queue;

[0065] A third acquisition module is used for acquiring target system resource information optimized during the resource optimization operation of the target background process when the judgment result of the second judgment module is yes;

[0066] The resource recovery module is used to perform resource recovery operations on the target system resource information.

[0067] The third aspect of the present invention discloses another process resource optimization device for a computer system, the device comprising:

[0068] A memory storing executable program code;

[0069] a processor coupled to the memory;

[0070] The processor calls the executable program code stored in the memory to execute part or all of the steps in any one of the process resource optimization methods for a computer system disclosed in the first aspect of the present invention.

[0071] The fourth aspect of the present invention discloses a computer storage medium, which stores computer instructions. When the computer instructions are called, they are used to execute some or all of the steps in the process resource optimization method of any computer system disclosed in the first aspect of the present invention.

[0072] Compared with the prior art, the present invention has the following beneficial effects:

[0073] The present invention determines whether the computer system meets the determined process resource optimization conditions; when it is determined that the computer system meets the process resource optimization conditions, the system resource information of the computer system is obtained, and the system resource information includes at least one category of system resource information; according to the relationship between each category of system resource information and the optimization threshold corresponding to each category of system resource information, the resource optimization operation is performed on the target background process. It can be seen that when the present invention identifies that the system meets the process resource optimization conditions, according to the use scenario and load conditions of the system resources, the corresponding resource optimization operation is performed on the background process, and the background process resources are accurately and effectively limited and controlled. It can improve the utilization efficiency of system resources and the user experience without killing the process. BRIEF DESCRIPTION OF THE DRAWINGS

[0074] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0075] Figure 1 It is a flowchart of a method for optimizing process resources of a computer system disclosed in an embodiment of the present invention;

[0076] Figure 2 It is a flowchart of another method for optimizing process resources of a computer system disclosed in an embodiment of the present invention;

[0077] Figure 3 It is a structural diagram of a process resource optimization device for a computer system disclosed in an embodiment of the present invention;

[0078] Figure 4 It is a structural diagram of another device for optimizing process resources of a computer system disclosed in an embodiment of the present invention;

[0079] Figure 5 It is a structural diagram of another device for optimizing process resources of a computer system disclosed in an embodiment of the present invention. DETAILED DESCRIPTION

[0080] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0081] The terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish different objects rather than to describe a specific order. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, device, product or end including a series of steps or units is not limited to the listed steps or units, but may optionally include steps or units that are not listed, or may optionally include other steps or units inherent to these processes, methods, products or ends.

[0082] Reference to "embodiments" herein means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present invention. The appearance of the phrase in various places in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein may be combined with other embodiments.

[0083] The present invention discloses a method and device for optimizing process resources of a computer system. The method and device for optimizing process resources of a computer system can, when identifying that the system meets the process resource optimization conditions, perform corresponding resource optimization operations on background processes according to the usage scenarios and load conditions of system resources, accurately and effectively limit and control background process resources, and improve the utilization efficiency of system resources and the user experience without killing the process.

[0084] Embodiment 1

[0085] See also Figure 1 , Figure 1 1 is a flow chart of a method for optimizing process resources of a computer system disclosed in an embodiment of the present invention. Figure 1 The described method can be applied to a process resource optimization device of a computer system, which can be an independent device (such as a process resource manager) or integrated into a computer system, which is not limited in the embodiments of the present invention. Figure 1 As shown, the process resource optimization method of the computer system may include the following operations:

[0086] 101. Determine whether the computer system meets the determined process resource optimization conditions.

[0087] In the embodiment of the present invention, the computer system may be any system that adopts a multi-process or multi-threaded operation mechanism, such as an Android system, a Linux system, a PC system, etc., and the embodiment of the present invention does not limit this. According to the system resource information of the computer system and the pre-determined process resource optimization conditions, it is determined whether the operation scenario and load condition of the computer system meet the process resource optimization conditions.

[0088] 102. When it is determined that the computer system meets the process resource optimization condition, obtain system resource information of the computer system, where the system resource information includes at least one category of system resource information.

[0089] In an embodiment of the present invention, when it is determined that the computer system meets the above-mentioned predetermined process resource optimization conditions, the resource information of the computer system can be obtained through the resource management service of the computer system. For example, in an Android system, the current memory consumption can be obtained through the Android Framework ActivityManagerService service; a detection callback mechanism is added to the kernel CPU subsystem module, and when a scene switch is detected at the application layer, a detection mechanism is enabled to monitor the CPU utilization. Among them, the system resource information includes at least one category of system resource information, such as memory resources, CPU resources, GPU resources, disk resources, network resources, etc., which is not limited in the embodiment of the present invention. It should be noted that each category of system resource information includes at least one system resource information. For example, for a multi-core system, the CPU resources include the CPU resource information of each core.

[0090] 103. Perform resource optimization operations on the target background process according to the relationship between each category of system resource information and the optimization threshold corresponding to each category of system resource information.

[0091] In the embodiment of the present invention, each category of system resources has a resource optimization threshold corresponding to the system resources of the category, wherein the resource optimization threshold may be one or more, which is not limited by the embodiment of the present invention. Accordingly, each category of system resources also has a resource optimization method corresponding to the system resources of the category. When it is determined that a certain category of system resource information meets the threshold condition of the system resource information of the category, the corresponding resource optimization operation is performed on the background process. At the same time, when multiple categories of system resource information meet their corresponding threshold conditions, multiple corresponding resource optimization operations can be performed on the background process at the same time.

[0092] It can be seen that the method described in the embodiment of the present invention can, when it is identified that the system meets the process resource optimization conditions, perform corresponding resource optimization operations on the background process according to the usage scenarios and load conditions of the system resources, accurately and effectively limit and control the background process resources, and can improve the utilization efficiency of system resources and improve the user experience without killing the process.

[0093] In an optional embodiment, determining whether the computer system meets the determined process resource optimization condition may include the following operations:

[0094] Determine whether the computer system is in an idle state, and when it is determined that the computer system is in an idle state, determine that the computer system meets the determined process resource optimization condition; wherein the idle state includes one or more combinations of screen off, standby, hibernation, when the interval between the current moment and the last refresh end moment is greater than or equal to a first preset time threshold, the service process for driving the display in the computer system has no refresh operation, the CPU utilization rate of the computer system is lower than a preset threshold, and the foreground process of the computer system is an idle process; and / or,

[0095] Determine whether the computer system has a scene switching operation. When it is determined that the computer system has a scene switching operation, determine that the computer system meets the determined process resource optimization conditions; wherein the scene switching operation includes any one of a foreground and background process switching operation and a new process start operation.

[0096] In an embodiment of the present invention, determining whether a computer system meets the process resource optimization conditions can be achieved by determining whether the computer system is in an idle state, and / or determining whether a scene switching operation exists in the computer system. Among them, the idle state of the computer system can be the state after the system performs a Screen off operation, a standby state, a dormant state, monitoring that the interval between the current moment and the last refresh end moment is greater than or equal to a first preset time threshold, the service process used to drive the display in the computer system has no refresh operation (for example, the SurfaceFlinger service has not displayed refresh within a certain period of time), and the process currently being executed by the computer system is an Idle process. One or more combinations of the following. Among them, the scene switching operation can include any one of monitoring that the system has performed a switching operation between the foreground and background processes (for example, the user switches APPs on the mobile phone) and starting a new process operation.

[0097] It can be seen that the method described in the embodiment of the present invention can determine whether the system meets the process resource optimization method through the usage scenarios and load conditions of various system resources, and accurately and effectively limit and control the background process resources according to the usage scenarios and load conditions of the system resources, thereby improving the accuracy and reliability of the prediction of the present invention and improving the utilization efficiency of system resources.

[0098] In another optional embodiment, performing a resource optimization operation on a target background process according to a relationship between each category of system resource information and an optimization threshold corresponding to each category of system resource information may include the following operations:

[0099] Perform scoring operations on all background processes to obtain the scoring values ​​of all background processes;

[0100] According to the score values ​​of all background processes, all target background processes are screened out from all background processes, wherein all target background processes are background processes for which resource optimization operations need to be performed;

[0101] According to the relationship between each category of system resource information and the optimization threshold corresponding to each category of system resource information, all target background processes are divided into at least one target background process subset, and corresponding resource optimization operations are performed on each target background process subset.

[0102] In an embodiment of the present invention, the scoring operation performed on all background processes to obtain the scoring values ​​of all background processes may be performed using the OOM-ADJ scoring mechanism of the native Linux system, or may be performed according to other scoring mechanisms to score all background processes, which is not limited in the embodiment of the present invention. Among them, the scoring value may be a positive value or a negative value, which is not limited in the embodiment of the present invention. After obtaining the scoring values ​​of all background processes, all background processes are sorted according to the size of the scoring values, and the background processes that need to be optimized for resources are selected from the sorting order as the target background processes. Furthermore, according to the relationship between each category of system resource information and the optimization threshold corresponding to each category of system resource information, the target background process is divided into one or more target background process subsets, and the corresponding resource optimization operation is performed on each target background process subset.

[0103] For example, after scoring all background processes, the score values ​​of the five background processes A, B, C, D, and E are 10, 5, -10, 45, and 100, respectively. The background processes with score values ​​greater than 0 are determined as target background processes (A, B, D, E). Furthermore, according to whether the score values ​​are greater than or equal to 50, the target background processes are divided into two target background process subsets: a first subset (A, B, D) and a second subset (E). Memory optimization operations are performed on the background processes in the first subset, and CPU priority adjustment operations are performed on the background processes in the second subset.

[0104] It can be seen that the method described in the embodiment of the present invention can score the background processes, group the background processes, and then perform different resource optimization operations on different groups, thereby improving the refinement of resource optimization, which is beneficial to improving the level of intelligent optimization of system resources and further improving the utilization efficiency of system resources.

[0105] In yet another optional embodiment, according to the relationship between each category of system resource information and the optimization threshold corresponding to each category of system resource information, all target background processes are divided into at least one target background process subset, and corresponding resource optimization operations are performed on each target background process subset, which may include the following operations:

[0106] When all categories include a total memory idle rate category, according to the relationship between the total memory idle rate category and the optimization threshold corresponding to the system resource information of the total memory idle rate category, all target background processes are divided into at least one target background process subset, and a memory recovery method corresponding to each target background process subset is determined;

[0107] According to the memory recovery mode corresponding to each target background process subset, a corresponding memory recovery operation is performed on each target background process subset.

[0108] In the embodiment of the present invention, considering that the recovery costs of different types of memory recovery objects are different, and the memory recovery ratios corresponding to different memory allocation times are different, when all categories of system resource information include the total memory idle rate category, all target background processes can be divided into at least one target background process subset according to the relationship between the total memory idle rate and the optimization threshold corresponding to the total memory idle rate, and the memory recovery method corresponding to each target background process subset is determined. Then, according to the memory recovery method corresponding to each target background process subset, the corresponding memory recovery operation is performed on each target background process.

[0109] For example, the score values ​​of the five background processes A, B, C, D, and E are 10, 5, -10, 45, and 100 respectively. The background processes with score values ​​greater than 0 are determined as target background processes (A, B, D, and E). Then, according to whether the score value is greater than or equal to 50, the target background processes are divided into two target background process subsets: the first subset (A, B, D) and the second subset (E). If the score value of the first subset is lower, the memory recovery method of the first subset is to recover the file page memory. If the score value of the second subset is higher, the memory recovery method of the second subset is to recover the file page memory and recover the anonymous page memory.

[0110] It can be seen that the method described in the embodiment of the present invention can specify different memory recovery methods for different background processes according to the relationship between the total memory utilization and the corresponding threshold, and immediately recycle the specified type of memory, which is beneficial to protect the specified type of memory to avoid the specified type of memory being recycled prematurely, and at the same time improves the flexibility of the memory recovery process, further improving the utilization efficiency of system resources.

[0111] In this optional embodiment, further, according to the relationship between the total memory idle rate category and the optimization threshold corresponding to the system resource information of the total memory idle rate category, all target background processes are divided into at least one target background process subset, and the memory recovery method corresponding to each target background process subset is determined, which may include the following operations:

[0112] Among them, the optimization thresholds corresponding to the system resource information of the total memory idle rate category include a first memory optimization threshold and a second memory optimization threshold; when it is determined that the idle rate of the system resource information of the total memory idle rate category is less than or equal to the first memory optimization threshold and greater than the second memory optimization threshold, all target background processes are divided into at least one first target background process subset, and a first memory recovery method corresponding to each first target background process subset is determined; wherein the first memory recovery method includes one or more combinations of a Heap-GC recovery method, a File page recovery method, and an anonymous page recovery method;

[0113] When it is determined that the idle rate of the system resource information of the total memory idle rate category is less than or equal to the second memory optimization threshold, all target background processes are divided into at least one second target background process subset, and a second memory recovery method corresponding to each second target background process subset is determined; wherein the second memory recovery method includes one or more combinations of a Heap-GC recovery method, a File page recovery method, an anonymous page recovery method, and a Swap partition replacement method.

[0114] In an embodiment of the present invention, a hierarchical cumulative method is adopted for memory recovery of background processes based on the score value of the background process, a weak recovery threshold (i.e., the total memory idle rate exceeds the above-mentioned first memory optimization threshold but does not exceed the above-mentioned second memory optimization threshold) and a strong recovery threshold (i.e., the total memory idle rate exceeds the above-mentioned second memory optimization threshold).

[0115] For example, for the background process subset with a score value between 0 and 300, if the weak recovery threshold is reached, the Heap-GC recovery mode is triggered; if the strong recovery threshold is reached, one or more combinations of the Heap-GC recovery mode and the File page recovery mode are triggered; for the background process subset with a score value between 300 and 600, if the weak recovery threshold is reached, one or more combinations of the Heap-GC recovery mode and the File page recovery mode are triggered; if the strong recovery threshold is reached, one or more combinations of the Heap-GC recovery mode, the File page recovery mode, and the anonymous page recovery mode are triggered; for the background process subset with a score value between 600 and 999, if the weak recovery threshold is reached, one or more combinations of the Heap-GC recovery mode, the File page recovery mode, and the anonymous page recovery mode are triggered; if the strong recovery threshold is reached, one or more combinations of the Heap-GC recovery mode, the File page recovery mode, the anonymous page recovery mode, and the Swap partition replacement mode are triggered.

[0116] Furthermore, it should be noted that the above-mentioned total memory idle rate can refer to the total idle rate of the system's physical memory, or it can refer to the total memory idle benchmark rate after determination. For example, after each startup, the ratio of the Free+Cached margin of the memory to the total memory is taken as the total memory idle benchmark value, and weak recycling (for example, benchmark value * 80%) and strong recycling (for example, benchmark value * 40%) are defined as trigger thresholds. At the same time, for different products, the benchmark levels of weak recycling and strong recycling can be preset with different benchmark coefficient values, such as: tablet computer 1.0, car system 0.8, TV box 0.6, etc., which are not limited in the embodiments of the present invention.

[0117] It can be seen that the method described in the embodiment of the present invention can specify different memory recovery methods for different background processes according to the relationship between the total memory utilization and the corresponding threshold, provide diversified memory recovery methods, and perform differentiated treatment on different background processes, thereby improving the flexibility and adaptability of memory recovery and further improving the utilization efficiency of system resources; at the same time, according to the differences in product form and usage process, the strong and weak thresholds of memory recovery are automatically corrected to improve the compatibility and reliability of the present invention.

[0118] In yet another optional embodiment, according to the relationship between each category of system resource information and the optimization threshold corresponding to each category of system resource information, all target background processes are divided into at least one target background process subset, and corresponding resource optimization operations are performed on each target background process subset, which may also include the following operations:

[0119] When all categories include a total CPU utilization category, and the optimization threshold corresponding to the system resource information of the total CPU utilization category includes a first CUP optimization threshold and a second CUP optimization threshold, according to a relationship between the total CPU utilization category and the first CUP optimization threshold and the second CUP optimization threshold corresponding to the system resource information of the total CPU utilization category, all target background processes are divided into at least one target background process subset, and a priority adjustment method corresponding to each target background process subset is determined;

[0120] According to the priority adjustment mode corresponding to each target background process subset, a corresponding priority adjustment operation is performed on each target background process subset.

[0121] In an embodiment of the present invention, when all categories of system resource information include a total CPU utilization category, all target background processes can be divided into at least one target background process subset based on the relationship between the total CPU utilization and the optimization threshold corresponding to the total CPU utilization, and the priority adjustment method corresponding to each target background process subset can be determined. Furthermore, according to the priority adjustment method corresponding to each target background process subset, a corresponding priority adjustment operation is performed on each target background process. Among them, the optimization threshold corresponding to the total CPU utilization includes a first CUP optimization threshold and a second CUP optimization threshold, that is, there is a weak restriction threshold (that is, the total CPU utilization exceeds the above-mentioned first CUP optimization threshold, but does not exceed the above-mentioned second CUP optimization threshold) and a strong restriction threshold (that is, the total CPU utilization exceeds the above-mentioned second CUP optimization threshold).

[0122] For example, for the background process subset with a score value between 50-500, if the weak limit threshold is reached, the trigger will adjust the priority Nice value of the process in the background process subset to 10, and if the strong limit threshold is reached, the trigger will adjust the priority Nice value of the process in the background process subset to 15; for the background process subset with a score value between 500-999, if the weak limit threshold is reached, the trigger will adjust the priority Nice value of the process in the background process subset to 15, and if the strong limit threshold is reached, the trigger will adjust the priority Nice value of the process in the background process subset to 20.

[0123] It should be noted that in the present invention, for the same background process, only the process memory optimization operation can be performed, or only the process priority adjustment operation can be performed, or both the process memory optimization operation and the priority adjustment operation can be performed at the same time, and the embodiments of the present invention are not limited thereto.

[0124] It can be seen that the method described in the embodiment of the present invention can specify different priority adjustment methods for different background processes according to the relationship between the total CPU utilization and the corresponding threshold, provide diversified priority adjustment methods, and perform differentiated treatment on different background processes, thereby improving the flexibility and adaptability of priority adjustment, and further improving the utilization efficiency of system resources; at the same time, combined with the characteristics of a scene that is prone to experience deficiencies after an actual scene switch, the system resources occupied by background processes are accurately and effectively limited.

[0125] In yet another optional embodiment, performing a scoring operation on all background processes to obtain the scoring values ​​of all background processes may include the following operations:

[0126] Determine process information of each background process among all background processes, where the process information of each background process includes one or more combinations of process memory occupancy, process CPU utilization, process survival time, and process priority of each background process;

[0127] Determine the weight coefficient corresponding to each factor indicator included in the process information of each background process;

[0128] For each background process, a weighted calculation is performed on each background process according to each factor indicator in all process information and the weight coefficient corresponding to the factor indicator to calculate the score value of each background process.

[0129] In an embodiment of the present invention, the process information of each background process is obtained, wherein the process information may include one or more combinations of the process memory occupancy rate, process CPU utilization rate, process survival time, and process priority of each background process. After the process information is determined, the content in the process information is used as a scoring factor indicator, and the weight coefficient corresponding to each factor indicator is determined at the same time. For each background process, a weighted calculation is performed on each background process according to the process information of the process and the weight coefficient corresponding to each factor indicator, and the score value of each background process can be calculated.

[0130] It can be seen that the method described in the embodiment of the present invention can accurately calculate the score value of the background process through weighted calculation based on the real-time process information of the background process and the weight coefficient of the factor indicator in the process information, which is conducive to the accurate division of the background process, and is conducive to the accurate optimization operation of each background process, thereby further improving the utilization efficiency of system resources.

[0131] Embodiment 2

[0132] See also Figure 2 , Figure 2 1 is a flow chart of another process resource optimization of a computer system disclosed in an embodiment of the present invention. Figure 2The described method can be applied to a process resource optimization device of a computer system, which can be an independent device (such as a process resource manager) or integrated into a computer system, which is not limited in the embodiments of the present invention. Figure 2 As shown, the process resource optimization method of the computer system may include the following operations:

[0133] 201. Determine whether the computer system meets the determined process resource optimization conditions.

[0134] 202. When it is determined that the computer system meets the process resource optimization condition, obtain system resource information of the computer system, where the system resource information includes at least one category of system resource information.

[0135] 203. Perform resource optimization operations on the target background process according to the relationship between each category of system resource information and the optimization threshold corresponding to each category of system resource information.

[0136] In the embodiment of the present invention, for other descriptions of step 201 to step 203, please refer to the detailed description of step 101 to step 103 in embodiment 1 respectively, and the embodiment of the present invention will not be repeated here.

[0137] 204. Obtain a queue of pending processes of the computer system; the queue of pending processes is used to represent processes to be executed within a second preset time range from the current moment.

[0138] In the embodiment of the present invention, the to-be-executed process queue of the computer system is used to represent the processes to be executed within a preset duration (i.e., the second preset duration) from the current moment. For example, the processes to be executed within 10 seconds from the current moment.

[0139] 205. Determine whether there is a target to-be-executed process in the to-be-executed process queue that is associated with the target background process on which the resource optimization operation has been performed.

[0140] In an embodiment of the present invention, after obtaining the queue of processes to be executed of the computer system, it is determined whether there is a process associated with the target background process on which the above-mentioned resource optimization operation has been executed among all the processes in the queue of processes to be executed. For example, starting from the current moment, the background processes to be executed within 10 seconds are A, B, and C, among which the parent process D of process A belongs to the target background process on which the above-mentioned resource optimization operation has been executed, and process A is determined as the target process to be executed.

[0141] 206. When the judgment result is yes, obtain the target system resource information optimized during the resource optimization operation of the target background process.

[0142] In an embodiment of the present invention, when the judgment result is yes, the system resource information optimized by the target background process during the execution of the above-mentioned resource optimization operation is obtained. For example, the parent process D of the A process belongs to the target background process on which the above-mentioned resource optimization operation has been executed. During the resource optimization process, the File memory page of the D process is recycled. Then, the recycled File memory page of the D process is the target system resource information.

[0143] 207. Perform resource recovery operations on the target system resource information.

[0144] It can be seen that the method described in the embodiment of the present invention can obtain the target process on which the optimization operation has been executed through the queue of processes to be executed, and then restore the optimized resources of the target process in advance, avoiding reloading when the user switches to the target process, causing freezes or waiting for loading, thereby improving the utilization efficiency of system resources and further improving the user experience.

[0145] Embodiment 3

[0146] See also Figure 3 , Figure 3 1 is a schematic diagram of the structure of a process resource optimization device for a computer system disclosed in an embodiment of the present invention. Figure 3 The described device can be applied to a process resource optimization device of a computer system. The process resource optimization device of the computer system can be an independent device (for example, a process resource manager) or integrated in the computer system, which is not limited in the embodiment of the present invention. It should be noted that the process resource optimization device of the computer system refers to the steps in the process resource optimization method of a computer system described in Embodiment 1 and Embodiment 2, and the detailed description is not repeated in this embodiment. Figure 3 As shown, the process resource optimization device of the computer system may include:

[0147] The first judgment module 301 is used to judge whether the computer system meets the determined process resource optimization condition;

[0148] A first acquisition module 302 is used to acquire system resource information of the computer system when the first determination module 301 determines that the computer system meets the process resource optimization condition, where the system resource information includes at least one category of system resource information;

[0149] The resource optimization module 303 is used to perform resource optimization operations on the target background process according to the relationship between each category of system resource information and the optimization threshold corresponding to each category of system resource information.

[0150] It can be seen that the device described in the embodiment of the present invention can, when it is identified that the system meets the process resource optimization conditions, perform corresponding resource optimization operations on the background process according to the usage scenarios and load conditions of the system resources, accurately and effectively limit and control the background process resources, and can improve the utilization efficiency of system resources and improve the user experience without killing the process.

[0151] In an optional embodiment, if Figure 4 As shown, the first judgment module 301 is specifically used for:

[0152] Determine whether the computer system is in an idle state, and when it is determined that the computer system is in an idle state, determine that the computer system meets the determined process resource optimization condition; wherein the idle state includes one or more combinations of screen off, standby, hibernation, when the interval between the current moment and the last refresh end moment is greater than or equal to a first preset time threshold, the service process for driving the display in the computer system has no refresh operation, the CPU utilization rate of the computer system is lower than a preset threshold, and the foreground process of the computer system is an idle process; and / or,

[0153] Determine whether the computer system has a scene switching operation. When it is determined that the computer system has a scene switching operation, determine that the computer system meets the determined process resource optimization conditions; wherein the scene switching operation includes any one of a foreground and background process switching operation and a new process start operation.

[0154] It can be seen that the device described in the embodiment of the present invention can determine whether the system meets the process resource optimization method through the usage scenarios and load conditions of various system resources, and accurately and effectively limit and control the background process resources according to the usage scenarios and load conditions of the system resources, thereby improving the accuracy and reliability of the prediction of the present invention and improving the utilization efficiency of system resources.

[0155] In another optional embodiment, Figure 4 As shown, the resource optimization module 303 may include:

[0156] The scoring submodule 3031 is used to score all background processes and obtain the scoring values ​​of all background processes;

[0157] The screening submodule 3032 is used to screen out all target background processes from all background processes according to the score values ​​of the background processes, wherein all target background processes are background processes for which resource optimization operations need to be performed;

[0158] The resource optimization submodule 3033 is used to divide all target background processes into at least one target background process subset according to the relationship between each category of system resource information and the optimization threshold corresponding to each category of system resource information, and perform corresponding resource optimization operations on each target background process subset.

[0159] It can be seen that the device described in the embodiment of the present invention can score the background processes, group the background processes, and then perform different resource optimization operations on different groups, thereby improving the refinement of resource optimization, which is beneficial to improving the level of intelligent optimization of system resources and further improving the utilization efficiency of system resources.

[0160] In yet another optional embodiment, Figure 4 As shown, when all categories include the total memory idle rate category, the resource optimization submodule 3033 is specifically used to:

[0161] According to the relationship between the total memory idle rate category and the optimization threshold corresponding to the system resource information of the total memory idle rate category, all target background processes are divided into at least one target background process subset, and the memory recovery method corresponding to each target background process subset is determined;

[0162] According to the memory recovery mode corresponding to each target background process subset, a corresponding memory recovery operation is performed on each target background process subset.

[0163] It can be seen that the device described in the embodiment of the present invention can specify different memory recovery methods for different background processes according to the relationship between the total memory utilization and the corresponding threshold, and immediately recycle the specified type of memory, which is beneficial to protect the specified type of memory to avoid the specified type of memory being recycled prematurely, and at the same time improves the flexibility of the memory recovery process and further improves the utilization efficiency of system resources.

[0164] In this optional embodiment, if Figure 4 As shown, when the optimization threshold corresponding to the system resource information of the total memory idle rate category includes the first memory optimization threshold and the second memory optimization threshold; the resource optimization submodule 3033 divides all target background processes into at least one target background process subset according to the relationship between the total memory idle rate category and the optimization threshold corresponding to the system resource information of the total memory idle rate category, and determines the specific method of the memory recovery method corresponding to each target background process subset as follows:

[0165] When it is determined that the idle rate of the system resource information of the total memory idle rate category is less than or equal to the first memory optimization threshold and greater than the second memory optimization threshold, all target background processes are divided into at least one first target background process subset, and a first memory recovery method corresponding to each first target background process subset is determined; wherein the first memory recovery method includes one or more combinations of a Heap-GC recovery method, a File page recovery method, and an anonymous page recovery method;

[0166] When it is determined that the idle rate of the system resource information of the total memory idle rate category is less than or equal to the second memory optimization threshold, all target background processes are divided into at least one second target background process subset, and a second memory recovery method corresponding to each second target background process subset is determined; wherein the second memory recovery method includes one or more combinations of a Heap-GC recovery method, a File page recovery method, an anonymous page recovery method, and a Swap partition replacement method.

[0167] It can be seen that the device described in the embodiment of the present invention can specify different memory recovery methods for different background processes according to the relationship between the total memory utilization and the corresponding threshold, provide diversified memory recovery methods, and perform differentiated treatment on different background processes, thereby improving the flexibility and adaptability of memory recovery and further improving the utilization efficiency of system resources; at the same time, according to the differences in product form and usage process, the strong and weak thresholds of memory recovery are automatically corrected to improve the compatibility and reliability of the present invention.

[0168] In yet another optional embodiment, Figure 4 As shown, when all categories include the total CPU utilization category, and the optimization threshold corresponding to the system resource information of the total CPU utilization category includes the first CPU optimization threshold and the second CPU optimization threshold, the resource optimization submodule 3033 is specifically used to:

[0169] According to the relationship between the CPU total utilization category and the first CPU optimization threshold corresponding to the system resource information of the CPU total utilization category and the second CPU optimization threshold, all target background processes are divided into at least one target background process subset, and a priority adjustment method corresponding to each target background process subset is determined;

[0170] According to the priority adjustment mode corresponding to each target background process subset, a corresponding priority adjustment operation is performed on each target background process subset.

[0171] It can be seen that the device described in the embodiment of the present invention can specify different priority adjustment methods for different background processes according to the relationship between the total CPU utilization and the corresponding threshold, provide diversified priority adjustment methods, and perform differentiated treatment on different background processes, thereby improving the flexibility and adaptability of priority adjustment, and further improving the utilization efficiency of system resources; at the same time, combined with the characteristics of the scene that is prone to insufficient experience after an actual scene switch, the system resources occupied by the background processes are accurately and effectively limited.

[0172] In yet another optional embodiment, Figure 4 As shown, the scoring submodule 3031 is specifically used for:

[0173] Determine process information of each background process among all background processes, where the process information of each background process includes one or more combinations of process memory occupancy, process CPU utilization, process survival time, and process priority of each background process;

[0174] Determine the weight coefficient corresponding to each factor indicator included in the process information of each background process;

[0175] For each background process, a weighted calculation is performed on each background process according to each factor indicator in all process information and the weight coefficient corresponding to the factor indicator to calculate the score value of each background process.

[0176] It can be seen that the device described in the embodiment of the present invention can accurately calculate the score value of the background process through weighted calculation based on the real-time process information of the background process and the weight coefficient of the factor indicator in the process information, which is conducive to the accurate division of the background process and the accurate optimization operation of each background process, thereby further improving the utilization efficiency of system resources.

[0177] In yet another optional embodiment, Figure 4 As shown, the device may also include:

[0178] The second acquisition module 304 is used to acquire a queue of pending processes of the computer system after the resource optimization module 303 performs a resource optimization operation on the target background process according to the relationship between each category of system resource information and the optimization threshold corresponding to each category of system resource information, wherein the queue of pending processes is used to represent processes to be executed within a second preset time range from the current moment;

[0179] The second determination module 305 is used to determine whether there is a target to-be-executed process associated with the target background process on which the resource optimization operation has been executed in the to-be-executed process queue;

[0180] The third acquisition module 306 is used to acquire the target system resource information optimized during the resource optimization operation of the target background process when the judgment result of the second judgment module 305 is yes;

[0181] The resource recovery module 307 is used to perform resource recovery operations on the target system resource information.

[0182] It can be seen that the device described in the embodiment of the present invention can obtain the target process on which the optimization operation has been executed through the queue of processes to be executed, and then restore the optimized resources of the target process in advance, avoiding reloading when the user switches to the target process, causing freezes or waiting for loading, thereby improving the utilization efficiency of system resources and further improving the user experience.

[0183] Embodiment 4

[0184] See also Figure 5 , Figure 5 1 is a schematic diagram of the structure of another device for optimizing process resources of a computer system disclosed in an embodiment of the present invention. Figure 5 The described device can be applied to a process resource optimization device of a computer system, and the process resource optimization device of the computer system can be an independent device (for example, a process resource manager) or integrated into the computer system, which is not limited in the embodiment of the present invention. Figure 5 As shown, the process resource optimization device of the computer system may include:

[0185] A memory 401 storing executable program codes;

[0186] a processor 402 coupled to the memory 401;

[0187] The processor 402 calls the executable program code stored in the memory 401 to execute part or all of the steps in the process resource optimization method of the computer system disclosed in the first or second embodiment of the present invention.

[0188] Embodiment 5

[0189] An embodiment of the present invention discloses a computer storage medium, which stores computer instructions. When the computer instructions are called, they are used to execute the steps in the process resource optimization method of the computer system disclosed in the first or second embodiment of the present invention.

[0190] The device embodiments described above are only illustrative, wherein the modules described as separate components may or may not be physically separated, and the components displayed as modules may or may not be physical modules, i.e., they may be located in one place, or they may be distributed on multiple network modules. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Those of ordinary skill in the art may understand and implement it without creative work.

[0191] Through the specific description of the above embodiments, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware. Based on such an understanding, the above technical solution can be essentially or partly contributed to the prior art in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, and the storage medium includes a read-only memory (ROM), a random access memory (RAM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), a one-time programmable read-only memory (OTPROM), an electronically erasable rewritable read-only memory (EEPROM), a compact disc (CD-ROM) or other optical disc storage, magnetic disk storage, magnetic tape storage, or any other computer-readable medium that can be used to carry or store data.

[0192] Finally, it should be noted that the process resource optimization method and device for a computer system disclosed in the embodiment of the present invention discloses only the preferred embodiments of the present invention, which are only used to illustrate the technical solution of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, it should be understood by those skilled in the art that the technical solutions described in the aforementioned embodiments can still be modified, or some of the technical features therein can be replaced by equivalents. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the various embodiments of the present invention.

Claims

1. A method for optimizing process resources of a computer system, characterized in that: The method comprises: Determining whether the computer system meets the determined process resource optimization condition; When it is determined that the computer system meets the process resource optimization condition, obtaining system resource information of the computer system, the system resource information including at least one category of system resource information; performing resource optimization operations on the target background process according to the relationship between each category of system resource information and the optimization threshold corresponding to each category of system resource information; The performing resource optimization operation on the target background process according to the relationship between each category of system resource information and the optimization threshold corresponding to each category of system resource information includes: Performing a scoring operation on all background processes to obtain scoring values ​​of all the background processes; According to the scoring values ​​of all the background processes, all target background processes are screened out from all the background processes, wherein all the target background processes are background processes for which resource optimization operations need to be performed; According to the relationship between the system resource information of each category and the optimization threshold corresponding to the system resource information of each category, all the target background processes are divided into at least one target background process subset, and a corresponding resource optimization operation is performed on each target background process subset; All of the categories include a total CPU utilization category, and the optimization threshold corresponding to the system resource information of the total CPU utilization category includes a first CPU optimization threshold and a second CPU optimization threshold; The method of dividing all the target background processes into at least one target background process subset according to the relationship between the system resource information of each category and the optimization threshold corresponding to the system resource information of each category, and performing a corresponding resource optimization operation on each target background process subset includes: According to the relationship between the first CUP optimization threshold and the second CUP optimization threshold corresponding to the CPU total utilization category and the system resource information of the CPU total utilization category, all the target background processes are divided into at least one target background process subset, and a priority adjustment method corresponding to each of the target background process subsets is determined; According to the priority adjustment mode corresponding to each of the target background process subsets, performing a corresponding priority adjustment operation on each of the target background process subsets; The scoring operation for all the background processes to obtain the scoring values ​​of all the background processes includes: Determine the process information of each of the background processes among all the background processes, wherein the process information of each of the background processes includes one or more combinations of the process memory occupancy rate, the process CPU utilization rate, the process survival time, and the process priority of each of the background processes; Determine a weight coefficient corresponding to each factor indicator included in the process information of each of the background processes; For each of the background processes, weighted calculation is performed on each of the factor indicators in all of the process information and the weight coefficient corresponding to the factor indicator to calculate the score value of each of the background processes.

2. The process resource optimization method of a computer system according to claim 1, characterized in that: The determining whether the computer system satisfies the determined process resource optimization condition includes: Determine whether the computer system is in an idle state, and when it is determined that the computer system is in the idle state, determine that the computer system meets the determined process resource optimization condition; wherein the idle state includes one or more combinations of screen off, standby, hibernation, when the interval between the current moment and the last refresh end moment is greater than or equal to a first preset time threshold, the service process for driving the display in the computer system has no refresh operation, the CPU utilization rate of the computer system is lower than a preset threshold, and the foreground process of the computer system is an Idle process; and / or, Determine whether the computer system has a scene switching operation. When it is determined that the computer system has the scene switching operation, determine that the computer system meets the determined process resource optimization conditions; wherein the scene switching operation includes any one of a foreground and background process switching operation and a new process startup operation.

3. The process resource optimization method of a computer system according to claim 1, characterized in that: All the mentioned categories include the total memory idleness category; The method of dividing all the target background processes into at least one target background process subset according to the relationship between the system resource information of each category and the optimization threshold corresponding to the system resource information of each category, and performing a corresponding resource optimization operation on each target background process subset includes: According to the relationship between the total memory idle rate category and the optimization threshold corresponding to the system resource information of the total memory idle rate category, all the target background processes are divided into at least one target background process subset, and a memory recovery method corresponding to each of the target background process subsets is determined; According to the memory recovery mode corresponding to each of the target background process subsets, a corresponding memory recovery operation is performed on each of the target background process subsets.

4. The process resource optimization method of a computer system according to claim 3, characterized in that: The optimization threshold corresponding to the system resource information of the total memory idle rate category includes a first memory optimization threshold and a second memory optimization threshold; the relationship between the total memory idle rate category and the optimization threshold corresponding to the system resource information of the total memory idle rate category, dividing all the target background processes into at least one target background process subset, and determining the memory recovery method corresponding to each of the target background process subsets, including: When it is determined that the idle rate of the system resource information of the total memory idle rate category is less than or equal to the first memory optimization threshold and greater than the second memory optimization threshold, all the target background processes are divided into at least one first target background process subset, and a first memory recovery method corresponding to each of the first target background process subsets is determined; wherein the first memory recovery method includes One or more combinations of recycling mode, file page recycling mode, and anonymous page recycling mode; When it is determined that the idle rate of the system resource information of the total memory idle rate category is less than or equal to the second memory optimization threshold, all the target background processes are divided into at least one second target background process subset, and a second memory recovery method corresponding to each second target background process subset is determined; wherein the second memory recovery method includes the The recycling method, the File page recycling method, the anonymous page recycling method and the Swap partition replacement method are selected from one or more combinations thereof.

5. The process resource optimization method of a computer system according to claim 1, characterized in that: After performing resource optimization operations on the target background process according to the relationship between the system resource information of each category and the optimization threshold corresponding to the system resource information of each category, the method further includes: Acquire a queue of pending processes of the computer system, wherein the queue of pending processes is used to represent processes to be executed within a second preset time range from a current moment; Determine whether there is a target to-be-executed process in the to-be-executed process queue that is associated with the target background process on which the resource optimization operation has been executed; When the judgment result is yes, obtaining the target system resource information optimized during the resource optimization operation of the target background process; A resource recovery operation is performed on the target system resource information.

6. A process resource optimization device for a computer system, characterized in that: The device comprises: A first judgment module, used to judge whether the computer system meets the determined process resource optimization condition; A first acquisition module, configured to acquire system resource information of the computer system when the first determination module determines that the computer system meets the process resource optimization condition, wherein the system resource information includes at least one category of system resource information; A resource optimization module, configured to perform resource optimization operations on a target background process according to a relationship between each category of system resource information and an optimization threshold value corresponding to each category of system resource information; The resource optimization module includes: The scoring submodule is used to score all background processes and obtain the scoring values ​​of all the background processes; A screening submodule, used for screening out all target background processes from all the background processes according to the scoring values ​​of all the background processes, wherein all the target background processes are background processes for which resource optimization operations need to be performed; A resource optimization submodule, configured to divide all the target background processes into at least one target background process subset according to the relationship between the system resource information of each category and the optimization threshold corresponding to the system resource information of each category, and perform a corresponding resource optimization operation on each target background process subset; All the categories include a total CPU utilization category, and the optimization threshold corresponding to the system resource information of the total CPU utilization category includes a first CPU optimization threshold and a second CPU optimization threshold; the resource optimization submodule is specifically used to: According to the relationship between the first CUP optimization threshold and the second CUP optimization threshold corresponding to the CPU total utilization category and the system resource information of the CPU total utilization category, all the target background processes are divided into at least one target background process subset, and a priority adjustment method corresponding to each of the target background process subsets is determined; According to the priority adjustment mode corresponding to each of the target background process subsets, performing a corresponding priority adjustment operation on each of the target background process subsets; The scoring submodule is specifically used for: Determine the process information of each of the background processes among all the background processes, wherein the process information of each of the background processes includes one or more combinations of the process memory occupancy rate, the process CPU utilization rate, the process survival time, and the process priority of each of the background processes; Determine a weight coefficient corresponding to each factor indicator included in the process information of each of the background processes; For each of the background processes, weighted calculation is performed on each of the factor indicators in all of the process information and the weight coefficient corresponding to the factor indicator to calculate the score value of each of the background processes.

7. A process resource optimization device for a computer system, characterized in that: The device includes: a memory storing executable program code; a processor coupled to the memory; The processor calls the executable program code stored in the memory to execute the process resource optimization method of the computer system according to any one of claims 1 to 5.