Container cluster and scheduling method and scheduling device thereof

Through the simulation annealing algorithm, the calculation chain is planned for the task chain, and the problem of difficult real-time and non-real-time hybrid scheduling and multi-task global optimization in the existing technology is solved, and the overall running time of the container cluster and the task chain are optimized. Efficient scheduling.

CN118885296APending Publication Date: 2024-11-01KYLAND TECH CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202411007244.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-25
Publication Date
2024-11-01

AI Technical Summary

Technical Problem

Existing container scheduling systems are difficult to achieve dynamic hybrid scheduling of real-time and non-real-time containers, and it is difficult to optimize the run time of multiple tasks globally.

Method used

By obtaining the resource requirements of the computing task, using a simulated annealing algorithm to plan the computing chain for the task chain, scheduling each container to optimize the overall running time, and avoiding ignoring the resource requirements of other tasks when scheduling a single task.

Benefits of technology

It realizes dynamic hybrid scheduling of containers with different real-time properties and the overall running time of the task chain, improving the real-time and scheduling efficiency of computing tasks.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118885296A_ABST
    Figure CN118885296A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a container cluster and a scheduling method and device thereof, and the method comprises the steps: obtaining all calculation tasks which reach the cluster in a current scheduling period, and arranging the calculation tasks into a task chain; according to the resource requirements of the calculation tasks, a preset planning algorithm is called with the total operation time of the task chain as an optimization target, a calculation chain is planned for the task chain, and the calculation chain comprises a container for executing each calculation task; and scheduling the calculation chain to execute each calculation task. According to the technical scheme provided by the embodiment of the invention, the container scheduling is carried out by taking the overall operation time of the calculation task in the task chain as an optimization target according to the resource demand of the calculation task, so that the dynamic mixed scheduling of the containers with different real-time performance is realized, and the overall operation time of the whole task chain is globally optimal.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of operating systems, and in particular to a container cluster and a scheduling method and a scheduling device thereof. Background Art

[0002] Currently, both open source and closed source container scheduling frameworks on the market find it difficult to dynamically mix and schedule real-time and non-real-time container applications based on specific task requirements and the actual execution environment. When multiple tasks are mixed and scheduled into various containers, it is even more difficult to globally optimize the running time of multiple tasks.

[0003] The existing scheduling system needs to be improved in terms of flexibility and scheduling effect in order to better adapt to flexible computing needs and multi-tasking environmental conditions. Summary of the invention

[0004] In view of this, an embodiment of the present application provides a container cluster and its scheduling method and scheduling device, which realizes dynamic mixed scheduling of containers with different real-time characteristics by overall scheduling of computing tasks in the task chain according to the resource requirements of computing tasks and actual idle containers, and realizes optimization of the overall running time of all computing tasks in the entire task chain.

[0005] In the first aspect, an embodiment of the present application provides a container cluster scheduling method, including: obtaining each computing task that arrives at the cluster within the current scheduling cycle and arranging them into a task chain; according to the resource requirements of each computing task, taking the overall running time of the task chain as the optimization target, calling a preset planning algorithm to plan a computing chain for the task chain, wherein the computing chain includes a container for executing each computing task; scheduling each container in the computing chain to execute the corresponding computing task in the task chain. The technical solution of the embodiment of the present application is based on the resource requirements of the computing task, and by scheduling containers with the overall running time of the computing tasks in the task chain as the optimization target, it not only realizes the dynamic mixed scheduling of containers with different real-time characteristics, but also realizes the global optimality of the overall running time of the entire task chain.

[0006] As described above, according to the resource requirements of the computing tasks, by scheduling containers with the overall running time of the computing tasks in the task chain as the optimization goal, not only the dynamic mixed scheduling of containers with different real-time performance is achieved, but also the problem of not considering the resource requirements of other computing tasks when scheduling a single computing task is avoided, thus achieving the optimal overall running time of the entire task chain.

[0007] In a possible implementation of the first aspect, the planning algorithm is a simulated annealing algorithm, and an evaluation function value of the simulated annealing algorithm is obtained according to a satisfaction rate of resources of each container in the computing chain for resource requirements of a corresponding computing task.

[0008] From the above, it can be seen that the simulated annealing algorithm is optimal in the overall scheduling of computing tasks in the entire task chain compared to the algorithm that schedules each computing task separately.

[0009] In a possible implementation of the first aspect, when a computing task in the task chain comes from within the cluster, when planning the computing chain for the task chain, a corresponding container is scheduled for the computing task within a set of idle containers whose communication time with the container generating the computing task is less than a set time length.

[0010] As described above, the internal computing tasks are scheduled in a container set with a set communication duration, thereby further improving the real-time performance of the computing tasks in the entire task chain.

