Data processing method based on rule engine and related equipment

Through the data processing method based on the rule engine, the rule objects are obtained and processed, and the problem that business rules changes affect the system functions is solved, and the process simplification and development efficiency are improved during rule changes are achieved.

CN119719161APending Publication Date: 2025-03-28BEIJING GUODIANTONG NETWORK TECH CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411635311.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-15
Publication Date
2025-03-28

AI Technical Summary

Technical Problem

The current business rules are closely coupled with the system code, resulting in changes in business rules that may have a chain reaction to system functions, increasing the complexity of the change process and uncertainty in development efficiency.

Method used

The data processing method based on the rule engine is adopted, and the rule object is processed by obtaining the rule data and converting it into a rule object. The rule object is processed by the target rules in the rule engine, and the rule processing results are obtained and displayed on the target page.

Benefits of technology

This method allows changes in business rules to not affect the system functions, and can use the latest target rules in the rule engine to process rule objects, reducing the complexity of the process and the uncertainty of development efficiency during rule changes.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119719161A_ABST
    Figure CN119719161A_ABST
Patent Text Reader

Abstract

The invention provides a data processing method based on a rule engine and related equipment. The method comprises the following steps: acquiring rule data, and converting the rule data into a rule object; in response to determining that the rule object meets a pre-stored fact object, processing the rule object by using a target rule in a rule engine to obtain a rule processing result; and displaying the rule processing result on a target page. Therefore, when the target rule is updated, the system function is not influenced, the new target rule in the rule engine can be utilized to process the rule object, and the complexity of the flow and the uncertainty of the development efficiency during rule change are reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of data processing technology, and in particular to a data processing method based on a rule engine and related equipment. Background Art

[0002] As digital transformation accelerates, the need for business rule management and execution is becoming increasingly complex. However, current business rules are tightly coupled with system code, and changes to business rules may have a chain reaction on system functions, increasing the complexity of the change process and the uncertainty of development efficiency.

[0003] In view of this, how to prevent changes in business rules from affecting system functions has become a technical problem that needs to be solved urgently. Summary of the invention

[0004] In view of this, the purpose of the present disclosure is to propose a data processing method based on a rule engine and related devices to solve or partially solve the above technical problems.

[0005] Based on the above objectives, the first aspect of the present disclosure proposes a data processing method based on a rule engine, the method comprising:

[0006] Obtaining rule data and converting the rule data into a rule object;

[0007] In response to determining that the rule object satisfies a pre-stored fact object, processing the rule object using a target rule in a rule engine to obtain a rule processing result;

[0008] The rule processing result is displayed on the target page.

[0009] Based on the same inventive concept, the second aspect of the present disclosure proposes a data processing device based on a rule engine, comprising:

[0010] An acquisition module, configured to acquire rule data and convert the rule data into a rule object;

[0011] A processing module, configured to, in response to determining that the rule object satisfies a pre-stored fact object, process the rule object using a target rule in a rule engine to obtain a rule processing result;

[0012] The display module is configured to display the rule processing result on a target page.

[0013] Based on the same inventive concept, the third aspect of the present disclosure proposes an electronic device, including a memory, a processor, and a computer program stored in the memory and executable by the processor, wherein the processor implements the method as described above when executing the computer program.

[0014] Based on the same inventive concept, a fourth aspect of the present disclosure proposes a non-transitory computer-readable storage medium, wherein the non-transitory computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a computer to execute the method as described above.

[0015] From the above, it can be seen that the data processing method and related equipment based on the rule engine provided by the present disclosure. Obtain rule data and convert the rule data into a rule object. The rule object is a data form that can be processed by the rule engine, which is convenient for the rule engine to process the rule object. When the rule object satisfies the pre-stored fact object, the target rule in the rule engine is used to process the rule object to obtain the rule processing result. The rule processing result is displayed on the target page. In this way, when the target rule is updated, it will not affect the system function. The latest target rule in the rule engine can be used to process the rule object, reducing the complexity of the process and the uncertainty of development efficiency when the rule is changed. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] In order to more clearly illustrate the technical solutions in the present disclosure or related technologies, the drawings required for use in the embodiments or related technical descriptions are briefly introduced below. Obviously, the drawings described below are only embodiments of the present disclosure. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0017] Figure 1 It is a flow chart of a data processing method based on a rule engine according to an embodiment of the present disclosure;

