Resource allocation method and device, storage medium and computer program product

By collecting resource usage data of workloads on the cloud resource management platform, determining their resource usage types, and dynamically allocating CPU resources, the problem of low resource utilization in the existing technology is solved, and more efficient resource management and utilization is achieved.

CN120066773APending Publication Date: 2025-05-30CHINA MOBILE (SUZHOU) SOFTWARE TECH CO LTD +1
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202510125485.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-01-26
Publication Date
2025-05-30

AI Technical Summary

Technical Problem

The existing cloud resource management platform fails to effectively solve the problem of insufficient resources or waste when dealing with machines with different performances, resulting in low resource utilization.

Method used

By collecting resource usage data of workloads on the computing node, determining their resource usage type, and allocating corresponding CPU resources according to this type, dynamically adjusting the number of CPU cores and frequency to optimize resource utilization.

Benefits of technology

Improve resource utilization, reduce the impact of workloads on performance, and reduce the problem of insufficient resources or waste.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120066773A_ABST
    Figure CN120066773A_ABST
Patent Text Reader

Abstract

The invention provides a resource allocation method and device, a storage medium and a computer program product. The resource allocation method comprises the steps of collecting resource use data of a workload running on a first computing node within a preset time period; determining a resource use type corresponding to the workload according to the resource use data; and allocating CPU resources corresponding to the resource use type to the workload. The resource utilization rate can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of cloud computing, and in particular, to a resource allocation method, apparatus, storage medium, and computer program product. Background Art

[0002] Currently, in the process of resource management optimization, a cloud resource analysis and cost optimization platform based on cloud cost management (Financial Operations, FinOps), namely the Crane platform, has been proposed; the Crane platform can use the time series prediction algorithm - Digital Signal Processing (DSP) to calculate idle resources, perform elastic resource oversubscription and restrictions, and when the node metrics exceed the water level line, corresponding restrictions will be imposed on the pods. However, Crane does not consider machines with the same specifications but different performances.

[0003] To solve the above problems, there is currently a technology that can perform scheduling according to priorities. Specifically, a node calculates its own scheduling priority based on network coverage and remaining energy, and sends and receives messages containing the scheduling priority in the set of neighbor nodes. The above scheduling method considers the performance of the workload. However, there are still many situations in the actual use of the workload that affect the performance. Therefore, there will still be problems of resource shortage or waste, which in turn leads to low resource utilization. Summary of the Invention

[0004] The present application provides a resource allocation method, apparatus, storage medium, and computer program product, which can improve resource utilization.

[0005] The technical solution of the present application is implemented as follows:

[0006] In a first aspect, the present application proposes a resource allocation method, the method including:

[0007] Collecting resource usage data of a workload running on a first computing node within a preset time period;

[0008] Determining, according to the resource usage data, a resource usage type corresponding to the workload;

[0009] Allocating CPU resources corresponding to the resource usage type to the workload.

[0010] In a second aspect, the present application proposes a resource allocation apparatus, the resource allocation apparatus including:

[0011] A collection unit, configured to collect resource usage data of a workload running on a first computing node within a preset time period;

[0012] A determination unit, configured to determine a resource usage type corresponding to the workload according to the resource usage data;

[0013] An allocation unit, configured to allocate CPU resources corresponding to the resource usage type to the workload.

[0014] In a third aspect, the present application provides a resource allocation device, including: a processor, a memory, and a communication bus; the communication bus is used to implement connection communication between the processor and the memory; when the processor executes a running program stored in the memory, the above resource allocation method is implemented.

[0015] In a fourth aspect, the present application provides a storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the above resource allocation method is implemented.

[0016] In a fifth aspect, the present application provides a computer program product, including a computer program, and when the computer program is executed by a processor, the above resource allocation method is implemented.

