Tool process resource limiting method and device, equipment and storage medium

By setting global and individual resource limits for tool processes and dynamically adjusting them based on historical consumption data, the problem of resource consumption due to tool process failures is solved, ensuring the stable operation of application processes.

CN121858283APending Publication Date: 2026-04-14INDUSTRIAL AND COMMERCIAL BANK OF CHINA
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-12-26
Publication Date
2026-04-14

AI Technical Summary

Technical Problem

When a tool process malfunctions, it may consume a large amount of resources, which can adversely affect the application process. Existing technologies lack effective means of resource monitoring.

Method used

By acquiring the global resource limit and historical resource consumption data of the tool process, a separate resource limit is allocated to each tool process, and the actual resource consumption is monitored in real time to dynamically adjust the resource limit to prevent the tool process from consuming too many resources.

Benefits of technology

It effectively prevents tool processes from consuming excessive resources during malfunctions, protects the normal operation of application processes, and improves the accuracy and stability of system resource allocation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121858283A_ABST
    Figure CN121858283A_ABST
Patent Text Reader

Abstract

The invention relates to the field of financial science and technology, in particular to a tool process resource limiting method and device, equipment and a storage medium, and the method comprises the steps that in response to a system process being a tool process, a global resource upper limit configured for the tool process is acquired; according to historical resource consumption data of each tool process and the global resource upper limit, allocating a single process resource upper limit to each tool process; and during the running period of the tool process, collecting actual single-process resources in real time, and performing dynamic resource limitation on the tool process according to the actual single-process resources and the single-process resource upper limit. The method and the device are convenient for preventing adverse effects on the application process when the tool process has a fault.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of financial technology, and in particular to a method, apparatus, device and storage medium for limiting tool process resources. Background Technology

[0002] When a computer or server's operating system performs business processing, it generates corresponding system processes, such as tool processes or application processes. Tool processes provide support, management, and service functions for the operating system, other processes, or system administrators, such as log collection processes, monitoring collection processes, link collection processes, and heartbeat message uploading processes. Application processes directly serve the user's goals and execute specific tasks explicitly initiated by the user, such as web browsing processes and video playback processes.

[0003] Both tool processes and application processes consume certain resources during operation, such as CPU utilization, memory usage, and I / O read / write speed. Currently, the resource monitoring capabilities built by tool processes have blind spots, which may cause tool processes to consume a large amount of resources when they malfunction, thus adversely affecting application processes. Summary of the Invention

[0004] To prevent tool processes from adversely affecting application processes when they malfunction, this application provides a method, apparatus, device, and storage medium for limiting tool process resources.

[0005] Firstly, this application provides a method for limiting tool process resources, including:

[0006] In response to the system process being a tool process, obtain the global resource limit configured for the tool process;

[0007] Based on the historical resource consumption data of each tool process and the global resource limit, allocate a single-process resource limit to each tool process;

[0008] During the execution of the tool process, the actual single-process resources are collected in real time, and the tool process is dynamically restricted in terms of resources based on the actual single-process resources and the single-process resource limit.

[0009] Through the above implementation, after configuring the global resource limit, the single-process resource limit allocated to each tool process is determined by using historical resource consumption data. This single-process resource limit can restrict the actual single-process resources consumed by the tool process during runtime from not exceeding the corresponding single-process resource limit. In this way, even if the tool process fails, it cannot occupy a large amount of actual single-process resources, thereby preventing the tool process from crowding out the application process's process resources and thus preventing the tool process from causing adverse effects on the application process when it fails.

[0010] Preferably, the step of allocating a single-process resource limit to each tool process based on its historical resource consumption data and the global resource limit includes:

[0011] The total number of processes of each tool process is counted, and the initial process resource limit of each tool process is determined based on the global resource limit and the total number of processes.

[0012] Based on the historical resource consumption data of each tool process, the resource demand pattern of the tool process is determined, and the initial process resource limit is adjusted according to the resource demand pattern to obtain the single-process resource limit allocated to the tool process.

[0013] By implementing the above methods and using the resource demand patterns determined by historical resource consumption data, the initial process resource limit initially allocated to the tool process can be adjusted, thereby improving the accuracy of the final determined single-process resource limit.

[0014] Preferably, based on the historical resource consumption data of each tool process, the resource demand pattern of the tool process is determined, and the initial process resource limit is adjusted according to the resource demand pattern to obtain the single-process resource limit allocated to the tool process, including:

[0015] Obtain the historical resource consumption of the tool process, wherein the historical resource consumption includes one of historical CPU utilization, historical memory usage, or historical I / O read / write rate;

[0016] Statistical feature values ​​are generated by statistically analyzing the historical resource consumption.

[0017] Based on preset statistical feature thresholds and the statistical feature values, the resource requirement mode of the tool process is determined from the balanced mode and the high-frequency mode.

[0018] Based on the rules associated with the resource demand pattern, the historical resource consumption is processed to generate a correction coefficient;

[0019] The initial process resource limit is corrected using the correction coefficient to obtain the single-process resource limit of the tool process.

[0020] Through the above implementation, the actual resource demand pattern is determined based on the statistical characteristics of historical resource consumption. Then, the correction coefficient obtained by processing historical resource consumption through the rules associated with this pattern is used to correct the initial process resource limit. Since the actual resource demand pattern can reflect the real resource consumption of the tool process in the most recent period of its history, correcting the initial process resource limit with the correction coefficient obtained from the actual resource demand pattern can improve the accuracy of the obtained single process resource limit.

