CN112732367A - Event flow processing method, device and equipment and readable storage medium - Google Patents

Event flow processing method, device and equipment and readable storage medium Download PDF

Info

Publication number
CN112732367A
CN112732367A CN202011613704.8A CN202011613704A CN112732367A CN 112732367 A CN112732367 A CN 112732367A CN 202011613704 A CN202011613704 A CN 202011613704A CN 112732367 A CN112732367 A CN 112732367A
Authority
CN
China
Prior art keywords
node
flow
event
target
subtasks
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202011613704.8A
Other languages
Chinese (zh)
Inventor
孙亮
李映超
徐文锋
张泰�
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Sankuai Online Technology Co Ltd
Original Assignee
Beijing Sankuai Online Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Sankuai Online Technology Co Ltd filed Critical Beijing Sankuai Online Technology Co Ltd
Priority to CN202011613704.8A priority Critical patent/CN112732367A/en
Publication of CN112732367A publication Critical patent/CN112732367A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/448Execution paradigms, e.g. implementations of programming paradigms
    • G06F9/4482Procedural
    • G06F9/4484Executing subprograms
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/48Program initiating; Program switching, e.g. by interrupt
    • G06F9/4806Task transfer initiation or dispatching
    • G06F9/4843Task transfer initiation or dispatching by program, e.g. task dispatcher, supervisor, operating system
    • G06F9/4881Scheduling strategies for dispatcher, e.g. round robin, multi-level priority queues

Abstract

The application discloses a method, a device and equipment for processing an event flow and a readable storage medium, and relates to the field of flow control. The method comprises the following steps: based on a node structure in an event flow, sequentially executing node tasks of flow nodes, wherein a target node comprises at least two subtasks; processing at least two subtasks in parallel; determining a state flow action of the target node based on the processing results of the at least two subtasks; and continuing to execute the node task in the event flow based on the state flow action until the flow of the event flow is finished. Aiming at the node structure of the event process, a node-subtask refinement structure is designed, and the atomic task is designed to be processed in parallel in the nodes, so that the method is suitable for various processes, thereby satisfying various different processes, improving the code reuse rate, and only processing the subtasks in parallel between the nodes, reducing the process complexity and improving the process execution efficiency.

Description

