Method and device for processing workflow

By decomposing the source workflow into candidate workflows and determining the target workflow, the problem of low performance of traditional workflow engines in online high-concurrency scenarios is solved, and support for conditional nodes and execution efficiency are improved.

CN118567795AActive Publication Date: 2024-08-30DITU (BEIJING) TECH CO LTD
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
CN202310827875.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-07-06
Publication Date
2024-08-30
Estimated Expiration
2043-07-06

AI Technical Summary

Technical Problem

Traditional workflow engines are difficult to effectively support workflows containing conditional nodes in online high-concurrency scenarios, resulting in low scheduling execution performance and inability to meet business needs.

Method used

By obtaining the source workflow, decompose it into multiple candidate workflows based on the different value conditions of the condition nodes, remove the condition nodes, and determine the target workflow before the business process is executed, thereby controlling the execution of the business process, using parallel breadth traversal Algorithms and coroutine synchronizers improve execution efficiency.

Benefits of technology

It implements support for workflows containing conditional nodes, improves the execution performance of the workflow engine, saves coroutine resources, reduces synchronization overhead, and is suitable for online high-concurrency scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118567795A
    Figure CN118567795A
Patent Text Reader

Abstract

According to the embodiment of the invention, a method, device and equipment for processing workflow, a computer readable storage medium and a computer program product are provided. The method comprises the steps that a source workflow is obtained, the source workflow comprises condition nodes, and each condition node is provided with a plurality of subsequent nodes corresponding to different value conditions; based on different value conditions of a group of condition nodes, decomposing the source workflow into a plurality of candidate workflows, so that the plurality of candidate workflows do not comprise the condition nodes; before the business process is executed, determining a target workflow for the business process from the plurality of candidate workflows according to the values of the business process about the group of condition nodes; and controlling execution of the business process according to the target workflow. Therefore, the execution performance of the workflow can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] Example embodiments of the present disclosure generally relate to the field of computers, and more particularly, to methods, devices, apparatuses, computer-readable storage media, and computer program products for processing workflows. Background Art

[0002] Workflow refers to the automation of part or all of a business process in a computer application environment. It is an abstract and general description of the business rules between the workflow and its various operation steps.

[0003] A workflow engine is a tool used to design and drive workflows. The workflow engine extracts complex business processes from business systems and uses workflows to define the business processes. The business system can then call the workflow engine to execute the business process according to the pre-defined workflow. In order to improve the scheduling performance of the workflow engine, an efficient scheduling execution algorithm needs to be provided. Summary of the invention

[0004] In a first aspect of the present disclosure, a method for processing a workflow is provided, the method comprising: obtaining a source workflow, the source workflow comprising a set of conditional nodes, each conditional node having a plurality of successor nodes corresponding to different value conditions; based on different value conditions of the set of conditional nodes, decomposing the source workflow into a plurality of candidate workflows, so that none of the plurality of candidate workflows includes the conditional nodes; before the business process is executed, determining a target workflow for the business process from the plurality of candidate workflows according to the values ​​of the set of conditional nodes of the business process; and controlling the execution of the business process according to the target workflow.

[0005] In a second aspect of the present disclosure, there is provided an apparatus for processing a workflow, the apparatus comprising: a source workflow acquisition module, configured to acquire a source workflow, the source workflow comprising a conditional node, each conditional node having a plurality of successor nodes corresponding to different value conditions; a candidate workflow decomposition module, configured to decompose the source workflow into a plurality of candidate workflows based on a set of different value conditions of the conditional nodes, so that none of the plurality of candidate workflows includes the conditional node; a target workflow determination module, configured to determine a target workflow for a business process from a plurality of candidate workflows according to the values ​​of a set of conditional nodes of the business process before the business process is executed; and a control module, configured to control the execution of the business process according to the target workflow.

[0006] In a third aspect of the present disclosure, an electronic device is provided. The device includes at least one processing unit; and at least one memory, the at least one memory is coupled to the at least one processing unit and stores instructions for execution by the at least one processing unit. When the instructions are executed by the at least one processing unit, the device executes the method of the first aspect.

[0007] In a fourth aspect of the present disclosure, a computer-readable storage medium is provided, wherein a computer program is stored on the computer-readable storage medium, and the computer program can be executed by a processor to implement the method of the first aspect.

[0008] In a fifth aspect of the present disclosure, a computer program product is provided, which includes computer executable instructions, and when the computer executable instructions are executed by a processor, the method of the first aspect is implemented.

[0009] It should be understood that the contents described in the summary of the present invention are not intended to limit the key features or important features of the embodiments of the present disclosure, nor are they intended to limit the scope of the present disclosure. Other features of the present disclosure will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0010] The above and other features, advantages and aspects of the embodiments of the present disclosure will become more apparent with reference to the following detailed description in conjunction with the accompanying drawings. In the accompanying drawings, the same or similar reference numerals represent the same or similar elements, wherein:

[0011] Figure 1 A schematic diagram showing an example environment in which embodiments of the present disclosure can be implemented;

[0012] Figure 2 An exemplary architecture diagram of a workflow engine according to an embodiment of the present disclosure is shown;

[0013] Figure 3 A schematic diagram showing an example data structure of a workflow according to some embodiments of the present disclosure;

[0014] Figure 4 A schematic diagram showing an example of converting a source workflow into multiple candidate workflows according to some embodiments of the present disclosure;

[0015] Figure 5 A schematic diagram showing an example of a path decomposition process for determining a candidate workflow according to some embodiments of the present disclosure;

[0016] Figure 6 A schematic diagram showing an example of a workflow and its corresponding coroutine according to some embodiments of the present disclosure;

[0017] Figure 7A schematic diagram showing an example of a workflow according to some embodiments of the present disclosure;

[0018] Figure 8 Shown according to Figure 7 A schematic diagram of an example of the execution time of the workflow shown;

[0019] Fig. 9 A flowchart of a method for processing a workflow according to some embodiments of the present disclosure is shown;

[0020] Fig.10 A block diagram showing an apparatus for processing a workflow according to some embodiments of the present disclosure; and

[0021] Fig.11 A block diagram of a device capable of implementing various embodiments of the present disclosure is shown. DETAILED DESCRIPTION

[0022] Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although certain embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be construed as being limited to the embodiments set forth herein. On the contrary, these embodiments are provided to provide a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are only for exemplary purposes and are not intended to limit the scope of protection of the present disclosure.

[0023] It should be noted that the titles of any sections / subsections provided herein are not restrictive. Various embodiments are described throughout this article, and any type of embodiment may be included under any section / subsection. In addition, the embodiments described in any section / subsection may be combined in any manner with any other embodiments described in the same section / subsection and / or different sections / subsections.

[0024] In the description of the embodiments of the present disclosure, the term "including" and similar terms should be understood as open inclusion, that is, "including but not limited to". The term "based on" should be understood as "based at least in part on". The term "one embodiment" or "the embodiment" should be understood as "at least one embodiment". The term "some embodiments" should be understood as "at least some embodiments". Other explicit and implicit definitions may be included below. The terms "first", "second", etc. may refer to different or the same objects. Other explicit and implicit definitions may be included below.

[0025] The embodiments of the present disclosure may involve user data, data acquisition and / or use, etc. These aspects are subject to the corresponding laws, regulations and relevant provisions. In the embodiments of the present disclosure, all data collection, acquisition, processing, processing, forwarding, use, etc. are carried out on the premise that the user knows and confirms. Accordingly, when implementing each embodiment of the present disclosure, the type, scope of use, usage scenario, etc. of the data or information that may be involved should be informed to the user and the user's authorization should be obtained in an appropriate manner in accordance with the relevant laws and regulations. The specific notification and / or authorization method can vary according to the actual situation and application scenario, and the scope of the present disclosure is not limited in this respect.

