Workflow expansion method, device, server and storage medium

By automatically generating and executing branch workflow instances in the workflow, the problem of reconfiguring and execution from scratch after the workflow instance is solved in the prior art is solved, and the execution efficiency of workflow instances is improved.

CN115249124BActive Publication Date: 2025-05-23PING AN TECH (SHENZHEN) CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210871028.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-07-22
Publication Date
2025-05-23
Estimated Expiration
2042-07-22

AI Technical Summary

Technical Problem

The prior art needs to reconfigure the entire workflow after the workflow instance is executed and execute from scratch, resulting in high time and labor costs and low execution efficiency.

Method used

By obtaining the identification of the workflow to be expanded, the branch flow chart and the identification of the target node, the branch workflow is automatically generated and its identification is added to the workflow extension table of the target node. When the workflow instance flows to the target node and passes, a branch workflow instance is generated and executed based on the extension table.

Benefits of technology

Execute branch workflow instances directly without re-executing previous workflow instances, improving the execution efficiency of workflow instances and reducing the need for developers to re-write workflows and the waste of time to execute from scratch.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115249124B_ABST
    Figure CN115249124B_ABST
Patent Text Reader

Abstract

The present application relates to the field of computers, and provides a workflow extension method, device, server and storage medium, the method comprising: obtaining a workflow extension request; generating a corresponding branch workflow according to a branch flowchart; adding a branch workflow identifier of the branch workflow to a workflow extension table of a target node to update the workflow extension table; when the in-transit workflow instance corresponding to the workflow to be extended flows to the target node, and the output result of the target node is passed, generating a branch workflow instance according to the branch workflow corresponding to the branch workflow identifier in the workflow extension table, and executing the branch workflow instance. The method improves the execution efficiency of the workflow instance. The present application also relates to the field of blockchain, and the above-mentioned storage medium can store data created according to the use of blockchain nodes.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a workflow expansion method, device, server and storage medium. Background Art

[0002] A workflow is a computing model that uses computers of multiple participants to transfer documents, information or tasks between participants according to preset process rules, and is used to automate work operations. A workflow instance is a task that runs according to the workflow. Currently, when a workflow instance starts executing, if the workflow needs to be changed, the developer needs to reconfigure the entire workflow. After the workflow is reconfigured, the instances that were previously executed according to the original workflow need to be executed from the beginning according to the reconfigured workflow. Some workflows involve hundreds or thousands of nodes, and the time and labor costs required to redraw the entire workflow are high. In addition, the circulation cycle of some workflows is very long, and executing the instance from the beginning causes unnecessary waste of time, and the execution efficiency of the workflow instance is low. Summary of the invention

[0003] The embodiments of the present application provide a workflow extension method, apparatus, device and storage medium, aiming to improve the execution efficiency of workflow instances.

[0004] In a first aspect, an embodiment of the present application provides a workflow extension method, including:

[0005] Obtaining a workflow extension request, the workflow extension request including a first identifier of the workflow to be extended, a second identifier of a target node, and a branch flowchart of the workflow, wherein the target node is a workflow node in the workflow to be extended for splicing a branch workflow corresponding to the branch flowchart;

[0006] According to the branch flowchart, a corresponding branch workflow is generated;

[0007] Adding the branch workflow identifier of the branch workflow to the workflow extension table of the target node to update the workflow extension table;

[0008] When the in-transit workflow instance corresponding to the workflow to be extended flows to the target node and the output result of the target node is passed, a branch workflow instance is generated according to the branch workflow corresponding to the branch workflow identifier in the workflow extension table, and the branch workflow instance is executed.

[0009] In a second aspect, an embodiment of the present application further provides a workflow extension device, the workflow extension device comprising:

[0010] An acquisition module, used to acquire a workflow extension request, wherein the workflow extension request includes a first identifier of the workflow to be extended, a second identifier of a target node, and a branch flowchart of the workflow, wherein the target node is a workflow node in the workflow to be extended for splicing a branch workflow corresponding to the branch flowchart;

[0011] A workflow generation module, used to generate corresponding branch workflows according to the branch flowchart;

[0012] An updating module, configured to add the branch workflow identifier of the branch workflow to the workflow extension table of the target node to update the workflow extension table;

[0013] The instance generation module is used to generate a corresponding branch workflow instance according to the branch workflow identifier corresponding to the branch workflow in the workflow extension table, and execute the branch workflow instance when the in-transit workflow instance corresponding to the workflow to be extended flows to the target node and the output result of the target node is passed.

[0014] In a third aspect, an embodiment of the present application further provides a server, comprising a processor, a memory, and a computer program stored in the memory and executable by the processor, wherein when the computer program is executed by the processor, the workflow extension method as described above is implemented.

[0015] In a fourth aspect, an embodiment of the present application further provides a storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the workflow extension method as described above is implemented.

