Workflow scheduling method and device, execution engine, equipment and program product
By dynamically determining the current layer node in the workflow platform and using the breadth-first search method to execute the workflow, the problem of low workflow execution efficiency in the existing technology is solved, and efficient deployment and execution of large models in complex application scenarios is achieved.
Patent Information
- Application Number
- CN202411954335.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-27
- Publication Date
- 2025-05-02
- Estimated Expiration
- 2044-12-27
AI Technical Summary
The workflow execution engine in the existing workflow platform is difficult to ensure the execution efficiency of workflows, which limits the efficient deployment and execution of large models in complex application scenarios.
By dynamically determining the current layer nodes based on the topological relationship between each node in the target workflow and the execution status and/or execution results of each node, the workflow is executed using a breadth-first search method, reducing the consumption of program stack space and improving the parallel execution capability of multiple branch chains.
On the basis of ensuring the correct execution of workflows, the execution efficiency of workflows is effectively improved, and is suitable for efficient deployment and execution of large models in complex application scenarios.
Smart Images

Figure CN119919083A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of large model application technology, and in particular to a workflow scheduling method, apparatus, execution engine, equipment and program product. Background Art
[0002] With the rapid development of large model technology, workflow platforms have become an indispensable technical support for the efficient deployment and execution of large models in complex application scenarios. The platform integrates resource scheduling, task management and other functions to provide a flexible and efficient workflow management mechanism for the application of large models.
[0003] However, the workflow execution engine in the current workflow platform can hardly guarantee the execution efficiency of the workflow, which greatly limits the application scenarios of large models. Summary of the invention
[0004] Based on the above requirements, the present application proposes a workflow scheduling method, apparatus, execution engine, device and program product to solve the problem of low workflow execution efficiency in the prior art.
[0005] In order to achieve the above technical objectives, this application specifically proposes the following technical solutions:
[0006] The first aspect of the present application provides a workflow scheduling method, comprising:
[0007] Based on the topological relationship between the nodes in the target workflow and the execution status and / or execution result of each node, determine the current layer node; the current layer node includes the start node of the target workflow or the post-node of the previous layer node in each branch path of the target workflow;
[0008] When the current layer node is not empty, each current layer node is executed separately based on the target attribute information of each current layer node.
[0009] The second aspect of the present application provides a workflow scheduling device, comprising:
[0010] A first data processing module, configured to determine a current layer node based on a topological relationship between nodes in a target workflow and an execution state and / or execution result of each node; the current layer node includes a start node of the target workflow or a post-node of a previous layer node in each branch path of the target workflow;
[0011] The second data processing module is used to execute each current layer node separately based on the target attribute information of each current layer node when the current layer node is not empty.
[0012] A third aspect of the present application provides a workflow execution engine, wherein the workflow execution engine is configured to execute any of the workflow scheduling methods described above.
[0013] In a fourth aspect, the present application proposes a storage medium, on which a computer program is stored. When the computer program is executed by a processor, the workflow scheduling method as described above is implemented.
[0014] A fifth aspect of the present application provides an electronic device, comprising:
[0015] Memory and processor;
[0016] The memory is connected to the processor and is used to store programs;
[0017] The processor is used to implement the above-mentioned workflow scheduling method by running the program in the memory.
[0018] In a sixth aspect, the present application proposes a computer program product, comprising computer program instructions, which, when executed by a processor, enable the processor to execute the workflow scheduling method as described above.
[0019] The workflow scheduling method proposed in the present application determines the current layer node based on the topological relationship between each node in the target workflow and the execution status and / or execution result of each node. The current layer node includes the start node of the target workflow or the post-node of the previous layer node in each branch path of the target workflow, so that the current layer node can be dynamically determined according to the breadth-first search method, which effectively reduces the consumption of program stack space, thereby improving the parallel execution capability of the multi-branch chain of the target workflow. The above scheme determines the current layer node in combination with the topological relationship between each node and the real-time execution status and / or execution result of each node, which can ensure that the determined current layer node is more accurate and is the node that must be executed at present, so that the execution efficiency of the target workflow can be effectively improved on the basis of ensuring the correct execution of the target workflow; wherein, when the current layer node is not empty, each current layer node is executed separately based on the target attribute information of each current layer node, thereby, by comprehensively considering the different attribute information of the current layer node, the execution efficiency of the target workflow can be further improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying any creative work.
[0021] Figure 1 A flowchart of a workflow scheduling method provided in an embodiment of the present application.
[0022] Figure 2 A flowchart of another workflow scheduling method provided in an embodiment of the present application.
[0023] Figure 3 A schematic diagram of the structure of a workflow scheduling device provided in an embodiment of the present application.
[0024] Figure 4 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0025] The technical solution of the embodiment of the present application is applicable to the application scenario of the large model, that is, the workflow platform of the large model is used to perform workflow scheduling. The workflow platform provides a flexible and efficient workflow scheduling mechanism for the application of the large model by integrating functions such as resource scheduling and task management. The technical solution of the embodiment of the present application can effectively improve the execution efficiency of the workflow while ensuring the accurate execution of the workflow, thereby meeting the efficient deployment and execution of the large model in complex application scenarios.
[0026] At present, the workflow execution engine in the workflow platform usually uses the large model development middleware to realize the scheduling of the workflow, that is, a middleware object is built for each workflow, and the execution of the workflow is the execution of the middleware object. This solution mainly relies on the reasoning function of the middleware and uses a recursive method to execute the workflow. It builds the entire workflow into an object that can be executed for reasoning, and the large model development middleware controls the execution process of the workflow. It can complete tasks such as chained multi-step reasoning, task planning, and external data source interaction, and the execution of the workflow through the middleware hosting is convenient for the development of the workflow engine. However, the large model development middleware cannot flexibly support the construction of parallel chains of workflows, so the parallel execution of each branch chain in the workflow cannot be supported through this solution, which greatly limits the execution efficiency of the workflow, and cannot be applied to scenarios that require parallel chains, limiting the scalability of the workflow engine.
[0027] The inventor of the present application has found that the execution process of the entire workflow can be abstracted into a directed acyclic graph, and the dependency and execution order between the nodes in the workflow can be clearly described through this structure. During the execution of the workflow, each branch chain can be traversed from front to back using a depth-first search method through the graph engine. Each node performs a corresponding operation based on the received input, and passes the output to the successor node until the workflow execution ends, that is, each branch chain in the directed acyclic graph is recursively executed in the "parent chain set child chain" style, and the child chain is traced back to the parent chain after the execution is completed to achieve the gradual advancement of data and tasks. This solution is completely free from the dependence on the tripartite library during the execution of the workflow, so it has higher scalability and solves the problem that multiple branch chains cannot be executed in parallel through large model development middleware. However, this method requires a large amount of program stack space, limits the nesting depth of parallel branch chains, thereby affecting the parallel execution capability of multiple branch chains, and thus cannot guarantee the execution efficiency of the workflow.
[0028] Based on the above technical status, the inventors of the present application have proposed a new workflow scheduling scheme after research. The workflow scheduling scheme determines the current layer node based on the topological relationship between each node in the target workflow and the execution status and / or execution result of each node. The current layer node includes the start node of the target workflow or the post-node of the previous layer node in each branch path of the target workflow, so that the current layer node can be dynamically determined according to the breadth-first search method, which effectively reduces the consumption of program stack space, thereby improving the parallel execution capability of the multi-branch chain of the target workflow. In addition, the above scheme determines the current layer node in combination with the topological relationship between each node and the real-time execution status and / or execution result of each node, which can ensure that the determined current layer node is more accurate and is the node that must be executed at present, so that the execution efficiency of the target workflow can be effectively improved on the basis of ensuring the correct execution of the target workflow; wherein, when the current layer node is not empty, each current layer node is executed separately based on the target attribute information of each current layer node, thereby, by comprehensively considering the different attribute information of the current layer node, the execution efficiency of the target workflow can be further improved.
[0029] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0030] See also Figure 1 The embodiment of the present application first proposes a workflow scheduling method, which can be executed by a processor in a workflow platform. The method includes:
[0031] S101. Determine a current layer node based on the topological relationship between nodes in the target workflow and the execution status and / or execution result of each node; the current layer node includes the start node of the target workflow or the post-node of the previous layer node in each branch path of the target workflow.
[0032] Specifically, the target workflow may be the workflow currently being executed, and the target workflow may include one or more branch paths, and any branch path may include at least one node. In implementation, a graph model of workflows corresponding to different tasks may be pre-built, and the target workflow may be determined based on the tasks to be executed selected by the user. After receiving the workflow protocol of the target workflow, the graph model of the target workflow may be built based on the workflow protocol, and the workflow protocol may include the user's task requirement information. For any workflow, the graph model of the workflow may characterize the topological relationship between the nodes in the workflow, and the topological relationship between the nodes may be used to characterize the dependency relationship and execution order between the nodes, etc. For example, the graph model may be a directed acyclic graph, and thus, the topological relationship between the nodes in the target workflow may be quickly and effectively determined based on the graph model of the target workflow.
[0033] Among them, each node in the target workflow can be executed layer by layer based on the topological relationship between each node and the execution status and / or execution result of each node. For any node, the execution status of the node may include executed, executing, not executed, etc. In implementation, the execution status of the node can be updated in real time during the execution of the node. In addition, the execution result of the node can characterize the data output after the node is executed. For example, when the node is a message node, the execution result of the node may include the message data that needs to be output during the execution of the node. When the node is a branch node, the execution result of the node may include the decision result of the node, etc. In implementation, the execution results of each node can be stored in real time, and the execution result of the node can also be output to the post-node of the node, or the branch path can be selected according to the execution result of the node.
[0034] In practice, in the process of executing each node in the target workflow layer by layer, each node in each layer can be executed concurrently or in parallel. And each node in each layer can include nodes in multiple branch paths, that is, multiple branch paths can be executed in parallel.
[0035] Among them, when the current layer node is a first layer node, the current layer node may include the start node of the target workflow. When the current layer node is a node other than the first layer node, the current layer node may include the post-node of the previous layer node in part or all of the branch paths of the target workflow. For any node, the post-node of the node may include a node that is adjacent to the execution order of the node and is executed after the node. It can be understood that the current layer node may include the post-node of each previous layer node, and may also include the post-node of some previous layer nodes in each previous layer node. In addition, for any previous layer node, the current layer node may include all the post-nodes of the previous layer node, and may also include some of the post-nodes of the previous layer node. That is, the current layer node can be dynamically determined according to the breadth-first search method based on the topological relationship between the nodes in the target workflow, thereby effectively reducing the consumption of program stack space, thereby improving the parallel execution capability of the multi-branch chain of the target workflow, thereby effectively improving the execution efficiency of the target workflow.
[0036] In implementation, the current layer node can be determined based on the topological relationship between the nodes in the target workflow and the execution status and / or execution result of each node. For example, when the current layer node is a first layer node, the start node can be determined based on the topological relationship between the nodes. For any start node, when the execution status of the start node is not executed, the start node can be used as the current layer node. Among them, based on the topological relationship between the nodes, each node without a predecessor node can be used as the start node. For any node, the predecessor node of the node can include a node that is adjacent to the execution order of the node and is executed before the node.
[0037] When the current layer node is a node other than the first layer node, all the successor nodes of each previous layer node can be determined based on the topological relationship between the nodes, and the current layer node can be determined from the successor nodes based on the execution status and / or execution results of each node. Wherein, for any successor node, when there is no branch node in the predecessor node of the successor node, it can be determined whether to use the successor node as the current layer node based on the execution status of the successor node and the execution status of each predecessor node of the successor node. For example, when the execution status of the successor node is not executed, and the execution status of each predecessor node of the successor node is executed or being executed, the successor node can be used as the current layer node, and when the execution status of the successor node is executed or being executed, and / or when there is at least one node in each predecessor node of the successor node whose execution status is not executed, the successor node is not used as the current layer node.
[0038] In addition, when there is a branch node in the predecessor node of the post-positioned node, the branch path to be executed can be determined based on the execution result of the branch node, and whether to use the post-positioned node as the current layer node can be determined based on the positional relationship between the post-positioned node and the branch path to be executed, the execution status of the post-positioned node, and the execution status of each predecessor node of the post-positioned node. For example, when the first condition, the second condition, and the third condition are all met, the post-positioned node is used as the current layer node, and when at least one of the first condition, the second condition, and the third condition is not met, the post-positioned node is not used as the current layer node. Among them, the first condition can include that the post-positioned node is located in the branch path to be executed, the second condition can include that the execution status of the post-positioned node is not executed, and the third condition can include that the execution status of each predecessor node of the post-positioned node is executed or executing.
[0039] Therefore, by combining the topological relationship between each node and the real-time execution status and / or execution results of each node to determine the current layer node, it can be ensured that the determined current layer node is more accurate and is the node that must be executed at present, thereby effectively improving the execution efficiency of the target workflow while ensuring the correct execution of the target workflow.
[0040] S202. When the current layer node is not empty, execute each current layer node separately based on the target attribute information of each current layer node.
[0041] Specifically, when the current layer node is not empty, it indicates that there are nodes to be executed in the target workflow. At this time, each current layer node can be executed based on the target attribute information of each current layer node. For any node, the target attribute information of the node can be used to determine the execution priority of the node, the execution timing of the node, the start time of the next layer node, etc. For example, the target attribute information can include the attribute value of at least one of the attributes such as the predetermined execution time, the number of dependent nodes, the target response rate, the execution status of the dependent node, the target timeout duration, and the redundant identification information.
[0042] Among them, in the process of executing each current layer node based on the target attribute information of each current layer node, each current layer node can be executed concurrently or in parallel based on the target attribute information of each node, or each current layer node can be executed in a corresponding order, or the corresponding current layer node can be executed in a corresponding execution timing. In the process of executing each current layer in a corresponding order, for the same execution order, multiple current layer nodes executed in parallel can be included, or only one current layer node can be included, so that by comprehensively considering the different attribute information of the current layer nodes, the execution efficiency of the target workflow can be further improved under the premise of ensuring the effective execution of each current layer node.
[0043] In some embodiments, determining the current layer node based on the topological relationship between the nodes in the target workflow and the execution status and / or execution result of each node includes:
[0044] Determine the subsequent nodes of each of the previous layer nodes based on the topological relationship between the nodes in the target workflow;
[0045] Determine a candidate node from the subsequent nodes based on the execution status of each of the subsequent nodes and the execution status of the predecessor nodes of each of the subsequent nodes;
[0046] The current layer node is determined from the candidate nodes based on the type of the predecessor node of each candidate node.
[0047] Specifically, based on the topological relationship between the nodes in the target workflow, the successor node of each previous layer node can be determined respectively. For example, for any previous layer node, the node that is connected to the previous layer node in the topological relationship and whose execution order is after the previous layer node can be used as the successor node of the previous layer node.
[0048] Wherein, based on the execution state of each post-positioned node and the execution state of the preceding node of each post-positioned node, a candidate node can be determined from each post-positioned node. For example, for any post-positioned node, when the execution state of the post-positioned node is not executed, and the execution states of the preceding nodes of the post-positioned node all meet the target condition, the post-positioned node can be used as a candidate node. Wherein, the target condition can include that the execution state is being executed or has been executed. It is understandable that when the execution state of the post-positioned node is executed or being executed, and / or, among the preceding nodes of the post-positioned node, there is at least one preceding node that does not meet the target condition, the post-positioned node is not used as a candidate node.
[0049] Optionally, for any node, the target condition corresponding to the node can be pre-configured as having been executed or being executed. Among them, the target condition corresponding to the node can be determined based on the scheduled execution duration of the node. For example, when the scheduled execution duration of the node is greater than the duration threshold, the target condition corresponding to the node can be configured as being executed, and when the scheduled execution duration of the node is less than or equal to the duration threshold, the target condition corresponding to the node can be configured as having been executed. In addition, it is also possible to determine whether the target condition corresponding to the node has been executed or is being executed based on the number of dependent nodes in the post-nodes of the node. For example, when the number of dependent nodes is greater than 0, the target condition corresponding to the node can be configured as having been executed, and when the number of dependent nodes is equal to 0, the target condition corresponding to the node can be configured as being executed. It can be understood that, for any node, the dependent nodes of the node may include nodes that depend on the execution result of the node during the execution process.
[0050] For any candidate node, the current layer node can be determined from the candidate nodes based on the types of the predecessor nodes of the candidate node. For any node, the type of the node can include a branch node, a message node, etc. In implementation, whether to use the candidate node as the current layer node can be determined based on whether the types of the predecessor nodes of the candidate node include a branch node, so as to ensure that the determined current layer node is more accurate and is the node that must be executed at present, thereby effectively improving the execution efficiency of the target workflow on the basis of ensuring the correct execution of the target workflow.
[0051] In some embodiments, the determining the current layer node from the candidate nodes based on the type of the predecessor node of each candidate node includes:
[0052] Based on the types of the predecessor nodes of the candidate node, determining whether the predecessor nodes of the candidate node include a branch node;
[0053] When the preceding node of the candidate node includes a branch node, determining a branch path to be executed based on the execution result of the branch node, and determining whether to use the candidate node as a current layer node based on the positional relationship between the candidate node and the branch path to be executed;
[0054] When the preceding node of the candidate node does not include a branch node, the candidate node is used as the current layer node.
[0055] Specifically, for any candidate node, it can be determined whether there is a branch node in each of the predecessor nodes of the candidate node based on the type of each of the predecessor nodes of the candidate node. For any node, if the node is connected to multiple branch paths whose execution order is after the node, the node can be used as a branch node.
[0056] Branch nodes can be used to make conditional judgments. For example, conditional judgments can be made based on the execution results output by the predecessor node of the branch node and predetermined judgment conditions, so as to select a branch path to be executed from the branch path connected to the node according to the conditional judgment results. In addition, branch nodes can also be used to make decisions. For example, decisions can be made based on the execution results output by the predecessor node of the branch node and a pre-configured decision method, so as to select a branch path to be executed from the branch path connected to the node according to the decision results. Decisions can also be made based on the execution results output by the predecessor node of the branch node through the large model connected to the branch node, so as to select a branch path to be executed from the branch path connected to the node according to the decision results, wherein the large model can make decisions by performing semantic extraction, decision analysis, etc. on the execution results output by the predecessor node of the branch node.
[0057] Wherein, when the preceding node of the candidate node includes a branch node, the branch path to be executed can be determined based on the execution result of the branch node, and the branch path to be executed is the branch path currently to be executed in each branch path connected by the branch node and whose execution order is located after the branch node. In implementation, it can be determined whether to use the candidate node as the current layer node based on the positional relationship between the candidate node and the branch path to be executed. Wherein, the positional relationship between the candidate node and the branch path to be executed can include being located on the branch path to be executed and not being located on the branch path to be executed. When the candidate node is located on the branch path to be executed, the candidate node can be used as the current layer node, and when the candidate node is not located on the branch path to be executed, the candidate node is not used as the current layer node. It can be understood that when the preceding node of the candidate node includes multiple branch nodes, the candidate node can be used as the current layer node when the candidate node is located on the branch path to be executed corresponding to any branch node, and when the candidate node does not exist in the branch path to be executed corresponding to each branch node, the candidate node is not used as the current layer node.
[0058] In addition, when the preceding node of the candidate node does not include a branch node, the candidate node can be used as the current layer node.
[0059] Therefore, through the scheme of this embodiment, it can be ensured that the determined current layer node is more accurate and is the node that must be executed currently, thereby being able to effectively improve the execution efficiency of the target workflow on the basis of ensuring the correct execution of the target workflow.
[0060] In some embodiments, executing each of the current layer nodes based on the target attribute information of each of the current layer nodes respectively includes:
[0061] When there are multiple nodes in the current layer, determining the execution priority of each node in the current layer based on the target attribute information of each node in the current layer;
[0062] Execute each of the current layer nodes based on the execution priority of each of the current layer nodes.
[0063] Specifically, when there are multiple current layer nodes, the execution priority of each current layer node can be determined based on the target attribute information of each current layer node. It can be understood that the target attribute information can include an attribute value of a target attribute or multiple attribute values of target attributes.
[0064] Among them, when the target attribute information includes an attribute value of a target attribute, the execution priority of each current layer node can be determined based on the attribute value of each current layer node under the target attribute and the predetermined correspondence between the attribute value and the execution priority. When the target attribute information includes the attribute values of multiple target attributes, the execution priority of each current layer node under each target attribute can be obtained respectively, and the final execution priority of each current layer node can be determined based on the weight coefficient corresponding to each target attribute and the execution priority of each current layer node under each target attribute. For example, for any current layer node, the execution priority of the current layer node under each target attribute can be weighted and summed based on the weight coefficient corresponding to each target attribute to obtain the final execution priority of the current layer node.
[0065] For any target attribute, the predetermined correspondence between the attribute value of the target attribute and the execution priority may include a positive correlation between the execution priority and the attribute value of the target attribute, that is, the larger the attribute value of the target attribute, the higher the execution priority, and the smaller the attribute value of the target attribute, the lower the execution priority. The predetermined correspondence between the attribute value of the target attribute and the execution priority may also include a negative correlation between the execution priority and the attribute value of the target attribute, that is, the larger the attribute value of the target attribute, the lower the execution priority, and the smaller the attribute value of the target attribute, the higher the execution priority. In addition, the predetermined correspondence between the attribute value of the target attribute and the execution priority may also include an execution priority that corresponds one-to-one to each candidate attribute value of the target attribute.
[0066] During implementation, for any target attribute, the attribute values of each current layer node under the target attribute can be sorted, and based on the sorting result and the corresponding predetermined correspondence, the execution priority of each current layer node under the target attribute can be determined. The attribute values of each current layer node under the target attribute can also be matched with the candidate attribute values in the corresponding predetermined correspondence, and the execution priority of each current layer node under the target attribute can be determined based on the matching result, so that the execution priority of each current layer node under the target attribute can be determined quickly and accurately.
[0067] After determining the final execution priority of each current layer node, each current layer node can be executed based on the final execution priority of each current layer node. For example, each current layer node can be executed concurrently through a coroutine based on the final execution priority of each current layer node, or each current layer node can be executed in parallel through multiple threads based on the final execution priority of each current layer node, thereby effectively improving the execution efficiency of the target workflow while ensuring that key nodes are executed first.
[0068] It can be understood that when executing each current layer node in parallel through multiple threads, when the number of allocatable threads is greater than or equal to the number of current layer nodes, a thread can be allocated to each current layer node respectively, so as to execute the corresponding current layer node through the allocated threads, wherein each thread can execute the corresponding current layer node based on the target execution timing of the corresponding current layer node, thereby being able to further improve the execution efficiency of the target workflow while ensuring the effective execution of each current layer node.
[0069] In addition, when the number of current layer nodes is one, execution resources can be directly allocated to the current layer node, and based on the target attribute information of the current layer node, the current layer node can be executed through the allocated execution resources. For example, the target execution timing of the current layer node can be determined based on the target attribute information of the current layer node, and when the target execution timing of the current layer node is reached, the current layer node can be executed through the allocated execution resources, thereby ensuring the effective execution of the current layer node.
[0070] In some embodiments, the target attribute information includes an attribute value of at least one of a predetermined execution time, a number of dependent nodes, a target response rate, and an execution state of a dependent node.
[0071] Specifically, for any current layer node, the target attribute information of the current layer node may include the scheduled execution time of the current layer node. The scheduled execution time may represent the theoretical execution time of the current layer node. In implementation, the scheduled execution time of each node in the target workflow may be preconfigured. Among them, for any node in the target workflow, the scheduled execution time of the node may be determined based on the historical execution data of the node. For example, multiple historical execution times of the node may be obtained, and the target statistical results of each historical execution time may be used as the scheduled execution time of the node. The target statistical results of each historical execution time may include the mean, median, maximum, minimum, etc. of each historical execution time, which may be set according to actual needs. Among them, the multiple historical execution times of the node may include historical execution times under multiple different execution conditions. Different execution conditions may include different execution modes, such as concurrent execution mode, parallel execution mode, serial execution mode, etc. For the historical execution time under the same execution mode, the historical execution time under different resource allocation conditions may also be included, thereby effectively improving the accuracy of the determination result of the scheduled execution time of each node in the target workflow.
[0072] In implementation, after determining the current layer node, the execution priority of each current layer node can be determined based on the scheduled execution time of each current layer node. Among them, the execution priority can be positively correlated with the scheduled execution time, that is, for any current layer node, the longer the scheduled execution time of the current layer node, the higher the execution priority of the current layer node, and conversely, the shorter the scheduled execution time of the current layer node, the lower the execution priority of the current layer node. Therefore, by giving priority to executing the current layer node with a longer scheduled execution time, in the process of executing the next layer node, the subsequent node of the current layer node in the next layer node can be executed in time according to the execution status and / or execution result of the current layer node, that is, the waiting time of the subsequent node of the current layer node in the next layer node is reduced, so that the overall time consumption of the target workflow in the execution process can be effectively reduced, thereby achieving an effective improvement in the execution efficiency of the target workflow.
[0073] The target attribute information of the current layer node may also include the number of dependent nodes of the current layer node, and the dependent nodes of the current layer node may include nodes that depend on the execution result of the current layer node during execution. In implementation, the dependent nodes of each node in the target workflow may be pre-configured so that the number of dependent nodes of each node can be quickly and effectively determined during the execution of the target workflow.
[0074] In implementation, after determining the current layer node, the execution priority of each current layer node can be determined based on the number of dependent nodes of each current layer node. Among them, the execution priority can be positively correlated with the number of dependent nodes, that is, for any current layer node, the more dependent nodes the current layer node has, the higher the execution priority of the current layer node, and conversely, the fewer dependent nodes the current layer node has, the lower the execution priority of the current layer node. Therefore, by giving priority to executing the current layer nodes with a large number of dependent nodes, during the execution process of the dependent nodes of the current layer node, it can be executed in time according to the execution result of the current layer node, that is, the waiting time of the dependent nodes of the current layer node is reduced, so that the overall time consumption of the target workflow during the execution process can be effectively reduced, thereby achieving an effective improvement in the execution efficiency of the target workflow.
[0075] The target attribute information of the current layer node may also include the target response rate of the current layer node. The target response rate of the current layer node may include the time required for the current layer node to complete the execution and output the execution result from receiving the input data or executing the trigger signal. In the implementation, the target response rate of the predetermined node in the target workflow can be pre-configured so that the target response rate of the corresponding node can be quickly and effectively determined during the execution of the target workflow. Among them, the predetermined node may include nodes in the target workflow that have high requirements for the response rate during the execution process, such as message nodes. The message node can be used to output message data to the user end during the execution process. The higher response rate can more efficiently respond to questions or requests input by the user end, thereby effectively improving the user experience. Thus, the target response rate of the message node can be pre-configured so that during the execution of the message node, the execution priority of the message node can be determined based on its target response rate to achieve the streaming output of the message, so as to interact with the user in real time.
[0076] During implementation, after determining the current layer node, the execution priority of each current layer node can be determined based on the target response rate of each current layer node. Among them, the execution priority can be positively correlated with the target response rate, that is, for any current layer node, the higher the target response rate of the current layer node, the higher the execution priority of the current layer node, and conversely, the lower the target response rate of the current layer node, the lower the execution priority of the current layer node. It can be understood that for current layer nodes that are not configured with a target response rate, the execution priority corresponding to the target response rate of the current layer node can be the level that represents the lowest execution priority. As a result, during the execution of the target workflow, nodes with higher response rate requirements can be executed preferentially, thereby effectively improving the user experience while improving the overall execution efficiency of the target workflow.
[0077] The target attribute information of the current layer node may also include the execution status of the node on which the current layer node depends. The execution status of the node on which the current layer node depends may be in execution or executed. It is understood that for any node in the target workflow, if the execution status of the node on which the node depends is not executed, the node needs to be removed from the current layer node, that is, the node is not executed in the current layer.
[0078] In implementation, after determining the current layer node, the execution priority of the current layer node can be determined based on the execution status of the node on which the current layer node depends. For example, the execution priority of the current layer node can be determined based on a predetermined correspondence between the execution status and the execution priority. For example, the execution priority of the current layer node whose execution status of the node on which it depends is executed can be higher than the execution priority of the current layer node whose execution status of the node on which it depends is executing. Thus, during the execution process of the current layer node, the current layer node on which the node on which it depends has been executed can be executed preferentially, thereby effectively improving the overall execution efficiency of the target workflow while ensuring the correct execution of the target workflow.
[0079] In addition, after determining the current layer node, the execution timing of the current layer node can also be determined based on the execution status of the node on which the current layer node depends. For example, if the execution status of the node on which the current layer node depends is executing, the execution timing of the current layer node can be determined based on the execution end time of the node on which the current layer node depends; if the execution status of the node on which the current layer node depends is executed, the execution timing of the current layer node can be determined based on the moment when the current layer node receives input data (such as the execution result of the node on which the current layer node depends) or an execution trigger signal, thereby effectively improving the overall execution efficiency of the target workflow while ensuring the correct execution of the target workflow.
[0080] In some embodiments, the target attribute information includes a target timeout duration;
[0081] The executing each of the current layer nodes respectively based on the target attribute information of each of the current layer nodes comprises:
[0082] When the timeout duration of the target node reaches the target timeout duration, the step of determining the current layer node is repeated, and the target node includes the node with the longest predetermined execution duration among the current layer nodes.
[0083] Specifically, during the execution of the target workflow, there are usually nodes that take a long time to execute, such as nodes connected to large models. For nodes that take a long time to execute, if the nodes in the next layer wait for the execution of the node to end before executing, the overall time consumption of the target workflow will be greatly increased.
[0084] In this embodiment, for any current layer node, the target attribute information of the current layer node may also include the target timeout duration of the current layer node. The target timeout duration may be used to characterize the maximum duration that the current layer node is allowed to exceed the target duration during the execution of each current layer node in the target workflow. Among them, the target duration may be used to characterize the expected execution duration at the current layer during the execution of the target workflow. In implementation, the target duration may be determined based on the scheduled execution duration of each current layer node. For example, the minimum execution duration among the scheduled execution durations of each current layer node may be used as the target duration. The mean or median of the scheduled execution durations of each current layer node may also be used as the target duration. The mean, median or maximum value of the scheduled execution durations of each current layer node other than the current layer node with the longest scheduled execution duration may also be used as the target duration.
[0085] In implementation, after determining each current layer node, the target duration and the target node in each current layer node can also be determined, and the target timeout duration of the target node can be determined based on the target duration. The target node can include the node with the longest predetermined execution duration in each current layer node. It is understandable that for each current layer node other than the target node, it is not necessary to determine its target timeout duration.
[0086] Among them, in the process of determining the target timeout duration of the target node based on the target duration, the target timeout duration of the target node can be determined based on the difference between the duration difference and the predetermined threshold, wherein the duration difference is the difference between the predetermined execution duration of the target node and the target duration. For example, when the difference between the duration difference and the predetermined threshold is greater than or equal to 0, the difference between the duration difference and the predetermined threshold can be used as the target timeout duration of the target node, and when the difference between the duration difference and the predetermined threshold is less than 0, any value within the target duration interval can be used as the target timeout duration of the target node, and the upper limit value of the target duration interval can be the duration difference, and the lower limit value of the target duration interval can be 0.
[0087] In the process of executing the target node, the timeout duration of the target node can be obtained in real time. The timeout duration of the target node can include the time difference between the current moment and the specified moment. The specified moment can be the sum of the start moment of the target workflow execution at the current layer and the target duration. When the timeout duration of the target node reaches the target timeout duration, it can jump to the next layer, and update the next layer to the current layer to repeat the step of determining the current layer node. That is, in the execution process of the current layer node, for the current layer node with a longer predetermined execution time, the current layer node can continue to be executed in the execution process of the next layer node, without waiting for its execution to end and output the execution result at the current layer. In this way, the waiting time of each node in the next layer node that does not need to rely on the execution result of the node can be effectively reduced, thereby effectively reducing the overall time consumption of the target workflow during the execution process, thereby achieving an effective improvement in the execution efficiency of the target workflow.
[0088] It is understandable that for nodes in the next layer that need to depend on the execution result of this node, it is necessary to wait until the execution of this node is completed before executing, so as to ensure the effective execution of each node in the target workflow.
[0089] In some embodiments, the target attribute information includes redundant identification information; the redundant identification information is used to characterize the redundant branch path of the branch path where the current layer node is located;
[0090] The executing each of the current layer nodes respectively based on the target attribute information of each of the current layer nodes comprises:
[0091] When the redundant identification information of the current layer node indicates that a redundant branch path exists in the branch path where the current layer node is located, obtaining the execution result of the redundant branch path;
[0092] If there is an execution result of the redundant branch path, the execution result of the redundant branch path is used as the execution result of the branch path where the current layer node is located;
[0093] If there is no execution result of the redundant branch path, the current layer node is executed.
[0094] Specifically, for any current layer node, the target attribute information of the current layer node may also include redundant identification information. The redundant identification information may be used to characterize the redundant branch paths of the branch path where the current layer node is located. Among them, for any branch path in the target workflow, the redundant branch path of the branch path may include the branch paths in the branch paths of the target workflow that have the same execution results as the branch paths. In implementation, redundant identification information may be added to each node in the corresponding branch path in the process of constructing the graph model of the target workflow, so as to mark the corresponding redundant branch paths with the redundant identification information. It is understandable that for each branch path where there is no redundant branch path, the redundant identification information of each node in the branch path may be empty.
[0095] In the process of executing the current layer node, for any current layer node, it is possible to determine whether there is a redundant branch path in the branch path where the current layer node is located based on the redundant identification information of the current layer node. If not, the current layer node can be directly executed. If so, the execution result of the redundant branch path can be obtained.
[0096] Among them, if the execution result of the redundant branch path exists, that is, the redundant branch path has been executed, there is no need to continue executing the branch path where the current layer node is located, and the execution result of the redundant branch path is used as the execution result of the branch path, thereby improving the overall execution efficiency of the target workflow.
[0097] If there is no execution result of the redundant branch path, that is, the redundant branch path has not been completed, the current layer node can be directly executed to ensure the effective execution of the target workflow.
[0098] In some embodiments, it also includes:
[0099] When the current layer node is empty, it is determined that the target workflow execution is finished.
[0100] Specifically, when the current layer node is empty, it indicates that there is no node to be executed in the target workflow. At this time, the target workflow can be directly controlled to end execution, thereby ensuring the effective execution of the target workflow.
[0101] The following is an example of an optional implementation method to illustrate the implementation process of the workflow scheduling method of the present application. Figure 2 As shown, the method includes:
[0102] S201, obtaining the workflow protocol of the target workflow;
[0103] S202, determining the start node of the target workflow based on the workflow protocol, and constructing a topological relationship between nodes in the target workflow;
[0104] S203, adding the start node of the target workflow to the current layer node list; wherein each node in the current layer node list is the current layer node;
[0105] S204, determine whether the node list of the current layer is empty; if it is empty, execute step S209; if it is not empty, execute step S205;
[0106] S205, based on the target attribute information of each node in the current layer node list, execute each node in the current layer node list, and save the execution result of each node in the variable pool;
[0107] S206, determining whether the condition for jumping to the next layer node is met, if so, executing step S207, if not, repeating step S206; wherein, the method for determining whether the condition for jumping to the next layer node is met may include: the timeout duration of the target node in the current layer node list reaches the target timeout duration;
[0108] S207, determining a next-layer node list based on the topological relationship between nodes in the target workflow and the execution status and / or execution result of each node;
[0109] S208, assign the next layer node list to the current layer node list, and execute step S204;
[0110] S209: Control the target workflow to end execution.
[0111] Corresponding to the above-mentioned workflow scheduling method, the present application embodiment also provides a workflow scheduling device, see Figure 3 As shown, the device comprises:
[0112] The first data processing module 301 is used to determine the current layer node based on the topological relationship between the nodes in the target workflow and the execution status and / or execution result of each node; the current layer node includes the start node of the target workflow or the post-node of the previous layer node in each branch path of the target workflow;
[0113] The second data processing module 302 is used to execute each current layer node separately based on the target attribute information of each current layer node when the current layer node is not empty.
[0114] In a possible implementation manner, the first data processing module 301 is specifically configured to:
[0115] Determine the subsequent nodes of each of the previous layer nodes based on the topological relationship between the nodes in the target workflow;
[0116] Determine a candidate node from the subsequent nodes based on the execution status of each of the subsequent nodes and the execution status of the predecessor nodes of each of the subsequent nodes;
[0117] The current layer node is determined from the candidate nodes based on the type of the predecessor node of each candidate node.
[0118] In a possible implementation manner, the first data processing module 301 is specifically configured to:
[0119] Based on the types of the predecessor nodes of the candidate node, determining whether the predecessor nodes of the candidate node include a branch node;
[0120] When the preceding node of the candidate node includes a branch node, determining a branch path to be executed based on the execution result of the branch node, and determining whether to use the candidate node as a current layer node based on the positional relationship between the candidate node and the branch path to be executed;
[0121] When the preceding node of the candidate node does not include a branch node, the candidate node is used as the current layer node.
[0122] In a possible implementation manner, the second data processing module 302 is specifically configured to:
[0123] When there are multiple nodes in the current layer, determining the execution priority of each node in the current layer based on the target attribute information of each node in the current layer;
[0124] Execute each of the current layer nodes based on the execution priority of each of the current layer nodes.
[0125] In a possible implementation, the target attribute information includes an attribute value of at least one of a predetermined execution time, a number of dependent nodes, a target response rate, and an execution state of a dependent node.
[0126] In a possible implementation manner, the target attribute information includes a target timeout duration;
[0127] The second data processing module 302 is specifically used for:
[0128] When the timeout duration of the target node reaches the target timeout duration, the step of determining the current layer node is repeated, and the target node includes the node with the longest predetermined execution duration among the current layer nodes.
[0129] In a possible implementation, the target attribute information includes redundant identification information; the redundant identification information is used to characterize the redundant branch paths of the branch path where the current layer node is located;
[0130] The second data processing module 302 is specifically used for:
[0131] When the redundant identification information of the current layer node indicates that a redundant branch path exists in the branch path where the current layer node is located, obtaining the execution result of the redundant branch path;
[0132] If there is an execution result of the redundant branch path, the execution result of the redundant branch path is used as the execution result of the branch path where the current layer node is located;
[0133] If there is no execution result of the redundant branch path, the current layer node is executed.
[0134] In a possible implementation manner, the second data processing module 302 is further configured to:
[0135] When the current layer node is empty, it is determined that the target workflow execution is finished.
[0136] The workflow scheduling device provided in this embodiment belongs to the same application concept as the workflow scheduling method provided in the above embodiments of this application, and can execute the workflow scheduling method provided in any of the above embodiments of this application, and has the corresponding functional modules and beneficial effects of executing the workflow scheduling method. For technical details not fully described in this embodiment, please refer to the specific processing content of the workflow scheduling method provided in the above embodiments of this application, which will not be repeated here.
[0137] The functions implemented by the above modules can be implemented by the same or different processors respectively, and the embodiments of the present application are not limited thereto.
[0138] It should be understood that each module in the above device can be implemented in the form of a processor calling software. For example, the device includes a processor, the processor is connected to a memory, and instructions are stored in the memory. The processor calls the instructions stored in the memory to implement any of the above methods or realize the functions of each unit of the device, wherein the processor can be a general-purpose processor, such as a CPU or a microprocessor, etc., and the memory can be a memory in the device or a memory outside the device. Alternatively, the unit in the device can be implemented in the form of a hardware circuit, and the functions of some or all units can be realized by designing the hardware circuit. The hardware circuit can be understood as one or more processors; for example, in one implementation, the hardware circuit is an ASIC, and the functions of some or all of the above units are realized by designing the logical relationship of the components in the circuit; for another example, in another implementation, the hardware circuit can be implemented by PLD, taking FPGA as an example, which can include a large number of logic gate circuits, and the connection relationship between the logic gate circuits is configured by a configuration file, so as to realize the functions of some or all of the above units. All units of the above device can be implemented in the form of a processor calling software, or in the form of a hardware circuit, or in part by a processor calling software, and the remaining part is implemented in the form of a hardware circuit.
[0139] In an embodiment of the present application, a processor is a circuit with the ability to process signals. In one implementation, the processor may be a circuit with the ability to read and run instructions, such as a CPU, a microprocessor, a GPU, or a DSP; in another implementation, the processor may implement certain functions through the logical relationship of a hardware circuit, and the logical relationship of the hardware circuit is fixed or reconfigurable, such as a hardware circuit implemented by an ASIC or PLD, such as an FPGA. In a reconfigurable hardware circuit, the process of the processor loading a configuration document to implement the hardware circuit configuration can be understood as the process of the processor loading instructions to implement the functions of some or all of the above units. In addition, it can also be a hardware circuit designed for artificial intelligence, which can be understood as an ASIC, such as an NPU, TPU, DPU, etc.
[0140] It can be seen that each unit in the above device can be one or more processors (or processing circuits) configured to implement the above method, such as: CPU, GPU, NPU, TPU, DPU, microprocessor, DSP, ASIC, FPGA, or a combination of at least two of these processor forms.
[0141] In addition, all or part of the units in the above device can be integrated together, or can be implemented independently. In one implementation, these units are integrated together and implemented in the form of a SOC. The SOC may include at least one processor for implementing any of the above methods or implementing the functions of each unit of the device. The type of the at least one processor may be different, for example, including a CPU and an FPGA, a CPU and an artificial intelligence processor, a CPU and a GPU, etc.
[0142] The embodiment of the present application also provides a workflow execution engine, which is configured to execute the workflow scheduling method described in any of the above embodiments of this specification.
[0143] The embodiment of the present application also provides a workflow platform, which includes the workflow execution engine described in the above embodiment of this specification.
[0144] Another embodiment of the present application also provides an electronic device, see Figure 4 As shown, the electronic device includes:
[0145] Memory 200 and processor 210;
[0146] The memory 200 is connected to the processor 210 and is used to store programs;
[0147] The processor 210 is used to implement the workflow scheduling method described in any of the above embodiments of this specification by running the program stored in the memory 200.
[0148] Specifically, the electronic device may further include: a bus, a communication interface 220 , an input device 230 and an output device 240 .
[0149] The processor 210, the memory 200, the communication interface 220, the input device 230 and the output device 240 are connected to each other via a bus.
[0150] A bus may include a pathway that transfers information between components of a computer system.
[0151] The processor 210 may be a general-purpose processor, such as a general-purpose central processing unit (CPU), a microprocessor, etc., or an application-specific integrated circuit (ASIC), or one or more integrated circuits for controlling the execution of the program of the scheme of the present invention. It may also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.
[0152] The processor 210 may include a main processor, and may also include a baseband chip, a modem, and the like.
[0153] The memory 200 stores a program for executing the technical solution of the present invention, and may also store an operating system and other key services. Specifically, the program may include a program code, and the program code includes a computer operation instruction. More specifically, the memory 200 may include a read-only memory (ROM), other types of static storage devices that can store static information and instructions, a random access memory (RAM), other types of dynamic storage devices that can store information and instructions, a disk storage, a flash, and the like.
[0154] The input device 230 may include a device for receiving data and information input by a user, such as a keyboard, a mouse, a camera, a scanner, a light pen, a voice input device, a touch screen, a pedometer, or a gravity sensor.
[0155] Output device 240 may include devices that allow information to be output to a user, such as a display screen, printer, speaker, etc.
[0156] The communication interface 220 may include any transceiver or the like to communicate with other devices or communication networks, such as Ethernet, Radio Access Network (RAN), Wireless Local Area Network (WLAN), etc.
[0157] The processor 210 executes the program stored in the memory 200 and calls other devices, which can be used to implement each step of any workflow scheduling method provided in the above embodiments of the present application.
[0158] The method in the present application can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented by software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer programs or instructions, and when the computer programs or instructions are loaded and executed on a computer, the process or function described in the present application is executed in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, a network device, a user device, a core network device, an OAM or other programmable device.
[0159] The computer program product may be written in any combination of one or more programming languages to write program codes for performing the operations of the embodiments of the present application, including object-oriented programming languages, such as Java, C++, etc., and conventional procedural programming languages, such as "C" language or similar programming languages. The program code may be executed entirely on the user computing device, partially on the user device, as an independent software package, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server.
[0160] The computer program or instructions may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium, for example, the computer program or instructions may be transmitted from one website, computer, server or data center to another website, computer, server or data center by wired or wireless means. The computer-readable storage medium may be any available medium that can be accessed by a computer or a data storage device such as a server or data center that integrates one or more available media. The available medium may be a magnetic medium, such as a floppy disk, a hard disk, or a magnetic tape; it may also be an optical medium, such as a digital video disk; it may also be a semiconductor medium, such as a solid-state drive. The computer-readable storage medium may be a volatile or non-volatile storage medium, or may include both volatile and non-volatile types of storage media.
[0161] In addition, the embodiment of the present application may also be a storage medium on which a computer program is stored. The computer program is executed by a processor to execute the steps of the workflow scheduling method described in any of the above embodiments of this specification, and specifically the following steps may be implemented:
[0162] S101, based on the topological relationship between the nodes in the target workflow and the execution status and / or execution result of each node, determine the current layer node; the current layer node includes the start node of the target workflow or the post-node of the previous layer node in each branch path of the target workflow;
[0163] S102. When the current layer node is not empty, execute each current layer node separately based on the target attribute information of each current layer node.
[0164] For the aforementioned method embodiments, for the sake of simplicity, they are all described as a series of action combinations, but those skilled in the art should be aware that the present application is not limited by the order of the actions described, because according to the present application, some steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present application.
[0165] It should be noted that each embodiment in this specification is described in a progressive manner, and each embodiment focuses on the differences from other embodiments, and the same or similar parts between the embodiments can be referred to each other. For the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0166] The steps in the methods of the embodiments of the present application can be adjusted in order, combined and deleted according to actual needs, and the technical features recorded in the embodiments can be replaced or combined. The modules and submodules in the devices and terminals in the embodiments of the present application can be combined, divided and deleted according to actual needs.
[0167] In the several embodiments provided in the present application, it should be understood that the disclosed terminals, devices and methods can be implemented in other ways. For example, the terminal embodiments described above are only schematic, for example, the division of modules or submodules is only a logical function division, and there may be other division methods in actual implementation, for example, multiple submodules or modules can be combined or integrated into another module, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or modules, which can be electrical, mechanical or other forms.
[0168] The modules or submodules described as separate components may or may not be physically separated, and the components of the modules or submodules may or may not be physical modules or submodules, that is, they may be located in one place, or they may be distributed on multiple network modules or submodules. Some or all of the modules or submodules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0169] In addition, each functional module or submodule in each embodiment of the present application may be integrated into one processing module, or each module or submodule may exist physically separately, or two or more modules or submodules may be integrated into one module. The above-mentioned integrated modules or submodules may be implemented in the form of hardware or in the form of software functional modules or submodules.
[0170] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in the above description according to function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0171] The steps of the method or algorithm described in conjunction with the embodiments disclosed herein may be implemented directly by hardware, software units executed by a processor, or a combination of the two. The software units may be placed in a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.
[0172] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.
[0173] The above description of the disclosed embodiments enables those skilled in the art to implement or use the present application. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application will not be limited to the embodiments shown herein, but will conform to the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A workflow scheduling method, characterized in that: include: Determine the current layer node based on the topological relationship between the nodes in the target workflow and the execution status and / or execution result of each node; The current layer node includes the start node of the target workflow or the post-node of the previous layer node in each branch path of the target workflow; When the current layer node is not empty, each current layer node is executed separately based on the target attribute information of each current layer node.
2. The method according to claim 1, characterized in that The determining of the current layer node based on the topological relationship between the nodes in the target workflow and the execution status and / or execution result of each node includes: Determine the subsequent nodes of each of the previous layer nodes based on the topological relationship between the nodes in the target workflow; Determine a candidate node from the subsequent nodes based on the execution status of each of the subsequent nodes and the execution status of the predecessor nodes of each of the subsequent nodes; The current layer node is determined from the candidate nodes based on the type of the predecessor node of each candidate node.
3. The method according to claim 2, characterized in that The determining the current layer node from the candidate nodes based on the type of the preceding node of each candidate node includes: Based on the types of the predecessor nodes of the candidate node, determining whether the predecessor nodes of the candidate node include a branch node; When the preceding node of the candidate node includes a branch node, determining a branch path to be executed based on the execution result of the branch node, and determining whether to use the candidate node as a current layer node based on the positional relationship between the candidate node and the branch path to be executed; When the preceding node of the candidate node does not include a branch node, the candidate node is used as the current layer node.
4. The method according to claim 1, characterized in that The executing each of the current layer nodes respectively based on the target attribute information of each of the current layer nodes comprises: When there are multiple nodes in the current layer, determining the execution priority of each node in the current layer based on the target attribute information of each node in the current layer; Execute each of the current layer nodes based on the execution priority of each of the current layer nodes.
5. The method according to claim 1, characterized in that: The target attribute information includes an attribute value of at least one of a predetermined execution time, a number of dependent nodes, a target response rate, and an execution state of a dependent node.
6. The method according to claim 1, characterized in that The target attribute information includes the target timeout duration; The executing each of the current layer nodes respectively based on the target attribute information of each of the current layer nodes comprises: When the timeout duration of the target node reaches the target timeout duration, the step of determining the current layer node is repeated, and the target node includes the node with the longest predetermined execution duration among the current layer nodes.
7. The method according to claim 1, characterized in that The target attribute information includes redundant identification information; the redundant identification information is used to characterize the redundant branch path of the branch path where the current layer node is located; The executing each of the current layer nodes respectively based on the target attribute information of each of the current layer nodes comprises: When the redundant identification information of the current layer node indicates that a redundant branch path exists in the branch path where the current layer node is located, obtaining the execution result of the redundant branch path; If there is an execution result of the redundant branch path, the execution result of the redundant branch path is used as the execution result of the branch path where the current layer node is located; If there is no execution result of the redundant branch path, the current layer node is executed.
8. The method according to any one of claims 1 to 7, characterized in that: Also includes: When the current layer node is empty, it is determined that the target workflow execution is finished.
9. A workflow scheduling device, characterized in that: include: A first data processing module, configured to determine a current layer node based on a topological relationship between nodes in a target workflow and an execution state and / or execution result of each node; the current layer node includes a start node of the target workflow or a post-node of a previous layer node in each branch path of the target workflow; The second data processing module is used to execute each current layer node separately based on the target attribute information of each current layer node when the current layer node is not empty.
10. A workflow execution engine, characterized in that: The workflow execution engine is configured to execute the workflow scheduling method according to any one of claims 1 to 8.
11. An electronic device, characterized in that: include: Memory and processor; The memory is connected to the processor and is used to store programs; The processor is used to implement the workflow scheduling method according to any one of claims 1 to 8 by running the program in the memory.
12. A computer program product, characterized in that The method comprises computer program instructions, which, when executed by a processor, enable the processor to execute the workflow scheduling method according to any one of claims 1 to 8.
Citation Information
Patent Citations
ETL work flow analysis method based on breadth-first search algorithm
CN107315834A
Workflow control method, workflow node and workflow control system
CN111382983A
Business data processing method and device and server
CN112766907A
Multi-task processing method and system
CN114048011A
Task processing method and device, electronic equipment and storage medium
CN116048757A