[0011] In a possible implementation of the first aspect, the computing tasks are arranged into a task chain, including: when the computing tasks have no serial connection relationship in computing content, the computing tasks are arranged into the task chain in order of arrival time; when the computing tasks have a serial connection relationship in computing content, the computing tasks are arranged into the task chain in order of arrival serial connection relationship.

[0012] From the above, by connecting the computing tasks in series into a task chain, the scheduling of the computing tasks in the task chain is realized while optimizing the scheduling of the task chain as a whole, thus meeting the requirements of the computing task chaining.

[0013] In a possible implementation manner of the first aspect, a container cluster scheduling method further includes: before planning the computing chain for the task chain, obtaining a resource requirement of the computing task according to computing content of the computing task.

[0014] From the above, by converting the computing content of the computing task into its resource requirements, container scheduling based on its resource requirements can be achieved.

[0015] In a possible implementation manner of the first aspect, the container cluster is a Kubernetes-based container cluster.

[0016] From the above, the overall scheduling of the task chain is realized in the Kubernetes-based container cluster to make full use of Kubernetes' container management capabilities and improve development efficiency.

[0017] In a possible implementation of the first aspect, a scheduling method for a container cluster further includes: after scheduling each container in the computing chain and before executing the corresponding computing task in the task chain, mirroring and synchronizing each container in the computing chain according to each computing task in the task chain.

[0018] As described above, the corresponding containers of the computing tasks in the computing chain are mirrored and synchronized, so that each container performs computing according to the content of the computing tasks.

[0019] In a possible implementation of the first aspect, the resource requirement of each computing task includes at least one of the following: processor computing power resource requirement, memory resource requirement, network bandwidth requirement, and PCIe bus bandwidth requirement.

[0020] From the above, at least one of the following resource requirements is considered for each computing task: processor computing power resource requirements, memory resource requirements, and communication bandwidth requirements, so as to achieve multi-dimensional scheduling.

[0021] In the second aspect, an embodiment of the present application provides a scheduling device for a container cluster, including: a task acquisition module, used to acquire each computing task that arrives at the cluster within the current scheduling cycle, and arrange them into a task chain, wherein the cluster includes several containers with different real-time characteristics; a link planning module, used to call a preset planning algorithm according to the resource requirements of each computing task and take the overall running time of the task chain as the optimization goal, to plan a computing chain for the task chain, wherein the computing chain includes a container for executing each computing task; a container scheduling module, used to schedule each container in the computing chain and execute the corresponding computing tasks in the task chain.

[0022] As described above, according to the resource requirements of the computing tasks and the actual idle containers, the overall running time of all computing tasks in the task chain is taken as the optimization goal. Through link planning, corresponding real-time containers are scheduled for each computing task in the task chain. This not only realizes the dynamic mixed scheduling of containers with different real-time characteristics, but also avoids the problem of ignoring the resource requirements of other computing tasks for a single computing task, and realizes the optimization of the overall running time of the computing tasks in the entire task chain.

[0023] In a possible implementation of the second aspect, the planning algorithm is a simulated annealing algorithm, and an evaluation function value of the simulated annealing algorithm is obtained according to a satisfaction rate of resources of each container in the computing chain for resource requirements of a corresponding computing task.

[0024] From the above, it can be seen that the simulated annealing algorithm is optimal in the overall scheduling of computing tasks in the entire task chain compared to the algorithm that schedules each computing task separately.

[0025] In a possible implementation of the second aspect, when a computing task in the task chain comes from within the cluster, when the task scheduling module plans the computing chain for the task chain, a corresponding container is scheduled for the computing task within a set of idle containers whose communication time with the container that generates the computing task is less than a set time length.

[0026] As described above, the internal computing tasks are scheduled in a container set with a set communication duration, thereby further improving the real-time performance of the computing tasks in the entire task chain.

[0027] In a possible implementation of the second aspect, when the task acquisition module arranges the computing tasks into a task chain, it is specifically used to, when the computing tasks have no serial relationship in computing content, arrange the computing tasks into the task chain in the order of arrival time; when the computing tasks have a serial relationship in computing content, arrange the computing tasks into the task chain in the order of arrival serial relationship.

[0028] From the above, by connecting the computing tasks in series into a task chain, the scheduling of the computing tasks in the task chain is realized while optimizing the scheduling of the task chain as a whole, thus meeting the requirements of the computing task chaining.

[0029] In a possible implementation of the second aspect, the task acquisition module is further configured to obtain resource requirements of the computing task according to computing content of the computing task.

[0030] From the above, by converting the computing content of the computing task into its resource requirements, container scheduling based on its resource requirements can be achieved.