[0018] Figure 2 is a schematic diagram of a rule architecture of an embodiment of the present disclosure;

[0019] Figure 3 It is a structural schematic diagram of a data processing device based on a rule engine according to an embodiment of the present disclosure;

[0020] Figure 4 It is a schematic diagram of the structure of an electronic device according to an embodiment of the present disclosure. DETAILED DESCRIPTION

[0021] In order to make the objectives, technical solutions and advantages of the present disclosure more clearly understood, the present disclosure is further described in detail below in combination with specific embodiments and with reference to the accompanying drawings.

[0022] It should be noted that, unless otherwise defined, the technical terms or scientific terms used in the embodiments of the present disclosure should be understood by people with ordinary skills in the field to which the present disclosure belongs. The "first", "second" and similar words used in the embodiments of the present disclosure do not indicate any order, quantity or importance, but are only used to distinguish different components. "Including" or "comprising" and similar words mean that the elements or objects appearing before the word cover the elements or objects listed after the word and their equivalents, without excluding other elements or objects. "Connect" or "connected" and similar words are not limited to physical or mechanical connections, but can include electrical connections, whether direct or indirect. "Up", "down", "left", "right" and the like are only used to indicate relative positional relationships. When the absolute position of the described object changes, the relative positional relationship may also change accordingly.

[0023] Based on the description of the background technology, in the complex information management system of large enterprises, the rapid formulation and flexible change of business rules have become the key to improving the ability of enterprises to respond to market demands. However, in the traditional way, business rules are tightly coupled with system codes, and any change in business rules may have a chain reaction on other functions of the system, increasing the complexity of the change process and the uncertainty of development efficiency.

[0024] The mainstream rule engines on the market, such as Drools, uRule, and IBM ODM, have their own characteristics, but there is still room for improvement in terms of ease of use, cross-platform support, and intuitive rule management. For example, Drools, as a powerful open source rule engine written in Java, uses the ReteOO algorithm, but the learning curve is steep; uRule provides a Web interface to define rules, but the open source version has stopped updating; IBM ODM has comprehensive functions, but the commercial fee is high.

[0025] As mentioned above, how to prevent business rule changes from affecting system functions has become an important research issue.

[0026] Based on the above description, if Figure 1 As shown, the data processing method based on the rule engine proposed in this embodiment includes:

[0027] Step 101: Obtain rule data and convert the rule data into a rule object.

[0028] Step 102: In response to determining that the rule object satisfies a pre-stored fact object, the rule object is processed using a target rule in a rule engine to obtain a rule processing result.

[0029] Step 103: Display the rule processing result on the target page.

[0030] In specific implementation, the front-end component has a graphical interface that displays and applies rules, obtains configuration information from the configuration center, and obtains the latest rule data from the rule engine service. The graphical interface allows users to understand and build complex business rules in an intuitive way. The interface includes elements such as toolbars, canvases, and property editors, through which users can define, edit, and view rules.

[0031] Based on the EasyRules rule engine, the tree-structured JSON data built on the front end is converted into rule objects that can be recognized by EasyRules and stored in the MySQL database. At the same time, it provides a rich API interface to support the query and execution of rules.

[0032] Business request rule execution obtains rule objects from the local cache and executes them through the EasyRules engine core.

[0033] The results processed by the EasyRules engine core are fed back to the client page in a timely manner.

[0034] Through the above embodiment, the rule data is obtained and converted into a rule object. The rule object is a data form that can be processed by the rule engine, which is convenient for the rule engine to process the rule object. When the rule object satisfies the pre-stored fact object, the target rule in the rule engine is used to process the rule object to obtain the rule processing result. The rule processing result is displayed on the target page. In this way, when the target rule is updated, it will not affect the system function. The latest target rule in the rule engine can be used to process the rule object, reducing the complexity of the process and the uncertainty of development efficiency when the rule is changed.

[0035] In some embodiments, before step 102, the method further includes:

[0036] Step 1021, use the rule engine to define the rule, and obtain the rule name, rule description, rule priority, rule condition and rule action.

