Microservice workflow scheduling method and device based on dynamic resource selection strategy

Through dynamic resource selection strategy, combined with sub-deadlines and scheduling priority, the problem of unbalanced resource utilization and high cost in microservice workflow scheduling is solved, and tasks are completed and cost optimization are achieved.

CN115033357BActive Publication Date: 2024-11-12NANJING UNIV OF POSTS & TELECOMM
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202210534598.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-05-17
Publication Date
2024-11-12
Estimated Expiration
2042-05-17

AI Technical Summary

Technical Problem

In the existing microservice workflow scheduling methods, resource selection strategies based on cost and vector similarity lead to a high total scheduling cost and the inability to effectively utilize resources, resulting in unbalanced resources in virtual machine instances, increasing costs.

Method used

Adopt dynamic resource selection strategy, preprocessing by obtaining workflow application information, calculate the sub-deadline and scheduling priority of the task, dynamically select appropriate virtual machine instances, and adjust parameters online during the scheduling process to ensure that the task is in the sub-deadline. Completed within the VM to reduce the unit price cost.

Benefits of technology

The task is completed within the sub-deadline period, which reduces the total scheduling cost, increases the scheduling success rate, and optimizes resource utilization through dynamic adjustment process, reducing the unit price cost of virtual machines.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115033357B_ABST
    Figure CN115033357B_ABST
Patent Text Reader

Abstract

The present invention discloses a microservice workflow scheduling method based on a dynamic resource selection strategy. The method comprises: preprocessing the microservice workflow to obtain the sub-deadline parameters and sorting priority of each task in the workflow; using the dynamic resource selection strategy to select the most suitable virtual machine instance for each microservice task, completing the scheduling of the microservice workflow by comprehensively considering the unit price and the number of virtual machine instances used, obtaining the optimal resources for task execution, and updating the task status and the resource vector of the virtual machine instance on this basis. The method solves the problem of excessively high scheduling cost caused by unreasonable resource selection strategies in the existing microservice workflow scheduling method.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to a microservice workflow scheduling method based on a dynamic resource selection strategy (DRSS), and belongs to the technical field of cloud computing and microservices. Background Art

[0002] In recent years, with the rise of the Internet boom, traditional monolithic architecture applications can no longer cope with the surge in user traffic, and application service providers have begun to adopt microservice architecture to deal with this problem. Nowadays, most commercial or scientific applications contain a large number of computing tasks, which are often represented in the form of workflows. After adopting the microservice architecture, using microservice workflows to represent a set of microservice tasks with a partial order relationship is also a common method used by application service providers to build application business processes.

[0003] For workflows, scheduling tasks in the workflow to execute on corresponding resources is always an indispensable step. Compared with tasks in traditional workflows, microservice tasks are much smaller and require much less computing resources. This means that if microservice tasks are assigned to virtual machine instances one-to-one according to the workflow scheduling scheme of traditional cloud platforms, a lot of resource waste and unnecessary costs will be caused. The emergence of lightweight virtual machine technology containers just solves this problem. Containers have the characteristics of lightweight, fast startup, good resource isolation and fast deployment, which are very suitable for the deployment of microservice tasks. Deploy microservice tasks to containers, and then deploy the containers with tasks to virtual machines, so that multiple microservice tasks can be executed on the same virtual machine instance, effectively utilizing the remaining resources.

[0004] The resource selection strategies in the existing microservice workflow scheduling methods are mainly cost-based strategies and vector similarity-based strategies. The cost-based selection strategy only considers the cost of each selected virtual machine, ignoring the fact that the heterogeneous resource requirements of tasks will lead to unbalanced remaining resources of virtual machine instances, resulting in frequent selection of new virtual machine instances during selection, causing cost increases. The vector similarity-based strategy completely ignores the cost factor. As the task allocation process proceeds, the number of remaining unallocated tasks decreases. The cost reduction brought about by the reduction in the number of virtual machines caused by continuing to allocate based on the vector similarity indicator is far less than the cost increase brought about by selecting high-priced virtual machine instances.

[0005] The above two strategies will lead to a high total cost of scheduling. Therefore, how to design an algorithm that can meet the user's deadline requirements and reduce the total cost of scheduling as much as possible is the focus of research. Summary of the invention

[0006] To solve the above problems, the present invention provides a microservice workflow scheduling method and device based on a dynamic resource selection strategy.

[0007] Technical solution: To solve the above technical problems, the technical solution adopted by the present invention is:

[0008] In a first aspect, a microservice workflow scheduling method includes:

[0009] (1) Obtain input workflow application information;

[0010] (2) Preprocess the workflow application information to obtain the sub-deadline and scheduling priority of each microservice task in the workflow, and put the ready tasks at this time into the ready queue according to the scheduling priority;

[0011] (3) Take the ready tasks out of the ready queue in turn, find available resource virtual machine instances for the tasks while ensuring resource requirements and task sub-deadlines, and store them in the available virtual machine instance set;

[0012] (4) Select a suitable virtual machine instance for the task from the available set of virtual machine instances through a dynamic resource selection strategy, and place the task on the virtual machine instance for execution to obtain the actual execution time of the task;

[0013] (5) In response to the completion of task allocation, the actual execution time of the task is used to replace the average execution time used in the preprocessing process, the parameters of the subsequent tasks of this task are updated through the online adjustment process, and the new ready tasks generated by the completion of this task are placed in the ready queue;

[0014] (6) In response to the ready queue being empty, the scheduling is completed and the entire scheduling plan is output.

[0015] In some embodiments, the preprocessing of the workflow application information includes:

[0016] (21) Convert the workflow application input by the user into a directed acyclic graph, and fill the average execution time of each task and the data transmission time between dependent tasks into the directed acyclic graph;

[0017] (22) Use the average execution time of the task instead of the actual execution time to calculate the earliest start time of each task;

[0018] (23) Calculate the task rank by the earliest start time of the task and the data transmission time between tasks, and calculate the sub-deadline of the task;

[0019] (24) Put the ready task into the ready queue, and calculate the scheduling priority of the ready task using the obtained sub-deadline parameter.

[0020] Furthermore, in some embodiments, converting the workflow application input by the user into a directed acyclic graph includes:

[0021] The workflow model can be represented by a directed acyclic graph DAG, where DAG = (T, E); T = {t1, t2, …, t n} is a set of nodes in a directed acyclic graph, each node represents a computing task; E is a set of edges in DAG, and the data dependencies between tasks are represented by the edges e of the corresponding nodes. ij To express, e ij ={t i ,t j} represents the task t i and task t j The dependency relationship between tasks, i.e. j Must be in task t i After completion, it can be executed. At this time, task t i It is called task t j The direct predecessor task of task t j It is called task t i The direct successor task; if there is data transmission between tasks, ij Add data i,j Attribute, indicating the amount of data that needs to be transferred between tasks; at this time, for task t i For i The set of direct predecessor tasks pred(t i ) is completed and all data is transmitted, t i All microservice tasks are given the computing resources required for the execution of the task in advance, using the demand resource vector Represented by , where m is the number of computing resource types.

[0022] In some embodiments, using the average execution time of the tasks instead of the actual execution time to calculate the earliest start time of each task includes:

[0023] The earliest start time of a task is defined as follows:

[0024]

[0025] Among them, EST(t i ) represents task t i The earliest start time, t entry represents the entry task in the directed acyclic graph, pred(ti ) indicates t i The direct predecessor task, ET(t k ,v l ) represents task t k In the virtual machine instance v l TT(t i ,t k ) to represent the task t i With the task k The data transmission time between two tasks is 0 if they are executed on the same virtual machine instance; otherwise, the data transmission time is the time taken by task t i With the task k The ratio of the amount of data that needs to be transmitted to the average bandwidth of the data center;

[0026] The average execution time AET of the task on all virtual machine instances is used i To replace ET(t k ,v l ) to perform initial calculations.

[0027] In some embodiments, calculating the rank of a task by the earliest start time of the task and the data transmission time between tasks, and calculating the sub-deadline of the task, includes:

[0028] Task i rank u (t i ) represents task t i To export task exit The length of the critical path between is defined as follows:

[0029]

[0030] Among them, ET(t i ,v l ) represents task t i In the virtual machine instance v l TT(t i ,t k ) to represent the task t i With the task k Data transmission time between i ) represents task t i The set of subsequent tasks; for the export task t exit , rank u (t exit )=0; through this value, recursively find the rank of each task; through the concept of rank, task t i Sub-deadline sd iis defined as:

[0031]

[0032] Where D refers to the deadline for user submission, ET(t i ,v l ) represents task t i In the virtual machine instance v l The execution time on entry Refers to the entry task in the directed acyclic graph.

[0033] In some embodiments, placing the ready task into the ready queue and calculating the scheduling priority of the ready task by using the obtained sub-deadline parameter includes:

[0034] The definition of a ready task is: when all the predecessor tasks of a task have been assigned to the virtual machine instance and executed, and all the data have been received, the task is considered a ready task; once a task becomes a ready task, it will be placed in the ready queue; calculate the scheduling urgency of each ready task in the ready queue

[0035]

[0036] Among them, u i The value indicates the scheduling urgency of the ready tasks in the ready queue, sd i Represents task t i Sub-deadline, EST(t i ) represents task t i The earliest start time, ET(t i ,v l ) represents task t i In the virtual machine instance v l The execution time on ut(t i ) represents task t i To export task exit The number of unscheduled tasks between .

[0037] In some embodiments, the step of finding an available resource virtual machine instance for the task while ensuring resource requirements and task sub-deadlines includes:

[0038] A suitable virtual machine instance must meet the following requirements: During the container lifecycle, the available idle resources of the virtual machine always meet the computing requirements of the task, and the task is completed before the sub-deadline; that is, it meets the following requirements:

[0039]

[0040]

[0041] EST(t cur )+ET(t cur ,v l )≤sd cur

[0042] in, Represents the total available resource vector of the virtual machine instance, represents the available resource vector of the virtual machine instance at time t, Represents the used resource vector of the virtual machine instance at time t, The resource requirement vector of the task to be assigned at time t, EST(t i ) represents task t i The earliest start time, ET(t i ,v l ) represents task t i In the virtual machine instance v l Execution time on sd i Represents task t i Sub-deadline, t cur Indicates the tasks that are being scheduled.

[0043] In some embodiments, the dynamic resource selection strategy includes:

[0044] The quality Q of a virtual machine instance is defined as follows:

[0045]

[0046] Where CS(i,l,t) refers to cosine similarity, which is defined as follows:

[0047]

[0048] Where m is the number of computing resource types; Represents the available resource vector of the virtual machine instance at time t The number of g-th resources in Represents the resource requirement vector of the task The quantity of the g-th resource; price l is the virtual machine instance v l Unit price, price max represents the unit price of the most expensive virtual machine in the resource pool; and θ is a weighting factor, calculated as follows:

[0049]

[0050] Where f represents the number of tasks that have been scheduled, n represents the total number of tasks in the directed acyclic graph, and the ratio of scheduled tasks to the total number of tasks represents the degree of completion of the entire scheduling.

[0051] In a second aspect, the present invention provides a microservice workflow scheduling device, including a processor and a storage medium;

[0052] The storage medium is used to store instructions;

[0053] The processor is used to operate according to the instructions to execute the steps of the method according to the first aspect.

[0054] In a third aspect, the present invention provides a storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the steps of the method described in the first aspect.

[0055] Compared with the prior art, the present invention has the following beneficial effects:

[0056] The algorithm constrains the execution time of tasks by adopting the method of sub-deadline division and reasonably sets the sub-deadline. This step can ensure that each task can be completed within its sub-deadline as much as possible, so that the entire workflow can be completed within the total deadline, ensuring the success rate of scheduling. Next, the ready tasks are prioritized, so that tasks that are more likely to exceed the sub-deadline can be allocated in a limited manner, reducing the situation where the completion time of tasks exceeds their sub-deadlines. In the resource search process, the available virtual machine instances are searched in the resource pool by limiting the sub-deadlines of resources and tasks, ensuring the availability of the selected virtual machine instances. In the task scheduling process, a dynamic resource allocation strategy is adopted. This strategy relies on weighted factors that change with the scheduling progress, which not only ensures the flexibility of subsequent task allocation in the early stage of scheduling, but also reduces the unit price cost of virtual machines in the later stage of scheduling, so that the final total cost can be greatly reduced. The final dynamic adjustment process ensures that the entire scheduling process can be carried out in an orderly manner. Four scientific workflows were used for experimental evaluation. The algorithm proposed in the present invention can obtain a higher scheduling success rate and a lower scheduling total cost compared with similar algorithms. BRIEF DESCRIPTION OF THE DRAWINGS

[0057] Figure 1 This is an example diagram of the workflow of an embodiment of the present invention;

[0058] Figure 2 Schematic diagram of four workflow structures in accordance with the present invention;

[0059] Figure 3 This is a flow chart of a microservice workflow scheduling method according to an embodiment of the present invention;

[0060] Figure 4 A comparison chart of scheduling success rates under different deadline factors in an embodiment of the present invention;