[0021] Preferably, determining the resource requirement pattern of the tool process from the balanced mode and the high-frequency mode based on the preset statistical feature threshold and the statistical feature value includes:

[0022] If the statistical characteristic value is the standard deviation, and the standard deviation is less than the preset statistical characteristic threshold, then the balanced mode will be used as the resource demand mode.

[0023] Otherwise, the high-frequency pattern will be used as the resource demand pattern.

[0024] Through the above implementation, if the standard deviation is less than the preset statistical characteristic threshold, it indicates that the historical resource consumption data of the tool process is relatively concentrated in terms of the data size. In this case, it is recommended that the balanced mode with the correction coefficient set as the mean of the historical resource consumption data is more suitable as the resource demand mode. If the standard deviation is not less than the preset statistical characteristic threshold, it indicates that the historical resource consumption data of the tool process is relatively dispersed in terms of the data size. In this case, it is recommended that the high-frequency mode with the correction coefficient set as the mode of the historical resource consumption data is more suitable as the resource demand mode. In this way, it is easier to improve the accuracy of the determined actual resource demand mode through the standard deviation.

[0025] Preferably, before obtaining the global resource limit configured for the tool process in response to the system process being a tool process, the method further includes:

[0026] Determine whether the system process was started by the system service manager;

[0027] If so, determine whether the system process is run by a system user to determine whether the system process is a utility process.

[0028] By implementing the above methods, the system process can be identified by whether it is started by the system service manager and whether it is run by a system user, thereby improving the accuracy of determining whether a system process is a tool process.

[0029] Preferably, the method further includes:

[0030] In response to the fact that the actual resource consumption of the tool process reaches the corresponding single-process resource limit, the proportion of the resource consumption reaching the limit in the actual consumption is calculated.

[0031] The total number of tool processes whose proportion exceeds a preset proportion threshold is calculated.

[0032] In response to the total number of processes exceeding the threshold being greater than a preset total number of processes threshold, the global resource limit is adjusted based on a preset adjustment coefficient.

[0033] By implementing the above method, the total number of processes exceeding the threshold is counted, and when the total number of processes exceeding the threshold is greater than the preset total number of processes threshold, the global resource limit is adjusted. This makes it easier to improve the matching degree between the global resource limit and the actual resource consumption of the current tool process.

[0034] Secondly, this application provides a tool process resource limiting device, comprising:

[0035] The upper limit acquisition module is used to acquire the global resource upper limit configured for the tool process in response to the system process being a tool process;

[0036] The upper limit allocation module is used to allocate a single-process resource limit to each of the tool processes based on the historical resource consumption data of each tool process and the global resource limit.

[0037] The resource limiting module is used to collect the actual single-process resources in real time during the operation of the tool process, and to dynamically limit the resources of the tool process based on the actual single-process resources and the single-process resource limit.

[0038] Through the above implementation, after configuring the global resource limit, the single-process resource limit allocated to each tool process is determined by using historical resource consumption data. This single-process resource limit can restrict the actual single-process resources consumed by the tool process during runtime from not exceeding the corresponding single-process resource limit. In this way, even if the tool process fails, it cannot occupy a large amount of actual single-process resources, thereby preventing the tool process from crowding out the application process's process resources and thus preventing the tool process from causing adverse effects on the application process when it fails.

[0039] Thirdly, this application provides a computer device, which includes a memory and a processor. The memory stores a computer program, and the processor executes the computer program to implement the steps in the method described above.

[0040] Fourthly, this application provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps in the above-described method.

[0041] Fifthly, this application also provides a computer program product. The computer program product includes a computer program that, when executed by a processor, implements the steps in any of the above method embodiments.

[0042] The aforementioned method, apparatus, device, and storage medium for limiting tool process resources obtain a global resource limit configured for the tool process in response to a system process; allocate a single-process resource limit for each tool process based on historical resource consumption data and the global resource limit; and dynamically limit the tool process's resources based on the actual single-process resources and the single-process resource limit during its operation. Through this implementation, after configuring the global resource limit, a single-process resource limit is determined for each tool process using historical resource consumption data. This single-process resource limit restricts the actual single-process resources consumed by the tool process during operation from exceeding the corresponding single-process resource limit. Thus, even if a tool process malfunctions, it cannot occupy a large amount of actual single-process resources, preventing the tool process from consuming application process resources and thus mitigating the adverse effects of tool process malfunctions on the application process.

[0043] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of this application, nor is it intended to limit the scope of this application. Other features of this application will become readily apparent from the following description. Attached Figure Description

[0044] To more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings used in the embodiments will be briefly introduced below. It should be understood that the following drawings only show some embodiments of the present invention and should not be regarded as a limitation on the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.

[0045] Figure 1 This is a flowchart of a tool process resource limitation method provided in the embodiments of this application;

[0046] Figure 2 This is a flowchart of another tool process resource limiting method provided in the embodiments of this application;

[0047] Figure 3 This is a flowchart of another tool process resource limitation method provided in the embodiments of this application;

[0048] Figure 4 This is a schematic diagram of the structure of a tool process resource limiting device provided in the embodiments of this application;

[0049] Figure 5 This is a schematic diagram of the structure of a computer device provided in an embodiment of this application;

[0050] Figure 6This is an internal structural diagram of a computer-readable storage medium provided in an embodiment of this application. Detailed Implementation

[0051] To make the objectives, technical solutions, and advantages of this disclosure clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this disclosure.

[0052] It should be noted that the terms "first," "second," etc., used in the specification, claims, and accompanying drawings herein are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, apparatus, product, or device that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or devices.