[0026] The solutions described in this specification and in the examples, if they involve the processing of personal information, will be processed on the premise of having a legal basis (such as obtaining the consent of the subject of personal information, or being necessary for the performance of a contract, etc.), and will only be processed within the scope of regulations or agreements. If a user refuses to process personal information other than the necessary information for basic functions, it will not affect the user's use of basic functions.

[0027] The term workflow in the embodiments of the present disclosure refers to the automation of part or all of a business process in a computer application environment, and is an abstract and general description of the business rules between the workflow and its various operation steps. Usually, in order to complete a business, a set of related tasks need to be completed according to a certain process. Each task corresponds to a node in the workflow. The workflow includes the following types of nodes:

[0028] Head node: It can also be described as the starting node. It generally refers to the first node executed in the workflow. The head node does not have a predecessor node.

[0029] Tail node: It can also be described as the end node. It generally refers to the last node executed in the workflow. After the tail node is executed, it indicates the end of the workflow execution. The tail node does not have a successor node.

[0030] Predecessor node and successor node: Among two adjacent nodes that are executed in a sequential order, the node that is executed first is the predecessor node of the node that is executed later. Correspondingly, the node that is executed later is the successor node of the node that is executed first. It is understandable that a node may be a predecessor node of another node and also a successor node of other nodes. For example, node A is the predecessor node of node B adjacent to it, and correspondingly, node B is the successor node of node A. At the same time, node A can also be the successor node of node C adjacent to it. In addition, a node may have multiple predecessor nodes, for example, node A has multiple predecessor nodes in a parallel relationship. A node may also have multiple successor nodes, for example, node A has multiple successor nodes in a parallel relationship.

[0031] Conditional node: It can also be called a decision node or a judgment node. A conditional node predefines a set of conditions. When the workflow reaches this node, it will make a judgment based on the conditions, and the path that meets the conditions will be executed.

[0032] Traditional workflow engines are generally used in low-concurrency scenarios such as office automation. Tasks scheduled in workflows generally take minutes, hours, or even days to complete. The duration of tasks is not the primary consideration. The main challenge lies in the ability to allocate and schedule machine resources and executed tasks in a distributed environment. Unlike traditional workflow engines, online workflow engines are generally used in high-concurrency scenarios such as the Internet, and the task scheduling in workflows is performed on a single machine. In order to meet business needs, the task scheduling of a single node in a workflow generally takes milliseconds. The main challenge of online workflow engines lies in the scheduling and execution performance of multi-threads or coroutines in a multi-CPU environment. Due to the above differences, traditional workflow engines are not suitable for online high-concurrency scenarios. However, most online workflow engines have weak support capabilities for workflows that can be easily implemented in traditional workflow engines, such as workflows with conditional branches and support for sub-workflows.

[0033] For example, in online high-concurrency scenarios, workflows are usually multi-layer serial-parallel hybrid workflows. In multi-layer serial-parallel hybrid workflows, multiple nodes often need to be executed in parallel. In addition, it is often necessary to select one node from multiple nodes for execution. In this case, the workflow needs to include conditional nodes.

[0034] However, the emergence of conditional nodes makes the workflow scheduling and execution algorithm more complicated. For performance reasons, there are not many workflow engines that can effectively support conditional nodes in online high-concurrency scenarios. Therefore, as discussed above, in order to improve the performance of the workflow engine, the workflow needs to be processed.

[0035] In view of this, the present application proposes a solution for processing workflows. According to the solution, a source workflow can be obtained, wherein the source workflow includes a set of conditional nodes, each conditional node having multiple successor nodes corresponding to different value conditions. Accordingly, the source workflow can be decomposed into multiple candidate workflows based on different value conditions of the set of conditional nodes, so that the decomposed multiple candidate workflows do not include the conditional nodes.

[0036] Furthermore, before the business process is executed, a target workflow for the business process can be determined from multiple candidate workflows based on the values ​​of a set of conditional nodes in the business process. Accordingly, the execution of the business process can be controlled based on the target workflow.

[0037] In this way, according to the values ​​of the conditional nodes of the business process to be executed, the target workflow is selected from the multiple candidate workflows obtained by decomposition to execute the business process. This enables the workflow engine to support workflows containing conditional nodes. In addition, since the workflow is decomposed in advance according to the values ​​of the conditional nodes, it avoids the need to judge the execution path in real time every time the execution is scheduled, thereby improving the execution performance of the workflow engine.

[0038] In addition, the present disclosure also provides a solution for scheduling workflows. In this solution, a "parallel breadth traversal algorithm" is used. If a node has multiple successor nodes to be executed, the multiple successor nodes to be executed can start multiple coroutines for parallel execution, thereby improving the execution efficiency of the node. In some embodiments, if the current node has only a single successor node, the coroutine used to execute the current node can be used to continue to execute the successor node, thereby saving coroutine resources. In some embodiments, a coroutine synchronizer can also be used to reduce the overhead of synchronization between coroutines.

[0039] In the following, we will first refer to Figure 1 An example environment is described in which embodiments according to the present disclosure can be implemented.

[0040] Example Environment

[0041] Figure 1 1 shows a block diagram of an example environment 100 in which embodiments of the present disclosure can be implemented. The example environment 100 includes a workflow management system 110, a configuration distribution layer 120, and a workflow engine 130.

[0042] The workflow management system 110 is used by users to configure workflows, such as creating, deleting, modifying, viewing, importing, and exporting workflows. Users can also review and publish workflows through the workflow management system 110. The configuration information of the workflow can be stored in the database 140. As an example, Figure 1 The database 140 in the workflow management system 110 is independent of the workflow management system 110. In other examples, the database 140 can also be used as a submodule of the workflow management system 100 and integrated in the workflow management system 100. The embodiment of the present disclosure does not limit the implementation form of the database 140. In addition, the workflow management system 110 is also used to distribute the configuration information of the workflow to the configuration distribution layer 120.

[0043] The configuration distribution layer 120 is used to obtain the configuration information of the workflow from the workflow management system 110 and distribute it through different channels, such as publishing it to different storage media such as redis cluster, zookeeper cluster and other distributed caches, global configuration center or local disk, etc. It can also be directly exported to a file in a specific format, such as a json file, and then the developer copies the exported json file to the relevant project directory and runs it in a local loading mode. As an example, Figure 1 The two types of distribution channels, storage media and files, are given as examples. The present disclosure does not limit the types, quantity, etc. of channels for distributing workflows.

[0044] The workflow engine 130 is generally embedded in the service provided by the workflow engine 130 in the form of a component (or SDK). It provides a method to load workflow configuration information from the configuration distribution layer to build a workflow engine instance (or described as a workflow engine object). After the instance or object is built, the service can be provided with the ability to schedule and execute workflows. As an example, Figure 1 In the example, three services (service 1, service 2, service 3) and corresponding workflow engines are given. The types of workflow engines embedded in different services can be the same or different. The present disclosure does not limit the number and type of services and the type and number of workflow engines.

[0045] The workflow management system 110 can be implemented as different devices or device clusters. The device or device cluster can be a terminal device or a terminal device cluster, or a server or a server cluster. For example, the workflow management system is a server. The business system is a server cluster composed of multiple servers.

[0046] The workflow management system 110 , the configuration distribution layer 120 , and the workflow engine 130 may be integrated into one platform, such as a workflow platform.

[0047] It should be understood that the functions of various systems or modules in the environment 100 are described for exemplary purposes only and do not imply any limitation on the scope of the present disclosure.