[0031] In a possible implementation of the second aspect, the container cluster is a Kubernetes-based container cluster.

[0032] From the above, the overall scheduling of the task chain is realized in the Kubernetes-based container cluster to make full use of Kubernetes' container management capabilities and improve development efficiency.

[0033] In a possible implementation of the second aspect, the container scheduling module is further used to perform mirror synchronization on each container of the computing chain according to each computing task in the task chain.

[0034] As described above, the corresponding containers of the computing tasks in the computing chain are mirrored and synchronized, so that each container performs computing according to the content of the computing tasks.

[0035] In a possible implementation of the second aspect, the resource requirement of each computing task includes at least one of the following: processor computing power resource requirement, memory resource requirement, and communication bandwidth requirement.

[0036] From the above, at least one of the following resource requirements is considered for each computing task: processor computing power resource requirements, memory resource requirements, and communication bandwidth requirements, so as to achieve multi-dimensional scheduling.

[0037] In a third aspect, an embodiment of the present application provides a container cluster, comprising: a scheduling device as described in any implementation manner of the second aspect, wherein the scheduling device is located in a central cloud of the cluster, and the containers of the cluster are distributed on computing nodes connected to the central cloud via a network. BRIEF DESCRIPTION OF THE DRAWINGS

[0038] Figure 1 This is a flow chart of a first embodiment of a method for scheduling a container cluster of the present application;

[0039] Figure 2 This is a flow chart of a second embodiment of a method for scheduling a container cluster of the present application;

[0040] Figure 3 This is a flow chart of internal task scheduling in Embodiment 2 of a scheduling method for a container cluster of the present application;

[0041] Figure 4 This is a flow chart of external task scheduling in Embodiment 2 of a method for scheduling a container cluster of the present application;

[0042] Figure 5 This is a structural diagram of a first embodiment of a scheduling device for a container cluster of the present application;

[0043] Figure 6 This is a structural diagram of a second embodiment of a scheduling device for a container cluster of the present application. DETAILED DESCRIPTION

[0044] In the following description, reference is made to “some embodiments”, which describe a subset of all possible embodiments, but it will be understood that “some embodiments” may be the same subset or different subsets of all possible embodiments and may be combined with each other without conflict.

[0045] In the following description, the terms "first\second\third, etc." or module A, module B, module C, etc. are only used to distinguish similar objects, or to distinguish different embodiments, and do not represent a specific ordering of the objects. It can be understood that the specific order or sequence can be interchanged where permitted, so that the embodiments of the present application described here can be implemented in an order other than that illustrated or described here.

[0046] In the following description, the numbers representing the steps, such as S110, S120, etc., do not necessarily mean that the steps must be executed in this manner. If permitted, the order of the previous and next steps can be interchanged, or the steps can be executed simultaneously.

[0047] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which this application belongs. The terms used herein are only for the purpose of describing the embodiments of this application and are not intended to limit this application.

[0048] An embodiment of the present application provides a container cluster and a scheduling method and a scheduling device, the method comprising: obtaining each computing task that arrives at the cluster within a current scheduling cycle and arranging them into a task chain; based on the resource requirements of each computing task, taking the overall running time of the task chain as the optimization goal, calling a preset planning algorithm to plan a computing chain for the task chain, the computing chain comprising a container for executing each computing task; scheduling each container in the computing chain and executing the corresponding computing tasks in the task chain.

[0049] The technical solution of the embodiment of the present application performs container scheduling based on the resource requirements of the computing tasks by taking the overall running time of the computing tasks in the task chain as the optimization target. This not only realizes the dynamic mixed scheduling of containers with different real-time performance, but also avoids the problem of not considering the resource requirements of other computing tasks when scheduling a single computing task, thereby achieving the optimal overall running time of the entire task chain. The embodiments of the present application are introduced below in conjunction with the accompanying drawings.

[0050] Let's combine Figure 1 A first embodiment of a scheduling method for a container cluster is introduced.

[0051] A method for scheduling a container cluster Embodiment 1 is run in a management node of a container cluster, and the management node of the container cluster schedules containers for received tasks within a scheduling cycle.

[0052] Figure 1 The flowchart of Embodiment 1 of a method for scheduling a container cluster is shown, including steps S110 to S130.

[0053] S110: Obtain computing tasks that arrive at the cluster in the current scheduling period, and arrange them into a task chain.

[0054] The computing tasks in the task chain are arranged in sequence, so that the computing tasks can be scheduled in sequence when the computing chain is subsequently planned for the task chain.

[0055] The container cluster includes several containers with different real-time requirements. Each real-time container has different resources and different time to complete the corresponding calculation. The container with less strict real-time requirement is a non-real-time container, and the container with strict real-time requirement is a real-time container.

