Resource scheduling method and device in cluster system, equipment, medium and product

By determining the main resource type and computing resource application share of the target virtual machine in the cluster system, evaluating the host based on resource weights and available amounts, filtering out the optimal target host for scheduling, the problems of insufficient resource utilization and load skew in the existing technology are solved, and more balanced resource scheduling and improved resource utilization are achieved.

CN119739465APending Publication Date: 2025-04-01INSPUR SUZHOU INTELLIGENT TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202412000271.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-31
Publication Date
2025-04-01

AI Technical Summary

Technical Problem

The resource scheduling algorithm in the existing cluster system cannot effectively solve the problems of insufficient resource utilization and skewed resource load, resulting in unbalanced resource distribution and affecting the overall resource utilization rate.

Method used

By determining the master resource type of the target virtual machine, calculate its resource application share on each host, and evaluate the host based on the resource weight and available amount, filter out the optimal target host for scheduling.

Benefits of technology

A more balanced host resource scheduling is achieved, cluster resource utilization is improved, and resource skew and uneven allocation problems caused by a single scheduling rule are eliminated.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119739465A_ABST
    Figure CN119739465A_ABST
Patent Text Reader

Abstract

The invention discloses a resource scheduling method and device in a cluster system, equipment, a medium and a product, which are applied to the technical field of cluster systems and are used for solving the problem that the utilization rate of cluster resources is reduced due to unbalanced scheduling of the cluster resources in the cluster system in the traditional technology. The method comprises the steps of determining a main resource type applied by a target virtual machine according to a resource scheduling request; calculating a first application share of the target virtual machine for the main resource type on each host, and screening according to each first application share to obtain a first alternative host; calculating a second application share of the target virtual machine for each resource type in the cluster system, and calculating a weight corresponding to each resource type according to each second application share; calculating an evaluation value of each host according to the current available amount of each resource type in each host and the corresponding weight, and screening according to each evaluation value to obtain a second alternative host; and selecting a target host from the first alternative host and the second alternative host to schedule the target virtual machine.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of cluster systems, and in particular to a resource scheduling method in a cluster system, and also to a resource scheduling device, electronic equipment, computer-readable storage medium and computer program product in a cluster system. Background Art

[0002] OpenStack (cloud computing platform) occupies a pivotal position in cloud computing. Its core component responsible for allocating host resource scheduling to virtual machines is nova-scheduler (a resource scheduling component). This component first passes through the filter stage to filter out host nodes that do not meet the conditions set by the user or system (such as CPU usage, memory size, disk space, etc.), and then uses the community scheduling algorithm to evaluate the weights of the host nodes that pass the filter, sorts the host nodes according to their scores, and selects the best scheduling host to meet the resource application requirements of the virtual machine.

[0003] However, although the current community scheduling algorithm can customize resource weights, with the scheduling and allocation of cluster resources, the allocable conditions of various types of resources for each host in the cluster system will vary greatly. At this time, if the host is still selected according to the inherent resource weights, some bottleneck resources will appear, resulting in insufficient utilization of some host resources. In addition, the community scheduling algorithm scores according to weights, and the host with the highest score is regarded as the host with the most sufficient resources, so it is selected as the host to be scheduled. However, since the resource request characteristics of user virtual machines are not taken into account, resource load tilt will occur after multiple scheduling or large-scale scheduling, resulting in uneven distribution of cluster resources, thereby affecting the overall resource utilization of the cluster.

[0004] Therefore, how to achieve more balanced host resource scheduling in a cluster system to effectively improve cluster resource utilization is an urgent problem to be solved by those skilled in the art. Summary of the invention

[0005] An object of the present invention is to provide a resource scheduling method within a cluster system, which can achieve more balanced host resource scheduling within the cluster system and effectively improve cluster resource utilization; another object of the present invention is to provide a resource scheduling device, electronic device, computer-readable storage medium and computer program product within a cluster system, all of which have the above-mentioned beneficial effects.

[0006] In a first aspect, the present invention provides a resource scheduling method in a cluster system, comprising:

[0007] Determine the primary resource type requested by the target virtual machine according to the resource scheduling request;

[0008] Calculating a first application share of the target virtual machine for the primary resource type on each host, and selecting a first candidate host according to each of the first application shares;

[0009] Calculating the second application share of the target virtual machine for each resource type in the cluster system, and calculating the weight corresponding to each resource type according to each of the second application shares;

[0010] Calculating the evaluation value of each of the hosts according to the current available amount and the corresponding weight of each of the resource types in each of the hosts, and selecting and obtaining the second candidate host according to each of the evaluation values;

[0011] A target host is selected from the first candidate host and the second candidate host to schedule the target virtual machine.

[0012] The primary resource type requested by the target virtual machine is determined according to the resource scheduling request, including:

[0013] Determine, according to the resource scheduling request, a target application amount of the target virtual machine for each resource type, and a target available amount of the cluster system for each resource type;

[0014] Calculate the target application share of the target virtual machine for each resource type in the cluster system according to each target application amount and each target available amount;

[0015] A maximum target application share value is determined according to each of the target application shares, and a resource type corresponding to the maximum target application share value is used as a primary resource type applied for by the target virtual machine.

[0016] Before calculating the first application share of the target virtual machine for the primary resource type on each host, the method further includes:

[0017] Determining the current available amount of each resource type for each host;

[0018] For each resource type, hosts whose current available quantity of the resource type does not meet the target application quantity are eliminated.

[0019] The step of calculating the first application share of the target virtual machine for the primary resource type on each host includes:

[0020] Determine a first application amount of the target virtual machine for the primary resource type;

[0021] Determining a first available amount of each of the hosts for the primary resource type;

