A process engine implementation method, system, device and medium
By converting the business flow chart into a directed graph and forming a feature graph, combining the starting node process and backward node process, the problem of poor universality of the process engine in the existing technology is solved, and the efficient and general flow logic of the process engine is realized, and the development efficiency is improved.
Patent Information
- Application Number
- CN202410860044.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-28
- Publication Date
- 2025-03-14
- Estimated Expiration
- 2044-06-28
AI Technical Summary
The process engines in the prior art are not very versatile and need to be repeatedly developed to deal with different processes. The existing logic cannot be reused, which affects development efficiency.
By converting the business flow chart into a directed graph and removing the judgment nodes, a feature map is formed to display all connected paths. Based on the judgment node data attributes of the feature map, the connection conditions of the connecting path are obtained, and the connection path of the judgment node to be executed is determined. At the same time, through the starting node process and the backward node process, the general flow logic of the process engine is realized.
It improves the universality and efficiency of the process engine, enables the process engine to adapt to different business processes, reduces duplicate development, improves the ability to reuse existing logic, and thus improves development efficiency.
Smart Images

Figure CN118644212B_ABST
Abstract
Description
Technical Field
[0001] The present application belongs to the field of process business technology, and in particular, relates to a method, system, device and medium for implementing a process engine. Background Art
[0002] A process engine is a technology in computer programming that can convert flowcharts into data structures that can be understood in programming languages, and implement operations such as creation, verification, storage, modification, display, and interpretation of flowcharts.
[0003] The process engines in the prior art are generally designed for one or several specific processes. For example, in an approval process, one or more approvers in sequence generally decide whether to approve or reject. When the previous approver approves, the approval process enters the next approver.
[0004] The following questions may arise in response to the above approval process:
[0005] a. The approver is one or more approvers. During the approval process, any one of the approvers or all of them may need to approve before entering the next approval stage;
[0006] b. The approvers corresponding to different applicants may not be exactly the same;
[0007] c. Different approval processes may be inconsistent.
[0008] In the above approval process, repeated development is required to cope with different processes. It is not very versatile and its implementation depends on specific working conditions. It cannot be used by non-specific processes and the existing logic cannot be effectively reused, which affects development efficiency. Summary of the invention
[0009] The embodiments of the present application provide a method, system, device and medium for implementing a process engine, which can solve the problems in the prior art that repeated development is required to cope with different processes, the versatility is not strong, the implementation depends on specific working conditions, it cannot be used by non-specific processes, and the existing logic cannot be effectively reused, which affects development efficiency.
[0010] In a first aspect, an embodiment of the present application provides a method for implementing a process engine, including:
[0011] Obtain a flowchart of a business process, and convert the flowchart into a directed graph, wherein the directed graph includes common nodes and judgment nodes;
[0012] All judgment nodes in the directed graph are removed, and common nodes before and after the judgment nodes are connected to form a feature graph, where the feature graph is used to display all connected paths of the flowchart of the business process;
[0013] Based on the data attributes of the judgment nodes in the feature graph, the connectivity conditions of the connectivity paths of the judgment nodes in the feature graph are obtained, and the connectivity paths of the judgment nodes of the to-be-executed processes of the business process are determined by comparing the connectivity conditions of the judgment nodes of the to-be-executed processes with the connectivity conditions of the corresponding judgment nodes in the feature graph;
[0014] By judging whether there is a historical node in the flow of the process to be executed, the flow process of the process to be executed is determined, and the flow process includes a starting node process and a backward node process.
[0015] Furthermore, after removing all the judgment nodes in the directed graph and connecting the common nodes before and after the judgment nodes to form a feature graph, the method further includes:
[0016] A configuration check is performed on the feature graph so that the business process corresponding to the feature graph has at least one reachable path, where the reachable path is a path that has one and only one start node and end node of a business process and is reachable between the start node and the end node.
[0017] Furthermore, the data attribute of the judgment node in the feature graph is used to obtain the connectivity condition of the judgment node in the feature graph, including:
[0018] Traversing all nodes in the feature graph to obtain all judgment nodes in the feature graph;
[0019] Obtaining a judgment expression of the judgment node, parsing the judgment expression, and determining a data attribute to be used;
[0020] According to the attribute values of different data attributes, the unique values of different connected paths of the judgment node are calculated;
[0021] Based on the unique value, a connectivity condition of a connectivity path of the judgment node is obtained.
[0022] Furthermore, the flow process of the process to be executed is determined by judging whether there is a historical node in the flow, and the flow process includes a starting node process and a backward node process, including:
[0023] Obtain business process nodes and the node relationship table between each node;
[0024] If the process to be executed does not have a historical node in circulation, based on the node relationship table, the starting node process is executed to obtain the starting node of the process to be executed;
[0025] If the to-be-executed process has a historical node in flow, based on the node relationship table, the backward node process is executed;
[0026] When executing the backward node process or the starting node process, n flow nodes are generated, where n≥0, and the flow nodes are nodes being executed.
[0027] Further, the execution starting node process to obtain the starting node of the process to be executed includes:
[0028] Determine whether the process to be executed specifies a starting node. If the process to be executed does not specify a starting node, loop through the uncirculated nodes in the process to be executed to determine whether the uncirculated nodes are judgment nodes. If the uncirculated nodes are not judgment nodes, determine them as starting nodes.
[0029] If the to-be-executed process specifies a starting node, it is determined whether the specified starting node exists in the to-be-executed process nodes; if the specified starting node exists, the starting node is determined by determining whether the specified starting node is a determination node.
[0030] Furthermore, the backward node process is executed based on the node relationship table, including:
[0031] Based on the node relationship table, obtaining the untransferred connections between the nodes of the to-be-executed process;
[0032] Determine the backward node of the uncirculated connection by judging whether the starting node of the uncirculated connection is a judgment node;
[0033] Determine whether the backward node of the uncirculated connection specifies a backward node, if not, determine the backward node, if specified, determine the backward node of the uncirculated connection by determining whether the backward node of the uncirculated connection has a specified backward node;
[0034] The untransferred connections in the process to be executed are traversed in a loop until there are no untransferred connections between the nodes of the process to be executed, and all nodes are returned.
[0035] Furthermore, in determining whether there is a historical node in the flow of the process to be executed, the flow process of the process to be executed is determined, and the flow process includes a starting node process and a backward node process, which includes:
[0036] Based on the judgment nodes and common nodes of the feature graph, establishing a union of the judgment nodes and common nodes in the feature graph;
[0037] Establishing a first association function, wherein the first association function is used to make each element in the set of directed edges of the feature graph correspond to an ordered pair of elements in the union;
[0038] Establishing a second association function, the second association function is used to make the element corresponding to the judgment node of the directed edge in the feature graph correspond to an element in the set of weights of the directed edge corresponding to the judgment node in the feature graph, wherein the weight is a calculated unique value representing a connectivity condition;
[0039] Set the node to be transferred to the process to be executed as u, when u∈G(D), and (G(u))(x1, x2, x3, ..., x n )∈W(D), determine that the process to be executed has a reachable path in the feature graph, where G(D) is the set of judgment nodes of the feature graph, D represents the feature graph, G(u) represents the node u to be transferred as the judgment node, (x1, x2, x3, ..., x n ) is a set of connectivity conditions of the judgment nodes of the process to be executed, and W(D) represents a set of weights of directed edges corresponding to the judgment nodes of the feature graph.
[0040] In a second aspect, an embodiment of the present application provides a process engine implementation system, including:
[0041] The first processing module is used to obtain a flowchart of a business process and convert the flowchart into a directed graph, wherein the directed graph includes common nodes and judgment nodes;
[0042] The second processing module is used to remove all judgment nodes in the directed graph, connect the common nodes before and after the judgment nodes, and form a feature graph, which is used to show all connected paths of the flowchart of the business process;
[0043] The third processing module: based on the data attributes of the judgment nodes in the feature graph, obtains the connectivity conditions of the connectivity paths of the judgment nodes in the feature graph, and determines the connectivity paths of the judgment nodes of the to-be-executed process of the business process by comparing the connectivity conditions of the judgment nodes of the to-be-executed process with the connectivity conditions of the corresponding judgment nodes in the feature graph;
[0044] The fourth processing module: by judging whether there is a historical node in the flow of the process to be executed, the flow process of the process to be executed is determined, and the flow process includes a starting node process and a backward node process.
[0045] In a third aspect, an embodiment of the present application provides a terminal device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the above-mentioned method for implementing a process engine when executing the computer program.
[0046] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, including: the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, it implements the above-mentioned method for implementing a process engine.
[0047] Compared with the prior art, the embodiments of the present invention have the following beneficial effects:
[0048] The present application provides a method for implementing a process engine, which converts a business process diagram into a visual feature diagram or a red-green diagram. By assigning different unique values to different connectivity paths of the judgment node, the different connectivity conditions are given, so that the process engine can be smoothly implemented. In addition, by setting the starting node process and the backward node process, the process engine only needs the user to provide a node relationship table of the business process during the implementation process, and then it can be executed according to the existing starting node process and backward node process flow logic, thereby improving the versatility and efficiency of the process engine implementation. BRIEF DESCRIPTION OF THE DRAWINGS
[0049] In order to more clearly illustrate the technical solutions in the embodiments of the present application, 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 some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0050] Figure 1 It is a flowchart of a method for implementing a process engine provided by an embodiment of the present invention;
[0051] Figure 2 It is a flowchart of a starting node process of a method for implementing a process engine provided by an embodiment of the present invention;
[0052] Figure 3 It is a flowchart of a backward node process of a method for implementing a process engine provided by an embodiment of the present invention;
[0053] Figure 4 It is a structural diagram of a process engine implementation system provided by an embodiment of the present invention;
[0054] Figure 5 It is a schematic diagram of the structure of the terminal device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0055] In the following description, specific details such as specific system structures, technologies, etc. are provided for the purpose of illustration rather than limitation, so as to provide a thorough understanding of the embodiments of the present application. However, it should be clear to those skilled in the art that the present application may also be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to prevent unnecessary details from obstructing the description of the present application.
[0056] It should be understood that when used in the present specification and the appended claims, the term "comprising" indicates the presence of described features, wholes, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, components and / or combinations thereof.
[0057] It should also be understood that the term “and / or” used in the specification and appended claims refers to any and all possible combinations of one or more of the associated listed items, and includes these combinations.
[0058] As used in the specification and appended claims of this application, the term "if" can be interpreted as "when" or "uponce" or "in response to determining" or "in response to detecting", depending on the context. Similarly, the phrase "if it is determined" or "if [described condition or event] is detected" can be interpreted as meaning "uponce it is determined" or "in response to determining" or "uponce [described condition or event] is detected" or "in response to detecting [described condition or event]", depending on the context.
[0059] In addition, in the description of the present application specification and the appended claims, the terms "first", "second", "third", etc. are only used to distinguish the descriptions and cannot be understood as indicating or implying relative importance.
[0060] References to "one embodiment" or "some embodiments" etc. described in the specification of this application mean that one or more embodiments of the present application include specific features, structures or characteristics described in conjunction with the embodiment. Therefore, the statements "in one embodiment", "in some embodiments", "in some other embodiments", "in some other embodiments", etc. that appear in different places in this specification do not necessarily refer to the same embodiment, but mean "one or more but not all embodiments", unless otherwise specifically emphasized in other ways. The terms "including", "comprising", "having" and their variations all mean "including but not limited to", unless otherwise specifically emphasized in other ways.
[0061] See also Figure 1 As shown, the present invention is a method for implementing a process engine, comprising the following steps:
[0062] S100, obtaining a flowchart of a business process, and converting the flowchart into a directed graph, wherein the directed graph includes common nodes and judgment nodes;
[0063] In this embodiment, the business process is analyzed to obtain a flowchart of the business process, which contains various steps and judgment conditions of the business process. According to the flowchart of the business process, a graph theory algorithm is used to convert the flowchart into a data representation of a directed graph. During the conversion process, the steps that do not require the execution of the judgment conditions are converted into ordinary nodes of the directed graph, and the steps that require the execution of the judgment conditions are converted into judgment nodes of the directed graph. A depth-first search algorithm is used to traverse all nodes of the directed graph to obtain a topological sorting sequence of the nodes, thereby obtaining the sequential processing order of the business process. A graphical tool is used to visualize the directed graph to intuitively display the business processing steps and logical relationships.
[0064] In order to further distinguish between common nodes and judgment nodes, in this embodiment, the directed graph is converted into a red-green graph, and the red-green graph includes red nodes and green nodes, the red nodes represent common nodes, and the green nodes represent judgment nodes; specifically, the information of all nodes and edges in the directed graph is obtained, and the type of each node is determined by traversing the directed graph to obtain a set of judgment nodes and common nodes, and the judgment nodes are dyed green and the common nodes are dyed red to form a red-green graph.
[0065] S200, removing all judgment nodes in the directed graph, connecting the common nodes before and after the judgment nodes, and forming a feature graph, wherein the feature graph is used to display all connected paths of the flowchart of the business process;
[0066] In this embodiment, a graph traversal algorithm is used to remove all judgment nodes, and at the same time, the forward common nodes and backward common nodes of each judgment node are connected to form a feature graph, through which all possible circulation paths in the business process can be obtained.
[0067] In some implementations, after the above step S200, the following steps are included:
[0068] A configuration check is performed on the feature graph so that the corresponding business process in the feature graph has at least one reachable path, where the reachable path is a path that has one and only one start node and end node of a business process and is reachable between the start node and the end node.
[0069] In this embodiment, after obtaining the feature graph, it is necessary to perform a configuration check on the feature graph to verify whether all nodes in the feature graph are correctly connected, to ensure that there are no isolated nodes or logical errors in the feature graph, and at the same time, the corresponding business process in the feature graph has at least one reachable path, so that the business process engine can be successfully implemented.
[0070] In one embodiment, based on the feature graph of the flowchart, a node list of all nodes and an edge list of all edges in the feature graph are obtained. By traversing the edge list, it is determined whether the starting node and the ending node of each edge are the same. If the starting node and the ending node are the same, it means that there is a self-loop of the node. Then the id of the node is added to the node self-loop list. After traversing all the edges, a node self-loop list is obtained, which includes the self-loop node id. According to the node self-loop list, the self-loop nodes in the node list are obtained, and the edges related to the self-loop nodes are obtained in the edge list through the self-loop node id. In the business logic, special processing is performed on these nodes and edges with self-loops, such as prompting the user to remove the self-loop, or skipping these nodes when the process is executed, so as to avoid the process being stuck in the self-loop and unable to enter the next link.
[0071] In one embodiment, by analyzing the starting node of the feature graph, it is determined whether there is one and only one starting node. If there are multiple starting nodes or no starting node, the process configuration is illegal, and it is determined that the starting node of the flowchart does not meet the requirements. Similarly, all the end nodes in the flowchart are obtained, and by judging the number of end nodes, it is determined whether there is one and only one end node. If the number of end nodes does not meet the requirements, it is determined that there is an error in the process configuration. At the same time, according to the node connectivity information obtained by the depth-first search algorithm, all possible paths from the starting node to the end node are obtained by path search. By analyzing the nodes and connection relationships of each path, it is determined whether there is a reachable path from the starting node to the end node. If there is no reachable path, it is determined that an effective execution process cannot be formed between the nodes of the flowchart. Combining the inspection results of the above steps, a judgment conclusion on the legality of the configuration of the feature graph is obtained. If both the starting node and the end node meet the uniqueness requirements, and there is a reachable path between the nodes, it is determined that the configuration of the feature graph is legal, and the complete process from start to end can be executed normally. Otherwise, it is determined that there is an error in the configuration of the flowchart and an effective task execution process cannot be supported.
[0072] S300, based on the data attributes of the judgment nodes in the feature graph, obtaining the connectivity conditions of the connectivity paths of the judgment nodes in the feature graph, and determining the connectivity paths of the judgment nodes of the to-be-executed process of the business process by comparing the connectivity conditions of the judgment nodes of the to-be-executed process with the connectivity conditions of the corresponding judgment nodes in the feature graph;
[0073] In some embodiments, obtaining the connectivity condition of the connectivity path of the judgment node in the feature graph based on the data attribute of the judgment node in the feature graph includes:
[0074] Traversing all nodes in the feature graph to obtain all judgment nodes in the feature graph;
[0075] Obtaining a judgment expression of the judgment node, parsing the judgment expression, and determining a data attribute to be used;
[0076] According to the attribute values of different data attributes, the unique values of different connected paths of the judgment node are calculated;
[0077] Based on the unique value, a connectivity condition of a connectivity path of the judgment node is obtained.
[0078] In this embodiment, according to the feature graph, a depth-first search algorithm is used to traverse all nodes in the feature graph, obtain the judgment nodes in the feature graph, and determine the judgment expression in each judgment node according to the business logic of each judgment node in the business process; the data attributes required in the judgment expression are parsed through regular expressions, the attribute values of the data attributes of different connected paths of the judgment node are obtained, and the unique values of the different connected paths are obtained. The unique values are mapped to the corresponding connected paths, and the unique values are used as the connectivity conditions of the connected paths. When the business process flows to the judgment node, the data attributes of the business process at the judgment node and their corresponding attribute values are obtained, and the unique value is calculated through the attribute value to determine the execution path of the business process.
[0079] In one embodiment, the unique value is obtained by the assignment method, and the different attribute values of the data attribute in the judgment expression are mapped to a unique integer through the hash algorithm, and the integers corresponding to the data attributes of different judgment expressions are combined in a predetermined order to generate a unique value. Specifically, in a judgment node, if its judgment expression is "age>18", the data attribute involved in the judgment expression is age through regular expression parsing, and its attribute value is yes or no, respectively. When the attribute value is yes, the corresponding integer is 1, and when the attribute value is no, the corresponding integer is 0. According to the attribute value of the data attribute of age of the judgment node in the business process, the unique values of different connected paths are determined. If there are more than two judgment expressions in a judgment node, such as "0≤age<18, 18≤age<60, age≥60", according to the attribute values corresponding to the data attributes of different judgment expressions, it can be determined that the judgment node has three connected paths, and the corresponding unique values are 001, 010 and 100 respectively.
[0080] S400: Determine the flow process of the process to be executed by judging whether there is a historical node in the flow, wherein the flow process includes a starting node process and a backward node process.
[0081] In some embodiments, the step S400 includes:
[0082] Obtain business process nodes and the node relationship table between each node;
[0083] If the process to be executed does not have a historical node in circulation, based on the node relationship table, the starting node process is executed to obtain the starting node of the process to be executed;
[0084] If the to-be-executed process has a historical node in flow, based on the node relationship table, the backward node process is executed;
[0085] When executing the backward node process or the starting node process, n flow nodes are generated, where n≥0, and the flow nodes are nodes being executed.
[0086] In this embodiment, during the process of circulating the process, it is necessary to determine the starting node of the current process to be executed and the node to which it is about to lead. Specifically, if there is a historical node in circulation in the process to be executed, it means that the process to be executed is already in circulation, and the current node is determined to be the starting node. At this time, it is necessary to determine the backward node to which the starting node is about to lead, that is, to execute the backward node process. If there is no historical node in circulation in the process to be executed, it means that the process to be executed has not started to flow. At this time, it is necessary to determine the starting node of the process to be executed, that is, to execute the starting node process.
[0087] In this embodiment, when the process to be executed is circulated, a node relationship table of the nodes of the business process and the connections between the nodes is obtained, and a feature graph is established based on the node relationship table. In other embodiments, the feature graph is further converted into a red-green graph for storage.
[0088] In the workflow of a business process, there are often multiple processes to be executed starting at the same time, or multiple processes starting at the same time after one process is completed. Therefore, in this application, during the execution of the backward node process or the starting node process, the number of flow nodes in execution is multiple.
[0089] Specifically, when determining the flow of the process to be executed, the historical records of the process to be executed are obtained, and the flow information of the current process to be executed is analyzed in a loop traversal manner to determine whether there is a forward direction for the process to be executed. If there is a forward node, and whether there is a forward node in flow, a loop traversal method is used to determine whether the status of each forward node is "flowing" one by one to determine whether there is a forward node in flow. If there is a forward node in flow, the detailed information of the forward node is recorded, including attributes such as node name, executor, and execution time, so as to ensure the traceability of process execution, and at the same time, the backward node process is executed starting from the forward node in flow; or if there is no forward node or no forward node in flow, a request to execute the start node process is initiated to determine the start node, and the process is driven to flow from the start node.
[0090] In some embodiments, during the process execution, according to the business logic and data operations of each node, the data of the relevant business table is updated, such as updating the status of the business document, saving the approval opinions, etc., to ensure that the business data is synchronized with the process progress. After the process execution is completed, the execution results and related data of the process instance are obtained, and the final status, time consumption, and processor information of the process execution are obtained by querying the process instance table and the historical node table, which are used for subsequent business processing and statistical analysis.
[0091] In some implementations, the executing the starting node process to obtain the starting node of the process to be executed includes:
[0092] Determine whether the process to be executed specifies a starting node. If the process to be executed does not specify a starting node, loop through the uncirculated nodes in the process to be executed to determine whether the uncirculated nodes are judgment nodes. If the uncirculated nodes are not judgment nodes, determine them as starting nodes.
[0093] If the to-be-executed process specifies a starting node, it is determined whether the specified starting node exists in the to-be-executed process nodes; if the specified starting node exists, the starting node is determined by determining whether the specified starting node is a determination node.
[0094] In this embodiment, Figure 2 As shown, according to the business logic, determine whether there is a specified starting node in the process to be executed. If there is no specified starting node, traverse all nodes in the process to be executed to determine the starting node of the process to be executed. If there is a specified starting node, determine whether there is a specified starting node in the node in the process to be executed. If there is a specified starting node, determine whether the node is a judgment node. If the node is not a judgment node, record the node and determine that the node is the starting node. If the node in the process to be executed does not have the specified starting node or the specified starting node is a judgment node, an error is returned, and the process to be executed is recorded as an exception, and the process ends.
[0095] In this embodiment, based on the node relationship table, it is determined whether there are uncirculated nodes in the process to be executed. If there are uncirculated nodes, it is determined whether the uncirculated node is a judgment node. If the uncirculated node is not a judgment node, the uncirculated node is recorded, and then the nodes in the process to be executed are traversed in a loop until there are no uncirculated nodes in the process to be executed. Then all the nodes recorded in the traversal process are returned and determined as the starting node.
[0096] In this embodiment, the multiple starting nodes returned are handed over to the executor to determine the final starting node, and according to the determined starting node, the corresponding backward node process is executed to determine the backward node to which the starting node will lead.
[0097] In some embodiments, the performing of the backward node process includes:
[0098] Based on the node relationship table, obtaining the untransferred connections between the nodes of the to-be-executed process;
[0099] Determine the backward node of the uncirculated connection by judging whether the starting node of the uncirculated connection is a judgment node;
[0100] Determine whether the backward node of the uncirculated connection specifies a backward node, if not, determine the backward node, if specified, determine the backward node of the uncirculated connection by determining whether the backward node of the uncirculated connection has a specified backward node;
[0101] The node relationship table is traversed in a loop until there are no untransferred links between the nodes of the to-be-executed process, and all nodes are returned.
[0102] In this embodiment, Figure 3 As shown, based on the node relationship table, the process to be executed is traversed to determine whether there is an uncirculated connection in the process to be executed. If there is no uncirculated connection, all nodes in the process to be executed are returned, indicating that the process to be executed has been completed at this time. If there is an uncirculated connection, determine whether the starting node of the uncirculated connection is a judgment node. If the starting node is a judgment node, determine the backward node through step S300. If the starting node is not a judgment node, determine the backward node according to the business process. After obtaining the backward node, determine whether there is a designated backward node in the process to be executed according to the business logic. If there is no designated backward node, record the backward node and use it as the starting node of the next uncirculated connection. If there is a designated backward node, determine whether the backward node is the designated backward node. If the backward node is the designated backward node, determine whether the connection value between the starting node of the process to be executed and the designated backward node meets the conditions, that is, whether the execution conditions between the two nodes meet the specified conditions. If yes, record the designated backward node and use the designated backward node as the starting node of the next uncirculated connection. If the backward node is not the designated backward node or the connection value between the starting node and the designated backward node does not meet the conditions, the loop process is returned, the starting node of the execution process is recorded as an abnormal node, and the process ends.
[0103] In this embodiment, if an untransferred connection is successfully transferred, the recorded backward node is returned to the node relationship table, and the recorded backward node is used as the starting node of the next untransferred connection to perform a new round of transfer of untransferred connections. When all untransferred connections in the process to be executed are transferred, it means that the process to be executed is completed, and all nodes in the process to be executed are returned, and the execution status of each node is recorded, including the executor, execution time, etc.
[0104] In some embodiments, before step S400, the method further includes:
[0105] Based on the judgment nodes and common nodes of the feature graph, establishing a union of the judgment nodes and common nodes in the feature graph;
[0106] Establishing a first association function, wherein the first association function is used to make each element in the set of directed edges of the feature graph correspond to an ordered pair of elements in the union;
[0107] Establishing a second association function, the second association function is used to make the element corresponding to the judgment node of the directed edge in the feature graph correspond to an element in the set of weights of the directed edge corresponding to the judgment node in the feature graph, wherein the weight is a calculated unique value representing a connectivity condition;
[0108] Set the node to be transferred to the process to be executed as u, when u∈G(D), and (G(u))(x1, x2, x3, ..., x n )∈W(D), determine that the process to be executed has a reachable path in the feature graph, where G(D) is the set of judgment nodes of the feature graph, D represents the feature graph, G(u) represents the node u to be transferred as the judgment node, (x1, x2, x3, ..., x n ) is a set of connectivity conditions of the judgment nodes of the process to be executed, and W(D) represents a set of weights of directed edges corresponding to the judgment nodes of the feature graph.
[0109] In this embodiment, when transferring the process to be executed, it is first determined whether there is a reachable path of the process to be executed in the feature graph, thereby ensuring the smooth transfer of the process to be executed and shortening the execution process of the business process. Specifically, according to the definition of directed graph in mathematics, the feature graph D is defined as an ordered sextuple (G(D), R(D), A(D), ψ(D), W(D), υ(D)), where G(D) is a judgment node, R(D) is an ordinary node, in the red-green graph, G(D) represents a node dyed green, and R(D) represents a node dyed red; A(D) is a set of directed edges, W(D) is a set of weights of directed edges corresponding to the judgment nodes, and the weight is a calculated unique value representing the connectivity condition; ψ(D) is a first association function, which makes each element in A(D) correspond to an ordered pair of elements in the union of G(D) and R(D), and υ(D) is a second association function, which makes the element corresponding to the judgment node in ψ(A(D)) correspond to an element of the W(D). If there is a process to be executed, the node to be transferred is u. When u∈G(D), it means that the node to be transferred is a judgment node. At this time, it is necessary to determine the connection path of the node to be transferred. If at this time (G(u))(x1, x2, x3, ..., x n )∈W(D), it means that the process to be executed has a reachable path in the feature graph.
[0110] Specifically, a feature graph D contains 1 judgment node and 5 ordinary nodes, where the judgment node set G(D) = {g1}, and the ordinary node set R(D) = {r1, r2, r3, r4, r5}. At this time, the union of the judgment nodes and the ordinary nodes V(D) = {g1, r1, r2, r3, r4, r5}, and the directed edge set is set to A(D) = {(r1, r2), (r2, r3), (r3, g1), (g1, r4), (g1, r2), (r4, r5)}. At this time, W(D) = {((g1, r4), 1), ((g1, r2), 0)}. Through the first association function ψ(D), each element in A(D) corresponds to an ordered pair of elements in V(D), such as ψ((r1, r2), 1) = (r1, r2). Through the second association function υ(D), the element of the judgment node in ψ(A(D)) corresponds to an element of W(D), such as υ((g1, r4), 1)) = (g1, r4), 1). If there is a process to be executed r3->r4, the preset ordered 1-tuple (x1) = ((g1, r4), 1)) is used. In this process to be executed, there is a node to be transferred g1∈G(D). At this time, (G(g1))(x1)∈W(D), which means that the process to be executed has a reachable path in the feature graph.
[0111] See also Figure 4As shown, the present invention also provides a process engine implementation system, the system comprising:
[0112] The first processing module 401 is used to obtain a flowchart of a business process and convert the flowchart into a directed graph, wherein the directed graph includes common nodes and judgment nodes;
[0113] The second processing module 402 is used to remove all the judgment nodes in the directed graph, connect the common nodes before and after the judgment nodes, and form a feature graph, which is used to show all the connected paths of the flowchart of the business process;
[0114] The third processing module 403: based on the data attributes of the judgment nodes in the feature graph, obtain the connectivity conditions of the connectivity paths of the judgment nodes in the feature graph, and determine the connectivity paths of the judgment nodes of the to-be-executed process of the business process by comparing the connectivity conditions of the judgment nodes of the to-be-executed process with the connectivity conditions of the corresponding judgment nodes in the feature graph;
[0115] Fourth processing module 404: determining the flow process of the process to be executed by judging whether there is a historical node in the flow, wherein the flow process includes a start node process and a backward node process.
[0116] It is understandable that if Figure 1 The contents of the implementation method of the process engine shown in the embodiment are applicable to the implementation system embodiment of the process engine. The functions specifically implemented by the implementation system embodiment of the process engine are similar to those of the embodiment of the process engine. Figure 1 The implementation method of the process engine shown in FIG. 1 is the same as that of the embodiment shown in FIG. 1 , and the beneficial effects achieved are the same as those of FIG. Figure 1 The beneficial effects achieved by the implementation method embodiment of the process engine shown are also the same.
[0117] It should be noted that the information interaction, execution process and other contents between the above-mentioned systems are based on the same concept as the embodiment of the method of the present invention. Their specific functions and technical effects can be found in the method embodiment part and will not be repeated here.
[0118] Those skilled in the art can clearly understand that, for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example for illustration. In practical applications, the above-mentioned function allocation can be completed by different functional units and modules as needed, that is, the internal structure of the system can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiment can be integrated in a processing unit, or each unit can exist physically separately, or two or more units can be integrated in one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units. In addition, the specific names of the functional units and modules are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of this application. The specific working process of the units and modules in the above-mentioned system can refer to the corresponding process in the aforementioned method embodiment, which will not be repeated here.
[0119] See also Figure 5 As shown, an embodiment of the present invention further provides a computer device 5, comprising: a memory 502 and a processor 501 and a computer program 503 stored in the memory 502. When the computer program 503 is executed on the processor 501, an implementation method of a process engine as described in any one of the above methods is implemented.
[0120] The computer device 5 may be a computing device such as a desktop computer, a notebook, a PDA, or a cloud server. The computer device 5 may include, but is not limited to, a processor 501 and a memory 502. Those skilled in the art will appreciate that Figure 5 It is only an example of the computer device 5 and does not constitute a limitation on the computer device 5. It may include more or fewer components than shown in the figure, or a combination of certain components, or different components. For example, it may also include input and output devices, network access devices, etc.
[0121] The processor 501 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc.
[0122] In some embodiments, the memory 502 may be an internal storage unit of the computer device 5, such as a hard disk or memory of the computer device 5. In other embodiments, the memory 502 may also be an external storage device of the computer device 5, such as a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), etc. equipped on the computer device 5. Further, the memory 502 may also include both an internal storage unit of the computer device 5 and an external storage device. The memory 502 is used to store an operating system, an application program, a boot loader (BootLoader), data, and other programs, such as the program code of the computer program, etc. The memory 502 may also be used to temporarily store data that has been output or is to be output.
[0123] An embodiment of the present invention further provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the implementation method of the process engine as described in any one of the above methods is implemented.
[0124] In this embodiment, if the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present application implements all or part of the processes in the above-mentioned embodiment method, which can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a computer-readable storage medium. When the computer program is executed by the processor, the steps of the above-mentioned various method embodiments can be implemented. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable medium can at least include: any entity or device that can carry the computer program code to the camera / terminal device, recording medium, computer memory, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), electric carrier signal, telecommunication signal and software distribution medium. For example, a USB flash drive, a mobile hard disk, a disk or an optical disk. In some jurisdictions, according to legislation and patent practice, computer-readable media cannot be electric carrier signals and telecommunication signals.
[0125] The embodiments described above are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, a person skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. Such modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application, and should all be included in the protection scope of the present application.
Claims
1. A method for implementing a process engine, characterized in that: include: Obtain a flowchart of a business process, and convert the flowchart into a directed graph, wherein the directed graph includes common nodes and judgment nodes; All judgment nodes in the directed graph are removed, and common nodes before and after the judgment nodes are connected to form a feature graph, where the feature graph is used to display all connected paths of the flowchart of the business process; Based on the data attributes of the judgment nodes of the feature graph, the connectivity conditions of the connectivity paths of the judgment nodes in the feature graph are obtained, and the connectivity paths of the judgment nodes of the to-be-executed processes of the business process are determined by comparing the connectivity conditions of the judgment nodes of the to-be-executed processes with the connectivity conditions of the corresponding judgment nodes in the feature graph; By judging whether the process to be executed has a historical node in the process flow, determining the process flow of the process to be executed, wherein the process flow includes a starting node process and a backward node process; Wherein, in determining the flow process of the process to be executed by judging whether there is a historical node in the flow, the flow process of the process to be executed includes a starting node process and a backward node process, and the previous includes: Based on the judgment nodes and common nodes of the feature graph, establishing a union of the judgment nodes and common nodes in the feature graph; Establishing a first association function, wherein the first association function is used to make each element in the set of directed edges of the feature graph correspond to an ordered pair of elements in the union; Establishing a second association function, the second association function is used to make the element corresponding to the judgment node of the directed edge in the feature graph correspond to an element in the set of weights of the directed edge corresponding to the judgment node in the feature graph, wherein the weight is a calculated unique value representing a connectivity condition; Set the node to be transferred to the process to be executed as u, when u∈G(D), and (G(u))(x1, x2, x3, ..., x n )∈W(D), determine that the process to be executed has a reachable path in the feature graph, where G(D) is the set of judgment nodes of the feature graph, D represents the feature graph, G(u) represents the node u to be transferred as the judgment node, (x1, x2, x3, ..., x n ) is a set of connectivity conditions of the judgment nodes of the process to be executed, and W(D) represents a set of weights of directed edges corresponding to the judgment nodes of the feature graph.
2. The method according to claim 1, characterized in that After removing all the judgment nodes in the directed graph and connecting the common nodes before and after the judgment nodes to form a feature graph, the method includes: A configuration check is performed on the feature graph so that the business process corresponding to the feature graph has at least one reachable path, where the reachable path is a path that has one and only one start node and end node of a business process and is reachable between the start node and the end node.
3. The method according to claim 1, characterized in that The obtaining the connectivity condition of the judgment node in the feature graph based on the data attribute of the judgment node in the feature graph includes: Traversing all nodes in the feature graph to obtain all judgment nodes in the feature graph; Obtaining a judgment expression of the judgment node, parsing the judgment expression, and determining a data attribute to be used; According to the attribute values of different data attributes, the unique values of different connected paths of the judgment node are calculated; Based on the unique value, a connectivity condition of a connectivity path of the judgment node is obtained.
4. The method according to claim 1, characterized in that By judging whether there is a historical node in the flow of the process to be executed, the flow process of the process to be executed is determined, and the flow process includes a starting node process and a backward node process, including: Obtain business process nodes and the node relationship table between each node; If the process to be executed does not have a historical node in circulation, based on the node relationship table, the starting node process is executed to obtain the starting node of the process to be executed; If the to-be-executed process has a historical node in flow, based on the node relationship table, the backward node process is executed; When executing the backward node process or the starting node process, n flow nodes are generated, where n≥0, and the flow nodes are nodes being executed.
5. The method according to claim 4, characterized in that The executing starting node process to obtain the starting node of the process to be executed includes: Determine whether the process to be executed specifies a starting node. If the process to be executed does not specify a starting node, loop through the uncirculated nodes in the process to be executed to determine whether the uncirculated nodes are judgment nodes. If the uncirculated nodes are not judgment nodes, determine them as starting nodes. If the to-be-executed process specifies a starting node, it is determined whether the specified starting node exists in the to-be-executed process nodes; if the specified starting node exists, the starting node is determined by determining whether the specified starting node is a determination node.
6. The method according to claim 4, characterized in that The step of executing a backward node process based on the node relationship table includes: Based on the node relationship table, obtaining the untransferred connections between the nodes of the to-be-executed process; Determine the backward node of the uncirculated connection by judging whether the starting node of the uncirculated connection is a judgment node; Determine whether the backward node of the uncirculated connection has a designated backward node, if not, determine the backward node, if designated, determine the backward node of the uncirculated connection by determining whether the backward node of the uncirculated connection has a designated backward node; The untransferred connections in the process to be executed are traversed in a loop until there are no untransferred connections between the nodes of the process to be executed, and all nodes are returned.
7. A process engine implementation system, characterized in that: include: The first processing module is used to obtain a flowchart of a business process and convert the flowchart into a directed graph, wherein the directed graph includes common nodes and judgment nodes; The second processing module is used to remove all judgment nodes in the directed graph, connect the common nodes before and after the judgment nodes, and form a feature graph, which is used to show all connected paths of the flowchart of the business process; The third processing module: based on the data attributes of the judgment nodes in the feature graph, obtains the connectivity conditions of the connectivity paths of the judgment nodes in the feature graph, and determines the connectivity paths of the judgment nodes of the to-be-executed process of the business process by comparing the connectivity conditions of the judgment nodes of the to-be-executed process with the connectivity conditions of the corresponding judgment nodes in the feature graph; The fourth processing module: by judging whether there is a historical node in the flow of the process to be executed, determining the flow process of the process to be executed, the flow process includes a starting node process and a backward node process; Wherein, in determining the flow process of the process to be executed by judging whether there is a historical node in the flow, the flow process of the process to be executed includes a starting node process and a backward node process, and the previous includes: Based on the judgment nodes and common nodes of the feature graph, establishing a union of the judgment nodes and common nodes in the feature graph; Establishing a first association function, wherein the first association function is used to make each element in the set of directed edges of the feature graph correspond to an ordered pair of elements in the union; Establishing a second association function, the second association function is used to make the element corresponding to the judgment node of the directed edge in the feature graph correspond to an element in the set of weights of the directed edge corresponding to the judgment node in the feature graph, wherein the weight is a calculated unique value representing a connectivity condition; Set the node to be transferred to the process to be executed as u, when u∈G(D), and (G(u))(x1, x2, x3, ..., x n )∈W(D), determine that the process to be executed has a reachable path in the feature graph, where G(D) is the set of judgment nodes of the feature graph, D represents the feature graph, G(u) represents the node u to be transferred as the judgment node, (x1, x2, x3, ..., x n ) is a set of connectivity conditions of the judgment nodes of the process to be executed, and W(D) represents a set of weights of directed edges corresponding to the judgment nodes of the feature graph.
8. A terminal device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the method according to any one of claims 1 to 6 is implemented.
9. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 6 is implemented.
Citation Information
Patent Citations
Processing method and device for customizing online workflow, equipment and storage medium
CN114444935A