[0056] Among them, when the computing tasks have no serial connection in terms of computing content, the computing tasks are arranged as a task chain in the order of arrival time; when the computing tasks have a serial connection in terms of computing content, the computing tasks are arranged as a task chain in the order of arrival serial connection; when a computing task needs to use the output data of another computing task as input, the two computing tasks are in a serial connection.

[0057] In some embodiments, the container cluster is a Kubernetes-based container cluster, in which the control node (master node) of the central cloud executes the process of this embodiment, and the containers in the cluster are located on the computing nodes.

[0058] S120: According to the resource requirements of each computing task, taking the overall running time of the task chain as the optimization target, calling a preset planning algorithm, and planning a computing chain for the task chain.

[0059] The computing chain includes an idle container planned for each computing task in the task chain, and the idle container meets the resource requirements of the computing task. The position order of each planned container in the computing chain is the same as the computing task corresponding to the container in the task chain.

[0060] Among them, the overall running time of the task chain is taken as the optimization goal, that is, the task chain is scheduled as a whole, and the duration of realizing the entire task chain is considered as a whole. The scheduling result obtained by the preset algorithm makes the time for the computing chain to realize the task chain better than the sum of the time for realizing the corresponding calculation of the container scheduled separately for each calculation, and the container scheduled for each computing task meets the resource requirements of the computing task.

[0061] The preset planning algorithm includes but is not limited to one of the following algorithms: simulated annealing algorithm, genetic algorithm, particle swarm algorithm or ant colony algorithm. Various planning algorithms are essentially optimal solution algorithms for combinatorial problems. Regardless of the algorithm, the overall scheduling effect is better than the traditional greedy algorithm (scheduling containers separately for each computing task). The simulated annealing algorithm is one of the preferred algorithms, and the overall planning effect is the best.

[0062] In some embodiments, the evaluation function value of the simulated annealing algorithm includes at least obtaining the evaluation function value according to the satisfaction rate of the resources of each container in the computing chain to the resource requirements of the corresponding computing task, and the higher the satisfaction rate of the resource requirements of a computing task, the shorter its execution time. There is no limitation on the method of obtaining the evaluation function value of the simulated annealing algorithm according to the satisfaction rate of the resources of each container in the computing chain to the resource requirements of the corresponding computing task. In short, the higher the satisfaction rate of the resources of each container in the computing chain to the resource requirements of the corresponding computing task, the greater the evaluation function value.

[0063] Specifically, at each iteration of the simulated annealing algorithm, an idle container whose resources meet the resource requirements of the computing task is randomly selected for each computing task in the task chain, and the evaluation function value of the simulated annealing algorithm of this iteration is calculated. When the function value is better than the evaluation function value of the previous iteration, this iteration is accepted, otherwise this iteration is accepted with a certain probability, and the lower the annealing temperature, the smaller the probability; then the annealing temperature is lowered to continue the iteration until the termination condition is met (after a set number of iterations or reaching the annealing temperature threshold), and the iteration result that meets the termination condition is the final planned computing chain.

[0064] Among them, each iteration of the simulated annealing algorithm randomly selects a container whose resources meet the resource requirements of the time task for a computing task in the task chain, thereby avoiding the situation in which only the resource satisfaction rate of each computing task is considered in the greedy algorithm, preferably without considering other computing tasks, resulting in only achieving the optimal running time of a single computing task under the conditions of each iteration, and failing to achieve the global optimal.

[0065] In some embodiments, the resource requirements of the computing task are multi-dimensional requirements, including at least one of the following: processor computing power resource requirements, memory resource requirements, network bandwidth requirements, PCIe bus bandwidth requirements, etc. The processor includes at least one of the following: CPU, GPU, NPU.

[0066] In some embodiments, when a computing task in a task chain comes from within the cluster, when planning a computing chain for the task chain, a corresponding container is scheduled for the computing task within a set of idle containers whose communication time with the container that generates the computing task is less than a set time length, so that the computing task runs in a container that can be connected.

[0067] In some embodiments, when a computing task in a task chain comes from outside the cluster, when planning a computing chain for the task chain, a corresponding container is scheduled for the computing task in a set of free containers.

[0068] In some embodiments, before planning a computing chain for a task chain, the resource requirements of the computing task are obtained according to the computing content of the computing task so as to perform scheduling according to the resource requirements.

[0069] In some embodiments, when a computing task in a task chain comes from a container within a cluster, the last task in the computing chain feeds back the computing result to the container after the computing is completed; when a computing task in a task chain comes from a container within a cluster, the last task in the computing chain feeds back the computing result to the management node of the cluster after the computing is completed.

