CN116414597A - Process node processing method, device, storage medium and equipment - Google Patents

Process node processing method, device, storage medium and equipment Download PDF

Info

Publication number
CN116414597A
CN116414597A CN202210010133.1A CN202210010133A CN116414597A CN 116414597 A CN116414597 A CN 116414597A CN 202210010133 A CN202210010133 A CN 202210010133A CN 116414597 A CN116414597 A CN 116414597A
Authority
CN
China
Prior art keywords
node
flow
state
target
target flow
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202210010133.1A
Other languages
Chinese (zh)
Inventor
刘子哲
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN202210010133.1A priority Critical patent/CN116414597A/en
Publication of CN116414597A publication Critical patent/CN116414597A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/0703Error or fault processing not based on redundancy, i.e. by taking additional measures to deal with the error or fault not making use of redundancy in operation, in hardware, or in data representation
    • G06F11/0706Error or fault processing not based on redundancy, i.e. by taking additional measures to deal with the error or fault not making use of redundancy in operation, in hardware, or in data representation the processing taking place on a specific hardware platform or in a specific software environment
    • G06F11/0715Error or fault processing not based on redundancy, i.e. by taking additional measures to deal with the error or fault not making use of redundancy in operation, in hardware, or in data representation the processing taking place on a specific hardware platform or in a specific software environment in a system implementing multitasking
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/0703Error or fault processing not based on redundancy, i.e. by taking additional measures to deal with the error or fault not making use of redundancy in operation, in hardware, or in data representation
    • G06F11/0793Remedial or corrective actions
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Abstract

The embodiment of the application discloses a method, a device, a storage medium and equipment for processing a flow node, which mainly relate to the technical field of cloud, and the method comprises the following steps: acquiring the working state of the workflow engine in the process that an application process in the workflow engine executes a flow node to be executed in a target flow instance; if the working state of the workflow engine is an abnormal state, traversing the flow nodes of the state database associated with the target flow instance according to the flow node to be executed to obtain a target flow node in a lost state in the target flow instance; and reading attribute information of the target flow node from the state database, calling an application process, and executing the target flow node according to the attribute information. According to the method and the device, the situation that the target flow instance cannot be executed and completed due to loss of the flow node can be avoided, and the execution efficiency of the target flow instance is improved.

Description

