Workflow scheduling method, server and medium

By selecting the node with the initial value of the input degree in the workflow and the state is to be run as the node to be run, and reducing the input degree of the downstream node after the node is completed, the problem that the workflow scheduling performance in the big data environment is affected by the time-consuming check of the upstream node task status in the big data environment, and efficient workflow scheduling is achieved.

CN113434265BActive Publication Date: 2025-05-02ALIBABA GROUP HOLDING LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202010207152.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-03-23
Publication Date
2025-05-02
Estimated Expiration
2040-03-23

AI Technical Summary

Technical Problem

In the big data environment, there are too many upstream dependencies of node tasks in the workflow, which causes upstream node task status checks to take time and affects scheduling performance.

Method used

In the node that constitutes the directed acyclic graph of the workflow to be run, the node whose incoming degree is the initial value and whose status is the to-run node is selected as the to-run node, and after the node is completed, the incoming degree of its downstream node is reduced by a preset unit to achieve orderly execution of the node.

Benefits of technology

This method reduces the time-consuming task status check of upstream nodes, improves scheduling performance, and ensures that each node only executes after its upstream node is executed, thereby avoiding scheduling delays caused by state check delays.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113434265B_ABST
    Figure CN113434265B_ABST
Patent Text Reader

Abstract

The present invention provides a workflow scheduling method, a server and a medium. The method comprises: selecting one or more nodes whose in-degree is an initial value and whose state is to be run from all nodes of a directed acyclic graph constituting a workflow to be run as nodes to be run; running the nodes to be run to complete, obtaining operation-completed nodes; and reducing the in-degree of the downstream node of the operation-completed node by a preset unit. The present invention reduces the impact of the long time spent on upstream node task status checking on scheduling performance.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of information processing, and in particular to a workflow scheduling method, a server and a medium. Background Art

[0002] With the development of the Internet, information processing is becoming more and more large-scale. It is often necessary to schedule workflows containing many tasks. Scheduling means assigning each node task in the workflow to different task execution nodes according to the nature of the node task. In the workflow, each node task has its own upstream node task and downstream node task. The upstream node task refers to the node task that the execution of the current node task depends on. Only when all the upstream node tasks of the current node task are completed, the current node task can be executed. The downstream node task refers to the node task that depends on the execution of the current node task. The downstream node task can be executed only after the current node task is executed.

[0003] Since there are dependencies among node tasks in the workflow, in the case of big data, the execution of a node task may depend on the execution of tens of thousands or hundreds of thousands of upstream node tasks. Therefore, when the current node task is called to execute, it will take a lot of time to check the status of the upstream node tasks because there are too many dependent upstream node tasks, which will cause delays in the execution of node tasks and low scheduling performance. Summary of the invention

[0004] In view of this, the present invention aims to reduce the impact of time-consuming upstream node task status checks on scheduling performance.

[0005] To achieve this objective, according to a first aspect of the present invention, an embodiment of the present invention provides a workflow scheduling method, comprising:

[0006] Among all the nodes constituting the directed acyclic graph of the workflow to be run, one or more nodes whose in-degree is an initial value and whose state is to be run are selected as nodes to be run;

[0007] The node to be run is run to completion, thereby obtaining a run-completed node;

[0008] The in-degree of the downstream node of the running completed node is reduced by a preset unit.

[0009] Optionally, the method further comprises: calculating the in-degrees of all nodes of the directed acyclic graph of the to-be-executed workflow.

[0010] Optionally, the in-degree of the root node among all the nodes is an initial value.

[0011] Optionally, the calculating the in-degrees of all nodes of the directed acyclic graph of the to-be-run workflow includes:

[0012] Determining the number of directed edges in the directed acyclic graph that point to a particular node;

[0013] The result of multiplying the number of directed edges by a preset unit and adding the result to the initial value is used as the in-degree of the specific node.

[0014] Optionally, in the process of completing the operation of the node to be operated and obtaining the node completed, the method further includes:

[0015] During the operation, the node status is marked as running;

[0016] After the run is completed, mark the node status as final.

[0017] Optionally, the method further includes: sending the in-degrees of all the nodes to a server for storage; accordingly, reducing the in-degree of the downstream node of the running node by a preset unit includes: reducing the in-degree of the downstream node of the running node by a preset unit on the server.

[0018] According to a second aspect of the present invention, there is provided a workflow scheduling device, comprising:

[0019] A node selection unit to be run is used to select one or more nodes whose in-degree is an initial value and whose state is to be run from all the nodes of the directed acyclic graph constituting the workflow to be run as nodes to be run;

[0020] An operation unit, used to complete the operation of the node to be operated to obtain an operation completed node;

[0021] The in-degree reducing unit is used to reduce the in-degree of the downstream node of the running completed node by a preset unit.

[0022] Optionally, the device further comprises: an in-degree calculation unit, configured to calculate the in-degrees of all nodes of the directed acyclic graph of the workflow to be executed.

[0023] Optionally, the in-degree of the root node among all the nodes is an initial value.