[0061] Figure 5This is a comparison chart of scheduling costs under different deadline factors in an embodiment of the present invention. DETAILED DESCRIPTION

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

[0063] A microservice workflow scheduling method, comprising:

[0064] (1) Obtain input workflow application information;

[0065] (2) Preprocess the workflow application information to obtain the sub-deadline and scheduling priority of each microservice task in the workflow, and put the ready tasks at this time into the ready queue according to the scheduling priority;

[0066] (3) Take the ready tasks out of the ready queue in turn, find available resource virtual machine instances for the tasks while ensuring resource requirements and task sub-deadlines, and store them in the available virtual machine instance set;

[0067] (4) Select a suitable virtual machine instance for the task from the available set of virtual machine instances through a dynamic resource selection strategy, and place the task on the virtual machine instance for execution to obtain the actual execution time of the task;

[0068] (5) In response to the completion of task allocation, the actual execution time of the task is used to replace the average execution time used in the preprocessing process, the parameters of the subsequent tasks of this task are updated through the online adjustment process, and the new ready tasks generated by the completion of this task are placed in the ready queue;

[0069] (6) In response to the ready queue being empty, the scheduling is completed and the entire scheduling plan is output, thereby calculating the success rate and total cost of this scheduling.

[0070] In some embodiments, the preprocessing of the workflow application information includes:

[0071] (21) Convert the workflow application input by the user into a directed acyclic graph, and fill the average execution time of each task and the data transmission time between dependent tasks into the directed acyclic graph;

[0072] (22) Use the average execution time of the task instead of the actual execution time to calculate the earliest start time of each task;

[0073] (23) Calculate the task rank by the earliest start time of the task and the data transmission time between tasks, and calculate the sub-deadline of the task;

[0074] (24) Put the ready task into the ready queue, and calculate the scheduling priority of the ready task using the obtained sub-deadline parameter.

[0075] In some specific embodiments, the present invention mainly studies a microservice workflow scheduling method, and proposes a microservice workflow scheduling method under the scheduling requirements of workflow applications with deadlines, taking into account both the scheduling success rate and the total scheduling cost. Figure 3 The specific implementation steps are as follows:

[0076] The first step is to receive a workflow application with a deadline submitted by a user.

[0077] The second step is to use a directed acyclic graph model to represent the workflow application. i The direct predecessor task is pred(t i ) indicates that t i The direct successor task is succ(t i ) is represented by . To make the model more general, two virtual computing tasks with zero load and no data transmission are added at the beginning and end of the workflow. entry and t exit . Figure 1 The following is an example diagram of a workflow.

[0078] Use TT(t i ,t k ) to represent the task t i With the task k The data transmission time between is defined as follows:

[0079]

[0080] Where data i,j represents the amount of data that needs to be transferred between tasks, and BW represents the average bandwidth of the data center. If two tasks are executed on the same virtual machine instance, the data transfer time between them is 0. Otherwise, the data transfer time is the time required for task t i With the task k The ratio of the amount of data to be transmitted between the two data centers to the average bandwidth of the data center. Let ET(t i ,v l ) represents task t i In the virtual machine instance v l The execution time of task t i The earliest start time EST(ti ) can be defined by the following formula:

[0081]

[0082] Among them, EST(t i ) represents task t i The earliest start time, pred(t i ) indicates t i The direct predecessor task, ET(t k ,v l ) represents task t k In the virtual machine instance v l TT(t i ,t k ) to represent the task t i With the task k The data transmission time between two tasks is 0 if they are executed on the same virtual machine instance; otherwise, the data transmission time is the time taken by task t i With the task k The ratio of the amount of data that needs to be transmitted to the average bandwidth of the data center;

[0083] The average execution time AET of the task on all virtual machine instances is used i To replace ET(t k ,v l ) to perform initial calculations. The two virtual computing tasks at the beginning and end of the workflow have zero load and cannot transmit any data. entry and t exit They represent the entry task and exit task in the directed acyclic graph respectively.

[0084] Single virtual machine instance v l The execution cost c l The definition is as follows:

[0085]

[0086] Among them, UT l Refers to the virtual machine instance v l The usage time, interval refers to the billing time interval, usually one hour, and price l Refers to the virtual machine instance v l Therefore, the total cost can be defined as:

[0087]