[0017] The present application provides a resource allocation method, device, storage medium, and computer program product. The method includes: collecting resource usage data of a workload running on a first computing node within a preset time period; determining a resource usage type corresponding to the workload according to the resource usage data; and allocating CPU resources corresponding to the resource usage type to the workload. By adopting the above implementation solution, after the workload runs on the first computing node for a period of time, the resource usage data is monitored, and then it is divided into different resource usage types according to the resource usage situation, and different CPU resources are allocated to the workload according to the divided resource usage types, which fully considers the resource usage situation of the workload during operation, reduces the impact of the situation that occurs during the actual use of the workload on performance, reduces the problem of resource shortage or waste, and thus improves the resource utilization rate. Description of the Drawings

[0018] Figure 1 It is a flowchart of a resource allocation method provided by an embodiment of the present application;

[0019] Figure 2 It is a schematic diagram of an exemplary CPU core area division provided by an embodiment of the present application;

[0020] Figure 3 It is a module composition diagram of an exemplary resource allocation device provided by an embodiment of the present application;

[0021] Figure 4 It is a structural schematic of a resource allocation device provided by an embodiment of the present application Figure 1 ;

[0022] Figure 5 Structural schematic diagram of a resource allocation device provided by an embodiment of the present application Figure 2 。 Specific implementation manners

[0023] In order to understand the features and technical content of the embodiments of the present application in more detail, the implementation of the embodiments of the present application will be described in detail below with reference to the accompanying drawings. The accompanying drawings are for reference and illustration only and are not intended to limit the embodiments of the present application.

[0024] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by those skilled in the technical field to which this application belongs. The terms used herein are only for the purpose of describing the embodiments of this application and are not intended to limit this application.

[0025] In the following description, reference is made to "some embodiments", which describe a subset of all possible embodiments. However, it can be understood that "some embodiments" can be the same subset or different subsets of all possible embodiments and can be combined with each other without conflict. It should also be noted that the terms "first / second / third" related to the embodiments of this application are only used to distinguish similar objects and do not represent a specific order for the objects. It can be understood that "first / second / third" can be interchanged with a specific order or sequence when allowed, so that the embodiments of this application described here can be implemented in an order other than that illustrated or described here.

[0026] An embodiment of the present application provides a resource allocation method, as Figure 1 shown, this method may include:

[0027] S101. Collect resource usage data of the workload running on the first computing node within a preset time period.

[0028] A resource allocation method proposed by an embodiment of the present application is applicable to the case of meeting the service level agreement (SLA) of the workload.

[0029] In the embodiment of the present application, the preset time period may be 24 hours a day, 7 days a week, etc., and specifically can be selected according to the actual situation, and the embodiment of the present application does not make specific limitations.

[0030] In the embodiment of the present application, the resource usage data may be the CPU resource usage amount, etc., and specifically can be selected according to the actual situation, and the embodiment of the present application does not make specific limitations.

[0031] It should be noted that before collecting the resource usage data of the workload running on the first computing node during the preset period, it is necessary to determine the computing node where the workload is running first, and schedule the workload to the determined first computing node. The specific methods are as follows: Obtain the resource requirement information of the workload and the remaining resource information of multiple computing nodes; Based on the resource requirement information and the remaining resource information of multiple computing nodes, determine multiple resource matching degree information between the workload and multiple computing nodes; Find the first resource matching degree information with the largest value from multiple resource matching degree information; And determine the first computing node corresponding to the first resource matching degree information from multiple computing nodes; Schedule the workload to run on the first computing node.

[0032] It should be noted that machines with different brands but the same specifications usually have different performances, as shown in Table 1.

[0033] Table 1

[0034] CPU Number of Cores Clock Frequency (GHz) AMD EPYC 7A23 48 2.8 Kunpeng920-5250 32 2.6 Hygon 7380 32 2.2

[0035] In the embodiments of the present application, the resource matching degree information Match is defined to represent the matching degree between the resource requirement information of the workload and the remaining resource information of multiple computing nodes. Workloads in different operating modes can complement each other to improve the utilization rate of cluster resources and reduce the risk of resource fragmentation at the same time.

[0036] Specifically, the calculation process of Match is shown in formula (1).