[0022] A first application share of the target virtual machine for the primary resource type on each of the hosts is calculated according to the first application amount and each of the first available amounts.

[0023] The first candidate host is obtained by screening according to each of the first application shares, including:

[0024] Determining a minimum first application share according to each of the first application shares;

[0025] The host corresponding to the minimum value of the first application share is used as the first candidate host.

[0026] The step of calculating the second application share of the target virtual machine for each resource type in the cluster system includes:

[0027] Determine a second application amount of the target virtual machine for each resource type;

[0028] Determining a second available amount of the cluster system for each resource type;

[0029] A second application share of the target virtual machine for each resource type in the cluster system is calculated according to each of the second application amounts and each of the second available amounts.

[0030] The weight corresponding to each resource type is calculated according to each of the second application shares, including:

[0031] The first application share is used to perform normalized calculation on each of the second application shares to obtain a weight corresponding to each of the resource types.

[0032] The second candidate host is obtained by screening according to each of the evaluation values, including:

[0033] Sort the evaluation values ​​in descending order to obtain an evaluation value sequence;

[0034] The hosts corresponding to the first preset number of evaluation values ​​in the evaluation value sequence are used as the second candidate hosts.

[0035] Wherein, selecting a target host from the first candidate host and the second candidate host to schedule the target virtual machine includes:

[0036] Determine whether the first candidate host and the second candidate host have an intersection host;

[0037] If the intersection host exists, scheduling the target virtual machine using the intersection host as the target host;

[0038] If the intersection host does not exist, any host is selected from the first candidate host and the second candidate host as the target host to schedule the target virtual machine.

[0039] The step of calculating the second application share of the target virtual machine for each resource type in the cluster system includes:

[0040] Calculating a second application share of the target virtual machine for each resource type in the cluster system except the first candidate host;

[0041] Accordingly, selecting a target host from the first candidate host and the second candidate host to schedule the target virtual machine includes:

[0042] Any host is selected from the first candidate host and the second candidate host as the target host to schedule the target virtual machine.

[0043] The resource scheduling method in the cluster system further includes:

[0044] When the creation message of the target virtual machine is obtained, the resource scheduling request for the target virtual machine is automatically responded to.

[0045] In a second aspect, the present invention further discloses a resource scheduling device in a cluster system, comprising:

[0046] A determination module, used to determine the primary resource type requested by the target virtual machine according to the resource scheduling request;

[0047] A first screening module, configured to calculate a first application share of the target virtual machine for the primary resource type on each host, and screen and obtain a first candidate host according to each of the first application shares;

[0048] a calculation module, configured to calculate a second application share of the target virtual machine for each resource type in the cluster system, and obtain a weight corresponding to each resource type according to each of the second application shares;

[0049] A second screening module is used to calculate the evaluation value of each host according to the current available amount and corresponding weight of each resource type in each host, and screen and obtain the second candidate host according to each evaluation value;

[0050] The scheduling module is used to select a target host from the first candidate host and the second candidate host to schedule the target virtual machine.

[0051] In a third aspect, the present invention further discloses an electronic device, comprising:

[0052] Memory for storing computer programs;

[0053] The processor is used to implement the steps of any one of the resource scheduling methods in the cluster system as described above when executing the computer program.

[0054] In a fourth aspect, the present invention further discloses a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of any of the resource scheduling methods in a cluster system as described above are implemented.

[0055] In a fifth aspect, the present invention further discloses a computer program product, including a computer program / instruction, which, when executed by a processor, implements the steps of any of the resource scheduling methods within a cluster system as described above.

[0056] The present invention provides a resource scheduling method in a cluster system, which determines the main resource type applied for by a target virtual machine according to a resource scheduling request; calculates the first application share of the target virtual machine for the main resource type on each host, and screens a first candidate host according to each of the first application shares; calculates the second application share of the target virtual machine for each resource type in the cluster system, and calculates the weight corresponding to each of the resource types according to each of the second application shares; calculates the evaluation value of each of the hosts according to the current available amount and the corresponding weight of each of the resource types in each of the hosts, and screens a second candidate host according to each of the evaluation values; selects a target host from the first candidate host and the second candidate host to schedule the target virtual machine.

[0057] Applying the technical solution provided by the present invention, firstly, the main resource of this request is determined according to the resource demand of the target virtual machine through the fair scheduling idea of ​​the main resource, so as to calculate the main resource request share of the target virtual machine on each host, so as to realize the screening of the first candidate host based on each main resource request share; secondly, the resource request share of each type of resource of the target virtual machine in the cluster system is calculated to determine the weight corresponding to each type of resource, and the host evaluation calculation is realized in combination with the current available amount of each type of resource in each host, so as to realize the screening of the second candidate host based on the evaluation value of each host; finally, the best target host is selected from the first candidate host and the second candidate host to realize the scheduling of the target virtual machine. It can be seen that the scheduling method based on the fairness of the main resource and the dynamic weight update of the technical solution realizes the screening of the optimal host, which can effectively eliminate the problems of resource inclination and uneven resource allocation caused by a single scheduling rule. Therefore, the technical solution can realize more balanced host resource scheduling in the cluster system, and effectively improve the cluster resource utilization.

[0058] The resource scheduling device, electronic device, computer-readable storage medium and computer program product in the cluster system provided by the present invention also have the above-mentioned technical effects, and the present invention will not be described in detail here. BRIEF DESCRIPTION OF THE DRAWINGS

[0059] In order to more clearly illustrate the technical solutions in the prior art and the embodiments of the present invention, the following briefly introduces the drawings required for describing the prior art and the embodiments of the present invention. Of course, the drawings related to the embodiments of the present invention described below are only part of the embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without creative work, and the obtained other drawings also belong to the protection scope of the present invention.