[0088] The actual completion time of the workflow is defined as the scheduling length Makespan, and the deadline given by the user is recorded as D. For a directed acyclic graph, since texit The execution time of is 0, so t exit The actual completion time is the scheduling length of the workflow, that is, Makespan = FT(t exit ), FT(t exit ) is the export task t exit The optimization goal of the entire problem is to reduce the total cost of scheduling while satisfying the deadline constraints, as shown below:

[0089] min Cost

[0090] st Makespan≤D (5)

[0091] The third step is to divide the process into sub-deadline periods.

[0092] First, the concept is introduced, task t i rank u (t i ), which represents the task t i To task t exit The length of the critical path between is defined as follows:

[0093]

[0094] Among them, ET(t i ,v l ) represents task t i In the virtual machine instance v l The execution time on TT(ti,t k ) to represent the task t i With the task k Data transmission time between i ) represents task t i A collection of subsequent tasks;

[0095] For export tasks exit , rank u (t exit )=0. Through this value, we can recursively find the rank of each task. Through the concept of rank, task t i Sub-deadline sd i is defined as:

[0096]

[0097] Where D refers to the deadline for user submission, ET(t i ,v l ) represents task t i In the virtual machine instance v l The execution time on entryRefers to the entry task in the directed acyclic graph.

[0098] Formula (7) uses task t i With the entry task t entry The deadline is divided by the ratio of the rank increase. The concept of rank increase reflects the task t i The position in the entire workflow and the size of the task. The farther the task is from the entry task, the higher the rank u (t entry )-rank u (t i ) value, the larger the task calculation amount, the greater the ET(t i , v l ) will be larger. Both of these situations will lead to the extension of the sub-deadline, which is in line with the expected logic, so it is more reasonable to adopt this method to allocate sub-deadlines.

[0099] The fourth step is the sorting of ready tasks. The definition of a ready task is: when all the predecessor tasks of a task have been assigned to the virtual machine instance and completed, and all the data have been received, the task is considered a ready task. Once a task becomes a ready task, it will be placed in the ready queue. The ready queue is a priority queue that uses the concept of urgency to determine the priority of the task. It is defined as follows:

[0100]

[0101] Among them, u i The value indicates the scheduling urgency of the ready tasks in the ready queue, sd i Represents task t i Sub-deadline, EST(t i ) represents task t i The earliest start time, ET(t i ,v l ) represents task t i In the virtual machine instance v l The execution time on ut(t i ) represents task t i To export task exit The number of unscheduled tasks between sd i With EST(t i )+ET(t i , v l ), the smaller the distance between the task and the deadline, the greater the risk of the task exceeding the deadline. i The more tasks to be scheduled, the more t i The delay caused by the completion time exceeding the sub-deadline will have a greater impact on subsequent tasks. i The smaller the value, thei The higher the scheduling urgency.

[0102] Step 5: A suitable virtual machine instance must meet the following requirements: During the container lifecycle, the available idle resources of the virtual machine always meet the computing requirements of the task, and the task is completed before the sub-deadline, that is, it meets the following requirements:

[0103]

[0104]

[0105] EST(t cur )+ET(t cur ,v l )≤sd cur (11)

[0106] in, Represents the total available resource vector of the virtual machine instance, represents the available resource vector of the virtual machine instance at time t, Represents the used resource vector of the virtual machine instance at time t, The resource requirement vector of the task to be assigned at time t, EST(t i ) represents task t i The earliest start time, ET(t i ,v l ) represents task t i In the virtual machine instance v l Execution time on sd i Represents task t i Sub-deadline, t cur Indicates the tasks that are being scheduled.

[0107] In the sixth step, the existing algorithm adopts the strategy of selecting the cheapest virtual machine instance for the current task or the strategy of selecting the virtual machine instance with the largest cosine similarity between the available resource vector and the current task resource requirement vector when selecting the virtual machine instance for the task. The cosine similarity is defined as follows:

[0108]

[0109] Where m is the number of computing resource types; Represents the available resource vector of the virtual machine instance at time t The number of g-th resources in Represents the resource requirement vector of the task The number of the g-th resource in ;

[0110] The larger the cosine similarity, the more similar the two vectors are, which means that if the task is executed on this virtual machine instance, the remaining resources will not be over-consumed.