[0024] Optionally, the in-degree calculation unit is further used for:

[0025] Determining the number of directed edges in the directed acyclic graph that point to a particular node;

[0026] The result of multiplying the number of directed edges by a preset unit and adding the result to the initial value is used as the in-degree of the specific node.

[0027] Optionally, the operation unit is further used for:

[0028] During the operation, mark the node status as running;

[0029] After the run is completed, mark the node status as final.

[0030] Optionally, the device further comprises: a sending unit, configured to send the in-degrees of all the nodes to a server for storage; accordingly, the in-degree reducing unit is further configured to: reduce the in-degree of the downstream node of the running node by a preset unit on the server.

[0031] According to a third aspect of the present invention, there is provided a workflow scheduling server, comprising: a memory for storing computer executable code; and a processor for executing the computer executable code stored in the memory to implement the method as described above.

[0032] According to a fourth aspect of the present invention, a computer storage medium is provided, wherein the computer storage medium stores a computer executable code, and when the computer executable code is executed by a processor, the method described above is implemented.

[0033] The embodiment of the present invention first selects one or more nodes whose in-degree is the initial value and whose status is to be run from all the nodes of the directed acyclic graph constituting the workflow to be run as the nodes to be run. The in-degree is the initial value, indicating that all the upstream nodes of the node have been executed and can be executed. After execution, the in-degree of all the downstream nodes of the node is reduced by a preset unit. When the in-degree of a certain downstream node is reduced to the initial value again, it can be executed again. By continuously selecting one or more nodes whose in-degree is the initial value and whose status is to be run to execute, and then reducing the in-degree of the downstream node after execution, the purpose of each node being executed after its upstream node is achieved. It does not need to waste time checking the task status of the upstream node, and can also perform workflow scheduling normally, reducing the impact of the long time spent on checking the task status of the upstream node on the scheduling performance. BRIEF DESCRIPTION OF THE DRAWINGS

[0034] The above and other objects, features and advantages of the present invention will become more apparent through the description of the embodiments of the present invention with reference to the following drawings, in which:

[0035] Figure 1 A system architecture diagram is shown for use with a workflow scheduling method according to an embodiment of the present invention;

[0036] Figure 2A , B are Figure 1 The architecture diagram is applied to the financial approval process and the website operation and maintenance scenario using big data processing results;

[0037] Figure 3A-C shows examples of directed trees, directed acyclic graphs, and directed cyclic graphs, respectively;

[0038] Figure 4 A flowchart of a workflow scheduling method according to an embodiment of the present invention is shown;

[0039] Figure 5 A schematic diagram showing the use of a field of a node task to distinguish in-degree and state according to an embodiment of the present invention is shown;

[0040] Figure 6 A schematic diagram showing storing in-degree and state in a partition different from node tasks according to an embodiment of the present invention is shown;

[0041] Figure 7 A block diagram of a workflow scheduling device according to an embodiment of the present invention is shown;

[0042] Figure 8 A structural diagram of a workflow scheduling server according to an embodiment of the present invention is shown. DETAILED DESCRIPTION

[0043] The present invention is described below based on embodiments, but the present invention is not limited to these embodiments. In the detailed description of the present invention below, some specific details are described in detail. It is possible for a person skilled in the art to fully understand the present invention without the description of these details. In order to avoid confusing the essence of the present invention, known methods, processes, and procedures are not described in detail. In addition, the drawings are not necessarily drawn to scale.

[0044] Figure 1 The diagram shows the system architecture used by the workflow scheduling method according to the embodiment of the present invention. The system architecture includes a work scheduling server 110, a workflow generation terminal 120, a database 130 and a task execution unit group 140. The task execution unit group 140 includes a plurality of task execution units 141.

[0045] The workflow generation terminal 120 is a terminal for generating a workflow to be run. A workflow is a flow composed of a series of tasks that together complete an overall work. Each task in the flow is called a node. The workflow to be run is the workflow to be run. After running the nodes of the workflow in the order of dependency, the overall work is completed. The essence of the workflow to be run is a set of program codes for performing specific work, in which each node is equivalent to a code block. A code block calls the previous code block, or references the calculation results generated by the previous code block, which is the dependency relationship of the node.

[0046] The work scheduling server 110 is a core component of the embodiment of the present invention, which completes the allocation of each node in the workflow to the task execution unit 141 that actually executes them, so that the corresponding task execution unit 141 executes and completes the overall work.

[0047] The database 130 is a repository for storing various information required during the execution of the node.

[0048] The task execution unit 141 is a unit for executing node tasks, and receives the scheduling from the workflow scheduling server 110 to execute corresponding node tasks.

[0049] The workflow scheduling server 110 can be implemented as a single computer or as a collection of multiple computers. When implemented as a collection of multiple computers, the multiple computers cooperate with each other and each completes a part of the scheduling work.