Event flow processing method, device and equipment and readable storage medium
Technical Field
The present disclosure relates to the field of process control, and in particular, to a method, an apparatus, a device, and a readable storage medium for processing an event process.
Background
In some events with flow control, the flow is usually designed first, so that the processing of the event is performed based on the flow design. Schematically, in an online credit card approval system, the online credit card approval system needs to be designed according to an approval process, and different banks usually have different corresponding approval processes, that is, different approval systems need to be designed according to different banks.
In the related art, a flow chart is designed through some open source software based on tasks in an event flow, and the tasks in the event flow are designed into nodes in the flow chart, so that the execution of the event flow is completed through the execution of the node tasks.
However, in the above scheme, when the number of nodes is large, the performance and stability of the flow chart itself are easily affected, and when there are many parallel nodes, an optimistic lock is easily triggered, so that the task needs to be executed again, and the execution efficiency of the flow is reduced.
Disclosure of Invention
The embodiment of the application provides an event flow processing method, an event flow processing device, event flow processing equipment and a readable storage medium, and can improve the execution efficiency and accuracy of the event flow. The technical scheme is as follows:
in one aspect, a method for processing an event flow is provided, where the method includes:
sequentially executing node tasks of process nodes based on a node structure in an event process, wherein the event process comprises at least two process nodes, the at least two process nodes comprise target nodes, and the target nodes comprise at least two subtasks;
in response to execution to the target node, processing the at least two subtasks in parallel;
determining a state flow action of the target node based on the processing results of the at least two subtasks, wherein the state flow action is used for determining the node trend of the target node;
and continuing to execute the node task in the event flow based on the state flow action until the flow of the event flow is finished.
In another aspect, an apparatus for processing an event flow is provided, the apparatus including:
the system comprises an execution module, a task execution module and a task execution module, wherein the execution module is used for sequentially executing node tasks of process nodes based on a node structure in an event process, the event process comprises at least two process nodes, the at least two process nodes comprise target nodes, and the target nodes comprise at least two subtasks; in response to execution to the target node, processing the at least two subtasks in parallel;
a determining module, configured to determine a state flow action of the target node based on processing results of the at least two subtasks, where the state flow action is used to determine a node trend of the target node;
the execution module is further configured to continue to execute the node task in the event flow based on the state flow action until the flow of the event flow is ended.
In another aspect, a computer device is provided, which comprises a processor and a memory, wherein at least one instruction, at least one program, a set of codes, or a set of instructions is stored in the memory, and the at least one instruction, the at least one program, the set of codes, or the set of instructions is loaded and executed by the processor to implement the processing method of the event flow as provided in the above embodiments.
In another aspect, a computer readable storage medium is provided, in which at least one instruction, at least one program, a set of codes, or a set of instructions is stored, which is loaded and executed by the processor to implement the processing method of the event flow as provided in the above embodiments.
In another aspect, a computer program product or computer program is provided, the computer program product or computer program comprising computer instructions stored in a computer readable storage medium. The processor of the computer device reads the computer instructions from the computer readable storage medium, and the processor executes the computer instructions to cause the computer device to execute the processing method of the event flow described in any of the above embodiments.
The beneficial effects brought by the technical scheme provided by the embodiment of the application at least comprise:
aiming at the node structure of the event process, a node-subtask refinement structure is designed, an atomic task is designed in the node for parallel processing, the method is suitable for various processes, and in the development process of different processes, the unified node-subtask can be used for personalized design, so that the code reuse rate can be improved while various different processes are met, and the parallel processing of the subtasks is only performed among the nodes, thereby reducing the process complexity and improving the execution efficiency of the processes.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
FIG. 1 is a schematic node structure diagram of an event flow provided by an exemplary embodiment of the present application;
FIG. 2 is a schematic illustration of an approval process provided by an exemplary embodiment of the present application;
FIG. 3 is a schematic illustration of an implementation environment provided by an exemplary embodiment of the present application;
FIG. 4 is a flow chart of a method for processing an event flow as provided by an exemplary embodiment of the present application;
FIG. 5 is a schematic diagram of a node transformation scheme provided based on the embodiment shown in FIG. 4;
FIG. 6 is a flow chart of a method for processing an event flow as provided by another exemplary embodiment of the present application;
FIG. 7 is a flowchart of a method for processing an event flow provided by another exemplary embodiment of the present application;
FIG. 8 is a schematic overall process diagram of a processing method of an event flow according to another exemplary embodiment of the present application;
FIG. 9 is a block diagram of an event flow processing device according to an exemplary embodiment of the present application;
FIG. 10 is a block diagram of an event flow processing device according to another exemplary embodiment of the present application;
fig. 11 is a block diagram of a server according to an exemplary embodiment of the present application.
Detailed Description
To make the objects, technical solutions and advantages of the present application more clear, embodiments of the present application will be described in further detail below with reference to the accompanying drawings.
First, terms referred to in the embodiments of the present application are briefly described:
and (3) event flow: the event flow is a structural task formed by steps which need to be executed step by step or in parallel in the implementation process of an event, and schematically, the event flow can be applied to application scenes such as a credit card application approval process, an insurance service approval process and the like, for example: in the credit card approval process, processes such as identity information confirmation, wind control information confirmation, manual approval and the like are involved, and aiming at the process, a set of codes (namely, a set of system is designed) needs to be set to meet the credit card approval process; when the credit cards of multiple banks are approved, the credit card approval processes of the multiple banks are not completely consistent, and the contents of the butted data interfaces and the like are not consistent, so that different systems need to be designed for different banks. However, in the embodiment of the present application, a set of node structures is designed with the goal of improving the code reuse rate and the research and development efficiency, so that subtasks are flexibly set in the node structures for different systems, and the flow execution efficiency and the accuracy are improved.
Fig. 1 is a schematic node structure diagram of an event flow provided in an exemplary embodiment of the present application, as shown in fig. 1, the event flow includes a start node 110, at least one flow node 120, and a stop node 130;
the initiating node 110 is an initial node of the event flow, that is, the event flow starts from the initiating node 110 and is executed to subsequent nodes. In some embodiments, the initiating node 110 includes only one node adjacent thereto, since the initiating node 110 is generally a node that does not actually perform a task and is only used to start an event flow. That is, after the event flow is started from the initiator node 110, the process node 120 adjacent to the initiator node 110 is executed first.
The process node 120 is configured to implement an actual task corresponding to the node, and in some embodiments, the process node 120 itself is implemented as a task node; alternatively, the flow node 120 includes at least two subtasks 121 therein.
Illustratively, taking a credit card approval process as an example, the process nodes 120 include a data query node, a variable computation node, a wind control decision node, a manual processing node, and the like, where the data query node includes: a personal information query subtask, an operator data query subtask, a blacklist query subtask, a whitelist query subtask, and the like.
When the flow node 120 includes at least two subtasks 121, the at least two subtasks 121 are in a parallel processing relationship, that is, the at least two subtasks 121 perform synchronous processing, in some embodiments, when the at least two subtasks 121 are processed completely and the processing result meets the processing requirement, a state flow action of the current flow node 120 is generated, and because the number of the flow nodes adjacent to the flow node 120 in the following may be 1 or more, the next flow node 120 to be processed after the current flow node 120 is executed may be determined based on the state flow action. Illustratively, in a node structure. The process node A is subsequently connected with a process node B and a process node C in an adjacent mode, wherein after the execution of the subtasks in the process node A is finished, a state flow action is generated and used for indicating the execution of the process node B after the process node A, so that the task of the process node B is continuously executed.
The termination node 130 is an end node of the event flow, that is, when the event flow is executed to the termination node 130, that is, it indicates that the event flow is completely executed, at least one flow node 120 is adjacent to the termination node 130, that is, when the flow node 120 adjacent to the termination node 130 is completely executed, a state flow node is generated, and the state flow node is used to instruct the flow to jump to the termination node 130 next, that is, it indicates that the current event flow is completely executed.
Schematically, taking an approval process as an example for explanation, fig. 2 is a schematic view of an approval process provided in an exemplary embodiment of the present application, as shown in fig. 2, the process includes:
an initiating node 210, a data querying node 220, a variable computing node 230, a wind control decision node 240, a data querying node 250, a wind control decision node 260, a manual processing node 270, a reject processing node 280, a pass processing node 290, and a terminating node 200.
The data query node 220 and the data query node 250 are mainly used for querying some stored data, wherein the data queried by the data query node 220 and the data queried by the data query node 250 are the same or different; the variable calculation node 230 is mainly used for performing variable calculation on the data obtained by query; the wind control decision node 240 and the wind control decision node 260 are used for matching the variable calculation result and the data obtained by query with a preset wind control condition so as to obtain a wind control analysis result, wherein the wind control modes executed by the wind control decision node 240 and the wind control decision node 260 are the same or different; the manual processing node 270 is used for manually implementing the auditing process; the reject processing node 280 is configured to reject the process approval; pass processing node 290 is used to pass process approval.
When the approval process is executed, the start node 210 is started first, that is, the start node 210 is initialized, so that tasks in the data query node 220 are processed based on the process nodes adjacent to the start node 210, and the processes are sequentially performed downwards.
Illustratively, taking the data query node 220 as an example for description, the data query node 220 includes an information query subtask 221, an operator query subtask 222, a blacklist query subtask 223, and a whitelist query subtask 224, that is, when the approval process is executed to the data query node 220, the four subtasks, that is, the information query subtask 221, the operator query subtask 222, the blacklist query subtask 223, and the whitelist query subtask 224, are processed in parallel.
Taking the pass-through processing node 290 as an example, the pass-through processing node 290 includes a client reach subtask 291, an associated system reach subtask 292, and a card number acquiring subtask 293, and when the approval process is executed to the pass-through processing node 290, the three subtasks, i.e., the client reach subtask 291, the associated system reach subtask 292, and the card number acquiring subtask 293, are processed in parallel.
It should be noted that the above flow nodes and subtasks are implemented by codes in the design of the event flow, that is, the relationships between the flow nodes, the subtasks included in the flow nodes, and the trigger conditions between the flow nodes are designed by writing the codes.
Fig. 3 is a schematic diagram of an implementation environment provided by an exemplary embodiment of the present application, as shown in fig. 3, the implementation environment includes a terminal 310 and a server 320, where the terminal 310 and the server 320 are connected through a communication network 330;
the terminal 310 is configured to display a process approval platform, where when the terminal 310 is implemented as an administrator terminal, platform content corresponding to an administrator in the process approval platform is displayed, where the administrator is configured to examine and check content in a process of process approval, and an administrator account is logged in the process approval platform in the terminal 310. When the terminal 310 is implemented as an application terminal, platform contents corresponding to a user in the process approval platform are displayed, wherein the user is used for filling contents to be approved through editing, uploading, shooting and the like.
In some embodiments, the server 320 is a server corresponding to the process approval platform and configured to execute each node in the approval process; that is, after the terminal 310 uploads the content to be approved to the server 320, the server 320 examines the content to be approved based on a pre-designed approval process, and feeds back an examination result to the terminal 310.
The device types of the terminal 310 include: at least one of a smartphone, a tablet, an e-book reader, an MP3 player, an MP4 player, a laptop portable computer, and a desktop computer. Those skilled in the art will appreciate that the number of terminals described above may be greater or fewer. For example, the number of the terminals may be only one, or several tens or hundreds of the terminals, or more. The number of terminals and the type of the device are not limited in the embodiments of the present application.
The server 320 may be one server, or a server cluster formed by multiple servers, or may be a physical server device, or may be a cloud server, which is not limited in this embodiment of the application.
The terminal 310 and the server 320 may be connected through a wired network or a wireless network, which is not limited in this embodiment of the present application.
With reference to the above, fig. 4 is a flowchart of a processing method of an event flow according to an exemplary embodiment of the present application, which is described by taking an example of applying the method to a server, and as shown in fig. 4, the method includes:
step 401, based on the node structure in the event flow, sequentially executing the node tasks of the flow nodes.
The event process comprises at least two process nodes, the at least two process nodes comprise target nodes, and the target nodes comprise at least two subtasks.
In some embodiments, the event flow further includes a start node, so that before executing the node task of the flow node, the start node in the event flow is initialized from the start node first, and after the initialization of the start node is completed, the execution of the node task is started from the flow node adjacent to the start node. The initialization of the start node is mainly to determine a processing node of a current event process as a start node, in some embodiments, some variables in the start node are assigned as default values, illustratively, the start node includes a process start variable, when the process start variable is assigned to be 1, it indicates that the process is not started, and when the start node is initialized, the assignment of the process start variable is changed from 1 to 0, thereby indicating that the event process is started.
In some embodiments, the node structure of the event flow is preset, that is, the sequence, association relationship, and logical relationship between the flow nodes in the event flow are preset. Optionally, the node structure of the event flow and the execution content of the flow node are set in the form of codes.
In some embodiments, one or more flow nodes are adjacent after the flow node a, and when one flow node is adjacent after the flow node a (e.g., the flow node B), it means that after the flow node a is executed, the flow node B is executed. When the number of the adjacent process nodes after the process node a is at least two (e.g., process node B and process node C), it means that after the process node a is executed, the process node to be executed by jumping is selected based on the different execution results of the process node a, such as: and after the execution of the flow node A is finished, when the execution result of the flow node A is a result B, skipping to execute the flow node B, and when the execution result of the flow node A is a result C, skipping to execute the flow node C.
Referring to fig. 5, schematically, a reject processing node 520 and a pass processing node 530 are adjacent to the wind control decision node 510, and according to the code logic, when the execution of the wind control decision node 510 is completed, and the execution result does not meet the wind control requirement, the reject processing node 520 is executed; after the execution of the wind control decision node 510 is completed, if the execution result meets the wind control requirement, the execution passes through the processing node 530.
In some embodiments, a subtask is included in a flow node; or, the flow node itself is implemented as a task. In the embodiment of the application, at least two process nodes include a target node, and the target node includes at least two subtasks, where the at least two subtasks are parallel subtasks, that is, the at least two subtasks are independent of each other and are processed in parallel, and the subtasks do not interfere with each other. Alternatively, the subtask may obtain a variable in the event flow, but may not modify the variable in the event flow. Illustratively, taking the approval process as an example for description, in the wind control matching subtask of the wind control decision node, the wind control matching subtask can read the annual salary variable set by the user in the approval process, but cannot modify the variable.
At step 402, at least two subtasks are processed in parallel in response to execution to a target node.
When the starting node starts to process the event flow, the nodes in the event flow are executed step by step, the target node is one of the nodes in the event flow, and when the previous node of the target node finishes executing and the state flow action after the previous node finishes executing is used for indicating to jump to the execution target node, the target node in the event flow is executed.
In some embodiments, since the target node includes at least two parallel subtasks, and the execution of the at least two subtasks does not interfere with each other, when the execution is confirmed to the target node, the execution of the at least two subtasks is triggered synchronously. Optionally, a corresponding number of processes are created based on the number of subtasks in the target node to execute the subtasks, wherein a single process is used for executing one of the subtasks; or creating a corresponding number of threads for executing the subtasks based on the number of the subtasks in the target node, wherein the process corresponds to the target node, the threads of the subtasks are threads created in the process, and a single thread is used for executing one of the subtasks.
Illustratively, when the process is executed to a target node, a process corresponding to the target node is created first, and the number of sub-tasks in the target node is determined, so that a corresponding number of threads are created in the process corresponding to the target node, and at least two sub-tasks are processed in parallel through the parallel threads.
Illustratively, the flow node a includes a subtask 1, a subtask 2, and a subtask 3, and when the flow node a is executed, a process corresponding to the flow node a is created to indicate each node task in the flow node a, where, because the flow node a includes three subtasks, 3 threads are created in the process corresponding to the flow node a, such as: thread k, thread q, and thread p, where subtask 1 is executed by thread k, subtask 2 is executed by thread q, and subtask 3 is executed by thread p. And the thread k, the thread q and the thread p are three parallel independent threads in the process, and no interference relationship exists among the threads.
In some embodiments, in the process of processing at least two subtasks in parallel, in response to the target subtask execution exception existing in the at least two subtasks, the target subtask is retried to execute at the granularity of the subtask, that is, the execution exception of the target subtask does not interfere with other subtasks, and only the target subtask needs to be retried to execute.
In some embodiments, the target node is retried for execution at the node granularity in response to the target node having an execution exception during execution to the target node. Illustratively, when the target node is abnormal in the process of summarizing the processing results of the subtasks, the target node is restarted to be executed, that is, at least two subtasks in the target node are restarted to be processed in parallel.
In some embodiments, when the target subtask among the at least two subtasks performs retry for a first preset number of times, skipping to a preset flow node for flow retry; or, when the execution retry times of the target node reach a second preset time, skipping to the preset flow node for flow retry. The first preset times and the second preset times are the same or different; the preset process node can be any node before the target node; or, presetting a flow node as a starting node; or, the preset process node is a node which is preset before the target node and is used for restarting the process.
And step 403, determining the state flow action of the target node based on the processing results of the at least two subtasks.
The state flow action is used to determine the node strike of the target node. In some embodiments, the state flow action is used for indicating the execution result of the target node, and the next executed flow node is determined based on the matching relationship between the execution result and the preset value.
Illustratively, a flow node B and a flow node C are adjacent to the flow node a, and after the execution of the subtask in the flow node a is completed, an execution result is output, so as to determine a state flow action based on the execution result, where in the preset matching relationship, when the state flow action indicates a section, the flow node B is continuously executed, and when the state flow action indicates a section, the flow node C is continuously executed.
The indication of the state flow action is determined by the processing result of the subtask in the flow node a, and a matching relationship exists between the processing result of the subtask and the indication of the state flow action, wherein the matching relationship is preset. Illustratively, the flow node a includes a subtask 1, a subtask 2, and a subtask 3, when the processing result of the subtask 1 is result a1, the processing result of the subtask 2 is B1, the processing result of the subtask 3 is c2, and the execution results of the corresponding flow node a are result a1, result B1, and result c2, the result a1, the result B1, and the result c2 are matched with a preset matching relationship, so that the state flow action obtained by matching is sectionb, and the flow node B is skipped to be executed.
It should be noted that the matching relationship between the execution result of the flow node and the state flow action, and the matching relationship between the processing result of the subtask and the state flow action are schematic examples, and the indication manner of the state flow action, the indication manner of the execution result of the flow node, and the indication manner of the processing result of the subtask are not limited in the embodiment of the present application.
And step 404, continuing to execute the node task in the event flow based on the state flow action until the event flow is ended.
Optionally, after the target node finishes executing, the node task of the next process node is continuously executed based on the generated state flow action. And executing the node task by taking the next node as a new target node until the event flow is executed to the termination node, thereby determining that the event flow is ended.
To sum up, the event flow processing method provided in the embodiment of the present application designs a node-subtask refinement structure for a node structure of an event flow, designs an atomic task in a node for parallel processing, and is suitable for multiple flows.
In some embodiments, fig. 6 is a flowchart of a method for processing an event flow provided in another exemplary embodiment of the present application, which is described by taking an example of applying the method to a server, and as shown in fig. 6, the method includes:
step 601, based on the node structure in the event flow, sequentially executing the node tasks of the flow nodes.
The event process comprises at least two process nodes, the at least two process nodes comprise target nodes, and the target nodes comprise at least two subtasks.
In some embodiments, the event flow further includes a start node, so that before executing the node task of the flow node, the start node in the event flow is initialized from the start node first, and after the initialization of the start node is completed, the execution of the node task is started from the flow node adjacent to the start node.
In some embodiments, the node structure of the event flow is preset, that is, the sequence, association relationship, and logical relationship between the flow nodes in the event flow are preset. Optionally, the node structure of the event flow and the execution content of the flow node are set in the form of codes.
Step 602, in response to executing to the target node, processing at least two subtasks in parallel.
When the starting node starts to process the event flow, the nodes in the event flow are executed step by step, the target node is one of the nodes in the event flow, and when the previous node of the target node finishes executing and the state flow action after the previous node finishes executing is used for indicating to jump to the execution target node, the target node in the event flow is executed.
In some embodiments, since the target node includes at least two parallel subtasks, and the execution of the at least two subtasks does not interfere with each other, when the execution is confirmed to the target node, the execution of the at least two subtasks is triggered synchronously.
Step 603, receiving transaction information submitted by at least two subtasks.
And the transaction information is submitted after the execution of the subtasks is finished. Optionally, the transaction information is used to indicate the processing result of the subtask. Illustratively, the transaction information is used to indicate whether the subtask is correctly processed; or, the transaction information is used to indicate a judgment result obtained after the subtask judges the data, and the like.
Step 604, in response to the transaction information meeting the transaction information requirement, determining a state flow action of the target node.
The state flow action is used to determine the node strike of the target node. In some embodiments, the state flow action is used for indicating the execution result of the target node, and the next executed flow node is determined based on the matching relationship between the execution result and the preset value.
In some embodiments, the contracted years of supply may comply with information content requirements with the information content of the transaction information, determine an amount of transaction information received, and in response to the transaction information matching the required amount corresponding to the subjob, determine a state flow action for the target node.
Optionally, the event flow is also correspondingly provided with a task management module, and the task management module corresponds to the whole event flow and is used for managing the completion condition of the node tasks in each flow node in the whole event flow; or the task management module corresponds to the target node and is used for managing the completion condition of each subtask in the target node. And after the subtasks are completed, submitting the transaction information to the task management module so as to collect the processing condition of the tasks, and when all the subtasks in the target node report the transaction information and the content of the transaction information meets the requirement of the transaction information, determining that the target node is completely executed, determining the next node to be processed, and generating a state flow action.
And step 605, continuing to execute the node task in the event flow based on the state flow action until the event flow is ended.
Optionally, after the target node finishes executing, the node task of the next process node is continuously executed based on the generated state flow action. And executing the node task by taking the next node as a new target node until the event flow is executed to the termination node, thereby determining that the event flow is ended.
Optionally, after the target node finishes executing, determining the existence of a next node corresponding to the node trend based on the state flow action; and responding to the existence of the next node of the target node, and performing subtask processing by taking the next node as the target node until the flow of the event flow is finished.
In some embodiments, when determining the existence of the next node of the target node, determining whether the next node of the target node is an empty node, when the next node of the target node is an empty node, determining that the next node is a termination node, that is, the event flow is ended, and when the next node of the target node is not an empty node, determining that the next node is an executable node. That is, the inclusion condition of the subtask in the next node of the target node is determined based on the state flow action, the next node of the target node is determined to be a null node in response to the next node of the target node not including the subtask, and the next node of the target node is determined to exist in response to the next node of the target node including the subtask.
To sum up, the event flow processing method provided in the embodiment of the present application designs a node-subtask refinement structure for a node structure of an event flow, designs an atomic task in a node for parallel processing, and is suitable for multiple flows.
According to the method provided by the embodiment, the processing result of the subtask is determined by receiving the transaction information fed back by the at least two subtasks, so that the execution node of the target node is determined based on the processing result of the subtask, and further a state flow action is generated to execute the node task on the next node, thereby improving the execution efficiency and accuracy of the node task.
In some embodiments, when performing the event flow, the node structure needs to be checked first. Fig. 7 is a flowchart of a processing method of a offer event flow according to another exemplary embodiment of the present application, which is described by taking the method as an example for being applied to a server, and as shown in fig. 7, the method includes:
step 701, performing validity check on the node structure based on the flow chart of the event flow.
In some embodiments, the validity check includes checking the start node, checking the end node, checking the node logic between the flow nodes, and the like.
Illustratively, the validity check includes at least one of the following:
firstly, confirming the number of nodes adjacent to a starting node in an event flow based on a flow chart of the event flow, and determining that the node structure passes verification in response to the fact that the number of the nodes adjacent to the starting node meets the number requirement.
In some embodiments, since the initiating node itself does not have an actual node task, and is only used to handle the initiation of the event flow, there should be only a single flow node adjacent to the initiating node; or, in other embodiments, the start node itself needs to control the flow direction, and there are at least two flow nodes adjacent to the start node, such as: and executing a process node A after the node is started for the process of the user in the youth stage, and executing a process node B after the node is started for the process of the user in the middle-aged stage.
Secondly, confirming the nodes adjacent to the termination node in the event flow based on the flow chart of the event flow, and determining that the node structure passes the check in response to the fact that the flow nodes arranged behind the termination node do not exist in the flow nodes adjacent to the termination node.
In some embodiments, the termination node is used to indicate the termination of the event flow, i.e. when executing to the termination node, it indicates that the event flow has been executed and is therefore required to be implemented as the last node in the event flow, and the termination node cannot be followed by other flow nodes.
In response to the node structure check passing, the start node of the event flow is initialized, step 702.
The starting node is located at the initial position of the node structure, and the starting node is used for determining the node position of the starting time process.
In some embodiments, in response to the node structure check failing, the flow ends.
And 703, sequentially executing the node tasks of the process nodes based on the node structure in the event process.
The event process comprises at least two process nodes, the at least two process nodes comprise target nodes, and the target nodes comprise at least two subtasks.
In some embodiments, the event flow further includes a start node, so that before executing the node task of the flow node, the start node in the event flow is initialized from the start node first, and after the initialization of the start node is completed, the execution of the node task is started from the flow node adjacent to the start node.
In some embodiments, the node structure of the event flow is preset, that is, the sequence, association relationship, and logical relationship between the flow nodes in the event flow are preset. Optionally, the node structure of the event flow and the execution content of the flow node are set in the form of codes.
Step 704, in response to executing to the target node, processing at least two subtasks in parallel.
When the starting node starts to process the event flow, the nodes in the event flow are executed step by step, the target node is one of the nodes in the event flow, and when the previous node of the target node finishes executing and the state flow action after the previous node finishes executing is used for indicating to jump to the execution target node, the target node in the event flow is executed.
In some embodiments, since the target node includes at least two parallel subtasks, and the execution of the at least two subtasks does not interfere with each other, when the execution is confirmed to the target node, the execution of the at least two subtasks is triggered synchronously.
Step 705, determining the state flow action of the target node based on the processing results of the at least two subtasks.
The state flow action is used to determine the node strike of the target node. In some embodiments, the state flow action is used for indicating the execution result of the target node, and the next executed flow node is determined based on the matching relationship between the execution result and the preset value.
And step 706, continuing to execute the node task in the event flow based on the state flow action until the event flow is finished.
Optionally, after the target node finishes executing, the node task of the next process node is continuously executed based on the generated state flow action. And executing the node task by taking the next node as a new target node until the event flow is executed to the termination node, thereby determining that the event flow is ended.
To sum up, the event flow processing method provided in the embodiment of the present application designs a node-subtask refinement structure for a node structure of an event flow, designs an atomic task in a node for parallel processing, and is suitable for multiple flows.
The method provided by the embodiment guides a user to split the service into the minimum granularity from the design so as to improve the code reuse rate, naturally supports intra-node concurrency, gives consideration to the service expression of the code and the flow chart on the basis of improving the performance, and reduces the influence caused by the abnormality as much as possible by the micro-transaction.
Fig. 8 is a schematic overall process diagram of a processing method of an event flow according to another exemplary embodiment of the present application, and as shown in fig. 8, the process includes:
step 801, start the process.
Step 802, the flowchart checks for legitimacy.
Optionally, when the process is started, the validity of the flowchart is checked, for example: the start node can only connect one node, no adjacent node can exist after the end node, and the like.
Step 803, initialize the boot node.
That is, the initialization initial node is the current boot-up node.
Step 804, determine whether there is a next node.
Optionally, it is determined whether a next node of the flow is an empty node. When the next node is a null node, it indicates that the next node is a termination node, i.e., the process is ended, and when the next node is not a null node, i.e., an executable node, the node action is executed.
In some embodiments, the initiating node and the terminating node are nodes implemented inside the system, and the other nodes are nodes customized by the developer.
When there is a next node, a node action is performed, step 805.
Step 806, concurrently executing the node subtasks.
In some embodiments, the subtasks are executed in parallel, and the subtasks do not interfere with each other; the subtask can obtain the variable of the event flow, but can not modify the variable. And submitting the transaction after the single subtask is executed. And the task management module monitors the execution state of the subtasks, and executes the next step after all the subtasks are completed.
At step 807, a state flow action is performed.
The state flow action is generated according to the execution result of the subtask and is used for indicating the flow trend of the event flow.
In step 808, when there is no next node, the process ends.
To sum up, the event flow processing method provided in the embodiment of the present application designs a node-subtask refinement structure for a node structure of an event flow, designs an atomic task in a node for parallel processing, and is suitable for multiple flows.
Fig. 9 is a block diagram of a processing apparatus for processing an event flow according to an exemplary embodiment of the present application, where as shown in fig. 9, the apparatus includes:
an execution module 910, configured to sequentially execute node tasks of process nodes based on a node structure in an event process, where the event process includes at least two process nodes, where the at least two process nodes include a target node, and the target node includes at least two subtasks; in response to execution to the target node, processing the at least two subtasks in parallel;
a determining module 920, configured to determine a state transition action of the target node based on processing results of the at least two subtasks, where the state transition action is used to determine a node trend of the target node;
the executing module 910 is further configured to continue to execute the node task in the event flow based on the state flow action until the flow of the event flow is ended.
In an alternative embodiment, as shown in fig. 10, the determining module 920 includes:
a receiving unit 921, configured to receive transaction information submitted by the at least two subtasks, where the transaction information is submitted after the execution of the subtasks is completed;
the determining unit 922 is configured to determine a state transition action of the target node in response to that the transaction information meets the transaction information requirement.
In an optional embodiment, the determining unit 922 is further configured to determine the number of the received transaction messages in response to that the information content of the transaction messages meets the information content requirement;
the determining unit 922 is further configured to determine a state transition action of the target node in response to that the number of the received transaction information matches the required number corresponding to the subtask.
In an optional embodiment, the determining module 920 is further configured to determine the existence of a node next to the target node corresponding to the node trend based on the state flow action; and responding to the existence of the next node of the target node, and determining the next node as the target node to perform sub-task processing until the flow of the event flow is finished.
In an optional embodiment, the determining module 920 is further configured to determine, based on the state flow action, an inclusion of a subtask in a next node of the target node;
the determining module 920 is further configured to determine, in response to that the next node of the target node does not include the subtask, that the next node of the target node is an empty node; and responding to the next node of the target node containing the subtask, and determining that the next node of the target node exists.
In an optional embodiment, the execution module 910 is further configured to perform, in the process of processing the at least two subtasks in parallel, an execution retry on a target subtask at a granularity of the subtask in response to an execution exception of the target subtask existing in the at least two subtasks.
In an optional embodiment, the executing module 910 is further configured to perform, in response to the target node having an execution exception during the execution to the target node, an execution retry on the target node at a node granularity.
In an optional embodiment, the apparatus further comprises:
a checking module 930, configured to perform validity checking on the node structure based on the flow chart of the event flow;
the executing module 910 is further configured to initialize a starting node of the event procedure in response to the node structure passing verification, where the starting node is a node located at an initial position of the node structure, and the starting node is configured to determine a node position for starting the event procedure.
In an optional embodiment, the checking module 930 is further configured to determine, based on the flow chart of the event flow, the number of nodes adjacent to the initiating node in the event flow;
the determining module 920 is further configured to determine that the node structure passes the check in response to that the number of nodes adjacent to the initiating node meets a number requirement.
In an optional embodiment, the checking module 930 is further configured to, based on the flow chart of the event flow, confirm a node adjacent to the terminating node in the event flow;
the determining module 920 is further configured to determine that the node structure passes the check in response to that, in the process nodes adjacent to the termination node, there is no process node arranged after the termination node.
To sum up, the event flow processing apparatus provided in the embodiment of the present application designs a node-subtask refinement structure for a node structure of an event flow, designs an atomic task in a node for parallel processing, and is suitable for multiple flows.
It should be noted that: the event flow processing apparatus provided in the foregoing embodiment is only illustrated by dividing the functional modules, and in practical applications, the functions may be distributed by different functional modules according to needs, that is, the internal structure of the device may be divided into different functional modules to complete all or part of the functions described above. In addition, the event flow processing apparatus provided in the foregoing embodiment has the same concept as the event flow processing method embodiment, and specific implementation processes thereof are described in the method embodiment and are not described herein again.
Fig. 11 shows a schematic structural diagram of a server according to an exemplary embodiment of the present application. Specifically, the method comprises the following steps:
the server 1100 includes a Central Processing Unit (CPU) 1101, a system Memory 1104 including a Random Access Memory (RAM) 1102 and a Read Only Memory (ROM) 1103, and a system bus 1105 connecting the system Memory 1104 and the Central Processing Unit 1101. The server 1100 also includes a mass storage device 1106 for storing an operating system 1113, application programs 1114, and other program modules 1115.
The mass storage device 1106 is connected to the central processing unit 1101 through a mass storage controller (not shown) connected to the system bus 1105. The mass storage device 1106 and its associated computer-readable media provide non-volatile storage for the server 1100. That is, mass storage device 1106 may include a computer-readable medium (not shown) such as a hard disk or Compact disk Read Only Memory (CD-ROM) drive.
Without loss of generality, computer readable media may comprise computer storage media and communication media. Computer storage media includes volatile and nonvolatile, removable and non-removable media implemented in any method or technology for storage of information such as computer readable instructions, data structures, program modules or other data. Computer storage media includes RAM, ROM, Erasable Programmable Read-Only Memory (EPROM), Electrically Erasable Programmable Read-Only Memory (EEPROM), flash Memory or other solid state Memory technology, CD-ROM, Digital Versatile Disks (DVD), or other optical storage, magnetic cassettes, magnetic tape, magnetic disk storage, or other magnetic storage devices. Of course, those skilled in the art will appreciate that computer storage media is not limited to the foregoing. The system memory 1104 and mass storage device 1106 described above may collectively be referred to as memory.
The server 1100 may also operate in accordance with various embodiments of the application through remote computers connected to a network, such as the internet. That is, the server 1100 may connect to the network 1112 through the network interface unit 1111 that is coupled to the system bus 1105, or may connect to other types of networks or remote computer systems (not shown) using the network interface unit 1111.
The memory further includes one or more programs, and the one or more programs are stored in the memory and configured to be executed by the CPU.
The present application provides a computer-readable storage medium, in which at least one instruction is stored, and the at least one instruction is loaded and executed by the processor to implement the event flow processing method provided by the above-mentioned method embodiments.
The present application also provides a computer program product or computer program comprising computer instructions stored in a computer readable storage medium. The processor of the computer device reads the computer instructions from the computer readable storage medium, and the processor executes the computer instructions to cause the computer device to execute the processing method of the event flow described in any of the above embodiments.
The above-mentioned serial numbers of the embodiments of the present application are merely for description and do not represent the merits of the embodiments.
It will be understood by those skilled in the art that all or part of the steps for implementing the above embodiments may be implemented by hardware, or may be implemented by a program instructing relevant hardware, where the program may be stored in a computer-readable storage medium, and the above-mentioned storage medium may be a read-only memory, a magnetic disk or an optical disk, etc.
The above description is only exemplary of the present application and should not be taken as limiting, as any modification, equivalent replacement, or improvement made within the spirit and principle of the present application should be included in the protection scope of the present application.