[0060] Figure 1 A schematic diagram of a flow chart of a resource scheduling method in a cluster system provided by an embodiment of the present invention;

[0061] Figure 2 A schematic diagram of a flow chart of another resource scheduling method in a cluster system provided by an embodiment of the present invention;

[0062] Figure 3 A comparative analysis diagram of CPU allocation rate provided by an embodiment of the present invention;

[0063] Figure 4 A comparative analysis diagram of memory allocation rate provided by an embodiment of the present invention;

[0064] Figure 5 A comparative analysis diagram of a disk allocation rate provided by an embodiment of the present invention;

[0065] Figure 6 A comparative analysis diagram of resource allocation imbalance provided by an embodiment of the present invention;

[0066] Figure 7 A schematic diagram of the structure of a resource scheduling device in a cluster system provided by an embodiment of the present invention;

[0067] Figure 8 The present invention is a schematic diagram of the structure of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0068] The core of the present invention is to provide a resource scheduling method within a cluster system, which can achieve more balanced host resource scheduling within the cluster system and effectively improve the cluster resource utilization rate; another core of the present invention is to provide a resource scheduling device, electronic device, computer-readable storage medium and computer program product within a cluster system, all of which have the above-mentioned beneficial effects.

[0069] In order to describe the technical solutions in the embodiments of the present invention more clearly and completely, the technical solutions in the embodiments of the present invention will be introduced below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0070] An embodiment of the present invention provides a resource scheduling method in a cluster system.

[0071] Please refer to Figure 1 , Figure 1 This is a flow chart of a resource scheduling method in a cluster system provided by an embodiment of the present invention. The resource scheduling method in the cluster system may include the following S101 to S105.

[0072] S101: Determine the primary resource type requested by the target virtual machine according to the resource scheduling request.

[0073] This step is intended to determine the primary resource type, which refers to the resource type mainly requested by the target virtual machine, that is, the resource type with the largest number of requests from the target virtual machine. It can be understood that the resource types in the cluster system may include but are not limited to computing resources, storage resources, network resources, etc. The target virtual machine is the virtual machine that currently needs to schedule host resources. When a resource scheduling request for the target virtual machine is received, the primary resource type requested by the target virtual machine can be determined according to the resource scheduling request.

[0074] The resource scheduling request refers to the target virtual machine applying for scheduling host resources to implement the target virtual machine function. The acquisition method is not unique and can be directly initiated by the front-end user or automatically responded based on preset conditions. The present invention does not limit this.

[0075] For example, in one possible implementation, the resource scheduling method within the cluster system may further include: when a creation message of the target virtual machine is obtained, automatically responding to a resource scheduling request for the target virtual machine. In another possible implementation, the resource scheduling method within the cluster system may further include: when a migration message of the target virtual machine is obtained, automatically responding to a resource scheduling request for the target virtual machine. In yet another possible implementation, the resource scheduling method within the cluster system may further include: automatically responding to a resource scheduling request for the target virtual machine at a preset time interval. That is to say, the resource scheduling method within the cluster system provided by the embodiment of the present invention can be applied to the initial creation scenario of a new virtual machine, to the migration scenario of a virtual machine on an overloaded host, and to the automatic scheduling update scenario of the cluster system.

[0076] In one embodiment of the present invention, determining the primary resource type requested by the target virtual machine according to the resource scheduling request may include:

[0077] Determine the target application amount of each resource type for the target virtual machine and the target available amount of each resource type for the cluster system according to the resource scheduling request;

[0078] The target application share of the target virtual machine for each resource type in the cluster system is calculated based on each target application amount and each target available amount;

[0079] The maximum target application share is determined according to each target application share, and the resource type corresponding to the maximum target application share is used as the main resource type applied for by the target virtual machine.

[0080] The embodiment of the present invention provides a method for determining the primary resource type. As described above, the resource scheduling request refers to the target virtual machine applying for scheduling host resources to realize the target virtual machine function. Then, it must specify the resource type that the target virtual machine needs to apply for scheduling and the application amount of each resource type (target application amount); at the same time, the current available amount of each host in the cluster system for each resource type can also be collected, so as to obtain the current total available amount of each resource type in the cluster system (target available amount). For example, the target available amount of computing resources in the cluster system = the current available amount of computing resources of host 1 + the current available amount of computing resources of host 2 + ... + the current available amount of computing resources of host M (M represents the number of hosts in the cluster system). Obviously, for each resource type, the quotient of the target application amount and the target available amount is the target application share of the target virtual machine for the resource type in the cluster system. Then, the resource type corresponding to the target application share with the largest value is the primary resource type applied by the target virtual machine, that is, the resource type with the largest application share is the primary resource type applied by the target virtual machine.

[0081] Furthermore, in order to effectively improve the resource scheduling efficiency, after receiving the resource scheduling request for the target virtual machine and before executing S102, it can also include: determining the current available amount of each host for each resource type; for each resource type, eliminating the host whose current available amount of the resource type does not meet the target application amount.

[0082] It is understandable that the available amount of each resource type in each host in the cluster system changes in real time. When receiving a resource scheduling request for a target virtual machine, there may be some hosts that cannot meet the resource requirements of the target virtual machine. For example, the available amount of computing resources in the host is lower than the computing resource application amount of the target virtual machine. Therefore, the hosts that do not meet the resource requirements of the target virtual machine can be eliminated first, and only the remaining hosts in the cluster system can be used to screen the optimal host, so as to provide scheduling services for the target virtual machine. In this way, unnecessary computing can be effectively reduced and resource scheduling efficiency can be greatly improved.

[0083] S102: Calculate the first application share of the target virtual machine for the primary resource type on each host, and select a first candidate host according to each first application share.

