Workflow processing method and device, storage medium, and electronic device
By implementing workflow processing methods in multiple execution engines, and using local cache pools and distributed cache clusters to obtain process definition information, the problem of excessive load and request delay in workflow management system is solved, and the workflow execution efficiency and system reliability are improved.
Patent Information
- Application Number
- CN201911055220.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2019-10-31
- Publication Date
- 2025-03-18
- Estimated Expiration
- 2039-10-31
AI Technical Summary
In the prior art, the workflow management system has an excessive load pressure in the case of large concurrency under each independent system, resulting in slow process execution speed and a request delay will be caused when a large number of concurrency is requested.
By implementing the processing method of the workflow in multiple execution engines, it is judged whether there is process definition information corresponding to the pending workflow in the local cache pool, and if it exists, it is executed; if it does not exist, it is obtained from the distributed cache cluster and executed.
Reduces the load pressure of the workflow management system, improves the execution efficiency of the pending workflow, reduces the dependence of the execution engine on the workflow management system, and ensures that the workflow can still be executed when the workflow relationship system is down.
Smart Images

Figure CN112749193B_ABST
Abstract
Description
Background Art
[0002] Workflow refers to the automation of part or all of a business process in a computer application environment. It is an abstract and general description of the business rules between the workflow and its various operation steps. The main problem that workflow solves is: in order to achieve a certain business goal, use computers to automatically transfer documents, information or tasks between multiple participants according to certain predetermined rules.
[0003] At present, all known workflow systems are unified by a centralized workflow management system to carry the process-related work of multiple systems. The main thing is that all interface accesses are first distributed to the centralized workflow management system, and then the workflow management system distributes the processes of each system to each execution engine, and then each process is executed by the execution engine.
[0004] However, the above method has the following defects: on the one hand, when there is a large amount of concurrency in each independent system, the load pressure of the workflow management system is too large, which makes the execution speed of each process slower; on the other hand, although the intranet overhead of a single request is not large, when there are a large number of concurrent requests, it will cause request delays.
[0005] Therefore, it is necessary to provide a new workflow processing method and device.
[0006] It should be noted that the information disclosed in the above background technology section is only used to enhance the understanding of the background of the present invention, and therefore may include information that does not constitute prior art known to ordinary technicians in the field. Summary of the invention
[0007] The purpose of the present invention is to provide a workflow processing method, a workflow processing device, a computer-readable storage medium and an electronic device, thereby at least to a certain extent overcoming the problem of slow process execution speed caused by the limitations and defects of related technologies.
[0008] According to one aspect of the present disclosure, a workflow processing method is provided, which is applied to multiple execution engines. The workflow processing method includes:
[0009] Receiving a processing request including a workflow to be processed, and determining in response to the processing request whether there is process definition information corresponding to the workflow to be processed in a local cache pool;
[0010] When it is determined that there is a process definition corresponding to the to-be-processed workflow in the local cache pool, executing the to-be-processed workflow according to the process definition information; and
[0011] When it is determined that the local cache pool does not contain the process definition information corresponding to the workflow to be processed, the process definition information corresponding to the workflow to be processed is obtained from the distributed cache cluster, and the workflow to be processed is executed according to the process definition information.
[0012] In an exemplary embodiment of the present disclosure, the workflow processing method further includes:
[0013] Receiving a status update event pushed by a distributed coordination system that is generated when a change in the process definition information is detected;
[0014] Acquire, from the distributed cache cluster according to the status update event, changed process definition information corresponding to the status update event;
[0015] The acquired changed process definition information corresponding to the status update event is stored in the local cache pool.
[0016] In an exemplary embodiment of the present disclosure, the workflow processing method further includes:
[0017] A registration request is sent to the distributed coordination system, so that the distributed coordination system registers the execution engine according to the server name, server IP and request version number of the execution engine included in the registration request, or updates the registration information of the execution engine.
[0018] According to one aspect of the present disclosure, a workflow processing method is provided, which is applied to a distributed coordination system. The workflow processing method includes:
[0019] When a change in the process definition information is detected, a state update event of the process definition information when the change occurs is generated;
[0020] Pushing the changed process definition information to the distributed cache cluster so that the distributed cache cluster stores the changed process definition information;
[0021] The status update event is pushed to the execution engine, so that the execution engine obtains the changed process definition information from the distributed cache cluster according to the status update event, and executes the to-be-processed workflow according to the changed process definition information.
[0022] In an exemplary embodiment of the present disclosure, the workflow processing method further includes:
[0023] Receiving a registration request sent by the execution engine, and responding to the registration request to determine whether there is registration information corresponding to the execution engine in a database;
[0024] When it is determined that the registration information corresponding to the execution engine does not exist in the database, the registration information corresponding to the execution engine is created according to the server name, server IP and request version number of the execution engine included in the registration request.
[0025] In an exemplary embodiment of the present disclosure, the workflow processing method further includes:
[0026] When determining that registration information corresponding to the execution engine exists in the database, determining whether the request version number is greater than a historical version number in the registration information in the database;
[0027] When it is determined that the request version number is greater than the historical version number in the registration information in the database, the registration information in the database is updated according to the server name where the execution engine is located, the server IP address and the request version number.
[0028] In an exemplary embodiment of the present disclosure, pushing the status update event to the execution engine includes:
[0029] According to the registration information in the database, the status update event is pushed to the execution engine corresponding to each registration information.
[0030] In an exemplary embodiment of the present disclosure, the workflow processing method further includes:
[0031] The current process definition information in the database is updated using the changed process definition information.
[0032] According to one aspect of the present disclosure, a workflow processing device is provided, which is applied to multiple execution engines, and the workflow processing device includes:
[0033] A first determination module is used to receive a processing request including a workflow to be processed, and in response to the processing request, determine whether there is process definition information corresponding to the workflow to be processed in the local cache pool;
[0034] A first execution module, configured to execute the workflow to be processed according to the process definition information when it is determined that there is a process definition corresponding to the workflow to be processed in the local cache pool; and
[0035] The second execution module is used to obtain the process definition information corresponding to the workflow to be processed from the distributed cache cluster when it is determined that the local cache pool does not contain the process definition information corresponding to the workflow to be processed, and execute the workflow to be processed according to the process definition information.
[0036] According to one aspect of the present disclosure, a workflow processing device is provided, which is applied to a distributed coordination system. The workflow processing device includes:
[0037] A status update event generation module, used for generating a status update event of the process definition information when a change is detected in the process definition information;
[0038] A first push module, used to push the changed process definition information to the distributed cache cluster, so that the distributed cache cluster stores the changed process definition information;
[0039] The second push module is used to push the status update event to the execution engine, so that the execution engine obtains the changed process definition information from the distributed cache cluster according to the status update event, and executes the to-be-processed workflow according to the changed process definition information.
[0040] According to one aspect of the present disclosure, a workflow processing system is provided, comprising:
[0041] A distributed coordination system is used to generate a status update event of the process definition information when a change is detected; and push the changed process definition information to the distributed cache cluster, and push the status update event to the execution engine;
[0042] An execution engine, connected in communication with the distributed coordination system, configured to obtain the updated process definition information after the change from the distributed cache cluster according to the status update event; and execute the workflow to be processed according to the process definition information;
[0043] A distributed cache cluster is connected to the execution engine and the distributed coordination system for storing all process definition information.
[0044] According to one aspect of the present disclosure, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the method for processing a workflow described in any one of the above is implemented.
[0045] According to one aspect of the present disclosure, there is provided an electronic device, including:
[0046] Processor; and
[0047] A memory, configured to store executable instructions of the processor;
[0048] The processor is configured to execute any one of the above-mentioned workflow processing methods by executing the executable instructions.
[0049] The embodiments of the present invention provide a workflow processing method and device. On the one hand, since the workflow processing method is implemented based on multiple execution engines, it can solve the problem in the prior art that when there is a large amount of concurrency in each independent system, the load pressure of the workflow management system is too large, which makes the execution speed of each process slow, thereby reducing the load pressure of the workflow management system; on the other hand, by judging whether there is process definition information corresponding to the workflow to be processed in the local cache pool; and when it is judged that there is a process definition corresponding to the workflow to be processed in the local cache pool, the workflow to be processed is executed according to the process definition information; and then when it is judged that there is no process definition information corresponding to the workflow to be processed in the local cache pool, the process definition information corresponding to the workflow to be processed is obtained from the distributed cache cluster. The invention can obtain the corresponding process definition information and execute the pending workflow according to the process definition information, thereby solving the problem of request delay caused by a large number of concurrent requests in the prior art and improving the efficiency of executing the pending workflow. On the other hand, when it is determined that there is a process definition corresponding to the pending workflow in the local cache pool, the pending workflow is executed according to the process definition information. Then, when it is determined that there is no process definition information corresponding to the pending workflow in the local cache pool, the process definition information corresponding to the pending workflow is obtained from the distributed cache cluster, and the pending workflow is executed according to the process definition information. This reduces the dependence of the execution engine on the workflow management system, so that when the workflow relationship system is down, the execution engine can also execute the pending workflow according to the process definition information.
[0050] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the invention. BRIEF DESCRIPTION OF THE DRAWINGS
[0051] The accompanying drawings herein are incorporated into and constitute a part of the specification, illustrate embodiments consistent with the present invention, and together with the specification are used to explain the principles of the present invention. Obviously, the accompanying drawings described below are only some embodiments of the present invention, and for those of ordinary skill in the art, other accompanying drawings can be obtained based on these accompanying drawings without creative work.
[0052] Figure 1 A flowchart schematically illustrates a method for processing a workflow according to an exemplary embodiment of the present invention;
[0053] Figure 2 A block diagram schematically illustrating a system for processing a workflow according to an exemplary embodiment of the present invention;
[0054] Figure 3 A diagram schematically shows an example scenario of a workflow promotion according to an example embodiment of the present invention;
[0055] Figure 4 A flowchart of advancing a Token according to an exemplary embodiment of the present invention is schematically shown;
[0056] Figure 5 A flowchart schematically illustrating an execution process of a workflow according to an exemplary embodiment of the present invention;
[0057] Figure 6 A flowchart schematically illustrating another workflow processing method according to an exemplary embodiment of the present invention;
[0058] Figure 7 A flowchart schematically illustrating another workflow processing method according to an exemplary embodiment of the present invention;
[0059] Figure 8 A flowchart schematically illustrating another workflow processing method according to an exemplary embodiment of the present invention;
[0060] Fig. 9 A block diagram schematically showing a workflow processing device according to an exemplary embodiment of the present invention;
[0061] Fig.10 An electronic device for implementing the above workflow processing method according to an exemplary embodiment of the present invention is schematically shown. DETAILED DESCRIPTION
[0062] Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be implemented in a variety of forms and should not be construed as being limited to the examples set forth herein; on the contrary, these embodiments are provided so that the present invention will be more comprehensive and complete, and the concept of the example embodiments will be fully conveyed to those skilled in the art. The described features, structures, or characteristics may be combined in one or more embodiments in any suitable manner. In the following description, many specific details are provided to provide a full understanding of the embodiments of the present invention. However, those skilled in the art will appreciate that the technical solutions of the present invention may be practiced while omitting one or more of the specific details, or other methods, components, devices, steps, etc. may be adopted. In other cases, known technical solutions are not shown or described in detail to avoid obscuring various aspects of the present invention.
[0063] In addition, the accompanying drawings are only schematic illustrations of the present invention and are not necessarily drawn to scale. The same reference numerals in the figures represent the same or similar parts, and their repeated description will be omitted. Some of the block diagrams shown in the accompanying drawings are functional entities and do not necessarily correspond to physically or logically independent entities. These functional entities can be implemented in software form, or implemented in one or more hardware modules or integrated circuits, or implemented in different networks and / or processor devices and / or microcontroller devices.
[0064] This exemplary embodiment first provides a workflow processing method, which can be run on multiple execution engines, such as a server or a server cluster. Of course, those skilled in the art can also run the method of the present invention on other platforms as required, which is not specifically limited in this exemplary embodiment. Figure 1 As shown, the workflow processing method may include the following steps:
[0065] Step S110: receiving a processing request including a workflow to be processed, and determining in response to the processing request whether there is process definition information corresponding to the workflow to be processed in the local cache pool.
[0066] Step S120: When it is determined that there is a process definition corresponding to the workflow to be processed in the local cache pool, the workflow to be processed is executed according to the process definition information.
[0067] Step S130: When it is determined that the local cache pool does not contain the process definition information corresponding to the workflow to be processed, the process definition information corresponding to the workflow to be processed is obtained from the distributed cache cluster, and the workflow to be processed is executed according to the process definition information.
[0068] In the above-mentioned workflow processing method, on the one hand, since the workflow processing method is implemented based on multiple execution engines, it can solve the problem in the prior art that the load pressure of the workflow management system is too large when there is a large amount of concurrency in each independent system, which makes the execution speed of each process slow, thereby reducing the load pressure of the workflow management system; on the other hand, by judging whether there is process definition information corresponding to the workflow to be processed in the local cache pool; and when it is judged that there is a process definition corresponding to the workflow to be processed in the local cache pool, the workflow to be processed is executed according to the process definition information; and then when it is judged that there is no process definition information corresponding to the workflow to be processed in the local cache pool, the process definition corresponding to the workflow to be processed is obtained from the distributed cache cluster. The method can obtain information from the distributed cache cluster and execute the workflow to be processed according to the process definition information, thereby solving the problem in the prior art that when a large number of requests are made concurrently, the request delay is caused, and the timeliness of the execution of the workflow to be processed is improved; on the other hand, when it is determined that there is a process definition corresponding to the workflow to be processed in the local cache pool, the workflow to be processed is executed according to the process definition information; then, when it is determined that there is no process definition information corresponding to the workflow to be processed in the local cache pool, the process definition information corresponding to the workflow to be processed is obtained from the distributed cache cluster, and the workflow to be processed is executed according to the process definition information, thereby reducing the dependence of the execution engine on the workflow management system, so that when the workflow relationship system is down, the execution engine can also execute the workflow to be processed according to the process definition information.
[0069] Hereinafter, each step involved in the workflow processing method according to the exemplary embodiment of the present invention will be explained and illustrated in detail with reference to the accompanying drawings.
[0070] The purpose of the present invention is to provide a distributed workflow system with centralized process data, aiming to solve the problem in the prior art that process scheduling and execution are all handled uniformly by a centralized workflow management system, which results in excessive load pressure on process scheduling and execution of multiple systems and increases intranet overhead and delay.
[0071] First, a workflow processing system according to an exemplary embodiment of the present invention is explained and described.
[0072] refer to Figure 2 As shown, the workflow processing system may include a distributed coordination system 210, multiple execution engines 220, and a distributed cache cluster 230. Among them:
[0073] The distributed coordination system 210 (workflow-configuration center) may include, for example, ZooKeeper 211 and a database (MySQL) 212; wherein ZooKeeper may be used to generate a status update event for the process definition information when a change is detected in the process definition information; and push the changed process definition information to the distributed cache cluster, and push the status update event to the execution engine; the database (MySQL) may be used to store the process definition information.
[0074] The execution engine (workflow agent) 220 can be connected to the distributed coordination system for communication, and can be used to obtain the updated process definition information after the change from the distributed cache cluster according to the status update event; and execute the workflow to be processed according to the process definition information. Further, the execution engine (workflow agent) 220 can include RuntimeService (runtime service component), cache scheduling component 222 and local cache pool (Local CachePool) 223, and Actor (merged workflow) 224. Further, 221 is mainly used to manage the data generated by the process at runtime and the API for operating the running process. The data can include process parameters, events, process instances, and execution flows, etc.
[0075] The distributed cache cluster 230 can be connected to the execution engine and the distributed coordination system for storing all process definition information. The distributed cache cluster can include multiple Redis or Memcached.
[0076] Furthermore, the workflow processing system may also include a workflow scheduling engine (JobKeeper) asynchronous 240 and an event-driven model 250. Specifically, the workflow scheduling engine may be used to schedule the workflows to be processed, so as to avoid a problem where a certain execution engine is overloaded due to too many workflows to be processed that need to be executed at the same time. The event-driven model may be used to ensure the correct execution of the node.
[0077] the following, Figure 1 The steps in the workflow processing method involved are explained and illustrated.
[0078] In step S110, a processing request including a workflow to be processed is received, and in response to the processing request, it is determined whether process definition information corresponding to the workflow to be processed exists in the local cache pool.
[0079] In step S120, when it is determined that there is a process definition corresponding to the workflow to be processed in the local cache pool, the workflow to be processed is executed according to the process definition information.
[0080] In step S130, when it is determined that the local cache pool does not contain the process definition information corresponding to the workflow to be processed, the process definition information corresponding to the workflow to be processed is obtained from the distributed cache cluster, and the workflow to be processed is executed according to the process definition information.
[0081] Hereinafter, steps S110 to S130 will be explained and described. Figure 2 As shown, first, the business service system can initiate a processing request (process execution request) including the workflow to be processed to the execution engine 220. When the execution engine 220 receives the processing request, it responds to the processing request to determine whether there is process definition information corresponding to the workflow to be processed in the local cache pool (Local Cache Pool). If there is, the workflow to be processed is executed according to the process definition information; if not, the process definition information corresponding to the workflow to be processed is obtained from the distributed cache cluster, and the workflow to be processed is executed according to the process definition information.
[0082] Furthermore, as the amount of data processed grows, the workflows that need to be managed are also becoming larger and larger, filled with a large number of ETL tasks. For example, some workflows rely on a certain point in time to execute, and some workflows rely on data or external events to execute. Some tasks in the workflow will fail, and retry and alarm functions are required, rather than waiting until the entire workflow fails to discover the problem. In order to solve the above problems, a workflow scheduling engine is referenced to execute the workflow scheduling mechanism.
[0083] Specifically, the workflow scheduling mechanism is to ensure that the process can be correctly transferred from one node to the next node. Based on some ideas of Petri Net, Token301 is used to identify the location of the current process instance (ProcessInstance) and the transfer of Token between various points in the process is used to indicate the advancement of the process. For details, please refer to Figure 3 For example, when a workflow tries to start a process, it first constructs a process instance, creates a Root Token for the process instance, and places the Root Token on the Start Node.
[0084] Furthermore, when the Token is already at the Start-State node, it can start to move forward to prompt the process instance to move forward. For external operations, the operations that trigger the process instance to move forward can include the following two: one is to force the execution of the signal operation of the process instance 401 (ProcessInstance); the other is to execute the end operation of the task instance 402 (TaskInstance). The above two operations are both internally implemented through the "signal (flag) operation 403 of the current Token". For details, please refer to Figure 4 shown.
[0085] Furthermore, the event-driven model provides an operating mechanism to ensure the "correct execution of nodes". During execution, each node is represented by an instance of an activity. The execution of the workflow is the management of the entire life cycle of the activity instance. For details, please refer to Figure 5 For example, S501, Start; S502, Inactive; S503, Suspended; S504, Active; S505, Completed.
[0086] Figure 6 Another workflow processing method according to an exemplary embodiment of the present invention is schematically shown. Figure 6 As shown, the workflow processing method may include steps S610 to S630, which are described in detail below.
[0087] In step S610, a state update event generated when a change in the process definition information is detected and pushed by the distributed coordination system is received.
[0088] In step S620, the changed process definition information corresponding to the status update event is obtained from the distributed cache cluster according to the status update event.
[0089] In step S630, the acquired changed process definition information corresponding to the status update event is stored in the local cache pool.
[0090] The following will explain and illustrate steps S610 to S630. Figure 2As shown, when the business system is started, the workflow-Agent (execution engine) attached to the business system will receive the status update event pushed by the distributed coordination system when the process definition information is detected to have changed; wherein the status update event may include, for example, the creation, modification, deletion, publication, and offline of the process definition information; and then, according to the status update event, the changed process definition information corresponding to the status update event is obtained from the distributed cache cluster, and then the obtained changed process definition information corresponding to the status update event is stored in the local cache pool. Through this method, the dependence of the execution engine on the distributed coordination system can be reduced. Moreover, since the execution engine actively accepts the status update event pushed by the distributed coordination system, and stores the obtained process definition information in the local cache pool, once in the execution process of the workflow, it is no longer necessary to rely on the distributed coordination system, which not only reduces the pressure of the distributed coordination system, but also improves the execution efficiency of the workflow.
[0091] Furthermore, in order to enable all execution engines to receive the above-mentioned status update events in a timely manner, the workflow processing method also includes: sending a registration request to the distributed coordination system, so that the distributed coordination system registers the execution engine according to the server name, server IP and request version number of the execution engine included in the registration request, or updates the registration information of the execution engine.
[0092] Specifically, when the business system is started, the execution engine attached to the business system connects to the distributed coordination system, generates a registration request based on the machine name, IP, and request version number of the server, and then transmits the registration request to the distributed coordination system. When the distributed coordination system receives the registration request, it will make a judgment on the registration request. If the registration information exists and the request version number is greater than the request version number of the registration information of the configuration center, the registration information will be updated; if it does not exist, the registration information can be created. Through this method, the registration information stored in the distributed coordination system can be valid.
[0093] Figure 7 Another workflow processing method according to an example embodiment of the present invention is schematically shown, which is applied to a distributed coordination system. The workflow processing method may include steps S710 to S730, which are described in detail below.
[0094] In step S710, when a change in process definition information is detected, a state update event of the process definition information when the change occurs is generated.
[0095] In step S720, the changed process definition information is pushed to the distributed cache cluster, so that the distributed cache cluster stores the changed process definition information.
[0096] In step S730, the status update event is pushed to the execution engine, so that the execution engine obtains the changed process definition information from the distributed cache cluster according to the status update event, and executes the to-be-processed workflow according to the changed process definition information.
[0097] The following will explain and illustrate steps S710 to S730. Figure 2 As shown, when the distributed coordination system detects that the process definition information has changed, a state update event of the process definition information when the change occurs can be generated; wherein, the state update event can include, for example, the creation, modification, deletion, publication, and offline of the process definition information; then, the transformed process definition information is pushed to the distributed cache cluster, and when the distributed cache cluster receives the changed process definition information, the changed process definition information can be stored; finally, according to the registration information in the database, the state update event is pushed to the execution engine corresponding to each of the registration information; when the execution engine receives the state update event, the changed process definition information can be obtained from the distributed cache cluster according to the state update event, and the workflow to be processed can be executed according to the changed process definition information. Through this method, the pressure of the distributed coordination system can be further reduced, and at the same time, the pressure of excessive access volume on the distributed coordination system caused by the execution engine needing to obtain the changed process definition information from the distributed coordination system can be avoided.
[0098] Figure 8 Another workflow processing method according to an example embodiment of the present invention is schematically shown. Figure 8 As shown, the workflow processing method may include step S810 and step S820, which are described in detail below.
[0099] In step S810, a registration request sent by the execution engine is received, and in response to the registration request, it is determined whether there is registration information corresponding to the execution engine in the database.
[0100] In step S820, when it is determined that the registration information corresponding to the execution engine does not exist in the database, the registration information corresponding to the execution engine is created according to the server name, server IP and request version number of the execution engine included in the registration request.
[0101] Furthermore, when it is determined that there is registration information corresponding to the execution engine in the database, it is determined whether the request version number is greater than the historical version number in the registration information in the database; and when it is determined that the request version number is greater than the historical version number in the registration information in the database, the registration information in the database is updated according to the server name, server IP and request version number where the execution engine is located.
[0102] Furthermore, by updating the registration information in the database or creating the registration information of the execution engine according to the server name, server IP and request version number of the execution engine included in the registration request, all execution engines can receive the above-mentioned status update events in a timely manner, and obtain the changed process definition information from the distributed cache cluster in a timely manner according to the status update events, so that each workflow can be executed in a timely manner according to the corresponding process definition information, further improving the execution efficiency of the workflow.
[0103] Furthermore, in order to avoid the problem that the execution engines cannot obtain the changed process definition information in time due to the failure of the distributed cache cluster, thereby causing the inability to execute the workflow, the workflow processing method also includes: using the changed process definition information to update the current process definition information in the database.
[0104] The exemplary embodiment of the present invention also provides a workflow processing device, which is applied to multiple execution engines. Fig. 9 As shown, the workflow processing device may include a first judgment module 910, a first execution module 920 and a second execution module 930. Among them:
[0105] The first determination module 910 may be configured to receive a processing request including a workflow to be processed, and determine, in response to the processing request, whether there is process definition information corresponding to the workflow to be processed in the local cache pool.
[0106] The first execution module 920 may be configured to execute the workflow to be processed according to the process definition information when it is determined that a process definition corresponding to the workflow to be processed exists in the local cache pool.
[0107] The second execution module 930 can be used to obtain the process definition information corresponding to the workflow to be processed from the distributed cache cluster when it is determined that the local cache pool does not contain the process definition information corresponding to the workflow to be processed, and execute the workflow to be processed according to the process definition information.
[0108] In an exemplary embodiment of the present disclosure, the workflow processing device further includes:
[0109] The first receiving module may be configured to receive a status update event pushed by the distributed coordination system and generated when a change in the process definition information is detected.
[0110] The process definition information acquisition module may be used to acquire the changed process definition information corresponding to the status update event from the distributed cache cluster according to the status update event.
[0111] The first storage module can be used to store the acquired changed process definition information corresponding to the status update event in the local cache pool.
[0112] In an exemplary embodiment of the present disclosure, the workflow processing device further includes:
[0113] The registration request sending module can be used to send a registration request to the distributed coordination system so that the distributed coordination system registers the execution engine according to the server name, server IP and request version number of the execution engine included in the registration request, or updates the registration information of the execution engine.
[0114] According to one aspect of the present disclosure, a workflow processing device is provided, which is applied to a distributed coordination system. The workflow processing device includes:
[0115] The status update event generation module is used to generate a status update event when detecting that the process definition information has changed.
[0116] The first pushing module is used to push the changed process definition information to the distributed cache cluster, so that the distributed cache cluster stores the changed process definition information.
[0117] The second push module is used to push the status update event to the execution engine, so that the execution engine obtains the changed process definition information from the distributed cache cluster according to the status update event, and executes the to-be-processed workflow according to the changed process definition information.
[0118] In an exemplary embodiment of the present disclosure, the workflow processing device further includes:
[0119] The second receiving module may be configured to receive a registration request sent by the execution engine, and respond to the registration request to determine whether there is registration information corresponding to the execution engine in the database.
[0120] The registration information creation module can be used to create registration information corresponding to the execution engine according to the server name, server IP and request version number of the execution engine included in the registration request when it is determined that the registration information corresponding to the execution engine does not exist in the database.
[0121] In an exemplary embodiment of the present disclosure, the workflow processing device further includes:
[0122] The second judgment module may be configured to judge whether the requested version number is greater than a historical version number in the registration information in the database when judging whether the registration information corresponding to the execution engine exists in the database.
[0123] The registration information update module can be used to update the registration information in the database according to the server name, server IP and request version number where the execution engine is located when it is determined that the request version number is greater than the historical version number in the registration information in the database.
[0124] In an exemplary embodiment of the present disclosure, pushing the status update event to the execution engine includes:
[0125] According to the registration information in the database, the status update event is pushed to the execution engine corresponding to each registration information.
[0126] In an exemplary embodiment of the present disclosure, the workflow processing device further includes:
[0127] The second storage module can be used to update the current process definition information in the database using the changed process definition information.
[0128] The specific details of each module in the above-mentioned workflow processing device have been described in detail in the corresponding workflow processing method, so they will not be repeated here.
[0129] It should be noted that, although several modules or units of the equipment for action execution are mentioned in the above detailed description, this division is not mandatory. In fact, according to an embodiment of the present invention, the features and functions of two or more modules or units described above can be embodied in one module or unit. On the contrary, the features and functions of one module or unit described above can be further divided into being embodied by multiple modules or units.
[0130] In addition, although the steps of the method of the present invention are described in a specific order in the drawings, this does not require or imply that the steps must be performed in this specific order, or that all the steps shown must be performed to achieve the desired results. Additionally or alternatively, some steps may be omitted, multiple steps may be combined into one step, and / or one step may be decomposed into multiple steps, etc.
[0131] In an exemplary embodiment of the present invention, an electronic device capable of implementing the above method is also provided.
[0132] It will be appreciated by those skilled in the art that various aspects of the present invention may be implemented as a system, method or program product. Therefore, various aspects of the present invention may be specifically implemented in the following forms, namely: a complete hardware implementation, a complete software implementation (including firmware, microcode, etc.), or a combination of hardware and software, which may be collectively referred to herein as a "circuit", "module" or "system".
[0133] Refer to the following Fig.10 The electronic device 1000 according to this embodiment of the present invention will be described. Fig.10 The electronic device 1000 shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present invention.
[0134] like Fig.10 As shown, the electronic device 1000 is in the form of a general computing device. The components of the electronic device 1000 may include but are not limited to: the at least one processing unit 1010, the at least one storage unit 1020, and a bus 1030 connecting different system components (including the storage unit 1020 and the processing unit 1010).
[0135] The storage unit stores program codes, which can be executed by the processing unit 1010, so that the processing unit 1010 performs the steps according to various exemplary embodiments of the present invention described in the above “Exemplary Method” section of this specification. For example, the processing unit 1010 can perform the following steps: Figure 1 The step S110 shown in the figure is: receiving a processing request including a workflow to be processed, and judging whether there is process definition information corresponding to the workflow to be processed in the local cache pool in response to the processing request; step S120: when it is judged that there is a process definition corresponding to the workflow to be processed in the local cache pool, executing the workflow to be processed according to the process definition information; step S130: when it is judged that there is no process definition information corresponding to the workflow to be processed in the local cache pool, obtaining the process definition information corresponding to the workflow to be processed from the distributed cache cluster, and executing the workflow to be processed according to the process definition information.
[0136] Furthermore, the processing unit 1010 may execute the following steps: Figure 7 Step S710 shown in: when a change in process definition information is detected, a status update event of the process definition information when the change occurs is generated; step S720: the changed process definition information is pushed to the distributed cache cluster so that the distributed cache cluster stores the changed process definition information; S730: the status update event is pushed to the execution engine so that the execution engine obtains the changed process definition information from the distributed cache cluster according to the status update event, and executes the workflow to be processed according to the changed process definition information.
[0137] The storage unit 1020 may include a readable medium in the form of a volatile storage unit, such as a random access storage unit (RAM) 10201 and / or a cache storage unit 10202 , and may further include a read-only storage unit (ROM) 10203 .
[0138] The storage unit 1020 may also include a program / utility 10204 having a set (at least one) of program modules 10205, such program modules 10205 including but not limited to: an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a network environment.
[0139] Bus 1030 may represent one or more of several types of bus structures, including a memory unit bus or memory unit controller, a peripheral bus, an accelerated graphics port, a processing unit, or a local bus using any of a variety of bus architectures.
[0140] The electronic device 1000 may also communicate with one or more external devices 1100 (e.g., keyboards, pointing devices, Bluetooth devices, etc.), may also communicate with one or more devices that enable a user to interact with the electronic device 1000, and / or may communicate with any device that enables the electronic device 1000 to communicate with one or more other computing devices (e.g., routers, modems, etc.). Such communication may be performed via an input / output (I / O) interface 1050. Furthermore, the electronic device 1000 may also communicate with one or more networks (e.g., a local area network (LAN), a wide area network (WAN), and / or a public network, such as the Internet) via a network adapter 1060. As shown, the network adapter 1060 communicates with other modules of the electronic device 1000 via a bus 1030. It should be understood that, although not shown in the figure, other hardware and / or software modules may be used in conjunction with the electronic device 1000, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.
[0141] Through the description of the above implementation, it is easy for those skilled in the art to understand that the example implementation described here can be implemented by software, or by software combined with necessary hardware. Therefore, the technical solution according to the implementation of the present invention can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, and includes several instructions to enable a computing device (which can be a personal computer, a server, a terminal device, or a network device, etc.) to execute the method according to the implementation of the present invention.
[0142] In an exemplary embodiment of the present invention, a computer-readable storage medium is also provided, on which a program product capable of implementing the above method of this specification is stored. In some possible implementations, various aspects of the present invention can also be implemented in the form of a program product, which includes a program code, and when the program product is run on a terminal device, the program code is used to enable the terminal device to perform the steps according to various exemplary embodiments of the present invention described in the above "Exemplary Method" section of this specification.
[0143] The program product for implementing the above method according to an embodiment of the present invention may adopt a portable compact disk read-only memory (CD-ROM) and include program code, and may be run on a terminal device, such as a personal computer. However, the program product of the present invention is not limited thereto, and in this document, a readable storage medium may be any tangible medium containing or storing a program, which may be used by or in combination with an instruction execution system, apparatus, or device.
[0144] The program product may use any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. The readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples (non-exhaustive list) of readable storage media include: an electrical connection with one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above.
[0145] Computer readable signal media may include data signals propagated in baseband or as part of a carrier wave, in which readable program code is carried. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Readable signal media may also be any readable medium other than a readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device.
[0146] The program code embodied on the readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wired, optical cable, RF, etc., or any suitable combination of the foregoing.
[0147] Program code for performing the operations of the present invention may be written in any combination of one or more programming languages, including object-oriented programming languages such as Java, C++, etc., and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user computing device, partially on the user device, as a separate software package, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server. In cases involving a remote computing device, the remote computing device may be connected to the user computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computing device (e.g., through the Internet using an Internet service provider).
[0148] In addition, the above-mentioned figures are only schematic illustrations of the processes included in the method according to an exemplary embodiment of the present invention, and are not intended to be limiting. It is easy to understand that the processes shown in the above-mentioned figures do not indicate or limit the time sequence of these processes. In addition, it is also easy to understand that these processes can be performed synchronously or asynchronously, for example, in multiple modules.
[0149] Other embodiments of the invention will readily occur to those skilled in the art after considering the specification and practicing the invention invented herein. This application is intended to cover any variations, uses or adaptations of the invention that follow the general principles of the invention and include common knowledge or customary techniques in the art that are not invented by the present invention. The specification and examples are to be considered exemplary only, and the true scope and spirit of the invention are indicated by the claims.
Claims
1. A workflow processing method, characterized in that: Applied to multiple execution engines, the workflow processing method includes: Receiving a processing request including a workflow to be processed sent by a business service system, and responding to the processing request to determine whether there is process definition information corresponding to the workflow to be processed in a local cache pool; When it is determined that there is a process definition corresponding to the to-be-processed workflow in the local cache pool, executing the to-be-processed workflow according to the process definition information; and When it is determined that the process definition information corresponding to the workflow to be processed does not exist in the local cache pool, the process definition information corresponding to the workflow to be processed is obtained from the distributed cache cluster, and the workflow to be processed is executed according to the process definition information; The execution of the to-be-processed workflow according to the process definition information is achieved by: constructing a process instance corresponding to the to-be-processed workflow and creating a Root Token for the process instance; placing the Root Token on the start node and pushing the Root Token forward to cause the process instance to run forward; The process instance is operated in the following manner when it runs forward: the Signal operation of the process instance is enforced, and / or the End operation of the task instance is executed.
2. The workflow processing method according to claim 1, characterized in that: The workflow processing method further includes: Receiving a status update event pushed by a distributed coordination system that is generated when a change in the process definition information is detected; Acquire, from the distributed cache cluster according to the status update event, changed process definition information corresponding to the status update event; The acquired changed process definition information corresponding to the status update event is stored in the local cache pool.
3. The workflow processing method according to claim 2, characterized in that: The workflow processing method further includes: A registration request is sent to the distributed coordination system, so that the distributed coordination system registers the execution engine according to the server name, server IP and request version number of the execution engine included in the registration request, or updates the registration information of the execution engine.
4. A workflow processing method, characterized in that: Applied to a distributed coordination system, the workflow processing method includes: When a change in the process definition information is detected, a state update event of the process definition information when the change occurs is generated; Pushing the changed process definition information to the distributed cache cluster so that the distributed cache cluster stores the changed process definition information; Pushing the status update event to the execution engine, so that the execution engine obtains the changed process definition information from the distributed cache cluster according to the status update event, and executes the to-be-processed workflow according to the changed process definition information; The execution of the to-be-processed workflow according to the process definition information is achieved by: constructing a process instance corresponding to the to-be-processed workflow and creating a Root Token for the process instance; placing the Root Token on the start node and pushing the Root Token forward to cause the process instance to run forward; The process instance is operated in the following manner when it runs forward: the Signal operation of the process instance is enforced, and / or the End operation of the task instance is executed.
5. The workflow processing method according to claim 4, characterized in that: The workflow processing method further includes: Receiving a registration request sent by the execution engine, and responding to the registration request to determine whether there is registration information corresponding to the execution engine in a database; When it is determined that the registration information corresponding to the execution engine does not exist in the database, the registration information corresponding to the execution engine is created according to the server name, server IP and request version number of the execution engine included in the registration request.
6. The workflow processing method according to claim 5, characterized in that: The workflow processing method further includes: When determining that registration information corresponding to the execution engine exists in the database, determining whether the request version number is greater than a historical version number in the registration information in the database; When it is determined that the request version number is greater than the historical version number in the registration information in the database, the registration information in the database is updated according to the server name where the execution engine is located, the server IP address and the request version number.
7. The workflow processing method according to claim 6, characterized in that: Pushing the status update event to the execution engine includes: According to the registration information in the database, the status update event is pushed to the execution engine corresponding to each registration information.
8. The workflow processing method according to claim 5, characterized in that: The workflow processing method further includes: The current process definition information in the database is updated using the changed process definition information.
9. A workflow processing device, characterized in that: Applied to multiple execution engines, the workflow processing device includes: A first judgment module is used to receive a processing request including a to-be-processed workflow sent by a business service system, and judge whether there is process definition information corresponding to the to-be-processed workflow in a local cache pool in response to the processing request; A first execution module, configured to execute the workflow to be processed according to the process definition information when it is determined that there is a process definition corresponding to the workflow to be processed in the local cache pool; and A second execution module is used to obtain the process definition information corresponding to the workflow to be processed from the distributed cache cluster when it is determined that the process definition information corresponding to the workflow to be processed does not exist in the local cache pool, and execute the workflow to be processed according to the process definition information; The execution of the to-be-processed workflow according to the process definition information is achieved by: constructing a process instance corresponding to the to-be-processed workflow and creating a Root Token for the process instance; placing the Root Token on the start node and pushing the Root Token forward to cause the process instance to run forward; The process instance is operated in the following manner when it runs forward: the Signal operation of the process instance is enforced, and / or the End operation of the task instance is executed.
10. A workflow processing device, characterized in that: Applied to a distributed coordination system, the workflow processing device comprises: A status update event generation module, used for generating a status update event of the process definition information when a change is detected in the process definition information; A first push module, used to push the changed process definition information to the distributed cache cluster, so that the distributed cache cluster stores the changed process definition information; A second push module is used to push the status update event to the execution engine, so that the execution engine obtains the changed process definition information from the distributed cache cluster according to the status update event, and executes the to-be-processed workflow according to the changed process definition information; The execution of the to-be-processed workflow according to the process definition information is achieved by: constructing a process instance corresponding to the to-be-processed workflow and creating a Root Token for the process instance; placing the Root Token on the start node and pushing the Root Token forward to cause the process instance to run forward; The process instance is operated in the following manner when it runs forward: the Signal operation of the process instance is enforced, and / or the End operation of the task instance is executed.
11. A workflow processing system, characterized in that: include: A distributed coordination system, for generating a state update event of the process definition information when a change is detected in the process definition information; And push the changed process definition information to the distributed cache cluster, and push the status update event to the execution engine; An execution engine, connected in communication with the distributed coordination system, for obtaining updated process definition information after the change from the distributed cache cluster according to the status update event; and executing the pending workflow according to the process definition information; wherein, executing the pending workflow according to the process definition information is achieved by: constructing a process instance corresponding to the pending workflow, and creating a Root Token for the process instance; placing the Root Token on the start node, and pushing the Root Token forward to prompt the process instance to run forward; when the process instance runs forward, it is operated by: forcing the Signal operation of the process instance, and / or executing the End operation of the task instance; A distributed cache cluster is connected to the execution engine and the distributed coordination system for storing all process definition information.
12. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the workflow processing method according to any one of claims 1 to 8 is implemented.
13. An electronic device, characterized in that: include: processor; as well as A memory, configured to store executable instructions of the processor; The processor is configured to execute the workflow processing method according to any one of claims 1 to 8 by executing the executable instructions.
Citation Information
Patent Citations
Distributed workflow processing method and distributed workflow engine system
CN102456185A
Service processing method and apparatus
CN109472540A