Claims (15)

1. A method for processing an event flow, the method comprising:
sequentially executing node tasks of process nodes based on a node structure in an event process, wherein the event process comprises at least two process nodes, the at least two process nodes comprise target nodes, and the target nodes comprise at least two subtasks;
in response to execution to the target node, processing the at least two subtasks in parallel;
determining a state flow action of the target node based on the processing results of the at least two subtasks, wherein the state flow action is used for determining the node trend of the target node;
and continuing to execute the node task in the event flow based on the state flow action until the flow of the event flow is finished.
2. The method according to claim 1, wherein the determining the state flow action of the target node based on the processing results of the at least two subtasks comprises:
receiving transaction information submitted by the at least two subtasks, wherein the transaction information is submitted after the execution of the subtasks is finished;
and determining the state flow action of the target node in response to the transaction information meeting the transaction information requirement.
3. The method of claim 2, wherein the determining the state flow action of the target node in response to the transaction information meeting a transaction information requirement comprises:
in response to the information content of the transaction information meeting the information content requirement, determining the number of the received transaction information;
and determining the state flow action of the target node in response to the fact that the number of the received transaction information is matched with the required number corresponding to the subtasks.
4. The method according to any one of claims 1 to 3, wherein the continuing to execute the node task in the event flow based on the state flow action until the flow of the event flow is finished comprises:
determining a presence of a next node of the target node corresponding to the node strike based on the state flow action;
and responding to the existence of the next node of the target node, and determining the next node as the target node to perform sub-task processing until the flow of the event flow is finished.
5. The method of claim 4, wherein the determining the presence of a next node to the target node corresponding to the node walk based on the state flow action comprises:
determining the inclusion condition of a subtask in the next node of the target node based on the state flow action;
determining that a next node of the target node is a null node in response to the next node of the target node not including the subtask;
and responding to the next node of the target node containing the subtask, and determining that the next node of the target node exists.
6. A method according to any of claims 1 to 3, wherein said parallel processing of said at least two subtasks comprises;
and in the process of processing the at least two subtasks in parallel, responding to the target subtask execution exception in the at least two subtasks, and executing retry on the target subtask at the granularity of the subtask.
7. The method of any of claims 1 to 3, further comprising:
in the process of executing to the target node, responding to the target node that the execution exception exists, and executing retry to the target node at node granularity.
8. The method according to any one of claims 1 to 3, wherein before sequentially executing node tasks based on the node structure in the event flow, the method further comprises:
carrying out validity check on the node structure based on the flow chart of the event flow;
and responding to the passing of the verification of the node structure, initializing a starting node of the event process, wherein the starting node is a node located at the initial position of the node structure, and the starting node is used for determining the position of the node for starting the event process.
9. The method of claim 8, wherein the checking the validity of the node structure based on the flow chart of the event flow comprises:
confirming the number of nodes adjacent to the starting node in the event flow based on the flow chart of the event flow;
and determining that the node structure passes the check in response to the number of nodes adjacent to the initiating node meeting a number requirement.
10. The method of claim 8, wherein the checking the validity of the node structure based on the flow chart of the event flow comprises:
confirming a node adjacent to a termination node in the event flow based on the flow chart of the event flow;
and determining that the node structure passes the check in response to the fact that no flow node arranged after the termination node exists in the flow nodes adjacent to the termination node.
11. An event flow processing apparatus, characterized in that the apparatus comprises:
the system comprises an execution module, a task execution module and a task execution module, wherein the execution module is used for sequentially executing node tasks of process nodes based on a node structure in an event process, the event process comprises at least two process nodes, the at least two process nodes comprise target nodes, and the target nodes comprise at least two subtasks; in response to execution to the target node, processing the at least two subtasks in parallel;
a determining module, configured to determine a state flow action of the target node based on processing results of the at least two subtasks, where the state flow action is used to determine a node trend of the target node;
the execution module is further configured to continue to execute the node task in the event flow based on the state flow action until the flow of the event flow is ended.
12. The apparatus of claim 11, wherein the determining module comprises:
a receiving unit, configured to receive transaction information submitted by the at least two subtasks, where the transaction information is submitted after the execution of the subtasks is completed;
and the determining unit is used for determining the state flow action of the target node in response to the fact that the transaction information meets the transaction information requirement.
13. The apparatus of claim 12, wherein the determining unit is further configured to determine the amount of the transaction information received in response to an information content of the transaction information meeting an information content requirement;
the determining unit is further configured to determine a state flow action of the target node in response to that the number of the received transaction information matches the required number corresponding to the subtask.
14. A computer device comprising a processor and a memory, the memory having stored therein at least one instruction, at least one program, set of codes or set of instructions, which is loaded and executed by the processor to implement a method of processing an event flow according to any one of claims 1 to 10.
15. A computer readable storage medium having stored therein at least one instruction, at least one program, a set of codes, or a set of instructions, which is loaded and executed by a processor to implement a method of processing an event flow according to any one of claims 1 to 10.
CN202011613704.8A 2020-12-30 2020-12-30 Event flow processing method, device and equipment and readable storage medium Pending CN112732367A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011613704.8A CN112732367A (en) 2020-12-30 2020-12-30 Event flow processing method, device and equipment and readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011613704.8A CN112732367A (en) 2020-12-30 2020-12-30 Event flow processing method, device and equipment and readable storage medium

