CN117114613A - Flow engine, method, equipment and program product for business flow control - Google Patents

Flow engine, method, equipment and program product for business flow control Download PDF

Info

Publication number
CN117114613A
CN117114613A CN202311075520.4A CN202311075520A CN117114613A CN 117114613 A CN117114613 A CN 117114613A CN 202311075520 A CN202311075520 A CN 202311075520A CN 117114613 A CN117114613 A CN 117114613A
Authority
CN
China
Prior art keywords
service
event
layer
target
action
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
CN202311075520.4A
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 Jidu Technology Co Ltd
Original Assignee
Beijing Jidu 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 Jidu Technology Co Ltd filed Critical Beijing Jidu Technology Co Ltd
Priority to CN202311075520.4A priority Critical patent/CN117114613A/en
Publication of CN117114613A publication Critical patent/CN117114613A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q10/00Administration; Management
    • G06Q10/10Office automation; Time management
    • G06Q10/103Workflow collaboration or project management
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/25Integrating or interfacing systems involving database management systems
    • G06F16/252Integrating or interfacing systems involving database management systems between a Database Management System and a front-end application
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q10/00Administration; Management
    • G06Q10/06Resources, workflows, human or project management; Enterprise or organisation planning; Enterprise or organisation modelling
    • G06Q10/063Operations research, analysis or management
    • G06Q10/0633Workflow analysis

Landscapes

  • Engineering & Computer Science (AREA)
  • Business, Economics & Management (AREA)
  • Human Resources & Organizations (AREA)
  • Strategic Management (AREA)
  • Entrepreneurship & Innovation (AREA)
  • Theoretical Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Economics (AREA)
  • General Physics & Mathematics (AREA)
  • Physics & Mathematics (AREA)
  • Tourism & Hospitality (AREA)
  • Quality & Reliability (AREA)
  • General Business, Economics & Management (AREA)
  • Operations Research (AREA)
  • Marketing (AREA)
  • Data Mining & Analysis (AREA)
  • Development Economics (AREA)
  • Educational Administration (AREA)
  • Game Theory and Decision Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

The application relates to the technical field of business management, in particular to a flow engine, a method, equipment and a program product for controlling business flow, which comprise the following steps: the capability layer is used for responding to the execution instruction of the target service, determining service information corresponding to the target service based on the service identification of the target service, and sending the service information to the event layer; the event layer is used for receiving the service information sent by the capability layer and realizing flow control for the target service based on the service information; when determining that the execution condition of the target action is met in the process of executing each event, generating calling information and sending the calling information to an action layer; the action layer is used for receiving the calling information sent by the event layer and executing a target action corresponding to the calling information; and feeding back an execution result of the target action to an event layer so that the event layer continuously executes a flow corresponding to the event, thereby reducing the difficulty of system development and maintenance and improving the reusability of service logic codes in the service flow control process.

Description