[0050] The task execution unit 141 may be a single computer or a part of a single computer, such as a virtual machine partitioned from a single physical machine. In some cases, the task execution unit group 140 may be a single computer, and each task execution unit 141 may be a virtual machine partitioned from the computer.

[0051] Figure 2A -B are Figure 1 The architecture diagram is applied to the financial approval process and the scenario where the website uses big data processing results for operation and maintenance.

[0052] exist Figure 2A In the application scenario of the financial approval flow, the workflow generation terminal 120 is concretized as a financial approval flow generation terminal, which may be a specific terminal of a handling person, such as a mobile phone. When the handling person needs to withdraw a sum of money from the company in advance due to official business, he initiates a request for advance withdrawal from the application of his mobile phone, and the request must be approved by grassroots leaders, middle-level leaders, and senior leaders. This financial approval flow may include three nodes connected in sequence, namely grassroots leaders' approval, middle-level leaders' approval, and senior leaders' approval. The execution of this workflow is a process of approval by leaders at all levels in sequence.

[0053] The workflow scheduling server 110 is embodied as a financial approval flow scheduling server here, which schedules each node in the workflow, i.e., grassroots leadership approval, middle-level leadership approval, and high-level leadership approval, to the grassroots approval unit, middle-level approval unit, and high-level approval unit for approval. Since the approval of the middle-level approval node depends on the completion of the approval of the grassroots approval node, and the approval of the high-level approval node depends on the completion of the approval of the middle-level approval node, such scheduling should be orderly and reasonable, taking into account the dependency relationship between the nodes.

[0054] The database 130 is embodied here as a financial database, which stores the data required by the nodes of grassroots leadership approval, middle-level leadership approval, and senior leadership approval.

[0055] Each task execution unit 141 is specifically embodied as a grassroots approval unit, a middle-level approval unit, and a high-level approval unit. Grassroots leader approval, middle-level leader approval, and high-level leader approval are respectively executed by the grassroots approval unit, the middle-level approval unit, and the high-level approval unit.

[0056] When a specific handling personnel has a financial demand for funds, he sends a waiting financial approval flow to the financial approval flow scheduling server 110 on his mobile phone, i.e., the financial approval generation terminal 120. The financial approval flow scheduling server 110 schedules each node in the financial approval flow to the grassroots, middle-level, and high-level approval nodes 141 for execution. When scheduling, the dependency relationship between the nodes must be taken into account, that is, only when all the upstream nodes of a node are executed can the node be scheduled for execution, otherwise it will not be executed because it depends on the execution results of its upstream nodes.

[0057] exist Figure 2B In the scenario where the website uses big data processing results for operation and maintenance, the user terminal 170 is a terminal of a user using the Internet 160. It can be a computer terminal, a mobile terminal such as a mobile phone, a PDA, or a dedicated device terminal such as a car terminal.

[0058] The user terminal 170 accesses a specific website or uses a specific application through the Internet 160. The server side of the specific website or application will set up a front-end server 150 to collect basic data of the user's operation on the specific website or specific application. For example, the user visited a link on the website's homepage at X:X on X / X / XX (such as a product link on the Taobao website). Current websites or applications generally use these basic data to perform big data analysis to analyze the user's browsing preferences so that the user can be recommended more products that meet his or her preferences on the web page in the future. This big data analysis may be for a single user, such as analyzing the user's browsing preferences, or it may be for all users. For example, if a product on a web page has not been browsed or sold by a user for a long time, it means that it does not meet the preferences of most users and may no longer be recommended to users, etc. In order to perform this big data analysis, the front-end server 150 sends the to-be-run workflow (the workflow used for big data analysis) with the collected user basic data to the big data processing flow scheduling server 110. The front-end server 150 here is equivalent to Figure 1 The workflow generation terminal 120 in the big data processing flow scheduling server 110 is Figure 1 The workflow scheduling server in .

[0059] The workflow for big data analysis contains a large number of nodes, which are not executed on the big data processing flow scheduling server 110, but are scheduled to be executed by the major data processing units 141 in the big data processing unit group 140. The major data processing units 141 here are Figure 1 The big data processing unit group 140 is Figure 1 When scheduling each node in the big data processing flow to each large data processing unit 141 for execution, the big data processing flow scheduling server 110 needs to consider the dependency between the nodes.

[0060] When all the nodes in the big data processing flow are dispatched to the major data processing units 141 for execution, the major data processing units 141 return the processing results to the processing result operation node 180, and the processing result operation node 180 controls the front-end server 150 to adjust the display of the user interface according to the processing results (such as the obtained user preferences, etc.), so that the interface displayed to the user reflects the big data processing results.

[0061] Before introducing the specific workflow scheduling method of the embodiment of the present invention, the directed acyclic graph and the difference between the directed acyclic graph and the directed tree and the directed cyclic graph are first introduced.

[0062] Figure 3A -C shows examples of directed trees, directed acyclic graphs, and directed cyclic graphs. In graph theory, a graph is a shape formed by connecting several vertices or nodes with edges. If each edge in the graph has a direction, the graph is a directed graph, otherwise it is an undirected graph. A directed graph can be used to represent a workflow. A workflow is composed of nodes, each of which is Figure 3A -C is a circle with a letter. The dependency relationship of each node is regarded as a directed edge, and the direction is represented by an arrow. If the execution of node B depends on the execution of node A, a directed edge with an arrow pointing from A to B is used to represent the dependency relationship of B on A. Node A can be regarded as the upstream node task of node B. Node B can be regarded as the downstream node task of node A.

[0063] If a directed graph cannot return to the node through several edges starting from any node, the directed graph is called a directed acyclic graph. Figure 3B In the example, it is impossible to return to any node 210 through several edges. If a directed graph can return to the node through several edges from at least one node, the directed graph is called a directed cyclic graph. Figure 3C In the example, it starts from node B, passes through nodes D and F, and finally returns to node B, forming a ring consisting of nodes B, D, and F. Figure 3Cis a directed cyclic graph. A directed tree is a special case of a directed acyclic graph. A directed tree is a directed acyclic graph in which each vertex or node has at most one upstream node, that is, there is at most one directed edge pointing to each node. Figure 3A In the figure, vertex or node A has no directed edge pointing to it, while vertices BE each have one directed edge pointing to them.

[0064] In the embodiment of the present invention, each node of the workflow to be run is drawn, and the dependency relationship between the nodes is represented by the directed edges between the nodes, so that the workflow to be run can be converted into a graph. If the graph is a directed acyclic graph, the method of the embodiment of the present invention can be used to schedule the workflow. If the graph is a directed cyclic graph, an infinite loop will occur in the loop, and the method of the embodiment of the present invention cannot be applied.

[0065] like Figure 4 As shown, a workflow scheduling method according to an embodiment of the present invention includes: step 410, among all the nodes of the directed acyclic graph constituting the workflow to be run, selecting one or more nodes whose in-degree is an initial value and whose state is to be run as nodes to be run; step 420, running the nodes to be run to completion, and obtaining a run-completed node; step 430, reducing the in-degree of the downstream node of the run-completed node by a preset unit.

[0066] This method is Figure 1 The steps are executed by the workflow scheduling server 110. The following describes these steps in detail.

[0067] In step 410, one or more nodes whose in-degree is an initial value and whose status is to be run are selected from all nodes of the directed acyclic graph constituting the workflow to be run as nodes to be run.

[0068] Before step 410, the in-degrees of all nodes of the directed acyclic graph of the workflow to be executed may be calculated.

[0069] The workflow to be run is a workflow received by the workflow scheduling server 110 from the workflow generation terminal 120. Draw each node of the workflow to be run, and use the directed edges between the nodes to represent the dependencies between the nodes. In this way, the workflow to be run can be converted into a directed acyclic graph. The in-degree is a quantity that reflects the number of nodes that have not been executed yet and the execution of a node in the directed acyclic graph depends on. The higher the in-degree, the more nodes it depends on. Generally speaking, the node can only be executed when the in-degree of the node reflects that all the nodes it depends on have been executed (or in other words, the number of nodes it depends on and has not been executed is 0).

[0070] In one embodiment, the in-degrees of all nodes of the directed acyclic graph of the workflow to be run can be calculated in the following manner: determining the number of directed edges in the directed acyclic graph pointing to a specific node; multiplying the number of directed edges by a preset unit and adding the result of the initial value as the in-degree of the specific node.

[0071] In a directed acyclic graph, the node that has no directed edges pointing to it is the root node, such as Figure 3A -Node A in B. That is, there are only directed edges from the root node to other nodes, and no directed edges from other nodes to the root node. The in-degree of the root node is the initial value. The same initial value is assigned to the in-degree of other nodes, and then, for each directed edge pointing to the node, a preset unit is added to the initial value, and the final value is the in-degree of the node. That is, the in-degree of a node is equal to the number of directed edges pointing to the node in the directed acyclic graph multiplied by the preset unit, plus the result of the initial value. For example, in Figure 3B For node E, the number of directed edges pointing to it is 2, the initial value is 3, and the preset unit is 2, so the in-degree of node E is 3+2×2=7; the execution of node E depends on the completion of the execution of nodes B and C; for node D, the number of directed edges pointing to it is 1, so the in-degree of node D is 3+2×1=5, and the execution of node D depends on the completion of the execution of node B.

[0072] In a special case, the initial value is 0 and the preset unit is 1, so that the in-degree is equal to the number of directed edges pointing to the node in the directed acyclic graph.

[0073] After the in-degrees of all nodes are calculated, the in-degrees of all nodes may be sent to the workflow scheduling server 110 for storage, and the workflow scheduling server 110 may also store them in the database 130 .

[0074] When saving, the in-degree can be stored in the node task in the form of an additional field, or it can be saved in a dedicated storage area. The node task is a data structure that stores the execution code corresponding to the node.

[0075] In the method of adding fields, an in-degree field is added to the node task, the determined in-degree is filled, and the filled node task is stored. Figure 5 As shown, an in-degree field 530 can be added to the node task to place the determined in-degree. The node task also includes a node task content field 520 to place the content of the node task, that is, the execution code corresponding to the node. In addition, the node task can also include a node task identifier field to place an identifier assigned to the node task, which distinguishes the node task from other node tasks.

[0076] In the method of adding a storage area, such as Figure 6 As shown, a node task area 610 and an in-degree storage area 620 may be provided to store node tasks and corresponding in-degrees, respectively. The node task may be sent to the node task area 610 for storage, and the in-degree 613 may be associated with the node task identifier 611 and sent to the in-degree storage area 620 for storage. The in-degree 613 is associated with the node task identifier 611 for storage so that the node task content corresponding to the node task identifier 611 can be retrieved in the node task area 610 by using the node task identifier 611. Generally speaking, the node task identifier 611 is a part of the node task, and the node task generally includes the node task identifier 611 and the execution code (node ​​task content) 612 of the node task.

[0077] In addition, when the node task is subsequently retrieved, not only the in-degree but also the running status may be examined. Therefore, the running status of the node task must be indicated for later search. The running status of the node task can also be indicated by adding fields or adding storage areas.

[0078] In the method of adding fields, such as Figure 5 As shown, a running state field 540 can be added to the node task to indicate the running state of the node task, that is, to be run, in operation, or in the final state. In this step, the added running state field needs to be filled with "to be run".

[0079] In the method of adding a storage area, such as Figure 6 As shown, the database 130 also includes an operation status storage area 630 for storing the operation status of the node task. In this step, the operation status 614 to be run can be associated with the node task identifier 611 and stored in the operation status storage area 630. The operation status 614 is associated with the node task identifier 611 so that the node task content corresponding to the node task identifier 611 can be retrieved in the node task area 610 by using the node task identifier 611.

[0080] As described above, the in-degree of a node is equal to the number of directed edges pointing to the node in the directed acyclic graph multiplied by a preset unit, plus the result of the initial value. It is equivalent to that the initial in-degree of the node is the initial value, and then, for each directed edge pointing to the node, a preset unit is added to the initial value, and the final value is the in-degree of the node. However, if the node upstream (the node on which the directed edge executes) is executed, the in-degree of the node is reduced by a preset unit. In this way, when all the nodes upstream of the node are executed, the in-degree returns to the initial value. In this way, only one or more nodes with an in-degree of the initial value and a state of waiting to be run are selected from all the nodes as the nodes to be run. These nodes to be run can be run immediately because they have no dependent nodes that have not been executed. In addition, the reason for checking whether the state is to be run is that the in-degree of some nodes is the initial value, but it can be executed. Therefore, if the running state is not checked, repeated execution will result.

[0081] exist Figure 5 In the case of setting the in-degree field as shown, determining whether the in-degree is an initial value is performed by judging whether the in-degree field of each node task to be run is an initial value.

[0082] exist Figure 5 In the case of setting the running status field as shown, whether the node task is to be run is determined by judging whether the running status field of each node task is not run.

[0083] In summary, if the in-degree field is 0 and the running status field is waiting to run, the node is taken out as the waiting to run node.

[0084] exist Figure 6 In the case of setting the in-degree storage area 620 as shown, the selection of the node with the in-degree as the initial value is performed by searching the node task identifier of the in-degree as the initial value from the in-degree storage area 620, and searching the corresponding node task in the node task area 610 according to the found node task identifier. That is to say, first, the task identifiers corresponding to the in-degrees with the initial value are found in the in-degree storage area 620, and then the corresponding node tasks are found in the node task area 610 according to these task identifiers.

[0085] exist Figure 6In the case of setting the running state storage area 630 as shown, the node in the state of waiting to be run is selected by searching the task identifier of the node in the running state of waiting to be run from the running state storage area 630, and searching and taking out the corresponding node task in the node task area 610 according to the found node task identifier. That is to say, first, the task identifier corresponding to the running state to be run is found in the running state storage area 620, and then the corresponding node task is found in the node task area 610 according to these task identifiers.

[0086] To summarize, in one embodiment, one or more nodes with an in-degree of an initial value and a state of being to be run are selected as nodes to be run. This can be done by first searching for a node task identifier with an in-degree of an initial value in the in-degree storage area 620, then determining in the running state storage area 630 whether each of these node task identifiers corresponds to a running state of being to be run, finding out the node task identifiers with a running state of being to be run among these node task identifiers, and then determining in the node task area 610 that the node task corresponding to the found node task identifier is taken out.

[0087] In another embodiment, one or more nodes with an in-degree of an initial value and a state of being to be run are selected as nodes to be run. This can be done by first searching for node task identifiers with an operating state of being to be run in the operating state storage area 630, then determining in the in-degree storage area 620 whether each of these node task identifiers corresponds to an in-degree of an initial value, finding out the node task identifiers with an in-degree of an initial value among these node task identifiers, and determining in the node task area 610 that the node task corresponding to the found node task identifier is taken out.

[0088] In step 420, the node to be run is run to completion, and a run-completed node is obtained.

[0089] The running of the node to be run is completed. Figure 1 As shown, the node to be run is assigned to the task execution unit 140 for execution. During the execution process, the node to be run becomes a running node, and at this time, the node state needs to be marked as running. After the execution is completed, the running node becomes a running completed node, and at this time, the node state needs to be marked as a final state. When it is necessary to mark the node state as running, the modification method is different in the case where the above-mentioned running state is represented by the running state field and the case where the running state is stored in the running state storage area.

[0090] In the case where the running status is represented by the running status field, the running status field of the node task whose in-degree is the initial value and whose status is to be run can be directly changed to running. In the case where the running status is stored in the running status storage area, it is necessary to change the running status corresponding to the node task identifier taken out in the running status storage area 630 to running. When it is necessary to mark the node status as a terminal state, the modification method is different in the case where the above-mentioned running status is represented by the running status field and the case where the running status is stored in the running status storage area. In the case where the running status is represented by the running status field, the running status field of the node task that has been executed can be directly changed to a terminal state. In the case where the running status is stored in the running status storage area, it is necessary to change the running status corresponding to the node task identifier that has been executed in the running status storage area 630 to a terminal state.

[0091] In step 430, the in-degree of the downstream node of the execution completion node is reduced by a preset unit.

[0092] For the current node, the downstream node refers to the node in the directed acyclic graph that has a directed edge pointing from the current node to it.

[0093] As mentioned above, the initial in-degree of a node can be regarded as the initial value. Then, for each directed edge pointing to the node, a preset unit is added to the initial value, and the final value is the in-degree of the node. Then, if the upstream node (the node on which the directed edge executes) is executed, the in-degree of the node is reduced by another preset unit. In this way, when all the nodes upstream of the node are executed, the in-degree returns to the initial value. In this way, the node can be used as a node to be run. Therefore, once a node is executed, the in-degree of its downstream node needs to be reduced by a preset unit, so that the node to be run can be correctly found in the subsequent process.

[0094] In the case where the in-degree number is represented by the in-degree number field and in the case where the in-degree number is stored in the in-degree number storage area, the manner of reducing one preset unit is different.

[0095] In the case where the in-degree is represented by the in-degree field, the downstream node tasks can be directly found and their in-degree fields can be reduced by a preset unit. In the case where the in-degree is stored in the in-degree storage area 620, it is necessary to find the in-degree corresponding to these identifiers in the in-degree storage area 620 according to the identifiers of these downstream node tasks and reduce them by a preset unit.

[0096] The prior art has a scheduling method for fully loading a workflow into a workflow scheduling server 110. That is, all nodes of the workflow are fully loaded into the workflow scheduling server 110, and scheduling starts from the root node. When scheduling a certain node to run, all upstream node states are traversed one by one in the workflow scheduling server 110, and the node is started to run after the running conditions are met. This full loading method takes up too much memory, and due to the memory size, the number of workflow nodes that can be run at the same time is limited. In the embodiment of the present invention, only the node tasks with the input and output degrees as the initial value and the status as to be run are taken out for execution each time, and there is no need to traverse all nodes, which greatly improves efficiency and reduces memory usage.

[0097] There is also a way in the prior art to store the workflow in a database and interact with the database frequently. That is, the workflow to be run is stored in the database. When scheduling a certain node, the upstream node task status information of the node task is obtained from the database, and it is traversed and checked one by one. It can be run when the node running conditions are met. This solution will frequently interact with the database when traversing the upstream node task status information of the node task, and is dependent on the database performance. When the amount of data reaches a certain level, there will be a query performance bottleneck, and there will be a limit on the maximum in-degree of the node task. This limit threshold is related to the database performance. The embodiment of the present invention directly takes out the node with an in-degree of the initial value and a status of to-be-run from the database for operation, without the need for repeated interactions, thereby reducing the dependence on database performance.

[0098] like Figure 7 As shown, according to an embodiment of the present disclosure, a workflow scheduling device 700 is provided, including:

[0099] The node selection unit 710 is used to select one or more nodes whose in-degree is an initial value and whose state is to be run from all the nodes of the directed acyclic graph constituting the workflow to be run as the nodes to be run;

[0100] An operation unit 720 is used to complete the operation of the node to be operated to obtain an operation completed node;

[0101] The in-degree reducing unit 730 is configured to reduce the in-degree of the downstream node of the execution completed node by a preset unit.

[0102] Optionally, the device 700 further includes: an in-degree calculation unit (not shown), configured to calculate the in-degrees of all nodes of the directed acyclic graph of the workflow to be executed.

[0103] Optionally, the in-degree of the root node among all the nodes is an initial value.

[0104] Optionally, the in-degree calculation unit is further used for:

[0105] Determining the number of directed edges in the directed acyclic graph that point to a particular node;

[0106] The result of multiplying the number of directed edges by a preset unit and adding the result to the initial value is used as the in-degree of the specific node.

[0107] Optionally, the operation unit 720 is further configured to:

[0108] During the operation, mark the node status as running;

[0109] After the run is completed, mark the node status as final.

[0110] Optionally, the device further comprises: a sending unit (not shown) for sending the in-degrees of all the nodes to a server for storage; accordingly, the in-degree reduction unit is further used to: reduce the in-degree of the downstream node of the running node by a preset unit on the server.

[0111] Refer to the following Figure 8 hereinafter, the hardware structure of the workflow scheduling server 110 according to an embodiment of the present disclosure is described. Figure 8 The workflow scheduling server 110 shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.

[0112] like Figure 8 As shown, the workflow scheduling server 110 is in the form of a general computing device. The components of the workflow scheduling server 110 may include but are not limited to: at least one processing unit 810, at least one storage unit 820, and a bus 830 connecting different system components (including the storage unit 820 and the processing unit 810).

[0113] The storage unit stores program codes, which can be executed by the processing unit 810, so that the processing unit 810 performs the steps of various exemplary embodiments of the present invention described in the description of the exemplary method above. For example, the processing unit 810 can perform the following steps: Figure 4 The steps shown in .

[0114] The storage unit 820 may include a readable medium in the form of a volatile storage unit, such as a random access memory unit (RAM) 8201 and / or a cache memory unit 8202 , and may further include a read-only memory unit (ROM) 8203 .

[0115] The storage unit 820 may also include a program / utility 8204 having a set (at least one) of program modules 8205, such program modules 8205 including but not limited to: an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a network environment.

[0116] Bus 830 may represent one or more of several types of bus structures, including a memory unit bus or memory unit controller, a peripheral bus, an accelerated graphics port, a processing unit, or a local bus using any of a variety of bus architectures.

[0117] The workflow scheduling server 110 may also communicate with one or more external devices 700 (e.g., keyboards, pointing devices, Bluetooth devices, etc.), may also communicate with one or more devices that enable users to interact with the workflow scheduling server 110, and / or communicate with any device that enables the workflow scheduling server 110 to communicate with one or more other computing devices (e.g., routers, modems, etc.). Such communication may be performed via an input / output (I / O) interface 850. In addition, the workflow scheduling server 110 may also communicate with one or more networks (e.g., a local area network (LAN), a wide area network (WAN), and / or a public network, such as the Internet) via a network adapter 860. As shown, the network adapter 860 communicates with other modules of the workflow scheduling server 110 via a bus 830. It should be understood that, although not shown in the figure, other hardware and / or software modules may be used in conjunction with the workflow scheduling server 110, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.

[0118] Through the description of the above implementation, it is easy for those skilled in the art to understand that the example implementation described here can be implemented by software, or by software combined with necessary hardware. Therefore, the technical solution according to the implementation of the present disclosure can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, including several instructions to enable a computing device (which can be a personal computer, a server, a terminal device, or a network device, etc.) to execute the method according to the implementation of the present disclosure.

[0119] In an exemplary embodiment of the present disclosure, a computer program medium is further provided, on which computer-readable instructions are stored. When the computer-readable instructions are executed by a processor of a computer, the computer is caused to execute the method described in the above method embodiment.

[0120] According to one embodiment of the present disclosure, a program product for implementing the method in the above method embodiment is also provided, which can adopt a portable compact disk read-only memory (CD-ROM) and include program code, and can be run on a terminal device, such as a personal computer. However, the program product of the present invention is not limited thereto, and in this document, a readable storage medium can be any tangible medium containing or storing a program, which can be used by or in combination with an instruction execution system, an apparatus or a device.

[0121] The program product may use any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. The readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples (non-exhaustive list) of readable storage media include: an electrical connection with one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above.

[0122] Computer readable signal media may include data signals propagated in baseband or as part of a carrier wave, in which readable program code is carried. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Readable signal media may also be any readable medium other than a readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device.

[0123] The program code embodied on the readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wired, optical cable, RF, etc., or any suitable combination of the foregoing.

[0124] Program code for performing the operations of the present invention may be written in any combination of one or more programming languages, including object-oriented programming languages ​​such as Java, C++, etc., and conventional procedural programming languages ​​such as "C" or similar programming languages. The program code may be executed entirely on the user computing device, partially on the user device, as a separate software package, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server. In cases involving a remote computing device, the remote computing device may be connected to the user computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computing device (e.g., through the Internet using an Internet service provider).

[0125] It should be noted that, although several modules or units of the device for action execution are mentioned in the above detailed description, this division is not mandatory. In fact, according to the embodiments of the present disclosure, the features and functions of two or more modules or units described above can be embodied in one module or unit. On the contrary, the features and functions of one module or unit described above can be further divided into multiple modules or units to be embodied.

[0126] In addition, although the steps of the method in the present disclosure are described in a specific order in the drawings, this does not require or imply that the steps must be performed in this specific order, or that all the steps shown must be performed to achieve the desired results. Additionally or alternatively, some steps may be omitted, multiple steps may be combined into one step, and / or one step may be decomposed into multiple steps, etc.