[0111] The cost-based selection strategy only considers the cost of each selected virtual machine, ignoring the fact that heterogeneous resource requirements of tasks will lead to unbalanced remaining resources of virtual machine instances, resulting in frequent selection of new virtual machine instances during selection, which increases costs. The cosine similarity-based selection strategy takes into account the shortcomings of the cost-based selection strategy and considers the remaining resources within the virtual machine instance during selection, making subsequent allocation more flexible. However, this method over-considers the resource factor and completely ignores the cost factor. As the task allocation process proceeds, the amount of unallocated tasks remaining in the future becomes smaller and smaller. The cost reduction brought by the reduction in the number of virtual machines caused by continuing to allocate based on the cosine similarity indicator is far less than the cost increase brought by selecting high-priced virtual machine instances.

[0112] Considering the defects of the above two strategies, the present invention proposes a dynamic resource selection strategy, which defines the quality Q of the virtual machine instance as follows:

[0113]

[0114] Price l is the virtual machine instance v l Unit price, price max represents the unit price of the most expensive virtual machine in the resource pool. θ is a weighting factor, and the calculation formula is as follows:

[0115]

[0116] Where f represents the number of tasks that have been scheduled, n represents the total number of tasks in the directed acyclic graph, and the ratio of scheduled tasks to the total number of tasks represents the degree of completion of the entire scheduling. When in the early stage of scheduling, the value of θ is small. At this time, Q is mainly affected by cosine similarity. By selecting a virtual machine instance with a large Q value, a virtual machine with a large cosine similarity can be selected. At this time, there are still many tasks to be scheduled. Selecting a virtual machine with a large cosine similarity can provide greater flexibility for subsequent task allocation and help reduce the number of virtual machines used. As the scheduling process progresses, when it comes to the later stage of the scheduling process, the value of θ is large. At this time, Q is mainly affected by price. max / price lBy selecting a virtual machine instance with a large Q value, a virtual machine instance with a low unit price can be selected. At this time, the number of tasks remaining to be scheduled is small, and the cost reduction brought by the reduction in the number of virtual machines by continuing to allocate by cosine similarity is far less than the cost increase brought by the high unit price of the virtual machine. At this time, selecting a virtual machine with a lower unit price to complete the task can reduce unnecessary costs in terms of the unit price of the virtual machine.

[0117] Step 7: Complete the task scheduling process for the ready task t i After scheduling, task t i The actual execution time of task t can be obtained. i The actual execution time of its direct successor task set succ(t i ) affects the earliest start time of the task in , so it is necessary to adjust succ(t i ) to update various time parameters of tasks in the collection. Secondly, check the affected task nodes in the workflow to determine whether these affected tasks have been transformed into ready tasks, and add the tasks that have become ready tasks to the ready queue for a new round of sorting. At the same time, after the task is assigned to the virtual machine instance or the task is completed, the available resource vector of the corresponding virtual machine also needs to be updated synchronously.

[0118] Step 8: Check whether the ready queue is empty. This process controls the termination condition of the scheduling process. Only when there is no task in the ready queue can it be said that all tasks in the entire workflow have been scheduled and completed, and the entire scheduling plan can be obtained. If there are still tasks in the ready queue, return to the resource search to continue processing the first task in the ready queue.

[0119] The ninth step is to calculate the total scheduling cost and scheduling success rate of the scheduling plan obtained in the previous step.

[0120] In order to evaluate the performance of the algorithm in handling real loads, we used Figure 2 Four scientific workflow applications are shown for testing, including CyberShake, Epigenomics, LIGO, and Montage.

[0121] To measure the performance of each algorithm for scheduling different workflows, two benchmarks are introduced:

[0122] (1) The slowest (cheapest) scheduling scheme, that is, assigning the cheapest virtual machine instance to all tasks without considering the deadline, and obtaining the total time M spent by this scheduling scheme S and the total cost C S .

[0123] (2) The fastest (most expensive) scheduling scheme is to assign the most expensive virtual machine instance to all tasks and obtain the total time M spent by the scheduling scheme. F and the total cost C F .

[0124] In order to evaluate the sensitivity of the algorithm, different deadline constraints are set, ranging from strict to loose. The deadline D of the workflow is defined as follows:

[0125] D=M F +(M S -M F )×λ (15)

[0126] Among them, λ represents the deadline factor, ranging from 0 to 1. The deadline D of the workflow is determined by λ, so that the deadline can vary from relatively strict to loose. The larger the λ, the looser the deadline. Through the above settings, a reasonable deadline can be set by controlling the value of the cutoff factor λ to test the performance of different algorithms.

[0127] The metrics used to evaluate algorithm performance are:

[0128] Scheduling success rate SR: The algorithm scheduling success rate represents the ratio of the number of successfully scheduled workflows to the total number of workflows, and is defined as follows:

[0129]

[0130] Normalized cost NC: Normalized cost is the total cost Cost of the scheduling plan and the cost C of the cheapest scheduling plan S The ratio is defined as follows:

[0131]

[0132] Figure 4 and Figure 5 They are respectively the comparison chart of scheduling success rate under different deadline factors and the comparison chart of scheduling cost under different deadline factors. Figure 4 and Figure 5 The comparison experiment group in is divided into the IC-PCP algorithm using a cost-based scheduling strategy and the SMWS algorithm using a cosine similarity-based scheduling strategy. Figure 4 Under the four workflow conditions, the scheduling success rate obtained by the DRSS algorithm is generally higher than that of the other two algorithms. Figure 5 The total scheduling cost of the DRSS algorithm is generally lower than that of the other two algorithms. Figure 4 and Figure 5 It can be seen that the scheduling algorithm DRSS based on the dynamic resource selection strategy proposed in the present invention has corresponding improvements in both scheduling success rate and total scheduling cost.

[0133] Example 2

[0134] In a second aspect, this embodiment provides a microservice workflow scheduling device, including a processor and a storage medium;

[0135] The storage medium is used to store instructions;

[0136] The processor is used to operate according to the instructions to execute the steps of the method according to embodiment 1.

[0137] Example 3

[0138] In a third aspect, this embodiment provides a storage medium on which a computer program is stored. When the computer program is executed by a processor, the steps of the method described in Example 1 are implemented.

[0139] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.

[0140] 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 generate 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 flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0141] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0142] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0143] As described above, the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features thereof may be replaced by equivalents. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A microservice workflow scheduling method, It is characterized in that include: Obtain input workflow application information; Preprocess the workflow application information to obtain the sub-deadline and scheduling priority of each microservice task in the workflow, and put the ready tasks at this time into the ready queue according to the scheduling priority; Take the ready tasks from the ready queue in sequence, find available resource virtual machine instances for the tasks while ensuring resource requirements and task sub-deadlines, and store them in the available set of virtual machine instances; select a suitable virtual machine instance for the task in the available set of virtual machine instances through a dynamic resource selection strategy, and place the task on the virtual machine instance for execution to obtain the actual execution time of the task; In response to the completion of task allocation, the actual execution time of the task is used to replace the average execution time used in the preprocessing process, the parameters of the subsequent tasks of this task are updated through the online adjustment process, and the new ready tasks generated by the completion of this task are placed in the ready queue; In response to the ready queue being empty, the scheduling is completed; The dynamic resource selection strategy includes: The quality Q of a virtual machine instance is defined as follows: Where CS(i,l,t) refers to cosine similarity, which is defined as follows: Where m is the number of computing resource types; Represents the available resource vector of the virtual machine instance at time t The number of g-th resources in Represents the resource requirement vector of the task The quantity of the g-th resource; price l is the virtual machine instance v l Unit price, price max represents the unit price of the most expensive virtual machine in the resource pool; and θ is a weighting factor, calculated as follows: Where f represents the number of tasks that have been scheduled, n represents the total number of tasks in the directed acyclic graph, and the ratio of scheduled tasks to the total number of tasks represents the degree of completion of the entire scheduling.

2. The microservice workflow scheduling method according to claim 1, It is characterized in that The preprocessing of the workflow application information includes: Convert the workflow application input by the user into a directed acyclic graph, and fill the average execution time of each task and the data transmission time between dependent tasks into the directed acyclic graph; Use the average execution time of the task instead of the actual execution time to calculate the earliest start time of each task; The task rank is calculated by the earliest start time of the task and the data transmission time between tasks, and the sub-deadline of the task is calculated; Put the ready task into the ready queue, and calculate the scheduling priority of the ready task by the obtained sub-deadline parameter.

3. The microservice workflow scheduling method according to claim 2, It is characterized in that The step of converting the workflow application input by the user into a directed acyclic graph includes: The workflow model can be represented by a directed acyclic graph DAG, DAG = (T, E); T = {t 1 ,t 2 ,…,t n } is a set of nodes in a directed acyclic graph, each node represents a computing task; E is a set of edges in DAG, and the data dependencies between tasks are represented by the edges e of the corresponding nodes. ij To express, e ij ={t i ,t j } represents the task t i and task t j The dependency relationship between tasks t j Must be in task t i After completion, it can be executed. At this time, task t i It is called task t j The direct predecessor task of task t j It is called task t i The direct successor task; if there is data transmission between tasks, ij Add data i,j Attribute, indicating the amount of data that needs to be transferred between tasks; at this time, for task t i For i The set of direct predecessor tasks pred(t i ) is completed and all data is transmitted, t i All microservice tasks are given the computing resources required for the execution of the task in advance, using the demand resource vector Represented by , where m is the number of computing resource types.

