Resource allocation method and device

By building long-term and short-term resource feature maps, based on the resource usage data of workloads, the problems of waste of resources and low utilization in the resource scheduler are solved, rational allocation and efficient utilization of resources are achieved, and resource utilization in the data center is improved.

CN114035940BActive Publication Date: 2025-08-29ALIBABA (CHINA) CO LTD +1
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202111210713.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-10-18
Publication Date
2025-08-29
Estimated Expiration
2041-10-18

AI Technical Summary

Technical Problem

Existing resource schedulers have problems of waste of resources and low utilization rates in resource allocation, especially in heterogeneous scenarios where large machines have a large number of applications and severe resource fragmentation, it is difficult to accurately estimate resource requirements, resulting in the inability to guarantee resource utilization rates.

Method used

By constructing long-term and short-term resource feature maps, resources are allocated for long-term and short-term load types according to the resource usage data of the workload, and a unified resource processing and overselling mechanism are realized to meet the resource demands of different types of loads.

Benefits of technology

It improves the resource utilization rate of data centers, reduces resource waste, ensures the resource certainty demands of various services, and realizes the rational allocation and efficient utilization of resources.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114035940B_ABST
    Figure CN114035940B_ABST
Patent Text Reader

Abstract

The embodiments of this specification provide a resource allocation method and device, wherein the resource allocation method includes: obtaining resource usage data corresponding to the workload; constructing a long-cycle resource characteristic graph corresponding to the long-cycle load type and a short-cycle resource characteristic graph corresponding to the short-cycle load type based on the resource usage data; allocating short-cycle resources for the short-cycle load type in the resources to be allocated according to the short-cycle resource characteristic graph; allocating long-cycle resources for the long-cycle load type in the short-cycle resources according to the long-cycle resource characteristic graph.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of this specification relate to the field of computer technology, and in particular to a resource allocation method. Background Art

[0002] With the development of Internet technology, resource schedulers serving cloud products have become an indispensable part. Resource schedulers in existing technologies all adopt a static resource model of request. The entire system collects the total amount of resources of each node and calculates the number of resource requests loaded on the node based on the request described by the user, but this will result in a large waste of resources. This is mainly because the requests applied for by users may be far greater than the actual resource demand. For large-scale machine applications, the number is very large and cannot be managed manually. Even very experienced application developers face complex business scenarios and diverse infrastructures and find it difficult to accurately estimate the amount of resources they need, which will result in a large waste of resources. Secondly, due to the serious fragmentation of resources, due to the matching relationship between the rules of a single machine and the size of a single request, there may be some unusable fragmented resources on each machine, which makes it impossible to guarantee resource utilization in heterogeneous scenarios. Therefore, an effective solution is urgently needed to solve the above problems. Summary of the Invention

[0003] In view of this, embodiments of this specification provide a resource allocation method. One or more embodiments of this specification also relate to a resource allocation apparatus, a computing device, a computer-readable storage medium, and a computer program to address technical deficiencies in the prior art.

[0004] According to a first aspect of an embodiment of this specification, a resource allocation method is provided, including:

[0005] Obtain resource usage data corresponding to the workload;

[0006] Constructing a long-period resource characteristic graph corresponding to the long-period load type and a short-period resource characteristic graph corresponding to the short-period load type according to the resource usage data;

[0007] Allocating short-cycle resources for the short-cycle load type from the resources to be allocated according to the short-cycle resource characteristic graph;

[0008] According to the long-period resource characteristic diagram, long-period resources are allocated in the short-period resources for the long-period load type.

[0009] Optionally, constructing a short-period resource characteristic graph corresponding to a short-period load type according to the resource usage data includes:

[0010] Selecting initial resource usage data corresponding to a target time interval from the resource usage data;

[0011] Processing the initial resource usage data according to a preset attenuation strategy to obtain short-term resource usage data;

[0012] The short-period resource characteristic graph corresponding to the short-period load type is constructed based on the short-period resource usage data.

[0013] Optionally, allocating short-cycle resources for the short-cycle load type in the resources to be allocated according to the short-cycle resource characteristic graph includes:

[0014] Determining a short-period resource characteristic value according to the short-period resource characteristic graph;

[0015] Processing the workload in the short-cycle load type using the short-cycle resource characteristic value, and determining short-cycle resource allocation information according to the processing result;

[0016] According to the short cycle resource allocation information, the short cycle resource is allocated in the resources to be allocated for the short cycle load type.

[0017] Optionally, constructing a long-period resource characteristic graph corresponding to a long-period load type according to the resource usage data includes:

[0018] Determining a period value corresponding to the long-period load type, and determining long-period resource usage data in the resource usage data according to the period value;

[0019] The long-period resource characteristic graph corresponding to the long-period load type is constructed based on the long-period resource usage data.

[0020] Optionally, allocating long-period resources for the long-period load type in the short-period resources according to the long-period resource characteristic graph includes:

[0021] Determining a long-term resource characteristic value according to the long-term resource characteristic graph;

[0022] Determining long-term resource allocation information based on the long-term resource characteristic value;

[0023] According to the long-cycle resource allocation information, the long-cycle resource is allocated in the short-cycle resources for the long-cycle load type.

[0024] Optionally, allocating short-cycle resources for the short-cycle load type in the resources to be allocated according to the short-cycle resource characteristic graph includes:

[0025] Determine, according to the short-cycle resource characteristic graph, first resource allocation information corresponding to the first sub-load type included in the short-cycle load type, and second resource allocation information corresponding to the second sub-load type;

[0026] Allocating a first short-cycle resource for the first sub-load type in the resources to be allocated according to the first resource allocation information;

[0027] According to the second resource allocation information, a second short cycle resource is allocated for the second sub-load type in the first short cycle resource.

[0028] Optionally, the second resource allocation information is determined in the following manner:

[0029] Determining resource application information and resource usage information corresponding to the short-period load type according to the short-period resource characteristic graph;

[0030] Performing resource evaluation on the short-period load type according to the resource usage information to obtain resource evaluation information;

[0031] Determine the second resource allocation information corresponding to the second sub-load type based on the resource evaluation information and the resource application information.

[0032] Optionally, after the step of performing resource evaluation on the short-period load type according to the resource usage information and obtaining resource evaluation information is performed, the method further includes:

[0033] Obtaining a maneuvering resource and a maneuvering weight corresponding to the maneuvering resource;

[0034] generating third resource allocation information according to the maneuvering resource and the maneuvering weight, and determining fourth resource allocation information according to the resource evaluation information and the resource application information;

[0035] The second resource allocation information corresponding to the second sub-load type is determined based on the third resource allocation information and the fourth resource allocation information.

[0036] Optionally, the processing the initial resource usage data according to a preset attenuation strategy to obtain short-term resource usage data includes:

[0037] Sampling the initial resource usage data at each time node in the target time interval to obtain a plurality of initial resource usage values;

[0038] determining an attenuation value corresponding to the target time interval, and processing the multiple initial resource usage values ​​according to the attenuation value;

[0039] The short-term resource usage data is determined according to the processing result.

[0040] Optionally, it also includes:

[0041] Obtain system reserved resources;

[0042] Calculating calling resources according to the to-be-allocated resources, the short-cycle resources, and the system reserved resources, and creating a calling policy corresponding to the calling resources;

[0043] The calling resources are allocated according to the emergency load type, and the calling strategy is configured.

[0044] Optionally, after the step of allocating long-period resources for the long-period load type in the short-period resources according to the long-period resource characteristic graph is performed, the method further includes:

[0045] Obtaining an application request corresponding to a target application, and determining a target load type corresponding to the application request;

[0046] When the target load type is the short-cycle load type, loading the application request to the short-cycle resource;

[0047] When the target load type is the long-period load type, the application request is loaded to the long-period resource.

[0048] According to a second aspect of an embodiment of this specification, a resource allocation device is provided, including:

[0049] an acquisition module, configured to acquire resource usage data corresponding to the workload;

[0050] a construction module configured to construct a long-period resource characteristic graph corresponding to the long-period load type and a short-period resource characteristic graph corresponding to the short-period load type according to the resource usage data;

[0051] A first allocation module is configured to allocate short-cycle resources for the short-cycle load type in the resources to be allocated according to the short-cycle resource characteristic graph;

[0052] The second allocation module is configured to allocate long-period resources for the long-period load type in the short-period resources according to the long-period resource characteristic diagram.

[0053] According to a third aspect of an embodiment of this specification, a computing device is provided, including:

[0054] memory and processor;

[0055] The memory is configured to store computer-executable instructions, and the processor is configured to execute the computer-executable instructions:

[0056] Obtain resource usage data corresponding to the workload;

[0057] Constructing a long-period resource characteristic graph corresponding to the long-period load type and a short-period resource characteristic graph corresponding to the short-period load type according to the resource usage data;

[0058] Allocating short-cycle resources for the short-cycle load type from the resources to be allocated according to the short-cycle resource characteristic graph;

[0059] According to the long-period resource characteristic diagram, long-period resources are allocated in the short-period resources for the long-period load type.

[0060] According to a fourth aspect of the embodiments of this specification, a computer-readable storage medium is provided, which stores computer-executable instructions, and when the instructions are executed by a processor, the steps of any one of the resource allocation methods are implemented.

[0061] According to a fifth aspect of the embodiments of this specification, a computer program is provided, wherein when the computer program is executed in a computer, the computer is caused to execute the steps of the above-mentioned resource allocation method.

[0062] The resource allocation method provided in this specification can, after obtaining the resource usage data corresponding to the workload, construct a long-cycle resource characteristic graph corresponding to the long-cycle load type and a short-cycle resource characteristic graph corresponding to the short-cycle load type based on this data, so as to reflect the resource demands of different types of workloads through the resource characteristic graph, and then allocate short-cycle resources for the short-cycle load type according to the short-cycle resource characteristic graph, and oversell long-cycle resources for the long-cycle task load type after the resources are fully allocated according to the long-cycle resource characteristic graph; it realizes the resource allocation that supports any task through unified processing, which not only guarantees the resource certainty demands of various services, but also improves the resource utilization rate of the data center by overselling resources, and effectively reduces the losses caused by resource waste. BRIEF DESCRIPTION OF THE DRAWINGS

[0063] Figure 1 is a schematic diagram of resource allocation provided by an embodiment of this specification;

[0064] Figure 2 This is a flow chart of a resource allocation method provided by one embodiment of this specification;

[0065] Figure 3 is a schematic diagram of a resource characteristic diagram in a resource allocation method provided in one embodiment of this specification;

[0066] Figure 4 This is a schematic diagram of resource allocation processing in a resource allocation method provided in one embodiment of this specification;

[0067] Figure 5 This is a schematic diagram of a long-term resource allocation process in a resource allocation method provided in one embodiment of this specification;

[0068] Figure 6 This is a schematic diagram of calling a resource allocation process in a resource allocation method provided in one embodiment of this specification;

[0069] Figure 7 This is a flowchart of a processing process of a resource allocation method provided by an embodiment of this specification;

[0070] Figure 8 This is a schematic diagram of the structure of a resource allocation device provided by an embodiment of this specification;

[0071] Figure 9 This is a structural block diagram of a computing device provided by one embodiment of this specification. DETAILED DESCRIPTION

[0072] The following description sets forth many specific details to facilitate a thorough understanding of this specification. However, this specification can be implemented in many other ways than those described herein, and those skilled in the art can make similar generalizations without violating the scope of this specification. Therefore, this specification is not limited to the specific implementations disclosed below.

[0073] The terms used in one or more embodiments of this specification are for the purpose of describing specific embodiments only and are not intended to limit one or more embodiments of this specification. The singular forms "a," "the," and "the" used in one or more embodiments of this specification and the appended claims are also intended to include plural forms unless the context clearly indicates otherwise. It should also be understood that the term "and / or" used in one or more embodiments of this specification refers to and includes any or all possible combinations of one or more associated listed items.

[0074] It should be understood that although the terms first, second, etc. may be used to describe various information in one or more embodiments of this specification, such information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, without departing from the scope of one or more embodiments of this specification, the first may also be referred to as the second, and similarly, the second may also be referred to as the first. Depending on the context, the word "if" as used herein may be interpreted as "at the time of" or "when" or "in response to determining".

[0075] First, the terms involved in one or more embodiments of this specification are explained.

[0076] Workload: refers to applications running in data centers, including online services that process user requests in real time, background batch computing tasks, AI training and inference, etc.

[0077] Scheduling: refers to the process of placing workloads on limited computers in a data center to complete corresponding data processing, including the selection of computers at the current moment and the selection of the order in which workloads are loaded.

[0078] Resource model: refers to the paradigm for cluster resource usage. All workloads running in the cluster follow this standard constraint and is the core abstraction in cluster resource scheduling.

[0079] PriorityClass: Priority class, used to indicate the priority class of a task. Tasks of the same level are scheduled in the same way, while tasks of different types are scheduled in different ways.

[0080] In this specification, a resource allocation method is provided. This specification also relates to a resource allocation apparatus, a computing device, and a computer-readable storage medium, which are described in detail one by one in the following embodiments.

[0081] In practical applications, most resource schedulers use YARN, Mesos or Kubernetes to support scheduling and orchestration, and when calculating the number of resource requests that can be loaded on each node, it is necessary to meet the requirement of ∑ i request(i)≤Allocable node , see Figure 1 In the request allocation diagram shown, when request (4) arrives, it can only be placed on a new node, even if the current node's actual utilization rate may be very idle, which leads to a lot of resource waste. In existing technologies, most use integer programming to reduce the fragmentation problem caused by multi-dimensional resource packing, but this has very little room for improving cluster resource utilization.

[0082] Yarn supports further scheduling of tasks based on the runtime load of the node to improve the resource utilization efficiency of the node. Although its model is simple and suitable for the scenarios of big data batch processing computing tasks it targets, it lacks a response plan for long-lifecycle workloads. Long-lifecycle services are difficult to run on it and coexist with short-lifecycle workloads.

[0083] Kubernetes supports a resource model called BestEffort, which allows users to over-allocate tasks to nodes. However, BestEffort tasks lack resource descriptions, making it difficult for the scheduler to select the appropriate machine. There is also no fairness guarantee between tasks. As a result, tasks submitted through BestEffort cannot obtain relatively certain resource SLO guarantees, making it difficult to apply to real production environments.

[0084] In view of this, the resource allocation method provided in this specification can, after obtaining the resource usage data corresponding to the workload, construct a long-cycle resource characteristic graph corresponding to the long-cycle load type and a short-cycle resource characteristic graph corresponding to the short-cycle load type based on this data, so as to reflect the resource demands of different types of workloads through the resource characteristic graph, and then allocate short-cycle resources for the short-cycle load type according to the short-cycle resource characteristic graph, and oversell long-cycle resources for the long-cycle task load type according to the long-cycle resource characteristic graph after the resources are fully allocated; it realizes the resource allocation that supports any task through unified processing, which not only guarantees the resource certainty demands of various services, but also improves the resource utilization rate of the data center by overselling resources, and effectively reduces the losses caused by resource waste.

[0085] Figure 2 A flow chart of a resource allocation method provided according to an embodiment of this specification is shown, which specifically includes the following steps.

[0086] Step S202: Obtain resource usage data corresponding to the workload.

[0087] Specifically, workloads refer to applications running in the data center, including but not limited to user-requested online services, such as those invoked by clicking a button in a shopping app; background batch processing tasks, such as TensorFlow / PyTouch; and offline analytical tasks, such as daily big data reports and non-interactive SQL queries. In other words, any task requiring processing by computers in the data center is considered a workload. Accordingly, resource usage data refers to the historical resource usage of a workload over a predetermined period, enabling subsequent resource allocation based on this data.

[0088] Based on this, in order to allocate reasonable resources to different types of workloads in the future, while improving the resource utilization of the server and avoiding resource waste, we can first obtain the resource usage data corresponding to the workload, so as to facilitate the subsequent resource allocation of different types of workloads based on the resource usage data.

[0089] It should be noted that different types of workloads may have different resource usage. For example, real-time response tasks may require uninterrupted use of the computer resources of the data center, while real-time computing tasks such as AI training may require a portion of computer resources for a long time, and offline analysis tasks may only require the use of a portion of computer resources at a specific time. Therefore, if resources are allocated separately for each type of task, not only will resource utilization be unable to be guaranteed, but it will also cause resource waste. Therefore, before allocating resources, workloads can be classified according to the length of the resource usage cycle during runtime. Workloads that use computer resources for a long time belong to the long-cycle load type, and workloads that use computer resources for a short time belong to the short-cycle load type. This makes it easier to complete resource allocation based on the type in the future, and resources can be dependent on each other during allocation to improve resource utilization.

[0090] Step S204: constructing a long-period resource characteristic graph corresponding to the long-period load type and a short-period resource characteristic graph corresponding to the short-period load type according to the resource usage data.

[0091] Specifically, after obtaining the resource usage data corresponding to the workload as mentioned above, further, in order to ensure the rationality of resource allocation and improve resource utilization, a long-cycle resource characteristic graph corresponding to the long-cycle load type and a short-cycle resource characteristic graph corresponding to the short-cycle load type can be constructed respectively according to the obtained resource usage data, so as to facilitate the subsequent determination of resource usage of different types of workloads by analyzing the resource characteristic graphs, so as to select a reasonable proportion among the resources to be allocated for resource allocation.

[0092] Among them, the long-cycle load type specifically refers to the type corresponding to the workload whose running time is greater than the preset threshold, and correspondingly, the short-cycle load type specifically refers to the type corresponding to the workload whose running time is less than or equal to the preset threshold. The long-cycle resource characteristic graph specifically refers to an image corresponding to the resource usage of the workload in the long-cycle load type within a certain time interval. The long-cycle resource characteristic graph can be used to determine the resource usage of each sub-time interval of this type of workload during operation, as well as the resource utilization rate in each node; the short-cycle resource characteristic graph specifically refers to an image corresponding to the resource usage of the workload in the short-cycle load type within a certain time interval. The short-cycle resource characteristic graph can be used to determine the resource usage of each moment of this type of workload during operation, as well as the resource utilization rate in each node.

[0093] That is to say, the long-cycle resource characteristic graph is used to characterize the resource usage of workloads with longer running times, and the short-cycle resource characteristic graph is used to characterize the resource usage of workloads with shorter running times, so as to facilitate the subsequent resource allocation based on workloads with different types of running times. The resource usage characteristics of workloads with different running times are fully considered to ensure reasonable resource allocation and high utilization.

[0094] Furthermore, when constructing a resource characteristic graph corresponding to a periodic load type based on the resource usage data, considering that the resource usage data includes resource usage data corresponding to different types of workloads, it is necessary to select resource usage data corresponding to the periodic load type to complete the construction of the resource characteristic graph. In this embodiment, the specific implementation is as follows: Steps S2042 to S2046:

[0095] Step S2042: Select initial resource usage data corresponding to the target time interval from the resource usage data.

[0096] Step S2044: Process the initial resource usage data according to a preset attenuation strategy to obtain short-term resource usage data.

[0097] Specifically, the target time interval is used to determine the workload's resource usage within that time interval. This determined resource usage is the initial resource usage data. Accordingly, the decay strategy specifically refers to a strategy for decaying the initial resource usage data within the target time interval, used to improve computing efficiency and reduce computing resource consumption. Accordingly, the resource usage data upon which resource allocation depends specifically refers to the sampled resource usage data of the workload of the corresponding load type, obtained after decay processing.

[0098] Based on this, in order to be able to construct a resource characteristic graph corresponding to the periodic load type through the resource usage data corresponding to the periodic load type, the initial resource usage data corresponding to the target event interval can be selected from the resource usage data, and then the initial resource usage data can be processed according to the preset attenuation strategy to obtain the resource usage data corresponding to the periodic load type based on the processing results, so as to facilitate the subsequent construction of the resource characteristic graph corresponding to the period based on this, and facilitate the subsequent allocation of reasonable resources to the workload corresponding to the period.

[0099] Furthermore, when the initial resource usage data is processed based on the preset decay strategy, a sliding window statistical calculation is actually performed in a time decay manner to obtain resource usage data corresponding to the periodic load type. In this embodiment, the specific implementation is as follows:

[0100] The initial resource usage data is sampled and processed at each time node in the target time interval to obtain multiple initial resource usage values; the attenuation value corresponding to the target time interval is determined, and the multiple initial resource usage values ​​are processed according to the attenuation value; and the short-cycle resource usage data is determined based on the processing result.

[0101] Specifically, the multiple initial resource usage values ​​specifically refer to the resource usage values ​​obtained after sampling at each time node in the target time interval; correspondingly, the attenuation value specifically refers to the value corresponding to the half-attenuation batch.

[0102] Based on this, in order to be able to construct a resource characteristic diagram corresponding to the periodic load type in the future, it can be completed based on the initial resource usage data within the target time period. However, since the target time interval contains a lot of resource usage data, and different time nodes correspond to different resource usage values, in order to be able to quickly and accurately determine the resource usage data corresponding to the period and achieve accurate resource allocation in the resource allocation stage, the initial resource usage data can be sampled and processed at this time to obtain multiple initial resource usage values ​​based on the sampling processing results, and then the multiple initial resource usage values ​​can be processed according to the attenuation value, and the resource usage data of the corresponding period of the corresponding periodic load type can be obtained according to the processing results.

[0103] It should be noted that when determining the short-cycle resource usage data, the initial resource usage values ​​corresponding to different time nodes within the target time interval are actually counted, that is, after sampling the initial resource usage data at each time node, the resource usage of each time node is determined, and then the initial resource usage value corresponding to each time node is determined based on the preset histogram and the resource usage of each time node. After processing each initial resource usage value according to the preset half-life batch, the short-cycle resource usage data corresponding to the load type can be obtained.

[0104] For example, if the target time interval is 3 minutes and the half-life is 20 seconds, the resource usage values ​​of the last nine 20 seconds need to be merged. During the merging process, the closer the initial resource usage value is to the statistical time node, the greater the corresponding weight, and vice versa. This ensures that the final short-term resource usage data is closer to the real data, effectively improving the rationality of subsequent resource allocation.

[0105] Step S2046: constructing the short-period resource characteristic graph corresponding to the short-period load type based on the short-period resource usage data.

[0106] Specifically, after obtaining the short-cycle resource usage data as mentioned above, a short-cycle resource characteristic graph corresponding to the short-cycle load type can be constructed according to the short-cycle resource usage data, so as to facilitate the subsequent combination of the short-cycle resource characteristic graph to complete resource allocation for the workload of the short-cycle load type.

[0107] On the other hand, it is also necessary to construct a long-term resource feature graph corresponding to the long-term load type based on resource usage data. At this time, due to the characteristics of the long-term load type, the workload under this type has a long life cycle and requires stable resource support. Therefore, it is necessary to construct a long-term resource feature graph based on the characteristics of the workload in the long-term dimension. In this embodiment, the specific implementation method is as follows:

[0108] Determine a period value corresponding to the long-period load type, and determine long-period resource usage data in the resource usage data according to the period value; and construct the long-period resource characteristic graph corresponding to the long-period load type based on the long-period resource usage data.

[0109] Specifically, the period value refers to the length of the period required to construct the long-period resource characteristic diagram corresponding to the long-period load type. Correspondingly, the long-period resource usage data refers to the data on resource usage corresponding to the long-period load type within the interval corresponding to the period.

[0110] Based on this, due to the characteristics of long-cycle load types, their life cycle is long and the resources required are relatively stable. Therefore, it is necessary to first determine the cycle value corresponding to the long-cycle load type, and then determine the long-cycle resource usage data in the resource usage data based on the cycle value. Based on this, a long-cycle resource characteristic graph of the long-cycle load type is constructed to facilitate subsequent resource allocation from the perspective of resource utilization.

[0111] Taking real-time response services as long-term workloads and model training tasks as long-term workloads as examples, the process of constructing long-term resource feature graphs and short-term resource feature graphs is described.

[0112] Based on this, the resource usage data corresponding to the workload in the server is obtained, and then the initial resource usage data of the past 30 days is selected from the resource usage data. The initial resource usage data is then processed based on the time-attenuated sliding window statistical algorithm, and a short-cycle resource profile corresponding to the short-cycle load type is created based on the processing results. Furthermore, since the short-cycle resource profile is an expression of the resource usage of the workload of the real-time response service, and in order to meet the resource requirements of real-time AI and streaming computing tasks, it is also necessary to allocate resources to the workload of the long-cycle load type on this basis. At this time, the cycle value can be determined, and then the long-cycle resource usage data is determined in the resource usage data based on the cycle value to reflect the resource usage of the long-life cycle tasks (model training tasks) within the cycle value. Then, based on this, a long-cycle resource feature map corresponding to the long-online real-time load type is constructed, which can be applied to subsequent resource allocation processing.

[0113] In summary, by constructing long-term and short-term resource characteristic graphs to lay the foundation for subsequent resource allocation, we can further ensure the rationality of resource allocation. At the same time, taking into account the influence of the characteristics of different load types, we can further ensure subsequent resource utilization, thereby maintaining resources reasonably and efficiently and avoiding resource waste.

[0114] Step S206: Allocate short-cycle resources for the short-cycle load type from the resources to be allocated according to the short-cycle resource characteristic graph.

[0115] Specifically, after completing the construction of the short-cycle resource characteristic graph and the long-cycle resource characteristic graph, further, since the short-cycle resource characteristic graph corresponds to the short-cycle load type, and since the tasks corresponding to the short-cycle load type are all batch tasks. In other words, this type of workload requires continuous submission of requests and the continuous allocation of resources to run the requests responsible for this type of work, it is necessary to directly allocate short-cycle resources for the short-cycle load type in the resources to be allocated, so that the workload of the short-cycle load type can be completed using short-cycle resources.

[0116] Among them, the resources to be allocated specifically refer to all computing resources that the data center can allocate to workloads. Correspondingly, the short-cycle resources specifically refer to the resources allocated to workloads with short-cycle load types. That is to say, when processing requests for workloads with short-cycle load types, short-cycle resources will be called to support the operation of the request.

[0117] Furthermore, when allocating short-cycle resources for short-cycle load types, since the short-cycle resource characteristic graph reflects the image of resource usage of the short-cycle load type, resource allocation can be completed in combination with the short-cycle resource characteristic graph, which can not only ensure resource utilization but also achieve load balancing. In this embodiment, the specific implementation method is as follows:

[0118] Determine a short-cycle resource characteristic value according to the short-cycle resource characteristic diagram; use the short-cycle resource characteristic value to process the workload in the short-cycle load type, and determine short-cycle resource allocation information according to the processing result; and allocate the short-cycle resource for the short-cycle load type in the resources to be allocated according to the short-cycle resource allocation information.

[0119] Specifically, the short-period resource characteristic value specifically refers to the peak value in the short-period resource characteristic graph. Correspondingly, the short-period resource allocation information specifically refers to the information that needs to be followed when allocating resources for the short-period load type.

[0120] Based on this, since the focus of short-life cycle resources is on the computing power during this period, S is used to determine the resource characteristics of short life cycle. avg , fully guaranteeing the certainty of short-life cycle task resource operation without causing waste of resource allocation.

[0121] In summary, by using the short-cycle resource characteristic values ​​to determine resource allocation information, it can not only ensure that the subsequently allocated short-cycle resources can effectively support the workload of the short-cycle load type, but also improve the rationality of resource allocation and avoid resource waste caused by allocating too many resources.

[0122] Furthermore, in order to support different types of workloads, the workload in the short-period load type can be divided into two sub-load types, and short-period resource allocation can be completed based on this. In this embodiment, the specific implementation is as follows: Steps S2062 to S2066:

[0123] Step S2062: Determine, according to the short-cycle resource characteristic graph, first resource allocation information corresponding to the first sub-load type included in the short-cycle load type and second resource allocation information corresponding to the second sub-load type.

[0124] Specifically, the first sub-load type refers to workloads with high real-time requirements, such as the service obtained by clicking on the controls in the shopping app; the second sub-load type refers to workloads with high offline processing requirements, such as daily big data reports; accordingly, the first resource allocation information refers to information on resource allocation for the first sub-load type, and the second resource allocation information refers to information on resource allocation for the second sub-load type.

[0125] Based on this, after obtaining the short-cycle resource characteristic graph, since the first sub-load type needs to apply resources at all times, its priority is the highest. Therefore, the first resource allocation information corresponding to the first sub-load type can be directly determined according to the short-cycle resource characteristic graph; at the same time, since the second sub-load type uses resources in units of days and the usage time interval is relatively stable, its priority is lower than the first sub-load type. In order to improve resource utilization, the second resource allocation information can be determined in combination with other information of the short-cycle resource characteristic graph. In this embodiment, the specific implementation method is as follows:

[0126] Determine the resource application information and resource usage information corresponding to the short-cycle load type according to the short-cycle resource characteristic diagram; perform resource evaluation on the short-cycle load type according to the resource usage information to obtain resource evaluation information; and determine the second resource allocation information corresponding to the second sub-load type based on the resource evaluation information and the resource application information.

[0127] Specifically, resource application information refers to information corresponding to the resources requested by the workload of the first sub-load type before execution; resource usage information refers to information corresponding to the resources used by the workload of the first sub-load type during execution; and resource assessment information refers to information corresponding to the resources estimated to support the execution of the workload based on the resources used during execution. The requested resources corresponding to the resource application information must be greater than the assessed resources corresponding to the resource assessment information, and the assessed resources corresponding to the resource assessment information must be greater than the used resources corresponding to the resource usage information.

[0128] Based on this, considering that the priority of the workload of the second sub-load type is lower than that of the workload of the first sub-load type, and the resource usage frequency is lower, in order to improve resource utilization, on top of the workload of the first sub-load type, the resource application information and resource usage information corresponding to the first sub-load type can be determined through the short-cycle resource characteristic diagram, and then the available resources of the first sub-load type are evaluated according to the resource usage information to obtain resource evaluation information, and then the second resource allocation information corresponding to the second sub-load type can be determined in combination with the resource evaluation information and the resource application information, so as to be used for subsequent combination with the first resource allocation information to complete the resource allocation of the first sub-load type and the second sub-load type in the short-cycle load type.

[0129] It should be noted that when calculating resource evaluation information, the resource utilization estimate of the workload of the first sub-load type within the target time interval T can be used, and the value of T is the product of the set probability value of the running time of the second sub-load type to ensure the rationality of resource allocation.

[0130] In summary, by combining resource application information, resource usage information and resource evaluation information to determine the second allocation information of the second sub-load type, not only can resource utilization be improved, but also the impact on the workload of the first sub-load type can be reduced, thereby effectively ensuring the resource balance of the data center.

[0131] Step S2064: Allocate first short-cycle resources for the first sub-load type in the resources to be allocated according to the first resource allocation information.

[0132] Step S2066: Allocate a second short cycle resource for the second sub-load type in the first short cycle resource according to the second resource allocation information.

[0133] Specifically, after obtaining the first resource allocation information and the second resource allocation information as mentioned above, considering that the priority of the first sub-load type is greater than the priority of the second sub-load type, the resources corresponding to the first sub-load type can be selected from the resources to be allocated according to the first resource allocation information and allocated to the first sub-load type, that is, the first short-cycle resource is allocated for use by the workload of the first sub-load type.

[0134] Furthermore, according to the second resource allocation information, resources corresponding to the second sub-load type may be selected in the first short cycle resources and allocated to the second sub-load type, that is, the second short cycle resources are allocated for use by the workload of the second sub-load type.

[0135] That is to say, the second short-cycle resources that the second sub-load type can control are part of the first short-cycle resources, and this part will not be used when the workload is running, thereby improving resource utilization and avoiding resource waste.

[0136] For example, the services provided by the server are classified into four categories: Prod (real-time response services), Mid (long-term real-time computing tasks), Batch (offline analysis tasks), and Free (emergency tasks). The priority is Prod>Mid>Batch>Free. Based on this, the resource usage data corresponding to different types of workloads is obtained, and the resource profile corresponding to Prod is constructed based on the resource usage data. The resource profile value of the resource profile is used to determine whether the resources that can be allocated to Prod meet ∑ i request(Prod)≤Allocable node In other words, the resources that can be allocated to Prod on each node in the data center will not be oversold, which can ensure that the resources of the entire cluster will not be oversold, thereby ensuring resource balance.

[0137] For further information, see Figure 3The resource graph corresponding to Prod is shown in the figure. In this graph, limit is the resource curve requested by the workload, usage is the resource curve actually used by the workload, and the difference between the two is the requested but unused resources. In order to fully utilize this part of allocated but unused resources without affecting the operation of the workload, the available resources can be evaluated based on the actual used resources to obtain resource evaluation information, that is, Figure 3 The curve corresponding to the reservation in , and the resources between limit and reservation are the resources that can be allocated to Batch and will not affect Prod; that is, the resources allocated to Batch satisfy Allocable = ∑reclaimed(Prod).

[0138] Furthermore, based on the above content, it can be determined that the first short-cycle resource allocated to Prod is the schedulable resource in the node, and the second short-cycle resource that can be allocated to Batch is the unused resource in the first short-cycle resource, so as to support the selection of corresponding resources according to the type of workload to run the corresponding request during workload operation.

[0139] In addition, when a request for a workload belonging to Prod is received, the resource usage in Pod1-Podn is determined through load balancing. Figure 4 As shown in the figure, usage represents the used portion of resources, buffered represents the reserved portion of resources, and reclaimed represents the oversold portion of resources. Based on this, oversold resources exist in each Pod. That is, when a request for a Batch workload is received, this type of request can be run through the reclaimed resources in Pod1 through Podn. This means that unused resources allocated to Prod are used. After resource profiling, these resources are used to run requests with a lower priority than Prod, namely Batch requests Pod_L1, Pod_L2, Pod_L3, and Pod_L4, to ensure resource utilization.

[0140] In summary, by allocating the second short-cycle resource to the second sub-load type based on the first short-cycle resource, not only the resource management environment can be improved, but also waste of applied resources can be avoided, thereby effectively improving resource utilization.

[0141] In addition, considering the scenario where the resource allocation rate in the node cluster is not sufficient, in order to enable the workload of the second sub-load type to be fully scheduled to the resource node of the first load type, the control resources can be considered. That is, the second short-cycle resources corresponding to the second sub-load type are not only the unused resources in the first short-cycle resources, but also emergency resources. In this embodiment, the specific implementation method is as follows:

[0142] Obtain a maneuverable resource and a maneuverable weight corresponding to the maneuverable resource; generate third resource allocation information based on the maneuverable resource and the maneuverable weight, and determine fourth resource allocation information based on the resource evaluation information and the resource application information; based on the third resource allocation information and the fourth resource allocation information, determine the second resource allocation information corresponding to the second sub-load type.

[0143] Specifically, the maneuverable resources refer to resources that can be mobilized to respond to emergencies. Accordingly, the maneuverability weight is determined based on the frequency with which the workload of the second sub-load type uses the maneuverable resources. The higher the frequency, the greater the maneuverability weight, indicating a greater probability of maneuverable resources being used, further indicating a need to allocate more maneuverable resources for the workload of the second sub-load type. Accordingly, the third resource allocation information refers to resource information within the maneuverable resources that can be allocated to the second sub-load type, and the fourth resource allocation information refers to resource information within the first short-period resources that can be allocated to the second sub-load type.

[0144] Based on this, in order to ensure that the allocable resources for the workload of the second sub-load type are sufficient and the utilization rate is high, the exciting resources and their corresponding maneuvering weights can be obtained to determine the third resource allocation information corresponding to the resources that can be allocated to the second sub-load type based on the maneuvering resources and the maneuvering weights; at the same time, the fourth resource allocation information is determined based on the resource evaluation information and the resource application information, and finally the second resource allocation information corresponding to the second sub-load type can be determined by integrating the third resource allocation information and the fourth resource allocation information. The second resource allocation information includes the allocation details of the maneuvering resources and the allocation details of the first short-cycle resources to support the operation of the workload of the second sub-load type. It should be noted that the maneuvering weight value can be determined based on the average operating time of the workload of the second sub-load type and the frequency of scheduling maneuvering resources for the workload of the first sub-load type.

[0145] Continuing with the previous example, after determining the short-cycle resources that can be allocated to Batch from the first short-cycle resources corresponding to Prod, we can also calculate the additional resources that can be allocated to Batch based on the corresponding Free emergency resources and their corresponding weights. Then, by integrating these two parts of resources, we can determine the second short-cycle resources that can be allocated to Batch to support the operation of this type of workload.

[0146] In summary, by adding mobile resources to the second short-cycle resources, not only can the problem of insufficient resource allocation rate be avoided, but it can also ensure that the workload of the second sub-load type can be allocated to the first short-cycle resources corresponding to the first sub-load type, thereby improving resource utilization and avoiding useless consumption caused by long-term idle resources.

[0147] Step S208: Allocate long-period resources for the long-period load type in the short-period resources according to the long-period resource characteristic diagram.

[0148] Specifically, after completing the resource allocation for the short-cycle load type as described above, further, in order to improve resource utilization, long-cycle resources can be allocated to the long-cycle load type in the short-cycle resources according to the long-term resource characteristic diagram. That is to say, the long-cycle resources allocated to the long-cycle load type are part of the short-cycle resources, thereby ensuring that when allocating long-cycle resources, the characteristics of the long-cycle load type can be fully considered, and the resources that may not be used in the short-cycle load type are fully utilized, thereby effectively improving resource utilization.

[0149] Furthermore, in the process of allocating long-period resources for long-period load types, in order to improve the rationality of resource allocation, the long-period characteristic graph corresponding to the long-period load type can be combined to complete the allocation. In this embodiment, the specific implementation method is as follows:

[0150] Determine a long-cycle resource characteristic value according to the long-cycle resource characteristic diagram; determine long-cycle resource allocation information based on the long-cycle resource characteristic value; and allocate the long-cycle resource in the short-cycle resource for the long-cycle load type according to the long-cycle resource allocation information.

[0151] Specifically, the long-period resource characteristic value refers to a value representing resource usage of a workload of a long-period load type, and the long-period resource allocation information refers to information on resource allocation for the long-period load type.

[0152] Based on this, considering that short-cycle workloads have already adequately addressed short-lifecycle computing tasks, with the widespread application of AI technology, AI training and inference are not short-lifecycle tasks. They place higher demands on resource stability during runtime than workloads with short-cycle workloads, requiring long-term and stable resources. Therefore, if long-cycle resources need to be allocated for long-cycle workloads, it is necessary to determine long-cycle resource feature values ​​based on the long-cycle resource feature graph, and then determine long-cycle resource allocation information based on the long-cycle resource feature values. Then, according to the long-cycle resource allocation information, long-cycle resources can be allocated to the long-cycle workloads from the short-cycle resources. In other words, long-cycle resources are part of short-cycle resources.

[0153] Continuing with the above example, when resources need to be allocated to Mid, considering resource utilization, Mid's resource profile can be obtained based on the long-term resource usage of Prod's workload, and the cycle length can be determined according to the characteristics of the workload, that is, T mid ∈{8,31}, ensuring that the operating cycle of Mid's workload can cover the weekly or monthly time period of Prod's workload, that is, Mid's resource allocation needs to satisfy Allocable(Mid)=∑ i [request(Prod i )-S T (Prod i ), where S T (Prod i ) represents the long-term resource profile value of the Prod workload, that is, Figure 5 As shown in the diagram, the workload of Mid will occupy the allocated and unused resources for a long time during operation; the S obtained by the long-term resource profile value T (Prod i ) to perform resource point reading, making the Mid resource stability very close to the Prod resource, which is used to support tasks with long life cycles.

[0154] It should be noted that when workloads belonging to Prod, Mid, or Batch are requested simultaneously, if resources can be allocated, they can run simultaneously. If resources cannot be reasonably allocated, they can be processed in order of priority to improve resource utilization.

[0155] In summary, by profiling the resource usage characteristics of Prod-type online real-time interactive tasks, we can not only use short-cycle resources to re-allocate allocated but unused resources for long-cycle workloads, thereby improving resource utilization, but also ensure that workloads with long-cycle workloads use more stable resources during runtime to support their continuous operation.

[0156] In addition, considering that additional resources are needed to support the operation of sudden workloads in emergency scenarios, additional call resources can be set. In this embodiment, the specific implementation is as follows:

[0157] Obtain system reserved resources; calculate calling resources based on the resources to be allocated, the short-cycle resources and the system reserved resources, and create a calling strategy corresponding to the calling resources; allocate the calling resources according to the emergency load type, and configure the calling strategy.

[0158] Specifically, system reserved resources refer to resources that cannot be used, call resources refer to resources that can support additional allocation for emergency scenarios, and call policies refer to limiting the usage scenarios of call resources to avoid abuse of call resources.

[0159] Based on this, although the resource allocation of short-cycle load types and long-cycle load types has covered a large range of scenarios and can meet the computing resource demands of different workloads in their respective scenarios, in order to support emergency needs, calling resources can also be set. That is, the resources used during emergencies can be supported at any time. These resources can be calculated and determined based on the resources to be allocated, short-cycle resources, and system reserved resources. In order to improve the stability of calling resources, a calling strategy is also set for it to allocate calling resources for emergency load types and configure the calling strategy.

[0160] Continuing with the above example, considering that the combination of Prod+Mid+Batch can fully utilize the resources in the cluster and meet the workload's demand for computing resources in their respective scenarios. In order to cope with unexpected scenarios, you can set additional corresponding Free call resources, see Figure 6 The schematic diagram shown in the figure shows that Free is a resource scheduling based on the actual utilization of the node, which satisfies Allocable(Free)=min(Allocable Node -Reserved System -Usage Node ,HardLimit Free ), that is, the remaining resources in the node can be used as Free calling resources, and the Free corresponding resources of the same node can be set to not be called by too many tasks.

[0161] In summary, by setting call resources and call strategies, you can respond to emergency scenarios, which not only improves resource utilization but also facilitates resource maintenance.

[0162] Furthermore, after resource allocation is completed, if a request corresponding to the target application is received, corresponding resources can be selected and allocated based on the type of the target application to support the operation of the request. In this embodiment, the specific implementation is as follows:

[0163] Obtain an application request corresponding to a target application, and determine a target load type corresponding to the application request; if the target load type is the short-cycle load type, load the application request to the short-cycle resource; if the target load type is the long-cycle load type, load the application request to the long-cycle resource.

[0164] Specifically, the target application refers to an application that needs to be supported by computing resources at the current moment. Correspondingly, the application request is a request that needs to be responded to by resource operation.

[0165] Based on this, after receiving the application request corresponding to the target application, the target load type corresponding to the application request can be determined first. If the target load type belongs to the short-cycle load type, it means that short-cycle resources need to be used to run the application request, and the application request can be loaded into the short-cycle resources; if the target load type belongs to the long-cycle load type, it means that long-cycle resources need to be used to run the application request, and the application request can be loaded into the long-cycle resources.

[0166] The resource allocation method provided in this specification can, after obtaining the resource usage data corresponding to the workload, construct a long-cycle resource characteristic graph corresponding to the long-cycle load type and a short-cycle resource characteristic graph corresponding to the short-cycle load type based on this data, so as to reflect the resource demands of different types of workloads through the resource characteristic graph, and then allocate short-cycle resources for the short-cycle load type according to the short-cycle resource characteristic graph, and oversell long-cycle resources for the long-cycle task load type after the resources are fully allocated according to the long-cycle resource characteristic graph; it realizes the resource allocation that supports any task through unified processing, which not only guarantees the resource certainty demands of various services, but also improves the resource utilization rate of the data center by overselling resources, and effectively reduces the losses caused by resource waste.

[0167] The following combined Figure 7 , taking the application of the resource allocation method provided in this specification in the data center resource allocation scenario as an example, the resource allocation method is further explained. Figure 7 A flowchart of a resource allocation method according to an embodiment of the present specification is shown, which specifically includes the following steps.

[0168] Step S702: Obtain resource usage data corresponding to the workload.

[0169] Step S704: constructing a long-period resource characteristic graph corresponding to the long-period load type and a short-period resource characteristic graph corresponding to the short-period load type according to the resource usage data.

[0170] Step S706: Determine first resource allocation information corresponding to the first sub-load type included in the short-cycle load type according to the short-cycle resource characteristic graph.

[0171] Step S708: Determine resource application information and resource usage information corresponding to the short-period load type according to the short-period resource characteristic graph.

[0172] Step S710: Perform resource evaluation on the short-period load type according to the resource usage information to obtain resource evaluation information.

[0173] Step S712: Determine second resource allocation information corresponding to the second sub-load type based on the resource evaluation information and the resource application information.

[0174] Step S714: Allocate first short-cycle resources for the first sub-load type from the resources to be allocated according to the first resource allocation information.

[0175] Step S716: Allocate second short cycle resources for the second sub-load type in the first short cycle resources according to the second resource allocation information.

[0176] Step S718: Determine the long-period resource characteristic value according to the long-period resource characteristic graph.

[0177] Step S720: Determine long-period resource allocation information based on the long-period resource characteristic value.

[0178] Step S722: Allocate long-period resources for the long-period load type in the first short-period resources according to the long-period resource allocation information.

[0179] Step S724: Obtain system reserved resources, and calculate the calling resources based on the resources to be allocated, the short-term resources, and the system reserved resources.

[0180] Step S726: Create a call policy corresponding to the call resource, allocate the call resource according to the emergency load type, and configure the call policy.

[0181] To sum up, the resource allocation method provided in this specification, after obtaining the resource usage data corresponding to the workload, can construct a long-cycle resource characteristic graph corresponding to the long-cycle load type and a short-cycle resource characteristic graph corresponding to the short-cycle load type based on this, so as to reflect the resource demands of different types of workloads through the resource characteristic graph, and then allocate short-cycle resources for the short-cycle load type according to the short-cycle resource characteristic graph, and oversell long-cycle resources for the long-cycle task load type according to the long-cycle resource characteristic graph after the resources are fully allocated; it realizes the resource allocation that supports any task through unified processing, which not only guarantees the resource certainty demands of various services, but also improves the resource utilization rate of the data center by overselling resources, and effectively reduces the losses caused by resource waste.

[0182] Corresponding to the above method embodiment, this specification also provides a resource allocation device embodiment, Figure 8 FIG. 1 shows a schematic diagram of a resource allocation device provided by an embodiment of this specification. Figure 8 As shown, the device includes:

[0183] An acquisition module 802 is configured to acquire resource usage data corresponding to a workload;

[0184] A construction module 804 is configured to construct a long-period resource characteristic graph corresponding to the long-period load type and a short-period resource characteristic graph corresponding to the short-period load type according to the resource usage data;

[0185] A first allocation module 806 is configured to allocate short-cycle resources for the short-cycle load type in the resources to be allocated according to the short-cycle resource characteristic graph;

[0186] The second allocation module 808 is configured to allocate long-period resources for the long-period load type in the short-period resources according to the long-period resource characteristic diagram.

[0187] In an optional embodiment, the construction module 804 is further configured to:

[0188] Selecting initial resource usage data corresponding to a target time interval from the resource usage data; processing the initial resource usage data according to a preset attenuation strategy to obtain short-cycle resource usage data; and constructing the short-cycle resource characteristic graph corresponding to the short-cycle load type based on the short-cycle resource usage data.

[0189] In an optional embodiment, the first allocation module 806 is further configured to:

[0190] Determine a short-cycle resource characteristic value according to the short-cycle resource characteristic diagram; use the short-cycle resource characteristic value to process the workload in the short-cycle load type, and determine short-cycle resource allocation information according to the processing result; and allocate the short-cycle resource for the short-cycle load type in the resources to be allocated according to the short-cycle resource allocation information.

[0191] In an optional embodiment, the construction module 804 is further configured to:

[0192] Determine a period value corresponding to the long-period load type, and determine long-period resource usage data in the resource usage data according to the period value; and construct the long-period resource characteristic graph corresponding to the long-period load type based on the long-period resource usage data.

[0193] In an optional embodiment, the second allocation module 808 is further configured to:

[0194] Determine a long-cycle resource characteristic value according to the long-cycle resource characteristic diagram; determine long-cycle resource allocation information based on the long-cycle resource characteristic value; and allocate the long-cycle resource in the short-cycle resource for the long-cycle load type according to the long-cycle resource allocation information.

[0195] In an optional embodiment, the construction module 804 is further configured to:

[0196] According to the short cycle resource characteristic diagram, first resource allocation information corresponding to the first sub-load type contained in the short cycle load type and second resource allocation information corresponding to the second sub-load type are determined; according to the first resource allocation information, a first short cycle resource is allocated for the first sub-load type in the resources to be allocated; according to the second resource allocation information, a second short cycle resource is allocated for the second sub-load type in the first short cycle resource.

[0197] In an optional embodiment, the construction module 804 is further configured to:

[0198] Determine the resource application information and resource usage information corresponding to the short-cycle load type according to the short-cycle resource characteristic diagram; perform resource evaluation on the short-cycle load type according to the resource usage information to obtain resource evaluation information; and determine the second resource allocation information corresponding to the second sub-load type based on the resource evaluation information and the resource application information.

[0199] In an optional embodiment, the construction module 804 is further configured to:

[0200] Obtain a maneuverable resource and a maneuverable weight corresponding to the maneuverable resource; generate third resource allocation information based on the maneuverable resource and the maneuverable weight, and determine fourth resource allocation information based on the resource evaluation information and the resource application information; based on the third resource allocation information and the fourth resource allocation information, determine the second resource allocation information corresponding to the second sub-load type.

[0201] In an optional embodiment, the construction module 804 is further configured to:

[0202] The initial resource usage data is sampled and processed at each time node in the target time interval to obtain multiple initial resource usage values; the attenuation value corresponding to the target time interval is determined, and the multiple initial resource usage values ​​are processed according to the attenuation value; and the short-cycle resource usage data is determined based on the processing result.

[0203] In an optional embodiment, the resource allocation device further includes:

[0204] The emergency module is configured to obtain system reserved resources; calculate calling resources based on the resources to be allocated, the short-cycle resources and the system reserved resources, and create a calling strategy corresponding to the calling resources; allocate the calling resources according to the emergency load type, and configure the calling strategy.

[0205] In an optional embodiment, the resource allocation device further includes:

[0206] The loading module is configured to obtain an application request corresponding to a target application and determine a target load type corresponding to the application request; when the target load type is the short-cycle load type, the application request is loaded into the short-cycle resource; when the target load type is the long-cycle load type, the application request is loaded into the long-cycle resource.

[0207] The resource allocation device provided in this specification can, after obtaining the resource usage data corresponding to the workload, construct a long-cycle resource characteristic graph corresponding to the long-cycle load type and a short-cycle resource characteristic graph corresponding to the short-cycle load type based on this data, so as to reflect the resource demands of different types of workloads through the resource characteristic graph, and then allocate short-cycle resources for the short-cycle load type according to the short-cycle resource characteristic graph, and oversell long-cycle resources for the long-cycle task load type after the resources are fully allocated according to the long-cycle resource characteristic graph; it realizes the resource allocation that supports any task through unified processing, which not only guarantees the resource certainty demands of various services, but also improves the resource utilization rate of the data center by overselling resources, and effectively reduces the losses caused by resource waste.

[0208] The above is a schematic solution of a resource allocation device of this embodiment. It should be noted that the technical solution of the resource allocation device and the technical solution of the resource allocation method described above are based on the same concept. For details not described in detail in the technical solution of the resource allocation device, please refer to the description of the technical solution of the resource allocation method described above.

[0209] Figure 9 The block diagram of a computing device 900 according to one embodiment of the present disclosure is shown. Components of the computing device 900 include, but are not limited to, a memory 910 and a processor 920. The processor 920 is connected to the memory 910 via a bus 930, and a database 950 is used to store data.

[0210] The computing device 900 also includes an access device 940 that enables the computing device 900 to communicate via one or more networks 960. Examples of these networks include a public switched telephone network (PSTN), a local area network (LAN), a wide area network (WAN), a personal area network (PAN), or a combination of communication networks such as the Internet. The access device 940 may include one or more of any type of network interface (e.g., a network interface card (NIC)) whether wired or wireless, such as an IEEE 802.11 wireless local area network (WLAN) wireless interface, a Worldwide Interoperability for Microwave Access (Wi-MAX) interface, an Ethernet interface, a universal serial bus (USB) interface, a cellular network interface, a Bluetooth interface, a near field communication (NFC) interface, and the like.

[0211] In one embodiment of the present specification, the above components of the computing device 900 and Figure 9 Other components not shown in the figure may also be connected to each other, for example, via a bus. Figure 9 The computing device structure block diagram shown is for illustrative purposes only and is not intended to limit the scope of this specification. Those skilled in the art may add or replace other components as needed.

[0212] The computing device 900 can be any type of stationary or mobile computing device, including a mobile computer or mobile computing device (e.g., a tablet computer, a personal digital assistant, a laptop computer, a notebook computer, a netbook computer, etc.), a mobile phone (e.g., a smartphone), a wearable computing device (e.g., a smartwatch, smart glasses, etc.), or other types of mobile devices, or a stationary computing device such as a desktop computer or PC. The computing device 900 can also be a mobile or stationary server.

[0213] The processor 920 is configured to execute the following computer-executable instructions, which implement the steps of the above-mentioned resource allocation method when executed by the processor.

[0214] The above is a schematic solution of a computing device of this embodiment. It should be noted that the technical solution of the computing device and the technical solution of the resource allocation method described above are of the same concept. For details not described in detail in the technical solution of the computing device, please refer to the description of the technical solution of the resource allocation method described above.

[0215] An embodiment of the present specification further provides a computer-readable storage medium storing computer-executable instructions, which implement the steps of the above-mentioned resource allocation method when executed by a processor.

[0216] The above is an illustrative embodiment of a computer-readable storage medium. It should be noted that the technical solution of the storage medium and the technical solution of the resource allocation method described above are based on the same concept. For details not described in detail in the technical solution of the storage medium, please refer to the description of the technical solution of the resource allocation method described above.

[0217] An embodiment of the present specification further provides a computer program, wherein when the computer program is executed in a computer, the computer is caused to execute the steps of the above-mentioned resource allocation method.

[0218] The above is an illustrative solution of a computer program of this embodiment. It should be noted that the technical solution of the computer program and the technical solution of the resource allocation method described above are of the same concept. For details not described in detail in the technical solution of the computer program, please refer to the description of the technical solution of the resource allocation method described above.

[0219] The foregoing description of this specification describes specific embodiments. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recited in the claims can be performed in an order different from that described in the embodiments and still achieve the desired results. Furthermore, the processes depicted in the accompanying drawings do not necessarily require the specific order shown or the sequential order to achieve the desired results. In certain embodiments, multitasking and parallel processing are also possible or may be advantageous.

[0220] The computer instructions include computer program code, which may be in source code form, object code form, executable file, or some intermediate form. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, USB flash drive, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electric carrier signal, telecommunication signal, and software distribution medium, etc. It should be noted that the content contained in the computer-readable medium may be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, computer-readable media do not include electric carrier signals and telecommunication signals.

[0221] It should be noted that for the aforementioned method embodiments, for the sake of simplicity of description, they are all expressed as a series of action combinations, but those skilled in the art should be aware that the embodiments of this specification are not limited by the order of the actions described, because according to the embodiments of this specification, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in this specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the embodiments of this specification.

[0222] In the above embodiments, the description of each embodiment has its own focus. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0223] The preferred embodiments disclosed above are intended only to help illustrate this specification. The optional embodiments do not exhaustively describe all details, nor do they limit the invention to the specific embodiments described. Obviously, many modifications and variations can be made based on the content of the embodiments of this specification. This specification selects and specifically describes these embodiments in order to better explain the principles and practical applications of the embodiments of this specification, so that those skilled in the art can better understand and utilize this specification. This specification is limited only by the claims and their full scope and equivalents.

Claims

1. A resource allocation method, comprising: Obtain resource usage data corresponding to the workload; Constructing a long-period resource characteristic graph corresponding to the long-period load type and a short-period resource characteristic graph corresponding to the short-period load type based on the resource usage data, wherein the short-period resource characteristic graph is constructed based on resource usage data corresponding to the short-period load type obtained by processing initial resource usage data corresponding to a target time interval in the resource usage data according to a preset attenuation strategy; and the long-period resource characteristic graph is constructed based on the long-period resource usage data determined in the resource usage data by a period value corresponding to the long-period load type; Allocating short-cycle resources for the short-cycle load type from the resources to be allocated according to the short-cycle resource characteristic graph; According to the long-period resource characteristic diagram, long-period resources are allocated in the short-period resources for the long-period load type.

2. The resource allocation method according to claim 1, wherein allocating short-cycle resources according to the short-cycle resource characteristic graph and the short-cycle load type in the resources to be allocated comprises: Determining a short-period resource characteristic value according to the short-period resource characteristic graph; Processing the workload in the short-cycle load type using the short-cycle resource characteristic value, and determining short-cycle resource allocation information according to the processing result; According to the short cycle resource allocation information, the short cycle resource is allocated in the resources to be allocated for the short cycle load type.

3. The resource allocation method according to claim 1, wherein allocating long-period resources for the long-period load type in the short-period resources according to the long-period resource characteristic graph comprises: Determining a long-term resource characteristic value according to the long-term resource characteristic graph; Determining long-term resource allocation information based on the long-term resource characteristic value; According to the long-cycle resource allocation information, the long-cycle resource is allocated in the short-cycle resources for the long-cycle load type.

4. The resource allocation method according to claim 1, wherein allocating short-cycle resources according to the short-cycle resource characteristic graph and the short-cycle load type in the resources to be allocated comprises: Determine, according to the short-cycle resource characteristic graph, first resource allocation information corresponding to the first sub-load type included in the short-cycle load type, and second resource allocation information corresponding to the second sub-load type; Allocating a first short-cycle resource for the first sub-load type in the resources to be allocated according to the first resource allocation information; According to the second resource allocation information, a second short cycle resource is allocated for the second sub-load type in the first short cycle resource.

5. The resource allocation method according to claim 4, wherein the second resource allocation information is determined by: Determining resource application information and resource usage information corresponding to the short-period load type according to the short-period resource characteristic graph; Performing resource evaluation on the short-period load type according to the resource usage information to obtain resource evaluation information; Determine the second resource allocation information corresponding to the second sub-load type based on the resource evaluation information and the resource application information.

6. The resource allocation method according to claim 5, further comprising: performing resource evaluation on the short-period load type according to the resource usage information and obtaining resource evaluation information; Obtaining a maneuvering resource and a maneuvering weight corresponding to the maneuvering resource; generating third resource allocation information according to the maneuvering resource and the maneuvering weight, and determining fourth resource allocation information according to the resource evaluation information and the resource application information; The second resource allocation information corresponding to the second sub-load type is determined based on the third resource allocation information and the fourth resource allocation information.

7. The resource allocation method according to claim 1, wherein processing the initial resource usage data corresponding to the target time interval in the resource usage data according to a preset decay strategy comprises: Sampling the initial resource usage data at each time node in the target time interval to obtain a plurality of initial resource usage values; determining an attenuation value corresponding to the target time interval, and processing the multiple initial resource usage values ​​according to the attenuation value; The short-term resource usage data is determined according to the processing result.

8. The resource allocation method according to claim 1, further comprising: Obtain system reserved resources; Calculating calling resources according to the to-be-allocated resources, the short-cycle resources, and the system reserved resources, and creating a calling policy corresponding to the calling resources; The calling resources are allocated according to the emergency load type, and the calling strategy is configured.

9. The resource allocation method according to claim 1, further comprising: after allocating long-period resources for the long-period load type in the short-period resources according to the long-period resource characteristic graph; Obtaining an application request corresponding to a target application, and determining a target load type corresponding to the application request; When the target load type is the short-cycle load type, loading the application request to the short-cycle resource; When the target load type is the long-period load type, the application request is loaded to the long-period resource.

10. A resource allocation device, comprising: an acquisition module, configured to acquire resource usage data corresponding to the workload; a construction module configured to construct, based on the resource usage data, a long-period resource characteristic graph corresponding to the long-period load type and a short-period resource characteristic graph corresponding to the short-period load type, wherein the short-period resource characteristic graph is constructed based on resource usage data corresponding to the short-period load type obtained by processing initial resource usage data corresponding to a target time interval in the resource usage data according to a preset attenuation strategy; and the long-period resource characteristic graph is constructed based on long-period resource usage data determined in the resource usage data by a period value corresponding to the long-period load type; A first allocation module is configured to allocate short-cycle resources for the short-cycle load type in the resources to be allocated according to the short-cycle resource characteristic graph; The second allocation module is configured to allocate long-period resources for the long-period load type in the short-period resources according to the long-period resource characteristic diagram.

11. A computing device comprising: memory and processor; The memory is used to store computer-executable instructions, and the processor is used to execute the computer-executable instructions. When the computer-executable instructions are executed by the processor, the steps of the resource allocation method according to any one of claims 1 to 9 are implemented.

12. A computer-readable storage medium storing computer-executable instructions, wherein the computer-executable instructions, when executed by a processor, implement the steps of the resource allocation method according to any one of claims 1 to 9.

13. A computer program product, characterized in that The method comprises computer instructions, which, when executed by a processor, implement the steps of the resource allocation method according to any one of claims 1 to 9.

Citation Information

Patent Citations

  • Resource quota adjustment method and device, computer equipment and storage medium

    CN112860442A