[0048] Figure 2 A schematic diagram of an architecture for processing workflows according to some embodiments of the present disclosure is shown. The architecture can be implemented in Figure 1 In the workflow engine 130. Figure 2 In the example of , the architecture 200 includes three parts: a pre-processing module 210 , a core processing module 220 , and an operator library 230 .

[0049] It is understandable that the architecture 200 may also include more or fewer modules. The above two or more modules may be integrated into one module, or one of the above modules may be divided into more sub-modules. The functions of a module described below may be implemented in the module or in other modules. The embodiments of the present disclosure do not limit the division method and function implementation of the modules in the architecture.

[0050] The functions of each module are described below by way of example.

[0051] The preprocessing module 210 is used to preprocess the workflow to be scheduled for execution, including loading the workflow, setting the head and tail nodes, setting the predecessor node, workflow path decomposition, etc., in order to help the subsequent core processing module simplify the processing logic and improve performance. The core processing module 220 is used to be called when providing external services after the workflow engine is initialized. The core processing module 220 includes two submodules: an initialization module 221 and a scheduling execution module 222. Among them, the initialization module 221 is responsible for completing the initialization of context information. The scheduling execution module 222 includes two main submodules: a workflow scheduling submodule D and a node execution submodule E. In some embodiments of the present disclosure, the operator library 230 includes two types of operators, one is a general operator built into the engine, such as an operator of a conditional judgment class; and the other is a business operator provided by the business layer. In some embodiments of the present disclosure, the operator name is the same as the node name in the workflow. All operators provide an execution method with the same name (the method name is defined by the engine layer, such as: Run, Execute, etc., and the upper business layer implements the business logic according to the name defined by the engine layer). When executing a node below, the default method of the operator with the same name as the node is actually executed.

[0052] In some embodiments of the present disclosure, the pre-processing module 210 is called when the workflow engine is initialized.

[0053] In some embodiments of the present disclosure, the pre-processing module 210 first obtains or loads one or more workflows to be scheduled for execution.

[0054] Optionally, the preprocessing module 210 reads the configuration information of all workflows to be executed (described as workflow sets below) from a data source for storing workflows (for example, the distributed cache, global configuration center, or local disk involved in the configuration distribution layer 120 mentioned above) into memory and generates a workflow set of a specific data structure.

[0055] refer to Figure 3, exemplarily showing an example of a workflow with a map structure. The map structure is a two-dimensional array, and the data format is a key-value pair (Key-Value) format. In this example, the configuration information of the workflow is deserialized into a workflow 300 with a map structure, wherein the key (key) 310 is the identifier of the workflow (workflowId), and the value (value) 320 is the workflow object (workflow).

[0056] Optionally, a workflow object may include one or more workflow charts, for example, an object workflowChart of the WorkflowChart type.

[0057] Optionally, for each workflowChart object of type WorkflowChart, process it according to the following rules:

[0058] First, you can set the head and tail nodes.

[0059] The head node is a node that does not have a predecessor node. Therefore, the head node can be determined in the following way: for the node set Actions in the workflowChart, if there is a node Action that is not a successor node of any node, then set the node Action as the head node of the workflowChart.

[0060] The tail node is a node that has no successor node. Therefore, for the node set Actions in the workflowChart, if there is a node Action whose successor node list is empty, the node Action is set to the tail node of the workflowChart.

[0061] Furthermore, a predecessor node may be set.

[0062] In some embodiments of the present disclosure, there is a corresponding relationship between the predecessor node and the successor node. For example, for the first node, if the second node is the successor node of the first node, the corresponding first node must be the predecessor node of the second node. Then, through the successor node list of a certain node, the node can be marked as the predecessor node of all nodes in the successor node list. There is no need to traverse all nodes to obtain all predecessor nodes of the node. In this way, the speed of node search can be improved. In other words, the present disclosure marks the first node as the predecessor node of the second node in response to the successor node of the first node being the second node.

[0063] Therefore, for the workflow of the map structure mentioned above, the node set Actions in each object workflowChart of the WorkflowChart type is traversed, and each node Action in the node set Actions is processed according to the following rules: find the successor node list (NextActionIds) of the node Action, and for the node (NextAction) corresponding to each identifier (Id) in the successor node list (NextActionIds), add the identifier (ActionId) of the node (Action) to the predecessor node list (PrevActionIds) of each node (NextAction).

[0064] Through the above two processes, the head node, tail node, and predecessor node of each node are marked in advance, which facilitates the rapid access to nodes during the subsequent workflow scheduling and execution.

[0065] In some embodiments of the present disclosure, based on the workflowChart workflow diagram processed above, if the workflow diagram does not contain a conditional node, the workflow diagram can be directly scheduled. If the workflow diagram contains a conditional node, for the workflow diagram containing the conditional node, it is necessary to perform path decomposition before scheduling execution and process it into multiple workflow diagrams that do not contain conditional nodes.

[0066] In some embodiments of the present disclosure, for a workflow containing a conditional node, the preprocessing module 210 decomposes the workflow into multiple workflows that do not contain a conditional node based on different value conditions of the conditional node.

[0067] The following describes the process of decomposing a workflow that contains conditional nodes into a workflow that does not contain conditional nodes.

[0068] For ease of description, in the present disclosure, a workflow containing a conditional node may be described as a source workflow, and a workflow not containing a conditional node obtained after decomposition may be described as a candidate workflow.

[0069] The source workflow includes two types of nodes: task nodes and condition nodes. Each condition node has multiple successor nodes corresponding to different value conditions.

[0070] refer to Figure 4, is an example of a source workflow. The source workflow 400 includes a group of nodes consisting of 10 nodes from node 0 to node 9. Among them, node 1 and node 4 are conditional nodes, and the remaining nodes are task nodes. For conditional node 1, when its value condition is Y, its corresponding successor node is node 2; when its value condition is N, its corresponding successor node is node 3. For conditional node 4, when its corresponding value condition is Y, its corresponding successor node is node 5; when its value condition is N, its corresponding successor node is node 6.

[0071] In some embodiments of the present disclosure, based on a set of different value conditions of conditional nodes, a source workflow is converted into multiple candidate workflows, so that the multiple candidate workflows do not include conditional nodes.

[0072] The process may include the following steps: determining the successor node of any node (described as the third node in the embodiment of the present disclosure) in the source workflow. If the successor node is a target conditional node in the source workflow, then determining the successor non-conditional node corresponding to the target conditional node in the source workflow as the successor node of the third node in the corresponding candidate workflow. The successor non-conditional node is determined based on the target value condition associated with the target conditional node.

[0073] In other words, when the successor node of the third node in the source workflow is a conditional node, multiple successor non-conditional nodes under different condition values ​​of the conditional node are respectively decomposed into successor nodes of the third node in multiple candidate workflows.

[0074] Afterwards, the target condition node is deleted from the corresponding candidate workflow.

[0075] For example, see Figure 4 , there are two conditional nodes, node 1 and node 4, in the source workflow 400. The values ​​of node 1 and node 4 are divided into two cases, Y and N, so a total of 4 combinations can be obtained: (node ​​1: Y, node 4: Y), (node ​​1: Y, node 4: N), (node ​​1: N, node 4: Y), (node ​​1: N, node 4: N), and the paths decomposed by the latter two combinations are exactly the same and can be merged into one: (node ​​1: N). Then, the source workflow 400 can be decomposed into three candidate workflows: candidate workflows 401, 402 and 403. Among them, candidate workflow 401 is the candidate workflow corresponding to the situation (node ​​1: Y, node 4: Y). Candidate workflow 402 is the candidate workflow corresponding to the situation (node ​​1: Y, node 4: N). Candidate workflow 403 is the candidate workflow corresponding to the situation (node ​​1: N). It can be seen that candidate workflows 401, 402 and 403 do not contain conditional nodes 1 and 4.