Process node processing method, device, storage medium and equipment
Technical Field
The present disclosure relates to the field of cloud technologies, and in particular, to a method, a storage medium, and an apparatus for processing a flow node.
Background
In order to ensure that the task to be processed in the service system can be efficiently executed, the task to be processed is generally arranged into a flow instance comprising a plurality of flow nodes, and the coordination work of related components is controlled through a workflow engine, so that the flow nodes in the flow instance circulate according to a certain flow rule, and the service automation processing is realized. However, because the process nodes have strong dependency relationships, if an abnormal problem occurs in the execution process of a certain process node, the subsequent process node cannot be executed, and further, the execution of the process instance fails, so that the execution efficiency of the process instance is lower.
Disclosure of Invention
The technical problem to be solved by the embodiments of the present application is to provide a method, an apparatus, a storage medium, and a device for processing a flow node, which can improve the execution efficiency of a target flow instance.
In one aspect, a method for processing a flow node is provided in an embodiment of the present application, including:
acquiring the working state of the workflow engine in the process that an application process in the workflow engine executes a flow node to be executed in a target flow instance;
if the working state of the workflow engine is an abnormal state, traversing the flow nodes in the state database associated with the target flow instance according to the flow nodes to be executed to obtain the target flow nodes in the lost state in the target flow instance;
And reading attribute information of the target flow node from the state database, calling an application process, and executing the target flow node according to the attribute information.
In one aspect, a processing device for a flow node is provided in an embodiment of the present application, including:
the acquisition module is used for acquiring the working state of the workflow engine in the process of executing the flow node to be executed in the target flow instance by the application process in the workflow engine;
the traversing module is used for traversing the flow nodes in the state database associated with the target flow instance according to the flow nodes to be executed if the working state of the workflow engine is an abnormal state, so as to obtain the target flow nodes in the lost state in the target flow instance;
and the execution module is used for reading the attribute information of the target flow node from the state database, calling the application process and executing the target flow node according to the attribute information.
Wherein, the traversal module includes:
the first acquisition unit is used for acquiring the execution sequence of the flow nodes in the target flow instance from the state database; the process nodes in the target process instance comprise process nodes to be executed;
the generating unit is used for generating a flow node tree corresponding to the target flow instance according to the execution sequence of the flow nodes in the target flow instance;
The second acquisition unit is used for acquiring a first node type of the flow node to be executed;
and the traversing unit is used for traversing the nodes in the flow node tree according to the first node type to obtain the target flow node in the lost state in the target flow instance.
The flow node tree comprises a root node corresponding to a first flow node with the earliest execution sequence in the target flow instance and a leaf node corresponding to a second flow node with the execution sequence later than that of the first flow node in the target flow instance;
the traversing unit is specifically used for:
if the first node type is the signal gateway node type, traversing the flow node tree by taking a corresponding node of the flow node to be executed in the flow node tree as a traversing starting point to obtain a target flow node in a lost state in the target flow instance; the target flow node comprises at least one of a first flow node and a second flow node;
if the first node type is a non-signal gateway node type, traversing the flow node tree by taking the root node as a traversing starting point to obtain a target flow node in a lost state in the target flow instance.
If the first node type is a signal gateway node type, traversing the flow node tree by taking a corresponding node of the flow node to be executed in the flow node tree as a traversing starting point to obtain a target flow node in a lost state in the target flow instance, wherein the method comprises the following steps:
If the first node type is a signal gateway node type and the node used for reflecting the flow node to be executed in the flow node tree is a root node of the flow node tree, the execution state of the flow node to be executed is obtained, and if the execution state of the flow node to be executed is not the execution completion state, the flow node of the node to be executed is determined to be a target flow node in a lost state in the target flow instance;
if the first node type is the signal gateway node type and the node used for reflecting the to-be-executed flow node in the flow node tree is a leaf node of the flow node tree, traversing the flow node tree by taking the corresponding leaf node of the to-be-executed flow node as a traversing starting point in the direction of approaching to the root node of the flow node tree to obtain a third flow node with an execution state in an unexecuted state, and determining the third flow node as a target flow node in a lost state in the target flow example.
If the first node type is a non-signal gateway node type, traversing the flow node tree by taking the root node as a traversing starting point to obtain a target flow node in a lost state in the target flow instance, wherein the method comprises the following steps:
If the first node type is a non-signal gateway node type, traversing all nodes in the flow node tree by taking the root node as a traversing starting point to obtain a fourth flow node with an execution state in an unexecuted state;
and determining the fourth flow node as the target flow node in the lost state in the target flow instance.
Wherein, the execution module includes:
a third obtaining unit, configured to read attribute information of the target flow node from the state database;
the adding unit is used for adding the attribute information of the target flow node into the node database corresponding to the target flow instance;
the removing unit is used for calling the application process, reading the attribute information of the target flow node from the node database and removing the attribute information of the target flow node from the node database;
and the execution unit is used for acquiring the execution information of the target flow node from the state database according to the attribute information and executing the target flow node according to the execution information.
The execution information comprises node interface information of the target flow node and flow interface information of the target flow instance;
the execution unit is specifically configured to:
calling an application process, and acquiring node interface information of a target flow node and flow interface information of a target flow instance from a state database according to the attribute information;
Acquiring a second node type corresponding to the target flow node;
selecting a target processor for executing the target flow node from the processors in the workflow engine according to the second node type;
and calling a target processor, and executing the target process node according to the node interface information and the process interface information.
Wherein, the execution unit is further specifically configured to:
when an execution state change instruction aiming at a target flow node is received in the process of calling a target processor to execute the target flow node, updating the execution state of the target flow node according to the execution state change instruction to obtain an updated execution state;
updating the execution state of the target flow node in the state database by adopting the updated execution state;
and if the updated execution state is the unexecuted state, adding the attribute information of the target flow node into the node database.
Wherein, the acquisition module includes:
a fourth obtaining unit, configured to obtain system log data of the workflow engine in a process that an application process in the workflow engine executes a flow node to be executed in the target flow instance;
and the determining unit is used for determining the working state of the workflow engine according to the system log data.
Wherein, the determining unit is specifically configured to:
if the system log data indicate that the system of the first service equipment belonging to the node database of the workflow engine has restarting operation, determining that the working state of the workflow engine is an abnormal state;
if the system log data indicate that the system of the second service equipment corresponding to the application process has restarting operation, determining that the working state of the workflow engine is an abnormal state;
if the system log data indicates that the adjustment execution operation aiming at the flow node to be executed is received, determining that the working state of the workflow engine is an abnormal state;
and if the system log data indicates that the network of the first service equipment is abnormal, determining that the working state of the workflow engine is an abnormal state.
In one aspect, a computer device is provided, including: a processor and a memory;
the processor is connected to the memory, wherein the memory is configured to store a computer program, and when the computer program is executed by the processor, the computer device is caused to execute the method provided in the embodiment of the application.
In one aspect, the present application provides a computer readable storage medium storing a computer program adapted to be loaded and executed by a processor, so that a computer device having the processor performs the method provided in the embodiments of the present application.
In one aspect, the present application provides a computer program product or computer program comprising computer instructions stored in a computer readable storage medium. The processor of the computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device performs the method provided in the embodiments of the present application.
In the embodiment of the application, in the process that an application process in a workflow engine executes a flow node to be executed in a target flow instance, the working state of the workflow engine is obtained. Thus, the working state of the workflow engine can be detected, and whether the working state of the workflow engine is abnormal or not can be detected. If the working state of the workflow engine is an abnormal state, traversing the flow nodes in the state database associated with the target flow instance according to the flow nodes to be executed to obtain the target flow nodes in the lost state in the target flow instance; and reading attribute information of the target flow node from the state database, calling an application process, and executing the target flow node according to the attribute information. According to the method and the device, when the workflow engine is abnormal, the lost target flow node in the target flow instance can be retrieved and executed, so that the situation that the target flow instance cannot be executed successfully due to the fact that the flow node is lost when the workflow engine is abnormal can be avoided, and the execution efficiency of the target flow instance can be improved.
Drawings
In order to more clearly illustrate the embodiments of the invention or the technical solutions in the prior art, the drawings that are required in the embodiments or the description of the prior art will be briefly described, it being obvious that the drawings in the following description are only some embodiments of the invention, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a schematic architecture diagram of a process node processing system according to an embodiment of the present application;
fig. 2 is a schematic application scenario diagram of a process node processing provided in an embodiment of the present application;
fig. 3 is a flow diagram of a flow node processing method according to an embodiment of the present application;
FIG. 4 is a schematic diagram of a workflow engine provided by an embodiment of the present application;
FIG. 5 is a schematic diagram of a workflow engine operation provided in an embodiment of the present application;
FIG. 6 is a schematic diagram of a process node tree according to an embodiment of the present application;
FIG. 7 is a schematic diagram of a sub-process node according to an embodiment of the present application;
fig. 8 is a schematic diagram of a signal gateway node according to an embodiment of the present application;
fig. 9 is a schematic diagram of a signal gateway node according to an embodiment of the present application;
FIG. 10 is a schematic diagram of a finite state machine of one example of a process provided in an embodiment of the present application;
FIG. 11 is a schematic diagram of a finite state machine of a process node according to an embodiment of the present application;
FIG. 12 is a schematic diagram of an example workflow engine execution target flow provided in an embodiment of the present application;
fig. 13 is a schematic diagram of a process node processing method according to an embodiment of the present application;
fig. 14 is a schematic diagram of a target process node according to an embodiment of the present application;
fig. 15 is a schematic diagram of an acquiring target flow node according to an embodiment of the present application;
FIG. 16 is a schematic diagram of a target flow node implementation provided in an embodiment of the present application;
FIG. 17 is a schematic diagram of a target flow node according to an embodiment of the present disclosure;
fig. 18 is a schematic structural diagram of a flow node processing apparatus according to an embodiment of the present application;
fig. 19 is a schematic structural diagram of a computer device according to an embodiment of the present application.
Detailed Description
The following description of the embodiments of the present invention will be made clearly and completely with reference to the accompanying drawings, in which it is apparent that the embodiments described are only some embodiments of the present invention, but not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
The application relates to the technical field of cloud technology. The application relates to the field of cloud computing in the technical field of cloud technology, wherein cloud computing (cloud computing) refers to a delivery and use mode of an IT infrastructure, and refers to obtaining required resources in an on-demand and easily-expandable manner through a network; generalized cloud computing refers to the delivery and usage patterns of services, meaning that the required services are obtained in an on-demand, easily scalable manner over a network. Such services may be IT, software, internet related, or other services. Cloud Computing is a product of fusion of traditional computer and network technology developments such as Grid Computing (Grid Computing), distributed Computing (distributed Computing), parallel Computing (Parallel Computing), utility Computing (Utility Computing), network storage (Network Storage Technologies), virtualization (Virtualization), load balancing (Load balancing), and the like. In the embodiment of the application, the workflow engine may refer to a workflow engine of a cloud delivery platform deployed in a cloud, where the workflow engine of the cloud delivery platform can be used to execute flow instances of multiple services, for example, the services may include data verification, service transaction audit, and so on, so as to implement service automation processing. The cloud delivery platform can provide the capability of sharing the infrastructure of a large platform, realize the intensification of the infrastructure, provide a data storage and management platform, realize the collaborative management and integrated service of cross departments and regions, realize the scientization of decisions, break information islands and promote the integration of information systems.
Referring to fig. 1, fig. 1 is a schematic structural diagram of a flow node processing system according to an embodiment of the present application. As shown in fig. 1, the flow node processing system may include a server 10 and a cluster of user terminals. The cluster of user terminals may comprise one or more user terminals, the number of which will not be limited here. As shown in fig. 1, the user terminals 100a, 100b, 100c, …, and 100n may be specifically included. As shown in fig. 1, the user terminals 100a, 100b, 100c, …, 100n may respectively perform network connection with the server 10, so that each user terminal may perform data interaction with the server 10 through the network connection.
Wherein each user terminal in the user terminal cluster may include: smart phones, tablet computers, notebook computers, desktop computers, wearable devices, smart home, head-mounted devices, vehicle-mounted terminals and other intelligent terminals with flow node processing. It should be appreciated that each user terminal in the cluster of user terminals shown in fig. 1 may be provided with a target application (i.e. application client) that, when running in each user terminal, may interact with the server 10 shown in fig. 1, respectively, as described above.
As shown in fig. 1, the server 10 may be an independent physical server, a server cluster or a distributed system formed by a plurality of physical servers, or a cloud server that provides cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDNs, basic cloud computing services such as big data and artificial intelligence platforms, and the like.
For easy understanding, in the embodiment of the present application, one user terminal may be selected from the plurality of user terminals shown in fig. 1 as a target user terminal, where the target user terminal may include: smart terminals carrying process node processing functions such as smart phones, tablet computers, notebook computers, desktop computers, smart televisions and the like. For example, for ease of understanding, in the embodiment of the present application, the user terminal 100a shown in fig. 1 may be used as a target user terminal, and the user terminal 100a may acquire, in real time or periodically, the working state of the workflow engine during the execution of the flow node to be executed in the target flow instance by the application process in the workflow engine. The workflow engine refers to a functional component for implementing the target flow instance, and the workflow engine can perform important functional management such as node management, flow direction management, flow sample management and the like on the target flow instance, for example, the workflow engine may refer to a workflow engine of the cloud delivery platform, and the workflow engine detects and manages the execution of the target flow instance. The user terminal 100a may detect whether the operation state of the workflow engine is normal, and if the user terminal 100a detects that the operation state of the workflow engine is abnormal, a message indicating that the operation state of the workflow engine is abnormal may be transmitted to the server 10. After receiving the message that the working state of the workflow engine is in the abnormal state, the server 10 may traverse the flow nodes in the state database associated with the target flow instance according to the flow nodes to be executed, to obtain the target flow node in the lost state in the target flow instance. The state database includes execution states and execution information corresponding to each flow node in one or more flow instances, where the execution information may include attribute information (such as node identification) of the flow node, whether the flow node may skip, a flow instance to which the flow node belongs, and the like. The server 10 may traverse the flow nodes belonging to the target flow instance in the state database to obtain the target flow node in the lost state in the target flow instance.
Further, after obtaining the target flow node in the lost state in the target flow instance, the server 10 may obtain attribute information of the target flow node from the state database, where the attribute information may refer to a node identifier of the flow node, and send the attribute information of the target flow node to the user terminal 100a. The user terminal may invoke an application in the workflow engine, and execute the target flow node according to the attribute information of the target flow node (i.e., perform logic), so that the target flow node reaches an execution completion state. Thus, through the method and the device, when the working state of the workflow engine is detected to be abnormal, the target flow node in the lost state in the target flow instance is determined, and the target flow node is executed, so that the situation that the target flow instance cannot be successfully executed due to the loss of the flow node in the target flow instance can be avoided, and the execution efficiency of the target flow instance can be improved.
For easy understanding, further, please refer to fig. 2, fig. 2 is a schematic view of an application scenario of a process node process according to an embodiment of the present application. The server 20d shown in fig. 2 may be the server 10, the target user terminal 20a shown in fig. 2 may be any one of the user terminals in the user terminal cluster shown in fig. 1, and for example, the target user terminal 20a may be the user terminal 100b. As shown in fig. 2, the target user terminal 20a displays an execution status interface 20c of the flow node in the current flow instance a. As shown in fig. 2, the execution status interface 20c shows that the flow node 1 and the flow node 2 in the flow instance a are in the executed completion state, and the flow node 3 is in the executing state (i.e., not executing completion state). As shown in fig. 2, the target user terminal 20a may invoke an application process (such as any one of the application process 1, the application process 2, or the application process n) in the workflow engine 20b, obtain attribute information of the flow node 3 that is not executed in the flow instance a from the node database, and obtain execution information of the flow node 3 from the state database, and execute the flow node 3 that is not executed in the flow instance a according to the execution information of the flow node 3. The target user terminal 20a may obtain the working state of the workflow engine 20b in real time during the process of calling the application process in the workflow engine 20b to execute the flow node 3 (i.e. the flow node to be executed) in the flow instance a. If the target user terminal 20a detects that the workflow engine 20b is restarted, it can determine that the working state of the workflow engine 20b is abnormal, and send a message to the server 20d that the working state of the workflow engine 20b is abnormal.
Further, after receiving the message that the working state of the workflow engine 20b sent by the target user terminal 20a is in an abnormal state, the server 20d may traverse the flow nodes in the state database 20e according to the flow node 3, where the state database 20e stores related information (such as attribute information, execution information, etc.) of the flow nodes in the flow instance a. Server 10 may determine from state database 20e the flow node in the instance flow a that did not execute the completion (i.e., flow node 3), and determine that flow node 3 as the target flow node 20f in the missing state in flow instance a. The server 20d may obtain the attribute information 20g of the target flow node from the state database 20e, and return the attribute information 20g of the target flow node, which may be a node identifier, to the target user terminal 20 a. Further, after receiving the attribute information 20g of the target flow node, the target user terminal 20a may add the attribute information 20g of the target flow node to the node database, call an application process in the workflow engine, obtain the attribute information 20g of the target flow node from the node database, obtain the execution information of the target flow node from the state database according to the attribute information 20g of the target flow node, and execute the target flow node 3 according to the execution information. After execution of the target flow node in the workflow engine 20b is completed, the target user terminal 20a may output the execution status interface 20h, and output information of completion of execution of the flow instance. Therefore, according to the method and the device, the situation that the flow instance cannot be successfully executed due to the fact that the node is lost when the flow instance is executed can be avoided, and the execution efficiency of the flow instance can be improved.
Referring to fig. 3, fig. 3 is a flow chart of a flow node processing method according to an embodiment of the present application. The process node processing method may be performed by a computer device, which may be a server (e.g., the server 10 in fig. 1 described above), or a user terminal (e.g., any user terminal in the user terminal cluster in fig. 1 described above), which is not limited in this application. As shown in fig. 3, the process node processing method may include, but is not limited to, the following steps:
s101, acquiring the working state of the workflow engine in the process that an application process in the workflow engine executes a flow node to be executed in a target flow instance.
Specifically, the computer equipment can arrange the business processing task to be completed into a target flow instance comprising a plurality of flow nodes, and execute each flow node in the target flow instance through the workflow engine, so that the business processing task is automatically executed, the success of manual execution is reduced, and the task execution intellectualization is realized. The workflow engine is used for executing the flow nodes in the target flow instance, so that each flow node in the target flow instance is executed, and the workflow engine can also perform important function management such as node management, flow direction management, flow sample management and the like on the target flow instance. Specifically, the computer device may obtain, through an application process in the workflow engine, attribute information of a flow node that is not executed in the target flow instance in the node database, where the attribute information may refer to a node identifier of the flow node. Wherein, the node database stores the attribute information of the flow nodes which are not executed in one or more flow instances, and the target flow instance belongs to any one of the one or more flow instances.
Further, after the computer device reads the attribute information of the to-be-executed flow node (i.e. the flow node that is not executed) in the target flow instance through the application process in the workflow engine, the execution information of the to-be-executed flow node may be obtained from the state database according to the attribute information, where the execution information may include information such as an execution state of the target flow instance to which the to-be-executed flow node belongs, a first node type of the to-be-executed flow node, execution logic, and an execution state. The state database comprises attribute information, execution state and execution information of flow nodes included in each of one or more flow instances. Further, after the computer device obtains the attribute information of the to-be-executed flow node, the to-be-executed flow node can be executed according to the attribute information of the to-be-executed flow node through an application process in the workflow engine, so that the to-be-executed flow node reaches an executed completion state. The working state of the workflow engine can be obtained in real time or periodically in the process that the computer equipment executes the flow node to be executed in the target flow instance through the application process in the workflow engine.
The workflow engine can comprise a plurality of application processes, and the computer equipment can call the application processes in the workflow engine in one or two modes of the following two modes. Mode one: and determining an application process according to the service type corresponding to the flow node to be executed. Different application processes may have different business processing capabilities, for example, the application processes include an application process 1 and an application process 2, the application process 1 has business processing capabilities corresponding to business processing financial business types, and the application process 2 has business processing capabilities corresponding to business processing social business types. Therefore, the application process for executing the flow node to be executed can be determined according to the service type corresponding to the flow node to be executed, so that the accuracy of service processing can be improved. The service processing capability of the application process is determined according to the success rate, the processing efficiency and the like of the application process for processing the service in the historical time period. Mode two: the computer equipment can acquire the number of to-be-executed flow nodes of each application process, and determine the application process for executing the to-be-executed flow nodes of the target flow instance according to the number of to-be-executed flow nodes, so that load balancing of each application process can be realized, and service processing efficiency is improved.
Fig. 4 is a schematic diagram of a workflow engine according to an embodiment of the present application, where the workflow engine is part of a cloud delivery platform as shown in fig. 4. As shown in fig. 4, the cloud delivery platform includes a base layer, where the base layer includes a state database, a node database, and a message queue, where the state database is used to store relevant information (such as an execution state, execution logic, an instance identifier, etc.) of each flow instance and relevant information (such as an execution state, execution logic, a node identifier, etc.) of each flow node in each flow instance. The message queue is used for storing the to-be-executed flow nodes needing to be subjected to state update in the node database, namely the to-be-executed flow nodes which are not executed by the node database and have a first-in first-out sequence. The cloud delivery platform comprises an atomic task layer, wherein the atomic task layer comprises a virtual machine task module and a disk task module, and the virtual machine task module and the disk task module are used for determining a flow instance of a business processing task to be executed. The atomic task layer also comprises a node setting module and a deployment execution module, wherein the node setting module is used for setting flow nodes in the flow instance, and the deployment execution module is used for deploying the execution sequence of the flow nodes in the flow instance. The cloud delivery platform further comprises a controller layer, wherein the controller layer comprises an atomic task controller, a deployment progress tree updater, a layout generator and a workflow engine. The atomic task controller is used for controlling the generated flow instance, the deployment progress tree updater is used for updating the flow node tree according to the execution condition of the flow instance, the arrangement generator is used for arranging and generating the flow instance according to the business processing task, and the flow instance is executed through the workflow engine. The cloud delivery platform further comprises an API (i.e. a calling interface reserved for application programs by an operating system) layer, and the API layer stores service processing interface information in the cloud delivery platform. The cloud delivery platform can be accessed into a third system to manage business processing in the third party system.
For example, a processing task Q is set in the cloud delivery platform, and the computer device may determine execution logic and execution sequence of the flow nodes in the processing task Q through a point setting module and a deployment execution module in the cloud delivery platform. Further, the computer device may orchestrate the processing task Q through an orchestration generator in the cloud delivery platform, generating a flow instance Q. The process example q comprises four process nodes of material preparation, configuration preparation, application deployment and service registration. Further, the computer device can manage execution of four flow nodes in the flow instance q through a workflow engine in the cloud delivery platform, so that the four flow nodes in the flow instance q reach an execution completion state, and further execution management of the flow instance q is completed.
As shown in fig. 5, fig. 5 is a schematic diagram of a workflow engine operation provided in an embodiment of the present application, and as shown in fig. 5, a computer device may read, through a coroutine 1 and a coroutine 2 and … coroutine n (i.e., an application process) in the workflow engine, a flow node to be executed in a node database, where the node database includes flow nodes to be executed (i.e., flow nodes not executing completely) of a plurality of flow instances, where attribute information of the flow nodes not executing completely in the flow instances is stored in the node database. As shown in fig. 5, the coroutine 1 in the workflow engine may read attribute information (such as a node identifier) of the flow node 1 to be executed from the node database. Similarly, the coroutine 2 in the workflow engine can acquire the attribute information of the flow node 2 to be executed from the node database, that is, the coroutine in the workflow engine can respectively read the attribute information of one flow node to be executed. And after the coroutines in the workflow engine read the flow nodes to be executed from the node database, removing the attribute information of the read flow nodes to be executed from the node database. As shown in fig. 5, taking the process of executing the to-be-executed flow node 1 by the coroutine 1 as an example, the process of executing the to-be-executed flow node by the workflow engine is described in detail, and when the coroutine 1 in the workflow engine reads the to-be-executed flow node 1 from the node database, the attribute information of the to-be-executed flow node can be removed from the node database.
Further, after the coroutine 1 reads the attribute information of the to-be-processed flow node 1, the execution information of the to-be-executed flow node 1 may be obtained in the state database, where the execution information may include information such as an execution state of the to-be-executed flow node, an execution logic, and an execution state of the belonging target flow instance. The computer equipment can execute the flow node 1 to be executed according to the execution information of the flow node to be executed through the coroutine 1 in the workflow engine. After the coroutine 1 performs state circulation (i.e. state update) on the to-be-executed flow node 1 according to the execution information, the initial execution state of the to-be-executed flow node may be updated in the state database according to the execution state of the to-be-executed flow node 1 after the state update. Further, the computer device may detect whether the state-updated flow node to be executed is in a non-execution completion state, and if the state-updated flow node to be executed is still in the non-execution completion state, add attribute information of the state-updated flow node to the node database, so that the coroutine in the subsequent workflow engine continues to read the state-updated flow node to be executed from the node database, and further, the execution of the state-updated flow node to be executed is completed.
Optionally, in the process that the application process in the workflow engine executes the flow node to be executed in the target flow instance, the specific manner of obtaining the working state of the workflow engine by the computer device may include: and acquiring system log data of the workflow engine in the process that an application process in the workflow engine executes the flow node to be executed in the target flow instance. And determining the working state of the workflow engine according to the system log data.
Specifically, in the process that an application process in the workflow engine executes a flow node to be executed in a target flow instance, the computer device may acquire system log data of the workflow engine, where the system log data includes detailed record information of an event triggered in the workflow engine. The computer device may detect whether the working state of the workflow engine is an abnormal state by checking the system log data, and if it is detected that the workflow engine has a target event according to the system log data, it may determine that the working state of the workflow engine is an abnormal state. By analyzing the system log, the state of the workflow engine can be determined, the working state of the workflow engine can be automatically detected, and the detection efficiency is improved.
Optionally, the specific manner in which the computer device determines the working state of the workflow engine according to the system log data may include: if the system log data indicates that the system of the first service device belonging to the node database of the workflow engine has a restarting operation, the working state of the workflow engine is determined to be an abnormal state. If the system log data indicates that the system of the second service equipment corresponding to the application process has restarting operation, the working state of the workflow engine is determined to be an abnormal state. If the system log data indicates that the adjustment execution operation aiming at the flow node to be executed is received, the working state of the workflow engine is determined to be an abnormal state. And if the system log data indicates that the network of the first service equipment is abnormal, determining that the working state of the workflow engine is an abnormal state.
Specifically, if the computer device detects that the system log data of the workflow engine indicates that a restart operation exists in the system of the first service device belonging to the node database of the workflow engine, the working state of the workflow engine can be determined to be an abnormal state. Because the node database stores the attribute information of the to-be-executed flow nodes which are not executed in the target flow instance, when the node database fails and is restarted, the attribute information of the to-be-executed flow nodes can be lost, so that the workflow engine cannot execute the lost to-be-executed flow nodes, and further the success of the execution of the target flow instance cannot be ensured. Therefore, when the computer equipment detects that the node database has a restarting operation, the working state of the workflow engine can be determined to be an abnormal state, so that the lost flow node compensation to be executed is added into the node database later, and the successful execution of the target flow instance is ensured.
Specifically, when the computer device detects that the system log data of the workflow engine indicates that a restart operation exists in the second service device corresponding to the application process, it may be determined that the working state of the workflow engine is an abnormal state. When the workflow engine is restarted, the executing process node is lost if the workflow engine is restarted in the process of executing the process node to be executed according to the execution information, and the lost process node to be executed in the application process does not exist in the node database, so that the execution of the lost process node to be executed cannot be completed. Therefore, when the computer equipment detects that the restarting operation exists in the system of the second service equipment corresponding to the application process, the working state of the workflow engine can be determined to be an abnormal state.
Specifically, if the computer device detects that the system log data of the workflow engine indicates that the network belonging to the first service device is abnormal, it may be determined that the working state of the workflow engine is an abnormal state. The method comprises the steps that an application process in a workflow engine needs to acquire attribute information of a to-be-executed flow node from a node database, and after the application process sends a to-be-executed flow node reading request to first service equipment of the node database, the first service equipment of the node database can send the attribute information of the to-be-executed flow node to the application process, and the attribute information of the to-be-executed flow node sent to the application process is removed from the node database. When the first service device of the node database sends the to-be-executed flow node to the application process, the network abnormality occurs, which results in that the sending to-be-executed flow node is lost, that is, the application process does not receive the to-be-executed flow node sent by the first service device of the node database, and the target flow instance cannot be executed.
Specifically, if the system log data from the computer device to the workflow engine indicates that an adjustment execution operation for a flow node to be executed is received, it may be determined that the working state of the workflow engine is an abnormal state. When the manager detects that the flow node to be executed is abnormal, the manager triggers the adjustment execution operation for the flow node to be executed, such as the node stopping operation, the node retrying operation, the node skipping operation and the like. When the computer equipment detects that the manager adjusts the operation for the execution of the flow node to be executed, the working state of the workflow engine can be determined to be an abnormal state.
Optionally, the specific manner in which the computer device determines the working state of the workflow engine according to the system log data may include: the computer device may determine, according to the system log data of the workflow engine, an execution duration of the application process in the workflow engine in the to-be-executed flow node in the execution target flow instance. Further, the computer device may determine whether the execution duration is greater than or equal to a target duration threshold, and if the computer device detects that the execution duration of the flow node to be executed is greater than or equal to the target duration threshold, may determine that the working state of the workflow engine is an abnormal state; if the computer equipment detects that the execution time length of the flow node to be executed is smaller than the target time length threshold value, the working state of the workflow engine can be determined to be a normal state. The target duration threshold may be determined according to a service type of the target flow instance, or may be determined according to an execution condition of a specific node, which is not limited in the embodiments of the present application.
Optionally, the state database may refer to a MySQL database (a relational database management system) that is used to store execution information (such as flow interface information) of the target flow instance, and attribute information and execution information of each flow node in the target flow instance (such as the information of the flow instance, execution logic, and state flow rules of the target flow instance). The node database may refer to Redis (Remote Dictionary Server) database, and the Redis database is a high-performance key-value database, and may support master-slave synchronization, where data may be synchronized from a master server to any number of slave servers, and the slave servers may be master servers associated with other slave servers, so as to improve expandability of reading operations and reduce data redundancy.
S102, if the working state of the workflow engine is an abnormal state, traversing the flow nodes in the state database associated with the target flow instance according to the flow nodes to be executed to obtain the target flow nodes in the lost state in the target flow instance.
Specifically, if the computer device determines that the working state of the workflow engine is an abnormal state, it may be determined that there may be a loss of the flow node to be executed, and the computer device may traverse the flow node in the state database associated with the target flow instance to the target flow node in the lost state in the target flow instance according to the flow node to be executed. Specifically, the computer device may traverse the flow nodes in the state database according to the node types and the execution sequences of the flow nodes to be executed, and so on, to obtain the execution states of the flow nodes belonging to the target flow instance in the state database. Further, the flow node with the execution state being the non-execution completion state in the target flow instance is determined to be the target flow node in the lost state in the target flow instance.
Optionally, the computer device may determine, according to the execution state of the flow node belonging to the target flow instance in the state database, a candidate flow node in the non-execution completion state in the target flow instance, and obtain a node identifier of the candidate flow node. The computer device may also obtain a stored flow node belonging to the target flow instance from the node database, and obtain a node identification of the stored flow node. Further, the computer device may determine a difference flow node according to the node identifier of the stored flow node and the node identifier of the candidate flow node, and determine the difference flow node as the target flow node in the lost state in the target flow instance. It can be understood that after the computer device determines, according to the to-be-executed process node, the candidate process node in the non-execution completion state in the target process instance from the state database, whether the candidate process node in the non-execution completion state in the state database is lost can be determined according to the stored process node belonging to the target process instance stored in the node database. If the candidate flow node exists in the state database and does not exist in the node database, the candidate flow node can be determined to be lost, and the candidate flow node is determined to be the target flow node in the lost state in the target flow instance.
Optionally, the specific way for the computer device to traverse the process nodes in the state database associated with the target process instance according to the process node to be executed to obtain the target process node in the lost state in the target process instance may include: acquiring the execution sequence of the flow nodes in the target flow instance from the state database; the flow nodes in the target flow instance include flow nodes to be executed. And generating a flow node tree corresponding to the target flow instance according to the execution sequence of the flow nodes in the target flow instance. And acquiring a first node type of the flow node to be executed, traversing the nodes in the flow node tree according to the first node type, and obtaining the target flow node in a lost state in the target flow instance.
Specifically, the state database stores related information (such as execution information, attribute information, etc.) of a plurality of process nodes in the target process instance, and an execution sequence is arranged among the plurality of process nodes in the target process instance. If the start node executes before, the end node executes after. The computer device may obtain, from the state database, an execution order of flow nodes in the target flow instance, the flow nodes in the target flow instance including flow nodes to be executed. The computer device may generate a flow node tree corresponding to the target flow instance according to an execution order of the flow nodes in the target flow instance. The computer device may generate the flow node tree corresponding to the target flow instance according to the execution sequence of each flow node in the target flow instance. The computer device may use a first executed flow node in the target flow instance as a root node of a flow node tree corresponding to the target flow instance, use a flow node in the target flow instance, the execution order of which is later than that of the root node, as a leaf node, and use a last executed flow node in the target flow instance as a last node of the flow node tree corresponding to the target flow instance, so as to generate a flow node tree of the target flow instance. The flow node tree of the target flow instance can be generated in advance and can be directly invoked later. Further, the computer device may obtain a first node type of the flow node to be executed, and traverse the nodes in the flow node tree according to the first node type of the flow node to be executed, to obtain a target flow instance in a lost state in the target flow instance.
Fig. 6 is a schematic diagram of a flow node tree provided in an embodiment of the present application, where, as shown in fig. 6, a computer device may generate a flow node tree of a target flow instance according to an execution sequence of flow nodes in the target flow instance. If the flow instance a includes a flow node A1, a flow node A2, a flow node A3, a flow node A4, a flow node A5, and a flow node A6, which have execution sequences. The flow node A1 is the first flow node to execute, the flow node A2 and the flow node A3 have the same execution sequence and are only later than the flow node A1, the execution sequence of the flow node A6 is later than the flow node A2, and the flow node A4 and the flow node A5 have the same execution sequence and are later than the flow node A2. The computer device may use the flow node 1 with the first execution sequence in the flow instance a as the node 1 in the flow node tree, and use the flow node A2 and the flow node A3 with the same execution sequence and only later than the flow node A1 as the leaf node 2 and the leaf node 3 in the flow node tree. The computer device may use the flow node A4 and the flow node A5 with the same execution sequence as the leaf node 4 and the leaf node 5 in the flow node tree, and use the flow node A6 in the target flow instance as the leaf node 6 in the flow node tree to generate the flow node tree of the target flow instance. The flow node tree of the target flow instance can be generated in advance and can be directly invoked later.
Specifically, the first node type of the flow node to be executed may include an event node type, an active node type, a signal gateway node type, and the like. The event node type refers to a process node of the event node type that triggers a target event when running to the event node type, where the process node of the event node type may include a start event node and an end event node, where both the start event node and the end event node are actually present in a layout file (i.e., a target process instance) in a node form, but are not shown on a front page. The start event node is used for representing the start of a process instance or a layout file, and the end event node is used for representing the end of a process instance or a layout file.
Specifically, the active node type includes two sub-categories of tasks and sub-flows, and the flow nodes of the active node type are also actually present in the orchestration file (i.e., the target flow instance) in the form of nodes. Wherein the task is the most basic unit in the activity (Activities), the real action performer. When the first node type of the flow node to be executed is the task node type, different task modes can be supported by the task plug-in, for example, by binding an HTTP (HyperText Transfer Protocol, abbreviated as HTTP, a request-response protocol) plug-in, that is, when the first node type of the flow node to be executed is executed to the flow node to be executed, an HTTP request is sent to a designated network interface (i.e., URL), so that a preset target task is completed. Wherein, the sub-process nodes are nesting of processes, and one sub-process node can comprise a plurality of task nodes and a plurality of deployment sub-processes. As shown in fig. 7, fig. 7 is a schematic diagram of a sub-flow node provided in an embodiment of the present application, and as shown in fig. 7, a sub-flow a belonging to a target flow instance may include a sub-flow a1, a sub-flow a2, a sub-flow a3, and a sub-flow a4. The sub-process a1 may include process nodes of task types, namely a material preparation task node, a configuration preparation task node, an application deployment task node, and a service registration task node.
The signal gateway node type is used for controlling the flow direction of a service (i.e. a target flow instance), for example, a signal gateway node can be introduced to control the flow direction of the target flow instance, and the signal gateway node is actually present in the arrangement file (i.e. the target flow instance) in a node form and can be displayed in a form of a manual task on a front-end page. The signal gateway node means that when the target flow instance is executed to the signal gateway node, the signal gateway node will enter a blocking state, and the execution of the signal gateway node will not start to be restarted until a success/failure signal arrives. Fig. 8 is a schematic diagram of a signal gateway node according to an embodiment of the present application, where, as shown in fig. 8, the signal gateway node is shown in a front-end page in a manual task manner. As shown in fig. 8, when the signal gateway node displays the front-end page, the execution progress of the currently deployed orchestration (i.e. the target flow instance) may be displayed, for example, 16/16 has been executed, (16 total flow nodes have been executed, i.e. all execution is completed). As shown in fig. 8, when the signal gateway node displays the front-end page, the current execution state of the signal gateway may also be displayed, for example, waiting for a signal that the manual triggering is successful or failed. Of course, the administrator may click on a "undeployment" button in the signal gateway node to trigger the failure signal.
As shown in fig. 9, fig. 9 is a schematic diagram of execution of a signal gateway node provided in the embodiment of the present application, as shown in fig. 9, when execution of all of sub-process a1 (including a material preparation task node, a configuration preparation task node, an application deployment task node, and a service registration task node), sub-process a2, sub-process a3, and sub-process a4 in sub-process a of a target process example by a computer device is completed, after reaching a signal network node 90a, the signal gateway node enters a blocking state, and the execution of the signal gateway node is not started until a success/failure signal arrives. As shown in fig. 9, the manager may click on the operation success button corresponding to the signal gateway node 90a to generate a success signal, thereby completing execution of the sub-flow a. As shown in fig. 9, when the manager does not know how to operate the signal gateway node 90a, the view index button corresponding to the signal gateway node may be clicked to view the execution operation on the signal gateway node 90 a.
Optionally, the flow node tree includes a root node corresponding to a first flow node reflecting an earliest execution order in the target flow instance, and a leaf node corresponding to a second flow node reflecting an execution order in the target flow instance that is later than the first flow node. The specific way for the computer device to traverse the nodes in the process node tree according to the first node type to obtain the target process node in the lost state in the target process instance may include: if the first node type is the signal gateway node type, traversing the flow node tree by taking a corresponding node of the flow node to be executed in the flow node tree as a traversing starting point to obtain a target flow node in a lost state in the target flow instance; the target flow node includes at least one of a first flow node and a second flow node. If the first node type is a non-signal gateway node type, traversing the flow node tree by taking the root node as a traversing starting point to obtain a target flow node in a lost state in the target flow instance.
Specifically, the computer device may obtain a first node type of the flow node to be executed, and determine, according to the first node type, a target traversal manner for traversing the flow node in the state database associated with the target flow instance, so that nodes needing to be traversed in the flow node tree may be reduced, thereby reducing traversal time and improving traversal efficiency. If the computer device determines that the first node type is the signal gateway node type, the node traversal of the flow node tree can be performed by taking a node corresponding to the flow node to be executed in the flow node tree as a traversal starting point, so as to obtain a target flow node in a lost state in the target flow instance. The flow node with the execution sequence later than the signal gateway node is in an inactive state (i.e. cannot be executed yet, and needs to wait until the execution of the instruction, and then starts executing), so that the execution in the inactive state is not needed, and therefore, the flow node can be not traversed. Therefore, when the flow node to be executed is a signal gateway node, the corresponding node of the flow node to be executed in the flow node tree is taken as a traversing starting point, and the flow node tree is traversed to obtain the target flow node in the lost state in the target flow instance. Wherein the target flow node may comprise at least one of a first flow node and a second flow node.
Specifically, if the flow node to be executed is a non-signal gateway node type, the root node in the flow node tree may be used as a traversal starting point to traverse the flow node tree, so as to obtain a target flow node in a lost state in the target flow instance. If the flow node to be executed is of a non-signal gateway type, if the flow node to be executed is of an event node type, an active node type, etc., the flow node to be executed can exist at any node position in the target flow instance. Therefore, in order to ensure that each flow node in the target flow instance can be traversed, a root node in the flow node tree can be used as a traversing starting point, nodes in the flow node tree can be traversed to obtain an execution state of each flow node in the target flow instance, and the flow node with the execution state being not completed is determined to be the target flow node in the lost state in the target flow instance.
Optionally, the specific way for the computer device to traverse the flow node tree to obtain the target flow node in the lost state in the target flow instance may include: if the first node type is the signal gateway node type and the node used for reflecting the flow node to be executed in the flow node tree is the root node of the flow node tree, the execution state of the flow node to be executed is obtained, and if the execution state of the flow node to be executed is not the execution completion state, the flow node of the node to be executed is determined to be the target flow node in the lost state in the target flow instance. If the first node type is the signal gateway node type and the node used for reflecting the to-be-executed flow node in the flow node tree is a leaf node of the flow node tree, traversing the flow node tree by taking the corresponding leaf node of the to-be-executed flow node as a traversing starting point in the direction of approaching to the root node of the flow node tree to obtain a third flow node with an execution state in an unexecuted state, and determining the third flow node as a target flow node in a lost state in the target flow example.
Specifically, if the computer device determines that the first node type is the signal gateway node type and the node in the flow node tree for reflecting the flow node to be executed is the root node in the flow node tree, that is, when the node in the flow node tree corresponding to the flow node to be executed is the root node, the execution state of the flow node to be executed may be obtained. If the computer equipment determines that the execution state of the flow node to be executed is not the execution completion state, the flow node to be executed can be determined to be the target flow node in the lost state in the target flow instance; if the computer equipment determines that the execution state of the flow node to be executed is the execution completion state, the flow node to be executed is not determined to be the target flow node in the lost state in the target flow instance. Alternatively, when the computer device determines that the execution state of the flow node to be executed is the non-execution completion state, the flow node to be executed may be determined as the candidate flow node. The computer device may obtain a node identifier of the candidate flow node, and determine, according to the node identifier, whether a candidate flow node (i.e., a flow node to be executed) exists in the node database. If the computer equipment determines that the candidate flow nodes do not exist in the node database, determining the candidate flow nodes as the target flow nodes in a lost state in the target flow instance; if the candidate flow nodes exist in the node database, the candidate flow nodes are not determined to be the target flow nodes in the lost state in the target flow instance. Therefore, the efficiency of traversing the flow nodes in the state database can be improved, and the accuracy and the comprehensiveness of traversing the flow nodes in the state database can be improved.
Specifically, if the computer device determines that the first node type is a signal gateway node type and a node in the flow node tree for reflecting the to-be-executed flow node is a leaf node (i.e., not a root node) of the flow node tree, the node in the flow node tree may be traversed by using the leaf node corresponding to the to-be-executed flow node as a traversing starting point in a direction close to the root node of the flow node tree, so as to obtain an execution state of the flow node between the leaf node corresponding to the to-be-executed flow node and the root node. And determining a third flow node in the non-execution completion state in the target flow instance according to the execution state of the flow node between the leaf node and the root node corresponding to the flow node to be executed. Further, the computer device may determine the third flow node as a lost state target flow node in the target flow instance. Alternatively, the computer device may obtain a node identifier of the third flow node, and determine whether the third flow node exists in the node database according to the node identifier of the third flow node. If the computer equipment determines that the third flow node does not exist in the node database, the third flow node is determined to be the target flow node in the lost state in the target flow instance; if the computer equipment determines that the third flow node exists in the node database, the third flow node is not determined to be the target flow node in the lost state in the target flow instance. Therefore, the efficiency of traversing the flow nodes in the state database can be improved, and the accuracy and the comprehensiveness of traversing the flow nodes in the state database can be improved.
Optionally, the specific way for the computer device to traverse the flow node tree to obtain the target flow node in the lost state in the target flow instance may include: if the first node type is a non-signal gateway node type, traversing all nodes in the flow node tree by taking the root node as a traversing starting point to obtain a fourth flow node with an execution state in an unexecuted state. And determining the fourth flow node as the target flow node in the lost state in the target flow instance.
Specifically, if the computer device determines that the first node type of the flow node to be executed is a non-signal gateway node type, in order to ensure that each flow node in the target flow instance can be traversed, a root node in the flow node tree can be used as a traversing starting point, all nodes in the flow node tree can be traversed, and a fourth flow node with an execution state in an unexecuted state is obtained. Further, the computer device may determine the fourth flow node with the execution state in the unexecuted state as the target flow node in the lost state in the target flow instance. Alternatively, the computer device may determine whether the fourth flow node exists in the node database according to the node identification of the fourth flow node. If the computer equipment determines that the fourth flow node does not exist in the node database, the fourth flow node is determined to be the target flow node in the lost state in the target flow instance; if the computer equipment determines that the fourth flow node exists in the node database, the fourth flow node is not determined to be the target flow node in the lost state in the target flow instance.
Specifically, each flow instance and each flow node may be regarded as a finite state machine that changes the execution state of the flow instance or the flow node through some occurrence events, and may define the execution state circulation rule of the flow instance or the flow node (i.e. how the execution state of the flow instance or the flow node is circulated (i.e. updated) when what event is triggered). For example, for a flow node or a flow instance in a waiting state, the flow node or the flow instance in the waiting state may be circulated to the stopped state by a stop event, or the flow node or the flow instance in the waiting state may be circulated to the successful state by a success event. For another example, for a flow node or flow instance in a stopped state, the flow node or flow instance in the stopped state may be circulated to the stopped state by a stop success event. The functions of retry, skip, pause, etc. of the flow node or the flow instance may be set according to specific requirements, and for some unnecessary nodes, there is also a function of omitting execution failure (i.e. may be omitted when the unnecessary nodes fail to execute), and the requirement of continuing to execute. The finite state machine of the flow instance and the finite state machine of the flow node are different, and the flow node has some special execution states, which are not existed in the finite state machine of the flow instance, such as Skip state, ignoring state, and the like of the node.
Fig. 10 is a schematic diagram of a finite state machine of a flow example provided in an embodiment of the present application, where, as shown in fig. 10, an initial execution state of the flow example may be a created state, and when a start event is triggered (manually triggered or triggered during operation), the computer device may perform a state flow on the created state of the flow example according to the start event, and update the execution state of the flow example to an in-operation state. When a success event is triggered, the computer device may perform state flow on the running state of the flow instance according to the success event, and update the execution state of the flow instance to a successful state. When a failure event is triggered, the computer device may perform state flow on the running state of the flow instance according to the failure event, and update the execution state of the flow instance to a failed state. When a stop event is triggered, the computer device may perform state flow on the running state of the flow instance according to the stop event, and update the execution state of the flow instance to the in-stop state. When the waiting event is triggered, the computer device may perform state circulation on the running state of the flow instance according to the waiting event, and update the execution state of the flow instance to the waiting state. When the execution state of the flow instance is the in-stop state, if the stop success event is triggered, the computer device may perform state circulation on the in-stop state of the flow instance according to the stop success event, and update the execution state of the flow instance to the in-stop state. When the execution state of the flow instance is the failed state, if the skip event is triggered, the computer device may perform state circulation according to the failed state of the flow instance by the skip event, and update the execution state of the flow instance to the running state. When the execution state of the flow instance is the failed state, if the retry event is triggered, the computer device may perform state circulation on the failed state of the flow instance according to the retry event, and update the execution state of the flow instance to the retry state. Further, the computer device may update the execution state of the flow instance to the in-flight state by circulating the in-flight state of the retry of the flow instance by the start event. When the execution state of the flow instance is the waiting state, if the operation event is triggered, the computer device may perform state circulation on the waiting state of the flow instance according to the operation event, and update the execution state of the flow instance to the running state. When the execution state of the flow instance is the waiting state, if the failure event is triggered, the computer device may perform state circulation on the waiting state of the flow instance according to the failure event, and update the execution state of the flow instance to the failed state. When the execution state of the flow instance is the waiting state, if the stop event is triggered, the computer device may perform state circulation on the waiting state of the flow instance according to the failure event, and update the execution state of the flow instance to the stopping state.
Fig. 11 is a schematic diagram of a finite state machine of a flow node according to an embodiment of the present application, where, as shown in fig. 11, an initial execution state of the flow node may be a created state, and when a start event is triggered (manually triggered or triggered in a running process), a computer device may perform a state flow on the created state of the flow node according to the start event, and update the execution state of the flow node to a running state. When a stop success event is triggered, the computer device may perform state flow on the created state of the flow node according to the stop success event, and update the execution state of the flow node to the stopped state. When the signal gateway waiting event is triggered, the computer device may perform state circulation on the created state of the flow node according to the signal gateway waiting event, and update the execution state of the flow node to the waiting state. When a success event is triggered, the computer device may perform state flow on the running state of the flow node according to the success event, and update the execution state of the flow node to a successful state. When a failure event is triggered, the computer device may perform state flow on the running state of the flow node according to the failure event, and update the execution state of the flow node to a failed state. When a stop event is triggered, the computer device may perform state flow on the running state of the flow node according to the stop event, and update the execution state of the flow node to the stop state. When the waiting event is triggered, the computer device may perform state flow on the running state of the flow node according to the waiting event, and update the running state of the flow node to the waiting state.
When the execution state of the flow node is in the stop state, if the stop success event is triggered, the computer device may perform state circulation on the stop state of the flow node according to the stop success event, and update the execution state of the flow node to the stop state. When the execution state of the flow node is the failed state, if the skip event is triggered, the computer device may perform state circulation on the failed state of the flow node according to the skip event, and update the execution state of the flow node to the skipped state. When the execution state of the flow node is the failed state, if the ignore event is triggered, the computer device may perform state circulation on the failed state of the flow node according to the ignore event, and update the execution state of the flow node to the ignored state. When the execution state of the flow node is the failed state, if the retry event is triggered, the computer device may perform state circulation on the failed state of the flow node according to the retry event, and update the execution state of the flow node to the retry state. Further, the computer device may update the execution state of the flow node to the running state by circulating the retry-in state of the flow node through a start event, and may update the retry-in state of the flow node to the stop-in state by circulating the execution state of the flow node through a stop event. When the execution state of the flow node is the waiting state, if the operation event is triggered, the computer device may perform state circulation on the waiting state of the flow node according to the operation event, and update the execution state of the flow node to the running state. When the execution state of the flow node is the waiting state, if the failure event is triggered, the computer device may perform state circulation on the waiting state of the flow node according to the failure event, and update the execution state of the flow node to the failed state. When the execution state of the flow node is the waiting state, if the stop event is triggered, the computer device may perform state circulation on the waiting state of the flow node according to the failure event, and update the execution state of the flow node to the stopping state. When the execution state of the flow node is the waiting state, if the stop success event is triggered, the computer device may perform state circulation on the waiting state of the flow node according to the stop success event, and update the execution state of the flow node to the stopped state.
S103, the attribute information of the target flow node is read from the state database, the application process is called, and the target flow node is executed according to the attribute information.
Specifically, after determining the target flow node in the lost state in the target flow instance, the computer device may read attribute information of the target flow node from the state database, where the attribute information may refer to a node identifier of the target flow node. The computer device may invoke the application process to execute the target flow instance according to the attribute information to cause the target flow node to reach an execution completion state.
Alternatively, in order to prevent the flow nodes in the target flow instance from being lost when the working state of the workflow engine is abnormal, the computer device may use the MQ database as the node database. The MQ database is provided with an ACK mechanism, so that the node database can keep the attribute information of the flow node to be executed after the application process of the workflow engine reads the attribute information of the flow node to be executed from the node database. Thus, when the workflow engine fails, the attribute information of the to-be-executed flow node can be continuously acquired from the node database, and the to-be-executed flow node is executed according to the attribute information.
Fig. 12 is a schematic diagram of a workflow engine executing a target flow instance according to an embodiment of the present application, where, as shown in fig. 12, an upper layer service may start a task of arranging the target flow instance to generate the target flow instance. The computer device may store instance information (e.g., execution state, attribute information) of the target flow instance and node information (e.g., execution state, attribute information) of each flow node in the target flow instance into the state database 120d via the workflow engine-oss (i.e., operating system) 120 a. Further, the computer device may add the flow node to be executed in the target flow instance to the message queue 120b in the node database. Further, the computer device may obtain, through a coroutine in the workflow engine 120c, a node identifier of a flow node to be executed from the message queue 120b in the node database, and according to the node identifier of the flow node to be executed, obtain execution information of the flow node to be executed from the state database 120 d. Further, the computer device may determine, by the node processor 120e in the workflow engine, a target processor for processing the flow node to be executed according to the first node type of the flow node to be executed. As shown in fig. 12, when the flow node to be executed is of a task node type, a preset target plugin (for example, plugin 1 … … plugin m) may be used as a target processor for processing the flow node to be executed, and processing logic of the plugin is executed. When the flow node to be executed is a sub-flow node, the sub-flow node processor is adopted as a target processor of the flow node to be executed, and processing logic in the sub-flow node processor is executed. When the flow node to be executed is a signal gateway node, the signal gateway node processor is used as a target processor of the flow node to be executed, and processing logic in the signal gateway processor is executed.
Further, as shown in fig. 12, in the process of executing the flow node to be executed, if a status update instruction for the flow node to be executed is received, the event processor 120f updates, according to the status update instruction, the execution status of the target flow instance or the flow node to be executed. Further, the computer device may update the execution state in the state database 120d according to the program to be executed or the target flow instance after the update of the execution state. Meanwhile, the computer device may determine whether the execution state of the target flow instance or the to-be-executed flow node is in the non-execution completion state, if the execution state of the target flow instance or the to-be-executed flow node is in the non-execution completion state, push the to-be-executed flow node to the message queue 120b of the node database, and if the execution state of the target flow instance or the to-be-executed flow node is in the execution completion state, not push the to-be-executed flow node to the message queue 120b of the node database.
In the embodiment of the application, the working state of the workflow engine is obtained in the process that the application process in the workflow engine executes the flow node to be executed in the target flow instance. Thus, the working state of the workflow engine can be detected, and whether the working state of the workflow engine is abnormal or not can be detected. If the working state of the workflow engine is an abnormal state, traversing the flow nodes in the state database associated with the target flow instance according to the flow nodes to be executed to obtain the target flow node in the lost state in the target flow instance. It can be seen that when the working state of the workflow engine is detected to be an abnormal state, the state database is traversed, and the target flow node in the lost state in the target flow instance is determined. And reading attribute information of the target flow node from the state database, calling an application process, and executing the target flow node according to the attribute information. According to the method and the device, when the workflow engine is abnormal, the lost target flow node in the target flow instance can be retrieved and executed, so that the situation that the target flow instance cannot be executed successfully due to the fact that the flow node is lost when the workflow engine is abnormal can be avoided, and the execution efficiency of the target flow instance can be improved.
As shown in fig. 13, a flow diagram of a flow node processing method is provided in an embodiment of the present application. The process node processing method may be performed by a computer device, which may be a server (e.g., the server 10 in fig. 1 described above), or a user terminal (e.g., any user terminal in the user terminal cluster in fig. 1 described above), which is not limited in this application. As shown in fig. 13, the process node processing method may include, but is not limited to, the following steps:
s201, acquiring the working state of the workflow engine in the process that the application process in the workflow engine executes the flow node to be executed in the target flow instance.
S202, if the working state of the workflow engine is an abnormal state, traversing the flow nodes of the state database associated with the target flow instance according to the flow nodes to be executed to obtain the target flow node in the lost state in the target flow instance.
Specifically, the specific content of steps S201 to S202 in the embodiment of the present application may be referred to the content of steps S101 to S102 in fig. 3, and the embodiment of the present application is not described herein again.
S203, the attribute information of the target flow node is read from the state database.
Specifically, after determining the target flow node in the lost state in the target flow instance, the computer device may read attribute information of the target flow node from the state database, where the attribute information may be a node identifier.
S204, adding the attribute information of the target flow node into a node database corresponding to the target flow instance.
Specifically, the computer device may add the attribute information of the target flow node to a node database corresponding to the target flow instance. The application process of the workflow engine needs to acquire the flow node to be executed from the node database, so that the attribute information of the target flow node needs to be added into the node database, and the application process in the workflow engine can execute the target flow node.
S205, calling an application process, reading the attribute information of the target flow node from the node database, and removing the attribute information of the target flow node from the node database.
Specifically, the computer device may invoke an application process in the workflow engine, and cyclically read the attribute information of the target flow node from the node database, so that in order to avoid repeated execution, the attribute information of the target flow node needs to be removed from the node database.
S206, according to the attribute information, acquiring the execution information of the target flow node from the state database, and executing the target flow node according to the execution information.
Specifically, the computer device may obtain, from the state database, execution information of the target flow node according to attribute information of the target flow node, and execute the target flow node according to the execution information, so that the target flow node reaches an execution completion state.
Optionally, the execution information includes node interface information of the target flow node and flow interface information of the target flow instance. The computer device obtains the execution information of the target process node from the state database according to the attribute information, and the specific mode of executing the target process node according to the execution information may include: and calling an application process, and acquiring node interface information of the target flow node and flow interface information of the target flow instance from the state database according to the attribute information. And acquiring a second node type corresponding to the target flow node, and selecting a target processor for executing the target flow node from the processors in the workflow engine according to the second node type. And calling a target processor, and executing the target process node according to the node interface information and the process interface information.
Specifically, the execution information includes node interface information of the target flow node and flow interface information of the target flow instance. The computer device may invoke an application process in the workflow engine, and obtain, from the state database, execution information of the target flow node according to attribute information of the target flow node, where the execution information may refer to node interface information of the target flow node and flow interface information of the target flow instance. The node interface information of the target flow node may refer to DAO (Data Access Object, i.e., a data access object), and is located between logic and persistence, so as to implement access to the persistent data. The related information of the target flow node is encapsulated by database operation, a corresponding interface is provided for the outside, and the related information of the target flow node can be obtained through the interface. DAOs may provide an interface to access operations required by a relational database system, separate data access from business logic, and provide an object-oriented data access interface to upper layers. Likewise, the instance interface information of the target flow instance may also be referred to as DAO. The computer device may invoke a node processor in the workflow engine to execute the target flow node based on the node interface information of the target flow node and the flow interface information of the target flow instance.
Optionally, the specific manner in which the computer device invokes the node processor in the workflow engine to execute the target flow node according to the node interface information and the flow interface information may include: and obtaining a second node type corresponding to the target flow node. And determining a target processor for executing the target flow node according to the second node type, calling the target processor, and executing the target flow node according to the node interface information and the flow interface information. And when the execution state change instruction aiming at the target flow node is received in the process of calling the target processor to execute the target flow node, updating the execution target flow node according to the execution state change instruction.
Specifically, the computer device may obtain a second node type corresponding to the target flow node, and determine, according to the second node type of the target flow node, a target processor for executing the target flow node. The second node type of the target flow node may refer to the content described in the first node type of the flow node to be executed in step S102 in fig. 3, which is not described in detail herein. The processing logic required to be processed by the flow nodes of different node types is different and needs to be executed by different processors, so that the computer equipment can call the target processor to execute the target flow node according to the node interface information of the target flow node and the flow interface information of the target flow instance. If the second node type of the target process node is the task node type, an HTTP plug-in or other plug-ins can be adopted to carry out logic processing on the target process node; if the second node type of the target flow node is a sub-flow node type, executing processor logic on the target flow node by adopting a sub-flow node processor; and if the second node type of the target flow node is the signal gateway node type, executing processor logic on the target flow node by adopting a signal gateway processor. Specifically, the computer device may invoke the target processor to obtain an execution state flow rule of the target flow node according to the node interface information of the target flow node, and obtain an execution state flow rule of the target flow instance according to the flow interface information of the target flow instance. Further, an execution state change instruction for the target flow node is generated according to the execution state flow rule of the target flow node and the execution state flow rule of the target flow instance.
Further, in the process that the computer equipment calls the target processor to execute the target flow node, when an execution state change instruction aiming at the target flow node is received, the execution target flow node is updated according to the execution state change instruction. It can be understood that when the computer device receives the execution state change instruction of the manager for the target flow node during the execution of the target flow node, the execution target flow node can be updated according to the state change instruction, or it can be understood that if the target flow node triggers the preset state change instruction during the execution, the computer device service can update the instruction target flow node according to the preset state change instruction. For example, the current execution state of the target flow node is an in-operation state, the execution state of the target flow instance to which the target flow node belongs is a stop-in state, and the execution state instruction for the target flow node is generated to update the execution state of the target flow node to the in-stop state according to the execution state flow rule of the target flow node and the execution state flow rule of the target flow instance. The computer device may update the in-flight state of the target flow node to the in-flight state based on the update execution state of the target flow node to the in-flight state instruction. For example, if the computer device updates the execution state of the target flow node to the stopped state by calling the target processor, but obtains that the administrator has performed the skip adjustment operation for the target flow node according to the node interface information of the target flow node, the computer device updates the execution state of the target flow node to the skipped state according to the skip adjustment operation.
Specifically, in the target processor of the workflow engine, a deployment level (e.g., 65 th deployment) corresponding to the target flow instance is obtained according to the execution state of the target flow instance, and under the deployment level of the target flow instance, a target event (e.g., a stop event or a skip event, etc.) to be happened is determined according to the execution state of the target flow node and the execution state of the target flow instance. Wherein the computer device may invoke an FSM (i.e., finite State Machine) event handler in the target processor to flow the execution state of the target flow node to the next state based on the impending target event of the target flow node. If the execution state of the target flow node is the running state, when the computer equipment determines that the target event to be happened of the target flow node is a failure event through the target processor, in the FSM event processor, the running state of the target flow node is circulated according to the failure event, and the running state of the target flow node is updated to be the failure state. After the target processor executes the node, if the execution state of the target flow node reaches the executed completion state, the attribute information of the target flow node does not need to be added into the node database. If the execution state of the target flow node is in the non-execution completion state, the attribute information of the target flow node needs to be added into the node database. If the execution state of the target flow node reaches the executed completion state, but the target flow instance to which the target flow node belongs is not executed, the attribute information of the next flow node which is not executed in the target flow node is required to be added into the node database. Optionally, when the execution state of the target flow node is in the unexecuted state, after waiting for x seconds, the attribute information of the target flow node is added to the node database. The application process in the workflow engine can call a target processing function in the target processor, the target processing function determines a flow processing function according to the execution state of the target flow instance, and the logic processing is carried out on the target flow instance according to the flow processing function. The flow processing function of the target flow instance determines a node processing function of the target flow node according to the execution state of the target flow node, and performs logic processing on the target flow node according to the node processing function.
Optionally, the computer device further updates the execution state of the target flow node according to the execution state change instruction, to obtain an updated execution state. And updating the execution state of the target flow node in the state database by adopting the updated execution state. And if the updated execution state is the unexecuted state, adding the attribute information of the target flow node into the node database.
Specifically, the computer device may update the execution state of the target flow node according to the execution state update instruction, to obtain an updated execution state. If the current execution state of the target flow node is the running state, the computer device may update the execution state of the target flow node according to the failure event after receiving the execution state update instruction as the failure event, and update the running state of the target flow node to the failed state (i.e., the updated execution state). Further, the computer device may update the execution state of the target flow node in the state database with the updated execution state, e.g., when the execution of the target flow node is updated to a failed state, the running state of the target flow node in the state database may be updated to a failed state. Further, the computer device may determine whether the updated execution state of the target flow node is a non-execution completion state, and if the updated execution state of the target flow node is the non-execution completion state, add the attribute information of the target flow node after the state update to the node database. If the updated execution state of the target flow node is the executed completion state, the attribute information of the target flow node after the state update is not added to the node database.
Fig. 14 is a schematic diagram of an obtaining target flow node according to an embodiment of the present application, where, as shown in fig. 14, when a flow node to be executed is a non-signal gateway node type, in a process that a computer device executes the flow node to be executed in a target flow instance through an application process in a workflow engine, when an upper layer service receives a stop instruction for the flow node to be executed, the computer device may determine that a working state of the workflow engine is an abnormal state, and call a stop interface 140b. The computer device may call a stop interface processing function of the stop interface 140b, add a new logic to the stop interface processing function, that is, obtain a flow node tree corresponding to the target flow instance, obtain, according to a root node in the flow node tree, a target flow node in a lost state in the target flow instance, and push the target flow node back to the node database 140d, that is, add attribute information of the target flow node to the node database 140 d. Further, the computer device may execute the original logic of the stop interface processing function, update the execution state of the to-be-processed execution node to a stop-in-process state, return a stop success message to the upper layer service, and update the execution state of the to-be-executed flow node at the state database 140 e. In this way, the computer device adds the attribute information of the target flow node in the lost state in the target flow instance to the node data 140d, acquires the attribute information of the target flow node from the node database through the coroutine in the workflow engine 140c, acquires the execution information of the target flow node in the state database 140e, and circulates the execution state of the target flow node according to the execution information. Thus, the problem that the target flow instance cannot be executed due to the loss of the flow nodes in the target flow instance can be avoided, and the execution efficiency of the target flow instance can be improved.
Fig. 15 is a schematic diagram of an obtaining target flow node according to an embodiment of the present application, where, as shown in fig. 15, when the flow node to be executed is a signal gateway node type, in a process that a computer device executes the flow node to be executed in a target flow instance through an application process in a workflow engine, when an upper layer service receives a signal gateway task reporting instruction for the flow node to be executed, the computer device may determine that a working state of the workflow engine is an abnormal state, and call a signal gateway reporting 150b. The computer device may call a gateway task reporting interface processing function of the signal gateway reporting 150b, add new logic to the gateway task reporting interface processing function, that is, obtain a flow node tree corresponding to the target flow instance, recursively obtain the target flow node in the lost state in the target flow instance according to the current node (that is, the flow node to be executed), and push the target flow node back to the node database 150d, that is, add attribute information of the target flow node to the node database 150 d. Further, the computer device may execute the gateway task, report the original logic of the interface processing function, store the execution result of the target flow instance in the state database 150e, and return an execution success message to the upper layer service 150 a. In this way, the computer device adds the attribute information of the target flow node in the lost state in the target flow instance to the node data 150d, acquires the attribute information of the target flow node from the node database through the coroutine in the workflow engine 150c, acquires the execution information of the target flow node in the state database 150e, and circulates the execution state of the target flow node according to the execution information, so that the situation that the target flow instance cannot be completed due to the loss of the flow node in the target flow instance can be avoided, and the execution efficiency of the target flow instance can be improved.
Fig. 16 is a schematic diagram of execution of a target flow node according to the embodiment of the present application, where, as shown in fig. 16, when a computer device detects that a working state of a workflow engine is an abnormal state, a target flow node in a lost state in a target flow instance is obtained, and attribute information of the target flow node is added to a node database, which may cause a duplicate flow node in the node database. As shown in fig. 16, although there is a duplicate target flow node in the node database, the target flow node is not affected to reach an execution state where execution is completed. As shown in fig. 16, if the flow node 1 exists in the node database 160a, the node state of the flow node 1 is a waiting state, and the flow state of the target flow instance to which the flow node 1 belongs is a waiting state. Since the computer device adds the attribute information of the target flow node to the node database, there is a duplicate flow node 1 in the node database 160b, i.e. there are two identical flow nodes 1 in the node database 160 b. Further, the computer device may read a flow node 1 from the node database 160b by the workflow engine 160c, and when detecting a state update instruction for a target flow instance, the workflow engine 160c performs a state flow on the target flow instance to which the flow node 1 belongs, and updates the waiting state of the target flow instance to which the flow node 1 belongs to a stop state. Further, the computer device may update the execution state of the flow node 1 to the in-flight state by updating the wait state of the flow node 1 through the workflow engine 160 d. When the computer device determines that the flow node 1 is in the non-execution completion state, the flow node 1 is added to the node database 160e, and at this time, there is a flow node 1 whose execution state is in the stop state and a flow node 1 whose execution state is in the wait state in the node database 160 e.
Further, the computer device may read another flow node 1 (i.e. the execution state is a waiting state) from the node database 160e through the workflow engine 160f, update the state of the flow node 1, and add the updated state to the node database 160g, where two flow nodes 1 in the node database 160g have the same execution state. The computer device reads a process node 1 from the node database 160g through the workflow engine 160h, performs a state update on the process node 1, and if the process node enters a stop state after the state update of the process node 1, the process node is not added to the node database, and updates the state of the target process instance to which the process node 1 belongs to the stop state. At this time, only one flow node 1 exists in the node database 160i, and the computer device reads one flow node 1 from the node database 160i through the workflow engine 160j, and directly skips and does not update when detecting that the execution state of the flow instance to which the flow node 1 belongs is a stop state. It can be seen that, even if there are multiple identical flow nodes in the node database, execution completion of the target flow node is not affected.
As shown in fig. 17, fig. 17 is a schematic diagram of execution of a target flow node provided in the embodiment of the present application, and as shown in fig. 17, when a computer device detects that a working state of a workflow engine is an abnormal state, a target flow node in a lost state in a target flow instance is obtained, and attribute information of the target flow node is added to a node database, which may cause a duplicate flow node in the node database. As shown in fig. 16, although there is a duplicate target flow node in the node database, the target flow node is not affected to reach an execution state where execution is completed. As shown in fig. 17, if the flow node 1 exists in the node database 170a, the node state of the flow node 1 is a waiting state, and the flow state of the target flow instance to which the flow node 1 belongs is a waiting state. Since the computer device adds the attribute information of the target flow node to the node database, there is a duplicate flow node 1 in the node database 170b, i.e. there are two identical flow nodes 1 in the node database 170 b. Further, the computer device may read one flow node 1 from the node database 170b through one application process in the workflow engine 170c and another flow node 1 from the node database 170b through another application process in the workflow engine 170 d. When the workflow engine 170c and the workflow engine 170d detect a state update instruction for a target flow instance, the workflow engine 170c and the workflow engine 170d respectively perform state flow on the target flow instance to which the flow node 1 belongs, and update the waiting state of the target flow instance to which the flow node 1 belongs to a stop state.
Further, the computer device may update the execution state of the flow node 1 through the workflow engine 170e and the workflow engine 170f, respectively, and update the waiting state of the flow node 1 to the in-stop state. When the computer device determines that the flow nodes 1 corresponding to the workflow engine 170e and the workflow engine 170f are in the unexecuted completed state, the flow nodes 1 corresponding to the workflow engine 170e and the workflow engine 170f are added to the node database 170g, and at this time, two flow nodes 1 in the same execution state exist in the node database 170 g. Further, the computer device may read another flow node 1 (i.e., the execution state is a waiting state) from the node database 170g through the workflow engine 170h, and perform a state update for the flow node 1. When the workflow engine 170i detects that the flow node enters a stopped state via a 1 state update, it is not added to the node database. Meanwhile, the computer device may read another flow node 1 from the node database 170g through the workflow engine 170j (i.e. the execution state is a waiting state), perform a state update on the flow node 1, and skip directly the update when the workflow engine 170k detects that the state update of the target flow instance to which the flow node 1 belongs is a stop state. It can be seen that, even if there are multiple identical flow nodes in the node database, execution completion of the target flow node is not affected.
In the embodiment of the application, the working state of the workflow engine is obtained in the process that the application process in the workflow engine executes the flow node to be executed in the target flow instance. Thus, the working state of the workflow engine can be detected, and whether the working state of the workflow engine is abnormal or not can be detected. If the working state of the workflow engine is an abnormal state, traversing the flow nodes in the state database associated with the target flow instance according to the flow nodes to be executed to obtain the target flow node in the lost state in the target flow instance. It can be seen that when the working state of the workflow engine is detected to be an abnormal state, the state database is traversed, and the target flow node in the lost state in the target flow instance is determined. And reading attribute information of the target flow node from the state database, calling an application process, and executing the target flow node according to the attribute information. According to the method and the device, when the workflow engine is abnormal, the lost target flow node in the target flow instance can be retrieved and executed, so that the situation that the target flow instance cannot be executed successfully due to the fact that the flow node is lost when the workflow engine is abnormal can be avoided, and the execution efficiency of the target flow instance can be improved.
Referring to fig. 18, fig. 18 is a schematic structural diagram of a processing device for processing flow nodes according to an embodiment of the present application. The above-mentioned flow node processing means may be a computer program (including program code) running in a computer device, for example, the flow node processing means is an application software; the flow node processing apparatus may be configured to execute corresponding steps in the flow node processing method provided in the embodiment of the present application. As shown in fig. 18, the flow node processing apparatus may include: an acquisition module 11, a traversal module 12 and an execution module 13.
The obtaining module 11 is configured to obtain a working state of the workflow engine in a process of executing the flow node to be executed in the target flow instance by an application process in the workflow engine;
the traversing module 12 is configured to traverse the flow nodes in the state database associated with the target flow instance according to the to-be-executed flow node if the working state of the workflow engine is an abnormal state, so as to obtain a target flow node in a lost state in the target flow instance;
and the execution module 13 is used for reading the attribute information of the target flow node from the state database, calling the application process and executing the target flow node according to the attribute information.
Wherein the traversal module 12 comprises:
a first obtaining unit 1201, configured to obtain, from a state database, an execution order of flow nodes in a target flow instance; the process nodes in the target process instance comprise process nodes to be executed;
a generating unit 1202, configured to generate a flow node tree corresponding to the target flow instance according to an execution order of the flow nodes in the target flow instance;
a second obtaining unit 1203, configured to obtain a first node type of the flow node to be executed;
and the traversing unit 1204 is configured to traverse the nodes in the flow node tree according to the first node type, so as to obtain the target flow node in the lost state in the target flow instance.
The flow node tree comprises a root node corresponding to a first flow node with the earliest execution sequence in the target flow instance and a leaf node corresponding to a second flow node with the execution sequence later than that of the first flow node in the target flow instance;
the traversing unit 1204 is specifically configured to:
if the first node type is the signal gateway node type, traversing the flow node tree by taking a corresponding node of the flow node to be executed in the flow node tree as a traversing starting point to obtain a target flow node in a lost state in the target flow instance; the target flow node comprises at least one of a first flow node and a second flow node;
If the first node type is a non-signal gateway node type, traversing the flow node tree by taking the root node as a traversing starting point to obtain a target flow node in a lost state in the target flow instance.
The traversal unit 1204 is specifically further configured to:
if the first node type is a signal gateway node type and the node used for reflecting the flow node to be executed in the flow node tree is a root node of the flow node tree, the execution state of the flow node to be executed is obtained, and if the execution state of the flow node to be executed is not the execution completion state, the flow node of the node to be executed is determined to be a target flow node in a lost state in the target flow instance;
if the first node type is the signal gateway node type and the node used for reflecting the to-be-executed flow node in the flow node tree is a leaf node of the flow node tree, traversing the flow node tree by taking the corresponding leaf node of the to-be-executed flow node as a traversing starting point in the direction of approaching to the root node of the flow node tree to obtain a third flow node with an execution state in an unexecuted state, and determining the third flow node as a target flow node in a lost state in the target flow example.
The traversal unit 1204 is specifically further configured to:
if the first node type is a non-signal gateway node type, traversing all nodes in the flow node tree by taking the root node as a traversing starting point to obtain a fourth flow node with an execution state in an unexecuted state;
and determining the fourth flow node as the target flow node in the lost state in the target flow instance.
Wherein the execution module 13 comprises:
a third obtaining unit 1301, configured to read attribute information of the target flow node from the state database;
an adding unit 1302, configured to add attribute information of a target flow node to a node database corresponding to the target flow instance;
the removing unit 1303 is configured to invoke an application process, read attribute information of a target flow node from the node database, and remove the attribute information of the target flow node from the node database;
and an execution unit 1304, configured to obtain, from the state database, execution information of the target flow node according to the attribute information, and execute the target flow node according to the execution information.
The execution information comprises node interface information of the target flow node and flow interface information of the target flow instance;
The execution unit 1304 is specifically configured to:
calling an application process, and acquiring node interface information of a target flow node and flow interface information of a target flow instance from a state database according to the attribute information;
acquiring a second node type corresponding to the target flow node;
selecting a target processor for executing the target flow node from the processors in the workflow engine according to the second node type;
and calling a target processor, and executing the target process node according to the node interface information and the process interface information.
The execution unit 1304 is further specifically configured to:
when an execution state change instruction aiming at a target flow node is received in the process of calling a target processor to execute the target flow node, updating the execution state of the target flow node according to the execution state change instruction to obtain an updated execution state;
updating the execution state of the target flow node in the state database by adopting the updated execution state;
and if the updated execution state is the unexecuted state, adding the attribute information of the target flow node into the node database.
Wherein the acquisition module 11 comprises:
a fourth obtaining unit 1101, configured to obtain system log data of a workflow engine during an application process in the workflow engine executing a flow node to be executed in a target flow instance;
A determining unit 1102, configured to determine an operating state of the workflow engine according to the system log data.
The determining unit 1102 is specifically configured to:
if the system log data indicate that the system of the first service equipment belonging to the node database of the workflow engine has restarting operation, determining that the working state of the workflow engine is an abnormal state;
if the system log data indicate that the system of the second service equipment corresponding to the application process has restarting operation, determining that the working state of the workflow engine is an abnormal state;
if the system log data indicates that the adjustment execution operation aiming at the flow node to be executed is received, determining that the working state of the workflow engine is an abnormal state;
and if the system log data indicates that the network of the first service equipment is abnormal, determining that the working state of the workflow engine is an abnormal state.
According to one embodiment of the present application, the steps involved in the flow node processing method shown in fig. 3 may be performed by respective modules in the flow node processing apparatus shown in fig. 18. For example, step S101 shown in fig. 3 may be performed by the acquisition module 11 in fig. 18, step S102 shown in fig. 3 may be performed by the traversal module 12 in fig. 18, and step S103 shown in fig. 3 may be performed by the execution module 13 in fig. 18.
According to an embodiment of the present application, each module in the flow node processing apparatus shown in fig. 18 may be separately or completely combined into one or several units to form a structure, or some (some) of the units may be further split into multiple sub-units with smaller functions, so that the same operation may be implemented, without affecting the implementation of the technical effects of the embodiments of the present application. The above modules are divided based on logic functions, and in practical applications, the functions of one module may be implemented by a plurality of units, or the functions of a plurality of modules may be implemented by one unit. In other embodiments of the present application, the test device may also include other units, and in practical applications, these functions may also be implemented with assistance from other units, and may be implemented by cooperation of multiple units.
In the embodiment of the application, the working state of the workflow engine is obtained in the process that the application process in the workflow engine executes the flow node to be executed in the target flow instance. Thus, the working state of the workflow engine can be detected, and whether the working state of the workflow engine is abnormal or not can be detected. If the working state of the workflow engine is an abnormal state, traversing the flow nodes in the state database associated with the target flow instance according to the flow nodes to be executed to obtain the target flow node in the lost state in the target flow instance. It can be seen that when the working state of the workflow engine is detected to be an abnormal state, the state database is traversed, and the target flow node in the lost state in the target flow instance is determined. And reading attribute information of the target flow node from the state database, calling an application process, and executing the target flow node according to the attribute information. According to the method and the device, when the workflow engine is abnormal, the lost target flow node in the target flow instance can be retrieved and executed, so that the situation that the target flow instance cannot be executed successfully due to the fact that the flow node is lost when the workflow engine is abnormal can be avoided, and the execution efficiency of the target flow instance can be improved.
Referring to fig. 19, fig. 19 is a schematic structural diagram of a computer device according to an embodiment of the present application. As shown in fig. 19, the above-mentioned computer device 1000 may include: processor 1001, network interface 1004, and memory 1005, and in addition, the above-described computer device 1000 may further include: a user interface 1003, and at least one communication bus 1002. Wherein the communication bus 1002 is used to enable connected communication between these components. The user interface 1003 may include a Display (Display), a Keyboard (Keyboard), and the optional user interface 1003 may further include a standard wired interface, a wireless interface, among others. The network interface 1004 may optionally include a standard wired interface, a wireless interface (e.g., WI-FI interface). The memory 1005 may be a high-speed RAM memory or a nonvolatile memory (non-volatile memory), such as at least one magnetic disk memory. The memory 1005 may also optionally be at least one storage device located remotely from the processor 1001. As shown in fig. 19, an operating system, a network communication module, a user interface module, and a device control application program may be included in a memory 1005, which is one type of computer-readable storage medium.
In the computer device 1000 shown in fig. 19, the network interface 1004 may provide network communication functions; while user interface 1003 is primarily an interface for providing input to a target user; and the processor 1001 may be used to invoke a device control application stored in the memory 1005 to implement:
acquiring the working state of the workflow engine in the process that an application process in the workflow engine executes a flow node to be executed in a target flow instance;
if the working state of the workflow engine is an abnormal state, traversing the flow nodes in the state database associated with the target flow instance according to the flow nodes to be executed to obtain the target flow nodes in the lost state in the target flow instance;
and reading attribute information of the target flow node from the state database, calling an application process, and executing the target flow node according to the attribute information.
It should be understood that the computer device 1000 described in the embodiments of the present application may perform the description of the processing method of the flow node in the embodiment corresponding to fig. 3 or fig. 13, and may also perform the description of the processing apparatus of the flow node in the embodiment corresponding to fig. 18, which is not repeated herein. In addition, the description of the beneficial effects of the same method is omitted.
Furthermore, it should be noted here that: the embodiment of the present application further provides a computer readable storage medium, where the computer readable storage medium stores a computer program executed by the foregoing flow node processing apparatus, where the computer program includes program instructions, when executed by a processor, can perform the description of the flow node processing method in the embodiment corresponding to fig. 3 and 13, and therefore, a description will not be repeated herein.
In addition, the description of the beneficial effects of the same method is omitted. For technical details not disclosed in the embodiments of the computer-readable storage medium according to the present application, please refer to the description of the method embodiments of the present application. As an example, program instructions may be deployed to be executed on one computing device or on multiple computing devices at one site or, alternatively, across multiple computing devices distributed across multiple sites and interconnected by a communication network, where the multiple computing devices distributed across multiple sites and interconnected by the communication network may constitute a blockchain system.
In addition, it should be noted that: embodiments of the present application also provide a computer program product or computer program that may include computer instructions that may be stored in a computer-readable storage medium. The processor of the computer device reads the computer instructions from the computer readable storage medium, and the processor may execute the computer instructions, so that the computer device performs the foregoing description of the processing method of the flow node in the embodiment corresponding to fig. 3 and fig. 13, and therefore, a detailed description will not be given here. In addition, the description of the beneficial effects of the same method is omitted. For technical details not disclosed in the computer program product or the computer program embodiments related to the present application, please refer to the description of the method embodiments of the present application.
It should be noted that, for simplicity of description, the foregoing method embodiments are all expressed as a series of action combinations, but it should be understood by those skilled in the art that the present application is not limited by the described order of action, as some steps may take other order or be performed simultaneously according to the present application. Further, those skilled in the art will also appreciate that the embodiments described in the specification are all preferred embodiments, and that the acts and modules referred to are not necessarily required in the present application.
The steps in the method of the embodiment of the application can be sequentially adjusted, combined and deleted according to actual needs.
The modules in the device of the embodiment of the application can be combined, divided and deleted according to actual needs.
Those of ordinary skill in the art will appreciate that implementing all or part of the processes in the methods of the embodiments described above,
those skilled in the art will appreciate that the processes implementing all or part of the methods of the above embodiments may be implemented by a computer program for instructing relevant hardware, and the program may be stored in a computer readable storage medium, and the program may include the processes of the embodiments of the methods as above when executed. The storage medium may be a magnetic disk, an optical disk, a Read-Only Memory (ROM), a random-access Memory (Random Access Memory, RAM), or the like.
The foregoing disclosure is illustrative of the present invention and is not to be construed as limiting the scope of the invention, which is defined by the appended claims.