[0127] Through the description of the above implementation, it is easy for those skilled in the art to understand that the example implementation described here can be implemented by software, or by software combined with necessary hardware. Therefore, the technical solution according to the implementation of the present disclosure can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, including several instructions to enable a computing device (which can be a personal computer, a server, a mobile terminal, or a network device, etc.) to execute the method according to the implementation of the present disclosure.

[0128] Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing the invention disclosed herein. This application is intended to cover any modification, use or adaptation of the present disclosure, which follows the general principles of the present disclosure and includes common knowledge or customary techniques in the art that are not disclosed in the present disclosure. The specification and examples are intended to be exemplary only, and the true scope and spirit of the present disclosure are indicated by the appended claims.

Claims

1. A workflow scheduling method, characterized in that: include: Among all the nodes constituting the directed acyclic graph of the workflow to be run, one or more nodes whose in-degree is an initial value and whose state is to be run are selected as nodes to be run; The node to be run is run to completion, thereby obtaining a run-completed node; Decreasing the in-degree of the downstream node of the running completed node by a preset unit; The method further includes: determining the number of directed edges in the directed acyclic graph pointing to a specific node; multiplying the number of directed edges by a preset unit and adding the result of the initial value as the in-degree of the specific node; Send the node task to the node task area for storage, associate the in-degree with the node task identifier and send it to the in-degree storage area for storage, and associate the running status to be run with the node task identifier and store it in the running status storage area; In the in-degree storage area, multiple node task identifiers with in-degrees as initial values ​​are searched, and in the running status storage area, it is determined whether each of the multiple node task identifiers corresponds to a running status of waiting to be run, and the node task identifiers with a running status of waiting to be run are screened out from the multiple node task identifiers, and the node tasks corresponding to the node task identifiers are determined in the node task area.

2. The method according to claim 1, characterized in that: The method further comprises: The in-degrees of all nodes of the directed acyclic graph of the workflow to be executed are calculated.

3. The method according to claim 1 or 2, characterized in that: The in-degree of the root node among all the nodes is an initial value.

4. The method according to claim 1, characterized in that In the process of completing the operation of the node to be operated and obtaining the node completed, the method further includes: During the operation, mark the node status as running; After the run is completed, mark the node status as final.

5. The method according to claim 2, characterized in that: The method further comprises: Sending the in-degrees of all the nodes to the server for storage; Accordingly, reducing the in-degree of the downstream node of the running completed node by a preset unit includes: On the server, the in-degree of the downstream node of the running completed node is reduced by a preset unit.

6. A workflow scheduling device, characterized in that: include: A node selection unit to be run is used to select one or more nodes whose in-degree is an initial value and whose state is to be run from all the nodes of the directed acyclic graph constituting the workflow to be run as nodes to be run; An operation unit, used to complete the operation of the node to be operated to obtain an operation completed node; An in-degree reduction unit, used to reduce the in-degree of the downstream node of the running completed node by a preset unit; The device further comprises: an in-degree calculation unit, configured to determine the number of directed edges in the directed acyclic graph pointing to a specific node; multiplying the number of directed edges by a preset unit and adding the result of the initial value as the in-degree of the specific node; Send the node task to the node task area for storage, associate the in-degree with the node task identifier and send it to the in-degree storage area for storage, and associate the running status to be run with the node task identifier and store it in the running status storage area; In the in-degree storage area, multiple node task identifiers with in-degrees as initial values ​​are searched, and in the running status storage area, it is determined whether each of the multiple node task identifiers corresponds to a running status of waiting to be run, and the node task identifiers with a running status of waiting to be run are screened out from the multiple node task identifiers, and the node tasks corresponding to the node task identifiers are determined in the node task area.

7. The device according to claim 6, characterized in that The device also includes: The in-degree calculation unit is used to calculate the in-degrees of all nodes of the directed acyclic graph of the workflow to be executed.

8. The device according to claim 6 or 7, characterized in that The in-degree of the root node among all the nodes is an initial value.

9. The device according to claim 6, characterized in that The operation unit is further used for: During the operation, mark the node status as running; After the run is completed, mark the node status as final.

10. The device according to claim 7, characterized in that The device also includes: A sending unit, used for sending the in-degrees of all the nodes to a server for storage; Correspondingly, the in-degree reducing unit is further used to: reduce the in-degree of the downstream node of the running completed node by a preset unit on the server.

11. A workflow scheduling server, characterized in that: include: A memory for storing computer executable code; A processor, configured to execute the computer executable code stored in the memory to implement the method according to any one of claims 1-5.

12. A computer storage medium, characterized in that: The computer storage medium stores computer executable codes, and when the computer executable codes are executed by a processor, the method according to any one of claims 1 to 5 is implemented.

Citation Information

Patent Citations

  • Method for processing workflow of distributed system and workflow engine system

    WO2017125015A1