[0076] Combination Figure 3 The workflow shown further illustrates the process of decomposing a source workflow into candidate workflows.

[0077] Specifically, a map type object WorkflowCharts can be initialized, whose Key is the identification ID and value of the conditional node, and Value is the decomposed WorkflowChart object. If the source workflow includes multiple conditional nodes, the Key is a string of the identification IDs and values ​​of multiple conditional nodes connected together.

[0078] Furthermore, all conditional nodes in the workflow diagram can be traversed. If the number of conditional nodes is 0, the original workflow diagram WorkflowChart is directly stored in WorkflowCharts, and the Key-Value format is: <*, WorkflowChart>.

[0079] If the number of conditional nodes in the workflow graph is greater than 0, the workflow graph is path decomposed. The specific process is: all conditional nodes are combined according to their values ​​to obtain all combinations. According to each combination of values, a workflow path, namely a candidate workflow, can be determined.

[0080] refer to Figure 5 ,by Figure 4 Taking the candidate workflow 402 in FIG. 1 as an example, the detailed construction process of each candidate workflow includes the following steps.

[0081] In block 501, a candidate workflow may be determined. Based on different values ​​of conditional nodes, the execution path of the candidate workflow may be determined. Figure 5 In the example, when the value of node 1 is Y and the value of node 4 is N, the corresponding execution path is: node 0, node 1, node 2, node 4, node 6, node 9.

[0082] In block 502, the successor node may be recursively set. Starting from the head node, recursively traverse backwards, if a certain node A contains a conditional node C in the successor node list, then the conditional node C is deleted from the successor node list of A, and the successor node N pointed to by the current execution result of the conditional node C is added to the successor node list of node A.

[0083] like Figure 5 In the example, the successor node of node 0 is conditional node 1, and the value of node 1 is Y. Then node 1 is deleted from the successor node list of node 0, and node 2 is added to the successor node list of node 0. Similarly, node 4 is deleted from the successor node list of node 2, and node 6 is added to the successor node list of node 2.

[0084] In block 503, the predecessor node may be recursively set. This process may refer to the process of "setting the predecessor node" described above. That is, recursively traverse backwards from the head node, and for each successor node N of node A, set the predecessor node of N to A. The purpose of this operation is to increase the speed of node search.

[0085] In other words, the above processing of the candidate workflow includes: marking the head node in the candidate workflow; marking the tail node of the candidate workflow; and marking the predecessor nodes of multiple nodes in the candidate workflow.

[0086] In some embodiments of the present disclosure, marking predecessor nodes of multiple nodes in the candidate workflow includes: in response to a successor node of a first node in the candidate workflow being a second node, marking the first node as a predecessor node of the second node.

[0087] like Figure 5 In response to the setting of the successor node in block 502, node 0 is set as the predecessor node of node 2. Node 2 is set as the predecessor node of node 6. Node 6 is set as the predecessor node of node 9.

[0088] In block 504, an island node may be deleted. An island node is a non-head node that has no in-degree in the source workflow. That is, a non-head node that has no in-degree will never be accessed during the workflow traversal process, so it is deleted.

[0089] like Figure 5 Node 1 and node 4 are isolated nodes, so node 1 and node 4 are deleted to obtain candidate workflow 402.

[0090] Through the above steps 501-504, the source workflow can be decomposed to obtain multiple candidate workflows. Afterwards, the decomposed paths (candidate workflows) and the new workflow diagram are stored in the created WorkflowCharts object.

[0091] For example, continue to refer to Figure 3 , shows an example of the corresponding data structure after the source workflow is decomposed into multiple candidate workflows that do not contain conditional nodes.

[0092] n (n≥1) workflows are stored in a map data structure 310. For any workflow, for example, workflow i, it is combined according to different values ​​of multiple condition nodes and then path decomposed to obtain m (m≥2) workflow graphs, whose data structure 320 includes the following elements:

[0093] Identifier i (ID) represents the unique identifier of workflow i; scene identifier (SceneId) i is the identifier of the business scenario corresponding to workflow i. Usually, there may be multiple business scenarios in an application system, and multiple different workflows may need to be configured in each business scenario. When the application system provides services to the outside world, it is necessary to choose to use different workflows according to the actual business scenarios. Workflow Charts is used to describe a collection of m preprocessed workflow graphs. That is, a collection of multiple workflow graphs is obtained by combining different values ​​of multiple conditional nodes in the workflow graph to perform path decomposition. The value of IsDefault is used to indicate that when the business system does not find a matching workflow, this workflow is used by default for execution. The update time (UpdateTime) of the workflow configuration is used to indicate the update time of the workflow configuration information.

[0094] Optionally, an experiment group name (GroupName) may also be included. When the business system performs a specific experiment, a workflow may be configured for each group (the experiment group name is not shown in the figure).

[0095] Furthermore, for each workflow chart (WorkflowChart), taking workflow chart j as an example, its data structure 330 includes the following elements:

[0096] The identifier of the head node (FirstActionId) indicates the ID of the first node executed in the workflow diagram; the identifier of the tail node (LastActionId) indicates the ID of the last node executed in the workflow diagram; the node set (Actions) composed of all nodes contained in the workflow diagram is represented by a Key-Value structure. The content of the Key is the identifier of the node object; the content of the Value is the content description of each node. Figure 5 Node identifiers and node contents of p (p≥2) nodes (node ​​1, node 2, ... node p) are exemplarily shown.

[0097] Furthermore, for each node in the node set, taking node k as an example, its corresponding data structure 340 includes the following elements:

[0098] Node type (ActionType), for example, including two types: task node and condition node; node identifier (ActionId), which represents the unique identifier of the node; parameters contained in the node (Params); list of successor node execution conditions (NextConditions); list of predecessor node identifiers (PrevActionIds); node name (ActionName); list of successor node identifiers (NextActionIds); and node description information (Description).

[0099] After the above processing is performed on each path, the decomposed workflow graph no longer contains conditional nodes. After receiving the request, the subsequent online service only needs to calculate the current values ​​of each conditional node based on the current request parameters, and then select a candidate workflow corresponding to the workflow graph based on the combination of the values ​​of each conditional node for scheduling and execution.

[0100] Still combined Figure 2 ,The following section describes the process of scheduling workflow ,execution of the business.

[0101] In some embodiments of the present disclosure, the core processing module 220 is used to be called when providing external services after the workflow engine is initialized.

[0102] In some embodiments of the present disclosure, the core processing module 220 is used to receive a scheduling request for a service, and in response to the scheduling request for the service, select a target workflow corresponding to the request and control the execution of the business process based on the target workflow. For example, there may be multiple business scenarios in an application system, and multiple different workflows may be configured in each scenario. When the application system provides services to the outside world, it is necessary to select a target workflow based on the actual business scenario.

[0103] The following description takes the target workflow as a candidate workflow obtained by decomposing the source workflow as an example.

[0104] Before the business is executed, the core processing module 220 determines a target workflow for the business process from multiple candidate workflows according to the values ​​of a set of conditional nodes of the business process; and controls the execution of the business process according to the target workflow.

[0105] Exemplary, reference Figure 4 , the target workflow selected by the business process regarding condition node 1 and condition node 4 is candidate workflow 403 .

[0106] See also Figure 2 As an example, the core processing module 220 includes two sub-modules: an initialization module 221 and a scheduling execution module 222 .

[0107] The initialization module 221 is responsible for completing the initialization of the context information.