Publications (1)

Publication Number Publication Date
CN112732367A true CN112732367A (en) 2021-04-30

Family

ID=75611260

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011613704.8A Pending CN112732367A (en) 2020-12-30 2020-12-30 Event flow processing method, device and equipment and readable storage medium

Country Status (1)

Country Link
CN (1) CN112732367A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113377371A (en) * 2021-06-02 2021-09-10 五八到家有限公司 Multi-scene configuration method, system, device and medium

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113377371A (en) * 2021-06-02 2021-09-10 五八到家有限公司 Multi-scene configuration method, system, device and medium

Similar Documents

Publication Publication Date Title
CN108595157B (en) Block chain data processing method, device, equipment and storage medium
CN108681565B (en) Block chain data parallel processing method, device, equipment and storage medium
US11036491B1 (en) Identifying and resolving firmware component dependencies
US8869111B2 (en) Method and system for generating test cases for a software application
CN108319575B (en) Page component checking method, device, server and storage medium
US10025630B2 (en) Operating programs on a computer cluster
CN104067276A (en) Client-side minimal download and simulated page navigation features
CN111598575B (en) Business process control method, business process control device, electronic equipment and readable storage medium
US20160321069A1 (en) Effective feature location in large legacy systems
CN110688111A (en) Configuration method, device, server and storage medium of business process
CN113330419A (en) Equipment application installation method and device
CN109445800B (en) Version automatic deployment method and system based on distributed system
CN112732367A (en) Event flow processing method, device and equipment and readable storage medium
CN110806891B (en) Method and device for generating software version of embedded device
CN107644041B (en) Policy settlement processing method and device
CN112256444A (en) DAG-based business processing method and device, server and storage medium
CN113918345A (en) Capacity calculation method and device for configuration hardware, computer equipment and medium
CN113506035A (en) Method, device and equipment for determining approval process
CN111090638A (en) Method and device for comparing transaction functions in database migration
CN112379973A (en) Heavy loading method and device
KR102610920B1 (en) Method and apparatus for managing modules
CN114880157B (en) Fault injection method and device
CN113127548B (en) File merging method, device, equipment and storage medium
US20230259347A1 (en) Container based generation of inputs for generic functions
CN109871231B (en) Code sharing method and system

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination