Rule engine and state machine fusion method and device, computer equipment and storage medium
By analyzing business requirements in the enterprise and generating a dual-track model, the rules engine and state machines are interactively integrated, and the problems of integration complexity and low management efficiency in the existing technology are solved, and efficient coordination of business processes and rule management is achieved.
Patent Information
- Application Number
- CN202411679336.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-21
- Publication Date
- 2025-03-25
- Estimated Expiration
- 2044-11-21
AI Technical Summary
In the prior art, the integration of rule engines and state machines in business processes and rule management is complex, resulting in rules conflicts, performance bottlenecks, state inconsistencies and maintenance difficulties.
By analyzing the target business needs, generating target business rules and business processes, establishing business rules tracks based on the rules engine and business process tracks based on the state machine, generating a dual-track model to realize the interactive integration of the rule engine and the state machine.
It improves the efficiency of enterprise business process management and business rule management, ensures consistency of business decisions and a clear view of business processes, and provides a detailed business execution view through the interactive converged information generated by the dual-track model.
Smart Images

Figure CN119693119A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of R&D management and is applied to the field of financial technology business, and in particular to a method, device, computer equipment and storage medium for integrating a rule engine and a state machine. Background Art
[0002] In modern enterprises, business process management and business rule management are two core components that are essential to ensure efficient operation and compliance of the business. With the development of technology, rule engines and state machines, as two different technical solutions, have been widely used in the management of business processes and rules. A rule engine is a software component that separates business decision logic and implements it as a manageable set of rules. These rules can be easily modified without modifying the application code. There are a variety of commercial rule engine products on the market, such as Drools, JBoss Rules, and IBM Operational Decision Manager (ODM), which provide the ability to integrate with business logic and help enterprises quickly build rule engine systems. At the same time, there are also open source rule engine frameworks, such as Jess, CLIPS, and JRules, which provide flexible rule writing and execution mechanisms to meet the needs of different scenarios. A state machine is a computational model that can determine the next state based on the input and the current state. State machines are widely used to represent state transitions and event processing. Squirrel State Machine is a common state machine tool, and open source state machine frameworks such as XState and Boost.Statechart provide state machine modeling and execution capabilities to help developers better manage and control state transitions.
[0003] Although the existing technologies have achieved certain results in rule engines and state machines, they still have some defects and shortcomings. In terms of rule engines, due to their complexity, rule conflicts and performance bottlenecks are prone to occur. In terms of state machines, the modeling and maintenance of state machines need to take into account the complexity of state transfer, which is prone to state inconsistency and maintenance difficulties. In terms of integration, the integration of rule engines and state machines needs to consider issues such as version control and log management, which increases the complexity and challenges of integration. Therefore, how to integrate rule engines with state machines to improve the efficiency of enterprise business process management and business rule management has become a technical problem that needs to be solved urgently. Summary of the invention
[0004] The present application provides a method, apparatus, computer equipment and storage medium for integrating a rule engine and a state machine, which integrate the rule engine and the state machine to improve the efficiency of business process management and business rule management of an enterprise.
[0005] In a first aspect, the present application provides a method for integrating a rule engine and a state machine, the method comprising:
[0006] Analyze target business requirements and generate target business rules and target business processes;
[0007] Establishing a business rule track based on a rule engine and a business process track based on a state machine, and generating a dual-track model according to the business rule track and the business process track;
[0008] Through the dual-track model, the target business rules and the target business processes are interactively integrated to generate interactive integration information.
[0009] In a second aspect, the present application further provides a device for integrating a rule engine and a state machine, the device comprising:
[0010] Target business requirement analysis module, used to analyze target business requirements and generate target business rules and target business processes;
[0011] A dual-track model generation module is used to establish a business rule track based on a rule engine and a business process track based on a state machine, and generate a dual-track model according to the business rule track and the business process track;
[0012] The interactive fusion module is used to interactively fuse the target business rules and the target business processes through the dual-track model to generate interactive fusion information.
[0013] In a third aspect, the present application also provides a computer device, comprising a memory and a processor; the memory is used to store a computer program; the processor is used to execute the computer program and implement the above-mentioned method of integrating the rule engine and the state machine when executing the computer program.
[0014] In a fourth aspect, the present application further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the processor implements the above-mentioned method for integrating a rule engine and a state machine.
[0015] The present application discloses a method, apparatus, computer equipment and storage medium for integrating a rule engine and a state machine. The method for integrating the rule engine and the state machine includes parsing target business requirements, generating target business rules and target business processes; establishing a business rule track based on the rule engine and a business process track based on the state machine, and generating a dual-track model based on the business rule track and the business process track; through the dual-track model, the target business rules and the target business processes are interactively integrated to generate interactive integration information. In the above manner, the present application can respond to market changes and compliance requirements more quickly by separating the management of business rules and business processes. The use of the rule engine ensures the consistency of business decisions, and the use of the state machine provides a clear view of the business process. The interactive integration information generated by the dual-track model provides a detailed view of the business process and rule execution, which improves the efficiency of the enterprise in business process management and business rule management. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0017] Figure 1 is a schematic flow chart of a method for integrating a rule engine and a state machine provided in the first embodiment of the present application;
[0018] Figure 2 is a schematic flow chart of a method for integrating a rule engine and a state machine provided in the second embodiment of the present application;
[0019] Figure 3 is a schematic flow chart of a method for integrating a rule engine and a state machine provided in the third embodiment of the present application;
[0020] Figure 4 is a schematic flow chart of a method for integrating a rule engine and a state machine provided in the fourth embodiment of the present application;
[0021] Figure 5 A schematic block diagram of a device for integrating a rule engine and a state machine provided in an embodiment of the present application;
[0022] Figure 6 A schematic block diagram of the structure of a computer device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0023] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0024] The flowcharts shown in the accompanying drawings are only examples and do not necessarily include all the contents and operations / steps, nor must they be executed in the order described. For example, some operations / steps may also be decomposed, combined or partially merged, so the actual execution order may change according to actual conditions.
[0025] It should be understood that the terms used in this application specification are only for the purpose of describing specific embodiments and are not intended to limit the application. As used in this application specification and the appended claims, unless the context clearly indicates otherwise, the singular forms "a", "an" and "the" are intended to include plural forms.
[0026] It should also be understood that the term “and / or” used in the specification and appended claims refers to any and all possible combinations of one or more of the associated listed items, and includes these combinations.
[0027] The embodiments of the present application provide a method, device, computer equipment and storage medium for integrating a rule engine and a state machine. The method for integrating the rule engine and the state machine can be applied to a server. By separating the management of business rules and business processes, it is possible to respond to market changes and compliance requirements more quickly. The use of the rule engine ensures the consistency of business decisions, and the use of the state machine provides a clear view of the business process. The interactive fusion information generated by the dual-track model provides a detailed view of the business process and rule execution, thereby improving the efficiency of the enterprise in business process management and business rule management. The server can be an independent server or a server cluster.
[0028] In conjunction with the accompanying drawings, some embodiments of the present application are described in detail below. In the absence of conflict, the following embodiments and features in the embodiments can be combined with each other.
[0029] See also Figure 1 , Figure 1This is a schematic flow chart of a method for integrating a rule engine and a state machine provided in the first embodiment of the present application. The method for integrating the rule engine and the state machine can be applied to a server, and is used to respond to market changes and compliance requirements more quickly by separating the management of business rules and business processes. The use of the rule engine ensures the consistency of business decisions, and the use of the state machine provides a clear view of the business process. The interactive fusion information generated by the dual-track model provides a detailed view of the business process and rule execution, which improves the efficiency of the enterprise in business process management and business rule management.
[0030] like Figure 1 As shown, the method for integrating the rule engine and the state machine specifically includes steps S10 to S30.
[0031] Step S10: Analyze the target business requirements and generate target business rules and target business processes;
[0032] Step S20: establishing a business rule track based on a rule engine and a business process track based on a state machine, and generating a dual-track model according to the business rule track and the business process track;
[0033] Step S30: interactively integrate the target business rules and the target business processes through the dual-track model to generate interactive integration information.
[0034] In one embodiment, in order to better support the definition and management of business rules and business processes, this embodiment introduces a dual-track model. The dual-track model includes a business rule track and a business process track, which are used to manage business rules and business processes respectively. The business rule track is used to define and manage business rules, and the business process track is used to define and manage business processes. The business rule track and the business process track interact through events and actions, thereby supporting the collaborative execution of business rules and business processes. The introduction of the dual-track model can make the definition and management of business rules and business processes clearer and more controllable.
[0035] In order to better support the definition and execution of business rules, this embodiment integrates the rule engine and the state machine. The rule engine is used to define and manage business rules, and the state machine is used to control the execution of business processes. The integration of the two can make the execution of business rules more standardized and controllable, and also make the execution of business processes more flexible and scalable. Specifically, the rule engine and the state machine interact through events and actions, thereby supporting the collaborative execution of business rules and business processes.
[0036] Based on the analyzed business requirements, identify and define key business rules, organize the business rules into documents to ensure the clarity and comprehensibility of the rules, input the defined business rules into the rule engine, and establish a manageable rule base.
[0037] According to business needs, identify the main business processes that need to be implemented, use flowchart tools (such as BPMN, UML, etc.) to draw business process diagrams, and clarify the steps, decision points and participating roles of each process.
[0038] Document the detailed steps and logic of the business process to ensure clarity and understandability of the process. Create a business rule track based on a rule engine to ensure that all business rules can be dynamically called and executed. Create a business process track based on a state machine to ensure that all business process states and transitions can be effectively managed. Define events and actions to ensure that key steps in the business process track can trigger the evaluation of related rules in the business rule track.
[0039] Identify the key steps in the business process and the key conditions in the business rules so that they can interact during execution, set event triggers in the key steps of the business process, and trigger the corresponding business rule evaluation when these steps are reached. During the execution of the business process, make decisions based on the evaluation results of the business rules and record the information during the interaction.
[0040] The present embodiment discloses a method, apparatus, computer equipment and storage medium for integrating a rule engine and a state machine. The method for integrating the rule engine and the state machine includes parsing target business requirements, generating target business rules and target business processes; establishing a business rule track based on the rule engine and a business process track based on the state machine, and generating a dual-track model based on the business rule track and the business process track; through the dual-track model, the target business rules and the target business processes are interactively integrated to generate interactive integration information. In the above manner, the present application can respond to market changes and compliance requirements more quickly by separating the management of business rules and business processes. The use of the rule engine ensures the consistency of business decisions, and the use of the state machine provides a clear view of the business process. The interactive integration information generated by the dual-track model provides a detailed view of the business process and rule execution, which improves the efficiency of the enterprise in business process management and business rule management.
[0041] See also Figure 2 , Figure 2 This is a schematic flow chart of a method for integrating a rule engine and a state machine provided in the second embodiment of the present application. The method for integrating the rule engine and the state machine can be applied to a server, and is used to respond to market changes and compliance requirements more quickly by separating the management of business rules and business processes. The use of the rule engine ensures the consistency of business decisions, and the use of the state machine provides a clear view of the business process. The interactive fusion information generated by the dual-track model provides a detailed view of the business process and rule execution, which improves the efficiency of the enterprise in business process management and business rule management.
[0042] based on Figure 1 The embodiment shown, this embodiment Figure 2 As shown, step S20 includes steps S201 to S204.
[0043] Step S201, identifying at least one key business rule and at least one key business process in a preset business;
[0044] Step S202: Obtain the rule engine and the state machine;
[0045] Step S203: establishing the business rule track based on the rule engine and each of the key business rules;
[0046] Step S204: Establish the business process track based on the state machine and each of the key business processes.
[0047] In one embodiment, work with the business team to deeply understand business goals and needs, identify key factors that affect business decisions and processes, determine at least one key business rule, such as: "All sales orders must undergo a credit check", and document the logic and conditions of the rule to ensure it is clear and enforceable.
[0048] Identify at least one key business process, for example: “New Customer Onboarding Process” and create a flowchart to clearly identify the steps and decision points of the process.
[0049] Select appropriate rule engines such as Drools, Jess, etc. according to business needs, evaluate the functions, performance and integration capabilities of the rule engines, select appropriate state machine tools such as XState, Boost.Statechart, etc. according to the complexity of business processes, and evaluate the modeling capabilities, execution efficiency and scalability of the state machines.
[0050] Convert the identified key business rules into a format that the rule engine can understand. For example, define the rule "all sales orders must undergo a credit check" as an IF-THEN rule. Load the defined business rules into the rule engine and configure the rule engine to ensure that the rules can be correctly interpreted and executed.
[0051] Test the business rules loaded into the rule engine to ensure that the rules work as expected, convert the identified key business processes into a format that the state machine can understand, for example, define the "new customer onboarding process" as a series of states and transitions, and load the defined business process into the state machine. Configure the state machine to ensure that the process can be managed and executed correctly, and test the business process loaded into the state machine to ensure that the process works as expected.
[0052] The present embodiment discloses a method, device, computer equipment and storage medium for integrating a rule engine and a state machine. The method for integrating the rule engine and the state machine includes parsing target business requirements, generating target business rules and target business processes; identifying at least one key business rule and at least one key business process in a preset business; obtaining the rule engine and the state machine; establishing the business rule track based on the rule engine and each of the key business rules; establishing the business process track based on the state machine and each of the key business processes, and generating a dual-track model based on the business rule track and the business process track; through the dual-track model, the target business rules and the target business process are interactively integrated to generate interactive integration information. In the above manner, the present application can respond to market changes and compliance requirements more quickly by separating the management of business rules and business processes. The use of the rule engine ensures the consistency of business decisions, the use of the state machine provides a clear view of the business process, and the interactive integration information generated by the dual-track model provides a detailed view of the business process and rule execution, thereby improving the efficiency of the enterprise in business process management and business rule management.
[0053] based on Figure 2 In the embodiment shown, in this embodiment, step S203 includes:
[0054] Analyze the key business rules and generate rationality rules, policy rules and business logic rules;
[0055] Based on the rationality rule, the policy rule and the business logic rule, defining the triggering condition of the key business rule through the rule engine;
[0056] Based on at least one of the trigger conditions, the business rule track is established.
[0057] In one embodiment, we work with business experts to deeply understand business goals and requirements, identify key decision points and rule application scenarios in business processes, and divide key business rules into rationality rules, policy rules, and business logic rules:
[0058] Reasonableness rules: ensure that business operations comply with basic logic and business common sense;
[0059] Strategic rules: rules based on company policies and market strategies;
[0060] Business logic rules: involve the specific operations and processing logic of the business process.
[0061] For each type of rule, define its logic, conditions, and expected results in detail. For example, a rationality rule may include "the order amount cannot be negative"; a policy rule may include "prioritize high-value customer orders"; and a business logic rule may include "if there is insufficient inventory, delay shipment."
[0062] Determine which events or conditions trigger the evaluation of each type of business rule, for example, order submission may trigger a plausibility rule, and a change in customer category may trigger a policy rule. Configure the trigger conditions for each business rule in the rule engine. Define I F-THEN rules using the syntax and functionality of the rule engine, for example: "If the order amount is less than 0, then reject the order." Test the defined trigger conditions to ensure that they correctly trigger the rules under the expected events or conditions, adjust the rule logic and trigger conditions, and fix any issues found during testing.
[0063] Design the overall architecture of the business rule track, including components for rule storage, rule evaluation, and rule execution, load the defined business rules and their triggering conditions into the rule engine, and ensure that the rules are organized according to business logic and priority order.
[0064] based on Figure 2 In the embodiment shown, in this embodiment, step S204 includes:
[0065] Analyze the key business processes and determine the business execution sequence and business decision points;
[0066] The key business process is visualized through the state machine according to the business execution sequence and the business decision point, and the business process track is established.
[0067] The present embodiment discloses a method, apparatus, computer equipment and storage medium for integrating a rule engine and a state machine. The method for integrating the rule engine and the state machine includes parsing target business requirements, generating target business rules and target business processes; identifying at least one key business rule and at least one key business process in a preset business; obtaining the rule engine and the state machine; parsing the key business rules, generating rationality rules, policy rules and business logic rules; defining the triggering conditions of the key business rules through the rule engine based on the rationality rules, the policy rules and the business logic rules; establishing the business rule track based on at least one of the triggering conditions; parsing the key business process, determining the business execution sequence and the business decision point; visualizing the key business process according to the business execution sequence and the business decision point through the state machine, establishing the business process track, and generating a dual-track model based on the business rule track and the business process track; interactively integrating the target business rules and the target business process through the dual-track model to generate interactive integration information. Through the above method, this application can respond to market changes and compliance requirements more quickly by separating the management of business rules and business processes. The use of the rule engine ensures the consistency of business decisions, and the use of the state machine provides a clear view of the business process. The interactive fusion information generated by the dual-track model provides a detailed view of the business process and rule execution, thereby improving the efficiency of the enterprise's business process management and business rule management.
[0068] See also Figure 3 , Figure 3 This is a schematic flow chart of a method for integrating a rule engine and a state machine provided in the third embodiment of the present application. The method for integrating the rule engine and the state machine can be applied to a server, and is used to respond to market changes and compliance requirements more quickly by separating the management of business rules and business processes. The use of the rule engine ensures the consistency of business decisions, and the use of the state machine provides a clear view of the business process. The interactive fusion information generated by the dual-track model provides a detailed view of the business process and rule execution, which improves the efficiency of the enterprise in business process management and business rule management.
[0069] based on Figure 1 The embodiment shown, this embodiment Figure 3 As shown, step S20 also includes steps S205 to S208.
[0070] Step S205: define a target business rule node in the business rule track and a target business process node in the business process track according to the target business rule and the target business process;
[0071] Step S206: extracting event information contained in each of the target business rule nodes and each of the target business process nodes;
[0072] Step S207: Match each of the target business rule nodes with each of the target business process nodes based on each of the event information;
[0073] Step S208: Fusing the matched target business rule nodes and the target business process nodes to generate at least one event decision point, and generating the dual-track model based on each of the event decision points.
[0074] In one embodiment, the specific execution point of each rule in the business rule track is determined and defined as a business rule node. For example, if there is a rule that "provides a discount when the order amount exceeds a certain value", then the execution point of this rule is a business rule node. The specific steps of each process in the business process track are determined and defined as a business process node. For example, in the order processing process, "order confirmation" and "payment processing" can be two business process nodes.
[0075] Identify the events contained in each business rule node that trigger the execution of the rule, and record the event type, conditions, and expected inputs and outputs. Identify the events that may be generated in each business process node that may affect the execution of the rule, and record the event type, conditions, and expected inputs and outputs.
[0076] According to the extracted event information, match the business rule nodes and business process nodes to determine which process node events can trigger the rule nodes and which rule node events can affect the process nodes. Verify whether the matched nodes meet the business logic and rule conditions, and ensure that the matched nodes are meaningful in the business process and can correctly trigger or respond to events.
[0077] Define event decision points between matching business rule nodes and business process nodes. Event decision points are key points in the process where decisions are made based on the evaluation results of the rules. Integrate matching business rule nodes and business process nodes to ensure that they can work together at event decision points, and configure the rule engine and state machine so that events can be received and processed at event decision points.
[0078] Based on the fused nodes and event decision points, the overall framework of the dual-track model is constructed to ensure that the business rule track and the business process track can communicate and interact with each other in the architecture. The interaction logic between the business rule track and the business process track is implemented, and the rule engine and state machine are configured so that the process can be adjusted according to the rule evaluation results at the event decision point.
[0079] The present embodiment discloses a method, apparatus, computer equipment and storage medium for fusing a rule engine with a state machine. The method for fusing the rule engine with the state machine includes parsing target business requirements, generating target business rules and target business processes; establishing a business rule track based on the rule engine and a business process track based on the state machine, and defining target business rule nodes in the business rule track and target business process nodes in the business process track according to the target business rules and the target business processes; extracting event information contained in each of the target business rule nodes and each of the target business process nodes; matching each of the target business rule nodes and each of the target business process nodes based on each of the event information; fusing the matched target business rule nodes and the target business process nodes to generate at least one event decision point, and generating the dual-track model based on each of the event decision points; interactively fusing the target business rules and the target business processes through the dual-track model to generate interactive fusion information. Through the above method, this application can respond to market changes and compliance requirements more quickly by separating the management of business rules and business processes. The use of the rule engine ensures the consistency of business decisions, and the use of the state machine provides a clear view of the business process. The interactive fusion information generated by the dual-track model provides a detailed view of the business process and rule execution, thereby improving the efficiency of the enterprise's business process management and business rule management.
[0080] See also Figure 4 , Figure 4 This is a schematic flow chart of a method for integrating a rule engine and a state machine provided in the fourth embodiment of the present application. The method for integrating the rule engine and the state machine can be applied to a server, and is used to respond to market changes and compliance requirements more quickly by separating the management of business rules and business processes. The use of the rule engine ensures the consistency of business decisions, and the use of the state machine provides a clear view of the business process. The interactive fusion information generated by the dual-track model provides a detailed view of the business process and rule execution, which improves the efficiency of the enterprise in business process management and business rule management.
[0081] based on Figure 1 The embodiment shown, this embodiment Figure 4 As shown, step S30 also includes steps S301 to S303.
[0082] Step S301, generating a target event interaction instruction through the dual-track model, the target business rules and the target business process;
[0083] Step S302: In response to the target event interaction instruction, the target business rule and the target business process are respectively executed through the dual-track model to generate target business rule data and target business process data;
[0084] Step S303: Fusing the target business rule data and the target business process data to generate the interactive fusion information.
[0085] In one embodiment, the target business rules and target business processes are analyzed to determine the interaction points between them. The interaction points are usually specific events in the business process that trigger the evaluation of the business rules, and specific event interaction instructions are defined for each interaction point. The event interaction instructions should contain sufficient information to guide the dual-track model when and where to trigger the business rules and business processes.
[0086] Configure business rules in the rule engine so that they can respond to event interaction instructions, and configure business processes in the state machine so that they can be executed at the appropriate time and respond to the output of business rules. When the business process reaches a predefined interaction point, the corresponding business rule evaluation is triggered. The rule engine executes business rules based on event interaction instructions and current business data.
[0087] According to the definition of the state machine, execute each step of the business process. During the execution of the business process, respond to the evaluation results of the business rules and adjust the execution path of the process. During the execution process, record the evaluation results of the business rules and generate target business rule data. At the same time, record the execution status and results of the business process and generate target business process data.
[0088] According to the defined fusion rules, the target business rule data and the target business process data are fused to ensure data consistency and integrity during the data fusion process. The fused data constitutes interactive fusion information, which contains the execution results and impacts of business rules and business processes.
[0089] The present embodiment discloses a method, device, computer equipment and storage medium for integrating a rule engine and a state machine. The method for integrating the rule engine and the state machine includes parsing target business requirements, generating target business rules and target business processes; establishing a business rule track based on the rule engine and a business process track based on the state machine, and generating a dual-track model according to the business rule track and the business process track; generating target event interaction instructions through the dual-track model, the target business rules and the target business process; in response to the target event interaction instructions, executing the target business rules and the target business process respectively through the dual-track model to generate target business rule data and target business process data; integrating the target business rule data and the target business process data to generate the interactive fusion information. Through the above-mentioned method, the present application can respond to market changes and compliance requirements more quickly by separating the management of business rules and business processes. The use of the rule engine ensures the consistency of business decisions, the use of the state machine provides a clear business process view, and the interactive fusion information generated by the dual-track model provides a detailed view of business process and rule execution, thereby improving the efficiency of business process management and business rule management of enterprises.
[0090] based on Figure 4 In the embodiment shown, in this embodiment, step S304 includes:
[0091] transferring the target business rule data to the business process track, and transferring the target business process data to the business rule track;
[0092] Evaluate the target business rule data through the business process track to generate first interaction information;
[0093] Evaluate the target business process data through the business rule track to generate second interaction information;
[0094] The rule engine and the state machine are collaboratively managed according to the first interaction information and the second interaction information to generate the interaction fusion information.
[0095] See also Figure 5 , Figure 5 The embodiment of the present application provides a schematic block diagram of a fusion device of a rule engine and a state machine, wherein the fusion device of the rule engine and the state machine is used to execute the aforementioned fusion method of the rule engine and the state machine. The fusion device of the rule engine and the state machine can be configured on a server.
[0096] like Figure 5 As shown, the rule engine and state machine fusion device 400 includes:
[0097] The target business requirement analysis module 410 is used to analyze the target business requirements and generate target business rules and target business processes;
[0098] A dual-track model generation module 420 is used to establish a business rule track based on a rule engine and a business process track based on a state machine, and generate a dual-track model according to the business rule track and the business process track;
[0099] The interactive fusion module 430 is used to interactively fuse the target business rules and the target business processes through the dual-track model to generate interactive fusion information.
[0100] Furthermore, the dual-track model generation module 420 includes:
[0101] A preset business identification unit, used to identify at least one key business rule and at least one key business process in the preset business;
[0102] A rule engine and state machine acquisition unit, used to acquire the rule engine and the state machine;
[0103] A business rule track establishing unit, used to establish the business rule track based on the rule engine and each of the key business rules;
[0104] The business process track establishing unit is used to establish the business process track based on the state machine and each of the key business processes.
[0105] Furthermore, the business rule track establishing unit includes:
[0106] A key business rule parsing subunit, used to parse the key business rules and generate rationality rules, policy rules and business logic rules;
[0107] A trigger condition definition subunit, used to define the trigger condition of the key business rule through the rule engine based on the rationality rule, the policy rule and the business logic rule;
[0108] The business rule track establishing subunit is used to establish the business rule track based on at least one of the trigger conditions.
[0109] Furthermore, the business process track establishment unit includes:
[0110] A key business process analysis subunit is used to analyze the key business process and determine the business execution sequence and business decision points;
[0111] The business process track establishment subunit is used to visualize the key business process according to the business execution sequence and the business decision point through the state machine to establish the business process track.
[0112] Furthermore, the dual-track model generation module 420 further includes:
[0113] A node definition unit, used to define a target business rule node in the business rule track and a target business process node in the business process track according to the target business rule and the target business process;
[0114] An event information extraction unit, used to extract event information contained in each of the target business rule nodes and each of the target business process nodes;
[0115] A node matching unit, used for matching each of the target business rule nodes with each of the target business process nodes based on each of the event information;
[0116] The dual-track model generation unit is used to merge the matching target business rule nodes and the target business process nodes to generate at least one event decision point, and generate the dual-track model based on each event decision point.
[0117] Furthermore, the interactive fusion module 430 includes:
[0118] A target event interaction instruction generating unit, configured to generate a target event interaction instruction through the dual-track model, the target business rules and the target business process;
[0119] A business data generating unit, configured to execute the target business rule and the target business process respectively through the dual-track model in response to the target event interaction instruction, and generate target business rule data and target business process data;
[0120] The interactive fusion information generating unit is used to fuse the target business rule data and the target business process data to generate the interactive fusion information.
[0121] Furthermore, the interactive fusion information generating unit includes:
[0122] A data transmission subunit, used to transmit the target business rule data to the business process track, and to transmit the target business process data to the business rule track;
[0123] A first interaction information generating subunit is used to evaluate the target business rule data through the business process track to generate first interaction information;
[0124] A second interaction information generating subunit is used to evaluate the target business process data through the business rule track to generate second interaction information;
[0125] The interaction fusion information generating subunit is used to collaboratively manage the rule engine and the state machine according to the first interaction information and the second interaction information to generate the interaction fusion information.
[0126] It should be noted that those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working process of the above-described device and each module can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here.
[0127] The above-mentioned device can be implemented in the form of a computer program. Figure 6 Runs on the computer device shown.
[0128] See also Figure 6 , Figure 6 1 is a schematic block diagram of a computer device provided in an embodiment of the present application. The computer device may be a server.
[0129] See also Figure 6 The computer device includes a processor, a memory and a network interface connected through a system bus, wherein the memory may include a non-volatile storage medium and an internal memory.
[0130] The non-volatile storage medium can store an operating system and a computer program. The computer program includes program instructions, and when the program instructions are executed, the processor can execute any one of the fusion methods of the rule engine and the state machine.
[0131] The processor is used to provide computing and control capabilities and support the operation of the entire computer equipment.
[0132] The internal memory provides an environment for the operation of the computer program in the non-volatile storage medium. When the computer program is executed by the processor, the processor can execute any method for integrating the rule engine with the state machine.
[0133] The network interface is used for network communication, such as sending assigned tasks, etc. Those skilled in the art will understand that Figure 6 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0134] It should be understood that the processor may be a central processing unit (CPU), and the processor may also be other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. Among them, the general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.
[0135] In one embodiment, the processor is used to run a computer program stored in the memory to implement the following steps:
[0136] Analyze target business requirements and generate target business rules and target business processes;
[0137] Establishing a business rule track based on a rule engine and a business process track based on a state machine, and generating a dual-track model according to the business rule track and the business process track;
[0138] Through the dual-track model, the target business rules and the target business processes are interactively integrated to generate interactive integration information.
[0139] In one embodiment, a business rule track based on a rule engine and a business process track based on a state machine are established to achieve:
[0140] Identify at least one key business rule and at least one key business process in the preset business;
[0141] Obtain the rule engine and the state machine;
[0142] Based on the rule engine and each of the key business rules, establishing the business rule track;
[0143] The business process track is established based on the state machine and each of the key business processes.
[0144] In one embodiment, based on the rule engine and each of the key business rules, the business rule track is established to achieve:
[0145] Analyze the key business rules and generate rationality rules, policy rules and business logic rules;
[0146] Based on the rationality rule, the policy rule and the business logic rule, defining the triggering condition of the key business rule through the rule engine;
[0147] Based on at least one of the trigger conditions, the business rule track is established.
[0148] In one embodiment, based on the state machine and each of the key business processes, the business process track is established to achieve:
[0149] Analyze the key business processes and determine the business execution sequence and business decision points;
[0150] The key business process is visualized through the state machine according to the business execution sequence and the business decision point, and the business process track is established.
[0151] In one embodiment, a dual-track model is generated according to the business rule track and the business process track to achieve:
[0152] According to the target business rule and the target business process, define a target business rule node in the business rule track and a target business process node in the business process track;
[0153] Extracting event information contained in each of the target business rule nodes and each of the target business process nodes;
[0154] Based on each of the event information, matching each of the target business rule nodes with each of the target business process nodes;
[0155] The target business rule node and the target business process node that match are merged to generate at least one event decision point, and the dual-track model is generated based on each of the event decision points.
[0156] In one embodiment, the target business rules and the target business processes are interactively integrated through the dual-track model to generate interactive integration information for achieving:
[0157] Generate a target event interaction instruction through the dual-track model, the target business rules and the target business process;
[0158] In response to the target event interaction instruction, the target business rule and the target business process are respectively executed through the dual-track model to generate target business rule data and target business process data;
[0159] The target business rule data and the target business process data are merged to generate the interactive fusion information.
[0160] In one embodiment, the target business rule data and the target business process data are merged to generate the interactive fusion information, which is used to achieve:
[0161] transferring the target business rule data to the business process track, and transferring the target business process data to the business rule track;
[0162] Evaluate the target business rule data through the business process track to generate first interaction information;
[0163] Evaluate the target business process data through the business rule track to generate second interaction information;
[0164] The rule engine and the state machine are collaboratively managed according to the first interaction information and the second interaction information to generate the interaction fusion information.
[0165] A computer-readable storage medium is also provided in an embodiment of the present application, wherein the computer-readable storage medium stores a computer program, wherein the computer program includes program instructions, and the processor executes the program instructions to implement any one of the rule engine and state machine fusion methods provided in the embodiments of the present application.
[0166] The computer-readable storage medium may be an internal storage unit of the computer device described in the foregoing embodiment, such as a hard disk or memory of the computer device. The computer-readable storage medium may also be an external storage device of the computer device, such as a plug-in hard disk, a smart memory card (SmartMedia Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), etc., equipped on the computer device.
[0167] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of various equivalent modifications or replacements within the technical scope disclosed in the present application, and these modifications or replacements should be included in the protection scope of the present application. Therefore, the protection scope of the present application shall be based on the protection scope of the claims.
Claims
1. A method for integrating a rule engine and a state machine, characterized in that: include: Analyze target business requirements and generate target business rules and target business processes; Establishing a business rule track based on a rule engine and a business process track based on a state machine, and generating a dual-track model according to the business rule track and the business process track; Through the dual-track model, the target business rules and the target business processes are interactively integrated to generate interactive integration information.
2. The method for integrating a rule engine and a state machine according to claim 1, characterized in that: The establishment of a business rule track based on a rule engine and a business process track based on a state machine includes: Identify at least one key business rule and at least one key business process in the preset business; Obtain the rule engine and the state machine; Based on the rule engine and each of the key business rules, establishing the business rule track; The business process track is established based on the state machine and each of the key business processes.
3. The method for integrating a rule engine and a state machine according to claim 2, characterized in that: The establishing of the business rule track based on the rule engine and each of the key business rules includes: Analyze the key business rules and generate rationality rules, policy rules and business logic rules; Based on the rationality rule, the policy rule and the business logic rule, defining the triggering condition of the key business rule through the rule engine; Based on at least one of the trigger conditions, the business rule track is established.
4. The method for integrating a rule engine and a state machine according to claim 3, characterized in that: The step of establishing the business process track based on the state machine and each of the key business processes includes: Analyze the key business processes and determine the business execution sequence and business decision points; The key business process is visualized through the state machine according to the business execution sequence and the business decision point, and the business process track is established.
5. The method for integrating a rule engine and a state machine according to claim 1, characterized in that: The generating a dual-track model according to the business rule track and the business process track includes: According to the target business rule and the target business process, define a target business rule node in the business rule track and a target business process node in the business process track; Extracting event information contained in each of the target business rule nodes and each of the target business process nodes; Based on each of the event information, matching each of the target business rule nodes with each of the target business process nodes; The target business rule node and the target business process node that match are merged to generate at least one event decision point, and the dual-track model is generated based on each of the event decision points.
6. The method for integrating a rule engine and a state machine according to claim 1, characterized in that: The target business rules and the target business processes are interactively integrated through the dual-track model to generate interactive integration information, including: Generate a target event interaction instruction through the dual-track model, the target business rules and the target business process; In response to the target event interaction instruction, the target business rule and the target business process are respectively executed through the dual-track model to generate target business rule data and target business process data; The target business rule data and the target business process data are merged to generate the interactive fusion information.
7. The method for integrating a rule engine and a state machine according to claim 6, characterized in that: The step of fusing the target business rule data and the target business process data to generate the interactive fusion information includes: transferring the target business rule data to the business process track, and transferring the target business process data to the business rule track; Evaluate the target business rule data through the business process track to generate first interaction information; Evaluate the target business process data through the business rule track to generate second interaction information; The rule engine and the state machine are collaboratively managed according to the first interaction information and the second interaction information to generate the interaction fusion information.
8. A device for integrating a rule engine and a state machine, characterized in that: include: Target business requirement analysis module, used to analyze target business requirements and generate target business rules and target business processes; A dual-track model generation module is used to establish a business rule track based on a rule engine and a business process track based on a state machine, and generate a dual-track model according to the business rule track and the business process track; The interactive fusion module is used to interactively fuse the target business rules and the target business processes through the dual-track model to generate interactive fusion information.
9. A computer device, characterized in that: The computer device includes a memory and a processor; The memory is used to store computer programs; The processor is used to execute the computer program and implement the method for integrating the rule engine and the state machine according to any one of claims 1 to 7 when executing the computer program.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the processor implements the method for integrating a rule engine and a state machine according to any one of claims 1 to 7.
Citation Information
Patent Citations
Implementation method and device of state machine engine, computer equipment and storage medium
CN110580155A
Flow implementation method and system based on rule engine
CN112990850A
Event-driven software system and method based on finite-state machine and rule engine
CN116775170A
AI model arrangement method and device, electronic equipment and medium
CN117519850A
Business Process Automation
US20080320486A1
Cited By
Conference information intelligent data processing system based on multi-modal data fusion
CN121541981A
Intelligent Data Processing System for Conference Information Based on Multimodal Data Fusion
CN121541981B
Insurance product multi-channel release control system based on state machine
CN121616408A