A method and system for high-availability scheduling of cross-cluster resources in a cloud computing environment
By predicting resource usage peak and cooperative game theory, dynamically adjusting task allocation weights, solving the problem of unreasonable allocation of cross-cluster resource management in inter-cloud computing environment, improving resource utilization rate and reducing resource fragmentation, and ensuring the stability of LRAs tasks run.
Patent Information
- Application Number
- CN202210468150.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-04-29
- Publication Date
- 2025-01-17
- Estimated Expiration
- 2042-04-29
AI Technical Summary
In the inter-cloud computing environment, it is difficult for the existing technology to effectively manage cross-cluster resources, resulting in unreasonable resource allocation, low resource utilization rate and resource fragmentation, affecting the stability of long-term running applications (LRAs).
By predicting resource usage peaks, multiple sub-task allocation schemes are generated, high-availability evaluation function value and cooperative game scores of cluster resources are calculated, and task allocation weights are dynamically adjusted to ensure the rational allocation and utilization of resources.
It improves resource utilization, reduces resource fragmentation, and promotes the smooth operation of LRAs tasks during the life cycle.
Smart Images

Figure CN114911613B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to a multi-cluster task distribution scheduling technology, and in particular to a method and system for high-availability scheduling of cross-cluster resources in a cloud computing environment. Background Art
[0002] With the development of cloud computing, more and more enterprises and companies are beginning to adopt multi-cloud development strategies. Multi-cloud cross-cluster task deployment not only makes up for the shortcomings of limited management scale of a single cluster, but also has many advantages such as high availability scheduling, low latency, elastic resource scaling, and avoiding vendor lock-in. However, at the same time, it also brings many new problems. For example, enterprise resources are distributed in multiple regions and multiple data centers, making unified management difficult. Therefore, building and implementing unified management across clusters has become an urgent problem to be solved. At the same time, cross-cluster task scheduling, as the core of the multi-cluster system, faces many challenges.
[0003] In the cloud environment, production clusters run two types of workloads, including long-running applications (LRAs) for online cloud services and batch jobs (BJs) for offline data analysis. Compared with batch tasks, LRAs run for a longer time, ranging from several hours to several months, and need to be guaranteed to run stably during their life cycle, without preemption or migration. According to research, in order to ensure the stable operation of LRAs, Microsoft has dedicated many large clusters entirely to LRAs workloads. Currently, typical multi-cluster management projects have three ways of resource allocation for LRAs task scheduling: aggregation strategy, static weight strategy, and dynamic weight strategy. The aggregation strategy prioritizes tasks to member clusters with a large number of tasks that can be accommodated by the remaining available resources, and minimizes the number of task distribution clusters; the static weight strategy allocates tasks based on the cluster weights set by the user; the dynamic weight strategy is based on the user's subjective judgment of business resource requirements, and allocates tasks to the corresponding member clusters based on the maximum number of tasks that can be accommodated by each cluster resource as a dynamic weight. Compared with statically allocating tasks based on user experience, the current dynamic weight strategy has preliminarily achieved the purpose of dynamic load balancing based on the remaining available resources. However, it does not take into account the dynamic differences between the actual resource usage of users and the resource application value, as well as the natural differences in the cluster resource allocation under different stakeholders, which may lead to unreasonable resource placement and ineffective resource utilization. Although conservative resource allocation based on the application amount protects the service quality of LRAs to a great extent, the remaining available amount of different types of cluster resources in actual operation does not match the resource requirements of the tasks to be allocated, resulting in resource fragmentation and overall cost loss of multiple clusters. Summary of the invention
[0004] Technical problem to be solved by the present invention: In view of the above-mentioned problems in the prior art, a method and system for high-availability scheduling of cross-cluster resources in a cloud computing environment are provided. The present invention aims to improve resource utilization and reduce resource fragmentation while reasonably dividing tasks and allocating resources that meet the requirements for applications based on the existing resource conditions of multiple clusters.
[0005] In order to solve the above technical problems, the technical solution adopted by the present invention is:
[0006] A high-availability scheduling method for cross-cluster resources in a cloud computing environment, comprising:
[0007] 1) Determine the tasks to be assigned T j of P The resource requirements of each subtask determine the tasks to be assigned T j Corresponding P target member clusters and their total resources and allocated resources; based on the resource usage peaks of new tasks in multiple unit times before the current moment of all target member clusters, predict the overall resource usage peak of the tasks arriving in the next unit time from the current moment;
[0008] 2) Generate multiple subtask allocation schemes and determine the number of basic task units performed by each subtask;
[0009] 3) For each seed task allocation plan: Calculate the cluster resource high availability evaluation function value of the target member cluster based on the total resources of each target member cluster, the allocated resources, and the total resource usage peak of the tasks arriving in the next unit time from the current moment , and based on the cluster resource high availability evaluation function value of all target member clusters Calculate the cooperative game scores of all feasible subtask allocation solutions ;
[0010] 4) Scoring based on the highest-scoring cooperative game The number of basic task units executed by each subtask corresponding to the corresponding subtask allocation scheme is used as the task to be assigned T j of P The dynamic weight of each subtask in each target member cluster.
[0011] Optionally, the resource demand, the total amount of resources and the resources in the allocated resources include four resources: CPU, memory, network bandwidth and disk IO.
[0012] Optionally, in step 1), the tasks to be assigned are determined T j of PWhen the resource requirements of subtasks are met, the task to be assigned T j Resource requirements for:
[0013] ,
[0014] In the above formula, Tasks to be assigned T j Application requirements for CPU, memory, network bandwidth, and disk IO; P Any of the subtasks k The resource requirements of each subtask are:
[0015] ,
[0016] In the above formula, Respectively k The application requirements of each subtask on CPU, memory, network bandwidth, and disk IO, and any k The resource requirements of each subtask meet:
[0017] ,
[0018] In the above formula, P To be assigned tasks T j The number of subtasks, No. k The number of basic task units executed by each subtask, , They are the CPU, memory, network bandwidth, and disk IO requirements of a task unit. Is a positive integer.
[0019] Optionally, in step 3), the cluster resource high availability evaluation function value of the target member cluster is calculated The function expression is:
[0020] ,
[0021] in:
[0022] ,
[0023] ,
[0024] ,
[0025] ,
[0026] In the above formula, To unify the CPU ratio standard, the impact of memory, network bandwidth, and disk IO on high availability; To unify the memory ratio standard, the impact of CPU, network bandwidth, and disk IO on high availability; To unify the network bandwidth ratio standard, the impact of CPU, memory, and disk IO on high availability; To unify the disk IO ratio standard, the impact of CPU, memory, and network bandwidth on high availability; L To find the least common multiple function, any two numbers The least common multiple of , , The peak usage of CPU, memory, network bandwidth, and disk IO resources of the tasks arriving in the next unit time from the current moment are predicted respectively. , The target member clusters C i The remaining amount of CPU, memory, network bandwidth, and disk IO resources after allocating subtasks.
[0027] Optionally, the target member cluster C i The calculation function expression of the remaining amount of CPU, memory, network bandwidth, and disk IO resources after allocating subtasks is:
[0028] ,
[0029] In the above formula, , , , The target member clusters C i The total amount of CPU, memory, network bandwidth, and disk IO resources in the , , , The target member clusters C i The amount of allocated resources in CPU, memory, network bandwidth, and disk IO resources; Respectively k The application requirements of each subtask regarding CPU, memory, network bandwidth, and disk IO.
[0030] Optionally, the cooperative game score in step 2) The calculation function expression is:
[0031] ,
[0032] In the above formula, P To be assigned tasks T j The number of subtasks, For any i Target member cluster C i The cluster resource high availability evaluation function value.
[0033] Optionally, in step 4), the highest-scoring cooperative game score is When the number of basic task units executed by each subtask corresponding to the corresponding subtask allocation scheme is ,in ~ They are No. 1~ P The number of basic task units executed by each subtask.
[0034] In addition, the present invention also provides a method for high-availability scheduling of cross-cluster resources in a cloud computing environment, comprising:
[0035] S1) Receive tasks submitted by users, create task resource application requirements, and generate resource objects;
[0036] S2) Select the task to be assigned from all tasks T j ; Determine the tasks to be assigned T j Whether there is a matching propagation scheduling strategy for the resource object, the attributes of the propagation scheduling strategy include the type and name of the resource object, and the target member cluster attributes of the resource object; if a propagation scheduling strategy matching the resource object type and name is found, directly jump to step S4); if no matching propagation scheduling strategy is found, proceed to the next step S3);
[0037] S3) Wait for the creation of a new propagation scheduling strategy. If a new propagation scheduling strategy is detected, determine whether the new propagation scheduling strategy is consistent with the task to be assigned. T j If the resource matches, jump to step S4), otherwise re-execute step S3) to continue waiting for the creation of a new propagation scheduling strategy;
[0038] S4) The tasks to be assigned T j The resource object and the matching propagation scheduling strategy are bound to generate tasks to be assigned T j The resource binding object;
[0039] S5) Filter out candidate member clusters from all member clusters, score and sort the candidate member clusters, and if there is a task to be assigned, T j If the resource binding object does not specify the number of target member clusters, all candidate member clusters are directly used as target member clusters; otherwise, according to the tasks to be assigned T j The resource binding object specifies the number of target member clusters, and selects the required candidate member clusters as the target member clusters according to the scoring order among the candidate member clusters;
[0040] S6) Determine the tasks to be assigned T j Task scheduling type:
[0041] If the task scheduling type is the copy operation mode, the task to be assigned will be directly T j Distribute to all target member clusters so that all target member clusters execute the tasks to be assigned T j , jump to step S8);
[0042] If the task scheduling type is subtask allocation, jump to the next step;
[0043] S7) Determine the sub-type of sub-task allocation method:
[0044] If the subtype is aggregation, the maximum number of replicas that can be accommodated for each target member cluster is calculated respectively. The maximum number of replicas that can be accommodated refers to the number of task units that the target member cluster can still support running, and tasks are preferentially allocated to target member clusters with a larger maximum number of replicas to reduce the number of target member clusters distributed;
[0045] If the subtype is static weight mode, the tasks to be assigned are sorted according to the preset weight of the target member cluster. T j Divide the number of task units into each target member cluster according to the weight;
[0046] If the subtype is a dynamic weight method, the cross-cluster resource high availability scheduling method in the cloud computing environment is used to obtain the tasks to be assigned. T j of P The dynamic weight of each subtask in each target member cluster will be assigned to the task T j Divide the number of task units into each target member cluster according to the dynamic weight size; jump to step S8);
[0047] S8) Generate a subtask object according to the resource binding object;
[0048] S9) Send the subtask object to the corresponding target member cluster and deploy and run the subtask.
[0049] In addition, the present invention also provides a high-availability scheduling system for cross-cluster resources in a cloud computing environment, including an interconnected microprocessor and a memory, wherein the microprocessor is programmed or configured to execute the steps of the high-availability scheduling method for cross-cluster resources in a cloud computing environment.
[0050] In addition, the present invention also provides a computer-readable storage medium, which stores a computer program, and the computer program is used to be executed by a microprocessor to implement the steps of the cross-cluster resource high-availability scheduling method in a cloud computing environment.
[0051] Compared with the prior art, the present invention has the following advantages: the high-availability scheduling method for cross-cluster resources in a cloud computing environment of the present invention is a new dynamic weight scheduling strategy, which considers the historical average usage of different resources as an important factor in dynamic weight division, so that the real-time remaining available ratio of different resources in the cluster is infinitely close to the distribution of task requirements, and uses cooperative game theory to make the strategy infinitely close to the optimization goal, that is, the ratio of the remaining available amount of different resources is consistent with the ratio of the usage of different resources in the real-time multi-cluster system, which can promote more rational resource placement, improve resource utilization to a certain extent, reduce the generation of resource fragments, and enable more LRAs tasks to run smoothly within their life cycle. BRIEF DESCRIPTION OF THE DRAWINGS
[0052] Figure 1 The following is a flow chart of an application example of the resource allocation method of the present invention.
[0053] Figure 2 It is the total amount of resources and the allocated resource map of the target member cluster in the resource allocation method of the present invention.
[0054] Figure 3 The figure is a flow chart of an application example of the scheduling method of the present invention. DETAILED DESCRIPTION
[0055] like Figure 1 The cross-cluster resource high availability scheduling method in the cloud computing environment of this embodiment includes:
[0056] 1) Determine the tasks to be assigned T j of P The resource requirements of each subtask determine the tasks to be assigned T j Corresponding Ptarget member clusters and their total resources and allocated resources; based on the resource usage peaks of new tasks in multiple unit times before the current moment of all target member clusters, predict the overall resource usage peak of the tasks arriving in the next unit time from the current moment;
[0057] 2) Generate multiple subtask allocation schemes and determine the number of basic task units performed by each subtask;
[0058] 3) For each seed task allocation plan: Calculate the cluster resource high availability evaluation function value of the target member cluster based on the total resources of each target member cluster, the allocated resources, and the total resource usage peak of the tasks arriving in the next unit time from the current moment , and based on the cluster resource high availability evaluation function value of all target member clusters Calculate the cooperative game scores of all feasible subtask allocation solutions ;
[0059] 4) Scoring based on the highest-scoring cooperative game The number of basic task units executed by each subtask corresponding to the corresponding subtask allocation scheme is used as the task to be assigned T j of P The dynamic weight of each subtask in each target member cluster.
[0060] The key to the high-availability scheduling method of cross-cluster resources in the cloud computing environment of this embodiment is to consider the difference between actual resource usage and application value, the heterogeneity of clusters and tasks, which leads to resource fragmentation problems and overall cost loss of multiple clusters, and realizes a new dynamic weight strategy.
[0061] In this embodiment, resource requirements, total resources, and resources in allocated resources include four resources: CPU, memory, network bandwidth, and disk IO. In addition, for certain specific types of tasks, some of the above four resources can be used as resource requirements, total resources, and resources in allocated resources as needed. For example, some neural network acceleration computing tasks may be relatively dependent on the three resources of CPU, memory, and network bandwidth, while the requirements for disk IO are relatively small; for example, some file processing services may be relatively dependent on the three resources of CPU, memory, and disk IO, while the requirements for network bandwidth are relatively small; some computing tasks may be relatively dependent on the two resources of CPU and memory, while the requirements for network bandwidth and disk IO are relatively small, which will not be explained one by one here. In addition, based on the four resources of CPU, memory, network bandwidth, and disk IO, it can be further extended to other computing resources.
[0062] In this embodiment, in step 1), the tasks to be assigned are determined Tj of P When the resource requirements of subtasks are met, the task to be assigned T j Resource requirements for:
[0063] ,
[0064] In the above formula, Tasks to be assigned T j Application requirements for CPU, memory, network bandwidth, and disk IO; P Any of the subtasks k The resource requirements of each subtask are:
[0065] ,
[0066] In the above formula, Respectively k The application requirements of each subtask on CPU, memory, network bandwidth, and disk IO. Suppose the target member cluster is ,common target member clusters; the resource total configuration information set of each target member cluster is , Indicates the number of clusters Total resource information of member clusters, ,in , , and Respectively The CPU, memory, network bandwidth, and disk IO capacity of the member clusters. The resources allocated to each target member cluster are as follows: , Indicates The allocated resource information of the cluster, ,in , , and Respectively The peak values of the actual usage of CPU, memory, network bandwidth, and disk IO resources on each cluster (which can reduce the estimated differences in the application values that are too large), such as Figure 2 Therefore, any k The resource requirements of each subtask meet:
[0067] ,
[0068] In the above formula, P To be assigned tasks Tj The number of subtasks, No. k The number of basic task units executed by each subtask, , They are the CPU, memory, network bandwidth, and disk IO requirements of a task unit. Undoubtedly, based on the above allocation methods of the four resources of CPU, memory, network bandwidth, and disk IO, those skilled in the art can undoubtedly determine the allocation methods that can be extended to other multiple resource combinations.
[0069] In this embodiment, the resources include CPU, memory, network bandwidth, and disk IO. In step 3), the cluster resource high availability evaluation function value of the target member cluster is calculated. The function expression is:
[0070] ,
[0071] in:
[0072] ,
[0073] ,
[0074] ,
[0075] ,
[0076] In the above formula, To unify the CPU ratio standard, the impact of memory, network bandwidth, and disk IO on high availability; To unify the memory ratio standard, the impact of CPU, network bandwidth, and disk IO on high availability; To unify the network bandwidth ratio standard, the impact of CPU, memory, and disk IO on high availability; To unify the disk IO ratio standard, the impact of CPU, memory, and network bandwidth on high availability; L To find the least common multiple function, any two numbers The least common multiple of , , The peak usage of CPU, memory, network bandwidth, and disk IO resources of the tasks arriving in the next unit time from the current moment are predicted respectively. , The target member clusters C iThe remaining amount of CPU, memory, network bandwidth, and disk IO resources after allocating subtasks.
[0077] Cluster resource high availability evaluation function value The larger the value, the more likely it is that the target member cluster is in the target member cluster set C. The higher the resource availability, the better. As mentioned above, the cluster resource availability evaluation function value of the target member cluster is calculated. It is mainly to unify the proportion standard of one resource type and the sum of the impact values of other resource type factors on high availability. Therefore, based on the calculation method of the above four resources of CPU, memory, network bandwidth, and disk IO, technical personnel in this field can undoubtedly determine the calculation method that can be extended to other multiple resource combinations.
[0078] The target member cluster in the target member cluster set C The remaining amount of CPU, memory, network bandwidth, and disk IO resources after allocating subtasks can be calculated based on the total amount of resources, the number of allocated resources, and the resource application requirements of subtasks. Suppose the resource usage peaks of the newly arrived tasks in the hth unit time of the overall multi-cluster resources of CPU, memory, network bandwidth, and disk IO are , the resource usage of new tasks in the first h unit time is used to predict the CPU, memory, network bandwidth, and disk IO task resource requirements of the new tasks arriving in the next h+1 unit time: , , , . Subtask Dispatch to Clusters After that, cluster The CPU, memory, network bandwidth, and disk IO usage margins are , , , In this embodiment, the target member cluster C i The calculation function expression of the remaining amount of CPU, memory, network bandwidth, and disk IO resources after allocating subtasks is:
[0079] ,
[0080] In the above formula, , , , The target member clusters C i The total amount of CPU, memory, network bandwidth, and disk IO resources in the , , , The target member clusters C i The amount of allocated resources in CPU, memory, network bandwidth, and disk IO resources; Respectively k The application requirements of each subtask regarding CPU, memory, network bandwidth, and disk IO.
[0081] It should be noted that in step 1), when predicting the total resource usage peak value of the tasks arriving in the next unit time from the current moment based on the resource usage peak values of all target member clusters multiple unit times before the current moment, the required method can be used as needed. For example, a relatively simple way is to use the average method, that is, take the average value of the resource usage peak values of the first n unit times as the prediction of the total resource usage peak value of the tasks arriving in the next unit time from the current moment. Alternatively, a machine learning algorithm is used to take the resource usage peak values of the first n unit times as the input of the machine learning algorithm model, and the output of the machine learning algorithm model is the total resource usage peak value of the tasks arriving in the next unit time from the current moment. The machine learning algorithm can be trained by historical records to establish a mapping relationship between input and output.
[0082] A key point of the method of this embodiment is to use a cooperative game model. and the subtasks to be scheduled A cooperative game is formalized between them. In this cooperative game model, the players are the member clusters that perform task scheduling. After several rounds of games, The players will reach a win-win situation, which is called a Nash bargaining solution. A cooperative game is usually expressed as maximizing the product of the players' utility functions. Therefore, in this embodiment, the cooperative game score in step 2) is The calculation function expression is:
[0083] ,
[0084] In the above formula, P To be assigned tasks T j The number of subtasks, For any i Target member cluster C i The cluster resource high availability evaluation function value.
[0085] In this embodiment, in step 4), the highest cooperative game score is calculated. When the number of basic task units executed by each subtask corresponding to the corresponding subtask allocation scheme is ,in ~ They are No. 1~ P The number of basic task units to be executed by each subtask. The objective function of the cooperative game model in this embodiment can be expressed as:
[0086] .
[0087] By calculating the cooperative game scores of all feasible subtask allocation schemes Finally, the subtask set in the allocation scheme with the highest score is , the number of basic task units executed by each subtask is , the dynamic weights of the target member clusters are The dynamic weight calculation method of this embodiment considers the historical average usage of different resources as an important factor in dynamic weight division, so that the real-time remaining available ratio of different resources in the cluster is infinitely close to the distribution of task prediction requirements. The cooperative game theory is used to make the strategy infinitely close to the optimization goal, that is, the ratio of the remaining available amount of different resources is consistent with the ratio of the usage of different resources in the real-time multi-cluster system, which can promote more rational resource placement, improve resource utilization to a certain extent, reduce the generation of resource fragments, and enable more LRAs tasks to run smoothly within their life cycle.
[0088] like Figure 3 This embodiment also provides a method for high-availability scheduling of cross-cluster resources in a cloud computing environment, including:
[0089] S1) Receive tasks submitted by users, create task resource application requirements, and generate resource objects;
[0090] In this embodiment, an external user sends a task to the main cluster in the multi-cluster management system, and the main cluster generates a resource object based on the task resource application requirements. The independent task set of all clusters is In this embodiment, any of the j Tasks to be assigned T j of P Each subtask is described as an object of scheduling and resource allocation.
[0091] S2) Select the task to be assigned from all tasks T j ; Determine the tasks to be assigned T jWhether there is a matching propagation scheduling policy (Propagation Policy) for the resource object, the attributes of the propagation scheduling policy include the type (Kind) and name (Name) of the resource object, and the target member cluster attribute (Placement) of the resource object. If a propagation scheduling policy matching the type and name of the resource object is found, jump directly to step S4). If no matching propagation scheduling policy is found, proceed to the next step S3); in this embodiment, the resource object to be allocated is specifically detected by a resource detector. In this embodiment, the resource binding object (Resource Binding) is stored in the local cache. In addition, other storage methods may be used as needed, such as a database or cloud.
[0092] S3) Wait for the creation of a new propagation scheduling strategy. If a new propagation scheduling strategy is detected, determine whether the new propagation scheduling strategy is consistent with the task to be assigned. T j If the resource matches, jump to step S4), otherwise re-execute step S3) to continue waiting for the creation of a new propagation scheduling strategy;
[0093] S4) The tasks to be assigned T j The resource object and the matching propagation scheduling strategy are bound to generate tasks to be assigned T j As an optional implementation, in this embodiment, the attributes of the resource binding object (Resource Binding) include: resource object name, replica resource requirements, target member cluster attributes (Placement), etc.
[0094] S5) Filter out candidate member clusters from all member clusters, score and sort the candidate member clusters, and if there is a task to be assigned, T j If the resource binding object does not specify the number of target member clusters, all candidate member clusters are directly used as target member clusters; otherwise, according to the tasks to be assigned T j The resource binding object specifies the number of target member clusters, and selects the required candidate member clusters as the target member clusters according to the scoring order among the candidate member clusters;
[0095] It should be noted that, when screening out candidate member clusters in step S5), the resource conditions or other status conditions of the member clusters can be used. For example, the clusters can be filtered according to the scheduling algorithm of the filtering module in the scheduler, based on the three requirements of cluster affinity, stain tolerance and API version, to screen out candidate member clusters that meet the requirements. When scoring and sorting the candidate member clusters, they can be scored according to the resource conditions or other status conditions of the member clusters. Scoring is to map the resource conditions or other status conditions of the member clusters to scores. The required mapping method can be adopted as needed, including normalization and machine learning algorithms. If the user does not specify the number of target member clusters in the resource binding object, all candidate member clusters are scheduled and divided into copies as target member clusters by default. If the user specifies the number of target member clusters in the resource binding object, the clusters with the highest scores among the remaining candidate clusters are selected in turn and included in the target member cluster until the number of target member clusters meets the number of target member clusters specified by the user in the resource binding object.
[0096] S6) Determine the tasks to be assigned T j Task scheduling type:
[0097] If the task scheduling type is the copy operation mode, the task to be assigned will be directly T j Distribute to all target member clusters so that all target member clusters execute the tasks to be assigned T j , jump to step S8);
[0098] If the task scheduling type is subtask allocation, jump to the next step;
[0099] S7) Determine the sub-type of sub-task allocation method:
[0100] If the subtype is aggregation, the maximum number of replicas that can be accommodated for each target member cluster is calculated respectively. The maximum number of replicas that can be accommodated refers to the number of task units that the target member cluster can still support running, and tasks are preferentially allocated to target member clusters with a larger maximum number of replicas to reduce the number of target member clusters distributed;
[0101] If the subtype is static weight mode, the tasks to be assigned are sorted according to the preset weight of the target member cluster. T j Divide the number of task units into each target member cluster according to the weight;
[0102] If the subtype is a dynamic weight method, the aforementioned cross-cluster resource high availability scheduling method in the cloud computing environment is used to obtain the task to be assigned T j of PThe dynamic weight of each subtask in each target member cluster will be assigned to the task T j Divide the number of task units into each target member cluster according to the dynamic weight; jump to step S8);
[0103] S8) Generate a subtask object (Work) according to the resource binding object;
[0104] S9) Send the subtask object (Work) to the corresponding target member cluster and deploy and run the subtask.
[0105] Among them, steps S6) to S7) are specifically implemented by the scheduler. The scheduler calculates the scheduling result of the task, including the target member cluster and the number of replicas allocated to each target member cluster, based on the target member cluster attribute (Placement) in the resource binding object through the scheduling algorithm in the scheduler. Step S8) is implemented by the resource binding controller, and step S9) is implemented by the executor. The above scheduler, resource binding controller and executor are all logical divisions of related execution functions or steps, and should not be regarded as specific restrictions on the related execution functions or steps.
[0106] It should be noted that steps S2) to S9) are the scheduling process for a task to be assigned, and the loop of steps S2) to S9) can be scheduled as needed. It can return to step S2) immediately after step S9) is completed, or it can be triggered to return to step S2) by specific conditions, such as waiting for a delay, or after the task is completed, or based on the resources or task running status on the target service cluster.
[0107] In addition, this embodiment also provides a high-availability scheduling system for cross-cluster resources in a cloud computing environment, including an interconnected microprocessor and a memory, wherein the microprocessor is programmed or configured to execute the steps of the aforementioned high-availability scheduling method for cross-cluster resources in a cloud computing environment.
[0108] In addition, this embodiment also provides a computer-readable storage medium, which stores a computer program, and the computer program is used to be executed by a microprocessor to implement the steps of the aforementioned cross-cluster resource high-availability scheduling method in a cloud computing environment.
[0109] Those skilled in the art should understand that the embodiments of the present application can be provided as methods, systems, or computer program products. Therefore, the present application can take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present application can take the form of a computer program product implemented on one or more computer-readable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code. The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the process Figure 1 A process or multiple processes and / or boxes Figure 1 These computer program instructions can also be stored in a computer-readable memory that can guide a computer or other programmable data processing device to work in a specific way, so that the instructions stored in the computer-readable memory produce a product including an instruction device, which implements the functions specified in the process. Figure 1 A process or multiple processes and / or boxes Figure 1 These computer program instructions can also be loaded onto a computer or other programmable data processing device, so that a series of operation steps are executed on the computer or other programmable device to produce a computer-implemented process, so that the instructions executed on the computer or other programmable device provide for implementing the process in the process. Figure 1 A process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.
[0110] The above is only a preferred embodiment of the present invention, and the protection scope of the present invention is not limited to the above embodiments. All technical solutions under the concept of the present invention belong to the protection scope of the present invention. It should be pointed out that for ordinary technicians in this technical field, some improvements and modifications without departing from the principle of the present invention should also be regarded as the protection scope of the present invention.
Claims
1. A high-availability scheduling method for cross-cluster resources in a cloud computing environment, characterized in that: include: 1) Determine the tasks to be assigned T j of P The resource requirements of each subtask determine the tasks to be assigned T j Corresponding P target member clusters and their total resources and allocated resources; based on the resource usage peaks of new tasks in multiple unit times before the current moment of all target member clusters, predict the overall resource usage peak of the tasks arriving in the next unit time from the current moment; 2) Generate multiple subtask allocation schemes and determine the number of basic task units performed by each subtask; 3) For each seed task allocation plan: Calculate the cluster resource high availability evaluation function value of the target member cluster based on the total resources of each target member cluster, the allocated resources, and the total resource usage peak of the tasks arriving in the next unit time from the current moment , and based on the cluster resource high availability evaluation function value of all target member clusters Calculate the cooperative game scores of all feasible subtask allocation solutions ; 4) Scoring based on the highest-scoring cooperative game The number of basic task units executed by each subtask corresponding to the corresponding subtask allocation scheme is used as the task to be assigned T j of P The dynamic weight of each subtask in each target member cluster; The resource requirements, total resources and allocated resources include four resources: CPU, memory, network bandwidth and disk IO; In step 3), the cluster resource high availability evaluation function value of the target member cluster is calculated. The function expression is: , in: , , , , In the above formula, To unify the CPU ratio standard, the impact of memory, network bandwidth, and disk IO on high availability; To unify the memory ratio standard, the impact of CPU, network bandwidth, and disk IO on high availability; To unify the network bandwidth ratio standard, the impact of CPU, memory, and disk IO on high availability; To unify the disk IO ratio standard, the impact of CPU, memory, and network bandwidth on high availability; L To find the least common multiple function, any two numbers The least common multiple of , , The peak usage of CPU, memory, network bandwidth, and disk IO resources of the tasks arriving in the next unit time from the current moment are predicted respectively. , The target member clusters C i The remaining amount of CPU, memory, network bandwidth, and disk IO resources after allocating subtasks.
2. The method for high availability scheduling of cross-cluster resources in a cloud computing environment according to claim 1, characterized in that: Determine the tasks to be assigned in step 1) T j of P When the resource requirements of subtasks are met, the task to be assigned T j Resource requirements for: , In the above formula, Tasks to be assigned T j Application requirements for CPU, memory, network bandwidth, and disk IO; P Any of the subtasks k The resource requirements of each subtask are: , In the above formula, Respectively k The application requirements of each subtask on CPU, memory, network bandwidth, and disk IO, and any k The resource requirements of each subtask meet: , In the above formula, P To be assigned tasks T j The number of subtasks, No. k The number of basic task units executed by each subtask, , They are the CPU, memory, network bandwidth, and disk IO requirements of a task unit. Is a positive integer.
3. The method for high availability scheduling of cross-cluster resources in a cloud computing environment according to claim 2, characterized in that: The target member cluster C i The calculation function expression of the remaining amount of CPU, memory, network bandwidth, and disk IO resources after allocating subtasks is: , In the above formula, , , , The target member clusters C i The total amount of CPU, memory, network bandwidth, and disk IO resources in the , , , The target member clusters C i The amount of allocated resources in CPU, memory, network bandwidth, and disk IO resources; Respectively k The application requirements of each subtask regarding CPU, memory, network bandwidth, and disk IO.
4. The method for high availability scheduling of cross-cluster resources in a cloud computing environment according to claim 1, characterized in that: Step 2) Scoring of cooperative game The calculation function expression is: , In the above formula, P To be assigned tasks T j The number of subtasks, For any i Target member cluster C i The cluster resource high availability evaluation function value.
5. The method for high availability scheduling of cross-cluster resources in a cloud computing environment according to claim 1, characterized in that: In step 4), the highest cooperative game score is calculated. When the number of basic task units executed by each subtask corresponding to the corresponding subtask allocation scheme is ,in ~ They are No. 1~ P The number of basic task units executed by each subtask.
6. A high-availability scheduling method for cross-cluster resources in a cloud computing environment, characterized in that: include: S1) Receive tasks submitted by users, create task resource application requirements, and generate resource objects; S2) Select the task to be assigned from all tasks T j ; Determine the tasks to be assigned T j Whether there is a matching propagation scheduling strategy for the resource object, the attributes of the propagation scheduling strategy include the type and name of the resource object, and the target member cluster attributes of the resource object; if a propagation scheduling strategy matching the resource object type and name is found, directly jump to step S4); if no matching propagation scheduling strategy is found, proceed to the next step S3); S3) Wait for the creation of a new propagation scheduling strategy. If a new propagation scheduling strategy is detected, determine whether the new propagation scheduling strategy is consistent with the task to be assigned. T j If the resource matches, jump to step S4), otherwise re-execute step S3) to continue waiting for the creation of a new propagation scheduling strategy; S4) The tasks to be assigned T j The resource object and the matching propagation scheduling strategy are bound to generate tasks to be assigned T j The resource binding object; S5) Filter out candidate member clusters from all member clusters, score and sort the candidate member clusters, and if there is a task to be assigned, T j If the resource binding object does not specify the number of target member clusters, all candidate member clusters are directly used as target member clusters; Otherwise, follow the tasks to be assigned T j The resource binding object specifies the number of target member clusters, and selects the required candidate member clusters as the target member clusters according to the scoring order among the candidate member clusters; S6) Determine the tasks to be assigned T j Task scheduling type: If the task scheduling type is the copy operation mode, the task to be assigned will be directly T j Distribute to all target member clusters so that all target member clusters execute the tasks to be assigned T j , jump to step S8); If the task scheduling type is subtask allocation, jump to the next step; S7) Determine the sub-type of sub-task allocation method: If the subtype is aggregation, the maximum number of replicas that can be accommodated for each target member cluster is calculated respectively. The maximum number of replicas that can be accommodated refers to the number of task units that the target member cluster can still support running, and tasks are preferentially allocated to target member clusters with a larger maximum number of replicas to reduce the number of target member clusters distributed; If the subtype is static weight mode, the tasks to be assigned are sorted according to the preset weight of the target member cluster. T j Divide the number of task units into each target member cluster according to the weight; If the subtype is a dynamic weight method, the cross-cluster resource high availability scheduling method in a cloud computing environment according to any one of claims 1 to 5 is used to obtain the task T to be assigned. j of P The dynamic weight of each subtask in each target member cluster will be assigned to the task T j Divide the number of task units into each target member cluster according to the dynamic weight; Jump to step S8); S8) Generate a subtask object according to the resource binding object; S9) Send the subtask object to the corresponding target member cluster and deploy and run the subtask.
7. A high-availability scheduling system for cross-cluster resources in a cloud computing environment, comprising interconnected microprocessors and memories, characterized in that: The microprocessor is programmed or configured to execute the steps of the method for high-availability scheduling of cross-cluster resources in a cloud computing environment as described in any one of claims 1 to 6.
8. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and the computer program is used to be executed by a microprocessor to implement the steps of the method for high-availability scheduling of cross-cluster resources in a cloud computing environment as described in any one of claims 1 to 6.
Citation Information
Patent Citations
Cross-cluster task scheduling method and device
CN107621973A
Multi-dimensional resource scheduling method in kubernetes cluster architecture system
WO2021208546A1