Resource allocation method and apparatus, and storage medium and computer program product
By classifying workload resource usage data and dynamically allocating CPU resources, the problem of insufficient or wasted resources in resource management is solved, and more efficient resource utilization is achieved.
Patent Information
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- CHINA MOBILE (SUZHOU) SOFTWARE TECH CO LTD
- Filing Date
- 2026-01-16
- Publication Date
- 2026-07-30
AI Technical Summary
Existing technologies have failed to effectively address the problem of resource shortages or waste caused by machines of the same specifications but different performance in resource management, resulting in low resource utilization.
By collecting resource usage data from workloads, they are categorized into four types: continuous, diurnal, bursty, and irregular. CPU resources are dynamically allocated according to these categories, and resource allocation is optimized by dynamically adjusting the number of CPU cores and frequency.
It improved resource utilization, reduced resource shortages or waste, and enhanced the efficiency and performance of resource management.
Smart Images

Figure CN2026073040_30072026_PF_FP_ABST
Abstract
Description
A resource allocation method and apparatus, storage medium, and computer program product
[0001] Cross-references to related applications
[0002] This application is based on and claims priority to Chinese Patent Application No. 2025101254855, filed on January 26, 2025, the entire contents of which are hereby incorporated herein by reference. Technical Field
[0003] This application relates to the field of cloud computing, and more particularly to a resource allocation method and apparatus, storage medium, and computer program product. Background Technology
[0004] Currently, in the process of optimizing resource management, a cloud resource analysis and cost optimization platform based on Financial Operations (FinOps), namely the Crane platform, has been proposed. The Crane platform can use time series forecasting algorithms—Digital Signal Processing (DSP)—to calculate idle resources, perform elastic resource overselling and limiting, and restrict corresponding pods when node metrics exceed thresholds. However, Crane does not consider machines with the same specifications but different performance levels.
[0005] To address the aforementioned issues, current technologies offer priority-based scheduling. Specifically, nodes calculate their own scheduling priority based on network coverage and remaining energy, and then send and receive messages containing this priority from their neighboring node set. This scheduling method considers workload performance. However, in actual use, many situations can still arise that impact performance, leading to resource insufficiency or waste, and consequently, low resource utilization. Summary of the Invention
[0006] This application provides a resource allocation method and apparatus, a storage medium, and a computer program product. These can improve resource utilization.
[0007] The technical solution of this application is implemented as follows:
[0008] Firstly, this application proposes a resource allocation method, the method comprising:
[0009] Collect resource usage data of workloads running on the first computing node within a preset time period;
[0010] Based on the resource usage data, determine the resource usage type corresponding to the workload;
[0011] Allocate CPU resources corresponding to the resource usage type to the workload.
[0012] Secondly, this application proposes a resource allocation device, the resource allocation device comprising:
[0013] The data acquisition unit is configured to collect resource usage data of the workloads running on the first computing node within a preset time period;
[0014] The determining unit is configured to determine the resource usage type corresponding to the workload based on the resource usage data;
[0015] The allocation unit is configured to allocate CPU resources corresponding to the resource usage type to the workload.
[0016] Thirdly, this application proposes a resource allocation device, which 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; the processor implements the above-mentioned resource allocation method when executing the running program stored in the memory.
[0017] Fourthly, this application proposes a storage medium on which a computer program is stored, which, when executed by a processor, implements the above-described resource allocation method.
[0018] Fifthly, this application proposes a computer program product, including a computer program that implements the above-described resource allocation method when executed by a processor.
[0019] This application provides a resource allocation method and apparatus, 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 the resource usage type corresponding to the workload based on the resource usage data; and allocating CPU resources corresponding to the resource usage type to the workload. By adopting the above implementation scheme, resource usage data is monitored after the workload runs on the first computing node for a period of time. Then, based on the resource usage, different resource usage types are classified, and different CPU resources are allocated to the workload according to the classified resource usage types. This fully considers the resource usage of the workload during operation, reduces the impact of actual workload usage on performance, reduces resource shortages or waste, and thus improves resource utilization. Attached Figure Description
[0020] Figure 1 is a flowchart of a resource allocation method provided in an embodiment of this application;
[0021] Figure 2 is a schematic diagram of an exemplary CPU core region division provided in an embodiment of this application;
[0022] Figure 3 is a block diagram of an exemplary resource allocation device provided in an embodiment of this application;
[0023] Figure 4 is a schematic diagram of a resource allocation device provided in an embodiment of this application;
[0024] Figure 5 is a schematic diagram of the structure of a resource allocation device provided in an embodiment of this application. Detailed Implementation
[0025] In order to gain a more detailed understanding of the features and technical content of the embodiments of this application, the implementation of the embodiments of this 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 this application.
[0026] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used herein is for the purpose of describing embodiments of this application only and is not intended to limit this application.
[0027] In the following description, references to "some embodiments" refer to a subset of all possible embodiments. It is understood that "some embodiments" may be the same or different subsets of all possible embodiments and may be combined with each other without conflict. It should also be noted that the terms "first, second, third" used in the embodiments of this application are merely for distinguishing similar objects and do not represent a specific ordering of objects. It is understood that "first, second, third" may be interchanged in a specific order or sequence where permitted, so that the embodiments of this application described herein can be implemented in an order other than that illustrated or described herein.
[0028] This application provides a resource allocation method, as shown in Figure 1, which may include:
[0029] S101. Collect resource usage data of the workloads running on the first computing node within a preset time period.
[0030] The resource allocation method proposed in this application is applicable when the Service Level Agreement (SLA) of the workload is satisfied.
[0031] In this embodiment of the application, the preset time period can be 24 hours a day, 7 days a week, etc., and the specific time period can be selected according to the actual situation. This embodiment of the application does not make specific limitations.
[0032] In this embodiment, the resource usage data can be CPU resource usage, etc., and the specific data can be selected according to the actual situation. This embodiment does not impose any specific limitations.
[0033] It should be noted that before collecting resource usage data of workloads running on the first computing node within a preset time period, it is necessary to first determine the computing node of the running workload and schedule the workload to the determined first computing node. Specifically, this includes the following methods: obtaining resource requirement information of the workload and multiple remaining resource information of multiple computing nodes; determining multiple resource matching degree information between the workload and multiple computing nodes based on the resource requirement information and multiple remaining resource information; finding the first resource matching degree information with the largest value from the multiple resource matching degree information; determining the first computing node corresponding to the first resource matching degree information from the multiple computing nodes; and scheduling the workload to run on the first computing node.
[0034] It should be noted that machines of the same specifications but different brands usually have different performance characteristics, as shown in Table 1.
[0035] Table 1
[0036] In this embodiment of the application, a resource matching information Match is defined to characterize the matching degree between the resource requirement information of the workload and the remaining resource information of multiple computing nodes. Workloads with different operating modes can complement each other to improve the cluster resource utilization rate and reduce the risk of resource fragmentation.
[0037] Specifically, the calculation process for Match is shown in formula (1).
[0038] Where O represents the resource requirements of the workload, Q represents the remaining resource information of each compute node, and q nh This represents the remaining resource information of resource type h on computing node n, s ih This represents the resource requirement h for workload i with one replica. If x irn =1 indicates that the replica r of application load i is deployed on compute node n.
[0039] It should be noted that the scheduling plugin calculates the resource matching information between the workload and multiple compute nodes, and schedules the workload to the first compute node with the highest score.
[0040] S102. Based on the resource usage data, determine the resource usage type corresponding to the workload.
[0041] In this embodiment of the application, all workload resource usage types are pre-classified into four categories: continuous resource usage, day-night resource usage, burst resource usage, and irregular resource usage.
[0042] Continuous resource usage can be similar to MySQL and Network File System (NFS). The long-term resource usage of the workload changes relatively little, and the input / output (IO) traffic remains relatively stable. This type of workload needs to ensure its long-term resource usage performance.
[0043] Diurnal resource usage patterns are similar to those of business applications and some online services, which exhibit different peak usage times during the day and night. These types of workloads require scaling up or down resource usage during peak / normal periods.
[0044] Explosive resource usage can be similar to e-commerce promotional events, where workloads experience unpredictable and extremely high resource usage within a short period of time. It is necessary to reserve corresponding resources for such workloads and quickly scale up or down during the explosive period.
[0045] Irregular resource usage may be caused by the uncertainty of user behavior and the characteristics of the workload. In this mode, the workload does not show obvious patterns or regularities.
[0046] In this embodiment, firstly, first information is determined based on resource usage data; 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-to-valley ratio information. Then, the resource usage type corresponding to the workload is determined based on the first information.
[0047] In this embodiment, a normalized resource utilization rate curve is generated based on resource usage data as a measurement standard. Based on the normalized resource utilization rate curve, at least one of the following can be determined: resource utilization rate dispersion information, resource utilization rate autocorrelation information, resource utilization rate change rate information, and resource utilization rate peak-to-valley ratio information.
[0048] It should be noted that the resource utilization dispersion information may include the standard deviation and variance of the normalized resource utilization rate, etc. The specific selection can be made according to the actual situation, and this application embodiment does not make specific limitations.
[0049] In one embodiment, if the resource utilization dispersion information is less than a first threshold, the resource utilization type is determined to be the first type.
[0050] In this embodiment of the application, the first threshold can be 0.5, etc., and the specific value can be selected according to the actual situation. This embodiment of the application does not make specific limitations.
[0051] In the embodiments of this application, the first type is the continuous resource usage situation.
[0052] For example, if the standard deviation of the normalized resource utilization rate is below the threshold of 0.5, the resource utilization type can be determined to be continuous resource utilization.
[0053] It should be noted that the autocorrelation information of resource utilization rate can be the autocorrelation function of normalized resource utilization rate.
[0054] In another embodiment, if the resource utilization rate information satisfies the condition of periodic change, then the resource utilization type is determined to be the second type.
[0055] In the embodiments of this application, the periodic change condition can be that the autocorrelation function of the normalized resource utilization rate changes periodically.
[0056] In the embodiments of this application, the second type is the day-night resource usage situation.
[0057] For example, periodic fluctuations can be identified by calculating the autocorrelation function of normalized resource utilization to determine diurnal workloads.
[0058] It should be noted that the resource utilization rate change information includes the resource utilization rate change rate r and the slope p. The specific selection can be made according to the actual situation, and this application embodiment does not impose specific limitations.
[0059] In another embodiment, if the resource utilization rate change information is greater than the second threshold, the resource utilization type is determined to be the third type.
[0060] It should be noted that corresponding thresholds can be set for the rate of change r and the slope p of resource utilization, which are collectively referred to as the second threshold in this application.
[0061] Optionally, a threshold of 0.6 can be set for the rate of change of resource utilization r, and a threshold of 0.5 can be set for the slope of resource utilization p. The specific thresholds can be selected based on actual circumstances, and this embodiment does not impose specific limitations.
[0062] In this application embodiment, the third type is explosive resource usage.
[0063] For example, if the rate of change r of the normalized resource utilization curve is greater than 0.6 and the slope p of the normalized resource utilization curve is greater than 0.5, it indicates that the resource utilization rate rises sharply in a short period of time. In this case, it is judged as an explosive workload.
[0064] In another embodiment, if the peak-to-valley ratio of resource utilization meets the irregular usage condition, indicating that the resource has been used irregularly, then the resource usage type is determined to be the fourth type.
[0065] In this application embodiment, the fourth type is irregular resource usage.
[0066] In this embodiment, irregular usage conditions can be that the difference between multiple resource utilization peak-valley ratios is greater than a preset value, or that the resource utilization peak-valley ratio is greater than a preset value, etc. The specific conditions can be selected according to the actual situation, and this embodiment does not impose specific limitations.
[0067] For example, the workload classification criteria for different resource usage types can be found in Table 2.
[0068] Table 2
[0069] It should be noted that all workloads, unless they have strong resource usage characteristics (such as Graphics Processing Unit (GPU) tasks that process large model training, which will be marked as bursty resource usage), are all initialized as continuous resource usage.
[0070] It should be noted that the classification will be adjusted as the normalized resource utilization curve changes, with the aim of maintaining good Quality of Service (QoS) with minimal power reduction.
[0071] It should be noted that, in order to avoid potential QoS degradation, when the computing node is running at low intensity, the workload is forcibly classified as a continuous resource usage situation.
[0072] Understandably, while meeting the workload SLA, the workload should be scheduled to appropriate computing nodes to achieve load balancing as much as possible and improve resource utilization.
[0073] S103. Allocate CPU resources corresponding to the resource usage type for the workload.
[0074] In this embodiment, the CPU resources of the computing node are pre-divided into three parts: a first CPU resource, corresponding to the stable region, used to serve the first and / or second types of workloads; a second CPU resource, corresponding to the basic region, used to serve the third and / or fourth types of workloads; and a third CPU resource, corresponding to the dynamic region, which does not serve any workloads and is mainly used for periodically adjusting the first and / or second CPU resources, including adding new resources and reclaiming idle resources.
[0075] In this embodiment, the CPU resource can be a CPU core. The specific core can be selected based on actual circumstances, and this embodiment does not impose any specific limitations.
[0076] For example, referring to Figure 2, there are 10 CPU cores on the computing node. Three CPU cores correspond to the stable region for serving workloads with continuous resource usage and workloads with diurnal resource usage; three CPU cores correspond to the basic region for serving workloads with explosive resource usage and workloads with irregular resource usage; and the remaining two CPU cores correspond to the dynamic region for subsequent dynamic adjustment of CPU resources.
[0077] In one embodiment, if the resource usage type is a first type and / or a second type, then a first CPU resource is allocated to the workload; the first CPU resource is a portion of the CPU resources on the first computing node.
[0078] In another embodiment, if the resource usage type is a third type and / or a fourth type, then a second CPU resource is allocated to the workload; the second CPU resource is a portion of the CPU resources on the first computing node other than the first CPU resource.
[0079] It should be noted that resource usage data for all workloads can be collected every 10 minutes to initially categorize workloads after 24 hours of operation. Since the number of CPU cores is a key factor to monitor during workload operation, consuming nearly one-third of the server's energy, adjusting the number of CPU cores appropriately can effectively reduce energy consumption. Further adjustments can be made dynamically based on resource usage. Specific examples of these dynamic adjustments can be found in the following two implementations.
[0080] In one embodiment, after allocating CPU resources corresponding to the resource usage type to the workload, the CPU resources can be dynamically adjusted. Specifically, this involves monitoring changes in the workload's resource requirements and / or the CPU resource utilization rate; and adjusting the size of the CPU resources based on these changes.
[0081] It should be noted that when the resource demand of the workload increases rapidly, that is, when the peak resource demand of the first computing node is detected, priority is given to ensuring the resource demand of workloads with explosive resource usage and workloads with irregular usage.
[0082] It should be noted that when the resource utilization of a computing node is low, there is no need to reserve excess CPU resources. In this case, the third CPU resource will periodically collect idle CPU resources from the first and second CPU resources.
[0083] In this embodiment, referencing the soft isolation mechanism of IDLE (idle state) CPU cyclic collection, SCHED_OTHER (also known as SCHED_NORMAL in the Linux kernel source code) is utilized. SCHED_OTHER is a standard Linux time-sharing scheduler used for all threads that do not require special real-time mechanisms. In contrast, a runnable SCHED_RR process is always scheduled on top of any SCHED_OTHER process.
[0084] Understandably, by dynamically adjusting the number of CPU cores, the performance of the workload in the basic region can be greatly improved. Especially when peak loads occur, the workload performance in the stable region and the basic region is not significantly affected, thus improving resource utilization.
[0085] In another embodiment, after allocating CPU resources corresponding to the resource usage type to the workload, the CPU frequency can also be dynamically adjusted. Specifically, the CPU resource's operating status data is monitored, and the CPU resource's operating frequency is adjusted based on the operating status data.
[0086] In this embodiment, the operating status data of CPU resources includes: CPU frequency f, CPU utilization u, core cycle time c, and LLC missing rate l. ms Prometheus is typically used for real-time collection.
[0087] In this embodiment, the number of instructions per second (IPS) of the CPU resources is calculated based on the running status data, as detailed in formula (2). IPS = F(f,u,c,l) ms (2)
[0088] The algorithm monitors the CPU core count in both the stable and basic regions in real time and determines when to adjust the CPU frequency. At each decision point, the algorithm adjusts the maximum frequency f. max As baseline F(f) maxThen, a Long Short-Term Memory (LSTM) prediction model is used to obtain the corresponding IPS at all available frequencies, and the lowest frequency that meets the preset constraints is selected as the operating frequency f. target For details, please refer to formula (3).
[0089] F(f,·) can be determined according to IPS.
[0090] Understandably, the IPS prediction model will be updated when the phase of the cumulative average prediction error changes. Since this application focuses more on f... max and f target The relationship between the IPS (Inverterly Prediction System) models is considered, therefore, a certain degree of error is acceptable as long as the IPS model can provide consistent prediction results. In this application, the Interval Coefficient of Variation (ICOV) can be used to detect changes in the cumulative average prediction error. ICOV measures the interval homogeneity between different phases.
[0091] Optionally, a threshold of 25% can be set for detecting phase transitions. When the ICOV is greater than 25%, the IPS prediction model is updated using the most recently collected dataset.
[0092] It is understood that the embodiments of this application propose a CPU frequency adjustment algorithm based on workload performance to select the optimal frequency to run the workload, thereby achieving considerable power savings while minimizing the performance impact on all workloads.
[0093] Based on the above embodiments, this application proposes a resource allocation device, as shown in Figure 3. The device includes a resource matching and scheduling module, a classification module, and a CPU resource dynamic adjustment module. The resource matching and scheduling module calculates the resource matching degree (Match) between workload 1, workload 2, workload 3 in the scheduling queue and the computing nodes, selects suitable computing nodes, and then uses a classification algorithm to schedule the workloads to the corresponding suitable computing nodes. The classification module categorizes resource usage types into continuous resource usage, day / night resource usage, burst resource usage, and irregular resource usage. The corresponding resource usage type can be determined based on the resource usage data of the workload. The CPU resource dynamic adjustment module divides the CPU core area into a stable region, a basic region, and a dynamic region. Different CPU core regions are allocated to the workloads according to their corresponding resource usage types. The CPU cores in the dynamic region can also perform periodic collection of CPU space resources and implement CPU frequency condition algorithms based on workload performance.
[0094] Understandably, after the workload runs on the first computing node for a period of time, resource usage data is monitored. Then, based on the resource usage, different resource usage types are divided, and different CPU resources are allocated to the workload according to the divided resource usage types. This fully considers the resource usage of the workload during operation, reduces the impact of the situation that the workload encounters in actual use on performance, reduces the problem of insufficient or wasted resources, and thus improves resource utilization.
[0095] This application provides a resource allocation device. As shown in FIG4, the resource allocation device 1 includes:
[0096] The data acquisition unit 10 is configured to collect resource usage data of the workload running on the first computing node within a preset time period;
[0097] The determining unit 11 is configured to determine the resource usage type corresponding to the workload based on the resource usage data;
[0098] Allocation unit 12 is configured to allocate CPU resources corresponding to the resource usage type to the workload.
[0099] Optionally, the device further includes: an acquisition unit, a search unit, and a scheduling unit;
[0100] The acquisition unit is configured to acquire the resource requirement information of the workload and the remaining resource information of multiple computing nodes;
[0101] The determining unit 11 is further configured to determine multiple resource matching degree information between the workload and the multiple computing nodes based on the resource demand information and the multiple remaining resource information;
[0102] The search unit is configured to search for the first resource matching degree information with the largest value from the plurality of resource matching degree information; and to determine the first computing node corresponding to the first resource matching degree information from the plurality of computing nodes;
[0103] The scheduling unit is configured to schedule the workload to run on the first computing node.
[0104] Optionally, the determining unit 11 is further configured to determine first information based on 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-to-valley ratio information; if the resource usage rate dispersion information is less than a first threshold, the resource usage type is determined to be a first type; if the resource usage rate autocorrelation information satisfies a periodic change condition, the resource usage type is determined to be a second type; if the resource usage rate change rate information is greater than a second threshold, the resource usage type is determined to be a third type; if the resource usage rate peak-to-valley ratio information satisfies an irregular usage condition, the resource usage type is determined to be a fourth type.
[0105] Optionally, the allocation unit 12 is further configured to allocate a first CPU resource to the workload if the resource usage type is a first type and / or a second type; the first CPU resource is a portion of the CPU resources on the first computing node; if the resource usage type is a third type and / or a fourth type, allocate a second CPU resource to the workload; the second CPU resource is a portion of the CPU resources on the first computing node other than the first CPU resource.
[0106] Optionally, the device further includes: a monitoring unit and an adjustment unit;
[0107] 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;
[0108] The adjustment unit is configured to adjust the size of the CPU resources based on the resource demand change information and / or the CPU resource utilization information.
[0109] Optionally, the monitoring unit is further configured to monitor the operating status data of the CPU resources;
[0110] The adjustment unit is further configured to adjust the operating frequency of the CPU resources based on the operating status data.
[0111] This application provides a resource allocation device that collects resource usage data of workloads running on a first computing node within a preset time period; determines the resource usage type corresponding to the workload based on the resource usage data; and allocates CPU resources corresponding to the resource usage type to the workload. Therefore, the resource allocation device proposed in this embodiment monitors resource usage data after the workload has been running on the first computing node for a period of time, then classifies the workload into different resource usage types based on the resource usage, and allocates different CPU resources to the workload according to the classified resource usage type. This fully considers the resource usage of the workload during operation, reduces the impact of actual workload usage on performance, reduces resource shortages or waste, and thus improves resource utilization.
[0112] Figure 5 is a schematic diagram of the composition structure of a resource allocation device 1 provided in an embodiment of this application. In practical applications, based on the same disclosed concept of the above embodiments, as shown in Figure 5, the resource allocation device 1 of this embodiment includes: a processor 13, a memory 14, and a communication bus 15.
[0113] The processor 13 described above can be at least one of the following: Application Specific Integrated Circuit (ASIC), Digital Signal Processor (DSP), Digital Signal Processing Device (DSPD), Programmable Logic Device (PLD), Field Programmable Gate Array (FPGA), CPU, controller, microcontroller, and microprocessor. It is understood that, for different devices, the electronic device used to implement the above processor function can also be other types, and this embodiment does not specifically limit it.
[0114] In this embodiment, the communication bus 15 is used to realize the connection communication between the processor 13 and the memory 14; when the processor 13 executes the running program stored in the memory 14, it implements the following resource allocation method:
[0115] Collect resource usage data of workloads running on the first computing node within a preset time period; determine the resource usage type corresponding to the workload based on the resource usage data; and allocate CPU resources corresponding to the resource usage type to the workload.
[0116] Furthermore, the processor 13 is also configured to acquire resource requirement information of the workload and multiple remaining resource information of multiple computing nodes; based on the resource requirement information and the multiple remaining resource information, determine multiple resource matching degree information between the workload and the multiple computing nodes respectively; search for the first resource matching degree information with the largest value from the multiple resource matching degree information; 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.
[0117] Furthermore, the processor 13 is also configured to determine first information based on 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-to-valley ratio information; if the resource usage rate dispersion information is less than a first threshold, the resource usage type is determined to be a first type; if the resource usage rate autocorrelation information satisfies a periodic change condition, the resource usage type is determined to be a second type; if the resource usage rate change rate information is greater than a second threshold, the resource usage type is determined to be a third type; if the resource usage rate peak-to-valley ratio information satisfies an irregular usage condition, the resource usage type is determined to be a fourth type.
[0118] Furthermore, the processor 13 is also configured to allocate a first CPU resource to the workload if the resource usage type is a first type and / or a second type; the first CPU resource is a portion of the CPU resources on the first computing node; if the resource usage type is a third type and / or a fourth type, allocate a second CPU resource to the workload; the second CPU resource is a portion of the CPU resources on the first computing node other than the first CPU resource.
[0119] Furthermore, the processor 13 is also configured to monitor the resource demand change information of the workload and / or the resource utilization information of the CPU resources; and adjust the size of the CPU resources based on the resource demand change information and / or the resource utilization information of the CPU resources.
[0120] Furthermore, the processor 13 is also configured to monitor the operating status data of the CPU resources and adjust the operating frequency of the CPU resources based on the operating status data.
[0121] This application provides a storage medium storing a computer program thereon. The computer-readable storage medium stores one or more programs, which can be executed by one or more processors and applied in a resource allocation device. The computer program implements the resource allocation method described above.
[0122] Based on the above embodiments, this application provides a computer program product, including a computer program that can be executed by one or more processors, and the computer program implements the resource allocation method described above.
[0123] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element.
[0124] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of this disclosure, in essence, or the part that contributes to the related technology, 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 to cause an image display device (which may be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods described in the various embodiments of this disclosure.
[0125] The above description is merely a preferred embodiment of this application and is not intended to limit the scope of protection of this application.
Claims
1. A resource allocation method, the method comprising: Collect resource usage data of workloads running on the first computing node within a preset time period; Based on the resource usage data, determine the resource usage type corresponding to the workload; Allocate CPU resources corresponding to the resource usage type to the workload.
2. The method according to claim 1, wherein, Before collecting resource usage data of workloads running on the first computing node within a preset time period, the method further includes: Obtain the resource requirements of the workload and the remaining resource information of multiple computing nodes; Based on the resource demand information and the multiple remaining resource information, multiple resource matching degree information between the workload and the multiple computing nodes is determined; Find the first resource matching degree information with the largest value from the plurality of resource matching degree information; and determine the 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, wherein, The step of determining the resource usage type corresponding to the workload based on the resource usage data includes: Based on the resource usage data, first information is determined; 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. If the resource utilization rate dispersion information is less than the first threshold, then the resource utilization type is determined to be the first type; If the resource utilization rate information satisfies the condition of periodic change, then the resource utilization type is determined to be the second type. If the resource utilization rate change information is greater than the second threshold, then the resource utilization type is determined to be the third type; If the resource utilization peak-valley ratio information meets the irregular usage conditions, then the resource usage type is determined to be the fourth type.
4. The method according to claim 1 or 3, wherein, The step of allocating CPU resources corresponding to the resource usage type for the workload includes: If the resource usage type is a first type and / or a second type, then a first CPU resource is allocated to the workload; the first CPU resource is a portion of the CPU resources on the first computing node. If the resource usage type is the third type and / or the fourth type, then the second CPU resource is allocated to the workload; the second CPU resource is a portion of the CPU resources on the first computing node other than the first CPU resource.
5. The method according to claim 1, wherein, After allocating CPU resources corresponding to the resource usage type to the workload, the method further includes: Monitor the resource demand changes of the workload and / or the resource utilization information of the CPU resources; Based on the resource demand change information and / or the CPU resource utilization information, the size of the CPU resource is adjusted.
6. The method according to claim 1, wherein, After allocating CPU resources corresponding to the resource usage type to the workload, the method further includes: Monitor the operating status data of the CPU resources; Based on the operating status data, the operating frequency of the CPU resources is adjusted.
7. A resource allocation device, the resource allocation device comprising: The data acquisition unit is configured to collect resource usage data of the workloads running on the first computing node within a preset time period; The determining unit is configured to determine the resource usage type corresponding to the workload based on the resource usage data; The allocation unit is configured to allocate CPU resources corresponding to the resource usage type to the workload.
8. A resource allocation device, the resource allocation device comprising: A processor, a memory, and a communication bus; the communication bus is used to enable communication between the processor and the memory. When the processor executes the running program stored in the memory, it implements the method as described in any one of claims 1-6.
9. A storage medium having a computer program stored thereon, which, when executed by a processor, implements the method as claimed in any one of claims 1-6.
10. A computer program product comprising a computer program that, when executed by a processor, implements the method as described in any one of claims 1-6.