[0037]

[0038] Among them, O represents the resource requirement information of the workload, Q represents the remaining resource information of each computing node, q nh represents the remaining resource information of resource type h on computing node n, s ih represents the demand of one replica of workload i for resource h. If x irn = 1, it means that the replica r of application workload i is deployed on computing node n.

[0039] It should be noted that the scheduling plugin will calculate multiple resource matching degree information between the workload and multiple computing nodes, and schedule the workload to the first computing node with a high score.

[0040] S102. Determine the resource usage type corresponding to the workload according to the resource usage data.

[0041] In the embodiments of the present application, the resource usage types of all workloads are pre-divided into 4 categories, namely: continuous resource usage situation, day-night resource usage situation, burst resource usage situation, and irregular resource usage situation.

[0042] The continuous resource usage can be similar to that of MySQL or Network File System (NFS). For the long-term resource usage of the workload, relatively few changes occur, and the traffic input / output (IO) remains relatively stable. This type of workload requires ensuring its long-term resource usage performance.

[0043] The day-night type of resource usage can be similar to business applications and some online services. The workload shows different usage peaks during the day and at night. This type of workload requires scaling the resource usage up or down during peak / daily periods.

[0044] The bursty resource usage can be similar to e-commerce promotion activities. The workload experiences extremely high and unpredictable resource usage within a short period of time. Corresponding resources need to be reserved for this type of workload, and scaling up and down should be performed quickly during the burst.

[0045] The irregular resource usage may be due to the uncertainty of user behavior and the characteristics of the workload. In this mode, the workload shows no obvious patterns and models.

[0046] In the embodiment of the present application, first, according to the resource usage data, the first information is determined; wherein, the first information includes at least one of the following: resource utilization rate dispersion information, resource utilization rate autocorrelation information, resource utilization rate change rate information, and resource utilization rate peak-valley ratio information. Then, based on the first information, the resource usage type corresponding to the workload is determined.

[0047] In the embodiment of the present application, a normalized resource utilization rate curve is generated from the resource usage data as a measurement standard. Based on the normalized resource utilization rate curve, at least one of the resource utilization rate dispersion information, resource utilization rate autocorrelation information, resource utilization rate change rate information, and resource utilization rate peak-valley ratio information can be determined.

[0048] It should be noted that the resource utilization rate dispersion information may include the standard deviation, variance, etc. of the normalized resource utilization rate, and specific selection can be made according to the actual situation. The embodiment of the present application does not make specific limitations.

[0049] In one embodiment, if the resource utilization rate dispersion information is less than the first threshold, the resource usage type is determined to be the first type.

[0050] In the embodiment of the present application, the first threshold can be 0.5, etc., and specific selection can be made according to the actual situation. The embodiment of the present application does not make specific limitations.

[0051] In the embodiment of the present application, the first type is the continuous resource usage situation.

[0052] Exemplarily, if the standard deviation of the normalized resource utilization rate is lower than the threshold of 0.5, it can be determined that the resource usage type is continuous resource usage.

[0053] It should be noted that the autocorrelation information of the resource utilization rate can be the autocorrelation function of the normalized resource utilization rate.

[0054] In another embodiment, if the autocorrelation information of the resource utilization rate meets the periodic change condition, it is determined that the resource usage type is the second type.

[0055] In the embodiments of the present application, the periodic change condition can be that the autocorrelation function of the normalized resource utilization rate changes periodically.

[0056] In the embodiments of the present application, the second type is the day-night type resource usage.

[0057] Exemplarily, the periodic fluctuations are identified by calculating the autocorrelation function of the normalized resource utilization rate to determine the day-night type workload.

[0058] It should be noted that the resource utilization rate change rate information includes the change rate r and the slope p of the resource utilization rate. Specifically, it can be selected according to the actual situation, and the embodiments of the present application do not make specific limitations.

[0059] In another embodiment, if the resource utilization rate change rate information is greater than the second threshold, it is determined that the resource usage type is the third type.