[0084] This step aims to achieve host screening based on the idea of ​​fair scheduling of primary resources. This process can be implemented based on the application share of the target virtual machine for the primary resource type on each host (i.e., the above-mentioned first application share). In the specific implementation process, the host corresponding to the first application share with the smallest value can be used as the first candidate host, that is, the first candidate host is obtained by screening each first application share, which can include: determining the minimum value of the first application share according to each first application share; and using the host corresponding to the minimum value of the first application share as the first candidate host to achieve fair scheduling of primary resources.

[0085] Among them, calculating the first application share of the target virtual machine for the main resource type on each host may include: determining the first application amount of the target virtual machine for the main resource type; determining the first available amount of each host for the main resource type; and calculating the first application share of the target virtual machine for the main resource type on each host based on the first application amount and each first available amount. It can be understood that the application share is the ratio of the resource application amount to the resource available amount. Therefore, for each host, it is sufficient to directly calculate the ratio between the application amount (first application amount) of the target virtual machine for the main resource type and the available amount (first available amount) of the main resource type on the host.

[0086] S103: Calculate the second application share of the target virtual machine for each resource type in the cluster system, and calculate the weight corresponding to each resource type according to each second application share.

[0087] S104: Calculate the evaluation value of each host according to the current available amount of each resource type in each host and the corresponding weight, and select and obtain the second candidate host according to each evaluation value.

[0088] The above steps are intended to achieve host screening based on dynamic weight updates. Specifically, the weight calculation of each resource type can be implemented based on the application share (second application share) of each resource type by the target virtual machine in the cluster system, and then the host evaluation can be implemented in combination with the current available amount of each resource type in each host in the cluster system, so that step-by-step screening can be implemented based on the evaluation value of each host. In the specific implementation process, one or more hosts with larger host evaluation values ​​can be directly used as the second candidate host, that is, the second candidate host is obtained by screening according to each evaluation value, which may include: sorting each evaluation value in descending order to obtain an evaluation value sequence; and using the hosts corresponding to the first preset number of evaluation values ​​in the evaluation value sequence as the second candidate host to achieve host screening based on dynamic weight updates.

[0089] Among them, the calculation method of the second application share can be similar to the calculation method of the above-mentioned first application share, that is, calculating the second application share of the target virtual machine for each resource type in the cluster system, which can include: determining the second application quantity of the target virtual machine for each resource type; determining the second available quantity of the cluster system for each resource type; and calculating the second application share of the target virtual machine for each resource type in the cluster system based on each second application quantity and each second available quantity.

[0090] Furthermore, the weights corresponding to each resource type are obtained according to the calculation of each second application share, which may include: using the first application share to perform normalized calculation on each second application share to obtain the weights corresponding to each resource type. In a possible implementation, using the first application share to perform normalized calculation on each second application share to obtain the weights corresponding to each resource type may include: for each resource type, calculating the quotient between the second application share corresponding to the resource type and the first application share to obtain the weight corresponding to the resource type. In other words, the quotient between the second application share vector and the first application share vector can be directly calculated to realize the normalized calculation of the second application share, and obtain the weights corresponding to each resource type. Obviously, the weight value of the main resource type is the largest at this time, thereby realizing the host screening based on the dynamic weight update of the main resource. It can be understood that the scheme based on the dynamic weight update of the main resource can tilt the scheduling result to the host with more main resources, that is, it is more inclined to schedule the target virtual machine to the host with more sufficient main resources, so as to effectively improve the balance of resource scheduling.

[0091] S105: Select a target host from the first candidate host and the second candidate host to schedule the target virtual machine.

[0092] This step aims to achieve the screening of the optimal host (target host), which can be directly selected from the first candidate host and the second candidate host, so as to use the target host to implement the target virtual machine scheduling, that is, to schedule the target virtual machine to run on the target host.

[0093] In one embodiment of the present invention, selecting a target host from the first candidate host and the second candidate host to schedule the target virtual machine may include:

[0094] Determine whether there is an intersection host between the first candidate host and the second candidate host;

[0095] If there is an intersection host, the intersection host is used as the target host to schedule the target virtual machine;

[0096] If there is no intersection host, any host is selected from the first candidate host and the second candidate host as the target host to schedule the target virtual machine.

[0097] The embodiment of the present invention provides a method for screening a target host, that is, directly selecting a target host from the intersection of a first candidate host and a second candidate host to implement target virtual machine scheduling. When the first candidate host and the second candidate host do not have an intersection, the target host can be randomly selected from them for target virtual machine scheduling. It should be noted that this solution is applied to the first candidate virtual machine being screened from the entire system cluster (or the system cluster excluding hosts that do not meet the requirements), and the second candidate host is also screened from the entire system. It is possible that the first candidate host and the second candidate host have an intersection.

[0098] In one embodiment of the present invention, calculating the second application share of the target virtual machine for each resource type in the cluster system may include: calculating the second application share of the target virtual machine for each resource type in the cluster system except the first candidate host;

[0099] Accordingly, selecting a target host from the first candidate host and the second candidate host to schedule the target virtual machine may include: selecting any host from the first candidate host and the second candidate host as the target host to schedule the target virtual machine.

[0100] The embodiment of the present invention provides another method for screening target hosts. Obviously, this solution is applied to the first candidate host being screened from the entire system cluster (or the system cluster excluding the host that does not meet the requirements), and the second candidate host being screened from the system cluster other than the first candidate host, and it is impossible for the first candidate host and the second candidate host to have an intersection.