[0037] Step 1022, generating a definition rule based on the rule name, the rule description, the rule priority, the rule condition and the rule action.

[0038] Step 1023, registering the defined rule into the rule engine to obtain the target rule.

[0039] In practice, in EasyRules, rules are defined by implementing the Rule interface or declaring them on POJOs using annotations. Rules contain the following main elements:

[0040] Name: A unique identifier for a rule, used to distinguish different rules in a rule set.

[0041] Description: A brief description of the rule's function, which helps to understand and maintain the rule.

[0042] Priority: The order in which rules are executed in the rule engine. Rules with higher priorities are executed first.

[0043] Conditions: The prerequisite for the execution of a rule, that is, when certain conditions are met, the rule will be triggered and executed. These conditions are encapsulated by the implementation of the Condition interface.

[0044] Actions: The operations that need to be performed when the rule conditions are met. These operations are encapsulated by the implementation of the Action interface.

[0045] The defined rules need to be registered in the rule engine so that the rule engine can manage and execute the registered target rules. In the rule engine EasyRules, the defined rules are registered through the implementation of the Rules interface (such as RulesImpl). The rule engine tool can add the target rule instance to the Rules object to build a rule set.

[0046] Through the above scheme, based on the rule name, rule description, rule priority, rule condition and rule action, the definition rule can be accurately generated. The target rule is obtained by registering the definition rule in the rule engine, and then the target rule is stored in the rule engine.

[0047] In some embodiments, after step 1023, the method further includes:

[0048] Step 1023A, determining whether the target rule has been updated.

[0049] Step 1023B, in response to determining that the target rule has been updated, taking the updated target rule as the latest target rule, and updating the target rule stored in the rule engine to the latest target rule.

[0050] In specific implementation, the configuration center regularly sends requests to the rule engine service to check whether the target rule has been updated. When the update notification or polling finds that the target rule has been updated, the configuration center can send an event change message to the message queue.

[0051] After receiving an update notification or discovering through polling that the target rule has been updated, the client obtains the latest target rule from the rule engine service and updates the local cache.

[0052] Through the above solution, when the target rule is updated, the target rule stored in the rule engine is updated to the latest target rule. In this way, when the target rule is updated, it will not affect the system function, and the latest target rule in the rule engine can be used to process the rule object, reducing the complexity of the process and the uncertainty of development efficiency when the rule is changed.

[0053] In some embodiments, after step 1023, the method further includes:

[0054] Step 1023a: receiving a rule combination instruction, and determining a rule combination method according to the rule combination instruction.

[0055] Step 1023b: According to the rule combination instruction, a plurality of target rules are obtained from the target rules pre-stored in the rule engine.

[0056] Step 1023c: Combining the multiple target rules according to the rule combination method to obtain a combined target rule, and storing the combined target rule in the rule engine.

[0057] In specific implementation, the rule engine EasyRules also supports combining multiple simple target rules into more complex combined target rules (CompositeRule). The combined target rules can trigger and execute the rules according to specific logic (such as unit rule group, activation rule group, conditional rule group, etc.). Through rule combination, more flexible and powerful business logic can be constructed.

[0058] Through the above scheme, by combining multiple target rules, the combined target rules can meet more needs of users, so that the rule objects can be processed by using the combined target rules to obtain rule processing results.

[0059] In some embodiments, before step 102, the method further includes:

[0060] Step 1024, obtain the fact object.

[0061] Step 1025: manage the fact object through the fact interface of the rule engine, obtain the corresponding relationship between the fact object and the target rule, and store the corresponding relationship in the rule engine.

[0062] In the specific implementation, during the rule execution process, some known facts need to be processed, which serve as the basis for the rule condition judgment. The rule engine EasyRules manages fact objects through the Facts interface, which is essentially a collection of key-value pairs that allows developers to store and retrieve data related to rule execution.

[0063] Through the above scheme, the correspondence between the fact object and the target rule is stored in the rule engine, so that when the rule object satisfies the pre-stored fact object, the target rule corresponding to the rule object is determined, and the rule object is processed using the target rule to obtain the rule processing result.

[0064] In some embodiments, step 102 includes:

[0065] Step 102A, in response to determining that the rule object is consistent with a pre-stored fact object, determining a target rule corresponding to the fact object according to a correspondence between the fact object and the target rule pre-stored in the rule engine.