[0053] In this article, the term "and / or" is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A alone, A and B simultaneously, and B alone. Additionally, the character " / " in this article generally indicates that the preceding and following related objects have an "or" relationship.

[0054] Example 1

[0055] Figure 1 A flowchart of a tool process resource limiting method provided in Embodiment 1 of this application is shown below. Figure 1 The method can be executed by a device that performs the method, which can be implemented in software and / or hardware, and the method includes:

[0056] S110. In response to the system process being a tool process, obtain the global resource limit configured for the tool process.

[0057] It should be noted that during the process of providing services to users, the operating system will run multiple processes concurrently, and these processes will be referred to as system processes. In this embodiment, system processes include tool processes and application processes. Tool processes are used to maintain the stable operation of the entire system and provide basic services. For example, tool processes include log collection processes, monitoring collection processes, link collection processes, heartbeat message uploading processes, etc. Application processes are used to utilize the resources and services provided by the operating system to complete specific tasks. For example, application processes include document processing processes, web browsing processes, code compilation processes, video playback processes, etc.

[0058] At the current moment of the operating system's operation, multiple tool processes may be running concurrently within the operating system. During the operation of these tool processes, they consume corresponding resources. For example, these resources include at least: CPU utilization, memory usage, and I / O read / write speed. In other embodiments, the specific resources are not limited. Taking one type of resource consumed by a tool process as an example, to prevent a single tool process from suddenly consuming excessive resources due to a failure, this embodiment sets a resource limit for the type of resource consumed by each tool process, and records the configured resource limit as the global resource limit. This global resource limit is used to restrict the total amount of the type of resource consumed by all tool processes from exceeding the global resource limit.

[0059] Specifically, taking CPU utilization as an example, suppose the global resource limit for CPU utilization consumed by each tool process is set to 10% of the total CPU utilization; in response to the creation of a system process as a tool process in the operating system, the tool process is placed in a controller for managing CPU utilization, and the pre-configured global resource limit, 10% of the total CPU utilization, is configured into the controller; and this controller is called the CPU utilization controller, which is used to ensure that the total CPU utilization consumed by each tool process does not exceed the configured global resource limit, which applies only to CPU utilization.

[0060] In this embodiment, a memory usage controller and an I / O read / write rate controller are also provided. The working principle of the memory usage controller and the I / O read / write rate controller is the same as that of the CPU utilization controller mentioned above, except that they target different types of resources. The memory usage controller is used to control the total amount of memory consumed by each tool process to ensure that it does not exceed the configured global resource limit. This global resource limit applies only to memory usage. The I / O read / write rate controller is used to control the total amount of I / O read / write rate consumed by each tool process to ensure that it does not exceed the configured global resource limit. This global resource limit applies only to I / O read / write rate.

[0061] S120. Based on the historical resource consumption data of each tool process and the global resource limit, allocate a single-process resource limit to each tool process.

[0062] It should be noted that, based on the determination of the global resource limit, this embodiment intends to further allocate corresponding resource limits to each tool process currently existing in the controller, and the resource limit allocated to a single tool process is denoted as the single process resource limit.

[0063] Different tool processes consume varying amounts of resources during normal operation. If the global resource limit is simply divided equally among the total number of tool processes currently existing in the controller to obtain the single-process resource limit for each tool process, it is easy to result in tool processes with high resource consumption being allocated a low single-process resource limit, which is insufficient to meet normal resource consumption requirements. Conversely, tool processes with low resource consumption may be allocated a high single-process resource limit, leading to a waste of single-process resource limits. In other words, the equal distribution method is unlikely to allocate a suitable single-process resource limit for tool processes. To solve this problem, this embodiment acquires and analyzes the historical resource consumption data of each tool process to determine the normal resource consumption level of each tool process. Then, based on the normal resource consumption level of the tool process, a single-process resource limit that is appropriate for the normal resource consumption level is allocated from the global resource limit.

[0064] S130. During the operation of the tool process, the actual single-process resources are collected in real time, and the tool process is dynamically restricted in terms of resources based on the actual single-process resources and the single-process resource limit.

[0065] It should be noted that each tool process consumes corresponding resources during its operation. In this embodiment, the actual resources consumed by each tool process can be monitored in real time by the controller, and the actual resources consumed by a single tool process are recorded as the actual single-process resource. In step S120, a single-process resource limit has been allocated to each tool process in the controller; this single-process resource limit is used to limit the actual single-process resources generated by the corresponding tool process during its operation to not exceed the single-process resource limit, thereby realizing dynamic resource limitation for the corresponding tool process.

[0066] It should be noted that this embodiment obtains the global resource limit configured for the tool process in response to the system process being a tool process; based on the historical resource consumption data of each tool process and the global resource limit, a single-process resource limit is allocated to each tool process; during the execution of the tool process, the actual single-process resources are collected in real time, and the tool process is dynamically limited in resources based on the actual single-process resources and the single-process resource limit. Through the above implementation, after configuring the global resource limit, a single-process resource limit allocated individually to each tool process is determined based on historical resource consumption data. This single-process resource limit can limit the actual single-process resources consumed by the tool process during runtime to not exceed the corresponding single-process resource limit. In this way, even if the tool process fails, it cannot occupy a large amount of actual single-process resources, thereby preventing the process resources of the application process from being squeezed out, and thus facilitating the prevention of adverse effects on the application process when the tool process fails.

[0067] Example 2