[0101] It can be seen that the resource scheduling method in the cluster system provided by the embodiment of the present invention first determines the main resource of this request according to the resource demand of the target virtual machine through the idea of ​​fair scheduling of the main resource, thereby calculating the main resource request share of the target virtual machine on each host, so as to realize the screening of the first candidate host based on each main resource request share; secondly, the resource request share of each type of resource of the target virtual machine in the cluster system is calculated to determine the weight corresponding to each type of resource, and the host evaluation calculation is realized in combination with the current available amount of each type of resource in each host, so as to realize the screening of the second candidate host based on the evaluation value of each host; finally, the best target host is selected from the first candidate host and the second candidate host to realize the scheduling of the target virtual machine. It can be seen that the scheduling method based on the fairness of the main resource and the dynamic weight update of the technical scheme realizes the screening of the optimal host, which can effectively eliminate the problems of resource inclination and uneven resource allocation caused by a single scheduling rule. Therefore, the technical scheme can realize more balanced host resource scheduling in the cluster system and effectively improve the cluster resource utilization.

[0102] An embodiment of the present invention provides another resource scheduling method in a cluster system.

[0103] First, please refer to Figure 2 , Figure 2 A flowchart of another resource scheduling method in a cluster system provided by an embodiment of the present invention. Deploy a single-cluster cloud operating system. Assuming that there are M computing nodes (the number of hosts is M) in the cluster system, there are K key resources (the number of resource types is K) on the computing nodes, and there are N users (the number of target virtual machines is N) requesting host resources from the cluster system, and the amount of resources requested by each user is C, the scheduling of host resources in the cluster system can be achieved through the following implementation steps.

[0104] (1) There are M hosts in the cluster system, and the number of resource types that the user virtual machine is interested in using is K. Then the resource set R that can be allocated to the M hosts is:

[0105] ; , ;

[0106] No. The amount of resources requested by each user virtual machine for each resource type for:

[0107] ; ;

[0108] Then, The application share of each user's virtual machine in the entire cluster system for:

[0109] ; ;

[0110] At this time, use the resource filter plug-in to first filter out the resources that cannot satisfy the user's virtual machine. Filter hosts based on resource application volume to obtain a set of hosts that meet the conditions.

[0111] (2) Based on (1), the user virtual machine can be further determined Application share of the primary resource applied for (first application share) for:

[0112] ;

[0113] in, User virtual machine The primary resource of the application;

[0114] That is, the application share of the primary resource on each eligible host in the cluster system is:

[0115] ;

[0116] Therefore, the first candidate host can be screened according to the application share of each main resource:

[0117] .

[0118] (3) Similar to (2), we can further calculate the user virtual machine The application share of each resource type in the overall cluster system:

[0119] ;

[0120] because To apply for a share of the primary resource this time, the user virtual machine By performing vector normalization calculation on the application share of each resource type in the overall cluster system, we can obtain:

[0121] ;

[0122] but ; ;

[0123] in, Indicates On the host The available amount of class resources, Indicates the user virtual machine For The number of requests for class resources, It represents the result of normalizing the application share of each resource type. Indicates the user virtual machine The application share for each resource type (second application share).

[0124] (4) By user virtual machine The main resource requested is It can be seen that the user virtual machine The resource of interest in this request is Therefore, when selecting host scheduling, the weight of this resource should be appropriately tilted, that is, Vector as User VM The corresponding weight vector of the resource request. Then, the weighted scores of the hosts that meet the conditions in the cluster system are calculated according to the available resources and resource weights of each host in the cluster system, that is, The weight scores of hosts that meet the conditions are:

[0125] ; ;

[0126] in, Indicates that the condition is met The amount of resources available on the host.

[0127] (5) User virtual machines in a cluster system The resource request calculation scores are sorted in descending order, and the first subset-1 hosts with the highest scores are selected as the second candidate hosts (the default value of subset is 3), and they form a subset of candidate hosts together with the candidate hosts in (2).

[0128] (6) Randomly select a host in the subset as the host to be scheduled (target host) and place the user virtual machine Schedule to the host and start it.

[0129] Furthermore, the embodiment of the present invention also performs a simulation test, and the simulation test process is as follows:

[0130] (1) Assuming that the key resources that the user virtual machine is concerned about are memory, CPU, and disk resources, and assuming that the host resource specification list is as follows: Host_flavor_list = [(128, 256, 4096000), (96, 128, 4096000), (96,256, 1024000), (112, 128, 2048000), (112, 512, 4096000), (64, 256, 2048000),(256, 512, 5120000), (64, 128, 1024000), (128, 784, 5120000)], then 100 host clusters randomly formed from Host_flavor_list are host_map.

[0131] (2) Each time scheduling is performed, a vm_flavor (target virtual machine) is randomly selected from the user virtual machine list vm_flavor_list = [(1, 1, 1024), (2, 2,2048), (2, 4, 2048), (4, 4, 2048), (8, 6, 4096), (8, 8, 4096), (16, 16,10240), (16, 32, 20480), (32, 32, 40960), (64, 128, 102400)] as the resource application amount for this time.

[0132] (3) Simulate the process of issuing virtual machines on the cloud platform and schedule them in a loop until all hosts in host_map are short of at least one key resource. Note that if the resource application amount for a certain scheduling cannot be met by all hosts and there are still surplus resources of all types on the cluster hosts, a vm_flavor can be randomly selected from the vm_flavor_list for scheduling.

[0133] (4) In order to calculate the imbalance of resource scheduling and allocation in the cluster system, the imbalance of resource allocation after scheduling by the cloud platform can be defined as follows:

[0134] ;

[0135] in, Indicates the average CPU allocation rate in the cluster system. Indicates the cluster system CPU allocation ratio of the host; Indicates the average memory allocation rate in the cluster system. Indicates the cluster system The host's memory allocation ratio; Indicates the allocation rate of disk capacity in the cluster system. Indicates the cluster system The host's disk capacity allocation ratio.