[0016] The embodiments of the present application provide a workflow extension method, device, server and storage medium. The workflow extension method can automatically generate a branch workflow based on the branch flowchart by obtaining a first identifier of the workflow to be extended, a branch flowchart of the workflow and a second identifier of the target node. The branch workflow is a branch of the workflow to be extended, and the branch workflow identifier of the branch workflow is added to the workflow extension table of the target node. In this way, when the currently executed workflow instance flows to the target node and the output result of the workflow instance executed by the target node is passed, a branch workflow instance can be generated according to the branch workflow corresponding to the branch workflow identifier in the workflow extension table, and the branch workflow instance is executed. In this way, there is no need to re-execute the previous workflow instance, but to execute the branch workflow instance. There is no need for developers to rewrite the entire workflow, nor is there a need to execute the workflow instance from scratch, thereby greatly improving the execution efficiency of the workflow instance. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0018] Figure 1 It is a flowchart of a workflow expansion method provided in an embodiment of the present application;

[0019] Figure 2 is a schematic diagram of a flowchart of a workflow to be extended in an embodiment of the present application;

[0020] Figure 3 It is a schematic diagram of a flow chart of a branch workflow in an embodiment of the present application;

[0021] Figure 4 It is a schematic diagram of a node flow record of an in-transit workflow instance in an embodiment of the present application;

[0022] Figure 5 It is a schematic diagram of the node flow record of the branch workflow instance in the embodiment of the present application;

[0023] Figure 6 It is a schematic diagram of the node flow record in the embodiment of the present application;

[0024] Figure 7 It is a flowchart of another workflow expansion method provided in an embodiment of the present application;

[0025] Figure 8 is a schematic block diagram of a workflow expansion device provided in an embodiment of the present application;

[0026] Fig. 9 It is a schematic block diagram of the structure of a server provided in an embodiment of the present application.

[0027] The realization of the purpose, functional features and advantages of this application will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION

[0028] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0029] The flowcharts shown in the accompanying drawings are only examples and do not necessarily include all the contents and operations / steps, nor must they be executed in the order described. For example, some operations / steps may also be decomposed, combined or partially merged, so the actual execution order may change according to actual conditions.

[0030] A workflow is a computing model that uses computers of multiple participants to transfer documents, information or tasks between participants according to preset process rules, and is used to automate work operations. A workflow instance is a task that runs according to the workflow. Currently, when a workflow instance starts executing, if the workflow needs to be changed, the developer needs to reconfigure the entire workflow. After the workflow is reconfigured, the instances that were previously executed according to the original workflow need to be executed from the beginning according to the reconfigured workflow. Some workflows involve hundreds or thousands of nodes, and the time and labor costs required to redraw the entire workflow are high. In addition, the circulation cycle of some workflows is very long, and executing the instance from the beginning causes unnecessary waste of time, and the execution efficiency of the workflow instance is low.

[0031] To solve the above problems, an embodiment of the present application provides a workflow extension method, device, server and storage medium. The workflow extension method can automatically generate a branch workflow based on the branch flowchart by obtaining a first identifier of the workflow to be extended, a branch flowchart of the workflow and a second identifier of the target node. The branch workflow is a branch of the workflow to be extended, and the branch workflow identifier of the branch workflow is added to the workflow extension table of the target node. In this way, when the currently executed workflow instance flows to the target node and the output result of the workflow instance executed by the target node is passed, a branch workflow instance can be generated according to the branch workflow corresponding to the branch workflow identifier in the workflow extension table, and the branch workflow instance is executed. In this way, there is no need to re-execute the previous workflow instance, but to execute the branch workflow instance. There is no need for developers to rewrite the entire workflow, nor is there any need to execute the workflow instance from scratch, thereby greatly improving the execution efficiency of the workflow instance.

[0032] Among them, the workflow extension method can be applied to a server, which can be an independent server or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (Content Delivery Network, CDN), as well as big data and artificial intelligence platforms.

[0033] In conjunction with the accompanying drawings, some embodiments of the present application are described in detail below. In the absence of conflict, the following embodiments and features in the embodiments can be combined with each other.

[0034] See also Figure 1 , Figure 1 The flowchart of a workflow extension method provided by an embodiment of the present application is shown in FIG. The workflow extension method applies a server to improve the execution efficiency of a workflow instance.

[0035] like Figure 1 As shown, the workflow extension method includes steps S101 to S104.

[0036] Step S101: Obtain a workflow extension request.

[0037] The workflow extension request includes a first identifier of the workflow to be extended, a second identifier of the target node, and a branch flowchart of the workflow, wherein the target node is a workflow node in the workflow used to splice the branch workflow corresponding to the branch flowchart. The branch flowchart is a flowchart corresponding to a workflow as a branch of the workflow, the identifier of the workflow is used to uniquely represent the workflow, and the identifier of the workflow node is used to uniquely represent the workflow node.

[0038] In one embodiment, a terminal device displays a workflow extension page; obtains a workflow to be extended selected by a user on the workflow extension page, and displays a flowchart of the workflow to be extended on the workflow extension page; obtains a target node selected by a user in the flowchart of the workflow to be extended, and obtains a branch flowchart of the workflow to be extended drawn by the user on the workflow extension page; in response to a user triggering an operation of a start extension control on the workflow extension page, obtains a first identifier of the workflow to be extended, a second identifier of the target node, and a branch flowchart, and generates a workflow extension request based on the first identifier of the workflow to be extended, the second identifier of the target node, and the branch flowchart, and sends the workflow extension request to a server.