Claims (14)

1. A method for processing a flow node, comprising:
acquiring the working state of a workflow engine in the process that an application process in the workflow engine executes a flow node to be executed in a target flow instance;
if the working state of the workflow engine is an abnormal state, traversing the flow nodes in the state database associated with the target flow instance according to the flow nodes to be executed to obtain the target flow nodes in the lost state in the target flow instance;
and reading attribute information of the target process node from the state database, calling the application process, and executing the target process node according to the attribute information.
2. The method according to claim 1, wherein traversing the process nodes in the state database associated with the target process instance according to the to-be-executed process node obtains a target process node in a lost state in the target process instance, including:
Acquiring the execution sequence of the flow nodes in the target flow instance from the state database; the flow nodes in the target flow instance comprise the flow nodes to be executed;
generating a flow node tree corresponding to the target flow instance according to the execution sequence of the flow nodes in the target flow instance;
acquiring a first node type of the flow node to be executed;
traversing the nodes in the flow node tree according to the first node type to obtain the target flow node in the lost state in the target flow instance.
3. The method of claim 2, wherein the flow node tree includes a root node corresponding to a first flow node reflecting an earliest execution order in the target flow instance, and a leaf node corresponding to a second flow node reflecting an execution order in the target flow instance that is later than the first flow node;
traversing the nodes in the process node tree according to the first node type to obtain the target process node in the lost state in the target process instance, including:
if the first node type is a signal gateway node type, traversing the flow node tree by taking a corresponding node of the flow node to be executed in the flow node tree as a traversing starting point to obtain a target flow node in a lost state in the target flow instance; the target flow node comprises at least one of the first flow node and the second flow node;
And if the first node type is a non-signal gateway node type, traversing the flow node tree by taking the root node as a traversing starting point to obtain a target flow node in a lost state in the target flow instance.
4. The method of claim 3, wherein if the first node type is a signal gateway node type, traversing the flow node tree with a corresponding node of the flow node to be executed in the flow node tree as a traversing start point to obtain a target flow node in a lost state in the target flow instance, including:
if the first node type is a signal gateway node type and a node in the flow node tree for reflecting the to-be-executed flow node is a root node of the flow node tree, acquiring an execution state of the to-be-executed flow node, and if the execution state of the to-be-executed flow node is a non-execution completion state, determining the to-be-executed flow node as a target flow node in a lost state in a target flow instance;
if the first node type is a signal gateway node type and the node in the flow node tree for reflecting the to-be-executed flow node is a leaf node of the flow node tree, traversing the flow node tree with the corresponding leaf node of the to-be-executed flow node as a traversing starting point in a direction close to a root node of the flow node tree to obtain a third flow node with an execution state in a non-execution completion state, and determining the third flow node as a target flow node in a lost state in the target flow example.
5. The method of claim 3, wherein if the first node type is a non-signal gateway node type, traversing the flow node tree with the root node as a traversing start point to obtain a target flow node in a lost state in the target flow instance, comprising:
if the first node type is a non-signal gateway node type, traversing all nodes in the flow node tree by taking the root node as a traversing starting point to obtain a fourth flow node with an execution state in an unexecuted state;
and determining the fourth flow node as the target flow node in the lost state in the target flow instance.
6. The method of claim 1, wherein the reading the attribute information of the target flow node from the state database, invoking the application process, and executing the target flow instance according to the attribute information, comprises:
reading attribute information of the target flow node from the state database;
adding the attribute information of the target flow node into a node database corresponding to the target flow instance;
Invoking the application process, reading the attribute information of the target flow node from the node database, and removing the attribute information of the target flow node from the node database;
and acquiring the execution information of the target flow node from the state database according to the attribute information, and executing the target flow node according to the execution information.
7. The method of claim 6, wherein the execution information includes node interface information of the target flow node and flow interface information of the target flow instance;
the step of obtaining the execution information of the target process node from the state database according to the attribute information, and executing the target process node according to the execution information comprises the following steps:
invoking the application process, and acquiring node interface information of the target process node and process interface information of the target process instance from the state database according to the attribute information;
acquiring a second node type corresponding to the target flow node;
selecting a target processor for executing the target flow node from processors in the workflow engine according to the second node type;
And calling the target processor, and executing the target process node according to the node interface information and the process interface information.
8. The method of claim 7, wherein the method further comprises:
when an execution state change instruction aiming at the target flow node is received in the process of calling the target processor to execute the target flow node, updating the execution state of the target flow node according to the execution state change instruction to obtain an updated execution state;
updating the execution state of the target flow node in the state database by adopting the updated execution state;
and if the updated execution state is the unexecuted state, adding the attribute information of the target flow node into the node database.
9. The method according to claim 1, wherein the step of obtaining the working state of the workflow engine during the execution of the to-be-executed flow node in the target flow instance by the application process in the workflow engine includes:
acquiring system log data of the workflow engine in the process of executing the flow node to be executed in the target flow instance by the application process in the workflow engine;
And determining the working state of the workflow engine according to the system log data.
10. The method of claim 9, wherein said determining an operational state of the workflow engine from the system log data comprises:
if the system log data indicate that the system of the first service equipment belonging to the node database of the workflow engine has restarting operation, determining that the working state of the workflow engine is an abnormal state;
if the system log data indicate that the system of the second service equipment corresponding to the application process has restarting operation, determining that the working state of the workflow engine is an abnormal state;
if the system log data indicates that the adjustment execution operation aiming at the flow node to be executed is received, determining that the working state of the workflow engine is an abnormal state;
and if the system log data indicates that the network of the first service equipment is abnormal, determining that the working state of the workflow engine is an abnormal state.
11. A flow node processing apparatus, comprising:
the system comprises an acquisition module, a target flow instance and a target flow instance, wherein the acquisition module is used for acquiring the working state of a workflow engine in the process of executing the flow node to be executed in the target flow instance by an application process in the workflow engine;
The traversing module is used for traversing the flow nodes in the state database associated with the target flow instance according to the flow nodes to be executed if the working state of the workflow engine is an abnormal state, so as to obtain the target flow nodes in the lost state in the target flow instance;
and the execution module is used for reading the attribute information of the target flow node from the state database, calling the application process and executing the target flow node according to the attribute information.
12. A computer device, comprising: a processor and a memory;
the processor is connected to a memory, wherein the memory is configured to store a computer program, and the processor is configured to invoke the computer program to cause the computer device to perform the method of any of claims 1-10.
13. A computer readable storage medium, characterized in that the computer readable storage medium has stored therein a computer program adapted to be loaded and executed by a processor to cause a computer device having the processor to perform the method of any of claims 1-10.
14. A computer program product or computer program, characterized in that it comprises computer instructions stored in a computer-readable storage medium, which are adapted to be read and executed by a processor to cause a computer device with the processor to perform the method of any of claims 1-10.
CN202210010133.1A 2022-01-05 2022-01-05 Process node processing method, device, storage medium and equipment Pending CN116414597A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210010133.1A CN116414597A (en) 2022-01-05 2022-01-05 Process node processing method, device, storage medium and equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210010133.1A CN116414597A (en) 2022-01-05 2022-01-05 Process node processing method, device, storage medium and equipment