[0136] (5) According to the above scheduling algorithm implementation steps and 100 simulation tests, the openstack community scheduling algorithm and the scheduling algorithm used in the technical solution of the present invention are compared in terms of resource utilization and resource distribution imbalance. Please refer to Figures 3 to 6 , Figure 3 A comparative analysis diagram of CPU allocation rate provided by an embodiment of the present invention, Figure 4 A comparative analysis diagram of a memory allocation rate provided by an embodiment of the present invention, Figure 5 A comparative analysis diagram of a disk allocation rate provided by an embodiment of the present invention, Figure 6 A comparative analysis diagram of resource allocation imbalance provided by an embodiment of the present invention. Figures 3 to 6 As shown in the figure, based on 100 full scheduling tests, this solution performs better than the openstack community scheduling algorithm in terms of average CPU / memory / disk allocation rate, and the resource utilization rate is improved by an average of 7.5%; in terms of resource allocation imbalance, this solution has a lower imbalance than the openstack community scheduling algorithm, and the resource scheduling allocation is more balanced.

[0137] It can be seen that the resource scheduling method in the cluster system provided by the embodiment of the present invention first determines the main resource of this request according to the resource demand of the target virtual machine through the idea of ​​fair scheduling of the main resource, thereby calculating the main resource request share of the target virtual machine on each host, so as to realize the screening of the first candidate host based on each main resource request share; secondly, the resource request share of each type of resource of the target virtual machine in the cluster system is calculated to determine the weight corresponding to each type of resource, and the host evaluation calculation is realized in combination with the current available amount of each type of resource in each host, so as to realize the screening of the second candidate host based on the evaluation value of each host; finally, the best target host is selected from the first candidate host and the second candidate host to realize the scheduling of the target virtual machine. It can be seen that the scheduling method based on the fairness of the main resource and the dynamic weight update of the technical scheme realizes the screening of the optimal host, which can effectively eliminate the problems of resource inclination and uneven resource allocation caused by a single scheduling rule. Therefore, the technical scheme can realize more balanced host resource scheduling in the cluster system and effectively improve the cluster resource utilization.

[0138] An embodiment of the present invention provides a resource scheduling device in a cluster system.

[0139] Please refer to Figure 7 , Figure 7This is a schematic diagram of the structure of a resource scheduling device in a cluster system provided by the present invention. The resource scheduling device in the cluster system may include:

[0140] Determining module 1, used to determine the primary resource type requested by the target virtual machine according to the resource scheduling request;

[0141] A first screening module 2 is used to calculate the first application share of the target virtual machine for the primary resource type on each host, and screen the first candidate host according to each first application share;

[0142] Calculation module 3, used to calculate the second application share of the target virtual machine for each resource type in the cluster system, and calculate the weight corresponding to each resource type according to each second application share;

[0143] The second screening module 4 is used to calculate the evaluation value of each host according to the current available amount of each resource type in each host and the corresponding weight, and screen the second candidate host according to each evaluation value;

[0144] The scheduling module 5 is used to select a target host from the first candidate host and the second candidate host to schedule the target virtual machine.

[0145] It can be seen that the resource scheduling device in the cluster system provided by the embodiment of the present invention first determines the main resource of this request according to the resource demand of the target virtual machine through the idea of ​​fair scheduling of the main resource, thereby calculating the main resource request share of the target virtual machine on each host, so as to realize the screening of the first candidate host based on each main resource request share; secondly, the resource request share of each type of resource of the target virtual machine in the cluster system is calculated to determine the weight corresponding to each type of resource, and the host evaluation calculation is realized in combination with the current available amount of each type of resource in each host, so as to realize the screening of the second candidate host based on the evaluation value of each host; finally, the best target host is selected from the first candidate host and the second candidate host to realize the scheduling of the target virtual machine. It can be seen that the scheduling method based on the fairness of the main resource and the dynamic weight update of the technical scheme realizes the screening of the optimal host, which can effectively eliminate the problems of resource inclination and uneven resource allocation caused by a single scheduling rule. Therefore, the technical scheme can realize more balanced host resource scheduling in the cluster system and effectively improve the cluster resource utilization.

[0146] In one embodiment of the present invention, the above-mentioned determination module 1 can be specifically used to determine the target application quantity of each resource type for the target virtual machine and the target available quantity of each resource type for the cluster system according to the resource scheduling request; calculate the target application share of each resource type for the target virtual machine in the cluster system according to each target application quantity and each target available quantity; determine the maximum value of the target application share according to each target application share, and use the resource type corresponding to the maximum value of the target application share as the main resource type applied by the target virtual machine.

[0147] In one embodiment of the present invention, the resource scheduling device within the cluster system may also include a screening module for determining the current available amount of each resource type on each host before calculating the first application share of the target virtual machine for the main resource type on each host; for each resource type, the host whose current available amount of the resource type does not meet the target application amount is eliminated.

[0148] In one embodiment of the present invention, the above-mentioned first screening module 2 can be specifically used to determine the first application quantity of the target virtual machine for the main resource type; determine the first available quantity of each host for the main resource type; and calculate the first application share of the target virtual machine for the main resource type on each host based on the first application quantity and each first available quantity.

[0149] In one embodiment of the present invention, the first screening module 2 may be specifically used to determine a minimum first application share according to each first application share; and select a host corresponding to the minimum first application share as a first candidate host.

[0150] In one embodiment of the present invention, the above-mentioned calculation module 3 can be specifically used to determine the second application quantity of the target virtual machine for each resource type; determine the second available quantity of the cluster system for each resource type; and calculate the second application share of the target virtual machine for each resource type in the cluster system based on each second application quantity and each second available quantity.

[0151] In one embodiment of the present invention, the calculation module 3 may be specifically used to perform normalized calculation on each second application share using the first application share to obtain the weight corresponding to each resource type.