[0066] Step 102B: Process the rule object based on the target rule to obtain a rule processing result.

[0067] In practice, rule execution is the core function of the rule engine EasyRules. When all necessary target rules are registered with the rule engine and the corresponding fact objects are available, the rule engine can be started to execute the target rules. In the rule engine EasyRules, this is usually achieved by calling the fire method of the RulesEngine interface. This method accepts a rule set and a fact object as parameters, and then triggers and executes the corresponding rules based on the definition of the target rule and the state of the fact object.

[0068] Through the above scheme, according to the correspondence between the fact object and the target rule, the target rule corresponding to the fact object can be accurately determined, so that the rule object is processed based on the target rule to obtain the rule processing result.

[0069] In some embodiments, step 102 includes:

[0070] Step 102a: Process the rule object using the target rule in the rule engine and obtain the processing status.

[0071] Step 102b, in response to determining that the processing state is an abnormal state, calling a pre-stored abnormal processing mechanism from the rule engine.

[0072] Step 102c: based on the exception handling mechanism, exclude the exceptions in the processing process, and continue to process the rule object to obtain the rule processing result.

[0073] In the specific implementation, various exceptions may be encountered during the rule execution process, such as rule condition evaluation failure, action execution error, etc. The rule engine EasyRules provides a flexible exception handling mechanism, allowing custom exception handling logic. Usually these exceptions will be captured and handled during the rule execution process to ensure the stability and reliability of the rule engine.

[0074] Through the above scheme, when the processing state is an abnormal state, the exception can be quickly and accurately eliminated based on the exception handling mechanism, so as to continue to process the rule object to obtain the rule processing result, avoiding abnormal problems in the process of processing the rule object.

[0075] Through the above embodiment, the rule data is obtained and converted into a rule object. The rule object is a data form that can be processed by the rule engine, which is convenient for the rule engine to process the rule object. When the rule object satisfies the pre-stored fact object, the target rule in the rule engine is used to process the rule object to obtain the rule processing result. The rule processing result is displayed on the target page. In this way, when the target rule is updated, it will not affect the system function. The latest target rule in the rule engine can be used to process the rule object, reducing the complexity of the process and the uncertainty of development efficiency when the rule is changed.

[0076] It should be noted that the embodiments of the present disclosure may be further described in the following manner:

[0077] With the acceleration of digital transformation of enterprises, the demand for business rule management and execution is becoming increasingly complex. In order to meet the rule engine requirements of different platforms (desktop and Web), the disclosed embodiment proposes a cross-platform rule engine system based on EasyRules, and implements it based on the client of Vue.js and Electron, with Mysql database as the backend storage for persistent storage of business rule data. This system not only retains the powerful rule processing capabilities of EasyRules, but also realizes the graphical construction, storage and cross-platform application of rules through innovative client design.

[0078] Figure 2 is a schematic diagram of a rule architecture of an embodiment of the present disclosure, such as Figure 2 As shown in the figure, the rule architecture includes: front-end components, rule engine services, MySQL database and configuration center. The configuration center includes configuration client, local cache, rule execution and engine core. When the configuration center receives a business request, it executes the relevant business request.

[0079] Step 1: The front-end component has a graphical interface that displays and applies rules, obtains configuration information from the configuration center, and obtains the latest rule data from the rule engine service. The graphical interface allows users to understand and build complex business rules in an intuitive way. The interface contains elements such as toolbars, canvases, and property editors, through which users can define, edit, and view rules.

[0080] Step 2: Based on the EasyRules rule engine, convert the tree-structured JSON data built by the front end into rule objects that can be recognized by EasyRules and store them in the MySQL database. At the same time, it provides a rich API interface to support the query and execution of rules.

[0081] Step 3: The configuration center periodically sends requests to the rule engine service to check whether the target rule has been updated. When the target rule is updated through update notification or polling, the configuration center can send an event change message to the message queue.

[0082] Step 4: After receiving the update notification or discovering through polling that the target rule has been updated, the client obtains the latest target rule from the rule engine service and updates the local cache.

[0083] Step 5: Business request rule execution, obtain the rule object from the local cache and execute it through the EasyRules engine core.