Flow engine, method, equipment and program product for business flow control
Technical Field
The present application relates to the field of business management technologies, and in particular, to a flow engine, a method, an apparatus, and a program product for controlling a business flow.
Background
With the complexity of the business process, there are various data states, processing actions, etc., for example, in the order cancellation business: the order state is in a refund state, and the actions such as order fund original return, order log recording and the like are needed to be carried out. In the related art, in order to improve the readability, maintainability, and extensibility of a business operation and maintenance process, a model-view-controller, or a state machine software system is often used to implement business process control.
In order to be able to perform a specific business action in an application scenario, the model-view-controller architecture couples the business action and the flow control, but if the flow control is to be modified, it may need to be adjusted to adapt to the new flow control, for example, for a scenario where the station jumps on the ground, the business action is to be raised by 1 meter (up to 1 meter), if the scenario is modified to jump on a slope 0.5 meter from the ground, the business action needs to be raised by 0.5 meter to adapt to the new flow control, which increases the difficulty of system development and maintenance; and the state machine code has weak modularization capability, so that the code reusability is low, and repetition or redundant logic is easy to occur.
Therefore, how to reduce the difficulty of system development and maintenance and improve the reusability of service logic codes is needed to be solved.
Disclosure of Invention
The embodiment of the application provides a flow engine, a method, equipment and a program product for controlling a business flow, which can reduce the difficulty of system development and maintenance and improve the reusability of business logic codes in the process of controlling the business flow.
In one aspect, an embodiment of the present application provides a flow engine for controlling a business flow, where the flow engine includes: capability layer, event layer and action layer;
the capability layer is used for responding to an execution instruction of a target service, determining service information corresponding to the target service based on a service identifier of the target service, and sending the service information to the event layer, wherein the service information comprises at least one event to be executed corresponding to the target service;
the event layer is used for receiving the service information sent by the capability layer and realizing flow control for the target service based on the event contained in the service information; in the process of executing each event, determining that the execution condition of a target action is met, generating calling information and sending the calling information to the action layer, wherein the calling information carries an event identifier of the event and an action identifier of the target action, and the target action is an action required to be executed for completing the event;
The action layer is used for receiving the calling information sent by the event layer and executing target actions corresponding to the event identifications and the action identifications in the calling information; and feeding back an execution result of the target action to the event layer so that the event layer continues to execute a flow corresponding to the event.
In one aspect, an embodiment of the present application provides a method for controlling a business process, which is applied to a process engine, where the process engine includes: capability layer, event layer and action layer; the method comprises the following steps:
responding to an execution instruction of a target service through the capability layer, determining service information corresponding to the target service based on a service identifier of the target service, and sending the service information to an event layer, wherein the service information comprises at least one event to be executed corresponding to the target service;
receiving service information sent by the capability layer through the event layer, and realizing flow control for the target service based on an event contained in the service information; in the process of executing each event, determining that the execution condition of a target action is met, generating calling information and sending the calling information to the action layer, wherein the calling information carries an event identifier of the event and an action identifier of the target action, and the target action is an action required to be executed for completing the event;
Receiving call information sent by the event layer through the action layer, and executing target actions corresponding to event identifications and action identifications in the call information; and feeding back an execution result of the target action to the event layer so that the event layer continues to execute a flow corresponding to the event.
Optionally, the executing instruction of the response target service through the capability layer includes:
responding to an execution instruction aiming at the target service, which is triggered based on a display interface;
and responding to the execution instruction aiming at the target service, wherein the execution instruction is triggered when the execution time arrives.
Optionally, after executing the event included in the service information through the event layer, the method further includes:
after all the events corresponding to the target service are determined to be executed through the event layer, generating a target service state representing the completion of the service;
and the event layer is used for associating the target service state with the service identifier and then sending the service identifier to the capability layer so that the capability layer can determine that the target service is in a completion state.
Optionally, before determining, by the capability layer, service information corresponding to the target service based on the service identifier of the target service, the method further includes:
And querying, by the capability layer, a target service state representing that the service is completed based on the service identifier of the target service, and determining that the target service state is not queried.
Optionally, after responding to the execution instruction of the target service through the capability layer, the method further includes:
if at least one other execution instruction is responded within a preset time period, locking the target object corresponding to the target service through the capability layer, so as to serially execute service flows of the service corresponding to a plurality of execution instructions related to the target object; the other instructions are other execution instructions of the target service or execution instructions of other services related to the target object.
Optionally, the determining that the execution condition of the target action is met includes:
if the event layer determines that the target object corresponding to the target service is in a target state, determining that the execution condition of the target action is met; or if the order of executing the target actions is determined to be reached through the event layer, determining that the execution conditions of the target actions are met.
Optionally, the executing the event included in the service information includes:
And if the service information contains a plurality of events, sequentially executing the plurality of events based on the event execution sequence contained in the service information through the event layer.
In one aspect, an embodiment of the present application provides a device for controlling a business process, where the device includes:
a processor and a memory; the memory is connected with the processor, and the memory stores a computer program, and when the computer program is executed by the processor, the processor is used for executing the method for controlling the business process.
In one aspect, embodiments of the present application provide a computer program product comprising a computer program which, when executed by a processor, implements a method for business process control as described above.
Alternatively, the computer readable storage medium may be implemented as a computer program product, i.e. embodiments of the present application also provide a computer readable storage medium comprising a computer program which, when executed by a processor, implements a method of controlling a business process as described above.
The beneficial effects of the application are as follows:
the flow engine provided by the embodiment of the application comprises a capability layer so as to conveniently interact with a user, an event layer and an action layer are distinguished so as to conveniently decouple flow control (event) from business logic (action), when the code of the flow control is modified, the code of the modified flow control can be adapted without modifying the business logic code, and only the proper action is required to be called from the action layer; in addition, the flow engine provided by the embodiment of the application only comprises a capability layer, an event layer and an action layer, is simpler than the architecture of a workflow engine (comprising a flow definer, a flow executor, a service scheduler, an event monitor and a data storage), so that the operation efficiency is higher when the service flow control is realized.
Additional features and advantages of the application will be set forth in the description which follows, and in part will be obvious from the description, or may be learned by practice of the application. The objectives and other advantages of the application will be realized and attained by the structure particularly pointed out in the written description and claims thereof as well as the appended drawings.
Drawings
Fig. 1 is a schematic application scenario diagram of a business process control method according to an embodiment of the present application;
fig. 2 is a flow chart of a business flow control method according to an embodiment of the present application;
FIG. 3 is a schematic diagram of a display interface according to an embodiment of the present application;
FIG. 4 is a schematic diagram of a functional module of a process engine according to an embodiment of the present application;
fig. 5 is a schematic diagram of a specific flow of a target service according to an embodiment of the present application;
fig. 6 is a schematic diagram of a business process control device according to an embodiment of the present application.
Detailed Description
For the purpose of making the objects, technical solutions and advantages of the present application more apparent, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present application, and it is apparent that the described embodiments are only some embodiments of the present application, not all embodiments of the present application. All other embodiments, which can be made by those skilled in the art based on the embodiments of the application without making any inventive effort, are intended to be within the scope of the application. Embodiments of the application and features of the embodiments may be combined with one another arbitrarily without conflict. Also, while a logical order of illustration is depicted in the flowchart, in some cases the steps shown or described may be performed in a different order than presented.
Some of the concepts involved in the embodiments of the present application are described below.
Model-View-Controller (MVC) architecture: the MVC architecture in Java is a common software design pattern for building Web applications. This mode divides the application into three main components: models (models), views (views), and controllers (controllers), each component has its own unique responsibilities and functions.
Model (Model): the model is the core of the application program and is responsible for processing the storage, retrieval and operation of data. It does not interact directly with the user, but is operated by the controller to update and manage.
View (View): the view is responsible for presenting data and providing a user interface. They may be in different formats such as HTML, JSP, XML. The view obtains data from the model and presents it to the user.
Controller (Controller): the controller is responsible for processing user requests and responding. It takes user input from the view and passes it to the model for processing. Once the model has completed processing, the controller passes the data from the model back to the view for presentation.
State machine: the state machine design mode is a commonly used software design mode for managing state transitions of objects. It separates the behavior and state of an object, defines the state of an object as a set of discrete states, and specifies the behavior of an object in different states. The state machine design model includes the following components:
State (State): a state is a state in which an object is located and includes a set of related properties and behaviors. In the state machine design mode, the states are discrete, i.e., discontinuous between states. Each state has some predefined behavior.
State Transition (Transition): state transition refers to a transition from one state to another. The transition may be triggered by an event inside the object or by an external event. A state transition may be defined as a set of conditions that, when satisfied, allow an object to transition from a current state to a next state.
Action (Action): an action is an operation performed during a state transition. The actions may include preconditions for state transitions, behavior upon entering a state, and behavior upon exiting a state.
Context (Context): context refers to the environment of the current object. Implementation of a state machine design schema typically includes a context object that contains the state of the state machine and the behavior in the current state.
Workflow engine: the workflow engine architecture is a software architecture for building and managing complex business processes. By abstracting the business logic into a configurable flow, the execution of the business flow is more controllable and reusable. The workflow engine includes the following components:
Flow definer (Process Definition): the flow definer is used for defining the elements of activities, sequences, conditions, participants and the like in the business flow and storing the elements in the flow definition library. The flow definer may use various tools such as a flow chart designer, an XML editor, and the like.
Process Executor (Process Executor): the flow executor is responsible for executing the flow definitions in the flow definition library. It reads the flow definition and performs each activity in the defined order of activities until the flow ends or an exception occurs.
Service Scheduler (Task Scheduler): the service scheduler is responsible for distributing the service to the participants and monitoring the execution of the service. The traffic scheduler may use various algorithms such as round robin, earliest deadline first, shortest deadline first, etc.
Event Listener (Event Listener): the event listener is used to capture and process events such as traffic assignments, traffic completions, exception handling, etc. It may log the event or trigger other events.
Data Store (Data Store): the data memory is used for storing business data and flow states. It may use various storage techniques such as databases, caches, message queues, etc.
The flow engine: the software system for realizing the business process control comprises a capability layer, an event layer and an action layer. The capability layer is used for receiving a service request sent by the client and determining service information corresponding to the service request; the event layer is used for receiving the service information sent by the capability layer, executing an event in the service information, generating calling information when determining a condition for triggering execution of a target action, and sending the calling information to the action layer, wherein the calling information carries an event identifier of the event and an action identifier of the target action; the action layer receives the calling information sent by the event layer and executes the target action corresponding to the event identifier and the action identifier in the calling information.
Service information: carrying a service identifier; the service information comprises at least one event to be executed corresponding to the service, and if the event comprises a plurality of events, the service information also comprises the execution sequence of the event. The setting of the service information can enable the event layer to definitely determine the event to be executed corresponding to the target service.
Calling information: carrying a target action identifier, which is generated when the target action execution condition is met; the generation of call information can cause the action layer to explicitly require actions to be performed.
Target traffic state: the method is generated after all the events corresponding to the target service are executed, and the target service state is the service flow execution completion of the target service.
And (3) locking: the method is a method for locking a distributed system based on storage (Redis), and the working principle is that a Lua script of the Redis is used, so that a processed request can realize distributed mutual exclusion by using the Redis, even if concurrent business processes are executed in series.
The preferred embodiments of the present application will be described below with reference to the accompanying drawings of the specification, it being understood that the preferred embodiments described herein are for illustration and explanation only, and not for limitation of the present application, and embodiments of the present application and features of the embodiments may be combined with each other without conflict.
Fig. 1 is an application scenario of a business process control method according to an embodiment of the present application, where the application scenario includes: a network 10, a server 20, at least one client (installed on the terminal device 30_1, the terminal device 30_2, the terminal device 30_3 shown in fig. 1), and a database 40. The server 20 is a background server corresponding to software, a web page, an applet, or the like, or a server dedicated to performing business process control, and the application is not limited in particular. The server 20 may be an independent physical server, a server cluster or a distributed system formed by a plurality of physical servers, or a cloud server providing cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, content delivery networks (Content Delivery Network, CDN), basic cloud computing services such as big data and artificial intelligent platforms, and the like; the database 40 stores programs and data of the business process control method; the server 20 and the terminal device communicate via the network 10; the terminal equipment comprises, but is not limited to, mobile phones, tablet computers, notebook computers, desktop computers, electronic book readers, intelligent voice interaction equipment, intelligent household appliances, vehicle-mounted terminals and other equipment; the terminal device may be provided with a client related to the business process control method, where the client may be software (for example, a browser, business process control software, etc.), or may be a web page, an applet, etc., and the embodiment of the present application is not specifically limited.
Based on the problems of low code reusability caused by low coupling of MVC architecture business actions and flow control and weak state machine code modularization capability and complex workflow engine architecture and inadequacy of processing concurrent business in the prior art, the embodiment of the application provides a business flow control method which is applied to a flow engine, wherein the flow engine comprises: capability layer, event layer and action layer, as shown in fig. 2, the method comprises:
s201: and responding to the execution instruction of the target service through the capability layer, determining service information corresponding to the target service based on the service identification of the target service, and sending the service information to the event layer.
In the embodiment of the application, the capability layer comprises the externally exposed interface of the flow engine provided by the embodiment of the application, and can provide a plurality of capabilities corresponding to the service scene under different service scenes, namely, different service scenes correspond to different capabilities, such as 'the scene of trading with a merchant' can correspond to order cancellation capability, order payment capability and the like; as another example, a "game scene" may correspond to a jump capability.
The target service is a service corresponding to an execution instruction, different execution instructions correspond to different target services, and different execution instructions may be instructions with different instruction contents, for example, the capability layer responds to the execution instruction of the cancellation order 1, and the target service is the cancellation order 1; the capability layer responds to the execution instruction of the payment order 2, and the target service is the payment order 2. The different execution instructions may also be execution instructions with different response times and the same instruction content, for example, the current capability layer responds to the execution instruction of the cancellation order 1, and the capability layer responds to the execution instruction of the cancellation order 1 after 0.1 seconds. In addition, the target services triggered under different service scenes are different, for example, the scene of trade with a merchant can trigger an order 1 to cancel the service, an order 2 to pay the service and the like; as another example, a "game scene" may trigger a service that jumps the target object.
In the embodiment of the application, the way that the flow engine responds to the execution instruction of the target service through the capability layer comprises, but is not limited to, at least one of the following:
(1) And (5) passive response.
And responding to the execution instruction for the target service based on the triggering of the client display interface.
As shown in fig. 3, by clicking the "refund" icon corresponding to "order 2" on the display interface, the capability layer can receive the cancellation service for order 1 and execute the subsequent service flow. In addition, the user can also check the details of the order 2 by clicking on the 'order 2' icon, so that whether the order 2 is to be canceled can be further determined according to requirements.
In addition to the above-mentioned execution instruction for the target service may be triggered through the display interface, other external devices may also be used to trigger, for example, a keyboard, and when the "space key" on the keyboard is clicked, the target object in the game may be triggered to perform the "jump" service flow.
In the above embodiment, the external device triggers the execution instruction for the target service, so that the capability layer can respond to the requirement of the user in time.
(2) And (5) actively responding.
And responding to the execution instruction aiming at the target service, wherein the execution instruction is triggered when the execution time arrives.
In the embodiment of the application, the corresponding execution time can be set for the service to be executed, and when the execution time is reached, the execution instruction for the target service is triggered. For example, for an order to be paid, if a request to cancel the order has not been received after 10 minutes, the service to cancel the order is automatically performed.
In the above embodiment, by determining the manner of reaching the execution time, the execution instruction of the target service is triggered, so that the timely execution of the instruction can be ensured, and the service is not always in the to-be-executed state.
After responding to the execution instruction of the target service, the capability layer may also respond to other execution instructions before the target service is completed (i.e. within a preset time period), in this case, it needs to determine whether the target object of the service corresponding to the other instruction is the same as the target object of the target service, and if so, it needs to perform locking processing on the target object to serially execute the service flows of the service corresponding to the multiple execution instructions related to the target object; if the two execution instructions are different, the corresponding services of the two execution instructions can be executed in parallel. Wherein the target object represents a recipient of the action of the business, e.g., the order cancellation business is acting on order 1; the other instructions may be other execution instructions of the target service, or may be execution instructions of other services related to the target object. In addition, after responding to the execution instruction of the target service, it is unnecessary to determine whether to respond to other instructions, and whether the target object of the service corresponding to other instructions is the same as the target object corresponding to the target service, so as to directly lock the target object corresponding to the target service.
For example, the capability layer cancels the service in response to order 1, pays the service in response to order 1 after 0.1 seconds, and the target service has not been completed after 0.1 seconds. The payment service and the cancellation service are different in service flow, but both of the two services are applied to the order 1, and in this case, the locking process needs to be performed on the order 1, so that the service related to the order 1 is executed in series. If the order 1 is not locked, two services are performed in parallel in different threads, the two threads are not communicated with each other, the occurrence of concurrency problem is not known, and finally data disorder is caused.
For another example, the capability layer responds to the order 1 to cancel the service, and then responds to the order 2 to pay the service after 0.1 seconds, and at this time, the cancellation service and the payment service can be executed in parallel because the target objects corresponding to the two services are different, that is, locking processing is not required to be performed on the order 1 or the order 2.
In order to facilitate management of service flows of each service, the application also sets corresponding service identifiers and service information for each service, wherein the service information comprises at least one event to be executed corresponding to the service. After the capability layer responds to the execution instruction of the target service, service information corresponding to the target service can be determined based on the service identification of the target service, and then the service information is sent to the event layer, so that the event layer executes the event in the service information.
For example, the service identifier of the target service is 000A, service information carrying the identifier of "000A" is queried from the plurality of service information, and the service information is sent to the event layer. In addition, in order to enable the business process to be performed smoothly, the business information is sent to the event layer, and meanwhile, the business data related to the target business is also sent to the event layer, where the business data may include parameters of the target object, such as a state of the target object (order 1) of the object identifier (order state is to be paid), and is not limited specifically herein.
Optionally, before determining service information corresponding to the target service based on the service identifier of the target service, the capability layer queries a target service state indicating that the service is completed based on the service identifier of the target service, and when the target service state is not queried, the capability layer indicates that the target service is not completed, then the subsequent process can be continued, and if the target service state is queried, the capability layer indicates that the target service is completed, then the process is ended. The business process of the same business is prevented from being executed for a plurality of times, and system resources are saved.
For example, the user clicks the "payment" icon twice on the display interface as shown in fig. 3, because the target objects corresponding to the two execution instructions are both order 1, locking processing needs to be performed on order 1, and after the execution of the business process of the first payment instruction is completed, the business process of the second payment instruction can be started to be executed, and because the business of the payment instruction is in a completed state, the business process of executing the second payment instruction is canceled.
S202: and receiving the service information sent by the capability layer through the event layer, and realizing flow control for the target service based on the event contained in the service information.
In the embodiment of the application, the event layer is a flow control layer and is also a middle layer responsible for decoupling business logic (action) and flow control (event). The event layer contains the event corresponding to the target service, and can execute the corresponding event based on the service information sent by the capability layer, generate the calling information for calling the target action, and send the calling information to the action layer.
If the number of the events to be executed is multiple, the service information includes an execution sequence of the multiple events in addition to the multiple events to be executed, and the event layer may execute the multiple events in sequence according to the execution sequence. For example, the content in the service information is: 1. executing the events A,2, C and 3 and executing the event D, and executing the events according to the sequence of the events A, C and D after the event layer receives the service information.
In the embodiment of the application, in order to improve the reusability of codes, the logic codes corresponding to all events are modularized. For example, the content in the service information is: 1. and executing the event A, the event 2, the event C and the event 3 and executing the event A, and directly calling the logic code corresponding to the event A to execute after the event layer executes the event C, so that whether the logic code corresponding to the event A exists behind the logic code corresponding to the event C or not is not considered.
In the process of executing each event, the execution condition of the target action may be triggered, at this time, call information carrying the event identifier of the event and the action identifier of the target action may be generated, and then the call information is sent to the action layer, so that the action layer executes the target action, where the target action is the action that needs to be executed to complete the event. Event 1 and event 2 of the event layer may call the same action at the same time, so as to avoid confusion (for example, event 1 and event 2 call action a at the same time, after the execution of action a is completed, it is not known to which event the execution result is fed back), and the call information may carry an event identifier.
Optionally, the execution conditions that trigger the target action include, but are not limited to, some or all of the following:
determining that a target object corresponding to a target service is in a target state;
an order of arrival to perform the target action is determined.
The target object represents the receptor acted by the service, for example, the order cancellation service is acted on the order 1, and the target object corresponding to the service is the order 1. The target state is that the state of the target object meets the preset condition, for example, when determining that the order 1 is unpaid, determining that the order 1 is in a state to be paid, and triggering a payment action; when it is determined that order 1 has been paid, it is determined that order 1 is in a refund state, triggering a "funds original refund" action.
In the embodiment of the application, the event layer plays a role of flow control, for example, in the process of executing an event, the state of a target object corresponding to a target service is checked, and when the target object meets a first state, a first action is triggered; triggering a second action when the target object meets the second state; in addition, the execution order of the actions may be defined in the logic code of the event, such as the order in which action 2 is executed after action 1 is executed.
Optionally, after executing the event contained in the service information, the event layer determines that all the events corresponding to the target service are executed, and then generates a target service state indicating that the service is completed; the process engine provided by the embodiment of the application can simultaneously process the service processes of a plurality of services, correlate the target service state with the service identifier, and feed back the correlated target service state and service identifier to the capability layer so as to ensure that the capability layer determines that the target service is in a completion state. The service identifier and the target service state after association can be "000A successful" or "000A complete", and the embodiment of the application does not limit the specific content of the feedback.
S203: and receiving calling information sent by the event layer through the action layer, executing a target action corresponding to the event identifier and the action identifier in the calling information, and feeding back an execution result of the target action to the event layer so that the event layer continuously executes a flow corresponding to the event.
The action layer is the support of the event layer and comprises a plurality of actions which are called by the event layer, so that the event layer can smoothly execute each event. For example, a refund event in the event layer may invoke a logging action of the action layer.
Based on the embodiment in S202, when executing each event, the event layer needs to determine whether the execution condition is satisfied, if the execution condition of the target action is satisfied, generating call information including an action identifier of the target action, sending the call information to the action layer, after the action layer receives the call information, executing the target action corresponding to the action identifier, and feeding back an execution result of the target action to the event layer, so that the event layer can execute a subsequent flow; if the execution condition is not met, the target action is not called, namely the event layer does not generate calling information aiming at the target action, if the event is followed by a to-be-executed flow, the follow-up flow is continuously executed, if the event is followed by no to-be-executed flow, whether other events executed after the event exist or not can be determined based on service information, if the event exists, the other events are executed, and if the event does not exist, the execution of the service flow corresponding to the target service is completed.
For example, in the order refund event, a condition for judging whether the action of executing the "order fund original path refund" is satisfied exists, if the condition is satisfied, call information carrying an event identifier of the order refund event and an action identifier of the "order fund original path refund" is generated and sent to an action layer, so that the action layer executes the action of "order fund original path refund"; if not, the subsequent flow of the order refund event is executed, namely 'update order status to refund'.
The action layer may receive call information sent by different events of the event layer at the same time, where the call information may include the same action identifier, that is, the event 1 and the event 2 may call the action a at the same time. According to the embodiment of the application, the logic codes corresponding to the actions are modularized, so that the event 1 and the event 2 can call the action A at the same time, and the reusability of the logic codes corresponding to the action A is improved.
After the action layer performs the target action, a result, for example, "the action a is successfully performed" or "the action a is failed to be performed", is fed back to the event layer, and the embodiment of the application does not specifically limit the specific content of the feedback, so as to reduce unnecessary flows, and can also feed back the result only when the action a is failed to be performed, and directly perform subsequent flows when the action a is successful. In addition, considering that the action A may be called by a plurality of events at the same time, the result fed back to the event layer may also carry an identification of the event, such as "event 1-action A complete", so that the event layer can determine to continue to execute the event 1 according to the result fed back by the action layer.
The event 1 and the event 2 may correspond to different services, and the service data are different, and the event layer sends the call information to the action layer and sends the service data to the action layer, so that the action a is executed according to the corresponding service data. For example, the order 1 cancellation service and the order 2 cancellation service are executed simultaneously, the event corresponding to the order 1 cancellation service is refund event 1, the event corresponding to the order 2 cancellation service is refund event 2, both refund event 1 and refund event 2 need to call the action of refund of the original path of the order funds, since the order 1 is paid by a "wallet" in the payment software, refund needs to refund the funds to the "wallet", the order 2 is paid by a bank card, and refund needs to refund the funds to the bank card, although the actions called by refund event 1 and refund event 2 are the same, the executing process of the actions will also have differences due to the difference of service data.
The event 1 and the event 2 may also correspond to the same service, for example, the order 1 cancel service corresponds to a refund event and a return event, both of which call an order log action, and for the refund event, record whether refund is completed, return a bank card, etc., and correspond to the return event, record whether to send out goods, whether to fill out a receiver accurately, etc. That is, for different events of the same service, when an action is invoked, service data and invocation information related to the action are sent to the action layer, so that the action layer completes the action according to the related service data.
The method for controlling the business process according to the embodiment of the present application is described in detail below based on fig. 4.
The capability layer responds to the execution instruction cancelled by the order 1, wherein the execution instruction may be triggered by a user on a display interface or may be triggered when the execution time is reached. And then the capability layer determines service information based on the service identifier of 'order 1 cancellation', and sends the service information and service data corresponding to the order 1 to the event layer.
After receiving the service information and the service data, the event layer is used for according to the content in the service information: the method comprises the steps that 1, order return events are executed, 2, order return events are executed, conditions for executing actions of arranging quick delivery to get goods, recording order cancel reasons, arranging customer service follow-up feedback and recording order log are triggered in the process of executing the order return events, call information corresponding to each action is generated, and the call information and relevant service data are sent to an action layer; it should be noted that the above 4 actions may or may not be performed simultaneously (in a certain order). In the process of executing the order refund event, triggering the conditions of executing the actions of 'order fund original refund' and 'record order log', generating call information corresponding to each action, and sending the call information and related service data to an action layer; it should be noted that the above 2 actions may or may not be performed simultaneously (performed in a certain order), and the call information includes an action identifier of the action.
After the action layer receives the calling information and the related service data, the action layer can execute the action corresponding to the action identifier in the calling information according to the service data. Namely, after the action layer receives the call information for calling and recording the order log and the related service data, the action layer records the order log and feeds back the execution result and the recorded content to the event layer, and the event layer can further feed back the execution result and the recorded content to the upper layer so as to enable the user to determine the state of the order 1.
The specific flow control of the order refund event in fig. 4 is shown in fig. 5.
After the capability layer responds to the order 1 and cancels the execution instruction, the capability layer can firstly lock the order 1. In the process of executing the refund event by the event layer, judging whether the state of the order 1 meets the refund requirement, if so, the state of the order 1 is as follows: and when the order 1 is in a paid state, triggering an action condition of 'order 1 fund original way refund', enabling an action layer to execute 'order 1 fund original way refund', after the action layer finishes 'order 1 fund original way refund', enabling an event layer to not receive an execution result representing failure, and enabling the action layer to execute 'record order 1 log' action according to the fact that the subsequent procedure is continuously executed, namely, the condition of executing 'record order 1 log' action is reached. Because the order refund event includes a process of updating the state of the order 1, after the action layer finishes recording the log of the order 1, an execution result is fed back to the event layer, and after the event layer receives the execution result, the state of the order 1 is updated to be refund. After all the business execution related to the order 1 is completed, the order 1 is unlocked.
In the above embodiment, the capability layer or the event layer actively sends the service data to the next layer, or may request the service data from the previous layer if some data is needed in the process of executing the event or the action. The capability layer can request the service data from the client, and the user can input the corresponding service data on the display interface according to the request, send the service data to the capability layer and forward the service data to the lower layer by the capability layer.
The embodiment of the application provides a business flow control method, which enables logic codes of events (flow control) to be executed in an event layer, enables logic codes of actions (business logic) to be executed in an action layer, realizes decoupling of the flow control and the business logic, and further can reduce difficulty of system development and maintenance; the logical codes of the events and the actions are modularized, so that the event can be conveniently called by the capability layer and the actions can be conveniently called by the event layer, and the reusability of the codes is improved; locking the target object of the target service to ensure that only the current thread in the system executes the service corresponding to the target object, thereby realizing concurrency control; the flow engine provided by the embodiment of the application has simple architecture (3 functional modules), and can improve the service execution efficiency.
Based on the same inventive concept, the embodiment of the application also provides a process engine for controlling the business process, which comprises: capability layer, event layer and action layer;
the capability layer is used for responding to the execution instruction of the target service, determining service information corresponding to the target service based on the service identifier of the target service, and sending the service information to the event layer, wherein the service information comprises at least one event to be executed corresponding to the target service;
the event layer is used for receiving the service information sent by the capability layer and realizing flow control for the target service based on the event contained in the service information; in the process of executing each event, determining that the execution condition of the target action is met, generating calling information and sending the calling information to an action layer, wherein the calling information carries an event identifier of the event and an action identifier of the target action, and the target action is the action required to be executed by the completion event;
the action layer is used for receiving the calling information sent by the event layer and executing the target action corresponding to the event identifier and the action identifier in the calling information; and feeding back the execution result of the target action to the event layer so that the event layer continues to execute the flow corresponding to the event.
Optionally, the capability layer is specifically configured to:
responding to an execution instruction aiming at a target service triggered based on a display interface;
and responding to the execution instruction aiming at the target service, wherein the execution instruction is triggered when the execution time arrives.
Optionally, after executing the event contained in the service information, the event layer is further configured to:
after all the events corresponding to the target service are determined to be executed, generating a target service state representing the completion of the service;
and after the target service state is associated with the service identifier, the service identifier is sent to the capability layer, so that the capability layer determines that the target service is in a finished state.
Optionally, before determining the service information corresponding to the target service based on the service identifier of the target service, the capability layer is further configured to:
and inquiring a target service state representing the completion of the service based on the service identification of the target service, and determining that the target service state is not inquired.
Optionally, after responding to the execution instruction of the target service, the capability layer is further configured to:
if at least one other execution instruction is responded within a preset time period, locking the target object corresponding to the target service, so as to serially execute the service flows of the service corresponding to the plurality of execution instructions related to the target object; wherein the other instructions are other execution instructions of the target service or execution instructions of other services related to the target object.
Optionally, the event layer is specifically configured to perform at least one of the following operations:
if the target object corresponding to the target service is in the target state, determining that the execution condition of the target action is met; or (b)
If the order of executing the target actions is determined, the execution condition of the target actions is determined to be satisfied.
Optionally, the event layer is specifically configured to:
if the service information includes a plurality of events, the plurality of events are sequentially executed based on the execution order of the events included in the service information.
In summary, the flow engine provided by the embodiment of the application comprises a capability layer so as to facilitate interaction with a user, an event layer and an action layer are distinguished so as to decouple flow control (event) from business logic (action), when the code of the flow control is modified, the code of the business logic is not required to be modified to adapt to the modified code of the flow control, and only the appropriate action is required to be called from the action layer; in addition, the flow engine provided by the embodiment of the application only comprises a capability layer, an event layer and an action layer, is simpler than the architecture of a workflow engine (comprising a flow definer, a flow executor, a service scheduler, an event monitor and a data storage), so that the operation efficiency is higher when the service flow control is realized.
Based on the same inventive concept, the embodiment of the application also provides a device for controlling the business process, which comprises:
a processor and a memory; the memory is connected to the processor, and the memory stores a computer program, and when the computer program is executed by the processor, the processor is configured to execute the method for controlling the business process.
As shown in fig. 6, the business process control apparatus 600 is embodied in the form of a general purpose computing device. Components of business process control device 600 may include, but are not limited to: the at least one processing unit 601, the at least one memory unit 602, a bus 603 connecting the different system components, including the memory unit 602 and the processing unit 601.
Bus 603 represents one or more of several types of bus structures, including a memory bus or memory controller, a peripheral bus, a processor, and a local bus using any of a variety of bus architectures.
The storage unit 602 may include readable media in the form of volatile memory such as Random Access Memory (RAM) 621 and/or cache memory 622, and may further include Read Only Memory (ROM) 623.
The storage unit 602 may also include a program/utility 625 having a set (at least one) of program modules 624, such program modules 624 including, but not limited to: an operating system, one or more application programs, other program modules, and program data, each or some combination of which may include an implementation of a network environment.
Business process control device 600 may also communicate with one or more external devices 604 (e.g., keyboard, pointing device, etc.), one or more devices that enable a user to interact with business process control device 600, and/or any devices (e.g., routers, modems, etc.) that enable business process control device 600 to communicate with one or more other computing devices. Such communication may occur through an input/output (I/O) interface 605. Also, business process control device 600 may also communicate with one or more networks such as a Local Area Network (LAN), a Wide Area Network (WAN), and/or a public network such as the Internet via network adapter 606. As shown in fig. 6, network adapter 606 communicates with other modules of device 600 for business process control over bus 603. It should be appreciated that although not shown, other hardware and/or software modules may be used in connection with business process control device 600, including, but not limited to: microcode, device drivers, redundant processors, external disk drive arrays, RAID systems, tape drives, data backup storage systems, and the like.
The embodiment of the application also provides a computer program product, which comprises a computer program, and when the computer program is executed by a processor, the method for determining the voice interaction area outside the vehicle is realized. For example, the methods of the present application may be implemented in whole or in part by software, hardware, firmware, or any combination thereof. When implemented in software, may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer programs or instructions. When the computer program or instructions are loaded and executed on a computer, the processes or functions of the present application are performed in whole or in part. The computer may be a general purpose computer, a special purpose computer, a computer network, a network device, a user device, a core network device, an OAM, or other programmable apparatus.
Alternatively, a computer readable storage medium may be an implementation manner of the computer program product, that is, an embodiment of the present application further provides a computer readable storage medium, which includes a computer program, where the computer program when executed by a processor implements any one of the above-mentioned methods for determining a voice interaction region outside a vehicle.
For example, a computer program or instructions may be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another computer-readable storage medium, e.g., a computer program or instructions may be transmitted from one website site, computer, server, or data center to another website site, computer, server, or data center by wire or wirelessly. Computer readable storage media can be any available media that can be accessed by a computer or data storage devices such as servers, data centers, etc. that integrate one or more available media. Usable media may be magnetic media such as floppy disks, hard disks, magnetic tape; but also optical media such as digital video discs; but also semiconductor media such as solid state disks. The computer readable storage medium may be volatile or nonvolatile storage medium, or may include both volatile and nonvolatile types of storage medium.
It will be appreciated by those skilled in the art that embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to the application. It will be understood that each flow and/or block of the flowchart illustrations and/or block diagrams, and combinations of flows and/or blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
It will be apparent to those skilled in the art that various modifications and variations can be made to the present application without departing from the spirit or scope of the application. Thus, it is intended that the present application also include such modifications and alterations insofar as they come within the scope of the appended claims or the equivalents thereof.