[0152] In one embodiment of the present invention, the second screening module 4 can be specifically used to sort the evaluation values ​​in descending order to obtain an evaluation value sequence; and select hosts corresponding to the first preset number of evaluation values ​​in the evaluation value sequence as second candidate hosts.

[0153] In one embodiment of the present invention, the above-mentioned scheduling module 5 can be specifically used to determine whether there is an intersection host between the first candidate host and the second candidate host; if there is an intersection host, the intersection host is used as the target host to schedule the target virtual machine; if there is no intersection host, any host is selected from the first candidate host and the second candidate host as the target host to schedule the target virtual machine.

[0154] In one embodiment of the present invention, the calculation module 3 may be specifically used to calculate the second application share of the target virtual machine for each resource type in the cluster system except the first candidate host;

[0155] Accordingly, the scheduling module 5 may be specifically configured to select any host from the first candidate host and the second candidate host as the target host to schedule the target virtual machine.

[0156] In one embodiment of the present invention, the resource scheduling device in the cluster system may further include a response module, which is used to automatically respond to a resource scheduling request for the target virtual machine when a creation message of the target virtual machine is obtained.

[0157] For an introduction to the device provided in the embodiment of the present invention, please refer to the above method embodiment, and the present invention will not be elaborated here.

[0158] An embodiment of the present invention provides an electronic device.

[0159] Please refer to Figure 8 , Figure 8 This is a schematic diagram of the structure of an electronic device provided by the present invention, and the electronic device may include:

[0160] A memory 11, used for storing computer programs;

[0161] The processor 10 can implement the steps of any one of the above-mentioned resource scheduling methods in the cluster system when executing the computer program.

[0162] like Figure 8 , which is a schematic diagram of the composition structure of an electronic device, the electronic device may include: a processor 10, a memory 11, a communication interface 12 and a communication bus 13. The processor 10, the memory 11 and the communication interface 12 all communicate with each other through the communication bus 13.

[0163] In the embodiment of the present invention, the processor 10 may be a central processing unit (CPU), an application specific integrated circuit, a digital signal processor, a field programmable gate array or other programmable logic devices.

[0164] The processor 10 may call a program stored in the memory 11. Specifically, the processor 10 may execute operations in an embodiment of a resource scheduling method in a cluster system.

[0165] The memory 11 is used to store one or more programs, which may include program codes, and the program codes include computer operation instructions. In the embodiment of the present invention, the memory 11 at least stores programs for implementing the following functions:

[0166] Determine the primary resource type requested by the target virtual machine according to the resource scheduling request;

[0167] Calculate the first application share of the target virtual machine for the primary resource type on each host, and select the first candidate host according to each first application share;

[0168] Calculate the second application share of the target virtual machine for each resource type in the cluster system, and calculate the weight corresponding to each resource type according to each second application share;

[0169] Calculate the evaluation value of each host according to the current available amount and corresponding weight of each resource type in each host, and select the second candidate host according to each evaluation value;

[0170] A target host is selected from the first candidate host and the second candidate host to schedule the target virtual machine.

[0171] In a possible implementation, the memory 11 may include a program storage area and a data storage area, wherein the program storage area may store an operating system and an application required for at least one function, etc.; the data storage area may store data created during use.

[0172] In addition, the memory 11 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device or other volatile solid-state storage device.

[0173] The communication interface 12 may be an interface of a communication module, and is used to connect to other devices or systems.

[0174] Of course, it should be noted that Figure 8 The structure shown does not constitute a limitation on the electronic device in the embodiment of the present invention. In actual applications, the electronic device may include Figure 8 More or fewer components than shown, or combinations of certain components.

[0175] An embodiment of the present invention provides a computer-readable storage medium.

[0176] The computer-readable storage medium provided in the embodiment of the present invention stores a computer program, and when the computer program is executed by a processor, the steps of any one of the resource scheduling methods in the cluster system described above can be implemented.

[0177] Among them, the computer-readable storage medium can be any available medium that can be stored in a computer or a data storage device such as a server or data center that includes one or more available media integrated. For example, it can be a magnetic medium (such as a floppy disk, hard disk, magnetic tape, etc.), an optical medium (such as a DVD) or a semiconductor medium (such as a solid-state hard disk) and other media that can store computer program codes.

[0178] For an introduction to the computer-readable storage medium provided in an embodiment of the present invention, please refer to the above method embodiment, and the present invention will not elaborate on it here.

[0179] An embodiment of the present invention provides a computer program product.

[0180] The computer program product provided by the embodiment of the present invention includes a computer program / instruction. When the computer program / instruction is executed by a processor, the steps of any one of the resource scheduling methods in the cluster system described above can be implemented.

[0181] Specifically, in the above embodiments, all or part of them can be implemented by software, hardware, firmware or any combination thereof. When implemented by software, all or part of them can be implemented in the form of a computer program product.

[0182] Among them, the computer program product may include one or more computer programs / instructions, and when the computer program / instructions are loaded and executed on a computer, the process or function described in the embodiment of the present invention may be generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. Computer instructions may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, computer instructions may be transmitted from one website site, computer, server or data center to another website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line, etc.) or wireless (e.g., infrared, wireless, microwave, etc.) means.

[0183] For an introduction to the computer program product provided by the embodiment of the present invention, please refer to the above method embodiment, and the present invention will not be elaborated here.

[0184] The various embodiments in the specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referred to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part description.

[0185] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in the above description according to function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.

[0186] The steps of the method or algorithm described in conjunction with the embodiments disclosed herein may be implemented directly using hardware, a software module executed by a processor, or a combination of the two. The software module may be placed in a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.

