Decision flow execution method, device, electronic device and computer-readable storage medium
By adding an interface layer to the decision engine system and isolating the decision engine and business layer in the adaptation layer, the stability problems caused by traditional decision flow execution methods are solved, and the stability and flexibility of the decision engine system are improved.
Patent Information
- Application Number
- CN202311240769.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-09-22
- Publication Date
- 2025-04-01
AI Technical Summary
Traditional decision flow execution methods lead to lower stability of decision engine systems.
By adding an interface layer to the decision engine system, isolating the decision engine and business layer in the adaptation layer, ensuring the stability of the core business layer and improving the overall stability of the decision engine system.
It improves the stability of the decision engine system, reduces development and maintenance costs, and realizes the reuse and flexibility of decision flow components.
Smart Images

Figure CN119739388A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of software interaction technology, and in particular to a decision flow execution method, device, electronic device and computer-readable storage medium. Background Art
[0002] At present, the decision-making model of the decision engine system usually adopts the decision flow model. The implementation of the decision flow model is mostly based on an open source or self-developed rule engine. Through the predefined translation module, each configured decision component is translated into the corresponding DSL (domain specific language), thereby translating the decision flow into a complete DSL file. The DSL file is executed by the rule engine to obtain the decision flow result.
[0003] However, the traditional decision flow execution method has the problem of low stability of the decision engine system. Summary of the invention
[0004] Embodiments of the present application provide a decision flow execution method, device, electronic device, computer-readable storage medium, and computer program product, which can improve the stability of a decision engine system.
[0005] In a first aspect, the present application provides a decision flow execution method. The method comprises:
[0006] In response to the decision flow execution instruction, the first decision flow is loaded through the execution subsystem in the business layer of the decision engine system to obtain a second decision flow; the decision flow is a process of a series of decision operations required to achieve a business goal;
[0007] Calling the engine interface in the interface layer of the decision engine system to process each component in the second decision flow to obtain a third decision flow; the component is a node in the decision flow;
[0008] A decision engine in the adaptation layer of the decision engine system is called to execute the third decision flow.
[0009] In a second aspect, the present application also provides a decision flow execution device. The device comprises:
[0010] A loading module, for responding to a decision flow execution instruction, loading the first decision flow through an execution subsystem in the business layer of the decision engine system to obtain a second decision flow; the decision flow is a process of a series of decision operations required to achieve a business goal;
[0011] A component processing module, used to call the engine interface in the interface layer of the decision engine system, process each component in the second decision flow, and obtain a third decision flow; the component is a node in the decision flow;
[0012] An execution module is used to call the decision engine in the adaptation layer of the decision engine system to execute the third decision flow.
[0013] In a third aspect, the present application further provides an electronic device. The electronic device includes a memory and a processor, the memory stores a computer program, and the processor implements the following steps when executing the computer program:
[0014] In response to the decision flow execution instruction, the first decision flow is loaded through the execution subsystem in the business layer of the decision engine system to obtain a second decision flow; the decision flow is a process of a series of decision operations required to achieve a business goal;
[0015] Calling the engine interface in the interface layer of the decision engine system to process each component in the second decision flow to obtain a third decision flow; the component is a node in the decision flow;
[0016] A decision engine in the adaptation layer of the decision engine system is called to execute the third decision flow.
[0017] In a fourth aspect, the present application further provides a computer-readable storage medium. The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the following steps are implemented:
[0018] In response to the decision flow execution instruction, the first decision flow is loaded through the execution subsystem in the business layer of the decision engine system to obtain a second decision flow; the decision flow is a process of a series of decision operations required to achieve a business goal;
[0019] Calling the engine interface in the interface layer of the decision engine system to process each component in the second decision flow to obtain a third decision flow; the component is a node in the decision flow;
[0020] A decision engine in the adaptation layer of the decision engine system is called to execute the third decision flow.
[0021] In a fifth aspect, the present application further provides a computer program product. The computer program product includes a computer program, and when the computer program is executed by a processor, the following steps are implemented:
[0022] In response to the decision flow execution instruction, the first decision flow is loaded through the execution subsystem in the business layer of the decision engine system to obtain a second decision flow; the decision flow is a process of a series of decision operations required to achieve a business goal;
[0023] Calling the engine interface in the interface layer of the decision engine system to process each component in the second decision flow to obtain a third decision flow; the component is a node in the decision flow;
[0024] A decision engine in the adaptation layer of the decision engine system is called to execute the third decision flow.
[0025] The above-mentioned decision flow execution method, device, electronic device, computer-readable storage medium and computer program product, in response to the decision flow execution instruction, load the first decision flow through the execution subsystem in the business layer of the decision engine system to obtain the second decision flow, which is the process of a series of decision operations required to achieve business goals; call the engine interface in the interface layer of the decision engine system, process each component in the second decision flow, and obtain the third decision flow, which is a node in the decision flow; call the decision engine in the adaptation layer of the decision engine system to execute the third decision flow; that is, by adding an interface layer in the decision engine system, the decision engine in the adaptation layer and the core business layer of the decision engine system are isolated, which can ensure the stability of the core business layer in the decision engine and improve the stability of the decision engine system. BRIEF DESCRIPTION OF THE DRAWINGS
[0026] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0027] Figure 1 A flowchart of a decision flow execution method in one embodiment;
[0028] Figure 2 A system architecture diagram of a decision engine system in one embodiment;
[0029] Figure 3 This is an interface diagram of a management subsystem in an embodiment;
[0030] Figure 4 A flowchart of a decision flow execution method in another embodiment;
[0031] Figure 5 A flowchart of a decision flow execution method in another embodiment;
[0032] Figure 6 It is a structural block diagram of a decision flow execution device in one embodiment;
[0033] Figure 7 FIG. 4 is a diagram showing the internal structure of an electronic device in one embodiment. DETAILED DESCRIPTION
[0034] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0035] In one embodiment, Figure 1 As shown, a decision flow execution method is provided. This embodiment uses the method applied to an electronic device as an example for illustration. The electronic device can be a terminal or a server. It can be understood that the method can also be applied to a system including a terminal and a server, and is implemented through the interaction between the terminal and the server. Among them, the terminal can be, but is not limited to, various personal computers, laptops, smart phones, tablet computers, Internet of Things devices and portable wearable devices. The Internet of Things devices can be smart speakers, smart TVs, smart air conditioners, smart car-mounted devices, smart cars, etc. Portable wearable devices can be smart watches, smart bracelets, head-mounted devices, etc. The server can be implemented as an independent server or a server cluster consisting of multiple servers.
[0036] In this embodiment, the decision flow execution method includes the following steps:
[0037] Step S102, in response to the decision flow execution instruction, the first decision flow is loaded through the execution subsystem in the business layer of the decision engine system to obtain the second decision flow; the decision flow is a process of a series of decision operations required to achieve business goals.
[0038] Among them, the decision flow is a process of a series of decision-making operations that need to be carried out to achieve business goals, that is, a series of decision-making steps and related operations that need to be carried out to achieve a certain business goal. It simulates the human decision-making process, integrates the workflow in the decision-making process with the decision, and realizes the configuration of the entire decision flow through page-based configuration to replace customized code development. It is usually represented by graphical methods such as flowcharts.
[0039] The decision engine system is a complete one-stop rule arrangement and execution system developed to achieve a certain decision goal (such as whether the decision goal is to defraud the user). The decision engine system includes a visual console for writing, arranging and publishing rules and an executor for executing and publishing rules.
[0040] like Figure 2As shown, the system architecture of the decision engine system includes a business layer, an interface layer, and an adaptation layer. The business layer includes an execution subsystem and a management subsystem, the interface layer includes an engine interface and a script execution interface, and the adaptation layer includes a decision engine. Among them, the execution subsystem is responsible for the pre-compilation, loading, and execution of the decision flow, and the management subsystem is responsible for the configuration, testing, and release of the decision flow; the interface layer is used to define the interface required by the decision engine system; the adaptation layer is used for the specific implementation of the interface defined in the interface layer; the engine interface can be a rule engine interface, and the decision engine can include at least one of the Drools rule engine, URule rule engine, EasyRule rule engine, and groovy script execution engine.
[0041] Determine the appropriate business layer based on the decision scenario; the adaptation layer is to access the open source or self-developed rule engine to execute the configured rules, which may include the accessed general rule engine. The rule engine interface is used to execute the configured first rule, which needs to be executed in the DSL language translated into the corresponding rule engine; the script execution interface is used to execute the script. Among them, the first rule can be a non-coded logical rule such as function calculation, size comparison, etc. configured by dragging and dropping on the interface of the management subsystem. When calculating, the first rule needs to be compiled into the DSL file required by the rule engine using the rule engine interface, and the other parts are serialized into other files such as json files, and then saved to the database; when the decision flow is executed, the script is executed, the script interface is called, and the corresponding script implementation class is called according to the script type to execute the script content.
[0042] The first decision flow is a decision flow that has been compiled and serialized, and the second decision flow is a decision flow after the first decision flow is loaded.
[0043] Optionally, if the user performs a required operation, such as opening a wallet, the electronic device responds to the decision flow execution instruction corresponding to the required operation, obtains the compiled first decision flow from the database, records the first decision flow through the execution subsystem in the business layer of the decision engine system, and loads the first decision flow into the execution subsystem to obtain the second decision flow.
[0044] Step S104, calling the engine interface in the interface layer of the decision engine system, processing each component in the second decision flow, and obtaining a third decision flow; a component is a node in the decision flow.
[0045] Among them, the component is the node in the decision flow, and the component is the decision component. After defining the content of each module, the component is arranged and connected through the workflow mode to output the final decision result. Although each decision component has different organizational forms, it usually includes three core contents: input, processing rules and output; when the data flows in according to the requirements of the decision component, the component will execute according to the defined logical expression, and after the execution is completed, the corresponding component result will be output. If the decision component is properly arranged in the decision flow, when all the component contents in the entire decision flow are executed, the execution result of the decision flow is obtained.
[0046] Optionally, the electronic device calls the engine interface in the interface layer of the decision engine system to precompile the first rule in each component in the second decision flow to obtain a third decision flow.
[0047] Optionally, the electronic device stores the third decision flow in a buffer; when it is necessary to execute the rules of each component in the third decision flow, the third decision flow is obtained from the buffer and executed.
[0048] Step S106, calling the decision engine in the adaptation layer of the decision engine system to execute the third decision flow.
[0049] The decision engine receives a set of input data, processes it through the configured first rule, and outputs a set of results. The first rule includes at least one of condition judgment and function calculation.
[0050] Optionally, calling the decision engine in the adaptation layer of the decision engine system to execute the third decision flow includes: calling the decision engine in the adaptation layer of the decision engine system, and executing the components in the third decision flow in sequence according to the arrangement order of each component in the third decision flow.
[0051] The starting point in the third decision flow is the start component, and the end point is the end component. The third decision flow may also include other components, such as a scorecard component, a rule set component, etc., but is not limited thereto.
[0052] Optionally, the electronic device calls the decision engine in the adaptation layer of the decision engine system, and executes the components in the third decision flow in sequence according to the arrangement order of the components in the third decision flow until all components of the third decision flow are executed, or stops execution when an exception occurs during execution.
[0053] The electronic device calls the decision engine in the adaptation layer of the decision engine system, and when executing the components in the third decision flow, returns to the next component to be executed after each component is executed until all components are executed.
[0054] The above-mentioned decision flow execution method, in response to the decision flow execution instruction, loads the first decision flow through the execution subsystem in the business layer of the decision engine system to obtain the second decision flow, which is the process of a series of decision operations required to achieve the business goal; calls the engine interface in the interface layer of the decision engine system, processes each component in the second decision flow, and obtains the third decision flow, which is a node in the decision flow; calls the decision engine in the adaptation layer of the decision engine system to execute the third decision flow; that is, by adding an interface layer in the decision engine system, the decision engine in the adaptation layer and the core business layer of the decision engine system are isolated, which can ensure the stability of the core business layer in the decision engine and improve the stability of the decision engine system.
[0055] In other words, the interface layer in the decision engine system decouples the core logic (business layer) in the decision engine system and the interfaces outside the system (such as the rule engine) used, ensuring the stability of the core system of the decision engine system while allowing the adaptation implementation to be easily replaced. That is, the interface of the decision engine is defined, and the rule engine interface can be implemented using a suitable framework in the adaptation layer.
[0056] Furthermore, the decision flow is no longer compiled into a complete DSL file, but a real system in which a set of decision components are executed in sequence, so that each component in the decision flow can be reused. For example, some common scorecards or rule sets can be extracted and managed and published separately, and reused in multiple decision flows. When the scorecard rules or rule set logic are adjusted, only the reused scorecard or rule set needs to be modified. There is no need to modify such scorecards or rule sets in each decision flow as in traditional decision flows, which can reduce development and maintenance costs.
[0057] In one embodiment, in response to a decision flow execution instruction, the first decision flow is loaded through the execution subsystem in the business layer of the decision engine system, and before obtaining the second decision flow, it also includes: calling the corresponding rule engine interface in the interface layer of the decision engine system, compiling the first rule of each component in the original decision flow to obtain the compiled first rule; the first rule is a rule composed of adjustable parameters of the component; serializing the second rule of each component in the original decision flow to obtain the serialized second rule; the second rule is a rule composed of attribute parameters of the component; generating the first decision flow based on the compiled first rule and the serialized second rule.
[0058] The original decision flow is the decision flow generated by the initial configuration.
[0059] Optionally, before calling the corresponding rule engine interface in the interface layer of the decision engine system and compiling the first rule of each component in the original decision flow, the method further includes: configuring the management subsystem in the business layer of the decision engine system to generate the original decision flow. The management subsystem is a system for managing the decision flow.
[0060] Optionally, the electronic device displays a page of the management subsystem, performs configuration in the page of the management subsystem, and generates an original decision flow.
[0061] like Figure 3 The interface diagram of the management subsystem is shown, and the first rule can be configured in the management subsystem. If the electronic device executes the first rule through the Drools rule engine, the first rule needs to be compiled into a drl file. With the help of an open source rule engine such as drools, the execution timing is determined in each component, such as the variable calculation component performs calculations (rule calculations, compiled into drl parts) after processing the input parameters, and then performs the output parameter processing.
[0062] Optionally, in response to the decision flow execution instruction, the first decision flow is loaded by the execution subsystem in the business layer of the decision engine system, and before obtaining the second decision flow, the method further includes: compiling and publishing the original decision flow to generate the first decision flow.
[0063] Optionally, calling the corresponding rule engine interface in the interface layer of the decision engine system, compiling the first rule of each component in the original decision flow, and obtaining the compiled first rule, including: obtaining the first rule to be compiled from each component in the original decision flow; calling the rule engine interface associated with the component in the interface layer of the decision engine system, compiling the first rule to be compiled, and obtaining the compiled first rule.
[0064] Optionally, the electronic device obtains the first rule to be compiled from each component in the original decision flow, stores the first rule to be compiled in the rule field, and calls the rule engine interface associated with the component in the interface layer of the decision engine system to compile the first rule to be compiled in the rule field to obtain the compiled first rule. The rule engine interface associated with the component may be a rule engine interface of the component type.
[0065] Optionally, the electronic device compiles the first rule to be compiled in the rule field to obtain the compiled first rule, and saves the compiled first rule and the component type, wherein the component type is also the type of the subsequent rule engine.
[0066] Optionally, the electronic device publishes the original decision stream, including: calling its own serialization interface to serialize the second rule of each component in the original decision stream to obtain the serialized second rule in a specified format.
[0067] In this embodiment, the electronic device calls the corresponding rule engine interface in the interface layer of the decision engine system, compiles the first rule of each component in the original decision flow, and obtains the compiled first rule; calls the serialization interface, serializes the second rule of each component in the original decision flow, and obtains the serialized second rule; then, based on the compiled first rule and the serialized second rule, the first decision flow can be accurately generated. Furthermore, the electronic device obtains the first rule to be compiled from each component in the original decision flow, calls the rule engine interface associated with the component in the interface layer of the decision engine system, compiles the first rule to be compiled, and can accurately obtain the compiled first rule.
[0068] The component entity model can only be persisted to the database after being serialized, and then read from the database and deserialized into the component model entity; serialization-deserialization is a set of methods that are inverse operations of each other.
[0069] In one embodiment, the engine interface in the interface layer of the decision engine system is called to process each component in the second decision flow to obtain a third decision flow, including: calling the corresponding engine interface in the interface layer of the decision engine system to precompile the first rule of each component in the second decision flow to obtain the third decision flow; the first rule is a rule composed of adjustable parameters of the component.
[0070] Optionally, the electronic device calls the rule engine interface corresponding to the component type in the interface layer of the decision engine system according to the component type, precompiles the first rule of each component in the second decision flow, and obtains the third decision flow. Exemplarily, if the component is a judgment component, the component type is a judgment type, if the component is a scoring component, the component type is a scoring type, and so on.
[0071] Optionally, calling the corresponding rule engine interface in the interface layer of the decision engine system, precompiling the first rule of each component in the second decision flow, and obtaining the third decision flow, including: calling the corresponding rule engine interface in the interface layer of the decision engine system, precompiling the first rule of each component in the second decision flow, and obtaining the precompiled first rule; deserializing the second rule of each component in the second decision flow to obtain the deserialized second rule; the second rule is a rule composed of the attribute parameters of the component; based on the precompiled first rule and the deserialized second rule, obtaining the third decision flow.
[0072] Among them, the first rule is the rule composed of the adjustable parameters of the component, that is, the part of the rule in the component that is easy to change and involves function calculation, etc. It can be understood that some feature components such as external data source call components may not need the first rule. Each component can specify the rule engine to be used for execution. The rule engine is responsible for calculating the first rule and outputting the calculation result. The second rule determines the subsequent actions and processes according to the output calculation result.
[0073] The second rule is a rule composed of the attribute parameters of the component. The attribute parameters are fixed parameters of the component itself and cannot be adjusted. The logical abstraction of the component is realized through the second rule, which is responsible for all execution actions of the component. For example, the hit rule of the scorecard component needs to calculate the score, and the hit rule in the rule set component is used for subsequent decision-making, etc., which are all reflected and executed in the second rule of the component.
[0074] Optionally, the engine interface in the adaptation layer includes a rule engine interface; the electronic device calls the rule engine interface corresponding to the component type in the interface layer of the decision engine system according to the component type, precompiles each component in the second decision flow, and obtains the precompiled first rule; deserializes the second rule in each component in the second decision flow to obtain the deserialized second rule; and constructs a third decision flow based on the precompiled first rule and the deserialized second rule.
[0075] Optionally, the component includes the first rule and the second rule, and may also include input and output parameters; the first rule part corresponds to the conventional decision component, and on this basis, the configuration of the input and output parameters and the additional operations required by this component are added, such as blackening, skipping a first rule execution exception, etc.; these components are sequentially organized into a decision flow (execution chain), and the decision engine system executes from the beginning to the end according to the arrangement order of the decision flow. The execution logic of each decision component is related to the implementation and configuration of the component; in this way, the core execution process of the decision engine system is stable in the code and does not depend on the rule engine used (such as drools). Among them, serialization and deserialization are inverse operations of each other.
[0076] In this embodiment, the electronic device calls the corresponding engine interface in the interface layer of the decision engine system, precompiles each component in the second decision flow, and can accurately obtain the third decision flow, thereby more accurately executing the third decision flow. Further, the electronic device precompiles the first rule in the component to obtain the precompiled first rule, deserializes the second rule in the component, and obtains the deserialized second rule; in the decision engine system, by abstracting the component into the first rule and the second rule, the execution steps of the component are arranged by the second rule, and the rule engine is responsible for calculating the function and the conditional judgment result, so that it will not be subject to the limitations of the rule engine, and can realize more complex and flexible functions and requirements, and can support more flexible and diverse component types, thereby obtaining a more accurate third decision flow. In addition, the component entity model can be persisted to the database after serialization, and the deserialized component model entity can be read from the database.
[0077] In addition, by extracting the function calculation and conditional judgment statement (first rule) of the component and compiling it into DSL, the DSL is greatly simplified; for example, the rule templates for judging whether the condition is hit are the same for the scorecard component and the rule set component, and the subsequent operations after the condition is hit are determined by the first rule of each component, which can simplify the implementation of the component. When the corresponding rule is hit, the configured additional actions will be executed, such as graying out the font, blackening the font, etc.
[0078] In one embodiment, Figure 4 As shown, the original decision flow is configured through the management subsystem in the business layer of the decision engine system, components are added and configured, and components are compiled; the first rule is compiled and loaded through the rule engine interface, and the second rule is serialized through the serialization interface; the compiled first rule, component type and serialized second rule are saved; and the compiled first rule is stored in the rule library.
[0079] The compiled first rule of the rule library is obtained through the execution subsystem in the business layer of the decision engine system; the first rule is precompiled through the rule engine interface and the precompiled unique identifier is returned, the second rule is deserialized through the deserialization interface to generate an executable component, thereby generating an executable third decision flow based on each executable component, and the third decision flow is cached.
[0080] When the decision flow is executed, the third decision flow to be executed is taken out from the cache, and the start component or the last executed component is located; the component is executed, using the compiled unique identifier and the deserialized second rule; the result is extracted, and additional actions are performed; it is determined whether it is an end component or an abnormal interruption, if so, it ends, otherwise the next component to be executed is taken, and the start component or the last executed component is continued to be located.
[0081] like Figure 5As shown, taking decision flow A as an example, the decision flow A includes a start component, a scorecard component, a rule set component and an end component. The model entity of each component can be unified as a component code code, and the next component code next code. Each component receives input data, processes the input data, and can output a result. Each component includes a first rule and a second rule. The first rules of different components are all different, and the second rules are also all different. When the business layer in the decision engine system executes decision flow A, it is executed in sequence according to the arrangement order of each component in the third decision flow A, that is, the arrangement order of the start component, the scorecard component, the rule set component and the end component.
[0082] In one embodiment, another decision flow execution method is provided, which is applied to an electronic device and includes the following steps:
[0083] Step A1, configure the management subsystem in the business layer of the decision engine system to generate an original decision flow.
[0084] Step A2, obtaining the first rule to be compiled from each component in the original decision flow; calling the rule engine interface associated with the component in the interface layer of the decision engine system, compiling the first rule to be compiled, and obtaining the compiled first rule; serializing the second rule of each component in the original decision flow, and obtaining the serialized second rule; generating the first decision flow based on the compiled first rule and the serialized second rule; the decision flow is a process of a series of decision operations required to achieve business goals, the component is a node in the decision flow, the first rule is a rule composed of adjustable parameters of the component, and the second rule is a rule composed of attribute parameters of the component.
[0085] Step A3, in response to the decision flow execution instruction, load the first decision flow through the execution subsystem in the business layer of the decision engine system to obtain the second decision flow; call the corresponding rule engine interface in the interface layer of the decision engine system to precompile the first rule of each component in the second decision flow to obtain the precompiled first rule; deserialize the second rule of each component in the second decision flow to obtain the deserialized second rule; based on the precompiled first rule and the deserialized second rule, obtain the third decision flow.
[0086] Step A4, calling the decision engine in the adaptation layer of the decision engine system, and executing the components in the third decision flow in sequence according to the arrangement order of the components in the third decision flow.
[0087] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.
[0088] Based on the same inventive concept, the embodiment of the present application also provides a decision flow execution device for implementing the decision flow execution method involved above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method, so the specific limitations in the one or more decision flow execution device embodiments provided below can refer to the limitations of the decision flow execution method above, and will not be repeated here.
[0089] In one embodiment, Figure 6 As shown, a decision flow execution device is provided, including: a loading module 602, a component processing module 604 and an execution module 606, wherein:
[0090] The loading module 602 is used to respond to the decision flow execution instruction and load the first decision flow through the execution subsystem in the business layer of the decision engine system to obtain the second decision flow; the decision flow is a process of a series of decision operations required to achieve business goals.
[0091] The component processing module 604 is used to call the engine interface in the interface layer of the decision engine system to process each component in the second decision flow to obtain a third decision flow; a component is a node in the decision flow.
[0092] The execution module 606 is used to call the decision engine in the adaptation layer of the decision engine system to execute the third decision flow.
[0093] The above-mentioned decision flow execution method, device, electronic device, computer-readable storage medium and computer program product, in response to the decision flow execution instruction, load the first decision flow through the execution subsystem in the business layer of the decision engine system to obtain the second decision flow, which is the process of a series of decision operations required to achieve business goals; call the engine interface in the interface layer of the decision engine system, process each component in the second decision flow, and obtain the third decision flow, which is a node in the decision flow; call the decision engine in the adaptation layer of the decision engine system to execute the third decision flow; that is, by adding an interface layer in the decision engine system, the decision engine in the adaptation layer and the core business layer of the decision engine system are isolated, which can ensure the stability of the core business layer in the decision engine and improve the stability of the decision engine system.
[0094] In one embodiment, the above-mentioned device also includes a first decision flow generation module; the first decision flow generation module is used to call the corresponding rule engine interface in the interface layer of the decision engine system, compile the first rule of each component in the original decision flow, and obtain the compiled first rule; the first rule is a rule composed of adjustable parameters of the component; the second rule of each component in the original decision flow is serialized to obtain a serialized second rule; the second rule is a rule composed of attribute parameters of the component; based on the compiled first rule and the serialized second rule, the first decision flow is generated.
[0095] In one embodiment, the above-mentioned first decision flow generation module is also used to obtain the first rule that needs to be compiled from each component in the original decision flow; call the rule engine interface associated with the component in the interface layer of the decision engine system, compile the first rule that needs to be compiled, and obtain the compiled first rule.
[0096] In one embodiment, the above-mentioned device further includes a configuration module; the configuration module is used to generate an original decision flow by configuring through a management subsystem in a business layer of the decision engine system.
[0097] In one embodiment, the component processing module 604 is further used to call the corresponding engine interface in the interface layer of the decision engine system, precompile the first rule of each component in the second decision flow, and obtain the third decision flow.
[0098] In one embodiment, the component processing module 604 is also used to call the corresponding rule engine interface in the interface layer of the decision engine system, precompile the first rule of each component in the second decision flow, and obtain the precompiled first rule; deserialize the second rule of each component in the second decision flow to obtain the deserialized second rule; the second rule is a rule composed of the attribute parameters of the component; based on the precompiled first rule and the deserialized second rule, a third decision flow is obtained.
[0099] In one embodiment, the execution module 606 is further used to call the decision engine in the adaptation layer of the decision engine system, and execute the components in the third decision flow in sequence according to the arrangement order of the components in the third decision flow.
[0100] Each module in the above-mentioned decision flow execution device can be implemented in whole or in part by software, hardware and a combination thereof. Each of the above-mentioned modules can be embedded in or independent of a processor in an electronic device in the form of hardware, or can be stored in a memory in an electronic device in the form of software, so that the processor can call and execute the operations corresponding to each of the above modules.
[0101] In one embodiment, an electronic device is provided. The electronic device may be a terminal, and its internal structure diagram may be as follows: Figure 6 As shown. The electronic device includes a processor, a memory, an input / output interface, a communication interface, a display unit and an input device. The processor, the memory and the input / output interface are connected via a system bus, and the communication interface, the display unit and the input device are connected to the system bus via the input / output interface. The processor of the electronic device is used to provide computing and control capabilities. The memory of the electronic device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The input / output interface of the electronic device is used to exchange information between the processor and an external device. The communication interface of the electronic device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner can be implemented through WIFI, a mobile cellular network, NFC (near field communication) or other technologies. When the computer program is executed by the processor, a decision flow execution method is implemented. The display unit of the electronic device is used to form a visually visible picture, which can be a display screen, a projection device or a virtual reality imaging device. The display screen can be a liquid crystal display screen or an electronic ink display screen, and the input device of the electronic device can be a touch layer covering the display screen, or a button, trackball or touchpad set on the electronic device casing, or an external keyboard, touchpad or mouse.
[0102] Those skilled in the art will understand that Figure 6The structure shown in the figure is merely a block diagram of a partial structure related to the scheme of the present application, and does not constitute a limitation on the electronic device to which the scheme of the present application is applied. The specific electronic device may include more or fewer components than shown in the figure, or combine certain components, or have a different arrangement of components.
[0103] The embodiment of the present application also provides a computer-readable storage medium, one or more non-volatile computer-readable storage media containing computer-executable instructions, which, when executed by one or more processors, enable the processors to execute the steps of the decision flow execution method.
[0104] An embodiment of the present application also provides a computer program product including instructions, which, when executed on a computer, enables the computer to execute the decision flow execution method.
[0105] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant regulations.
[0106] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., but are not limited to this.
[0107] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0108] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.
Claims
1. A decision flow execution method, characterized in that: include: In response to the decision flow execution instruction, the first decision flow is loaded through the execution subsystem in the business layer of the decision engine system to obtain a second decision flow; The decision flow is a series of decision-making operations that need to be performed in order to achieve business goals; Calling the engine interface in the interface layer of the decision engine system to process each component in the second decision flow to obtain a third decision flow; The component is a node in the decision flow; A decision engine in the adaptation layer of the decision engine system is called to execute the third decision flow.
2. The method according to claim 1, characterized in that In response to the decision flow execution instruction, before the execution subsystem in the business layer of the decision engine system loads the first decision flow to obtain the second decision flow, the method further includes: Calling the corresponding rule engine interface in the interface layer of the decision engine system, compiling the first rule of each component in the original decision flow, and obtaining the compiled first rule; the first rule is a rule composed of adjustable parameters of the component; The second rule of each component in the original decision flow is serialized to obtain a serialized second rule; the second rule is a rule constituted by the attribute parameters of the component; A first decision flow is generated based on the compiled first rule and the serialized second rule.
3. The method according to claim 2, characterized in that The calling of the corresponding rule engine interface in the interface layer of the decision engine system to compile the first rule of each component in the original decision flow to obtain the compiled first rule includes: From each component in the original decision flow, get the first rule that needs to be compiled; The rule engine interface associated with the component in the interface layer of the decision engine system is called to compile the first rule to be compiled to obtain the compiled first rule.
4. The method according to claim 2, characterized in that: The method further comprises: The original decision flow is generated by configuring the management subsystem in the business layer of the decision engine system.
5. The method according to claim 1, characterized in that The calling of the engine interface in the interface layer of the decision engine system to process each component in the second decision flow to obtain a third decision flow includes: The corresponding rule engine interface in the interface layer of the decision engine system is called to precompile the first rule of each component in the second decision flow to obtain a third decision flow; the first rule is a rule composed of adjustable parameters of the component.
6. The method according to claim 5, characterized in that The calling of the corresponding rule engine interface in the interface layer of the decision engine system to precompile the first rule of each component in the second decision flow to obtain the third decision flow includes: Calling a corresponding rule engine interface in the interface layer of the decision engine system to precompile the first rule of each component in the second decision flow to obtain the precompiled first rule; Deserialize the second rule of each component in the second decision flow to obtain the deserialized second rule; the second rule is a rule constituted by the attribute parameters of the component; Based on the precompiled first rule and the deserialized second rule, a third decision flow is obtained.
7. The method according to any one of claims 1 to 6, characterized in that: The calling of the decision engine in the adaptation layer of the decision engine system to execute the third decision flow includes: The decision engine in the adaptation layer of the decision engine system is called to execute the components in the third decision flow in sequence according to the arrangement order of the components in the third decision flow.
8. A decision flow execution device, characterized in that: include: A loading module, configured to load the first decision flow through an execution subsystem in a business layer of a decision engine system in response to a decision flow execution instruction, to obtain a second decision flow; The decision flow is a series of decision-making operations that need to be performed in order to achieve business goals; A component processing module, used for calling the engine interface in the interface layer of the decision engine system, processing each component in the second decision flow, and obtaining a third decision flow; The component is a node in the decision flow; An execution module is used to call the decision engine in the adaptation layer of the decision engine system to execute the third decision flow.
9. An electronic device comprising a memory and a processor, wherein a computer program is stored in the memory, wherein: When the computer program is executed by the processor, the processor is caused to perform the steps of the decision flow execution method according to any one of claims 1 to 7.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.