[0060] It should be noted that corresponding thresholds can be set for the change rate r and the slope p of the resource utilization rate respectively, which are collectively referred to as the second threshold in the present application.

[0061] Optionally, the corresponding threshold set for the change rate r of the resource utilization rate is 0.6, and the corresponding threshold set for the slope p of the resource utilization rate is 0.5. Specifically, it can be selected according to the actual situation, and the embodiments of the present application do not make specific limitations.

[0062] In the embodiments of the present application, the third type is the burst type resource usage.

[0063] Exemplarily, if the change rate r of the normalized resource utilization rate curve is greater than 0.6 and the slope p of the normalized resource utilization rate curve is greater than 0.5, it indicates that within a short period of time, the resource utilization rate rises sharply. At this time, it is determined as a burst type workload.

[0064] In another embodiment, if the resource utilization rate peak-valley ratio information meets the irregular usage condition, indicating that the resource is used irregularly, it is determined that the resource usage type is the fourth type.

[0065] In the embodiments of the present application, the fourth type is the irregular resource usage situation.

[0066] In the embodiments of the present application, the irregular usage conditions may be that the difference between the peak-valley ratio information of multiple resource utilization rates is greater than a preset value, or the peak-valley ratio information of the resource utilization rate is greater than a preset value, etc. Specifically, it can be selected according to the actual situation, and the embodiments of the present application do not make specific limitations.

[0067] Exemplarily, the workload classification criteria for different resource usage types can be seen in Table 2.

[0068] Table 2

[0069]

[0070] It should be noted that all workloads, unless they have strong resource usage characteristics (such as the Graphics Processing Unit (GPU) tasks for processing large model training will be marked as bursty resource usage situations), will otherwise be initially marked as continuous resource usage situations.

[0071] It should be noted that the classification will be adjusted with the change of the normalized resource utilization curve, and it is expected that good Quality of Service (QoS) can still be guaranteed with less power reduction.

[0072] It should be noted that in order to avoid potential QoS degradation, when the running intensity of the computing node is low, the workload is forced to be classified as a continuous resource usage situation.

[0073] It can be understood that when the workload SLA is met, the workload is scheduled to a suitable computing node to achieve load balancing as much as possible and improve resource utilization rate.

[0074] S103. Allocate CPU resources corresponding to the resource usage type for the workload.

[0075] In the embodiments of the present application, the CPU resources of the computing node are pre-divided into three parts. One part is the first CPU resource, corresponding to the stable area, which is used to serve the workloads of the first type and / or the second type. One part is the second CPU resource, corresponding to the basic area, which is used to serve the workloads of the third type and / or the fourth type. The last part is the third CPU resource, corresponding to the dynamic area, which does not serve any workloads, mainly for periodically adjusting the first CPU resource and / or the second CPU resource, including addition and idle recovery.

[0076] In the embodiments of the present application, the CPU resources may be CPU cores. Specifically, it can be selected according to the actual situation, and the embodiments of the present application do not make specific limitations.

[0077] Exemplarily, referring to Figure 2 , there are a total of 10 CPU cores on the computing node. Among them, three CPU cores are used to serve the workloads of continuous resource usage and diurnal resource usage; three CPU cores are used to serve the workloads of bursty resource usage and irregular resource usage, and the remaining two CPU cores are used for subsequent dynamic adjustment of CPU resources.

[0078] In one embodiment, if the resource usage type is the first type and / or the second type, the first CPU resources are allocated to the workloads; the first CPU resources are part of the CPU resources on the first computing node.

[0079] In another embodiment, if the resource usage type is the third type and / or the fourth type, the second CPU resources are allocated to the workloads; the second CPU resources are part of the CPU resources on the first computing node except the first CPU resources.