[0070] S130: Schedule each container in the computing chain to execute the corresponding computing tasks in the task chain.

[0071] In some embodiments, after scheduling each container in the computing chain and before executing the corresponding computing tasks in the task chain, the containers in the computing chain are mirrored and synchronized according to the computing tasks in the task chain, so that containers in a position order in the computing chain are configured to complete computing tasks in the same position order in the task chain.

[0072] In summary, embodiment 1 of a scheduling method for a container cluster schedules containers according to the resource requirements of computing tasks by taking the overall running time of computing tasks in the task chain as the optimization target. This not only realizes the dynamic mixed scheduling of containers with different real-time characteristics, but also avoids the problem of not considering the resource requirements of other computing tasks when scheduling a single computing task, thereby achieving the optimal overall running time of the entire task chain. The following describes the various embodiments of the present application in conjunction with the accompanying drawings.

[0073] Combine the following Figures 2 to 4 A second embodiment of a scheduling method for a container cluster is introduced.

[0074] Embodiment 2 of a scheduling method for a container cluster is an implementation of embodiment 1 of a scheduling method for a container cluster on Kubernetes, and has all the advantages of embodiment 1 of a scheduling method for a container cluster, and furthermore, it schedules idle containers for each computing task through a simulated annealing algorithm, thereby achieving better optimization of the overall running time of computing tasks in the entire task chain.

[0075] A method for scheduling a container cluster Embodiment 2 defines a computing task CM, a distributed operation module DOM, a distributed computing module DCM, a logical computing group LCG and a logical computing chain LCC on Kubernetes.

[0076] Among them, a computing task CM (computer task) is defined on the control node of the kubernetes central cloud to store computing tasks received from inside or outside the cluster.

[0077] Among them, a distributed operation module DOM (distributed operator module) is defined on the control node of the kubernetes central cloud, and the distributed operation module DOM is used for scheduling and container image management.

[0078] Among them, a distributed computing module DCM (distributed computing module) is defined on each computing node of Kubernetes. Each DCM is a container, and its physical bottom layer includes several physical resources. The real-time performance of the container is different according to its physical resources. For example, the physical resources include processor computing power resources, memory resources, network bandwidth resources and PCIe bandwidth resources. The processor can be a combination of CPU, GPU and NPU, and its operating system can be a Linux system.

[0079] Among them, a logical computing group LCG (logic computing group) is defined on the control node of the central cloud of Kubernetes to store a collection of DCMs.

[0080] Among them, a logical computing chain LCC (logic computing chan) (corresponding to the computing chain in the first embodiment of a scheduling method for a container cluster) is defined on the control node of the central cloud of Kubernetes, and is used to store the computing chain of the task chain scheduling.

[0081] Figure 2 The flowchart of Embodiment 2 of a method for scheduling a container cluster is shown, including steps S210 to S270.

[0082] S210: The kubernetes control node receives computing tasks initiated from within or outside the cluster and arranges them into a task chain.

[0083] Among them, the computing tasks in the task chain are arranged sequentially. When the computing tasks have no series connection relationship in the computing content, the computing tasks are arranged into a task chain in the order of arrival time; when the computing tasks have a series connection relationship in the computing content, the computing tasks are arranged into a task chain in the order of arrival series connection; when a computing task needs to use the output data of another computing task as input, the two computing tasks are in a series connection relationship.

[0084] S220: Check the status of each DCM in the cluster and the computational content that can be achieved by each DCM through DOM.

[0085] The status of the DCM includes whether each DCM is available, that is, whether each corresponding container is idle; each DCM implements different computing content according to its different physical resources.

[0086] The DCM of the specific computing task CM is determined based on the query result. The resource requirement of each computing task CM is obtained based on its computing content. The method of obtaining is not limited. For example, it includes a configuration method or a table lookup method. The resource requirement is a multi-dimensional requirement, including at least one of the following: processor computing power resource requirement, memory resource requirement, network bandwidth requirement, PCIe bus bandwidth requirement, etc.

[0087] S230: Determine whether the computing task in the task chain comes from inside or outside Kubernetes.

[0088] When the computing tasks in the task chain come from outside Kubernetes, step S240 is executed; when the computing tasks in the task chain come from the internal DCM of Kubernetes, steps S250 to S260 are executed.

[0089] S240: Perform link planning of the logical computing chain LCC in the idle and available DCM clusters on each computing node in the cluster by using a simulated annealing algorithm.

[0090] Among them, the logical computing chain LCC includes several DCMs, that is, several containers. A DCM in a position order in the logical computing chain LCC is used to run computing tasks with the same position order in the task chain, and the resources of the DCM meet the resource requirements of the computing tasks. The time taken by the logical computing chain LCC to implement the task chain is better than the sum of the time taken by the DCMs scheduled separately for each computing task to implement the corresponding calculations.