[0108] Before each scheduling and execution of the workflow graph, an initialization method InitContext needs to be executed to pass some context information into the workflow scheduling and execution function in the form of parameters. The specific initialization work includes:

[0109] In some embodiments, the initialization work includes business context (Ctx) initialization: business information required during workflow execution is stored in Ctx. Optionally, intermediate results during subsequent workflow scheduling execution can also be stored in Ctx.

[0110] Additionally or alternatively, the initialization work also includes initializing the coroutine synchronizer (CA) corresponding to the node: traversing the workflow graph, creating a coroutine synchronizer for each node containing multiple predecessor nodes. Exemplarily, the initial value of the internal counter of the coroutine synchronizer is set to the total number of predecessor nodes of the current node, and the created coroutine synchronizer will be stored in the CA.

[0111] Additionally or alternatively, the initialization work also includes initializing a workflow state synchronizer (CF): creating a coroutine synchronizer for synchronizing the workflow execution state. The initial value of the internal counter of the coroutine synchronizer is set to 1.

[0112] The coroutine synchronizer in the above initialization work is a tool for synchronizing multiple concurrently executed coroutines, which can be implemented in different programming languages. For example: WaitGroup implemented in golang, CountDownLatch implemented in Java, etc. The coroutine synchronizer generally provides an initialization operation: set the count of the built-in counter, and the initial value of the counter is the number of coroutines to be synchronized. Alternatively or additionally, the coroutine synchronizer can also provide a counting operation: in all concurrently executed coroutines, this method is called after each coroutine is executed, and the counter is reduced by 1. Alternatively or additionally, the coroutine synchronizer can also provide a waiting operation: usually after multiple concurrent coroutines are started in the main coroutine, the waiting method will be called to block the main coroutine. When all concurrent coroutines are executed, the counter becomes 0, and the main coroutine will be awakened and continue to execute.

[0113] Additionally or alternatively, the initialization work also includes initializing the nodes to be executed: creating an empty set W for storing the identifiers (IDs) of the nodes waiting to be executed.

[0114] Additionally or alternatively, the initialization work also includes initializing the head node: assigning the head node of the workflow graph to parameter A, which is of type Action.

[0115] After the initialization module 221 completes parameter initialization, the parameters are passed to the scheduling execution module 222 for scheduling and executing the workflow.

[0116] Reference Figure 2 As an example, the scheduling execution module 222 includes two main submodules: a workflow scheduling submodule D and a node execution submodule E. In addition, Figure 2 , six coroutines G1 to G6 are shown, each of which includes a workflow scheduling submodule D and a node execution module E. Moreover, the present disclosure does not limit the number of coroutines G.

[0117] When scheduling and executing a workflow, a common practice in the industry is to allocate a separate coroutine to each node for execution. In some embodiments of the present disclosure, a "parallel breadth traversal" algorithm is used.

[0118] In some embodiments, according to the "parallel breadth traversal algorithm" of the present disclosure, if a node has multiple successor nodes to be executed, the multiple successor nodes to be executed can start multiple coroutines to execute in parallel, thereby improving the execution efficiency of the node.

[0119] Alternatively or additionally, according to the “parallel breadth traversal algorithm” of the present disclosure, if the current node has only a single successor node, the coroutine used to execute the current node can be used to continue executing the successor node, thereby saving coroutine resources.

[0120] Alternatively or additionally, according to the "parallel breadth traversal algorithm" disclosed in the present invention, a coroutine synchronizer can also be used to reduce the synchronization overhead between coroutines. The specific implementation of the "parallel breadth traversal algorithm" will be described in detail below.

[0121] In some embodiments of the present disclosure, the coroutine creation rule may include the following cases: If the number of successor nodes of the current node is equal to 0, there is no need to create a new coroutine. If the number of successor nodes of the current node is equal to 1, there is no need to create a new coroutine, and the coroutine executing the current node executes the successor node, which can save the number of coroutines. If the number of successor nodes of the current node is equal to N (N>1), the coroutine executing the current node creates N new coroutines to execute the successor nodes in parallel.

[0122] For ease of description, the current node is described as the fourth node, and the coroutine that executes the current node is described as the first coroutine. Then, the above coroutine creation rule can be understood as using the first coroutine to process the fourth node in the target workflow.

[0123] Further, if the number of successor nodes of the current node is equal to 0, that is, if the fourth node has no successor node, then after the fourth node is completed, the first coroutine is terminated.

[0124] Exemplary, combined Figure 4 , taking the fourth node as node 9 as an example, in the candidate workflows 401, 402, and 403, node 9 does not have a successor node. After the execution of node 9 is completed, the coroutine assigned to node 9 is terminated.

[0125] Further, if the number of successor nodes of the current node is equal to 1, that is, if the fourth node has a single successor node, the single successor node is continuously processed using the first coroutine.

[0126] Exemplary, combined Figure 4 , taking the fourth node as node 2 as an example, in the candidate workflow 401, node 2 has a single successor node: node 5, then node 5 is still executed using the coroutine assigned to node 2, without allocating a new coroutine to node 5. Similarly, in the candidate workflow 402, node 2 has a single successor node: node 6, then node 6 is still executed using the coroutine assigned to node 2, without allocating a new coroutine to node 6.

[0127] Further, if the fourth node has multiple successor nodes, multiple coroutines are created using the first coroutine to execute the multiple successor nodes.

[0128] Exemplary, combined Figure 4 Taking the fourth node as node 2 as an example, in the candidate workflow 403, node 2 has two successor nodes, node 7 and node 8. Then, two new coroutines are created using the coroutine allocated to node 2, which are used to execute node 7 and node 8 respectively.

[0129] In some embodiments of the present disclosure, the coroutine creation rule also includes the following situation: for the current node of the coroutine to be assigned, if the current node has multiple predecessor nodes, a coroutine is selected from the multiple coroutines assigned to the multiple predecessor nodes according to a certain rule, and the selected coroutine is assigned to the node of the coroutine to be assigned. The rule may be to select the earliest completed coroutine among the multiple coroutines according to the execution completion time of the multiple coroutines assigned to the multiple predecessor nodes.

[0130] For ease of description, the current node to be assigned a coroutine is described as the fifth node. Corresponding to the above situation, if the fifth node has multiple predecessor nodes, and the multiple predecessor nodes correspond to multiple coroutines, the fifth node can be assigned a coroutine in the following manner: the fifth node is processed by using the second coroutine of the multiple coroutines.

[0131] In some embodiments of the present disclosure, the second coroutine is the coroutine that is completed earliest among the multiple coroutines.

[0132] Exemplary, combined Figure 4, taking node 9 as the current node of the coroutine to be assigned, in the candidate workflow 403, node 9 has two predecessor nodes, node 7 and node 8. Then, the earliest coroutine execution node 9 is completed by using the two coroutines assigned to node 7 and node 8, without allocating a new coroutine to node 9.

[0133] In some embodiments of the present disclosure, in the process of controlling a business process according to a target workflow, a corresponding coroutine synchronizer is set for the nodes in the target workflow to reduce the performance overhead of coroutine synchronization. For example, for the above-mentioned fifth node having multiple predecessor nodes, the timing for executing the fifth node is when all predecessor nodes of the fifth node are executed. To this end, a counter associated with the fifth node can be set as a coroutine synchronizer corresponding to the fifth node based on multiple predecessor nodes. The initial value of the counter can be set to the total number of predecessor nodes of the fifth node. In response to the completion of execution of a predecessor node among multiple predecessor nodes, the counter is decremented; in this way, when the value of the counter reaches a predetermined value, for example, when it is decremented to 0, in response to the counter reaching a predetermined value, the execution of the fifth node is triggered.