[0039] For example, Figure 2 As shown, the flowchart 10 of the workflow to be expanded includes an application submission node 11, a first-level approval node 12, a second-level approval node 13, and a headquarters approval node 14. Figure 3 As shown, the branch flow chart 20 of the workflow to be extended includes a third-level approval node 21 and a headquarters approval node 22 . At this time, it can be known that the target node is the second-level approval node 13 .

[0040] It is understandable that the workflow to be expanded can be a main workflow or a branch workflow, and this application does not specifically limit this. Figure 2 The main workflow corresponding to flowchart 10 in FIG. 1 can also be Figure 3 The branch workflow corresponding to flowchart 20 in FIG.

[0041] Step S102: Generate a corresponding branch workflow according to the branch flowchart.

[0042] Exemplarily, the branch flowchart is parsed to obtain the name, type, position, flow relationship and executed workflow function of each process node in the branch flowchart; and the corresponding branch workflow is generated according to the name, type, position, flow relationship and executed workflow function of each process node in the branch flowchart. The types of process nodes may include task nodes, judgment nodes, branch nodes, etc., and the workflow function of the process node is related to the process rules of the process node.

[0043] Step S103: Add the branch workflow identifier of the branch workflow to the workflow extension table of the target node to update the workflow extension table.

[0044] The workflow extension table is used to store branch workflow identifiers, and the stored branch workflow identifiers can be multiple, and the stored branch workflow identifiers correspond to the identifier of the target node and the identifier of the workflow where the target node is located, and the target node can be multiple or one. It is understandable that the user can add, delete, and modify the branch workflow identifiers in the workflow extension table.

[0045] For example, Figure 3 The secondary approval node 13 in is the target node, and the workflow extension table of the secondary approval node 13 includes the branch workflow identifier A, and the branch workflow identifier of the branch workflow generated based on the branch flowchart is the branch workflow identifier B, then the workflow extension table of the secondary approval node 13 is updated, and the updated workflow extension table includes the branch workflow identifier A and the branch workflow identifier B.

[0046] Step S104: when the in-transit workflow instance corresponding to the workflow to be extended flows to the target node and the output result of the target node is passed, a branch workflow instance is generated according to the branch workflow corresponding to the branch workflow identifier in the workflow extension table, and the branch workflow instance is executed.

[0047] The in-transit workflow instance corresponding to the workflow to be extended refers to the workflow instance that has been executed according to the workflow to be extended. For example, the in-transit workflow instance corresponding to the workflow to be extended includes workflow instance A and workflow instance B, and workflow instance A has been transferred to Figure 3 The first-level approval node 12 in the workflow instance B has already flowed to Figure 3 Secondary approval node 13 in.

[0048] Since workflow instance B has flowed to Figure 3In the second-level approval node 13, and the workflow extension table of the second-level approval node 13 includes the branch workflow identifier of the branch workflow corresponding to the flowchart 20, when the output result of the second-level approval node 13 for the workflow instance B is passed, the branch workflow instance B can be generated based on the branch workflow corresponding to the flowchart 20. 1 , and branch workflow instance B 1 The flow goes to the third-level approval node 21. In this way, the workflow instance B does not need to be executed from the beginning.

[0049] Since workflow instance A flows to Figure 3 Therefore, when the approval result of the first-level approval node 12 for workflow instance A is passed, workflow instance A flows to Figure 3 In the secondary approval node 13, if the output result of the secondary approval node 13 for the workflow instance A is passed, a branch workflow instance A can be generated based on the branch workflow corresponding to the flowchart 20. 1 , and branch workflow instance A 1 The flow goes to the third-level approval node 21. In this way, the workflow instance A does not need to be executed from the beginning.

[0050] In one embodiment, when there are multiple branch workflow identifiers obtained, a thread pool is created, and the number of concurrent threads in the thread pool is greater than or equal to the number of the branch workflow identifiers; multiple branch workflow identifiers are assigned to multiple threads in the thread pool, and the threads assigned the branch workflow identifiers are determined as target threads, and one target thread corresponds to one branch workflow identifier; each target thread is called to generate a branch workflow instance based on the branch workflow corresponding to the branch workflow identifier assigned to each target thread. By calling multiple threads in parallel, branch workflow instances can be generated based on the branch workflows corresponding to the branch workflow identifiers assigned to each target thread, thereby improving the efficiency of generating workflow instances.

[0051] In one embodiment, a node flow record of an in-transit workflow instance and a node flow record of a branch workflow instance are obtained; the node flow record of the in-transit workflow instance and the node flow record of the branch workflow instance are spliced ​​to obtain a target node flow record. By splicing the node flow record of the in-transit workflow instance with the node flow record of the branch workflow instance, a complete node flow record can be obtained.

[0052] Exemplarily, the server obtains the node flow record of the in-transit workflow instance and the node flow record of the branch workflow instance at a preset interval, and splices the node flow record of the in-transit workflow instance with the node flow record of the branch workflow instance to obtain the target node flow record. The preset time can be set according to actual conditions, and the embodiment of the present invention does not specifically limit this.