Claims (10)

1. A process engine for business process control, the process engine comprising: capability layer, event layer and action layer;
the capability layer is used for responding to an execution instruction of a target service, determining service information corresponding to the target service based on a service identifier of the target service, and sending the service information to the event layer, wherein the service information comprises at least one event to be executed corresponding to the target service;
the event layer is used for receiving the service information sent by the capability layer and realizing flow control for the target service based on the event contained in the service information; in the process of executing each event, determining that the execution condition of a target action is met, generating calling information and sending the calling information to the action layer, wherein the calling information carries an event identifier of the event and an action identifier of the target action, and the target action is an action required to be executed for completing the event;
the action layer is used for receiving the calling information sent by the event layer and executing target actions corresponding to the event identifications and the action identifications in the calling information; and feeding back an execution result of the target action to the event layer so that the event layer continues to execute a flow corresponding to the event.
2. The flow engine of claim 1, wherein the capability layer is specifically configured to:
responding to an execution instruction aiming at the target service, which is triggered based on a display interface;
and responding to the execution instruction aiming at the target service, wherein the execution instruction is triggered when the execution time arrives.
3. The flow engine of claim 1, wherein after executing the event contained in the business information, the event layer is further to:
after determining that all events corresponding to the target service are executed, generating a target service state representing that the service is completed;
and after the target service state is associated with the service identifier, the service identifier is sent to the capability layer, so that the capability layer determines that the target service is in a completion state.
4. The flow engine of claim 1, wherein prior to determining service information corresponding to the target service based on a service identification of the target service, the capability layer is further to:
and inquiring a target service state representing the completion of the service based on the service identification of the target service, and determining that the target service state is not inquired.
5. The flow engine of claim 1, wherein after responding to execution instructions of a target service, the capability layer is further to:
If at least one other execution instruction is responded within a preset time period, locking the target object corresponding to the target service, so as to serially execute the service flows of the service corresponding to the plurality of execution instructions related to the target object; the other instructions are other execution instructions of the target service or execution instructions of other services related to the target object.
6. The flow engine of claim 1, wherein the event layer is specifically configured to perform at least one of:
if the target object corresponding to the target service is in the target state, determining that the execution condition of the target action is met; or (b)
And if the order of executing the target actions is determined, determining that the execution conditions of the target actions are met.
7. The process engine of any one of claims 1 to 6, wherein said event layer is specifically configured to:
and if the service information contains a plurality of events, executing the plurality of events in sequence based on the execution sequence of the events contained in the service information.
8. A method of business process control, characterized by being applied to a process engine, the process engine comprising: capability layer, event layer and action layer; the method comprises the following steps:
Responding to an execution instruction of a target service through the capability layer, determining service information corresponding to the target service based on a service identifier of the target service, and sending the service information to an event layer, wherein the service information comprises at least one event to be executed corresponding to the target service;
receiving service information sent by the capability layer through the event layer, and realizing flow control for the target service based on an event contained in the service information; in the process of executing each event, determining that the execution condition of a target action is met, generating calling information, and sending the calling information to an action layer of the flow engine, wherein the calling information comprises an event identifier of the event and an action identifier of the target action, and the target action is an action required to be executed for completing the event;
receiving call information sent by the event layer through the action layer, and executing target actions corresponding to event identifications and action identifications in the call information; and feeding back an execution result of the target action to the event layer so that the event layer continues to execute a flow corresponding to the event.
9. An apparatus for business process control, the apparatus comprising:
a processor and a memory; wherein the memory is connected to the processor, the memory storing a computer program for performing the steps of claim 8 when the computer program is executed by the processor.
10. A computer program product comprising a computer program, characterized in that the method as claimed in claim 8 is implemented when the computer program is executed by a processor.
CN202311075520.4A 2023-08-24 2023-08-24 Flow engine, method, equipment and program product for business flow control Pending CN117114613A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311075520.4A CN117114613A (en) 2023-08-24 2023-08-24 Flow engine, method, equipment and program product for business flow control

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311075520.4A CN117114613A (en) 2023-08-24 2023-08-24 Flow engine, method, equipment and program product for business flow control