[0091] The evaluation function value of the simulated annealing algorithm is obtained according to the satisfaction rate of the resources of each DCM in the currently selected computing chain with the resource requirements of the corresponding computing task CM. For example, the evaluation function value of the simulated annealing algorithm is obtained by performing algorithmic averaging or weighted averaging on the evaluation function value of the satisfaction rate of the resources of each DCM with the resource requirements of the corresponding computing task CM, wherein the weighted factor increases with the importance of the computing task; or to prevent the large number from eating the small number, the square root or the logarithm of the satisfaction rate of the resources of each DCM with the resource requirements of the corresponding computing task CM is taken, and the evaluation function value of the simulated annealing algorithm is obtained by performing algorithmic averaging or weighted averaging; or other methods.

[0092] Among them, at each iteration of the simulated annealing algorithm, the evaluation function value of the simulated annealing algorithm in this iteration is calculated. When the evaluation function value is better than the evaluation function value of the previous iteration, this iteration is accepted, otherwise this iteration is accepted with a certain probability, and the result of the previous iteration is replaced by the result of this iteration. The probability is obtained according to the annealing temperature. The lower the annealing temperature, the smaller the probability; then the annealing temperature is lowered and the iteration is continued until the final termination condition is reached (after a set number of iterations or reaching the annealing temperature threshold), and the iteration result that reaches the final termination condition is the final planned calculation chain.

[0093] Among them, in each iteration of the simulated annealing algorithm, a DCM is first randomly selected from the DCMs in the DCM cluster that meet the resource requirements of the first computing task in the task chain; after the corresponding DCM of the current computing task CM in the task chain is selected, when selecting a DCM for the next computing task DM in the task chain, priority is broadcasted from the DCM to the DCM that meets the resource requirements of the next task, and a DCM is randomly selected from the available DCMs that are fed back from these DCMs; until a DCM is selected for all computing tasks CM in the task chain in this iteration, then the evaluation function value of the simulated annealing algorithm of this iteration is calculated, and a judgment is made whether to accept this iteration.

[0094] S250: Obtain idle DCMs in the kubernetes cluster whose communication duration with the DCM that initiates the task is less than the set duration, and form a logical computing group LCG.

[0095] Among them, the DCMs in the kubernetes cluster whose communication time with the DCM that initiates the task is less than the set time and are idle form a logical computing group LCG. The logical computing chain is planned in this logical computing group LCG, and the overall computing time is shorter and the real-time performance is better.

[0096] S260: Perform link planning of the logic computing chain LCC in the planned LCG by using a simulated annealing algorithm.

[0097] The principle and advantages of the simulated annealing algorithm are the same as those of step S240, except that the DCM is selected by iterating the simulated annealing algorithm within the planned LCG, rather than iterating within the entire container cluster in step S240.

[0098] S270: The distributed operation module DOM schedules each DCM in the logical computing chain LCC and performs mirror synchronization so that each DCM can complete the computing content of the corresponding computing task.

[0099] Figure 3 The flowchart of Embodiment 2 of a method for scheduling a container cluster when the computing task in the task chain is from within Kubernetes is shown, which includes:

[0100] 1. Initiate a computing task.

[0101] Among them, each computing task constitutes a task chain. For example, the computing task is generated from a container running RTOS (Real Time Operation System) and controls the PC IE device through the PCI E bus.

[0102] 2. Create a logical calculation group