[0068] This application provides a tool process resource limiting method in Embodiment 2, which optimizes the "allocating a single-process resource limit to each tool process based on the historical resource consumption data of each tool process and the global resource limit" in Embodiment 1. It should be noted that for parts not detailed in this embodiment, please refer to the descriptions in other embodiments. The method includes:

[0069] S210. In response to the system process being a tool process, obtain the global resource limit configured for the tool process.

[0070] S221. Count the total number of processes of each tool process, and determine the initial process resource limit of each tool process based on the global resource limit and the total number of processes.

[0071] It should be noted that, assuming there are already multiple tool processes in the current controller, it is necessary to allocate a corresponding single-process resource limit to each tool process. To this end, this embodiment intends to first allocate an initial process resource limit to each tool process, and then adjust the initial single-process resource limit to a final process resource limit that adapts to the normal level of resource consumption of the tool process based on the historical resource consumption data of each tool process.

[0072] In this embodiment, the configured global resource limit is to be evenly distributed to each tool process in the current controller, so as to obtain the initial single-process resource limit of each tool process, and the initial single-process resource limit is recorded as the initial process resource limit.

[0073] Specifically, first, the total number of tool processes in the current controller is counted and recorded as the total number of processes; then, the quotient between the global resource limit and the total number of processes is calculated, and this quotient is used as the initial process resource limit for each tool process; this initial process resource limit lays the data foundation for further accurate determination of the final process resource limit of the corresponding tool process.

[0074] S222. Based on the historical resource consumption data of each tool process, determine the resource demand pattern of the tool process, and adjust the initial process resource limit according to the resource demand pattern to obtain the single-process resource limit allocated to the tool process.

[0075] It should be noted that, taking a resource consumed by a tool process during runtime as an example, this resource includes, but is not limited to, one of the following: CPU utilization, memory usage, and I / O read / write speed. By performing mathematical statistics on the historical resource consumption data of this type of resource corresponding to the tool process, the resource demand pattern corresponding to the tool process can be determined. This resource demand pattern is used to correct the initial process resource limit based on the statistical results obtained from the mathematical statistics of the historical resource consumption data, thereby obtaining the final process resource limit, which is denoted as the single process resource limit.

[0076] S230. During the operation of the tool process, the actual single-process resources are collected in real time, and the tool process is dynamically restricted in terms of resources based on the actual single-process resources and the single-process resource limit.

[0077] Example 3

[0078] This application provides a method for limiting resource consumption in tool processes according to Embodiment 3. This method optimizes the method in Embodiment 2, which involves "determining the resource demand pattern of each tool process based on its historical resource consumption data, and adjusting the initial process resource limit based on the resource demand pattern to obtain the single-process resource limit allocated to the tool process." It should be noted that for parts not detailed in this embodiment, please refer to the descriptions in other embodiments. This method includes:

[0079] S310. In response to the system process being a tool process, obtain the global resource limit configured for the tool process.

[0080] S321. Count the total number of processes of each tool process, and determine the initial process resource limit of each tool process based on the global resource limit and the total number of processes.

[0081] S322A. Obtain the historical resource consumption of the tool process, wherein the historical resource consumption includes one of historical CPU utilization, historical memory usage, or historical I / O read / write rate.

[0082] In this embodiment, the resources consumed by the tool process in the controller during runtime include CPU utilization, memory usage, and I / O read / write rate. In other embodiments, the specific resources consumed are not limited. Taking one type of resource as an example, if the resource is CPU utilization, the historical resource consumption of the tool process consuming that CPU utilization is first obtained from the log, which is used as the historical CPU utilization. If the resource is memory usage, the historical resource consumption of the tool process consuming that memory usage is first obtained from the log, which is used as the historical memory usage. If the resource is I / O read / write rate, the historical resource consumption of the tool process consuming that I / O read / write rate is first obtained from the log, which is used as the historical I / O read / write rate.

[0083] S322B: Statistical analysis of the historical resource consumption is performed to generate statistical feature values.

[0084] Taking the historical resource consumption of a tool process as an example, the historical resource consumption includes historical data corresponding to multiple historical moments. This set of historical data has a corresponding degree of fluctuation. If the degree of fluctuation is large, it means that the historical data in this set of historical data is highly dispersed around its mean. In this case, the mode of this set of historical data can better represent the overall level of this set of historical data. If the degree of fluctuation is small, it means that the historical data in this set of historical data is less dispersed around its mean (the historical data is basically concentrated around the mean). In this case, the mean of this set of historical data can better represent the overall level of this set of historical data.

[0085] Specifically, in this embodiment, to measure the fluctuation of historical resource consumption, mathematical statistics are performed on each historical data in the historical resource consumption to obtain corresponding statistical characteristic values. These statistical characteristic values ​​are used to reflect the fluctuation of historical resource consumption. For example, the statistical characteristic value is one of the standard deviation or variance of each historical data in the historical resource consumption. In other embodiments, no limitation is made.

[0086] S322C. Based on a preset statistical feature threshold and the statistical feature value, determine the resource requirement mode of the tool process from the balanced mode and the high-frequency mode.

[0087] It should be noted that, in order to measure whether the fluctuation of each historical data in historical resource consumption (statistical characteristic value) is large, this embodiment presets a threshold for comparison with the statistical characteristic value, and this threshold is recorded as the statistical characteristic threshold. This statistical threshold is set based on historical experience data.

[0088] When the fluctuation of historical data in historical resource consumption is large or small, different resource demand models need to be adopted to further adjust the initial process resource limit. Specifically, when the fluctuation of historical data in historical resource consumption is large, it is more appropriate to use the mode of the historical data as the single-process resource limit of the corresponding tool process. When the fluctuation of historical data in historical resource consumption is small, it is more appropriate to use the mean of the historical data as the single-process resource limit of the corresponding tool process.