[0080] It should be noted that the resource usage data of all workloads can be collected every 10 minutes, and the workloads after running for 24 hours can be preliminarily classified. Since the number of CPU cores of the server is the key point concerned during the running process of the workloads and it also consumes nearly one-third of the energy consumption of the server, reasonably adjusting the CPU cores can effectively reduce the running energy consumption, and subsequent dynamic adjustment can be performed according to the resource usage situation. Specifically, the subsequent dynamic adjustment can refer to the following two embodiments.

[0081] In one embodiment, after allocating the CPU resources corresponding to the resource usage type to the workloads, the CPU resources can also be dynamically adjusted. Specifically: monitor the resource demand change information of the workloads and / or the resource utilization rate information of the CPU resources; based on the resource demand change information and / or the resource utilization rate information of the CPU resources, adjust the size of the CPU resources.

[0082] It should be noted that when the resource demand of the workloads increases rapidly, that is, when the resource demand peak of the first computing node is detected, the resource demands of the workloads of bursty resource usage and irregular usage are preferentially guaranteed.

[0083] It should be noted that when the resource utilization rate information of the computing node is low, there is no need to retain redundant CPU resources. At this time, the third CPU resources will periodically collect the idle CPU resources in the first CPU resources and the second CPU resources.

[0084] In an embodiment of the present application, referring to the soft isolation mechanism for CPU cycle collection in the IDLE (idle state), SCHED_OTHER (also known as SCHED_NORMAL in the Linux kernel source code) is used. It is the standard Linux time-sharing scheduler for all threads that do not require special real-time mechanisms. In contrast, runnable SCHED_RR processes are always scheduled above any SCHED_OTHER process.

[0085] It can be understood that by dynamically adjusting the number of CPU cores, the performance of the workload in the basic area can be greatly improved. Especially when the peak comes, the workload performance in the stable area and the basic area is basically not affected, and the resource utilization rate is increased.

[0086] In another embodiment, after allocating CPU resources corresponding to the resource usage type for the workload, the CPU frequency can also be dynamically adjusted. Specifically: monitor the running state data of the CPU resources; based on the running state data, adjust the working frequency of the CPU resources.

[0087] In an embodiment of the present application, the running state data of the CPU resources includes: CPU frequency f, CPU usage rate u, core cycle c, LLC miss rate l ms , which is usually collected in real time using Prometheus.

[0088] In an embodiment of the present application, calculate the Instructions Per Second (IPS) of the CPU resources based on the running state data. Specifically, refer to formula (2).

[0089] IPS = F(f, u, c, l ms ) (2)

[0090] This algorithm will monitor the running state of the number of CPU cores in the stable area and the basic area in real time and decide when to adjust the CPU frequency. At each decision point, the algorithm will use the maximum frequency f max as the baseline F(f max , ·), and then use the Long Short-Term Memory (LSTM) prediction model to obtain the corresponding IPS at all available frequencies, and select the lowest frequency that meets the preset constraint conditions as the working frequency f target . Specifically, refer to formula (3).

[0091]

[0092] Among them, F(f, ·) can be determined according to the IPS.

[0093] It can be understood that when the phase of the cumulative average prediction error changes, the IPS prediction model will be updated. Since this application pays more attention to the relationship between IPS between f max and f target as long as the IPS model can provide consistent prediction results, a certain amount of error can be accepted. The embodiments of this application can use the Interval Coefficient of Variation (ICOV) to detect the change of the cumulative average prediction error. ICOV measures the interval uniformity between different phases.

[0094] Optionally, set 25% as the threshold for detecting phase change. When ICOV is greater than 25%, update the IPS prediction model using the latest collected data set.

[0095] It can be understood that the embodiments of this application propose a CPU frequency adjustment algorithm based on workload performance to select the best frequency to run the workload, achieve considerable power savings, and minimize the performance impact on all workloads.