[0103] For example, the logical computing group created by the DOM of the central cloud includes 7 DCMs ( Figure 3 The DCM has 7 sub-boxes in the box of the logical computing group, the operating system is Linux (or other operating systems), the processors of the three DCMs only include one RAM industrial processor (or other industrial processors), and the processors of the four DCMs include one RAM industrial processor and one NPU respectively. In some examples, the DCM also includes a GPU processor, etc.

[0104] 3. Plan the logical calculation chain.

[0105] In the logic computing group LCG, the logic computing chain LCC is planned by means of a simulated annealing algorithm.

[0106] For example, there are three computing tasks in the computing chain, and the DCM is selected in three steps in each iteration of the simulated annealing algorithm. The DCM in the solid part is the DCM selected in each step. After multiple rounds of iterative planning, the computing chain LCG achieves the optimal running time of the task chain.

[0107] 4. Logical computing chain mirror synchronization.

[0108] Among them, DOM schedules each DCM in LCG and mirrors and synchronizes the scheduled DCM so that it can be used to complete the corresponding computing tasks.

[0109] 5. Notify and execute.

[0110] Among them, after the last DCM in the logical computing chain LCC is scheduled, it notifies the first DCM to start execution. Each DCM executes in turn and feeds back the execution result to the next DCM. The last DCM also feeds back the calculation result to the RTOS.

[0111] Figure 4 The flowchart of Embodiment 2 of a method for scheduling a container cluster when the computing task in the task chain comes from outside Kubernetes is shown, which includes:

[0112] 1. Initiate a computing task.

[0113] Among them, computing tasks are generated from external systems, and each computing task constitutes a task chain.

[0114] 2. Plan the logical calculation chain.

[0115] The idle DCMs that meet the requirements of each computing task in the task chain are the computing clusters, and the logical computing chains LCC are planned in the clusters by using the simulated annealing algorithm.

[0116] For example, the computing cluster includes 7 DCMs ( Figure 4The computing cluster has 7 sub-boxes in the box), the operating system is Linux (or other operating systems), the processors of the three DCMs only include one RAM industrial processor (or other industrial processors), and the processors of the four DCMs include one RAM industrial processor and one NPU respectively. In some examples, the DCM also includes a GPU processor, etc.

[0117] For example, there are three tasks in the computation chain. DCM is selected in three steps in each iteration of the simulated annealing algorithm. The DCM in the solid part is the DCM selected in each step. After multiple rounds of iterative planning, the computation chain LCG achieves the optimal running time of the task chain.

[0118] 3. Logical computing chain mirror synchronization.

[0119] The DOM schedules each DCM in the LCG and performs mirror synchronization on the scheduled DCM so that it can be used to complete the corresponding computing tasks. 4. Notify execution.

[0120] Among them, after the last DCM in the logical computing chain LCC is scheduled, it notifies the first DCM to start execution, and each DCM executes in turn and feeds back the execution result to the next DCM. The last DCM also feeds back the calculation result to the DOM.

[0121] In summary, Embodiment 2 of a method for scheduling a container cluster schedules idle containers for each computing task through a simulated annealing algorithm, thereby achieving better optimization of the overall running time of computing tasks in the entire task chain.

[0122] Combine the following Figure 5 A first embodiment of a scheduling device for a container cluster is introduced.

[0123] Embodiment 1 of a scheduling device for a container cluster The scheduling device is located at a management node of a container cluster and is used to run a scheduling method for a container cluster. Embodiment 1 The method has all the advantages thereof.

[0124] Figure 5 The structure of a first embodiment of a scheduling device for a container cluster is shown, including: a task acquisition module 510 , a link planning module 520 and a container scheduling module 530 .

[0125] The task acquisition module 510 is used to acquire computing tasks that arrive at the cluster in the current scheduling period and arrange them into a task chain. For its working principle and advantages, please refer to step S110 of the first embodiment of a scheduling method for a container cluster.

[0126] The link planning module 520 is used to plan a computing chain for the task chain based on the resource requirements of each computing task and the overall running time of the task chain as the optimization target, and to call a preset planning algorithm. For its working principle and advantages, please refer to step S120 of the first embodiment of a scheduling method for a container cluster.

[0127] The container scheduling module 530 is used to schedule each container in the computing chain and execute the corresponding computing tasks in the task chain. For its working principle and advantages, please refer to step S130 of the first embodiment of a scheduling method for a container cluster.

[0128] Combine the following Figure 6 A second embodiment of a scheduling device for a container cluster is introduced.

[0129] Embodiment 2 of a scheduling device for a container cluster The scheduling device is located at a management node of a kubernetes container cluster and is used to run a scheduling method for a container cluster. The method described in Embodiment 2 has all its advantages.

[0130] Figure 6 The structure of a second embodiment of a scheduling device for a container cluster is shown, including: a task acquisition module 610 , a DCM query module 620 , a task judgment module 630 , a link planning module 640 , and a container scheduling module 650 .

[0131] The task acquisition module 610 is used for the control node of Kubernetes to receive computing tasks initiated from within or outside the cluster and arrange them into task chains. For its working principle and advantages, please refer to step S210 of the second embodiment of a scheduling method for a container cluster.

[0132] The DCM query module 620 checks the status of each DCM in the cluster and the computational content that each DCM can implement through the DOM. For its working principle and advantages, please refer to step S220 of the second embodiment of a scheduling method for a container cluster.

[0133] The task judgment module 630 is used to judge whether the computing task in the task chain is from inside or outside Kubernetes. For its working principle and advantages, please refer to step S230 of the second embodiment of a scheduling method for a container cluster.

[0134] The link planning module 640 is used to plan the links of the logical computing chain LCC in the idle and available DCM clusters on each computing node in the cluster by using the simulated annealing algorithm when the computing task comes from outside Kubernetes; it is also used to obtain the idle DCMs in the Kubernetes cluster whose communication time with the DCM that initiates the task is less than the set time when the computing task comes from inside Kubernetes, to form a logical computing group LCG, and to plan the links of the logical computing chain LCC in the planned LCG by using the simulated annealing algorithm. For its working principle and advantages, please refer to steps S240, S250 and S260 of the second embodiment of a scheduling method for a container cluster.

[0135] The container scheduling module 650 is used by the distributed operation module DOM to schedule each DCM in the planned logical computing chain LCC and synchronize the mirroring so that each DCM can complete the calculation content of the corresponding computing task. For its working principle and advantages, please refer to step S270 of the second embodiment of a scheduling method for a container cluster.

[0136] An embodiment of the present application also provides a container cluster, the management node of which includes a scheduling device described in Embodiment 1 of a scheduling device for a container cluster or Embodiment 2 of a scheduling device for a container cluster, to implement container scheduling based on a task chain as a whole, to schedule a computing chain composed of idle containers for the task chain, to implement dynamic mixed scheduling of various real-time containers, and to optimize the overall running time of computing tasks in the entire task chain.

[0137] Among them, the container cluster is a cloud-based distributed cluster, the scheduling device is on the central cloud of the container cluster, and the containers in the container cluster are distributed on computing nodes connected by a network. Some computing nodes are on the central cloud, and some computing nodes are on the edge cloud. Each computing node includes several containers with different real-time characteristics.

[0138] Note that the above are only preferred embodiments of the present application and the technical principles used. Those skilled in the art will understand that the present application is not limited to the specific embodiments described herein, and that various obvious changes, readjustments and substitutions can be made by those skilled in the art without departing from the scope of protection of the present application. Therefore, although the present application is described in more detail through the above embodiments, the present application is not limited to the above embodiments, and may also include more other equivalent embodiments without departing from the concept of the present application, all of which belong to the scope of protection of the present application.

Claims

1. A method for scheduling a container cluster, characterized in that: include: Obtaining computing tasks that arrive at the cluster in the current scheduling period and arranging them into a task chain; According to the resource requirements of each of the computing tasks, taking the overall running time of the task chain as the optimization target, calling a preset planning algorithm to plan a computing chain for the task chain, wherein the computing chain includes a container for executing each of the computing tasks; Schedule each container in the computing chain to execute the corresponding computing tasks in the task chain.

2. The method according to claim 1, characterized in that: The planning algorithm is a simulated annealing algorithm, wherein the evaluation function value of the simulated annealing algorithm is obtained according to the satisfaction rate of the resources of each container in the computing chain to the resource requirements of the corresponding computing task.

3. The method according to claim 1, characterized in that: When a computing task in the task chain comes from within the cluster, when planning the computing chain for the task chain, a corresponding container is scheduled for the computing task within a set of idle containers whose communication time with the container generating the computing task is less than a set time length.

4. The method according to claim 1, characterized in that: Arranging the computing tasks into a task chain includes: When the computing tasks have no serial connection in terms of computing content, the computing tasks are arranged into the task chain in the order of arrival time; When the computing tasks have a serial connection relationship in terms of computing content, the computing tasks are arranged into the task chain according to the serial connection relationship.

5. The method according to claim 1, characterized in that: Also includes: Before planning the computing chain for the task chain, the resource requirement of the computing task is obtained according to the computing content of the computing task.

6. The method according to claim 1, characterized in that: The container cluster is a Kubernetes-based container cluster.

7. The method according to claim 1, characterized in that: Also includes: After scheduling each container in the computing chain and before executing the corresponding computing task in the task chain, mirror synchronization is performed on each container in the computing chain according to each computing task in the task chain.

8. The method according to claim 2, characterized in that: The resource requirements of each computing task include at least one of the following: processor computing power resource requirements, memory resource requirements, network bandwidth requirements, and PCIe bus bandwidth requirements.

9. A scheduling device for a container cluster, characterized in that: include: A task acquisition module, used to acquire computing tasks that arrive at the cluster in the current scheduling period and arrange them into a task chain; A link planning module, for planning a computing chain for the task chain based on the resource requirements of each computing task and taking the overall running time of the task chain as the optimization target, wherein the computing chain includes a container for executing each computing task; The container scheduling module is used to schedule each container in the computing chain to execute the corresponding computing tasks in the task chain.

10. A container cluster, characterized in that: include: The scheduling device as described in claim 9 is located in the central cloud of the cluster, and the containers of the cluster are distributed on computing nodes connected to the central cloud through a network.

Citation Information

Cited By

  • Resource virtualization and real-time scheduling method oriented to sensing, calculation and control integration

    CN120909777A