[0089] This embodiment pre-sets two resource demand modes for the tool process: balanced mode and high-frequency mode. The high-frequency mode uses the mode of each historical data point in the historical resource consumption as the single-process resource limit of the corresponding tool process, while the balanced mode uses the mean of each historical data point in the historical resource consumption as the single-process resource limit of the corresponding tool process.

[0090] Specifically, in response to a statistical characteristic value being less than a preset statistical characteristic threshold, the balanced mode is determined as the resource demand mode for the corresponding tool process; in response to a statistical characteristic value being greater than or equal to a preset statistical characteristic threshold, the high-frequency mode is determined as the resource demand mode for the corresponding tool process.

[0091] S322D: Based on the rules associated with the resource demand pattern, process the historical resource consumption to generate a correction coefficient.

[0092] Among them, the rules associated with the resource demand pattern are the rules inherent in that resource demand pattern.

[0093] It should be noted that after determining the resource demand pattern of the tool process, the historical resource consumption of the tool process can be further statistically analyzed to obtain a mathematical statistical value that matches the resource demand pattern. For example, if the resource demand pattern is a balanced pattern, the mathematical statistical value is the mean of each historical data in the historical resource consumption; if the resource demand pattern is a high-frequency pattern, the mathematical statistical value is the mode of each historical data in the historical resource consumption.

[0094] Specifically, after determining the resource demand pattern of the tool process, the historical resource consumption of the tool process is further statistically analyzed to obtain the corresponding statistical values. In this way, the statistical values ​​corresponding to each tool process of the controller can be obtained. First, the sum of each statistical value is calculated, and then the ratio of the statistical value of each tool process to the sum is calculated to obtain the correction coefficient corresponding to each tool process.

[0095] S322E. The initial process resource limit is corrected using the correction coefficient to obtain the single-process resource limit of the tool process.

[0096] Taking one of the tool processes as an example, the tool process has determined its corresponding initial process resource limit in step S321 above; the correction coefficient obtained in step S322D is used to correct the initial process resource limit, and the resulting new process resource limit is denoted as the single process resource limit.

[0097] Specifically, taking a tool process in the controller as an example, the product of the correction coefficient of the tool process and the global resource limit is calculated to obtain the process resource correction value. Then, the initial process resource limit of the tool process is replaced by the process resource correction value, thereby correcting the initial process resources. The process resource correction value is used as the final process resource limit of the tool process, which is denoted as the single process resource limit.

[0098] It should be noted that the initial process resource limit obtained by equally distributing the global resource limit may not be suitable for the actual resource consumption level of the corresponding tool process. In other words, the accuracy of the initial process resource limit is not good. The single process resource limit obtained by correcting the initial process resource limit with a correction coefficient can effectively improve the accuracy of the process resource limit allocated to the tool process.

[0099] S330. During the operation of the tool process, the actual single-process resources are collected in real time, and the tool process is dynamically restricted in terms of resources based on the actual single-process resources and the single-process resource limit.

[0100] Example 4

[0101] This application provides a tool process resource limitation method in Embodiment 4, which optimizes the "determining the resource requirement mode of the tool process from a balanced mode and a high-frequency mode based on a preset statistical feature threshold and the statistical feature value" in Embodiment 3. It should be noted that for parts not detailed in this embodiment, please refer to the descriptions in other embodiments. The method includes:

[0102] S410. In response to the system process being a tool process, obtain the global resource limit configured for the tool process.

[0103] S421. Count the total number of processes of each tool process, and determine the initial process resource limit of each tool process based on the global resource limit and the total number of processes.

[0104] S422A. Obtain the historical resource consumption of the tool process, wherein the historical resource consumption includes one of historical CPU utilization, historical memory usage, or historical I / O read / write rate.

[0105] S422B: Statistical analysis of the historical resource consumption is performed to generate statistical feature values.

[0106] S422C1. If the statistical characteristic value is the standard deviation, and the standard deviation is less than a preset statistical characteristic threshold, then the balanced mode is used as the resource demand mode.

[0107] In order to measure the degree of fluctuation of historical data in historical resource consumption, the standard deviation or variance of historical data in historical resource consumption is generally used as a statistical feature value. In practice, it has been found that since the calculated standard deviation can be in the same unit as the historical data in historical resource consumption, while the unit of variance is the square of the unit of the historical data in historical resource consumption, the standard deviation is more intuitive in measuring the degree of fluctuation of historical data in historical resource consumption. Therefore, this embodiment specifically adopts the standard deviation as a statistical feature value.

[0108] When the standard deviation is less than the preset statistical characteristic threshold, it indicates that the fluctuation of each historical data in the historical resource consumption is small. At this time, the mean of each historical data in the historical resource consumption can better reflect the resource consumption level of the tool process during normal operation. Therefore, the balanced mode is preferred as the resource demand mode.

[0109] S422C2, Otherwise, the high-frequency mode shall be used as the resource demand mode.

[0110] When the standard deviation is greater than or equal to the preset statistical characteristic threshold, it indicates that the fluctuation of each historical data in the historical resource consumption is relatively large. At this time, the mode of each historical data in the historical resource consumption can better reflect the resource consumption level of the tool process during normal operation. Therefore, the high-frequency mode is preferred as the resource demand mode.

[0111] It should be noted that by using the standard deviation as a statistical feature value, the accuracy of measuring the fluctuation of historical data in historical resource consumption can be improved, thereby improving the accuracy of the determined resource demand pattern.

[0112] S422D: Based on the rules associated with the resource demand pattern, process the historical resource consumption to generate a correction coefficient.

[0113] S422E: The initial process resource limit is corrected using the correction coefficient to obtain the single-process resource limit of the tool process.

[0114] S430. During the operation of the tool process, the actual single-process resources are collected in real time, and the tool process is dynamically restricted in terms of resources based on the actual single-process resources and the single-process resource limit.

[0115] Example 5

[0116] This application provides a tool process resource limitation method in Embodiment 5, which supplements the method shown in any one of Embodiments 1 to 4. It should be noted that for parts not described in detail in this embodiment, please refer to the descriptions in other embodiments. For example, to supplement Embodiment 1, please refer to... Figure 2 The method includes:

[0117] S510. Determine whether the system process was started by the system service manager.

[0118] It should be noted that when the operating system provides services to users, it will trigger the execution of different system processes based on the specific content of the service. These system processes are mainly divided into tool processes and application processes. In this embodiment, we want to limit the resources of the tool processes in the system processes. Therefore, we need to first identify the tool processes from the various system processes.

[0119] The startup methods for tool processes and application processes differ. Tool processes are generally started by the system service manager, while application processes are generally started by the user session manager.

[0120] Specifically, in response to the generation of a system process in the operating system, it is first determined whether the system process was started by the system service manager. For example, it can be determined whether the process name suffix of the system process is a specific suffix, such as sshd, nginx, syslogd, etc.

[0121] S520. If yes, determine whether the system process is run by a system user, so as to determine whether the system process is a tool process.

[0122] In this example, if a newly generated system process in the operating system is determined to be started by the system service manager, then the system process is highly likely to be a tool process. In order to further accurately determine whether the system process is a tool process, this embodiment also determines whether the system process is run by a system user.

[0123] It should be noted that tool processes are generally run by system users, while application processes are generally run by ordinary users.

[0124] Specifically, after determining that the system process was started by the system service manager, it is also determined whether the system process is run by a system user. If the system process is determined to be started by the system service manager and also run by a system user, then the system process can be identified as a utility process.

[0125] It should be noted that determining whether a system process is a tool process based on two criteria—whether the system process is started by the system service manager and whether the system process is run by a system user—can effectively improve the accuracy of tool process identification.

[0126] S530. In response to the system process being a tool process, obtain the global resource limit configured for the tool process.

[0127] S540. Based on the historical resource consumption data of each tool process and the global resource limit, allocate a single-process resource limit to each tool process.

[0128] S550. During the operation of the tool process, the actual single-process resources are collected in real time, and the tool process is dynamically restricted in terms of resources based on the actual single-process resources and the single-process resource limit.

[0129] Example 6

[0130] This application provides a tool process resource limitation method in Embodiment Six, which supplements the method shown in any one of Embodiments One to Four. It should be noted that for parts not described in detail in this embodiment, please refer to the descriptions in other embodiments. For example, to supplement Embodiment One, please refer to... Figure 3 The method includes:

[0131] S610. In response to the system process being a tool process, obtain the global resource limit configured for the tool process.

[0132] S620. Based on the historical resource consumption data of each tool process and the global resource limit, allocate a single-process resource limit to each tool process.

[0133] S630. During the operation of the tool process, the actual single-process resources are collected in real time, and the tool process is dynamically restricted in terms of resources based on the actual single-process resources and the single-process resource limit.

[0134] S640. In response to the fact that there is a limit resource consumption in the actual resource consumption of the tool process that reaches the corresponding single process resource limit, calculate the proportion of the limit resource consumption in the actual resource consumption.

[0135] It should be noted that, taking a tool process in the controller as an example, in order to dynamically limit the resources consumed by the tool process, the controller also monitors the resource consumption data of the tool process in real time from the time it enters control until the current time, to obtain the actual resource consumption. The actual resource consumption includes the resource consumption data corresponding to each data acquisition time within the current time period. Through steps S610-S630, the single-process resource limit of the tool process has been determined. If the number of resource consumption data that reach the single-process resource limit in the actual resource consumption within the current time period is large, it indicates that the single-process resource limit is too low relative to the actual resource consumption of the tool process, and it is necessary to appropriately increase the single-process resource limit to meet the actual resource consumption requirements of the tool process. To increase the single-process resource limit, it is first necessary to increase the global resource limit.

[0136] In order to determine whether the number of resource consumption data that reach the resource limit of a single process in the actual resource consumption within the current time period is large, this embodiment first determines the resource consumption data that reach the resource limit of a single process in the actual resource consumption, and records it as the limit-reaching resource consumption. Then, it calculates the proportion of the limit-reaching resource consumption in the actual resource consumption. By the level of this proportion, it can be determined whether the number of resource consumption data that reach the resource limit of a single process in the actual resource consumption within the current time period is large.

[0137] S650. Count the number of tool processes whose proportion is greater than the preset proportion threshold, and obtain the total number of processes exceeding the threshold.

[0138] In order to measure whether the proportion of this quantity is high, this embodiment presets a proportion threshold based on historical experience data; if the proportion of the quantity is greater than the preset proportion threshold, it indicates that the proportion of the quantity is high, and it also indicates that the number of resource consumption data that reach the resource limit of the single process in the actual resource consumption in the current time period is large.

[0139] It should be noted that the controller contains multiple tool processes. If only a small number of tool processes have a proportion greater than the proportion threshold, then there is no need to increase the global resource limit. However, if the proportion of most tool processes has a proportion greater than the proportion threshold, it means that the global resource limit is indeed lower than the actual resource consumption of each tool process. In this case, it is necessary to appropriately increase the global resource limit to meet the actual resource consumption requirements.