[0053] Exemplarily, when the server obtains the flow record query request of the branch workflow sent by the terminal device, it obtains the node flow record of the in-transit workflow instance and the node flow record of the branch workflow instance, and splices the node flow record of the in-transit workflow instance with the node flow record of the branch workflow instance to obtain the target node flow record, and sends the target node flow record to the terminal device. Among them, the flow record query request can include the identification information of the branch workflow instance, and the node flow record of the in-transit workflow instance and the node flow record of the branch workflow instance can be queried through the identification information of the branch workflow instance.

[0054] For example, Figure 4 As shown, the node flow record of an in-transit workflow instance is: the output result of the application submission node 31 for the in-transit workflow instance is pass, the in-transit workflow instance flows to the first-level approval node 32, the output result of the first-level approval node 32 for the in-transit workflow instance is pass, the in-transit workflow instance flows to the second-level approval node 33, the output result of the second-level approval node 33 for the in-transit workflow instance is rejection, the in-transit workflow instance flows back to the first-level approval node 32, the output result of the first-level approval node 32 for the in-transit workflow instance is pass, the in-transit workflow instance continues to flow to the second-level approval node 33, and the output result of the second-level approval node 33 for the in-transit workflow instance is pass.

[0055] For example, Figure 5 As shown, the node flow record of the branch workflow instance is: the output result of the third-level approval node 41 for the branch workflow instance is pass, and the branch workflow instance flows to the headquarters approval node 42, and the output result of the headquarters approval node 42 for the branch workflow instance is reject, then the branch workflow instance flows back to the third-level approval node 41, and the output result of the third-level approval node 41 for the branch workflow instance is pass, and the branch workflow instance flows to the headquarters approval node 42, and the output result of the headquarters approval node 42 for the branch workflow instance is pass, and the execution of the branch workflow instance ends. Figure 4 and Figure 5 By splicing the node flow records represented by Figure 6 The target node flow record is shown.

[0056] The workflow extension method provided in the above embodiment can automatically generate a branch workflow based on the branch flowchart by obtaining the first identifier of the workflow to be extended, the branch flowchart of the workflow and the second identifier of the target node, and the branch workflow is a branch of the workflow to be extended, and the branch workflow identifier of the branch workflow is added to the workflow extension table of the target node. In this way, when the currently executed workflow instance flows to the target node and the output result of the workflow instance executed by the target node is passed, a branch workflow instance can be generated according to the branch workflow corresponding to the branch workflow identifier in the workflow extension table, and the branch workflow instance can be executed. In this way, there is no need to re-execute the previous workflow instance, but to execute the branch workflow instance. There is no need for developers to rewrite the entire workflow, nor is there any need to execute the workflow instance from scratch, thereby greatly improving the execution efficiency of the workflow instance.

[0057] See also Figure 7 , Figure 7 It is a flowchart of another workflow extension method provided in an embodiment of the present application.

[0058] like Figure 7 As shown, the workflow extension method includes steps S201 to S207.

[0059] Step S201: Obtain a workflow extension request.

[0060] The workflow extension request includes a first identifier of the workflow to be extended, a second identifier of the target node, and a branch flowchart of the workflow, wherein the target node is a workflow node in the workflow used to splice the branch workflow corresponding to the branch flowchart. The branch flowchart is a flowchart corresponding to a workflow as a branch of the workflow, the identifier of the workflow is used to uniquely represent the workflow, and the identifier of the workflow node is used to uniquely represent the workflow node.

[0061] Step S202: Generate a corresponding branch workflow according to the branch flowchart.

[0062] Exemplarily, the branch flowchart is parsed to obtain the name, type, position, flow relationship and executed workflow function of each process node in the branch flowchart; and the corresponding branch workflow is generated according to the name, type, position, flow relationship and executed workflow function of each process node in the branch flowchart.

[0063] Step S203: Determine whether the target node is configured with a workflow extension table according to the second identifier.

[0064] Exemplarily, the current value of the preset identification bit in the second identification is obtained; when the current value of the preset identification bit in the second identification is the first preset value, it is determined that the target node is configured with a workflow extension table; when the current value of the preset identification bit in the second identification is the second preset value, it is determined that the target node is not configured with a workflow extension table. Among them, the preset identification bit, the first preset value, and the second preset value can be set based on actual conditions, and the embodiments of the present application do not specifically limit this.

[0065] Step S204: When the target node is configured with a workflow extension table, the branch workflow identifier of the branch workflow is added to the workflow extension table of the target node to update the workflow extension table.

[0066] When the target node is configured with a workflow extension table, the branch workflow identifier of the branch workflow can be added to the workflow extension table of the target node to update the workflow extension table. In this way, when the in-transit workflow instance corresponding to the workflow to be extended flows to the target node and the output result of the target node is passed, a branch workflow instance can be generated and executed according to the branch workflow corresponding to the branch workflow identifier in the workflow extension table. In this way, there is no need to re-execute the previous workflow instance, but to execute the branch workflow instance. The developer does not need to rewrite the entire workflow, nor does he need to execute the workflow instance from scratch, thereby greatly improving the execution efficiency of the workflow instance.

[0067] It can be understood that when the target node is configured with a workflow extension table, it can be determined that the target node has the workflow extension function, and the developer does not need to perform business code modification on the target node. However, when the target node is not configured with a workflow extension table, it can be determined that the target node does not have the workflow extension capability, and the developer is required to perform business code modification on the target node. Only after the business code modification is performed, the workflow extension function is possessed.

[0068] Step S205: When the in-transit workflow instance corresponding to the workflow to be extended flows to the target node and the output result of the target node is passed, a branch workflow instance is generated according to the branch workflow corresponding to the branch workflow identifier in the workflow extension table, and the branch workflow instance is executed.

[0069] The in-transit workflow instance corresponding to the workflow to be extended refers to the workflow instance that has been executed according to the workflow to be extended. For example, the in-transit workflow instance corresponding to the workflow to be extended includes workflow instance A and workflow instance B, and workflow instance A has been transferred to Figure 3 The first-level approval node 12 in the workflow instance B has already flowed to Figure 3 Secondary approval node 13 in.

[0070] Step S206: When the target node is not configured with a workflow extension table, a code transformation task for the target node is generated according to the first identifier, the second identifier and the branch workflow identifier of the branch workflow, and the code transformation task is pushed to the developer.

[0071] Among them, the code transformation task is used to prompt the developer to modify the business code of the target node, so that the downstream node of the target node after the business code is modified is the first node in the branch workflow. The code transformation task carries the first identifier of the workflow to be extended, the second identifier of the target node, and the branch workflow identifier of the currently generated branch workflow. The target node is the workflow node in the workflow to be extended for splicing the branch workflow corresponding to the branch flowchart. In this way, after knowing the code transformation task, the developer can modify the code business of the target node based on the first identifier of the workflow to be extended, the second identifier of the target node, and the branch workflow identifier of the currently generated branch workflow. In this way, the downstream node of the target node after the business code is modified is the first node in the branch workflow.

[0072] Exemplarily, pushing the code transformation task to the developer may include sending the code transformation task to the developer's internal enterprise account or email address.

[0073] Step S207: After the completion message of the code transformation task is obtained, when the in-transit workflow instance corresponding to the workflow to be extended flows to the target node and the output result of the target node is passed, a branch workflow instance is generated based on the branch workflow.

[0074] The completion message of the code transformation task is used to indicate that the server developer has completed the code transformation task of the target node. The completion message of the code transformation task can be sent by the developer to the server via a terminal device connected to the server.

[0075] The workflow extension method provided in the above embodiment can generate a code transformation task and push the code transformation task to the developer when the target node is not configured with a workflow extension table, thereby reminding the developer to modify the business code of the target node, so that the downstream node of the target node after the business code is modified is the first node in the branch workflow. After the target node is modified, when the in-transit workflow instance corresponding to the workflow to be extended flows to the target node and the output result of the target node is passed, a branch workflow instance is generated based on the branch workflow. The developer does not need to rewrite the entire workflow or execute the workflow instance from scratch, thereby greatly improving the execution efficiency of the workflow instance.

[0076] See also Figure 8 , Figure 8 It is a schematic block diagram of a workflow expansion device provided in an embodiment of the present application.

[0077] like Figure 8 As shown, the workflow extension device 300 includes:

[0078] The acquisition module 310 is used to acquire a workflow extension request, wherein the workflow extension request includes a first identifier of the workflow to be extended, a second identifier of a target node, and a branch flowchart of the workflow, wherein the target node is a workflow node in the workflow to be extended for splicing a branch workflow corresponding to the branch flowchart;

[0079] A workflow generation module 320, used to generate a corresponding branch workflow according to the branch flowchart;

[0080] An updating module 330, configured to add the branch workflow identifier of the branch workflow to the workflow extension table of the target node to update the workflow extension table;

[0081] The instance generation module 340 is used to generate a corresponding branch workflow instance according to the branch workflow identifier corresponding to the branch workflow in the workflow extension table, and execute the branch workflow instance when the in-transit workflow instance corresponding to the workflow to be extended flows to the target node and the output result of the target node is passed.

[0082] In one embodiment, the instance generation module 340 is further used to:

[0083] Acquire the branch workflow identifiers corresponding to the first identifier and the second identifier from the workflow extension table;

[0084] When there are multiple branch workflow identifiers obtained, create a thread pool, where the number of concurrent threads in the thread pool is greater than or equal to the number of branch workflow identifiers;

[0085] Allocating a plurality of the branch workflow identifiers to a plurality of threads in the thread pool, and determining the threads to which the branch workflow identifiers are allocated as target threads, wherein one target thread corresponds to one branch workflow identifier;

[0086] Each of the target threads is called to generate a branch workflow instance based on the branch workflow corresponding to the branch workflow identifier assigned to each of the target threads.

[0087] In one embodiment, the workflow generation module 320 is further used to:

[0088] Parsing the branch flowchart to obtain the name, type, position, flow relationship and executed workflow function of each process node in the branch flowchart;

[0089] According to the name, type, position, flow relationship and executed workflow function of each process node in the branch flowchart, a corresponding branch workflow is generated.

[0090] In one embodiment, the workflow extension device 300 further includes:

[0091] A determination module, configured to determine whether the target node is configured with a workflow extension table according to the second identifier;

[0092] The updating module 330 is further configured to add the branch workflow identifier of the branch workflow to the workflow extension table of the target node to update the workflow extension table when the target node is configured with a workflow extension table.

[0093] In one embodiment, the determining module is further configured to:

[0094] Obtaining a current value of a preset identification bit in the second identification;

[0095] When the current value of the preset identification bit in the second identification is the first preset value, determining that the target node is configured with a workflow extension table;

[0096] When the current value of the preset identification bit in the second identification is the second preset value, it is determined that the target node is not configured with a workflow extension table.

[0097] In one embodiment, the workflow extension device 300 further includes:

[0098] A task generation module, configured to generate a code transformation task for the target node according to the first identifier, the second identifier and the branch workflow identifier of the branch workflow when the target node is not configured with a workflow extension table;

[0099] A sending module, used to push the code transformation task to the developer, wherein the code transformation task is used to prompt the developer to modify the business code of the target node so that the downstream node of the target node after the business code is modified is the first node in the branch workflow;

[0100] The instance generation module 340 is also used to generate a branch workflow instance based on the branch workflow after obtaining the completion message of the code transformation task, when the in-transit workflow instance corresponding to the workflow to be extended flows to the target node and the output result of the target node is passed.

[0101] In one embodiment, the workflow extension device 300 further includes:

[0102] An acquisition module, used to acquire the node flow record of the in-transit workflow instance and the node flow record of the branch workflow instance;

[0103] The splicing module is used to splice the node flow record of the in-transit workflow instance with the node flow record of the branch workflow instance to obtain a target node flow record.

[0104] It should be noted that technicians in the relevant field can clearly understand that for the convenience and simplicity of description, the specific working processes of the above-described devices and modules and units can refer to the corresponding processes in the aforementioned workflow extension method embodiment, and will not be repeated here.

[0105] The apparatus provided in the above embodiment may be implemented in the form of a computer program. The computer program may be Fig. 9 Run on the server shown.

[0106] See also Fig. 9 , Fig. 9 It is a schematic block diagram of the structure of a server provided in an embodiment of the present application.

[0107] like Fig. 9 As shown, the server includes a processor, a memory, and a network interface connected via a system bus, wherein the memory may include a storage medium and an internal memory.

[0108] The storage medium can store an operating system and a computer program. The computer program includes program instructions, and when the program instructions are executed, the processor can execute any workflow expansion method.

[0109] The processor is used to provide computing and control capabilities to support the operation of the entire server.

[0110] The network interface is used for network communication, such as sending assigned tasks, etc. Those skilled in the art will understand that Fig. 9 The structure shown in the figure is only a block diagram of a partial structure related to the solution of the present application, and does not constitute a limitation on the server to which the solution of the present application is applied. The specific server may include more or fewer components than shown in the figure, or combine certain components, or have a different component arrangement.

[0111] It should be understood that the processor may be a central processing unit (CPU), and the processor may also be other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. Among them, the general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.

[0112] In one embodiment, the processor is used to run a computer program stored in the memory to implement the following steps:

[0113] Obtaining a workflow extension request, the workflow extension request including a first identifier of the workflow to be extended, a second identifier of a target node, and a branch flowchart of the workflow, wherein the target node is a workflow node in the workflow to be extended for splicing a branch workflow corresponding to the branch flowchart;

[0114] According to the branch flowchart, a corresponding branch workflow is generated;

[0115] Adding the branch workflow identifier of the branch workflow to the workflow extension table of the target node to update the workflow extension table;

[0116] When the in-transit workflow instance corresponding to the workflow to be extended flows to the target node and the output result of the target node is passed, a branch workflow instance is generated according to the branch workflow corresponding to the branch workflow identifier in the workflow extension table, and the branch workflow instance is executed.

[0117] In one embodiment, when the processor generates a branch workflow instance according to the branch workflow identifier corresponding to the branch workflow identifier in the workflow extension table, it is used to implement:

[0118] Acquire the branch workflow identifiers corresponding to the first identifier and the second identifier from the workflow extension table;

[0119] When there are multiple branch workflow identifiers obtained, create a thread pool, where the number of concurrent threads in the thread pool is greater than or equal to the number of branch workflow identifiers;

[0120] Allocating a plurality of the branch workflow identifiers to a plurality of threads in the thread pool, and determining the threads to which the branch workflow identifiers are allocated as target threads, wherein one target thread corresponds to one branch workflow identifier;

[0121] Each of the target threads is called to generate a branch workflow instance based on the branch workflow corresponding to the branch workflow identifier assigned to each of the target threads.

[0122] In one embodiment, when the processor generates a corresponding branch workflow according to the branch flowchart, it is used to implement:

[0123] Parsing the branch flowchart to obtain the name, type, position, flow relationship and executed workflow function of each process node in the branch flowchart;

[0124] According to the name, type, position, flow relationship and executed workflow function of each process node in the branch flowchart, a corresponding branch workflow is generated.

[0125] In one embodiment, before adding the branch workflow identifier of the branch workflow to the workflow extension table of the target node to update the workflow extension table, the processor is further configured to implement:

[0126] Determining, according to the second identifier, whether the target node is configured with a workflow extension table;

[0127] When the target node is configured with a workflow extension table, the branch workflow identifier of the branch workflow is added to the workflow extension table of the target node to update the workflow extension table.

[0128] In one embodiment, when the processor determines whether the target node is configured with a workflow extension table according to the second identifier, it is configured to implement:

[0129] Obtaining a current value of a preset identification bit in the second identification;

[0130] When the current value of the preset identification bit in the second identification is the first preset value, determining that the target node is configured with a workflow extension table;

[0131] When the current value of the preset identification bit in the second identification is the second preset value, it is determined that the target node is not configured with a workflow extension table.

[0132] In one embodiment, after determining whether the target node is configured with a workflow extension table according to the second identifier, the processor is further configured to implement:

[0133] When the target node is not configured with a workflow extension table, generating a code transformation task for the target node according to the first identifier, the second identifier and the branch workflow identifier of the branch workflow;

[0134] Pushing the code transformation task to the developer, the code transformation task is used to prompt the developer to modify the business code of the target node so that the downstream node of the target node after the business code is modified is the first node in the branch workflow;

[0135] After obtaining the completion message of the code transformation task, when the in-transit workflow instance corresponding to the workflow to be extended flows to the target node and the output result of the target node is passed, a branch workflow instance is generated based on the branch workflow.

[0136] In one embodiment, after the generation of the branch workflow instance is implemented, the processor is further configured to implement:

[0137] Obtaining the node flow record of the in-transit workflow instance and the node flow record of the branch workflow instance;

[0138] The node flow record of the in-transit workflow instance is concatenated with the node flow record of the branch workflow instance to obtain a target node flow record.

[0139] It should be noted that those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working process of the server described above can refer to the corresponding process in the aforementioned workflow extension method embodiment, and will not be repeated here.

[0140] It can be known from the description of the above implementation methods that those skilled in the art can clearly understand that the present application can be implemented by means of software plus a necessary general hardware platform. Based on such an understanding, the technical solution of the present application can be essentially or partly contributed to the prior art in the form of a software product, which can be stored in a storage medium such as ROM / RAM, a disk, an optical disk, etc., including several instructions for enabling a server (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in the various embodiments of the present application or certain parts of the embodiments.

[0141] An embodiment of the present application further provides a storage medium, on which a computer program is stored. The computer program includes program instructions. The method implemented when the program instructions are executed can refer to the various embodiments of the workflow extension method of the present application.

[0142] The storage medium may be volatile or non-volatile. The storage medium may be an internal storage unit of the server described in the foregoing embodiment, such as a hard disk or memory of the server. The storage medium may also be an external storage device of the server, such as a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), etc., equipped on the server.

[0143] Furthermore, the storage medium may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function, etc.; the data storage area may store data created according to the use of the blockchain node, etc.

[0144] The blockchain referred to in this application is a new application model of computer technologies such as distributed data storage, peer-to-peer transmission, consensus mechanism, encryption algorithm, etc. Blockchain is essentially a decentralized database, a string of data blocks generated by cryptographic methods. Each data block contains a batch of network transaction information, which is used to verify the validity of its information (anti-counterfeiting) and generate the next block. Blockchain can include the underlying blockchain platform, platform product service layer, and application service layer.

[0145] It should be understood that the terms used in this application specification are only for the purpose of describing specific embodiments and are not intended to limit the application. As used in this application specification and the appended claims, unless the context clearly indicates otherwise, the singular forms "a", "an" and "the" are intended to include plural forms.

[0146] It should also be understood that the term "and / or" used in the specification of this application and the appended claims refers to any combination of one or more of the associated listed items and all possible combinations, including these combinations. It should be noted that, in this article, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or system including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or system. In the absence of further restrictions, an element defined by the sentence "including a..." does not exclude the presence of other identical elements in the process, method, article or system including the element.

[0147] The serial numbers of the embodiments of the present application are for description only and do not represent the advantages and disadvantages of the embodiments. The above description is only a specific implementation mode of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of various equivalent modifications or replacements within the technical scope disclosed in the present application, and these modifications or replacements should be included in the protection scope of the present application. Therefore, the protection scope of the present application shall be based on the protection scope of the claims.

Claims

1. A workflow extension method, It is characterized in that include: Obtaining a workflow extension request, the workflow extension request including a first identifier of the workflow to be extended, a second identifier of a target node, and a branch flowchart of the workflow, wherein the target node is a workflow node in the workflow to be extended for splicing a branch workflow corresponding to the branch flowchart; According to the branch flowchart, a corresponding branch workflow is generated; Determining, according to the second identifier, whether the target node is configured with a workflow extension table; When the target node is not configured with a workflow extension table, generating a code transformation task for the target node according to the first identifier, the second identifier and the branch workflow identifier of the branch workflow; Pushing the code transformation task to the developer, the code transformation task is used to prompt the developer to modify the business code of the target node so that the downstream node of the target node after the business code is modified is the first node in the branch workflow; After obtaining the completion message of the code transformation task, when the in-transit workflow instance corresponding to the workflow to be extended flows to the target node and the output result of the target node is passed, generating a branch workflow instance based on the branch workflow; When the target node is configured with a workflow extension table, adding the branch workflow identifier of the branch workflow to the workflow extension table of the target node to update the workflow extension table; When the in-transit workflow instance corresponding to the workflow to be extended flows to the target node and the output result of the target node is passed, a branch workflow instance is generated according to the branch workflow corresponding to the branch workflow identifier in the workflow extension table, and the branch workflow instance is executed; The step of generating a branch workflow instance according to the branch workflow corresponding to the branch workflow identifier in the workflow extension table includes: Acquire the branch workflow identifiers corresponding to the first identifier and the second identifier from the workflow extension table; When there are multiple branch workflow identifiers obtained, create a thread pool, where the number of concurrent threads in the thread pool is greater than or equal to the number of branch workflow identifiers; Allocating a plurality of the branch workflow identifiers to a plurality of threads in the thread pool, and determining the threads to which the branch workflow identifiers are allocated as target threads, wherein one target thread corresponds to one branch workflow identifier; Each of the target threads is called to generate a branch workflow instance based on the branch workflow corresponding to the branch workflow identifier assigned to each of the target threads.

2. The workflow extension method according to claim 1, It is characterized in that The step of generating a corresponding branch workflow according to the branch flowchart includes: Parsing the branch flowchart to obtain the name, type, position, flow relationship and executed workflow function of each process node in the branch flowchart; According to the name, type, position, flow relationship and executed workflow function of each process node in the branch flowchart, a corresponding branch workflow is generated.

3. The workflow extension method according to claim 1, It is characterized in that The step of determining, according to the second identifier, whether the target node is configured with a workflow extension table includes: Obtaining a current value of a preset identification bit in the second identification; When the current value of the preset identification bit in the second identification is the first preset value, determining that the target node is configured with a workflow extension table; When the current value of the preset identification bit in the second identification is the second preset value, it is determined that the target node is not configured with a workflow extension table.

4. The workflow extension method according to any one of claims 1 to 3, It is characterized in that After generating the branch workflow instance, the method further includes: Obtaining the node flow record of the in-transit workflow instance and the node flow record of the branch workflow instance; The node flow record of the in-transit workflow instance is concatenated with the node flow record of the branch workflow instance to obtain a target node flow record.

5. A workflow expansion device, It is characterized in that The workflow expansion device comprises: An acquisition module, used to acquire a workflow extension request, wherein the workflow extension request includes a first identifier of the workflow to be extended, a second identifier of a target node, and a branch flowchart of the workflow, wherein the target node is a workflow node in the workflow to be extended for splicing a branch workflow corresponding to the branch flowchart; A workflow generation module, used to generate corresponding branch workflows according to the branch flowchart; A determination module, configured to determine whether the target node is configured with a workflow extension table according to the second identifier; A task generation module, configured to generate a code transformation task for the target node according to the first identifier, the second identifier and the branch workflow identifier of the branch workflow when the target node is not configured with a workflow extension table; A sending module, used to push the code transformation task to the developer, wherein the code transformation task is used to prompt the developer to modify the business code of the target node so that the downstream node of the target node after the business code is modified is the first node in the branch workflow; An instance generation module is used to generate a branch workflow instance based on the branch workflow after obtaining a completion message of the code transformation task and when the in-transit workflow instance corresponding to the workflow to be extended flows to the target node and the output result of the target node is passed; An updating module, configured to add the branch workflow identifier of the branch workflow to the workflow extension table of the target node to update the workflow extension table when the target node is configured with a workflow extension table; An instance generation module, configured to generate a corresponding branch workflow instance according to a branch workflow corresponding to a branch workflow identifier in the workflow extension table, and execute the branch workflow instance when the in-transit workflow instance corresponding to the workflow to be extended flows to the target node and the output result of the target node is passed; Wherein, the instance generation module is further configured to obtain the branch workflow identifier corresponding to the first identifier and the second identifier from the workflow extension table; when a plurality of the obtained branch workflow identifiers are present, create a thread pool, the number of concurrent threads of the thread pool being greater than or equal to the number of the branch workflow identifiers; allocate the plurality of branch workflow identifiers to a plurality of threads in the thread pool, and determine the threads to which the branch workflow identifiers are allocated as target threads, one target thread corresponding to one branch workflow identifier; call each of the target threads to generate branch workflow instances based on the branch workflows corresponding to the branch workflow identifiers allocated to them respectively.

6. A server, characterized in that the server includes a processor, a memory, and a computer program stored on the memory and executable by the processor, wherein when the computer program is executed by the processor, the workflow extension method according to any one of claims 1 to 4 is implemented.

7. A storage medium for computer-readable storage, characterized in that a computer program is stored on the storage medium, wherein when the computer program is executed by a processor, the workflow extension method according to any one of claims 1 to 4 is implemented.

Citation Information

Patent Citations

  • Method and device of data processing, storage medium and electronic equipment

    CN108171468A

  • Method and device for setting routing rule of flow and readable storage medium

    CN109583746A