[0096] Based on the above embodiments, the embodiments of this application propose a resource allocation device, as Figure 3 shown. The device includes: a resource matching and scheduling module, a classification module, and a CPU resource dynamic adjustment module. Among them, the resource matching and scheduling module calculates the resource matching degree Match between workload 1, workload 2, workload 3, and the computing node, and selects a suitable computing node. Then, uses a classification algorithm to schedule the workload to the corresponding suitable computing node. In the classification module, the resource usage types are divided into continuous resource usage situations, day-night resource usage situations, burst resource usage situations, and irregular resource usage situations. The corresponding resource usage type can be determined according to the resource usage data of the workload. The CPU resource dynamic adjustment module divides the CPU core area into a stable area, a basic area, and a dynamic area, allocates different CPU core areas for the workload according to the resource usage type corresponding to the workload. Then, the CPU cores in the dynamic area can also perform operations of periodically collecting CPU space resources and implementing the CPU frequency condition algorithm based on workload performance.

[0097] It can be understood that after the workload runs on the first computing node for a period of time, monitor the resource usage data, then divide it into different resource usage types according to the resource usage situation, and allocate different CPU resources for the workload according to the divided resource usage types, which fully considers the resource usage situation of the workload during operation, reduces the impact of the situation that occurs during the actual use of the workload on performance, reduces the problem of resource shortage or waste, and thus improves resource utilization.

[0098] An embodiment of the present application provides a resource allocation device. As Figure 4 shown, the resource allocation device 1 includes:

[0099] An acquisition unit 10, configured to acquire resource usage data of a workload running on a first computing node within a preset time period;

[0100] A determination unit 11, configured to determine a resource usage type corresponding to the workload according to the resource usage data;

[0101] An allocation unit 12, configured to allocate CPU resources corresponding to the resource usage type for the workload.

[0102] Optionally, the device further includes: an acquisition unit, a search unit, and a scheduling unit;

[0103] The acquisition unit is configured to acquire resource requirement information of the workload and remaining resource information of multiple computing nodes;

[0104] The determination unit 11 is further configured to determine multiple resource matching degree information between the workload and the multiple computing nodes based on the resource requirement information and the multiple remaining resource information;

[0105] The search unit is configured to search for first resource matching degree information with the largest value from the multiple resource matching degree information; and determine a first computing node corresponding to the first resource matching degree information from the multiple computing nodes;

[0106] The scheduling unit is configured to schedule the workload to run on the first computing node.

[0107] Optionally, the determination unit 11 is further configured to determine first information according to the resource usage data; the first information includes at least one of the following: resource usage rate dispersion information, resource usage rate autocorrelation information, resource usage rate change rate information, resource usage rate peak-valley ratio information; if the resource usage rate dispersion information is less than a first threshold, it is determined that the resource usage type is a first type; if the resource usage rate autocorrelation information meets the periodic change condition, it is determined that the resource usage type is a second type; if the resource usage rate change rate information is greater than a second threshold, it is determined that the resource usage type is a third type; if the resource usage rate peak-valley ratio information meets the irregular usage condition, it is determined that the resource usage type is a fourth type.

[0108] Optionally, the allocation unit 12 is further configured to allocate first CPU resources to the workload if the resource usage type is the first type and / or the second type; the first CPU resources are part of the CPU resources on the first computing node; if the resource usage type is the third type and / or the fourth type, allocate second CPU resources to the workload; the second CPU resources are part of the CPU resources on the first computing node except the first CPU resources.

[0109] Optionally, the apparatus further includes: a monitoring unit and an adjustment unit;

[0110] The monitoring unit is configured to monitor the resource demand change information of the workload and / or the resource utilization information of the CPU resources;

[0111] The adjustment unit is configured to adjust the size of the CPU resources based on the resource demand change information and / or the resource utilization information of the CPU resources.

[0112] Optionally, the monitoring unit is further configured to monitor the operation status data of the CPU resources;

[0113] The adjustment unit is further configured to adjust the operating frequency of the CPU resources based on the operation status data.

[0114] A resource allocation apparatus provided by an embodiment of the present application collects resource usage data of a workload running on a first computing node within a preset period; determines a resource usage type corresponding to the workload according to the resource usage data; and allocates CPU resources corresponding to the resource usage type to the workload. It can be seen that the resource allocation apparatus proposed in this embodiment monitors the resource usage data after the workload runs on the first computing node for a period of time, then divides it into different resource usage types according to the resource usage situation, and allocates different CPU resources to the workload according to the divided resource usage types, fully considering the resource usage situation of the workload during operation, reducing the impact of the situation that occurs during the actual use of the workload on performance, reducing the problem of resource shortage or waste, and thus improving resource utilization.

[0115] Figure 5 Schematic composition structure of a resource allocation apparatus 1 provided by an embodiment of the present application Figure 2 , in practical applications, based on the same inventive concept of the above embodiment, as Figure 5 shown, the resource allocation apparatus 1 of this embodiment includes: a processor 13, a memory 14, and a communication bus 15.

[0116] The above-mentioned processor 13 may be at least one of an application specific integrated circuit (ASIC), a digital signal processor (DSP), a digital signal processing device (DSPD), a programmable logic device (PLD), a field programmable gate array (FPGA), a CPU, a controller, a microcontroller, and a microprocessor. It can be understood that for different devices, the electronic devices used to implement the functions of the above-mentioned processor may also be others, and the present embodiment does not make specific limitations.

[0117] In the embodiment of the present application, the above-mentioned communication bus 15 is used to implement the connection and communication between the processor 13 and the memory 14; when the above-mentioned processor 13 executes the running program stored in the memory 14, the following resource allocation method is implemented:

[0118] Collect the resource usage data of the workload running on the first computing node within a preset time period; determine the resource usage type corresponding to the workload according to the resource usage data; and allocate the CPU resources corresponding to the resource usage type to the workload.

[0119] Furthermore, the above-mentioned processor 13 is further configured to obtain the resource requirement information of the workload and the remaining resource information of multiple computing nodes; determine multiple resource matching degree information between the workload and the multiple computing nodes based on the resource requirement information and the multiple remaining resource information; find the first resource matching degree information with the largest value from the multiple resource matching degree information; and determine the first computing node corresponding to the first resource matching degree information from the multiple computing nodes; and schedule the workload to run on the first computing node.

[0120] Further, the above-mentioned processor 13 is further configured to determine first information according to the resource usage data; the first information includes at least one of the following: resource usage rate dispersion information, resource usage rate autocorrelation information, resource usage rate change rate information, and resource usage rate peak-valley ratio information; if the resource usage rate dispersion information is less than a first threshold, determine that the resource usage type is a first type; if the resource usage rate autocorrelation information meets the periodic change condition, determine that the resource usage type is a second type; if the resource usage rate change rate information is greater than a second threshold, determine that the resource usage type is a third type; if the resource usage rate peak-valley ratio information meets the irregular usage condition, determine that the resource usage type is a fourth type.

[0121] Further, the above-mentioned processor 13 is further configured to, if the resource usage type is the first type and / or the second type, allocate first CPU resources to the workload; the first CPU resources are part of the CPU resources on the first computing node; if the resource usage type is the third type and / or the fourth type, allocate second CPU resources to the workload; the second CPU resources are part of the CPU resources on the first computing node other than the first CPU resources.

[0122] Further, the above-mentioned processor 13 is further configured to monitor the resource demand change information of the workload and / or the resource utilization information of the CPU resources; based on the resource demand change information and / or the resource utilization information of the CPU resources, adjust the size of the CPU resources.

[0123] Further, the above-mentioned processor 13 is further configured to monitor the operating state data of the CPU resources; based on the operating state data, adjust the operating frequency of the CPU resources.

[0124] An embodiment of the present application provides a storage medium, on which a computer program is stored. The above-mentioned computer-readable storage medium stores one or more programs, and the one or more programs can be executed by one or more processors and are applied to a resource allocation device. The computer program implements the resource allocation method as described above.

[0125] Based on the above embodiments, an embodiment of the present application provides a computer program product, including a computer program, and the computer program can be executed by one or more processors. The computer program implements the resource allocation method as described above.

[0126] It should be noted that in this document, the term "including", "comprising" or any other variation thereof is intended to cover non-exclusive inclusion, such that a process, method, article or device comprising a series of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article or device. Without further limitation, an element defined by the statement "comprising an..." does not exclude the presence of additional identical elements in the process, method, article or device comprising that element.

[0127] From the description of the above embodiments, those skilled in the art can clearly understand that the above-described example methods can be implemented by means of software plus a necessary general hardware platform. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation. Based on this understanding, the technical solution of the present disclosure, in essence or the part that contributes to the related art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) and includes several instructions for causing an image display device (which can be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods described in the various embodiments of the present disclosure.

[0128] The above is only a preferred embodiment of the present application and is not intended to limit the protection scope of the present application.

Claims

1. A resource allocation method, characterized in that: The method comprises: Collecting resource usage data of workloads running on the first computing node within a preset time period; Determining a resource usage type corresponding to the workload according to the resource usage data; Allocate CPU resources corresponding to the resource usage type to the workload.

2. The method according to claim 1, characterized in that: Before collecting resource usage data of workloads running on the first computing node within a preset period of time, the method further includes: Obtain resource demand information of the workload and multiple remaining resource information of multiple computing nodes; Based on the resource demand information and the plurality of remaining resource information, determining a plurality of resource matching degree information between the workload and the plurality of computing nodes respectively; Searching for first resource matching degree information having the largest value from the plurality of resource matching degree information; and determining a first computing node corresponding to the first resource matching degree information from the plurality of computing nodes; The workload is scheduled to run on the first computing node.

3. The method according to claim 1, characterized in that The determining, according to the resource usage data, the resource usage type corresponding to the workload includes: Determine first information according to the resource usage data; the first information includes at least one of the following: resource usage rate dispersion information, resource usage rate autocorrelation information, resource usage rate change rate information, resource usage rate peak-to-valley ratio information; If the resource usage rate dispersion information is less than a first threshold, determining that the resource usage type is a first type; If the resource usage rate self-correlation information satisfies a periodic change condition, determining that the resource usage type is the second type; If the resource usage rate change rate information is greater than a second threshold, determining that the resource usage type is a third type; If the resource usage peak-to-valley ratio information meets the irregular usage condition, the resource usage type is determined to be the fourth type.

4. The method according to claim 1 or 3, characterized in that: The allocating the CPU resources corresponding to the resource usage type to the workload includes: If the resource usage type is the first type and / or the second type, a first CPU resource is allocated to the workload; the first CPU resource is part of the CPU resources on the first computing node; If the resource usage type is the third type and / or the fourth type, a second CPU resource is allocated to the workload; the second CPU resource is part of the CPU resources on the first computing node except the first CPU resource.

5. The method according to claim 1, characterized in that After allocating the CPU resources corresponding to the resource usage type to the workload, the method further includes: Monitoring resource demand change information of the workload and / or resource utilization information of the CPU resources; Based on the resource demand change information and / or the resource utilization information of the CPU resource, the size of the CPU resource is adjusted.

6. The method according to claim 1, characterized in that After allocating the CPU resources corresponding to the resource usage type to the workload, the method further includes: Monitoring the operating status data of the CPU resources; Based on the operating status data, the operating frequency of the CPU resource is adjusted.

7. A resource allocation device, characterized in that: The resource allocation device comprises: A collection unit, used to collect resource usage data of workloads running on the first computing node within a preset period of time; a determining unit, configured to determine a resource usage type corresponding to the workload according to the resource usage data; An allocation unit is used to allocate CPU resources corresponding to the resource usage type to the workload.

8. A resource allocation device, characterized in that: The resource allocation device includes: a processor, a memory and a communication bus; the communication bus is used to realize the connection and communication between the processor and the memory; when the processor executes the running program stored in the memory, the method according to any one of claims 1 to 6 is implemented.

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

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

Citation Information

Cited By

  • Resource allocation method and apparatus, and storage medium and computer program product

    WO2026158174A1