[0084] Step 6: Feedback the results processed by the EasyRules engine core to the client page in a timely manner.

[0085] The algorithm of the EasyRules engine in the embodiment of the present disclosure is introduced as follows:

[0086] (1) Rule Definition

[0087] In EasyRules, rules are defined by implementing the Rule interface or declaring them on POJO using annotations. Rules contain the following main elements:

[0088] Name: A unique identifier for a rule, used to distinguish different rules in a rule set.

[0089] Description: A brief description of the rule's function, which helps to understand and maintain the rule.

[0090] Priority: The order in which rules are executed in the rule engine. Rules with higher priorities are executed first.

[0091] Conditions: The prerequisite for the execution of a rule, that is, when certain conditions are met, the rule will be triggered and executed. These conditions are encapsulated by the implementation of the Condition interface.

[0092] Actions: The operations that need to be performed when the rule conditions are met. These operations are encapsulated by the implementation of the Action interface.

[0093] (2) Rule Registration

[0094] The defined rules need to be registered in the rule engine so that the rule engine can manage and execute the registered target rules. In the rule engine EasyRules, the defined rules are registered through the implementation of the Rules interface (such as RulesImpl). The rule engine tool can add the target rule instance to the Rules object to build a rule set.

[0095] (3) Fact Management

[0096] During the rule execution process, some known facts need to be processed, which serve as the basis for the rule condition judgment. The rule engine EasyRules manages fact objects through the Facts interface, which is essentially a collection of key-value pairs that allows developers to store and retrieve data related to rule execution.

[0097] (4) Rule Enforcement

[0098] Rule execution is the core function of the rule engine EasyRules. When all necessary target rules are registered with the rule engine and the corresponding fact objects are available, the rule engine can be started to execute the target rules. In the rule engine EasyRules, this is usually achieved by calling the fire method of the RulesEngine interface. This method accepts a rule set and a fact object as parameters, and then triggers and executes the corresponding rules based on the definition of the target rule and the status of the fact object.

[0099] (5) Exception handling

[0100] During the rule execution process, you may encounter various exceptions, such as rule condition evaluation failure, action execution error, etc. The rule engine EasyRules provides a flexible exception handling mechanism, allowing you to customize the exception handling logic. Usually these exceptions will be captured and handled during the rule execution process to ensure the stability and reliability of the rule engine.

[0101] (6) Rule combination

[0102] EasyRules also supports combining multiple simple rules into more complex rule groups (CompositeRule). These rule groups can trigger and execute the rules according to specific logic (such as unit rule group, activation rule group, conditional rule group, etc.). By combining rules, more flexible and powerful business logic can be constructed.

[0103] The following example code illustrates the rule processing process:

[0104] In the Java sample code, two rules, "Staffing Item Classification" and "Position Classification", are first established. The rules contain annotation execution method settings such as conditional judgment annotations, execution method annotations, and priority annotations. In the example, the priority of the "Staffing Item Classification" rule is higher than the "Position Classification" rule, and the two rules are combined, and the combined rule has the highest priority. In the demonstration example, we first register the rules to the rule engine, and obtain the processing results by looping the rules on the data set and internal objects. This is a simple rule processing process. The sample code is as follows:

[0105]

[0106]

[0107]

[0108]

[0109]

[0110] In the disclosed embodiments, EasyRules is lightweight and extensible. The core package supports the definition of rules in the Java Bean+annotation mode, and the expression language can also be used to define rules. Desktop applications are implemented through Electron, and Web applications are implemented through Vue.js. The rule configuration is visualized, the operation design rule steps are simplified, the cost and risk of hard-coded business rules are reduced, and non-technical personnel are allowed to operate through the interface. The EasyRules engine is independently deployed to separate business rules from application code without affecting the core program, improving the reuse ability of business logic and the ability to quickly respond to demand changes.

[0111] The embodiments of the present disclosure have the following beneficial effects:

[0112] 1. Cross-platform capability: Implement desktop applications through Electron, implement web applications through Vue.js, and realize cross-platform definition and management of rules.

[0113] 2. Graphical interface: Provides an intuitive graphical interface to reduce the complexity of rule definition and improve user experience.