[0187] The technical solution provided by the present invention is described in detail above. Specific examples are used herein to illustrate the principle and implementation of the present invention, and the description of the above embodiments is only used to help understand the method of the present invention and its core idea. It should be pointed out that for ordinary technicians in this technical field, without departing from the principle of the present invention, the present invention can also be improved and modified, and these improvements and modifications also fall within the scope of protection of the present invention.

Claims

1. A resource scheduling method in a cluster system, characterized in that: include: Determine the primary resource type requested by the target virtual machine according to the resource scheduling request; Calculating a first application share of the target virtual machine for the primary resource type on each host, and selecting a first candidate host according to each of the first application shares; Calculating the second application share of the target virtual machine for each resource type in the cluster system, and calculating the weight corresponding to each resource type according to each of the second application shares; Calculating the evaluation value of each of the hosts according to the current available amount and the corresponding weight of each of the resource types in each of the hosts, and selecting and obtaining the second candidate host according to each of the evaluation values; A target host is selected from the first candidate host and the second candidate host to schedule the target virtual machine.

2. The resource scheduling method in a cluster system according to claim 1, characterized in that: Determine the primary resource type requested by the target virtual machine based on the resource scheduling request, including: Determine, according to the resource scheduling request, a target application amount of the target virtual machine for each resource type, and a target available amount of the cluster system for each resource type; Calculate the target application share of the target virtual machine for each resource type in the cluster system according to each target application amount and each target available amount; A maximum target application share value is determined according to each of the target application shares, and a resource type corresponding to the maximum target application share value is used as a primary resource type applied for by the target virtual machine.

3. The resource scheduling method in a cluster system according to claim 2, characterized in that: Before calculating the first application share of the target virtual machine for the primary resource type on each host, the method further includes: Determining the current available amount of each resource type for each host; For each resource type, hosts whose current available quantity of the resource type does not meet the target application quantity are eliminated.

4. The resource scheduling method in a cluster system according to claim 1, characterized in that: Calculating a first application share of the target virtual machine for the primary resource type on each host includes: Determine a first application amount of the target virtual machine for the primary resource type; Determining a first available amount of each of the hosts for the primary resource type; A first application share of the target virtual machine for the primary resource type on each of the hosts is calculated according to the first application amount and each of the first available amounts.

5. The resource scheduling method in a cluster system according to claim 4, characterized in that: The first candidate host is obtained by screening according to each of the first application shares, including: Determining a minimum first application share according to each of the first application shares; The host corresponding to the minimum value of the first application share is used as the first candidate host.

6. The resource scheduling method in a cluster system according to claim 1, characterized in that: Calculating the second application share of the target virtual machine for each resource type in the cluster system includes: Determine a second application amount of the target virtual machine for each resource type; Determining a second available amount of the cluster system for each resource type; A second application share of the target virtual machine for each resource type in the cluster system is calculated according to each of the second application amounts and each of the second available amounts.

7. The resource scheduling method in a cluster system according to claim 6, characterized in that: The weight corresponding to each resource type is calculated according to each of the second application shares, including: The first application share is used to perform normalized calculation on each of the second application shares to obtain a weight corresponding to each of the resource types.

8. The resource scheduling method in a cluster system according to claim 6, characterized in that: The second candidate host is obtained by screening according to each of the evaluation values, including: Sort the evaluation values ​​in descending order to obtain an evaluation value sequence; The hosts corresponding to the first preset number of evaluation values ​​in the evaluation value sequence are used as the second candidate hosts.

9. The resource scheduling method in a cluster system according to claim 1, characterized in that: Selecting a target host from the first candidate host and the second candidate host to schedule the target virtual machine includes: Determine whether the first candidate host and the second candidate host have an intersection host; If the intersection host exists, scheduling the target virtual machine using the intersection host as the target host; If the intersection host does not exist, any host is selected from the first candidate host and the second candidate host as the target host to schedule the target virtual machine.

10. The resource scheduling method in a cluster system according to claim 1, characterized in that: Calculating the second application share of the target virtual machine for each resource type in the cluster system includes: Calculating a second application share of the target virtual machine for each resource type in the cluster system except the first candidate host; Accordingly, selecting a target host from the first candidate host and the second candidate host to schedule the target virtual machine includes: Any host is selected from the first candidate host and the second candidate host as the target host to schedule the target virtual machine.

11. The resource scheduling method in a cluster system according to claim 1, characterized in that: Also includes: When the creation message of the target virtual machine is obtained, the resource scheduling request for the target virtual machine is automatically responded to.

12. A resource scheduling device in a cluster system, characterized in that: include: A determination module, used to determine the primary resource type requested by the target virtual machine according to the resource scheduling request; A first screening module, configured to calculate a first application share of the target virtual machine for the primary resource type on each host, and screen and obtain a first candidate host according to each of the first application shares; a calculation module, configured to calculate a second application share of the target virtual machine for each resource type in the cluster system, and obtain a weight corresponding to each resource type according to each of the second application shares; A second screening module is used to calculate the evaluation value of each host according to the current available amount and corresponding weight of each resource type in each host, and screen and obtain the second candidate host according to each evaluation value; The scheduling module is used to select a target host from the first candidate host and the second candidate host to schedule the target virtual machine.

13. An electronic device, characterized in that: include: Memory for storing computer programs; A processor is used to implement the steps of the resource scheduling method in a cluster system as described in any one of claims 1 to 11 when executing the computer program.

14. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the resource scheduling method in a cluster system as claimed in any one of claims 1 to 11 are implemented.

15. A computer program product comprising a computer program / instructions, characterized in that When the computer program / instructions are executed by a processor, the steps of the resource scheduling method in a cluster system as claimed in any one of claims 1 to 11 are implemented.