Resource scheduling method and device, equipment, storage medium and program product
By obtaining resource specification information, probability prediction and simulation resource application, the problem of uneven resource allocation is solved, and the balance of resource scheduling and business stability are achieved.
Patent Information
- Application Number
- CN202410993044.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-23
- Publication Date
- 2024-11-01
AI Technical Summary
Existing resource scheduling methods can easily lead to unbalanced resource allocation, and the rescheduling mechanism affects online services.
By obtaining resource specification information, creating probability prediction based on resource instances based on probability prediction models, simulate resource application operations to obtain resource fragmentation information, and select the target host to sort from small to large according to fragmentation rate for resource scheduling.
It effectively avoids uneven resource allocation, improves resource utilization, and reduces the impact of rescheduling on online services.
Smart Images

Figure CN118885295A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of resource management technology, and in particular to a resource scheduling method, device, equipment, storage medium and program product. Background Art
[0002] The existing technology uses the resource utilization rate of the node as the scheduling standard. According to this scheduling standard, nodes with higher comprehensive resource utilization rate are usually selected for scheduling, which easily forms resource hotspots during scheduling and allocation, leading to the problem of unbalanced resource allocation. The use of the existing rescheduling mechanism will affect online services. Summary of the invention
[0003] The purpose of the present invention is to provide a resource scheduling method, device, equipment, storage medium and program product to solve the problem of unbalanced resource allocation caused by existing resource scheduling.
[0004] In order to solve the above technical problems, in a first aspect, an embodiment of the present invention provides a resource scheduling method, including:
[0005] Get resource specification information;
[0006] Based on the resource specification information, a probability prediction is performed on the resource instance creation to obtain a first probability chain;
[0007] Performing a simulated operation of resource application on each host according to the first probability chain to obtain resource fragmentation information of each host;
[0008] Based on the resource fragmentation information of each host, a target host is selected from all hosts to perform resource scheduling of the resource instance to be created.
[0009] In some embodiments, the performing probability prediction on resource instance creation based on the resource specification information to obtain a first probability chain includes:
[0010] Inputting the resource specification information into a prediction probability model to obtain multiple probability chains for future resource applications;
[0011] A probability chain with the highest probability of resource instance creation is selected from the multiple probability chains as the first probability chain.
[0012] In some embodiments, each probability chain includes a probability of creation of each resource instance in the chain;
[0013] The step of selecting a probability chain with the highest probability of resource instance creation from the multiple probability chains as the first probability chain includes:
[0014] Determine the probability chain that satisfies the first condition among the multiple probability chains as the probability chain with the highest probability of resource instance creation, wherein the first condition is that the probability of creation of each resource instance on the chain is greater than the probability of creation of each resource instance on other probability chains;
[0015] The probability chain with the highest probability of creating the resource instance is used as the first probability chain.
[0016] In some embodiments, the method further comprises:
[0017] Get the history of resource instance creation;
[0018] Obtaining a resource instance creation order and a probability of creation of each resource instance from the historical records;
[0019] Model training is performed according to the resource instance creation order and the probability of creation of each resource instance to obtain the prediction probability model, wherein the output of the prediction probability model is a probability chain, and the probability chain includes the predicted future resource instance creation order and probability.
[0020] In some embodiments, performing a simulation operation of resource application on each host according to the first probability chain to obtain resource fragmentation information of each host includes:
[0021] Get the status information of all hosts in the resource pool;
[0022] For each host, according to the first probability chain and the status information of the host, a simulation operation of resource application is performed until the host can no longer create resources, and the remaining resources are used as fragmented resources of each host;
[0023] For each host, the resource fragmentation rate of each host is calculated according to the state information of the host and the fragmented resources of the host.
[0024] In some embodiments, the resource fragmentation information of the host is a resource fragmentation rate of the host;
[0025] The selecting a target host from all hosts to perform resource scheduling of the resource instance to be created based on the resource fragmentation information of each host includes:
[0026] Sort the resource fragmentation rates of all hosts in ascending order;
[0027] The hosts ranked in the top N positions are selected as target hosts, and the target hosts are used to perform resource scheduling of the resource instances to be created, where 1≤N≤M, M is a positive integer greater than 1, and N is a positive integer.
[0028] In a second aspect, an embodiment of the present invention further provides a resource scheduling device, including:
[0029] The acquisition module is used to obtain resource specification information;
[0030] A probability prediction module, used to perform probability prediction on resource instance creation based on the resource specification information to obtain a first probability chain;
[0031] A processing module, configured to perform a simulation operation of resource application on each host according to the first probability chain to obtain resource fragmentation information of each host;
[0032] The resource scheduling module is used to select a target host from all hosts to perform resource scheduling of the resource instance to be created based on the resource fragmentation information of each host.
[0033] In a third aspect, an embodiment of the present invention further provides a resource scheduling device, comprising a memory, a processor, and a program stored in the memory and executable on the processor; when the processor executes the program, the resource scheduling method described in the first aspect is implemented.
[0034] In a fourth aspect, an embodiment of the present invention further provides a readable storage medium having a program stored thereon, which, when executed by a processor, implements the steps in the resource scheduling method described in the first aspect.
[0035] In a fifth aspect, an embodiment of the present invention further provides a computer program product including computer instructions, which, when executed by a processor, implement the steps in the resource scheduling method described in the first aspect.
[0036] The beneficial effects of the above technical solution of the present invention are as follows:
[0037] In the above scheme, resource specification information is obtained; then, based on the resource specification information, a probability prediction is made on the creation of resource instances to obtain a first probability chain; then, a simulated operation of resource application is performed on each host according to the first probability chain to obtain resource fragmentation information of each host; finally, based on the resource fragmentation information of each host, a target host is selected from all hosts to perform resource scheduling of the resource instance to be created. In this way, a scheduling node is selected according to the resource specifications and in combination with the resource fragments obtained through prediction. Specifically, a host with small resource fragments can be selected for resource scheduling, which can avoid imbalance in resource allocation and ensure balanced use of various resources on the node. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] Figure 1 This is a flowchart of a resource scheduling method according to an embodiment of the present invention;
[0039] Figure 2What is shown is a schematic diagram of the Markov chain structure of the order in which different types of instances are created;
[0040] Figure 3 A schematic diagram of a resource instance creation process according to an embodiment of the present invention;
[0041] Figure 4 A schematic diagram of calculating the resource fragmentation rate of a host according to an embodiment of the present invention;
[0042] Figure 5 This is a second flow chart of the resource scheduling method according to an embodiment of the present invention;
[0043] Figure 6 The third flowchart of the resource scheduling method according to the embodiment of the present invention;
[0044] Figure 7 A schematic diagram of the effect of using the resource scheduling method of the present invention;
[0045] Figure 8 Schematic diagram of the structure of a resource scheduling device according to an embodiment of the present invention. DETAILED DESCRIPTION
[0046] In order to make the technical problems, technical solutions and advantages to be solved by the present invention more clear, a detailed description will be given below with reference to the accompanying drawings and specific embodiments.
[0047] The existing technology generally selects nodes with higher comprehensive resource utilization from eligible scheduling nodes for scheduling, which is prone to the following problems. First, it is easy to cause unbalanced resource allocation and fail to fully utilize all machine resources; second, it is easy to cause resource fragmentation in nodes with high resource load and fail to fully utilize the remaining resources of the node, such as the node CPU or memory has been fully allocated, and the remaining graphics processing unit (GPU) resources cannot be used.
[0048] Here, common resource fragments refer to small fragments of server resources (such as CPU) that cannot be fully utilized in a cloud computing environment. Resource fragments are defined in this application as remaining host resources that cannot match resource specifications and are sold.
[0049] Among them, resource specifications refer to: resource requirements defined according to user needs, such as the number of CPU cores, memory size, storage capacity, etc.
[0050] Fragmentation of resource allocation will lead to a decrease in resource utilization, so it is necessary to reduce fragmentation. Currently, virtual machine migration (rescheduling) mechanism is often used to reduce fragmentation and achieve balanced resource allocation, but this will affect online services.
[0051] In order to solve the above technical problems, the present invention provides a resource scheduling method, device, equipment, storage medium and program product, wherein the method and the device are based on the same application concept. Since the principles of solving the problems by the method and the device are similar, the implementation of the device and the method can refer to each other, and the repeated parts will not be repeated.
[0052] like Figure 1 FIG. 1 is a flow chart of a resource scheduling method provided by an embodiment of the present invention. The method may include:
[0053] Step 101, obtaining resource specification information;
[0054] The resource specification information is the resource description information of the resource instance to be created.
[0055] In an optional embodiment, step 101 specifically includes:
[0056] A resource creation request is received, wherein the resource creation request carries the resource specification information.
[0057] Here, the user initiates a resource creation request after selecting a resource specification on the cloud management platform page. After receiving the resource creation request, the device executing the method parses the resource creation request to obtain the resource specification information carried in the resource creation request.
[0058] Among them, resource specifications are resource descriptions created by resource instances. Usually, resource specifications include multi-dimensional resource requirements such as CPU, memory, storage, GPU, etc. It should be noted that resource specifications are defined according to business requirements, as shown below:
[0059] Specification name Specifications 10C-22G-150G-3060Ti CPU10C, memory 22G, disk 150G, GPU3060Ti 16C-32G-100G-3060Ti CPU16C, memory32G, disk100G, GPU3060Ti 8C-32G-3060Ti CPU8C, memory 32G, GPU3060Ti 16C-22G-100G-3060ti CPU16C, memory 22G, disk 100G, GPU3060Ti 20C-44G-200G-2*3060Ti CPU20C, memory 44G, disk 200G, 2 GPU3060Ti
[0060] Step 102, based on the resource specification information, perform probability prediction on resource instance creation to obtain a first probability chain;
[0061] Optionally, the first probability chain is a probability chain having a Markov chain structure. The Markov chain structure can be found in Figure 2 . Figure 2 In the figure, t[e] represents a resource instance, and the line represents the probability of creating a subsequent instance after the instance is created. The first probability chain includes the future resource instance creation order and probability predicted based on the resource specification information. Here, the first probability chain is the probability chain with the highest probability of resource instance creation. In this way, the subsequent simulation operation of resource application is performed according to the resource instance that is most likely to be created in the future. The resource fragments of the host obtained can provide a relatively accurate reference basis for achieving optimal resource scheduling.
[0062] It should be understood that when creating a resource instance based on resource specification information (i.e. creating a resource specification instance), you need to select a host to execute resource creation. After the resource instance is created, the host resources are occupied. For the specific creation process, see Figure 3 .
[0063] It should be noted that Markov Chain is a mathematical model used to describe a series of random events, in which the occurrence of each event is only related to the previous event.
[0064] Step 103, performing a simulated operation of resource application on each host according to the first probability chain to obtain resource fragmentation information of each host;
[0065] That is, for each host, the simulation operation of resource application is performed according to the first probability chain, that is, the resource application is simulated according to the creation order and probability of resource instances in the first probability chain until the host can no longer create resources, and the resource fragmentation information of each host is obtained.
[0066] Step 104 : Based on the resource fragmentation information of each host, a target host is selected from all hosts to perform resource scheduling of the resource instance to be created.
[0067] Here, based on the resource fragmentation information of each host, a host with a lower resource fragmentation rate is selected from all hosts as the target host for resource scheduling, which can avoid unbalanced resource allocation and ensure balanced use of various resources on the node.
[0068] In an optional embodiment, step 102, based on the resource specification information, performing probability prediction on resource instance creation to obtain a first probability chain includes:
[0069] Step 1021, inputting the resource specification information into a prediction probability model to obtain multiple probability chains for future resource applications;
[0070] That is, the prediction probability model can realize the probability prediction of resource instance creation. It should be noted that the prediction probability model is a pre-trained model. The specific model training process is as follows:
[0071] In an optional embodiment, the method of the present invention further comprises:
[0072] (1) Obtain the historical record of resource instance creation;
[0073] Among them, the historical records of resource instance creation can be obtained from the monitoring system.
[0074] (2) obtaining the resource instance creation order and the probability of creation of each resource instance from the historical records;
[0075] Here, the resource instance creation order refers to the order in which the resource instances are created. Specifically, the probability of creating other instances after each resource instance is created is counted in sequence according to the order in which the resource instances are created.
[0076] (3) Model training is performed according to the resource instance creation order and the probability of creation of each resource instance to obtain the prediction probability model, wherein the output of the prediction probability model is a probability chain, and the probability chain includes the predicted future resource instance creation order and probability.
[0077] Here, the model being trained is an empirical model based on predefined rules. It should be understood that the prediction probability model obtained through training is an inference model that can support fragmentation management when creating and destroying instances and expanding resource pools.
[0078] Among them, the probability chain output by the prediction probability model is a Markov chain, which is stored in the adjacent matrix format.
[0079] When the prediction probability model is subsequently applied for query, the model uses the Markov chain structure and the random number algorithm to obtain the probability of subsequent instance creation when the current specification creation event occurs.
[0080] In summary, the principle of probability prediction is: based on the historical records of resource instance creation in the monitoring system, according to the order of creation of each resource instance in the historical records, the probability of creating instances t[1] to t[n] after each resource instance is counted in sequence. According to the above steps, a Markov chain is finally generated and stored in the adjacent matrix format, as follows:
[0081] double[][]transition={{0.386,0.147,0.202,0.062,0.140,0.047,
[0082] 0.016},
[0083] {0.107,0.267,0.227,0.120,0.207,0.052,0.020},
[0084] {0.035,0.101,0.188,0.191,0.357,0.067,0.061},
[0085] {0.021,0.039,0.112,0.212,0.431,0.124,0.061},
[0086] {0.009,0.024,0.075,0.123,0.473,0.171,0.125},
[0087] {0.000,0.103,0.041,0.088,0.391,0.312,0.155},
[0088] {0.000,0.008,0.036,0.083,0.364,0.235,0.274}
[0089] };
[0090] The value of row i and column j is transition[i,j], which is the probability value p(t[k]t[k-1]) that the t[i] instance will subsequently create the t[j] instance. Figure 2 The figure shows the Markov chain structure diagram of the creation sequence of different types of instances. According to the Markov chain structure and the random number algorithm, we can get the list of resource instances created subsequently when the [j] specification resource creation instance event occurs. For example, the list of resource instances created subsequently is {t[1], t[2], t[3]…t[k]}. After that, based on the above-mentioned future specification creation sequence (sorted by probability from large to small), the creation specification sequence is simulated in each host (that is, resource application is simulated according to the creation specification sequence) until it cannot be created, and finally the resource fragmentation rate of all hosts is obtained.
[0091] Step 1022: Select a probability chain with the highest probability of resource instance creation from the multiple probability chains as the first probability chain.
[0092] In an optional embodiment, each probability chain includes the probability of creation of each resource instance on the chain; accordingly, the above step 1022 includes:
[0093] Determine the probability chain that satisfies the first condition among the multiple probability chains as the probability chain with the highest probability of resource instance creation, wherein the first condition is that the probability of creation of each resource instance on the chain is greater than the probability of creation of each resource instance on other probability chains;
[0094] The probability chain with the highest probability of creating the resource instance is used as the first probability chain.
[0095] It should be noted that the probability chain with the highest probability of resource instance creation refers to the probability chain (i.e., the first probability chain) on which the probability of each resource instance creation is the highest compared to the probability of each resource instance creation on other probability chains. Figure 2For example, when the t[e] instance is created, the probability of the t[b] instance being created is 0.28, and the probability of the t[c] instance being created is 0.72. When the t[e] instance is created, the probability of t[c] being created is the largest, so the probability of the subsequent t[g] being created is 0.56 at most, and so on, to obtain the array with the largest probability of instance creation (corresponding to the first probability chain). The first probability chain is the probability chain with the highest probability of resource instance creation, so that subsequent resource application simulation operations are performed according to the resource instances that are most likely to be created in the future, and the resource fragmentation of the obtained host can provide a relatively accurate reference basis for achieving optimal resource scheduling.
[0096] In an optional embodiment, the above step 103, performing a simulation operation of resource application on each host according to the first probability chain to obtain resource fragmentation information of each host, includes:
[0097] Step 1031, obtaining status information of all hosts in the resource pool;
[0098] Optionally, the status information of all hosts in the resource pool is queried through the model reasoning service to obtain the status information of all hosts in the resource pool. Here, the device (resource scheduling device) executing the method of the present invention is provided with a first module, which can implement the model reasoning service, and the status information of all hosts in the resource pool is queried through the first module. The prediction probability model is embedded in the first module.
[0099] Step 1032: for each host, perform a simulation operation of resource application according to the first probability chain and the state information of the host until the host can no longer create resources, and use the remaining resources as fragmented resources of each host;
[0100] Optionally, a simulator may be provided on the device executing the method of the present invention. By starting the simulator, all resources are simulated and created according to the actual resource pool situation (such as the status information of the host) so that (the model reasoning service) can obtain the host resource allocation situation of the resource pool in a timely and accurate manner.
[0101] Here, the host's status information includes the host's fixed loss (referring to the host's redundancy, the resource redundancy that ensures the normal operation of the host), (each service node (such as CPU core)) allocated resources, and available resources (referring to the host's unallocated and allocable resources). It should be noted that the simulation operation of resource application is performed until the host can no longer create resources (that is, the simulation resource instance creation is completed), that is, the host resources are occupied and the remaining resources cannot be allocated, that is, the resource margin that cannot be allocated after the simulation is filled is the host's fragmented resources.
[0102] Step 1033: For each host, the resource fragmentation rate of each host is calculated according to the state information of the host and the fragmented resources of the host.
[0103] Optionally, for each host, according to the status information of the host and the fragmented resources of the host, the resource fragmentation rate of each host is calculated based on the following calculation formula (1):
[0104]
[0105] Among them, vno is the resource usage instance (indicating the allocated resources), pno is the server node (such as CPU core), and the calculation of the resource fragmentation rate of the host can be seen in Figure 4 Resource fragmentation rate frag_ratio: The value range is between 0% and 100%, where the default setting is: 0% to 10% is excellent, 10% to 20% is good, 20% to 50% is fair, and 50% to 100% is poor.
[0106] In an optional embodiment, the resource fragmentation information of the host is the resource fragmentation rate of the host; accordingly, the above step 104, based on the resource fragmentation information of each host, selects a target host from all hosts to perform resource scheduling of the resource instance to be created, including:
[0107] Step 1041, sorting the resource fragmentation rates of all hosts in ascending order;
[0108] Step 1042, selecting the top N hosts as target hosts, and using the target hosts to perform resource scheduling for the resource instance to be created, 1≤N≤M, M is a positive integer greater than 1, and N is a positive integer.
[0109] Here, the selected hosts ranked in the top N should be understood as hosts with the best resource fragmentation rate. Then, the target hosts are used to perform the resource instance creation operation, that is, to schedule the resources of the resource instances to be created. For example, when the creation of the first (top1) fails, the second (top2) can be selected to continue retrying, and finally the creation of the resource instance is completed.
[0110] Embodiment 1
[0111] See also Figure 5 This embodiment illustrates the overall implementation process of the resource scheduling method of the present invention.
[0112] Step 501: The cloud platform (cloud management platform) receives a resource creation request initiated by a user;
[0113] This step is the beginning of the process. The user selects the resource specification on the cloud management platform page and initiates a resource creation request.
[0114] Step 502: The cloud platform parses the request and obtains resource specification information in the resource creation request.
[0115] This step is used to obtain resource specification information in the resource creation request. Resource specification is the resource description of resource instance creation. Usually, resource specifications include multi-dimensional resource requirements such as CPU, memory, storage, GPU, etc.
[0116] Step 503: The cloud platform requests the model inference service to obtain the optimal host information of the resource pool fragments.
[0117] This step is for the cloud platform to initiate a request to query the optimal host for the shard, and the request parameters include resource specification information. The model inference service is an inference service that loads the training model (prediction probability model) and returns the optimal host list (TOP3) for the shard based on the resource specifications. Specifically:
[0118] Step 5031, the model inference service receives the request and obtains the Markov chain structure (probability chain) according to the resource specification.
[0119] In this step, by querying the model inference service interface, the sequence and probability of subsequent instance creation when a resource event occurs are obtained according to the resource specifications. The Markov chain structure can be found in Figure 2 .
[0120] Step 5032: The model inference service queries the status information of all hosts in the resource pool.
[0121] Step 5033: The model inference service obtains the resource fragmentation rates of all hosts in the host list.
[0122] In this step, the instance array with the highest probability and the status information of all hosts in the resource pool are obtained through the prediction probability model. The data is prepared to perform simulated instance creation operations on each host until the host can no longer create resources, and then the resource fragmentation rate of each host is obtained.
[0123] Step 5034, the model inference service sorts the resources from small to large according to the resource fragmentation rate, and obtains a list of hosts ranked in the top 3.
[0124] Afterwards, the model inference service returns a list of hosts ranked in the top 3 to the cloud platform.
[0125] Step 504 , the cloud platform uses the hosts in the host list to perform resource scheduling for creating resource instances corresponding to resource specifications.
[0126] Here, when top1 fails to be created, top2 is selected to try again. Finally, the resource instance creation is completed.
[0127] It should be understood that the cloud platform is a cloud server, wherein the model reasoning service and the cloud platform, or the functions implemented by the model reasoning service and the functions implemented by the cloud platform can be integrated into the resource scheduling device.
[0128] Embodiment 2
[0129] See also Figure 6 , this embodiment is used to illustrate the implementation process of the resource scheduling method of the present invention.
[0130] Step 601, the simulator (implementing the cloud resource simulation function) queries the cloud management platform for created resources;
[0131] Step 602: The cloud management platform returns the physical machine, virtual machine, etc. to the simulator.
[0132] Step 603: The simulator initializes the simulation resource pool.
[0133] Step 604: The fragmentation analysis and evaluation module performs virtual machine creation history record collection and analysis.
[0134] Among them, the fragmentation analysis and evaluation module periodically collects the historical records of resource pool specification creation.
[0135] Step 605: The fragment analysis and evaluation module creates event probability modeling, that is, trains to obtain a prediction probability model.
[0136] Among them, the fragmentation analysis and evaluation module analyzes the historical records of resource pool specification creation and generates a probability model of specification creation events according to the algorithm, namely, a prediction probability model.
[0137] Step 606: The user sends a request to create a virtual machine to the cloud platform.
[0138] Step 607: The cloud platform requests the fragmentation analysis and evaluation module to obtain the optimal fragmentation service node.
[0139] When a user requests to create a virtual machine specification instance, the cloud platform requests the fragmentation assessment system (including the fragmentation analysis assessment module and the simulator) to assess the host fragmentation rate and obtain the optimal host for fragmentation.
[0140] Step 608 , the fragment analysis and evaluation module obtains a list of specifications to be created in the future when the creation event occurs through a prediction probability model.
[0141] The fragmentation analysis and evaluation module obtains the probability sequence of future specification creation when the virtual machine specification (the virtual machine specification requested to be created by the user) is created according to the prediction probability model, that is, the probability chain.
[0142] Step 609: The fragmentation analysis and evaluation module requests the simulator to obtain a list of physical machines in the resource pool (including resource margins, etc.).
[0143] That is, the fragmentation analysis and evaluation module queries the simulator to obtain the minimum resource pool resource usage, that is, to obtain the status information of all hosts.
[0144] Step 610: The simulator returns a response list to the fragmentation analysis and evaluation module.
[0145] Step 611, the fragmentation analysis and evaluation module cyclically fills the specifications in the specification table according to the host list until the host is filled.
[0146] Step 612: The fragmentation analysis and evaluation module calculates and sorts the host fragmentation rates.
[0147] This article uses an example to illustrate the algorithm calculation process of the host fragmentation rate:
[0148] 1) Assume that instance I may be created in the next 24 hours 24 ={i1,i2,i3,...i n}, the available hosts H in the current resource pool 24 ={h1,h2,h3,...h n}, the algorithm execution goal can be defined as finding the matching relationship between instance I and host H to satisfy the strategy with the optimal fragmentation rate.
[0149] 2) The size of the target solution space is {I 24 *H 24}, in order to ensure that the goal of balancing the computational complexity and accuracy of execution can be achieved under relatively large load scales and resource pool scales, we use the simulated annealing algorithm to search the candidate solution space and find optional deployment solutions with less resource waste.
[0150] 3) ITemp is a set of instance specifications that may be created in the future; ITemp[i] is an instance specification that may be created in the future. It is defined as follows: ITemp = {itemp[1], itemp[2], itemp[3]....itemp[k]}; HTemp is a set of optional host specifications in the future resource pool; it is defined as follows: HTemp = {htemp[1], htemp[2], htemp[3]....htemp[k]}.
[0151] The execution goal of the scheduling algorithm can be defined as the process of finding the optimal host for the fragmentation given ITemp = {itemp[1], itemp[2], itemp[3]....itemp[k]} and HTemp = {htemp[1], htemp[2], htemp[3]....htemp[k]}.
[0152] 4) Calculate the fragmentation rate. It supports calculating the fragmentation rate of each resource and also supports calculating the comprehensive fragmentation rate.
[0153] For example, if there are 2 unusable CPU cores left, a total of 20 cores, and the fragmentation rate is 10%, follow this step to calculate the memory fragmentation rate and GPU fragmentation rate respectively. According to system requirements, different weights can be set for different resources. For example, if the system believes that the GPU needs to be used first, the GPU weight can be set to 0.5, the CPU weight to 0.3, and the memory weight to 0.2. In this way, the comprehensive fragmentation rate is 0.5*GPU fragmentation rate + 0.3*CPU fragmentation rate + 0.2*memory fragmentation rate. Finally, select the node with the lowest comprehensive fragmentation rate for scheduling.
[0154] Step 613, returning the host with the minimum fragmentation rate.
[0155] Step 614, simulator update.
[0156] It should be understood that the above-mentioned fragmentation analysis and evaluation module and simulator, or the functions implemented by the fragmentation analysis and evaluation module and the functions implemented by the simulator, can be integrated into the resource scheduling device.
[0157] The effect of the resource scheduling method of the present invention is shown in Figure 7 . The resource scheduling method of the present invention can reduce fragmented resources and thus improve the overall sales rate of the server, and can generate scheduling results with better effects; by planning resource specifications and evaluating the resource fragmentation of the host based on the resource specifications, it can bring true and accurate host fragmentation results; and by predicting the sequence of future specification instance creation, it realizes the evaluation of the future fragmentation of the resource pool host and obtains more effective conclusions. The solution of the present invention combines future prediction capabilities, makes resource allocation more reasonable, reduces the risk of rescheduling, reduces business impact, and effectively improves resource utilization.
[0158] In addition, by adopting the method of the present invention, the load can be balanced to avoid hot spots in resource allocation, which may cause abnormalities in the host load due to excessive load. Therefore, the present technology has a good application prospect and plays an outstanding role in reducing costs and increasing efficiency.
[0159] Currently, environment rendering and gaming (hourly resource requirements) are widely used and continue to be popular, and resource allocation needs to be more reasonable and efficient. The method of the present invention predicts future directions based on historical data and makes good plans during the scheduling process, which reduces the fragmentation and rescheduling problems caused by insufficient consideration of resource allocation and reduces the impact of business migration.
[0160] like Figure 8 As shown, an embodiment of the present invention further provides a resource scheduling device, wherein the device includes:
[0161] The first acquisition module 801 is used to acquire resource specification information;
[0162] A probability prediction module 802 is used to perform probability prediction on resource instance creation based on the resource specification information to obtain a first probability chain;
[0163] The processing module 803 is used to perform a simulation operation of resource application on each host according to the first probability chain to obtain resource fragmentation information of each host;
[0164] The resource scheduling module 804 is used to select a target host from all hosts to perform resource scheduling of the resource instance to be created based on the resource fragmentation information of each host.
[0165] In some embodiments, the probability prediction module 802 includes:
[0166] A probability prediction unit, used for inputting the resource specification information into a prediction probability model to obtain multiple probability chains for future resource applications;
[0167] The first processing unit is configured to select a probability chain with the highest probability of resource instance creation from the multiple probability chains as the first probability chain.
[0168] In some embodiments, each probability chain includes a probability of creation of each resource instance on the chain; the first processing unit is specifically configured to:
[0169] Determine the probability chain that satisfies the first condition among the multiple probability chains as the probability chain with the highest probability of resource instance creation, wherein the first condition is that the probability of creation of each resource instance on the chain is greater than the probability of creation of each resource instance on other probability chains;
[0170] The probability chain with the highest probability of creating the resource instance is used as the first probability chain.
[0171] In some embodiments, the apparatus of the present invention further comprises:
[0172] The second acquisition module is used to obtain the historical records of resource instance creation;
[0173] A third acquisition module is used to acquire the resource instance creation order and the probability of each resource instance being created from the historical records;
[0174] A model training module is used to perform model training according to the resource instance creation order and the probability of creation of each resource instance to obtain the prediction probability model, wherein the output of the prediction probability model is a probability chain, and the probability chain includes the predicted future resource instance creation order and probability.
[0175] In some embodiments, the processing module 803 includes:
[0176] A first acquisition unit, used to acquire status information of all hosts in the resource pool;
[0177] a second processing unit, configured to perform a simulation operation of resource application for each host according to the first probability chain and the state information of the host until the host can no longer create resources, and use the remaining resources as fragmented resources of each host;
[0178] The third processing unit is used to calculate the resource fragmentation rate of each host according to the state information of the host and the fragmented resources of the host.
[0179] In some embodiments, the resource fragmentation information of the host is the resource fragmentation rate of the host; accordingly, the resource scheduling module 804 includes:
[0180] A fourth processing unit, used to sort the resource fragmentation rates of all hosts in ascending order;
[0181] The resource scheduling unit is used to select the hosts ranked in the top N positions as target hosts, and use the target hosts to perform resource scheduling of the resource instances to be created, 1≤N≤M, M is a positive integer greater than 1, and N is a positive integer.
[0182] Among them, the implementation embodiments of the above-mentioned resource scheduling method are all applicable to the embodiments of the resource scheduling device and can achieve the same technical effects.
[0183] The embodiment of the present invention also provides a resource scheduling device, including a memory, a processor, and a program stored in the memory and executable on the processor; when the processor executes the program, the following is achieved: Figure 1 The resource scheduling method shown.
[0184] Among them, the implementation embodiments of the above-mentioned resource scheduling method are all applicable to the embodiments of the resource scheduling device and can achieve the same technical effects.
[0185] The embodiment of the present invention further provides a readable storage medium on which a program is stored. When the program is executed by a processor, the steps in the above-mentioned resource scheduling method are implemented.
[0186] Among them, the implementation embodiments of the above-mentioned resource scheduling method are all applicable to the embodiments of the readable storage medium and can also achieve the same technical effect.
[0187] The embodiment of the present invention also provides a computer program product, including computer instructions, which, when executed by a processor, implement the following Figure 1 The various processes of the method embodiment shown can achieve the same technical effect, and will not be described again here to avoid repetition.
[0188] It should be noted that many functional components described in this specification are referred to as modules in order to more particularly emphasize the independence of their implementation methods.
[0189] In the embodiment of the present invention, module can be implemented with software so that it can be executed by various types of processors. For example, an executable code module of an identification can include one or more physical or logical blocks of computer instructions, for example, it can be constructed as an object, process or function. Nevertheless, the executable code of the identified module does not need to be physically located together, but can include different instructions stored in different positions, and when these instructions are logically combined together, it constitutes a module and realizes the specified purpose of the module.
[0190] In fact, executable code module can be a single instruction or many instructions, and can even be distributed on a plurality of different code segments, distributed among different programs, and distributed across a plurality of memory devices. Similarly, operating data can be identified in the module, and can be implemented and organized in the data structure of any appropriate type according to any appropriate form. The operating data can be collected as a single data set, or can be distributed in different locations (including on different storage devices), and can only be present on a system or network as an electronic signal at least in part.
[0191] When a module can be implemented by software, considering the level of existing hardware technology, a person skilled in the art can build a corresponding hardware circuit to implement the corresponding function of the module that can be implemented by software without considering the cost. The hardware circuit includes a conventional very large scale integration (VLSI) circuit or gate array and existing semiconductors such as logic chips, transistors, or other discrete components. The module can also be implemented by a programmable hardware device, such as a field programmable gate array, a programmable array logic, a programmable logic device, etc.
[0192] The above is a preferred embodiment of the present invention. It should be pointed out that for ordinary personnel in this technical field, several improvements and modifications can be made without departing from the principles of the present invention. These improvements and modifications should also be regarded as the scope of protection of the present invention.
Claims
1. A resource scheduling method, characterized in that: include: Get resource specification information; Based on the resource specification information, a probability prediction is performed on the resource instance creation to obtain a first probability chain; Performing a simulated operation of resource application on each host according to the first probability chain to obtain resource fragmentation information of each host; Based on the resource fragmentation information of each host, a target host is selected from all hosts to perform resource scheduling of the resource instance to be created.
2. The method according to claim 1, characterized in that The method of performing probability prediction on resource instance creation based on the resource specification information to obtain a first probability chain includes: Inputting the resource specification information into a prediction probability model to obtain multiple probability chains for future resource applications; A probability chain with the highest probability of resource instance creation is selected from the multiple probability chains as the first probability chain.
3. The method according to claim 2, characterized in that Each probability chain includes the probability of creation of each resource instance on the chain; The step of selecting a probability chain with the highest probability of resource instance creation from the multiple probability chains as the first probability chain includes: Determine the probability chain that satisfies the first condition among the multiple probability chains as the probability chain with the highest probability of resource instance creation, wherein the first condition is that the probability of creation of each resource instance on the chain is greater than the probability of creation of each resource instance on other probability chains; The probability chain with the highest probability of creating the resource instance is used as the first probability chain.
4. The method according to claim 2, characterized in that: The method further comprises: Get the history of resource instance creation; Obtaining a resource instance creation order and a probability of creation of each resource instance from the historical records; Model training is performed according to the resource instance creation order and the probability of creation of each resource instance to obtain the prediction probability model, wherein the output of the prediction probability model is a probability chain, and the probability chain includes the predicted future resource instance creation order and probability.
5. The method according to claim 1 or 4, characterized in that: The performing of the resource application simulation operation on each host according to the first probability chain to obtain resource fragmentation information of each host includes: Get the status information of all hosts in the resource pool; For each host, according to the first probability chain and the status information of the host, a simulation operation of resource application is performed until the host can no longer create resources, and the remaining resources are used as fragmented resources of each host; For each host, the resource fragmentation rate of each host is calculated according to the state information of the host and the fragmented resources of the host.
6. The method according to claim 1, characterized in that The resource fragmentation information of the host is the resource fragmentation rate of the host; The selecting a target host from all hosts to perform resource scheduling of the resource instance to be created based on the resource fragmentation information of each host includes: Sort the resource fragmentation rates of all hosts in ascending order; The hosts ranked in the top N positions are selected as target hosts, and the target hosts are used to perform resource scheduling of the resource instances to be created, where 1≤N≤M, M is a positive integer greater than 1, and N is a positive integer.
7. A resource scheduling device, characterized in that: include: The acquisition module is used to obtain resource specification information; A probability prediction module, used to perform probability prediction on resource instance creation based on the resource specification information to obtain a first probability chain; A processing module, configured to perform a simulation operation of resource application on each host according to the first probability chain to obtain resource fragmentation information of each host; The resource scheduling module is used to select a target host from all hosts to perform resource scheduling of the resource instance to be created based on the resource fragmentation information of each host.
8. A resource scheduling device, comprising a memory, a processor, and a program stored in the memory and executable on the processor; characterized in that: When the processor executes the program, the resource scheduling method according to any one of claims 1 to 6 is implemented.
9. A readable storage medium having a program stored thereon, characterized in that: When the program is executed by a processor, the steps in the resource scheduling method according to any one of claims 1 to 6 are implemented.
10. A computer program product, characterized in that The method comprises computer instructions, which, when executed by a processor, implement the steps in the resource scheduling method according to any one of claims 1 to 6.