[0114] 3. Highly integrated: Seamlessly integrated with EasyRules, retaining its powerful rule processing capabilities while providing rich client functions.

[0115] 4. Separation of business rules and application code: Improve the reusability of business logic and the ability to quickly respond to changes in requirements, and reduce system maintenance costs.

[0116] It should be noted that the method of the embodiment of the present disclosure can be performed by a single device, such as a computer or a server. The method of the present embodiment can also be applied in a distributed scenario and completed by multiple devices cooperating with each other. In the case of such a distributed scenario, one of the multiple devices can only perform one or more steps in the method of the embodiment of the present disclosure, and the multiple devices will interact with each other to complete the described method.

[0117] It should be noted that the above describes some embodiments of the present disclosure. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the above embodiments and still achieve the desired results. In addition, the processes depicted in the accompanying drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.

[0118] Based on the same inventive concept, corresponding to any of the above-mentioned embodiment methods, the present disclosure also provides a data processing device based on a rule engine.

[0119] refer to Figure 3 , the data processing device based on the rule engine comprises:

[0120] The acquisition module 301 is configured to acquire rule data and convert the rule data into a rule object;

[0121] The processing module 302 is configured to, in response to determining that the rule object satisfies a pre-stored fact object, process the rule object using a target rule in a rule engine to obtain a rule processing result;

[0122] The display module 303 is configured to display the rule processing result on the target page.

[0123] In some embodiments, before the target rule in the rule engine is used to process the rule object to obtain a rule processing result, the device further includes:

[0124] A rule definition module is configured to use a rule engine to perform rule definition and obtain a rule name, a rule description, a rule priority, a rule condition, and a rule action;

[0125] A rule generation module, configured to generate a definition rule based on the rule name, the rule description, the rule priority, the rule condition and the rule action;

[0126] The rule registration module is configured to register the defined rule into the rule engine to obtain the target rule.

[0127] In some embodiments, after registering the defined rule into the rule engine to obtain the target rule, the apparatus further comprises:

[0128] An update determination module, configured to determine whether the target rule has been updated;

[0129] The rule updating module is configured to, in response to determining that the target rule has been updated, use the updated target rule as the latest target rule and update the target rule stored in the rule engine to the latest target rule.

[0130] In some embodiments, after registering the defined rule into the rule engine to obtain the target rule, the apparatus further comprises:

[0131] A mode determination module is configured to receive a rule combination instruction and determine a rule combination mode according to the rule combination instruction;

[0132] A rule acquisition module is configured to acquire a plurality of target rules from target rules pre-stored in the rule engine according to the rule combination instruction;

[0133] The rule combination module is configured to combine the multiple target rules according to the rule combination method to obtain a combined target rule, and store the combined target rule in the rule engine.

[0134] In some embodiments, before the process of processing the rule object using the target rule in the rule engine to obtain the rule processing result in response to determining that the rule object satisfies the pre-stored fact object, the apparatus further comprises:

[0135] An object acquisition module, configured to acquire a fact object;

[0136] The object management module is configured to manage the fact object through the fact interface of the rule engine, obtain the corresponding relationship between the fact object and the target rule, and store the corresponding relationship in the rule engine.

[0137] In some embodiments, the processing module 302 includes:

[0138] a target rule determination unit configured to, in response to determining that the rule object is consistent with a pre-stored fact object, determine the target rule corresponding to the fact object according to a correspondence between the fact object and the target rule pre-stored in the rule engine;

[0139] The processing unit is configured to process the rule object based on the target rule to obtain a rule processing result.

[0140] In some embodiments, the processing module 302 includes:

[0141] a processing status acquisition unit, configured to process the rule object using a target rule in a rule engine and acquire a processing status;

[0142] an exception handling mechanism calling unit, configured to call a pre-stored exception handling mechanism from the rule engine in response to determining that the processing state is an abnormal state;

[0143] The exception elimination processing unit is configured to eliminate the exceptions in the processing process based on the exception processing mechanism, and continue to process the rule object to obtain the rule processing result.

[0144] For the convenience of description, the above device is described by dividing it into various modules according to its functions. Of course, when implementing the present disclosure, the functions of each module can be implemented in the same or multiple software and / or hardware.