[0134] The following is a detailed description of the workflow scheduling execution algorithm, which can be executed by the workflow scheduling submodule D as follows:

[0135] The workflow scheduling submodule executes executeFlow(Ctx,CA,CF,W,A) according to the initialization parameters Ctx,CA,CF,W,A, where:

[0136] If the number of predecessor nodes of the current node A is greater than 1, then if A exists in the set of nodes to be executed W, then return. If A does not exist in the set of nodes to be executed W, then add the current node A to the set of nodes to be executed W. In addition, use A's coroutine synchronizer CA(A) to wait for all predecessor nodes to be executed.

[0137] Additionally or alternatively, the workflow scheduling submodule D executes the current node A, that is, executes L=executeAction(Ctx, CA, CF, A), where L is a list of nodes to be executed returned after the method is executed.

[0138] Additionally or alternatively, if the length of list L is 0, it indicates that there is no node to be executed, and the node is the tail node, then it returns directly and the workflow execution ends. If the length of list L is 1, it indicates that node A has a single successor node, then for the only node L(0) in L, recursively call executeFlow(Ctx,CA,CF,W,L(0)), and then return. If the length of L is greater than 1, it indicates that node A has multiple successor nodes, then for each node L(i) to be executed in L, start a new coroutine, and recursively call executeFlow(Ctx,CA,CF,W,L(i)) in the new coroutine.

[0139] Additionally or alternatively, during the process of scheduling the workflow, the workflow state synchronizer (CF) is blocked, waiting for the workflow to be executed and completed. After the workflow is executed and completed, the workflow state synchronizer is released.

[0140] Reference Figure 6 , there are 11 nodes to be executed in the workflow diagram. In the common solutions in the industry, a coroutine needs to be assigned to each node, and a total of 11 coroutines need to be assigned. However, using the solution of the present disclosure, a coroutine G1 is assigned to node 1, and a coroutine G2 and G3 are assigned to nodes 2 and 3 respectively. Node 4 still uses the coroutine G2 of node 2, and node 5 still uses the coroutine G3 of node 3. Nodes 6, 7, and 8 are assigned a new coroutine G4, G5, and G6 respectively; node 9 still uses the coroutine G3 of node 5, and node 10 selects a coroutine from the multiple coroutines used by nodes 6, 7, 8, and 9, without allocating a new coroutine to node 10. Node 11 uses the coroutine selected for node 10, and there is no need to allocate a new coroutine to node 11. In this way, using the solution of the present disclosure, only 6 coroutines are needed to execute the workflow. Therefore, 5 coroutines can be saved. Even in some cases, if all nodes from the first node (head node) to the Nth node (tail node) of the workflow graph are serial, then the commonly used method in the industry needs to create N coroutines. However, the present disclosure only needs to create one coroutine, which can save N-1 coroutines compared to the conventional method.

[0141] For each node, the node execution submodule E is responsible for the execution of the corresponding node. The specific execution process of the node execution submodule E is as follows:

[0142] The node execution submodule E executes executeAction(Ctx,CA,CF,A) according to the initialization parameters Ctx,CA,CF,A.

[0143] The node execution submodule E initializes an empty node list L, which is used to store the list of nodes to be executed after the current node A is executed.

[0144] Alternatively or additionally, if the process state in Ctx is not set to skip, the following operations are performed: Execute the operator with the same name as node A in the operator library 230. Add all successor nodes of node A to L.

[0145] Alternatively or additionally, if the list of nodes to be executed (successor node list) L after the current node A is executed is not empty, the following logic is executed for each successor node NA:

[0146] If the number of predecessor nodes of NA is greater than 1, the counter value of NA's coroutine synchronizer CA is reduced by 1. If the counter value becomes 0, all coroutines blocked on NA's coroutine synchronizer CA will be awakened by the coroutine synchronizer of NA.

[0147] Alternatively or additionally, if the current node A is the tail node of the workflow graph to which it belongs, the count of the workflow state synchronizer (CF) is reduced by 1. If the counter value becomes 0 after reduction by 1, the main coroutine of the upstream blocked workflow scheduling is awakened by the workflow state synchronizer (CF).

[0148] Alternatively or additionally, the node execution submodule E returns to L after executing the above steps.

[0149] In order to explain the present disclosure more clearly, a simplified version of the workflow of an online search service is taken as an example to illustrate the breadth-parallel traversal process of the present invention. Figure 7 As shown, Figure 7 Each node is marked with the node's ID and name attributes.

[0150] The following table shows the detailed attribute configuration of each node. In order to better demonstrate the workflow scheduling execution process, the "execution time" of each node is simulated. That is, the "execution time" of the node in Table 1 below is artificially controlled to demonstrate the execution progress of each node. In actual workflow nodes, it is impossible to manually determine the execution time in advance before execution.

[0151] Table 1

[0152]

[0153]

[0154] According to the above configuration, the detailed execution process of the above workflow diagram is as follows Figure 8 As shown, the black interval is the execution interval of each node.

[0155] Table 2 below details the order in which the nodes in the above figure are executed:

[0156] Table 2

[0157] Time (unit: ms) Node execution events 0.000 Node 1 starts executing 10.100 Node 1 completes execution 10.134 Node 5 starts executing 10.137 Node 9 starts execution 10.154 Node 6 starts executing 10.213 Node 3 starts executing 40.185 Node 6 completes execution 40.209 Node 7 starts executing 45.312 Node 9 completes execution 50.320 Node 3 completes execution 70.275 Node 5 completes execution 80.214 Node 7 completes execution 80.220 Node 8 starts executing 90.222 Node 8 completes execution 90.225 Node 10 starts executing 105.438 Node 10 completes execution 105.461 Node 11 starts executing 115.556 Node 11 completes execution 115.569 Node 12 starts executing 120.588 Node 12 completes execution

[0158] In the embodiment of the present disclosure, when the workflow engine schedules execution, an algorithm called "parallel breadth traversal" is used to drive the scheduling and execution of the process. Compared with the pure serial mode of the traditional topological sorting algorithm, the present disclosure uses multiple parallel coroutines to execute parallel nodes in the workflow graph in parallel, and uses a coroutine synchronizer based on CAS (compare and swap) technology to achieve efficient synchronization of parallel coroutines, so as to improve the execution speed of the workflow.

[0159] Example Process

[0160] Fig. 9 FIG. 3 is a flowchart of a process 900 for processing a workflow according to some embodiments of the present disclosure. The process 300 may be implemented at the workflow engine 130. For ease of discussion, reference will be made to FIG. Figure 1 The process 300 is described with reference to the environment 100 of FIG. It should be understood that the process 300 may include additional actions not shown and / or may omit actions shown, and the scope of the present disclosure is not limited in this respect.

[0161] In block 910 , the workflow engine 130 obtains a source workflow, where the source workflow includes conditional nodes, each of which has multiple successor nodes corresponding to different value conditions.

[0162] In block 920 , the workflow engine 130 decomposes the source workflow into multiple candidate workflows based on a set of different value conditions of the conditional nodes, so that none of the multiple candidate workflows includes the conditional node.

[0163] At block 930 , before the business process is executed, the workflow engine 130 determines a target workflow for the business process from a plurality of candidate workflows based on the values ​​of a set of conditional nodes of the business process; and

[0164] At block 940 , the workflow engine 130 controls the execution of the business process according to the target workflow.

[0165] In some embodiments, the target workflow includes multiple nodes, and process 900 further includes at least one of the following: marking a head node in the target workflow; marking a tail node in the target workflow; marking predecessor nodes of multiple nodes in the target workflow.

[0166] In some embodiments, marking predecessor nodes of multiple nodes in the target workflow includes: in response to a successor node of a first node among the multiple nodes being a second node, marking the first node as a predecessor node of the second node.