Publications (1)

Publication Number Publication Date
CN117114613A true CN117114613A (en) 2023-11-24

Family

ID=88805069

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311075520.4A Pending CN117114613A (en) 2023-08-24 2023-08-24 Flow engine, method, equipment and program product for business flow control

Country Status (1)

Country Link
CN (1) CN117114613A (en)

Similar Documents

Publication Publication Date Title
US20170337095A1 (en) Service based information technology platform
CN102456185B (en) Distributed workflow processing method and distributed workflow engine system
US5913061A (en) Modular application collaboration
US9904585B1 (en) Error handling in executing workflow state machines
US20170236188A1 (en) System and method for automating business processes throughout the life cycle of an order by using a publish-subscriber pattern
US10803413B1 (en) Workflow service with translator
US9697042B2 (en) Extensibility of business process and application logic
CN110062041B (en) Method and device for changing IOT (input/output) equipment based on block chain
US11582083B2 (en) Multi-tenant event sourcing and audit logging in a cloud-based computing infrastructure
CN109800083A (en) A kind of method, apparatus, system and storage medium that micro services collaboration is called
CN113760500A (en) Service processing method, device, server and medium
CN115357403A (en) Micro-service system for task scheduling and task scheduling method
CN102511041A (en) Attributing causality to program execution capacity modifications and dynamically modifying program execution capacity
US7941454B2 (en) Apparatus, methods and computer programs for monitoring processing in a data processing system or network
US9047144B2 (en) System and method for providing Quality-of-Services in a multi-event processing environment
US11120513B2 (en) Capital chain information traceability method, system, server and readable storage medium
CN117114613A (en) Flow engine, method, equipment and program product for business flow control
CN111061576B (en) Method and system for creating entity object
EP2601627B1 (en) Transaction processing system and method
CN112463338A (en) Accumulation fund service processing method and device, electronic equipment and medium
CN113900741B (en) Service processing method and device based on plug-in, computer equipment and medium
CN116109112B (en) Service data processing method, device, medium and equipment based on aggregation interface
CN117950813B (en) Transaction management method, device and medium based on distributed application runtime
Lano et al. Enterprise Information Systems and Application Servers
CN110490570A (en) A kind of monitoring method of payment process, device, medium and electronic equipment

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