[0145] The device of the above embodiment is used to implement the corresponding rule engine-based data processing method in any of the above embodiments, and has the beneficial effects of the corresponding method embodiment, which will not be repeated here.

[0146] Based on the same inventive concept, corresponding to any of the above-mentioned embodiments and methods, the present disclosure also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the rule engine-based data processing method described in any of the above embodiments is implemented.

[0147] Figure 4 A more specific schematic diagram of the hardware structure of an electronic device provided in this embodiment is shown, and the device may include: a processor 1010, a memory 1020, an input / output interface 1030, a communication interface 1040, and a bus 1050. The processor 1010, the memory 1020, the input / output interface 1030, and the communication interface 1040 are connected to each other through the bus 1050 in the device.

[0148] The processor 1010 can be implemented by a general-purpose CPU (Central Processing Unit), a microprocessor, an application-specific integrated circuit (ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in the embodiments of this specification.

[0149] The memory 1020 may be implemented in the form of ROM (Read Only Memory), RAM (Random Access Memory), static storage device, dynamic storage device, etc. The memory 1020 may store an operating system and other application programs. When the technical solutions provided in the embodiments of this specification are implemented by software or firmware, the relevant program codes are stored in the memory 1020 and are called and executed by the processor 1010.

[0150] The input / output interface 1030 is used to connect the input / output module to realize information input and output. The input / output module can be configured in the device as a component (not shown in the figure), or it can be externally connected to the device to provide corresponding functions. The input device may include a keyboard, a mouse, a touch screen, a microphone, various sensors, etc., and the output device may include a display, a speaker, a vibrator, an indicator light, etc.

[0151] The communication interface 1040 is used to connect a communication module (not shown in the figure) to realize communication interaction between the device and other devices. The communication module can realize communication through a wired mode (such as USB (Universal Serial Bus), network cable, etc.), or through a wireless mode (such as mobile network, WIFI (Wireless Fidelity), Bluetooth, etc.).

[0152] The bus 1050 includes a path that transmits information between the various components of the device (eg, the processor 1010, the memory 1020, the input / output interface 1030, and the communication interface 1040).

[0153] It should be noted that, although the above device only shows the processor 1010, the memory 1020, the input / output interface 1030, the communication interface 1040 and the bus 1050, in the specific implementation process, the device may also include other components necessary for normal operation. In addition, it can be understood by those skilled in the art that the above device may also only include the components necessary for implementing the embodiments of the present specification, and does not necessarily include all the components shown in the figure.

[0154] The electronic device of the above embodiment is used to implement the corresponding rule engine-based data processing method in any of the above embodiments, and has the beneficial effects of the corresponding method embodiment, which will not be repeated here.

[0155] Based on the same inventive concept, corresponding to any of the above-mentioned embodiment methods, the present disclosure also provides a non-transitory computer-readable storage medium, wherein the non-transitory computer-readable storage medium stores computer instructions, and the computer instructions are used to enable the computer to execute the rule engine-based data processing method as described in any of the above embodiments.

[0156] The computer-readable medium of this embodiment includes permanent and non-permanent, removable and non-removable media, and information storage can be implemented by any method or technology. Information can be computer-readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, read-only compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device.

[0157] The computer instructions stored in the storage medium of the above embodiment are used to enable the computer to execute the data processing method based on the rule engine as described in any of the above embodiments, and have the beneficial effects of the corresponding method embodiments, which will not be repeated here.

[0158] Those skilled in the art should understand that the discussion of any of the above embodiments is merely illustrative and is not intended to imply that the scope of the present disclosure is limited to these examples. Based on the concept of the present disclosure, the technical features in the above embodiments or different embodiments may be combined, the steps may be implemented in any order, and there are many other variations of the different aspects of the embodiments of the present disclosure as described above, which are not provided in detail for the sake of simplicity.

[0159] In addition, to simplify the description and discussion, and in order not to make the embodiments of the present disclosure difficult to understand, the known power / ground connections to the integrated circuit (IC) chips and other components may or may not be shown in the provided figures. In addition, the device can be shown in the form of a block diagram to avoid making the embodiments of the present disclosure difficult to understand, and this also takes into account the fact that the details of the implementation of these block diagram devices are highly dependent on the platform on which the embodiments of the present disclosure will be implemented (that is, these details should be fully within the scope of understanding of those skilled in the art). Where specific details (e.g., circuits) are set forth to describe exemplary embodiments of the present disclosure, it is apparent to those skilled in the art that the embodiments of the present disclosure can be implemented without these specific details or with changes in these specific details. Therefore, these descriptions should be considered illustrative rather than restrictive.

[0160] Although the present disclosure has been described in conjunction with specific embodiments of the present disclosure, many replacements, modifications and variations of these embodiments will be apparent to those skilled in the art from the foregoing description. For example, other memory architectures (e.g., dynamic RAM (DRAM)) may use the embodiments discussed.

[0161] The embodiments of the present disclosure are intended to cover all such substitutions, modifications and variations that fall within the broad scope of the present disclosure. Therefore, any omissions, modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the embodiments of the present disclosure should be included in the scope of protection of the present disclosure.

Claims

1. A data processing method based on a rule engine, characterized in that: The method comprises: Obtaining rule data and converting the rule data into a rule object; In response to determining that the rule object satisfies a pre-stored fact object, processing the rule object using a target rule in a rule engine to obtain a rule processing result; The rule processing result is displayed on the target page.

2. The method according to claim 1, characterized in that Before the target rule in the rule engine is used to process the rule object to obtain the rule processing result, the method further includes: Use the rule engine to define rules and obtain rule names, rule descriptions, rule priorities, rule conditions, and rule actions; Generate a definition rule based on the rule name, the rule description, the rule priority, the rule condition and the rule action; The defined rule is registered in the rule engine to obtain the target rule.

3. The method according to claim 2, characterized in that After registering the defined rule into the rule engine to obtain the target rule, the method further includes: Determine whether the target rule has been updated; In response to determining that the target rule is updated, the updated target rule is used as the latest target rule, and the target rule stored in the rule engine is updated to the latest target rule.

4. The method according to claim 2, characterized in that: After registering the defined rule into the rule engine to obtain the target rule, the method further includes: receiving a rule combination instruction, and determining a rule combination mode according to the rule combination instruction; According to the rule combination instruction, a plurality of target rules are obtained from the target rules pre-stored in the rule engine; According to the rule combination method, the multiple target rules are combined to obtain a combined target rule, and the combined target rule is stored in the rule engine.

5. The method according to claim 1, characterized in that Before the step of processing the rule object using the target rule in the rule engine to obtain the rule processing result in response to determining that the rule object satisfies the pre-stored fact object, the step further includes: Get the fact object; The fact object is managed through the fact interface of the rule engine, the corresponding relationship between the fact object and the target rule is obtained, and the corresponding relationship is stored in the rule engine.

6. The method according to claim 1, characterized in that In response to determining that the rule object satisfies a pre-stored fact object, processing the rule object using a target rule in a rule engine to obtain a rule processing result includes: In response to determining that the rule object is consistent with a pre-stored fact object, determining a target rule corresponding to the fact object according to a correspondence between the fact object and the target rule pre-stored in the rule engine; The rule object is processed based on the target rule to obtain a rule processing result.

7. The method according to claim 1, characterized in that The process of processing the rule object using the target rule in the rule engine to obtain the rule processing result includes: Processing the rule object using the target rule in the rule engine and obtaining the processing status; In response to determining that the processing state is an abnormal state, calling a pre-stored abnormal processing mechanism from the rule engine; Based on the exception handling mechanism, the exceptions in the processing process are eliminated and the rule object is continuously processed to obtain the rule processing result.

8. A data processing device based on a rule engine, characterized in that: include: An acquisition module, configured to acquire rule data and convert the rule data into a rule object; A processing module, configured to, in response to determining that the rule object satisfies a pre-stored fact object, process the rule object using a target rule in a rule engine to obtain a rule processing result; The display module is configured to display the rule processing result on a target page.

9. An electronic device, characterized in that: The method comprises a memory, a processor and a computer program stored in the memory and running on the processor, wherein when the processor executes the program, the method according to any one of claims 1 to 7 is implemented.

10. A non-transitory computer-readable storage medium, characterized in that: The non-transitory computer-readable storage medium stores computer instructions, and the computer instructions are used to cause a computer to execute the method according to any one of claims 1 to 7.