[0167] In some embodiments, decomposing a source workflow into multiple candidate workflows includes: determining a successor node of a third node in the source workflow; if the successor node is a target conditional node in the source workflow, determining a successor non-conditional node corresponding to the target conditional node in the source workflow as a successor node of the third node in the corresponding candidate workflow, wherein the successor non-conditional node is determined based on a target value condition associated with the target conditional node; and deleting the target conditional node from the corresponding candidate workflow.

[0168] In some embodiments, decomposing the source workflow into multiple candidate workflows further includes: deleting an island node in the source workflow, where the island node is a non-head node in the workflow that has no in-degree.

[0169] In some embodiments, controlling the execution of the business process according to the target workflow includes: using the first coroutine to process the fourth node in the target workflow; if the fourth node has a single successor node, using the first coroutine to continue processing the single successor node.

[0170] In some embodiments, controlling the execution of the business process according to the target workflow includes: if the fourth node has multiple successor nodes, creating multiple coroutines using the first coroutine for executing the multiple successor nodes.

[0171] In some embodiments, controlling the execution of the business process according to the target workflow includes: if the fourth node does not have a successor node, terminating the first coroutine after the fourth node is completed.

[0172] In some embodiments, the target workflow includes a fifth node, the fifth node has multiple predecessor nodes, the multiple predecessor nodes correspond to multiple coroutines, and controlling the execution of the business process according to the target workflow includes: utilizing a second coroutine among the multiple coroutines to process the fifth node, the second coroutine being the earliest completed coroutine among the multiple coroutines.

[0173] In some embodiments, controlling the execution of a business process according to a target workflow includes: setting a counter associated with a fifth node based on multiple predecessor nodes; decrementing the counter in response to completion of execution of a predecessor node among the multiple predecessor nodes; and triggering execution of the fifth node in response to the counter reaching a predetermined value.

[0174] Example devices and equipment

[0175] Fig.10 A schematic structural block diagram of an apparatus 1000 for processing a workflow according to some embodiments of the present disclosure is shown. The apparatus 1000 may be implemented as or included in a business application system 130. Each module / component in the apparatus 1000 may be implemented by hardware, software, firmware, or any combination thereof.

[0176] like Fig.10 As shown, the apparatus 1000 includes a source workflow acquisition module 1010, which is configured to acquire a source workflow, the source workflow including a set of conditional nodes, each conditional node having a plurality of successor nodes corresponding to different value conditions;

[0177] The apparatus 1000 further includes a candidate workflow decomposition module 1020 configured to decompose the source workflow into a plurality of candidate workflows based on a set of different value conditions of conditional nodes, so that none of the plurality of candidate workflows includes a conditional node;

[0178] The apparatus 1000 further includes a target workflow determination module 1030 configured to determine a target workflow for the business process from a plurality of candidate workflows according to values ​​of a set of conditional nodes of the business process before the business process is executed; and

[0179] The apparatus 1000 further includes a control module 1040 configured to control the execution of the business process according to the target workflow.

[0180] In some embodiments, the target workflow includes multiple nodes, and the device 1000 also includes a marking module configured to perform at least one of the following: marking the head node in the target workflow; marking the tail node in the target workflow; marking the predecessor nodes of multiple nodes in the target workflow.

[0181] In some embodiments, the marking module is further configured to mark the first node as a predecessor node of the second node in response to a successor node of the first node among the plurality of nodes being the second node.

[0182] In some embodiments, the candidate workflow decomposition module 1020 is further configured to determine a successor node of the third node in the source workflow; if the successor node is a target conditional node in the source workflow, then determine a successor non-conditional node corresponding to the target conditional node in the source workflow as the successor node of the third node in the corresponding candidate workflow, wherein the successor non-conditional node is determined based on a target value condition associated with the target conditional node; and delete the target conditional node from the corresponding candidate workflow.

[0183] In some embodiments, the candidate workflow decomposition module 1020 is further configured to delete isolated nodes in the source workflow, where the isolated nodes are non-head nodes in the source workflow that do not have an in-degree.

[0184] In some embodiments, the control module 1040 is further configured to use the first coroutine to process the fourth node in the target workflow; if the fourth node has a single successor node, the first coroutine is used to continue processing the single successor node.

[0185] In some embodiments, the control module 1040 is further configured to create multiple coroutines using the first coroutine to execute the multiple successor nodes if the fourth node has multiple successor nodes.

[0186] In some embodiments, the control module 1040 is further configured to terminate the first coroutine after the fourth node is completed if the fourth node does not have a successor node.

[0187] In some embodiments, the target workflow includes a fifth node, the fifth node has multiple predecessor nodes, and the multiple predecessor nodes correspond to multiple coroutines. The control module 1040 is further configured to: use a second coroutine among the multiple coroutines to process the fifth node, and the second coroutine is the earliest completed coroutine among the multiple coroutines.

[0188] In some embodiments, the control module 1040 is further configured to set a counter associated with the fifth node based on multiple predecessor nodes; decrement the counter in response to completion of execution of a predecessor node among the multiple predecessor nodes; and trigger execution of the fifth node in response to the counter reaching a predetermined value.

[0189] Fig.11 A block diagram illustrating a computing device 1100 in which one or more embodiments of the present disclosure may be implemented is shown. It should be understood that Fig.11 The computing device 1100 shown is merely exemplary and should not constitute any limitation on the functionality and scope of the embodiments described herein. Fig.11 The computing device 1100 shown may be used to implement Figure 1 The workflow engine 130 is configured to:

[0190] like Fig.11 As shown, computing device 1100 is in the form of a general-purpose computing device. Components of computing device 1100 may include, but are not limited to, one or more processors or processing units 1110, memory 1120, storage device 1130, one or more communication units 1140, one or more input devices 1150, and one or more output devices 1160. Processing unit 1110 may be an actual or virtual processor and is capable of performing various processes according to a program stored in memory 1120. In a multi-processor system, multiple processing units execute computer executable instructions in parallel to increase the parallel processing capabilities of computing device 1100.

[0191] The computing device 1100 typically includes a plurality of computer storage media. Such media may be any accessible media that is accessible to the computing device 1100, including but not limited to volatile and non-volatile media, removable and non-removable media. The memory 1120 may be a volatile memory (e.g., a register, a cache, a random access memory (RAM)), a non-volatile memory (e.g., a read-only memory (ROM), an electrically erasable programmable read-only memory (EEPROM), flash memory), or some combination thereof. The storage device 1130 may be a removable or non-removable medium, and may include a machine-readable medium, such as a flash drive, a disk, or any other medium, which may be capable of being used to store information and / or data (e.g., training data for training) and may be accessed within the computing device 1100.

[0192] The computing device 1100 may further include additional removable / non-removable, volatile / non-volatile storage media. Fig.11 As shown in , a disk drive for reading or writing from a removable, non-volatile disk (e.g., a "floppy disk") and an optical drive for reading or writing from a removable, non-volatile optical disk may be provided. In these cases, each drive may be connected to the bus (not shown) by one or more data media interfaces. Memory 1120 may include a computer program product 1125 having one or more program modules that are configured to perform various methods or actions of various embodiments of the present disclosure.

[0193] The communication unit 1140 enables communication with other computing devices via a communication medium. Additionally, the functions of the components of the computing device 1100 can be implemented in a single computing cluster or multiple computing machines that can communicate via a communication connection. Therefore, the computing device 1100 can operate in a networked environment using a logical connection with one or more other servers, a network personal computer (PC), or another network node.

