Method, device and system for scheduling CPU resources
By obtaining the target application's time slice length and minimum performance requirements, and combining historical data to dynamically schedule CPU resources, the problem of CPU resource waste in existing technologies is solved, achieving more efficient resource allocation.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- CHINA MOBILE GROUP ZHEJIANG
- Filing Date
- 2021-05-19
- Publication Date
- 2026-07-21
AI Technical Summary
Existing CPU resource allocation methods result in wasted idle resources and fail to effectively and rationally allocate CPU resources.
By obtaining the target application's time slice length and minimum performance requirements, and based on historical CPU resource scheduling and performance data within the time window, the CPU utilization and maximum process I/O wait time parameters are determined, and the CPU resources required by the target application are dynamically scheduled.
While meeting user needs, reduce CPU resource waste and improve the accuracy and efficiency of resource allocation.
Smart Images

Figure CN115373829B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of computer technology, and specifically to a method, apparatus, and system for scheduling CPU resources. Background Technology
[0002] With the continuous development of virtualization technology, the popularity of virtual machine systems built on virtualization technology is constantly increasing. In a virtual machine system, multiple virtual devices (Virtual Central Processing Units, or VCPUs) can run on a single physical device. Multiple virtual devices share the CPU resources of the physical device, so the rational allocation of CPU resources is of great significance to the virtual machine system.
[0003] In existing technologies, CPU resource allocation methods typically fall into two categories: one is static allocation mode, which utilizes sufficient CPU resources to maintain application performance; the other is dynamic allocation mode, which allocates CPU resources based on historical peak data.
[0004] However, the inventors discovered during implementation that the prior art has at least the following defects: the CPU resource allocation method in the prior art will generate a lot of idle CPU resources, thus causing a waste of CPU resources. Summary of the Invention
[0005] In view of the above problems, the present invention is proposed to provide a method, apparatus and system for scheduling CPU resources that overcomes or at least partially solves the above problems.
[0006] According to one aspect of the present invention, a method for scheduling CPU resources is provided, comprising:
[0007] Retrieve the time slice length parameter configured for the target application and the application's minimum performance requirements parameter;
[0008] Based on the collected CPU resource scheduling data and application performance data of the target application within a preset historical time window, determine the CPU utilization parameter and the maximum process I / O wait time parameter of the target application that match the time slice length parameter and the minimum performance requirement parameter of the application.
[0009] Based on the CPU utilization parameters and maximum process I / O wait time parameters of the target application, schedule the CPU resources required by the target application.
[0010] In an optional implementation, the step of determining the CPU utilization parameter and maximum process I / O wait time parameter of the target application that match the time slice length parameter and the minimum performance requirement parameter of the application based on the collected CPU resource scheduling data and application performance data of the target application within a preset historical time window further includes:
[0011] The preset historical time window is divided into multiple time slices; the length of each time slice is consistent with the time slice length parameter.
[0012] Based on the CPU resource scheduling data of the target application within the preset historical time window, calculate the CPU utilization rate corresponding to each time slice, and based on the application performance data of the target application within the preset historical time window, calculate the application performance value corresponding to each time slice.
[0013] Candidate time slices that match the application performance value with the minimum performance requirement parameter are determined from the plurality of time slices;
[0014] The target time slice with the longest process I / O wait time is determined from the candidate time slices;
[0015] The CPU utilization parameters of the target application are determined based on the CPU utilization corresponding to the target time slice, and the maximum process I / O wait time parameters of the target application are determined based on the process I / O wait time of the target time slice.
[0016] In an optional implementation, the step of finding candidate time slices from the plurality of time slices further includes:
[0017] Divide time slices corresponding to the same CPU utilization level into a set of time slices;
[0018] For each time slice set, calculate the set application performance value based on the application performance value corresponding to each time slice in the time slice set;
[0019] Based on the minimum performance requirement parameters of the application, a set of target time slices is determined; wherein the application performance value of the set of target time slices matches the minimum performance requirement parameters of the application.
[0020] The time slices in the target time slice set are identified as candidate time slices.
[0021] In an optional implementation, calculating the set application performance value of the time slice set based on the application performance value corresponding to each time slice in the time slice set further includes:
[0022] The probability distribution of the application performance values corresponding to the time slice set is used to determine the set of application performance values for that time slice set.
[0023] In one optional implementation, the set of application performance values of the target time slice set is at the same application performance level as the minimum application performance requirement parameter;
[0024] Alternatively, the set of target time slices has an application performance value greater than or equal to the application's minimum performance requirement parameter.
[0025] In one alternative implementation, only the target application runs within the preset historical time window.
[0026] According to another aspect of the present invention, a CPU resource scheduling apparatus is provided, comprising:
[0027] The acquisition module is used to obtain the time slice length parameter configured for the target application and the minimum performance requirement parameter of the application.
[0028] The determination module is used to determine the CPU utilization parameter and the maximum process I / O wait time parameter of the target application that match the time slice length parameter and the minimum performance requirement parameter of the application, based on the collected CPU resource scheduling data and application performance data of the target application within a preset historical time window.
[0029] The scheduling module is used to schedule the CPU resources required by the target application based on the CPU utilization parameters and the maximum process I / O wait time parameters of the target application.
[0030] In an optional implementation, the determining module is further configured to:
[0031] The preset historical time window is divided into multiple time slices; the length of each time slice is consistent with the time slice length parameter.
[0032] Based on the CPU resource scheduling data of the target application within the preset historical time window, calculate the CPU utilization rate corresponding to each time slice, and based on the application performance data of the target application within the preset historical time window, calculate the application performance value corresponding to each time slice.
[0033] Candidate time slices that match the application performance value with the minimum performance requirement parameter are determined from the plurality of time slices;
[0034] The target time slice with the longest process I / O wait time is determined from the candidate time slices;
[0035] The CPU utilization parameters of the target application are determined based on the CPU utilization corresponding to the target time slice, and the maximum process I / O wait time parameters of the target application are determined based on the process I / O wait time of the target time slice.
[0036] In an optional implementation, the determining module is further configured to:
[0037] Divide time slices corresponding to the same CPU utilization level into a set of time slices;
[0038] For each time slice set, calculate the set application performance value based on the application performance value corresponding to each time slice in the time slice set;
[0039] Based on the minimum performance requirement parameters of the application, a set of target time slices is determined; wherein the application performance value of the set of target time slices matches the minimum performance requirement parameters of the application.
[0040] The time slices in the target time slice set are identified as candidate time slices.
[0041] In an optional implementation, the determining module is further configured to:
[0042] The probability distribution of the application performance values corresponding to the time slice set is used to determine the set of application performance values for that time slice set.
[0043] In one optional implementation, the set of application performance values of the target time slice set is at the same application performance level as the minimum application performance requirement parameter;
[0044] Alternatively, the set of target time slices has an application performance value greater than or equal to the application's minimum performance requirement parameter.
[0045] In one alternative implementation, only the target application runs within the preset historical time window.
[0046] According to another aspect of the present invention, a CPU resource scheduling system is provided, comprising:
[0047] The aforementioned CPU resource scheduling device, and the data monitoring module located on the virtual machine side;
[0048] The data monitoring module is used to collect CPU resource scheduling data and application performance data of the target application within a preset historical time window.
[0049] According to another aspect of the present invention, a computing device is provided, comprising: a processor, a memory, a communication interface, and a communication bus, wherein the processor, the memory, and the communication interface communicate with each other via the communication bus;
[0050] The memory is used to store at least one executable instruction, which causes the processor to perform the operation corresponding to the CPU resource scheduling method described above.
[0051] According to another aspect of the present invention, a computer storage medium is provided, the storage medium storing at least one executable instruction that causes a processor to perform an operation corresponding to the CPU resource scheduling method described above.
[0052] The CPU resource scheduling method, apparatus, and system disclosed in this invention acquire time slice length parameters and minimum performance requirement parameters for a target application; based on collected CPU resource scheduling data and application performance data of the target application within a preset historical time window, determine the CPU utilization parameters and maximum process I / O wait time parameters of the target application that match the time slice length parameters and minimum performance requirement parameters; and schedule the CPU resources required by the target application according to the CPU utilization parameters and maximum process I / O wait time parameters. This solution can schedule the minimum amount of CPU resources for the application while meeting user needs, thereby avoiding the generation of idle CPU resources and reducing CPU resource waste.
[0053] The above description is merely an overview of the technical solution of the present invention. In order to better understand the technical means of the present invention and to implement it in accordance with the contents of the specification, and in order to make the above and other objects, features and advantages of the present invention more apparent and understandable, specific embodiments of the present invention are described below. Attached Figure Description
[0054] Various other advantages and benefits will become apparent to those skilled in the art upon reading the following detailed description of preferred embodiments. The accompanying drawings are for illustrative purposes only and are not intended to limit the invention. Furthermore, the same reference numerals denote the same parts throughout the drawings. In the drawings:
[0055] Figure 1 A flowchart of a CPU resource scheduling method provided in Embodiment 1 of the present invention is shown;
[0056] Figure 2 A flowchart of a CPU resource scheduling method provided in Embodiment 2 of the present invention is shown;
[0057] Figure 3 A flowchart of a candidate time slice determination method according to an embodiment of the present invention is shown;
[0058] Figure 4 A schematic diagram of a CPU resource scheduling device provided in Embodiment 3 of the present invention is shown;
[0059] Figure 5 A schematic diagram of the structure of a CPU resource scheduling system provided in Embodiment 4 of the present invention is shown;
[0060] Figure 6 A schematic diagram of the structure of a computing device provided in Embodiment Six of the present invention is shown. Detailed Implementation
[0061] Exemplary embodiments of the invention will now be described in more detail with reference to the accompanying drawings. While exemplary embodiments of the invention are shown in the drawings, it should be understood that the invention may be implemented in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this invention will be thorough and complete, and will fully convey the scope of the invention to those skilled in the art.
[0062] Example 1
[0063] Figure 1 A flowchart of a CPU resource scheduling method according to Embodiment 1 of the present invention is shown. The CPU resource scheduling method provided in this embodiment is mainly applied to virtual machine systems built based on virtualization technology.
[0064] like Figure 1 As shown, the method includes:
[0065] Step S110: Obtain the time slice length parameter and the minimum performance requirement parameter for the target application.
[0066] The target application is the application for which CPU resources are to be allocated. The target application can be any application in the virtual machine system. This embodiment does not limit the specific type of the target application.
[0067] Users can configure the time slice length parameter for the target application according to their needs. The target application's time slice length parameter indicates the length of the time slice allocated to that application. A smaller time slice length parameter indicates a higher real-time requirement for CPU resources in the target application; for example, streaming media applications typically require a smaller time slice length parameter. In short, users can configure the appropriate time slice length parameter based on the type of the target application, etc.
[0068] Users can also configure the minimum performance requirements for a target application according to their needs. Specifically, the minimum performance requirement parameter represents the percentage of the application's optimal performance that the user can tolerate. For example, a minimum performance requirement parameter of 90% indicates that the user can tolerate a performance loss of up to 10% compared to the application's optimal performance.
[0069] Step S120: Based on the collected CPU resource scheduling data and application performance data of the target application within a preset historical time window, determine the CPU utilization parameters and maximum process I / O wait time parameters of the target application that match the time slice length parameters and the minimum performance requirement parameters of the application.
[0070] In actual implementation, once the allocated CPU resources exceed a certain threshold, the performance improvement of the application becomes minimal. To avoid wasting CPU resources, this step specifically determines the minimum CPU resource parameters that meet the user's requirements. These user requirements specifically include the target application's time slice length and minimum performance requirements; the minimum CPU resource parameters specifically include the target application's CPU utilization and maximum process I / O wait time.
[0071] In the specific implementation process, in order to accurately determine the minimum CPU resource parameters that meet user needs, this embodiment pre-collects CPU resource scheduling data and application performance data of the target application within a preset historical time window through a monitoring module set on the virtual machine side. The preset historical time window can be the most recent hour, 10 minutes, etc.
[0072] Further, based on the CPU resource scheduling data and application performance data of the target application within a preset historical time window, the mapping relationship between the time slice length parameter, the minimum performance requirement parameter of the application, the CPU utilization parameter, and the maximum process I / O wait time parameter is determined. Subsequently, the CPU utilization parameter and the maximum process I / O wait time parameter of the target application that match the time slice length parameter and the minimum performance requirement parameter are determined.
[0073] Step S130: Based on the CPU utilization parameters and maximum process I / O wait time parameters of the target application, schedule the CPU resources required by the target application.
[0074] Specifically, based on the CPU utilization parameters and maximum process I / O wait time parameters of the target application, the CPU resources of the target application can be allocated by automatically setting the corresponding parameters in the VMM (Virtual Machine Monitor).
[0075] Therefore, this embodiment allows users to configure the time slice length parameter and the minimum performance requirement parameter for the target application, thereby meeting their personalized needs. Furthermore, it determines the minimum CPU resource parameter that meets the user's requirements and performs CPU resource scheduling based on this parameter. This satisfies user needs while reducing idle CPU resources and avoiding waste. Specifically, this embodiment determines the mapping relationship between user requirement parameters and minimum CPU resource parameters based on collected CPU resource scheduling data and application performance data of the target application within a preset historical time window. This accurately determines the CPU utilization parameter and maximum process I / O wait time parameter of the target application that match the time slice length parameter and the minimum performance requirement parameter, further improving the accuracy of CPU resource scheduling.
[0076] Example 2
[0077] Figure 2 A flowchart of a CPU resource scheduling method according to Embodiment 2 of the present invention is shown. This embodiment is a further optimization of the CPU resource scheduling method in Embodiment 1.
[0078] like Figure 2 As shown, the method includes:
[0079] Step S210: Obtain the time slice length parameter and the minimum performance requirement parameter for the target application.
[0080] The specific implementation process of this step can be referred to the description in step S110, and will not be repeated here. Furthermore, compared with embodiment one, this embodiment specifically determines the minimum CPU resource parameters that meet the user's needs more accurately through subsequent steps S220-S260 based on the CPU resource scheduling data and application performance data of the target application within a preset historical time window.
[0081] Step S220: Divide the preset historical time window into multiple time slices; wherein the length of each time slice is consistent with the time slice length parameter.
[0082] To more accurately determine the minimum CPU resource parameters that meet user needs based on CPU resource scheduling data and application performance data of the target application within a preset historical time window, the preset historical time window is first determined. This preset historical time window is the most recent historical period, such as the most recent hour or 10 minutes. This approach ensures data real-time performance, avoiding outdated data; furthermore, the preset historical time window is close to the current time, making the CPU resource scheduling data and application performance data within that window more closely reflect the current situation, thus resulting in a more accurate extraction of the minimum CPU resource parameters that meet user needs.
[0083] The preset historical time window is further divided into multiple time slices, each with a length consistent with the time slice length parameter, thus meeting the user's configured time slice length requirements. The multiple time slices do not overlap; the starting point of any time slice is either the starting point of the preset historical time window or the ending point of another time slice; similarly, the ending point of any time slice is either the ending point of the preset historical time window or the starting point of another time slice.
[0084] Step S230: Calculate the CPU utilization rate for each time slice based on the CPU resource scheduling data of the target application within the preset historical time window, and calculate the application performance value for each time slice based on the application performance data of the target application within the preset historical time window.
[0085] The monitoring module, located on the virtual machine side, can monitor the CPU resource scheduling data of the target application in real time within a preset historical time window. This CPU resource scheduling data specifically includes timestamp logs of the start and end times of CPU resource scheduling for the target application within the preset historical time window. In this embodiment, each target application has a corresponding CPU resource scheduling timestamp log, thereby avoiding data interference between different applications.
[0086] Based on the CPU resource scheduling data of the target application within a preset historical time window, the CPU utilization rate corresponding to each time slice can be calculated. Specifically, for any time slice, the start time and end time of the CPU resource scheduling for the target application within that time slice are recorded. The duration of CPU resource occupation by the target application within that time slice is calculated based on the start and end times, and the ratio of the duration of CPU resource occupation by the target application within that time slice to the time slice length parameter is taken as the CPU utilization rate corresponding to that time slice.
[0087] The monitoring module set up on the virtual machine side can also monitor the application performance data of the target application in real time within a preset historical time window. Specifically, the application performance data includes the number of requests initiated by users of the target application within the preset historical time window and the number of times user requests received accurate responses, etc. Alternatively, the application performance data can be the performance evaluation score of the target application by the application management program on the device (such as application manager, etc.) within the preset historical time window, etc.
[0088] The application performance value for each time slot can be calculated based on the application performance data of the target application within a preset historical time window. In one optional implementation, if the application performance data consists of the number of requests initiated by the target application user and the number of requests that received accurate responses within the preset historical time window, then the number of requests initiated by the target application user and the number of requests that received accurate responses within each time slot are calculated, and the proportion of user requests that received accurate responses within that time slot is calculated. This proportion is then used as the application performance value for that time slot. The application performance value obtained in this way can intuitively reflect the user's perception of application performance, and the method is simple, easy to implement, and highly efficient. In another optional implementation, if the application performance data consists of the performance evaluation score of the target application by the application management program on the device within a preset historical time window, then for each time slot, the average score of the performance evaluation score of the target application within that time slot is used as the application performance value for that time slot. In this approach, since the application management program can evaluate the performance of the target application from multiple dimensions, the application performance value corresponding to the time slice can accurately and comprehensively reflect the application performance; and the application performance value corresponding to the time slice can be obtained by directly calling the data in the application management program, which improves the execution efficiency of this method.
[0089] Furthermore, the application performance value corresponding to each time slice is specifically the percentage of the application's performance within that time slice relative to its optimal performance. For example, an application performance value of 80% indicates that the application's performance only reaches 80% of its optimal performance within that time slice, resulting in a 20% performance loss.
[0090] In one optional implementation, in order to make the CPU resource scheduling data and / or application performance data of the target application more accurate within a preset historical time window, this embodiment controls that only the target application runs within the preset historical time window, that is, services unrelated to the target application stop running within the preset historical time window, thereby avoiding interference from services unrelated to the target application on the CPU resource scheduling data and / or application performance data corresponding to the target application.
[0091] Step S240: Select candidate time slices from multiple time slices that match the application performance value with the minimum performance requirement parameter.
[0092] This step filters candidate time slices from multiple time slices based on the application performance value corresponding to the time slice. The application performance value of the candidate time slice matches the minimum performance requirement parameter.
[0093] In one alternative implementation, time slices whose application performance value is greater than or equal to the minimum performance requirement parameter can be identified as candidate time slices. This approach allows for the rapid filtering of all candidate time slices that match the minimum performance requirement parameter.
[0094] In another alternative implementation, Figure 3 A flowchart of a candidate time slice determination method according to an embodiment of the present invention is shown. (The flowchart is as follows...) Figure 3 Steps S241-S244 show the process of identifying candidate time slices from multiple time slices that match the application performance value with the minimum performance requirement parameter.
[0095] Step S241: Divide the time slices corresponding to the same CPU utilization level into a time slice set.
[0096] To avoid using noisy time slices as candidate time slices in the future, this implementation first aggregates multiple time slices based on the CPU utilization corresponding to the time slices to generate at least one set of time slices, and then filters candidate time slices based on the overall characteristics of the time slice set, thereby improving the filtering accuracy of candidate time slices.
[0097] Specifically, for any set of time slices, the CPU utilization rates corresponding to the time slices in that set belong to the same CPU utilization level. For example, the CPU utilization rate corresponding to time slice T1 is 31%, and the CPU utilization rate corresponding to time slice T2 is 33%. Time slices T1 and T2 belong to time slice set C1, and the CPU utilization level corresponding to time slice set C1 is 30% to 35%. This embodiment does not limit the specific method of dividing the CPU utilization level.
[0098] Step S242: For each time slice set, calculate the set application performance value of the time slice set based on the application performance value corresponding to each time slice in the time slice set.
[0099] The collective application performance value of a time slice set can reflect the overall application performance characteristics of that time slice set, so this step calculates the collective application performance value of each time slice set.
[0100] In the specific calculation process, the collective application performance value of the time slice set is determined based on the probability distribution of the application performance values corresponding to that time slice set. For example, first determine the application performance values corresponding to the time slices included in the time slice set, calculate the probability of occurrence of each application performance value, and take the application performance value with the highest probability of occurrence as the collective application performance value of the time slice set.
[0101] Step S243: Determine the target time slice set based on the application's minimum performance requirement parameters; wherein the application performance value of the target time slice set matches the application's minimum performance requirement parameters.
[0102] Select the target time slice set from the time slice set that matches the application's performance value with the application's minimum performance requirement parameters.
[0103] In one optional implementation, different application performance levels can be set, such as application performance level 1 (95%–100%), application performance level 2 (90%–94%), etc. The set of time slices whose combined application performance values and minimum application performance requirements belong to the same application performance level is designated as the target time slice set. That is, the set of target time slices whose combined application performance values and minimum application performance requirements are at the same application performance level. For example, if the combined application performance value of time slice set C1 is 97% and the minimum application performance requirement is 96%, both belonging to application performance level 1, then time slice set C1 is determined as the target time slice set.
[0104] In another alternative implementation, the set of time slices whose application performance values are greater than or equal to the minimum performance requirement parameter of the application is used as the target time slice set, that is, the set of target time slices whose application performance values are greater than or equal to the minimum performance requirement parameter of the application.
[0105] Step S244: Determine the time slices in the target time slice set as candidate time slices.
[0106] In this embodiment, the time slice length of the candidate time slice is consistent with the user-configured time slice length parameter, and the application performance corresponding to the candidate time slice matches the user-configured minimum application performance requirement parameter. Therefore, the scheduling parameters of the candidate time slice can meet the current user needs.
[0107] Step S250: Determine the target time slice with the longest process I / O wait time from the candidate time slices.
[0108] As can be seen from step S240 above, the scheduling parameters of the candidate time slices can meet the current user needs. This step further determines the target time slice with the longest corresponding process I / O wait time from the candidate time slices, that is, further filtering the candidate time slices that meet the user needs to select the time slice that occupies the least CPU resources. The time slice that occupies the least CPU resources is the target time slice.
[0109] Step S260: Determine the CPU utilization parameter of the target application based on the CPU utilization corresponding to the target time slice, and determine the maximum process I / O wait time parameter of the target application based on the process I / O wait time of the target time slice.
[0110] The scheduling parameters of the target time slice can meet user needs and consume the least amount of CPU resources. Therefore, the CPU utilization parameters and maximum process I / O wait time parameters of the current target application can be determined based on the scheduling parameters of the target time slice.
[0111] Step S270: Based on the CPU utilization parameters and maximum process I / O wait time parameters of the target application, schedule the CPU resources required by the target application.
[0112] Therefore, this embodiment divides the preset historical time window into multiple time slices, and the length of each time slice is consistent with the user-configured time slice length parameter, ensuring that the time slice length of the subsequent target time slice meets the user's needs. Furthermore, it calculates the CPU utilization and application performance value corresponding to each time slice, and filters candidate time slices based on the application performance value and minimum performance requirement parameter. The scheduling parameters of the candidate time slices can meet the user's needs. Moreover, it determines the target time slice with the longest process I / O wait time from the candidate time slices. Scheduling the target application based on the scheduling parameters of the target time slice not only meets the user's needs but also minimizes CPU resource consumption, further avoiding idle resources and preventing CPU resource waste.
[0113] Example 3
[0114] Figure 4 A schematic diagram of a CPU resource scheduling device according to Embodiment 3 of the present invention is shown. Figure 4 As shown, the device 400 includes: an acquisition module 410, a determination module 420, and a scheduling module 430.
[0115] The acquisition module 410 is used to acquire the time slice length parameter configured for the target application and the minimum performance requirement parameter of the application.
[0116] The determination module 420 is used to determine the CPU utilization parameter and the maximum process I / O wait time parameter of the target application that match the time slice length parameter and the minimum performance requirement parameter of the application based on the collected CPU resource scheduling data and application performance data of the target application within a preset historical time window.
[0117] The scheduling module 430 is used to schedule the CPU resources required by the target application based on the CPU utilization parameters and the maximum process I / O wait time parameters of the target application.
[0118] In an optional implementation, the determining module is further configured to:
[0119] The preset historical time window is divided into multiple time slices; the length of each time slice is consistent with the time slice length parameter.
[0120] Based on the CPU resource scheduling data of the target application within the preset historical time window, calculate the CPU utilization rate corresponding to each time slice, and based on the application performance data of the target application within the preset historical time window, calculate the application performance value corresponding to each time slice.
[0121] Candidate time slices that match the application performance value with the minimum performance requirement parameter are determined from the plurality of time slices;
[0122] The target time slice with the longest process I / O wait time is determined from the candidate time slices;
[0123] The CPU utilization parameters of the target application are determined based on the CPU utilization corresponding to the target time slice, and the maximum process I / O wait time parameters of the target application are determined based on the process I / O wait time of the target time slice.
[0124] In an optional implementation, the determining module is further configured to:
[0125] Divide time slices corresponding to the same CPU utilization level into a set of time slices;
[0126] For each time slice set, calculate the set application performance value based on the application performance value corresponding to each time slice in the time slice set;
[0127] Based on the minimum performance requirement parameters of the application, a set of target time slices is determined; wherein the application performance value of the set of target time slices matches the minimum performance requirement parameters of the application.
[0128] The time slices in the target time slice set are identified as candidate time slices.
[0129] In an optional implementation, the determining module is further configured to:
[0130] The probability distribution of the application performance values corresponding to the time slice set is used to determine the set of application performance values for that time slice set.
[0131] In one optional implementation, the set of application performance values of the target time slice set is at the same application performance level as the minimum application performance requirement parameter;
[0132] Alternatively, the set of target time slices has an application performance value greater than or equal to the application's minimum performance requirement parameter.
[0133] In one alternative implementation, only the target application runs within the preset historical time window.
[0134] The specific implementation process of each module in this device can be referred to the description of the corresponding part in the method embodiment, and will not be repeated here.
[0135] Therefore, this device allows users to configure the time slice length parameters and minimum performance requirement parameters for the target application, thereby meeting their personalized needs. Furthermore, it determines the minimum CPU resource parameters that meet user requirements and performs CPU resource scheduling based on these parameters. This satisfies user needs while reducing idle resources and avoiding CPU resource waste. Specifically, this embodiment determines the mapping relationship between user requirement parameters and minimum CPU resource parameters based on collected CPU resource scheduling data and application performance data of the target application within a preset historical time window. This allows for accurate determination of the CPU utilization parameters and maximum process I / O wait time parameters of the target application that match the time slice length parameters and minimum performance requirement parameters, further improving the accuracy of CPU resource scheduling.
[0136] Example 4
[0137] Figure 5 A schematic diagram of a CPU resource scheduling system provided in Embodiment 4 of the present invention is shown. Figure 5 As shown, the system 500 includes: a CPU resource scheduling device 400 and a data monitoring module 600 set on the virtual machine side.
[0138] The data monitoring module is used to collect CPU resource scheduling data and application performance data of the target application within a preset historical time window.
[0139] In one alternative implementation, the CPU resource scheduling device 400 establishes a communication connection with the CPU scheduler to facilitate CPU resource scheduling for the target application.
[0140] Example 5
[0141] Embodiment 5 of the present invention provides a non-volatile computer storage medium, wherein the computer storage medium stores at least one executable instruction, which can execute the CPU resource scheduling method in any of the above method embodiments.
[0142] Example 6
[0143] Figure 6 A schematic diagram of a computing device according to Embodiment Six of the present invention is shown. The specific embodiments of the present invention do not limit the specific implementation of the computing device.
[0144] like Figure 6 As shown, the computing device may include: a processor 602, a communications interface 604, a memory 606, and a communications bus 608.
[0145] The processor 602, communication interface 604, and memory 606 communicate with each other via communication bus 608. Communication interface 604 is used to communicate with other network elements such as clients or other servers. The processor 602 executes program 610, specifically performing the relevant steps in the above-described embodiment of the CPU resource scheduling method.
[0146] Specifically, program 610 may include program code that includes computer operation instructions.
[0147] Processor 602 may be a central processing unit (CPU), an application-specific integrated circuit (ASIC), or one or more integrated circuits configured to implement embodiments of the present invention. The computing device includes one or more processors, which may be processors of the same type, such as one or more CPUs; or processors of different types, such as one or more CPUs and one or more ASICs.
[0148] Memory 606 is used to store program 610. Memory 606 may include high-speed RAM memory, and may also include non-volatile memory, such as at least one disk storage device.
[0149] Among them, Embodiments 5 and 6 are storage medium and computing device embodiments corresponding to the method embodiments. The specific implementation process of Embodiments 5 and 6 can be referred to the description in the corresponding method embodiments, and will not be repeated here.
[0150] The algorithms or displays provided herein are not inherently related to any particular computer, virtual system, or other device. Various general-purpose systems can also be used in conjunction with the teachings herein. The required structure for constructing such systems is apparent from the above description. Furthermore, the embodiments of the present invention are not directed to any particular programming language. It should be understood that the content of the invention described herein can be implemented using various programming languages, and the above description of specific languages is for the purpose of disclosing the best mode of implementation of the invention.
[0151] Numerous specific details are set forth in the specification provided herein. However, it will be understood that embodiments of the invention may be practiced without these specific details. In some instances, well-known methods, structures, and techniques have not been shown in detail so as not to obscure the understanding of this specification.
[0152] Similarly, it should be understood that, in order to simplify the invention and aid in understanding one or more of the various inventive aspects, features of the embodiments of the invention are sometimes grouped together in a single embodiment, figure, or description thereof in the above description of exemplary embodiments of the invention. However, this disclosure should not be construed as reflecting an intention that the claimed invention requires more features than are expressly recited in each claim. Rather, as reflected in the following claims, inventive aspects lie in fewer than all features of a single foregoing disclosed embodiment. Therefore, the claims following the detailed description are hereby expressly incorporated into this detailed description, wherein each claim itself is a separate embodiment of the invention.
[0153] Those skilled in the art will understand that modules in the device of the embodiments can be adaptively changed and placed in one or more devices different from that embodiment. Modules, units, or components in the embodiments can be combined into a single module, unit, or component, and further, they can be divided into multiple sub-modules, sub-units, or sub-components. Except where at least some of such features and / or processes or units are mutually exclusive, any combination can be used to combine all features disclosed in this specification (including the accompanying claims, abstract, and drawings) and all processes or units of any method or device so disclosed. Unless expressly stated otherwise, each feature disclosed in this specification (including the accompanying claims, abstract, and drawings) may be replaced by an alternative feature that serves the same, equivalent, or similar purpose.
[0154] Furthermore, those skilled in the art will understand that although some embodiments herein include certain features included in other embodiments but not others, combinations of features from different embodiments are intended to be within the scope of the invention and form different embodiments. For example, in the following claims, any of the claimed embodiments can be used in any combination.
[0155] The various component embodiments of the present invention can be implemented in hardware, or as software modules running on one or more processors, or a combination thereof. Those skilled in the art will understand that microprocessors or digital signal processors (DSPs) can be used in practice to implement some or all of the functions of some or all of the components according to the embodiments of the present invention. The present invention can also be implemented as a device or apparatus program (e.g., a computer program and computer program product) for performing part or all of the methods described herein. Such programs implementing the present invention can be stored on a computer-readable medium, or can be in the form of one or more signals. Such signals can be downloaded from an Internet website, provided on a carrier signal, or provided in any other form.
[0156] It should be noted that the above embodiments are illustrative of the invention and not restrictive, and that those skilled in the art can devise alternative embodiments without departing from the scope of the appended claims. In the claims, any reference signs placed between parentheses should not be construed as limiting the claims. The word "comprising" does not exclude the presence of elements or steps not listed in the claims. The word "a" or "an" preceding an element does not exclude the presence of a plurality of such elements. The invention can be implemented by means of hardware comprising several different elements and by means of a suitably programmed computer. In the unit claims enumerating several means, several of these means may be embodied by the same item of hardware. The use of the words first, second, and third, etc., does not indicate any order. These words can be interpreted as names. The steps in the above embodiments, unless otherwise specified, should not be construed as limiting the order of execution.
Claims
1. A method for scheduling CPU resources, characterized in that, include: Retrieve the time slice length parameter configured for the target application and the application's minimum performance requirements parameter; The preset historical time window is divided into multiple time slices; the length of each time slice is consistent with the time slice length parameter. Based on the CPU resource scheduling data of the target application within the preset historical time window, calculate the CPU utilization rate corresponding to each time slice, and based on the application performance data of the target application within the preset historical time window, calculate the application performance value corresponding to each time slice. From the multiple time slices, candidate time slices whose application performance values match the minimum performance requirement parameters are determined; from the candidate time slices, the target time slice with the longest corresponding process I / O wait time is determined. The CPU utilization parameters of the target application are determined based on the CPU utilization corresponding to the target time slice, and the maximum process I / O wait time parameters of the target application are determined based on the process I / O wait time of the target time slice. Based on the CPU utilization parameters and maximum process I / O wait time parameters of the target application, schedule the CPU resources required by the target application.
2. The method according to claim 1, characterized in that, The step of determining candidate time slices from the plurality of time slices that match the application performance value with the minimum performance requirement parameter further includes: Divide time slices corresponding to the same CPU utilization level into a set of time slices; For each time slice set, calculate the set application performance value based on the application performance value corresponding to each time slice in the time slice set; Based on the minimum performance requirement parameters of the application, a set of target time slices is determined; wherein the application performance value of the set of target time slices matches the minimum performance requirement parameters of the application. The time slices in the target time slice set are identified as candidate time slices.
3. The method according to claim 2, characterized in that, The step of calculating the set application performance value of the time slice set based on the application performance value corresponding to each time slice in the time slice set further includes: The set application performance value of the time slice set is determined based on the probability distribution of the application performance value corresponding to the time slice set.
4. The method according to claim 2, characterized in that, The set of target time slices has an application performance value that is at the same application performance level as the minimum application performance requirement parameter. Alternatively, the set of target time slices has an application performance value greater than or equal to the application's minimum performance requirement parameter.
5. The method according to any one of claims 1-4, characterized in that, Only the target application runs within the preset historical time window.
6. A CPU resource scheduling device, characterized in that, include: The acquisition module is used to obtain the time slice length parameter configured for the target application and the minimum performance requirement parameter of the application. A determination module is used to divide a preset historical time window into multiple time slices; wherein the length of each time slice is consistent with the time slice length parameter; calculate the CPU utilization rate corresponding to each time slice based on the CPU resource scheduling data of the target application within the preset historical time window, and calculate the application performance value corresponding to each time slice based on the application performance data of the target application within the preset historical time window; determine candidate time slices from the multiple time slices whose application performance values match the minimum performance requirement parameter; determine the target time slice with the largest corresponding process I / O wait time from the candidate time slices; determine the CPU utilization parameter of the target application based on the CPU utilization rate corresponding to the target time slice, and determine the maximum process I / O wait time parameter of the target application based on the process I / O wait time of the target time slice; The scheduling module is used to schedule the CPU resources required by the target application based on the CPU utilization parameters and the maximum process I / O wait time parameters of the target application.
7. A CPU resource scheduling system, characterized in that, include: The CPU resource scheduling device as described in claim 6, and the data monitoring module located on the virtual machine side; The data monitoring module is used to collect CPU resource scheduling data and application performance data of the target application within a preset historical time window.
8. A computing device, comprising: The processor, memory, communication interface, and communication bus are provided, wherein the processor, memory, and communication interface communicate with each other via the communication bus. The memory is used to store at least one executable instruction, which causes the processor to perform an operation corresponding to the CPU resource scheduling method as described in any one of claims 1-5.
9. A computer storage medium storing at least one executable instruction that causes a processor to perform an operation corresponding to the CPU resource scheduling method as described in any one of claims 1-5.