Publications (1)

Publication Number Publication Date
CN116414597A true CN116414597A (en) 2023-07-11

Family

ID=87050277

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210010133.1A Pending CN116414597A (en) 2022-01-05 2022-01-05 Process node processing method, device, storage medium and equipment

Country Status (1)

Country Link
CN (1) CN116414597A (en)

Similar Documents

Publication Publication Date Title
CN109120678B (en) Method and apparatus for service hosting of distributed storage system
US8762929B2 (en) System and method for exclusion of inconsistent objects from lifecycle management processes
CN107729139B (en) Method and device for concurrently acquiring resources
US10642647B2 (en) Concurrent queueing and control command feedback loop in unified automation platforms
CN112035228A (en) Resource scheduling method and device
CN113569987A (en) Model training method and device
CN110825535A (en) Job scheduling method and system
CN110895488B (en) Task scheduling method and device
US8326913B2 (en) Method and system for service contract discovery
CN111090423A (en) Webhook framework system and method for realizing active calling and event triggering
CN110673933A (en) ZooKeeper-based distributed asynchronous queue implementation method, device, equipment and medium
CN115964153A (en) Asynchronous task processing method, device, equipment and storage medium
CN110737510B (en) Block device management system
CN113778486A (en) Containerization processing method, device, medium and equipment for code pipeline
CN115329170A (en) Webpage crawling method, device, equipment and storage medium
CN117076096A (en) Task flow execution method and device, computer readable medium and electronic equipment
CN112445860B (en) Method and device for processing distributed transaction
CN113645260A (en) Service retry method, device, storage medium and electronic equipment
US10728323B2 (en) Method and apparatus for operating infrastructure layer in cloud computing architecture
CN115373886A (en) Service group container shutdown method, device, computer equipment and storage medium
CN116414597A (en) Process node processing method, device, storage medium and equipment
CN115309558A (en) Resource scheduling management system, method, computer equipment and storage medium
CN115437766A (en) Task processing method and device
US20210149709A1 (en) Method and apparatus for processing transaction
CN114610413A (en) Method, device, equipment and storage medium for executing synchronous and asynchronous tasks based on Java

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
REG Reference to a national code

Ref country code: HK

Ref legal event code: DE

Ref document number: 40089861

Country of ref document: HK