[0140] In order to determine whether most tool processes have a low single-process resource limit, this embodiment counts the number of tool processes in the controller whose proportion is greater than a preset proportion threshold, and records it as the total number of processes exceeding the threshold. If the total number of processes exceeding the threshold is high, it means that most tool processes have a proportion greater than the proportion threshold, which means that most tool processes in the controller have a low single-process resource limit.

[0141] S660. In response to the total number of processes exceeding the threshold being greater than a preset total number of processes threshold, adjust the global resource limit based on a preset adjustment coefficient.

[0142] In order to measure whether the total number of processes exceeding the threshold is high, this embodiment presets a threshold for the total number of processes based on historical experience data. If the total number of processes exceeding the threshold is greater than the threshold, it indicates that the total number of processes exceeding the threshold is high, and it also indicates that the single-process resource limit allocated to most tool processes in the controller is low, and the global resource limit needs to be increased.

[0143] To increase the global resource limit, this embodiment has a preset adjustment coefficient.

[0144] Specifically, in response to the total number of processes exceeding the threshold being greater than the preset total number of processes threshold, the product of the global resource limit and the preset adjustment coefficient is calculated to obtain the new global resource limit, thereby realizing the increase of the global resource limit.

[0145] It should be understood that although the steps in the flowcharts of the embodiments described above are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the embodiments described above may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages of other steps.

[0146] Example 7

[0147] Based on the same inventive concept, this embodiment also provides a tool process resource limiting device for implementing the above-described tool process resource limiting method. The solution provided by this device is similar to the implementation described in the above method; therefore, the specific limitations in one or more tool process resource limiting device embodiments provided below can be found in the limitations of the tool process resource limiting method described above, and will not be repeated here.

[0148] In this embodiment, as Figure 4 As shown, a tool process resource limiting device is provided, comprising:

[0149] The upper limit acquisition module is used to acquire the global resource upper limit configured for the tool process in response to the system process being a tool process;

[0150] The upper limit allocation module is used to allocate a single-process resource limit to each of the tool processes based on the historical resource consumption data of each tool process and the global resource limit.

[0151] The resource limiting module is used to collect the actual single-process resources in real time during the operation of the tool process, and to dynamically limit the resources of the tool process based on the actual single-process resources and the single-process resource limit.

[0152] In an optional embodiment, allocating a single-process resource limit to each of the tool processes based on their historical resource consumption data and the global resource limit includes:

[0153] The total number of processes of each tool process is counted, and the initial process resource limit of each tool process is determined based on the global resource limit and the total number of processes.

[0154] Based on the historical resource consumption data of each tool process, the resource demand pattern of the tool process is determined, and the initial process resource limit is adjusted according to the resource demand pattern to obtain the single-process resource limit allocated to the tool process.

[0155] In an optional embodiment, the step of determining the resource demand pattern of each tool process based on its historical resource consumption data, and adjusting the initial process resource limit according to the resource demand pattern to obtain the single-process resource limit allocated to the tool process, includes:

[0156] Obtain the historical resource consumption of the tool process, wherein the historical resource consumption includes one of historical CPU utilization, historical memory usage, or historical I / O read / write rate;

[0157] Statistical feature values ​​are generated by statistically analyzing the historical resource consumption.

[0158] Based on preset statistical feature thresholds and the statistical feature values, the resource requirement mode of the tool process is determined from the balanced mode and the high-frequency mode.

[0159] Based on the rules associated with the resource demand pattern, the historical resource consumption is processed to generate a correction coefficient;

[0160] The initial process resource limit is corrected using the correction coefficient to obtain the single-process resource limit of the tool process.

[0161] In an optional embodiment, determining the resource requirement pattern of the tool process from the balanced mode and the high-frequency mode based on a preset statistical feature threshold and the statistical feature value includes:

[0162] If the statistical characteristic value is the standard deviation, and the standard deviation is less than the preset statistical characteristic threshold, then the balanced mode will be used as the resource demand mode.

[0163] Otherwise, the high-frequency pattern will be used as the resource demand pattern.

[0164] In an optional embodiment, the tool process resource limiting device further includes:

[0165] The first judgment module is used to determine whether the system process was started by the system service manager;

[0166] The second judgment module is used to determine whether the system process is run by a system user if the condition is met, so as to determine whether the system process is a tool process.

[0167] In an optional embodiment, the tool process resource limiting device further includes:

[0168] The percentage calculation module is used to calculate the percentage of the actual resource consumption that reaches the corresponding single-process resource limit in the actual resource consumption of the tool process.

[0169] The total number statistics module is used to count the number of tool processes whose proportion is greater than a preset proportion threshold, and obtain the total number of processes exceeding the threshold.

[0170] The upper limit adjustment module is used to adjust the global resource upper limit based on a preset adjustment coefficient when the total number of processes exceeding the threshold exceeds a preset total number of processes threshold.

[0171] Each module in the aforementioned tool process resource limiting device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device, or stored in the memory of a computer device as software, so that the processor can call and execute the operations corresponding to each module.