[0194] Input device 1150 may be one or more input devices, such as a mouse, keyboard, trackball, etc. Output device 1160 may be one or more output devices, such as a display, speaker, printer, etc. Computing device 1100 may also communicate with one or more external devices (not shown) through communication unit 1140 as needed, such as storage devices, display devices, etc., communicate with one or more devices that allow a user to interact with computing device 1100, or communicate with any device that allows computing device 1100 to communicate with one or more other computing devices (e.g., a network card, a modem, etc.). Such communication may be performed via an input / output (I / O) interface (not shown).

[0195] According to an exemplary implementation of the present disclosure, a computer-readable storage medium is provided, on which computer-executable instructions are stored, wherein the computer-executable instructions are executed by a processor to implement the method described above. According to an exemplary implementation of the present disclosure, a computer program product is also provided, which is tangibly stored on a non-transitory computer-readable medium and includes computer-executable instructions, and the computer-executable instructions are executed by a processor to implement the method described above.

[0196] Various aspects of the present disclosure are described herein with reference to the flowcharts and / or block diagrams of the methods, devices, equipment, and computer program products implemented according to the present disclosure. It should be understood that each box in the flowchart and / or block diagram and the combination of each box in the flowchart and / or block diagram can be implemented by computer-readable program instructions.

[0197] These computer-readable program instructions can be provided to a processing unit of a general-purpose computer, a special-purpose computer, or other programmable data processing device, thereby producing a machine, so that when these instructions are executed by the processing unit of the computer or other programmable data processing device, a device that implements the functions / actions specified in one or more boxes in the flowchart and / or block diagram is generated. These computer-readable program instructions can also be stored in a computer-readable storage medium, and these instructions cause the computer, programmable data processing device, and / or other equipment to work in a specific manner, so that the computer-readable medium storing the instructions includes a manufactured product, which includes instructions for implementing various aspects of the functions / actions specified in one or more boxes in the flowchart and / or block diagram.

[0198] Computer-readable program instructions can be loaded onto a computer, other programmable data processing apparatus, or other device so that a series of operational steps are performed on the computer, other programmable data processing apparatus, or other device to produce a computer-implemented process, so that the instructions executed on the computer, other programmable data processing apparatus, or other device implement the functions / actions specified in one or more boxes in the flowchart and / or block diagram.

[0199] The flow chart and block diagram in the accompanying drawings show the possible architecture, function and operation of the system, method and computer program product according to multiple implementations of the present disclosure. In this regard, each square box in the flow chart or block diagram can represent a part of a module, program segment or instruction, and a part of a module, program segment or instruction includes one or more executable instructions for realizing the logical function of the specification. In some implementations as replacements, the function marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two continuous square boxes can actually be executed substantially in parallel, and they can sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be realized by a special hardware-based system that performs the function or action of the specification, or can be realized by a combination of special hardware and computer instructions.

[0200] The above descriptions of various implementations of the present disclosure are exemplary, non-exhaustive, and not limited to the disclosed implementations. Many modifications and variations will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the described implementations. The selection of terms used herein is intended to best explain the principles of the implementations, practical applications, or improvements to the technology in the market, or to enable other persons of ordinary skill in the art to understand the various implementations disclosed herein.

Claims

1. A method for processing a workflow, include: Acquire a source workflow, wherein the source workflow includes a group of conditional nodes, each of which has a plurality of successor nodes corresponding to different value conditions; Based on the different value conditions of the set of conditional nodes, decomposing the source workflow into a plurality of candidate workflows, so that none of the plurality of candidate workflows includes a conditional node; Before the business process is executed, determining a target workflow for the business process from the multiple candidate workflows according to the values ​​of the business process with respect to the set of conditional nodes; as well as The execution of the business process is controlled according to the target workflow.

2. The method according to claim 1, wherein the target workflow comprises a plurality of nodes, and the method further comprises at least one of the following: Marking a head node in the target workflow; Marking the tail node in the target workflow; The predecessor nodes of the plurality of nodes in the target workflow are marked.

3. The method according to claim 2, wherein the predecessor nodes of the plurality of nodes in the target workflow are marked include: In response to a successor node of a first node among the plurality of nodes being a second node, marking the first node as a predecessor node of the second node.

4. The method according to claim 1, wherein the source workflow is decomposed into a plurality of candidate workflows include: Determining a successor node of a third node in the source workflow; If the successor node is a target conditional node in the source workflow, a successor non-conditional node corresponding to the target conditional node in the source workflow is determined as the successor node of the third node in the corresponding candidate workflow, wherein the successor non-conditional node is determined based on a target value condition associated with the target conditional node; as well as The target condition node is deleted from the corresponding candidate workflow.

5. The method according to claim 4, wherein decomposing the source workflow into a plurality of candidate workflows further comprises: include: An isolated node in the source workflow is deleted, where the isolated node is a non-head node in the source workflow that has no in-degree.

6. The method according to claim 1, wherein the execution of the business process is controlled according to the target workflow include: Using the first coroutine to process the fourth node in the target workflow; If the fourth node has a single successor node, the single successor node is continuously processed using the first coroutine.

7. The method according to claim 6, wherein the execution of the business process is controlled according to the target workflow include: If the fourth node has multiple successor nodes, multiple coroutines are created using the first coroutine to execute the multiple successor nodes.

8. The method according to claim 6, wherein the execution of the business process is controlled according to the target workflow include: If the fourth node does not have a successor node, the first coroutine is terminated after the fourth node is completed.

9. The method according to claim 1, wherein the target workflow includes a fifth node, the fifth node has a plurality of predecessor nodes, the plurality of predecessor nodes correspond to a plurality of coroutines, and the execution of the business process is controlled according to the target workflow include: The fifth node is processed by using a second coroutine among the multiple coroutines, where the second coroutine is a coroutine that completes execution earliest among the multiple coroutines.

10. The method according to claim 9, wherein the execution of the business process is controlled according to the target workflow include: According to the plurality of predecessor nodes, setting a counter associated with the fifth node; In response to a predecessor node of the plurality of predecessor nodes completing execution, decrementing the counter; as well as In response to the counter reaching a predetermined value, execution of the fifth node is triggered.

11. A device for processing a workflow, the device include: A source workflow acquisition module is configured to acquire a source workflow, wherein the source workflow includes a group of conditional nodes, each of which has a plurality of successor nodes corresponding to different value conditions; A workflow decomposition module is configured to decompose the source workflow into a plurality of candidate workflows based on the different value conditions of the set of conditional nodes, so that none of the plurality of candidate workflows includes a conditional node; a target workflow determination module configured to determine, before the business process is executed, a target workflow for the business process from the multiple candidate workflows according to the values ​​of the business process with respect to the set of conditional nodes; as well as The control module is configured to control the execution of the business process according to the target workflow.

12. An electronic device, include: at least one processing unit; as well as At least one memory, the at least one memory being coupled to the at least one processing unit and storing instructions for execution by the at least one processing unit, the instructions causing the electronic device to perform the method according to any one of claims 1 to 10 when executed by the at least one processing unit.

13. A computer-readable storage medium having a computer program stored thereon, wherein the computer program can be executed by a processor to implement the method according to any one of claims 1 to 10.

14. A computer program product comprising computer executable instructions, wherein the computer executable instructions, when executed by a processor, implement the method according to any one of claims 1 to 10.

Citation Information

Patent Citations

  • Method and device for realizing dynamic merging of branches in unstructured process

    CN101963908A

  • Workflow system-oriented test case generation method and device

    CN106547696A

  • Oozie-based workflow test method and device, equipment and storage medium

    CN111797002A

  • Workflow adjusting method and device

    CN112989603A

  • Business processing method and device, electronic equipment and storage medium

    CN116166390A