4. The microservice workflow scheduling method according to claim 2, It is characterized in that The method of using the average execution time of the task instead of the actual execution time to calculate the earliest start time of each task includes: The earliest start time of a task is defined as follows: Among them, EST(t i ) represents task t i The earliest start time, t entry represents the entry task in the directed acyclic graph, pred(t i ) indicates t i The direct predecessor task, ET(t k ,v l ) represents task t k In the virtual machine instance v l TT(t i ,t k ) to represent the task t i With the task k The data transmission time between two tasks is 0 if they are executed on the same virtual machine instance; otherwise, the data transmission time is the time taken by task t i With the task k The ratio of the amount of data that needs to be transmitted to the average bandwidth of the data center; The average execution time AET of the task on all virtual machine instances is used i To replace ET(t k ,v l ) to perform initial calculations.

5. The microservice workflow scheduling method according to claim 2, It is characterized in that The step of calculating the task rank by the earliest start time of the task and the data transmission time between the tasks, and calculating the sub-deadline of the task, includes: Task i rank u (t i ) represents task t i To export task exit The length of the critical path between is defined as follows: Among them, ET(t i ,v l ) represents task t i In the virtual machine instance v l TT(t i ,t k ) to represent the task t i With the task k Data transmission time between i ) represents task t i The set of subsequent tasks; for the export task t exit , rank u (t exit )=0; through this value, recursively find the rank of each task; through the concept of rank, task t i Sub-deadline sd i is defined as: Where D refers to the deadline for user submission, ET(t i ,v l ) represents task t i In the virtual machine instance v l The execution time on entry Refers to the entry task in the directed acyclic graph.

6. The microservice workflow scheduling method according to claim 2, It is characterized in that The step of placing the ready task into the ready queue and calculating the scheduling priority of the ready task by using the obtained sub-deadline parameter includes: The definition of a ready task is: when all the predecessor tasks of a task have been assigned to the virtual machine instance and executed, and all the data have been received, the task is considered a ready task; once a task becomes a ready task, it will be placed in the ready queue; calculate the scheduling urgency of each ready task in the ready queue Among them, u i The value indicates the scheduling urgency of the ready tasks in the ready queue, sd i Represents task t i Sub-deadline, EST(t i ) represents task t i The earliest start time, ET(t i ,v l ) represents task t i In the virtual machine instance v l The execution time on ut(t i ) represents task t i To export task exit The number of unscheduled tasks between .

7. The microservice workflow scheduling method according to claim 1, It is characterized in that The step of searching for available resource virtual machine instances for the task under the constraints of ensuring resource requirements and task sub-deadlines includes: A suitable virtual machine instance must meet the following requirements: During the container lifecycle, the available idle resources of the virtual machine always meet the computing requirements of the task, and the task is completed before the sub-deadline; that is, it meets the following requirements: IS(t cur )+AND(t cur ,v l )≤sd cur in, Represents the total available resource vector of the virtual machine instance, represents the available resource vector of the virtual machine instance at time t, Represents the used resource vector of the virtual machine instance at time t, The resource requirement vector of the task to be assigned at time t, EST(t i ) represents task t i The earliest starting time, ET(t i ,v l ) represents task t i In the virtual machine instance v l Execution time on sd i Represents task t i Sub-deadline period, t cur Indicates the tasks that are being scheduled.

8. A microservice workflow scheduling device, It is characterized in that including processor and storage medium; The storage medium is used to store instructions; The processor is configured to operate according to the instructions to execute the steps of the method according to any one of claims 1 to 7.

9. A storage medium having a computer program stored thereon, It is characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.

Citation Information

Patent Citations

  • Workflow based mixed renting method of cloud computing resources

    CN106339924A

  • A virtual machine dynamic leasing and scheduling method based on batch task workflows in a cloud environment

    CN109828821A

  • Scientific workflow scheduling method for deadline constraints in cloud environment

    CN110609736A

  • Workflow scheduling method based on stable matching game theory

    CN112306642A