[0172] It should be noted that this embodiment obtains the global resource limit configured for the tool process in response to the system process being a tool process; based on the historical resource consumption data of each tool process and the global resource limit, a single-process resource limit is allocated to each tool process; during the execution of the tool process, the actual single-process resources are collected in real time, and the tool process is dynamically limited in resources based on the actual single-process resources and the single-process resource limit. Through the above implementation, after configuring the global resource limit, a single-process resource limit allocated individually to each tool process is determined based on historical resource consumption data. This single-process resource limit can limit the actual single-process resources consumed by the tool process during runtime to not exceed the corresponding single-process resource limit. In this way, even if the tool process fails, it cannot occupy a large amount of actual single-process resources, thereby preventing the process resources of the application process from being squeezed out, and thus facilitating the prevention of adverse effects on the application process when the tool process fails.

[0173] Example 8

[0174] In this embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be as follows. Figure 5 As shown, the computer device includes a processor, memory, and a network interface connected via a system bus. The processor provides computing and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and a database. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The database stores data. The network interface communicates with external terminals via a network connection. When the computer program is executed by the processor, it implements a tool process resource limiting method.

[0175] Those skilled in the art will understand that Figure 5 The structure shown is merely a block diagram of a portion of the structure related to the present disclosure and does not constitute a limitation on the computer device to which the present disclosure is applied. A specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.

[0176] Example 9

[0177] In this embodiment, a computer-readable storage medium is provided, such as... Figure 6 As shown, a computer program is stored thereon, and when the computer program is executed by the processor, it implements the steps in the above-described method embodiments.

[0178] Example 10

[0179] In this embodiment, a computer program product is provided, including a computer program that, when executed by a processor, implements the steps in the above-described method embodiments.

[0180] It should be noted that the information collected is information and data authorized by the user or fully authorized by all parties, and the collection, storage, use, processing, transmission, provision, disclosure and application of the relevant data all comply with the relevant laws, regulations and standards of the relevant countries and regions, necessary confidentiality measures have been taken, and it does not violate public order and good morals. Corresponding operation portals are provided for users to choose to authorize or refuse.

[0181] Those skilled in the art will understand that all or part of the processes in the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, databases, or other media used in the embodiments provided in this disclosure can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this disclosure may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this disclosure may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, etc., and are not limited to these.

[0182] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0183] The embodiments described above are merely illustrative of several implementations of this disclosure, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this patent disclosure. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this disclosure, and these all fall within the protection scope of this disclosure. Therefore, the protection scope of this disclosure should be determined by the appended claims.

Claims

1. A method for limiting resource usage in a tool process, characterized in that, include: In response to the system process being a tool process, obtain the global resource limit configured for the tool process; Based on the historical resource consumption data of each tool process and the global resource limit, allocate a single-process resource limit to each tool process; During the execution of the tool process, the actual single-process resources are collected in real time, and the tool process is dynamically restricted in terms of resources based on the actual single-process resources and the single-process resource limit.

2. The method according to claim 1, characterized in that, The step of allocating a single-process resource limit to each tool process based on its historical resource consumption data and the global resource limit includes: The total number of processes of each tool process is counted, and the initial process resource limit of each tool process is determined based on the global resource limit and the total number of processes. Based on the historical resource consumption data of each tool process, the resource demand pattern of the tool process is determined, and the initial process resource limit is adjusted according to the resource demand pattern to obtain the single-process resource limit allocated to the tool process.

3. The method according to claim 2, characterized in that, The step of determining the resource demand pattern of each tool process based on its historical resource consumption data, and adjusting the initial process resource limit according to the resource demand pattern to obtain the single-process resource limit allocated to the tool process, includes: Obtain the historical resource consumption of the tool process, wherein the historical resource consumption includes one of historical CPU utilization, historical memory usage, or historical I / O read / write rate; Statistical feature values ​​are generated by statistically analyzing the historical resource consumption. Based on preset statistical feature thresholds and the statistical feature values, the resource requirement mode of the tool process is determined from the balanced mode and the high-frequency mode. Based on the rules associated with the resource demand pattern, the historical resource consumption is processed to generate a correction coefficient; The initial process resource limit is corrected using the correction coefficient to obtain the single-process resource limit of the tool process.

4. The method according to claim 3, characterized in that, The process of determining the resource requirement pattern of the tool process from the balanced mode and the high-frequency mode based on the preset statistical feature threshold and the statistical feature value includes: If the statistical characteristic value is the standard deviation, and the standard deviation is less than the preset statistical characteristic threshold, then the balanced mode will be used as the resource demand mode. Otherwise, the high-frequency pattern will be used as the resource demand pattern.

5. The method according to any one of claims 1-4, characterized in that, Before the step of responding to the system process being a tool process and obtaining the global resource limit configured for the tool process, the method further includes: Determine whether the system process was started by the system service manager; If so, determine whether the system process is run by a system user to determine whether the system process is a utility process.

6. The method according to any one of claims 1-4, characterized in that, The method further includes: In response to the fact that the actual resource consumption of the tool process reaches the corresponding single-process resource limit, the proportion of the resource consumption reaching the limit in the actual consumption is calculated. The total number of tool processes whose proportion exceeds a preset proportion threshold is calculated. In response to the total number of processes exceeding the threshold being greater than a preset total number of processes threshold, the global resource limit is adjusted based on a preset adjustment coefficient.

7. A tool process resource limiting device, characterized in that, The device includes: The upper limit acquisition module is used to acquire the global resource upper limit configured for the tool process in response to the system process being a tool process; The upper limit allocation module is used to allocate a single-process resource limit to each of the tool processes based on the historical resource consumption data of each tool process and the global resource limit. The resource limiting module is used to collect the actual single-process resources in real time during the operation of the tool process, and to dynamically limit the resources of the tool process based on the actual single-process resources and the single-process resource limit.

8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 6.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 6.

10. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 6.