A business data processing method and related equipment based on rule engine optimization

By dividing business scenarios and establishing factor index tables for the full rules of the rule engine, optimizing the rule set, the complexity and maintenance problems of the rule engine are solved, and efficient management and rapid updates of the rule engine are achieved.

CN116932697BActive Publication Date: 2025-09-02CHINA PING AN PROPERTY INSURANCE CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310968326.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-08-02
Publication Date
2025-09-02
Estimated Expiration
2043-08-02

AI Technical Summary

Technical Problem

The complexity of the rule engine increases as the number of rules increases, making it difficult to manage and maintain, and the repetition and inclusion of rules affect performance and update difficulty.

Method used

By obtaining the full rules of the rule engine, dividing them based on business scenarios, establishing a factor index table, calculating the inclusion relationship between new rules and similar rules, optimizing the rule set, and achieving rapid update and merging of rules.

Benefits of technology

It reduces the complexity of the rule base, improves the maintainability and performance of the rule engine, enhances the accuracy and efficiency of rule matching, and supports the rapid launch and hot deployment of new rules.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116932697B_ABST
    Figure CN116932697B_ABST
Patent Text Reader

Abstract

The present application belongs to the field of financial technology, and relates to a business data processing method and related equipment based on rule engine optimization, including obtaining the full set of rules of the rule engine, each rule containing multiple rule factors and corresponding factor statements; dividing the full set of rules based on business scenarios to obtain rule sets for different business scenarios; establishing a factor index table based on the reference relationship between the rules in the rule set and the rule factors; obtaining a similar rule set of the new rule from the factor index table based on the rule factors of the new rule; calculating the inclusion relationship between the new rule and each similar rule; optimizing the rule set based on the inclusion relationship, and calling the updated rule set to process business data based on the obtained business request. In addition, the present application also involves blockchain technology, and the full set of rules can be stored in the blockchain. The present application can reduce the complexity of the rule base of the rule engine and improve the maintainability and business service capabilities of the rule engine.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the fields of business process optimization technology and financial technology, and in particular to a business data processing method and related equipment based on rule engine optimization. Background Art

[0002] Evolved from inference engines, rule engines are components embedded within applications. They separate business rules from application code and use predefined semantic modules to compose business decisions. A rule engine receives data input, interprets business rules, and makes decisions based on them. Using a rule engine can significantly simplify business processes and improve efficiency and stability.

[0003] However, due to the wide variety of business scenarios, particularly in the financial sector—for example, auto insurance involves scenarios such as reporting and inspection—the complexity of the rule engine increases as the number of rules involved in each business scenario increases, making it difficult to manage and maintain. Rules often overlap and include each other, which can degrade the performance of the rule engine and make rule updates more difficult, impacting the performance of the entire system. Summary of the Invention

[0004] The purpose of the embodiments of the present application is to propose a business data processing method and related equipment based on rule engine optimization to solve the technical problem in the prior art that the complexity of the rule engine increases with the increase in the number of rules, making the rule engine difficult to manage and maintain. At the same time, the duplication and inclusion between rules also make it difficult to update and optimize the rule engine.

[0005] In order to solve the above technical problems, the present application provides a business data processing method based on rule engine optimization, which adopts the following technical solutions:

[0006] Obtaining all rules of the rule engine, wherein each rule includes multiple rule factors and factor statements corresponding to each rule factor, and the factor statements have a logical operation relationship;

[0007] Divide the full set of rules based on business scenarios to obtain rule sets for different business scenarios;

[0008] Establishing a factor index table according to the reference relationship between the rules in the rule set and the rule factors;

[0009] Receive a configured new rule, and obtain a similar rule set of the new rule from the factor index table based on the rule factor of the new rule;

[0010] Calculating the inclusion relationship between the new rule and each similar rule in the similar rule set;

[0011] Obtaining a rule optimization action according to the inclusion relationship, and optimizing the rule set based on the rule optimization action to obtain an updated rule set;

[0012] Acquire business data according to the received business request, and match the business data to the corresponding business scenario in the rule engine;

[0013] According to the business scenario, an updated rule set corresponding to the business scenario is called as a target execution rule, and the business data is processed according to the target execution rule.

[0014] Furthermore, the step of obtaining a similar rule set of the new rule from the factor index table based on the rule factor of the new rule includes:

[0015] Determine the business scenario in which the new rule exists and obtain a target rule set;

[0016] Obtaining a target factor index table of the target rule set, and extracting the target rule factor of the new rule;

[0017] According to each target rule factor, searching the target factor index table for a corresponding target rule as a similar rule;

[0018] All the similar rules are merged to obtain a similar rule set.

[0019] Furthermore, the step of calculating the inclusion relationship between the new rule and each similar rule in the similar rule set includes:

[0020] Calculating the inclusion degree and the inclusion degree between the new rule and the similar rule;

[0021] The inclusion relationship between the new rule and the similar rule is obtained according to the inclusion degree and the included degree.

[0022] Furthermore, the step of obtaining a rule optimization action according to the inclusion relationship includes:

[0023] When the inclusion relationship satisfies a first preset condition, determining that the rule optimization action is to put the new rule online normally;

[0024] When the inclusion relationship satisfies a second preset condition, determining that the rule optimization action is to merge the similar rules into the new rule;

[0025] When the inclusion relationship satisfies a third preset condition, determining that the rule optimization action is to merge the new rule into the similar rule;

[0026] When the inclusion relationship satisfies a fourth preset condition, determining the rule optimization action to replace the similar rule with the new rule;

[0027] When the inclusion relationship satisfies a fifth preset condition, the rule optimization action is determined to be not putting the new rule online.

[0028] Furthermore, after the step of establishing a factor index table based on the reference relationship between the rules in the rule set and the rule factors, the method further includes:

[0029] Traversing all the rules in each of the rule sets, and recording the currently traversed rule as the current optimization rule;

[0030] Based on the rule factor of the current optimization rule, obtaining a current similar rule set of the current optimization rule from the factor index table;

[0031] Calculating the inclusion degree and the included degree between the current optimization rule and each current similar rule in the current similar rule set;

[0032] The rule set is optimized according to the inclusion degree and the included degree.

[0033] Furthermore, the step of optimizing the rule set according to the inclusion degree and the inclusion degree includes:

[0034] When the inclusion degree is within the first preset range, or when the inclusion degree is within the first preset range, keeping the current optimization rule and the current similarity rule unchanged;

[0035] When the inclusion degree is within a second preset range and the inclusion degree is within a second preset range, merging the current optimization rule with the current similarity rule;

[0036] When the inclusion degree reaches a preset threshold, deleting the current optimization rule;

[0037] When the inclusion degree reaches a preset threshold, the current similarity rule is deleted.

[0038] Furthermore, the step of dividing the full set of rules based on business scenarios to obtain rule sets for different business scenarios includes:

[0039] Obtain the rule configuration file corresponding to the business scenario;

[0040] The rule configuration file is parsed to obtain business rules of the business scenario, and the business rules are combined to obtain a rule set.

[0041] In order to solve the above technical problems, the embodiment of the present application further provides a business data processing device based on rule engine optimization, which adopts the following technical solution:

[0042] An acquisition module, configured to acquire all rules of a rule engine, wherein each rule comprises a plurality of rule factors and a factor statement corresponding to each rule factor, wherein the factor statements have a logical operation relationship;

[0043] A division module, configured to divide the full set of rules based on business scenarios to obtain rule sets for different business scenarios;

[0044] An establishment module, configured to establish a factor index table according to a reference relationship between rules in the rule set and rule factors;

[0045] A search module, configured to receive a configured new rule and obtain a similar rule set of the new rule from the factor index table based on the rule factor of the new rule;

[0046] a calculation module, configured to calculate an inclusion relationship between the new rule and each similar rule in the similar rule set;

[0047] an optimization module, configured to obtain a rule optimization action according to the inclusion relationship, and optimize the rule set based on the rule optimization action to obtain an updated rule set;

[0048] A matching module is used to obtain business data according to the received business request and match the business data to the corresponding business scenario in the rule engine;

[0049] The business execution module is used to call the updated rule set corresponding to the business scenario as a target execution rule according to the business scenario, and process the business data according to the target execution rule.

[0050] In order to solve the above technical problems, the embodiment of the present application further provides a computer device, which adopts the following technical solution:

[0051] The computer device includes a memory and a processor, wherein the memory stores computer-readable instructions, and when the processor executes the computer-readable instructions, the steps of the business data processing method based on rule engine optimization are implemented as described above.

[0052] In order to solve the above technical problems, the embodiment of the present application further provides a computer-readable storage medium, which adopts the following technical solution:

[0053] The computer-readable storage medium stores computer-readable instructions, which, when executed by a processor, implement the steps of the business data processing method based on rule engine optimization as described above.

[0054] Compared with the prior art, this application has the following beneficial effects:

[0055] This application divides the acquired full set of rules of the rule engine according to the business scenarios, obtains the rule set corresponding to each business scenario, and establishes a factor index table corresponding to the rule set, obtains similar rules of the new rule according to the factor index table, calculates the inclusion relationship between the new rule and the similar rules, and optimizes the rule set according to the inclusion relationship, which can reduce the complexity of the rule base of the rule engine, make the rule base clearer and easier to maintain, and improve the maintainability of the rule engine; at the same time, it can reduce the computing burden of the rule engine, improve the performance and efficiency of the rule engine, and improve the accuracy and precision of rule matching, which is conducive to the rule update of the rule engine, improves the update efficiency, and makes the new rules available as soon as they are online, realizing the hot deployment of new rules, thereby improving the ability of the rule engine to provide rule parsing services, and also improving the ability of the application system to provide services. BRIEF DESCRIPTION OF THE DRAWINGS

[0056] In order to more clearly illustrate the solutions in this application, a brief introduction will be given below to the drawings required for use in the description of the embodiments of this application. Obviously, the drawings described below are some embodiments of this application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.

[0057] Figure 1 is an exemplary system architecture diagram to which the present application may be applied;

[0058] Figure 2 is a flowchart of an embodiment of a business data processing method based on rule engine optimization according to the present application;

[0059] Figure 3 This is a structural diagram of an embodiment of a business data processing device based on rule engine optimization according to the present application;

[0060] Figure 4 It is a structural diagram of an embodiment of a computer device according to the present application. DETAILED DESCRIPTION

[0061] Unless otherwise defined, all technical and scientific terms used herein have the same meanings as commonly understood by those skilled in the art to which this application belongs. The terms used in the specification of the application are for the purpose of describing specific embodiments only and are not intended to limit this application. The terms "including" and "having" and any variations thereof in the specification and claims of this application and the above-mentioned drawings are intended to cover non-exclusive inclusions. The terms "first", "second", etc. in the specification and claims of this application or the above-mentioned drawings are used to distinguish different objects, not to describe a specific order.

[0062] References herein to "embodiments" mean that a particular feature, structure, or characteristic described in connection with the embodiments may be included in at least one embodiment of the present application. The appearance of this phrase in various places in the specification does not necessarily refer to the same embodiment, nor does it constitute an independent or alternative embodiment that is mutually exclusive of other embodiments. It is understood, both explicitly and implicitly, by those skilled in the art that the embodiments described herein may be combined with other embodiments.

[0063] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the accompanying drawings.

[0064] This application provides a business data processing method based on rule engine optimization, which can be applied to Figure 1 In the illustrated system architecture 100, the system architecture 100 may include terminal devices 101, 102, and 103, a network 104, and a server 105. The network 104 is used as a medium for providing communication links between the terminal devices 101, 102, and 103 and the server 105. The network 104 may include various connection types, such as wired or wireless communication links or fiber optic cables.

[0065] Users can use terminal devices 101, 102, and 103 to interact with server 105 via network 104 to receive or send messages, etc. Various communication client applications can be installed on terminal devices 101, 102, and 103, such as web browser applications, shopping applications, search applications, instant messaging tools, email clients, social platform software, etc.

[0066] Terminal devices 101, 102, and 103 can be various electronic devices with display screens and support web browsing, including but not limited to smartphones, tablet computers, e-book readers, MP3 players (Moving Picture Experts Group Audio Layer III), MP4 (Moving Picture Experts Group Audio Layer IV), laptop computers, desktop computers, etc.

[0067] The server 105 may be a server that provides various services, such as a background server that provides support for web pages displayed on the terminal devices 101 , 102 , and 103 .

[0068] It should be noted that the business data processing method based on rule engine optimization provided in the embodiment of the present application is generally executed by a server / terminal device, and accordingly, the business data processing device based on rule engine optimization is generally set in the server / terminal device.

[0069] It should be understood that Figure 1 The number of terminal devices, networks, and servers in the example is merely illustrative. Any number of terminal devices, networks, and servers may be used as required. An application program configured with a rule engine is installed on the terminal device. The business data processing method based on rule engine optimization in this application optimizes the rule engine by updating its rule set, thereby reducing the complexity of the rule base and improving the data matching efficiency and performance of the rule engine.

[0070] Continue to refer Figure 2 , shows a flowchart of an embodiment of a business data processing method based on rule engine optimization according to the present application, comprising the following steps:

[0071] Step S201: Obtain all rules of the rule engine, wherein each rule includes multiple rule factors and factor statements corresponding to each rule factor, and there is a logical operation relationship between the factor statements.

[0072] The rule engine evolved from the inference engine. It is a component embedded in the application that separates business decisions from application code and uses predefined semantic modules to write business decisions. The rule engine can accept data input, interpret business rules, and make business decisions based on business rules.

[0073] The rule engine can include multiple rule sets. When executing business decisions, it can select the business rule set corresponding to the business scenario from multiple rule sets based on the business scenario matched by the input data. That is, the business rules applicable to the business scenario are selected to meet business needs.

[0074] It's understood that a rule engine can be a component or module within an application, or it can be a standalone system. When used as a standalone system, the rule engine can provide rule parsing services for multiple application systems. These application systems include, but are not limited to, alarm systems, insurance marketing systems, and medical marketing systems.

[0075] In this embodiment, all rules for all businesses in the rule engine are obtained. Each rule contains multiple rule factors and factor statements corresponding to each rule factor. Each factor contains multiple description fields, and the factor statements have logical operation relationships. The rule factors can be rule labels, and the logical operation relationships include AND, OR, and NOT relationships. The corresponding logical operators are "&&," "||," and "!", respectively.

[0076] For example, assuming that rule 1 contains rule factors A, B, and C, the corresponding factor statements, description fields, and factor logical expressions are shown in Table 1.

[0077] Table 1

[0078]

[0079] In this embodiment, the factor statement can describe the corresponding field through natural language, that is, the factor statement can be a text of natural language; the rule statement can also describe the corresponding field through machine language, that is, the factor statement can be a text of machine language, but is not limited to this.

[0080] It should be emphasized that in order to further ensure the privacy and security of the full rules, the above full rules can also be stored in a node of a blockchain.

[0081] The blockchain referred to in this application is a new application model for computer technologies such as distributed data storage, peer-to-peer transmission, consensus mechanisms, and encryption algorithms. Blockchain is essentially a decentralized database, a series of data blocks generated using cryptographic methods. Each data block contains information about a batch of network transactions, which is used to verify the validity of this information (to prevent counterfeiting) and generate the next block. Blockchain can include the underlying blockchain platform, the platform product service layer, and the application service layer.

[0082] Step S202: Divide all rules based on business scenarios to obtain rule sets for different business scenarios.

[0083] In this embodiment, the rule engine contains the business rules required to execute the business process. All rules are divided according to business scenarios to obtain a rule set for each business scenario. For example, in an auto insurance system, different stages are included, such as the reporting stage, the inspection stage, the damage assessment stage, and the compensation stage. Different stages contain different business scenarios. For example, the business scenarios of the inspection stage include inspection departure standards, inspection arrival standards, full-case inspection standards, and inspection delivery standards; the business scenarios of the damage assessment stage include damage assessment delivery guidance, damage assessment quotation delivery, and damage assessment verification customer push. Each business scenario has its corresponding business rules.

[0084] In some optional implementations, a rule configuration file corresponding to a business scenario is obtained; the rule configuration file is parsed to obtain business rules for the business scenario, and the business rules are combined to obtain a rule set.

[0085] Business rules typically exist in the form of configuration files, known as rule configuration files. These configuration files are generated based on rule configuration information. These information includes the various rules for executing business processes and the logical relationships between these rules. These logical relationships represent all business rules in a business scenario. By parsing the rule configuration file, the corresponding business rules are obtained, and these rules are organized into a rule set for the business scenario.

[0086] By parsing the rule configuration files of business scenarios to obtain business rules, the efficiency of obtaining business rules is improved.

[0087] Step S203: Create a factor index table based on the reference relationship between the rules in the rule set and the rule factors.

[0088] A reference relationship indicates that a rule references a rule factor, that is, a rule uses a rule factor. It should be understood that each rule factor may be used by multiple rules, and the factor index table is used to record which rules have used each rule factor.

[0089] For example, the rule set includes rule 1, rule 2, rule 3 and rule 4. Rule 1 includes rule factors A, B and C; rule 2 includes rule factor A; rule 3 includes rule factors B and C; and rule 4 includes rule factor C. All rule factors are extracted, and a factor index table is established based on the reference relationship between rules and rule factors, as shown in Table 2.

[0090] Table 2

[0091] Rule Factor Rules of use A Rule 1; Rule 2 B Rule 1; Rule 3 C Rule 1; Rule 3; Rule 4

[0092] By redefining the rules through the factor index table, the rules can be combined through the rule factors. It has good scalability and can meet complex rule requirements. It is well suited for scenarios with flexible and changeable business, many rules, and high traffic.

[0093] Step S204: receiving a configured new rule, and obtaining a similar rule set of the new rule from a factor index table based on the rule factor of the new rule.

[0094] The existing rule engine needs to stop the rule parsing service when adding new rules, and recompile and program deployment are required after adding new rules. It is difficult to update rules and cannot achieve rapid reuse and rapid configuration of rules.

[0095] In this embodiment, rule optimization and updating are performed according to the rule factor of the new rule, and when a new rule is received, a similar rule search is performed on the new rule.

[0096] In some optional implementations, the step of obtaining a similar rule set of the new rule from the factor index table based on the rule factor of the new rule includes:

[0097] Determine the business scenario where the new rule is located and obtain the target rule set;

[0098] Obtain the target factor index table of the target rule set and extract the target rule factor of the new rule;

[0099] According to each target rule factor, the corresponding target rule is searched in the target factor index table as a similar rule;

[0100] All similar rules are merged to obtain a similar rule set.

[0101] Determine the business scenario where the new rule is located, obtain the rule set of the business scenario, and then determine the corresponding factor index table; extract the rule factors of the new rule, and search the factor index table for the rules that use each rule factor of the new rule. The rules found are similar rules, and all similar rules found are merged, that is, the union of all similar rules is the similar rule set.

[0102] In this embodiment, similar rules are searched in the factor index table through the rule factor of the new rule, which can improve the search efficiency and reduce the calculation burden of similar rules; the similar rules found are merged, duplicate rules are removed, and the search accuracy is improved, so as to improve the efficiency and accuracy of subsequent optimization updates.

[0103] Step S205: Calculate the inclusion relationship between the new rule and each similar rule in the similar rule set.

[0104] Specifically, the inclusion degree and the included degree between the new rule and the similar rule are calculated; and the inclusion relationship between the new rule and the similar rule is obtained according to the inclusion degree and the included degree.

[0105] In this embodiment, the new rule is compared with each similar rule in the similar rule set in pairs, and the inclusion degree and the included degree are calculated. The inclusion relationship is represented by the inclusion degree and the included degree.

[0106] The degree of inclusion refers to the degree to which a set is contained in another set, and the degree of being contained refers to the degree to which a set is contained in another set. "Contained" means contained within. For example, "A is contained in B" means that A is contained within B, i.e., A is a subset of B; "A is contained in B" means that A contains B, i.e., B is a subset of A.

[0107] The calculation formulas for inclusion and inclusion are as follows:

[0108] Inclusion

[0109] Inclusion

[0110] Among them, logic new and logic old Respectively represent the new rules new and similar rules old Factor logical expression of C new and C old Respectively represent the new rules new and similar rules old Multiple factor statements describe the Cartesian product of field sets; P(logic new ) indicates a new rule new The ratio of multiple rule factors to 1 in the truth table; P(logic old ) indicates similar rule old The ratio of multiple rule factors to 1 in the truth table; P(logic new andlogic old ) indicates a new rule new and similar rules old The proportion of regular factor unions that are 1 in the truth table.

[0111] For example, the rule factors of the new rule are 0438 and 0444. The description fields corresponding to 0438 are rear door shell outer panel (left) and side sliding door outer panel (left), and the description fields corresponding to 0444 are right wheel arch trim paint and rear wheel rim (right). The rule factors of the similar rule are 0438, 0444, and 0002. Among them, the description fields of 0438 are rear door shell outer panel (left), side sliding door outer panel (left), and headlight (left), the description field of 0444 is side wheel arch trim paint, and the description field of 0002 is Tesla MODEL3 new energy. The inclusion calculation formula between the new rule and the similar rule is as follows:

[0112]

[0113]

[0114] This embodiment calculates the inclusion degree and the degree of being included between the new rule and similar rules, so as to clearly understand the inclusion relationship between the new rule and similar rules, which is beneficial to the subsequent optimization and update of the rule set.

[0115] Step S206: Obtain a rule optimization action according to the inclusion relationship, optimize the rule set based on the rule optimization action, and obtain an updated rule set.

[0116] Among them, optimization actions include normal online, merging similar rules into new rules, merging new rules into similar rules, replacing similar rules with new rules, and not launching new rules, etc. Similar rules are old rules.

[0117] The first precondition is the inclusion degree (rule new , rule old )=0%&&inclusion(rule new , rule old )=0%, indicating that the new rule and similar rules do not have common rule factors, that is, the new rule does not overlap with the old rule at all, and the rules are not repeated, so the new rule can be directly added to the rule set;

[0118] The second precondition is 0% < inclusion (rule new , rule old )<100%&&0%<inclusion(rule new , rule old )<100%&&inclusion(rule new , rule old )<inclusion degree(rule new , rule old), indicating that the new rule has more rule factors than similar rules, and there are some common rule factors, that is, there are repeated rules. In this case, the rule factors in the similar rules are merged into the new rule to obtain the optimized new rule and add it to the rule set;

[0119] The third precondition is 0% < inclusion (rule new , rule old )<100%&&0%<inclusion(rule new , rule old )<100%&&inclusion(rule new , rule old )>Inclusion(rule new , rule old ), indicating that the rule factors in the new rule are less than those in the similar rules, and there are some common rule factors, that is, there are repeated rules. In this case, the rule factors in the new rule are merged into the similar rules to obtain the optimized new rule, and then the updated rule set is obtained;

[0120] The fourth preset condition is 0% < inclusion (rule new , rule old )<100%&&inclusion(rule new , rule old ) = 100%, indicating that the new rule contains all the rule factors of the similar rule, and the new rule replaces the similar rule;

[0121] The fifth precondition is the inclusion degree (rule new , rule old )=100%, indicating that all the rule factors of the new rule are included in the similar rules, that is, the new rule is repeated with the old rule, and the new rule will not be processed online.

[0122] In this embodiment, merging similar rules into new rules, merging new rules into similar rules, and replacing similar rules with new rules can all be collectively referred to as reorganization of rule factors.

[0123] Duplicate rules not only increase the complexity of the rule engine, but also increase the computational burden of the rule engine. If the rule engine repeatedly calculates the same rules when executing the rules, it will waste a lot of time and resources, affecting the performance and efficiency of the rule engine. At the same time, it may cause the rule engine to perform the same operations, resulting in unnecessary errors or conflicts.

[0124] In this embodiment, when configuring a new rule, the degree of inclusion and degree of being included calculated by the rule factor can be used to determine whether there are duplicate rules in the rule set. If there are duplicate rules, the duplicate rules can be optimized by reorganizing the rule factors, which can reduce the computational burden of the rule engine, improve the performance and efficiency of the rule engine, reduce errors and conflicts caused by executing the same operations, and improve the accuracy and precision of rule matching.

[0125] Step S207: Obtain business data according to the received business request, and match the business data to the corresponding business scenario in the rule engine.

[0126] The service request received from the user client contains a service identifier. The service identifier can be used to obtain the corresponding service data. The rule engine is configured with rules corresponding to different business scenarios. In order to call the rules to execute the service data, the service data needs to be matched to the corresponding service scenario in the rule engine.

[0127] For example, a business request may be an underwriting request, a claim settlement request, a payment request, a rights issuance request, a risk identification request, and the like.

[0128] Step S208: Based on the business scenario, the corresponding updated rule set in the rule engine is called as the target execution rule, and the business data is processed according to the target execution rule.

[0129] In this embodiment, the rules in the rule engine are divided according to business scenarios. Specifically, the rule engine contains rule sets corresponding to different business scenarios. Based on the identified business scenario, the updated rule set that matches the business request is used as the target execution rule for executing the business request. Business data is processed according to the target execution rule to complete the corresponding business process.

[0130] It should be understood that the present application uses an optimized rule engine to execute business, which can avoid repeated calls of the same rules, causing errors and conflicts during business execution, and at the same time, improve business execution capabilities.

[0131] This application divides the acquired full set of rules of the rule engine according to the business scenarios, obtains the rule set corresponding to each business scenario, and establishes a factor index table corresponding to the rule set, obtains similar rules of the new rule according to the factor index table, calculates the inclusion relationship between the new rule and the similar rules, and optimizes the rule set according to the inclusion relationship, which can reduce the complexity of the rule base, make the rule base clearer and easier to maintain, and improve the maintainability of the rule engine; at the same time, it can reduce the computing burden of the rule engine, improve the performance and efficiency of the rule engine, and improve the accuracy and precision of rule matching. The optimized rule engine is easier to update rules, improves update efficiency, enables new rules to be quickly put online, and realizes hot deployment of new rules, thereby improving the ability of the rule engine to provide rule parsing services and the ability of the application system to provide services.

[0132] In some optional implementations, after the step of establishing a factor index table based on the reference relationship between the rules in the rule set and the rule factors, the following steps are further performed:

[0133] Traverse all the rules in each rule set and record the currently traversed rule as the current optimization rule;

[0134] Based on the rule factor of the current optimization rule, obtain the current similar rule set of the current optimization rule from the factor index table;

[0135] Calculate the inclusion degree and the degree of inclusion between the current optimization rule and each current similar rule in the current similar rule set;

[0136] The rule set is optimized according to the inclusion degree and the included degree.

[0137] The rule base of a rule engine contains a large number of rules. If there are a large number of duplicate rules, the rule base will increase in complexity, making it difficult to manage and maintain. In this embodiment, it is necessary to optimize the rule set for each business scenario in the rule engine to reduce the complexity of the rule base, make the rule base clearer and easier to understand, and thus make the rule engine easier to maintain and manage.

[0138] Specifically, for each business scenario, a similar rule search is performed on each rule in the rule set to obtain the current similar rule set. The similar rule search is the same as step S204 and will not be repeated here.

[0139] The same method as step S205 is used to calculate the inclusion degree (rule1, rule2) and the inclusion degree (rule1, rule2) between the current optimization rule rule1 and each current similar rule rule2, and the optimization action is determined based on the inclusion degree (rule1, rule2) and the inclusion degree (rule1, rule2). The rule set of each business scenario is optimized according to the rule optimization action.

[0140] In this embodiment, the optimization actions include keep, merge and delete, where keep means keeping the current optimization rule and the current similarity rule unchanged; merge means that the current optimization rule and the current similarity rule have an intersection and the two are merged; delete means deleting the included rules.

[0141] In some optional implementations, an optimization action can be decided based on the degree of inclusion and the degree of being included. Specifically, when the degree of inclusion is within the first preset range, or the degree of being included is within the first preset range, the corresponding optimization action is maintenance; when the degree of inclusion is within the second preset range and the degree of being included is within the second preset range, the corresponding optimization action is merging; when the degree of inclusion is the preset threshold or the degree of being included is the preset threshold, the corresponding optimization action is deletion.

[0142] For example, the inclusion and inclusion degrees corresponding to different optimization actions are as follows:

[0143] Maintain: Inclusion (rule1, rule2) < 50% || Inclusion (rule1, rule2) < 50%, indicating that the degree of inclusion between the two rules is small and the shared rule factors are small;

[0144] Merge: 100% > inclusion (rule1, rule2) ≥ 50% && 100% > inclusion (rule1, rule2) ≥ 50%, indicating that the two rules have a high degree of inclusion and share many common rule factors.

[0145] Deletion: Inclusion degree (rule1, rule2) = 100%, indicating that all rule factors in the current optimization rule are included in the current similar rule, and the included current optimization rule will be deleted; inclusion degree (rule1, rule2) = 100%, indicating that the current optimization rule includes all rule factors of the current similar rule, and the included current similar rule will be deleted.

[0146] By optimizing the historical rules of each business scenario in the rule engine through the above optimization actions, the complexity of the rule base can be reduced, the computational burden of the rule engine can be reduced, the accuracy and precision of rule matching can be improved, the maintainability of the rule engine can be improved, and the difficulty of rule updates can be reduced.

[0147] The present application can be used in many general or special computer system environments or configurations. For example: personal computers, server computers, handheld or portable devices, tablet devices, multiprocessor systems, microprocessor-based systems, set-top boxes, programmable consumer electronics, network PCs, minicomputers, mainframe computers, distributed computing environments including any of the above systems or devices, and the like. The present application can be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, and the like that perform specific tasks or implement specific abstract data types. The present application can also be practiced in distributed computing environments in which tasks are performed by remote processing devices connected via a communication network. In a distributed computing environment, program modules can be located in local and remote computer storage media, including storage devices.

[0148] Those skilled in the art will appreciate that all or part of the processes in the above-described method embodiments can be implemented by instructing related hardware via computer-readable instructions. The computer-readable instructions can be stored in a computer-readable storage medium, and when the program is executed, it can include the processes in the above-described method embodiments. The aforementioned storage medium can be a non-volatile storage medium such as a magnetic disk, an optical disk, a read-only memory (ROM), or a random access memory (RAM).

[0149] It should be understood that although the steps in the flowcharts of the accompanying drawings are shown in sequence as indicated by the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some of the steps in the flowcharts of the accompanying drawings may include multiple sub-steps or multiple stages, and these sub-steps or stages are not necessarily executed at the same time, but can be executed at different times, and their execution order is not necessarily sequential, but can be executed in turn or alternately with other steps or at least a portion of the sub-steps or stages of other steps.

[0150] Further references Figure 3 , as a response to the above Figure 2 The present application provides an embodiment of a business data processing device based on rule engine optimization. Figure 2 Corresponding to the method embodiment shown, the device can be specifically applied to various electronic devices.

[0151] like Figure 3As shown, the business data processing device 300 based on rule engine optimization in this embodiment includes: an acquisition module 301, a division module 302, a creation module 303, a search module 304, a calculation module 305, an optimization module 306, a matching module 307 and a business execution module 308. Among them:

[0152] The acquisition module 301 is used to acquire all rules of the rule engine, wherein each rule includes multiple rule factors and factor statements corresponding to each rule factor, and the factor statements have a logical operation relationship;

[0153] The division module 302 is used to divide the full set of rules based on business scenarios to obtain rule sets for different business scenarios;

[0154] The establishment module 303 is used to establish a factor index table according to the reference relationship between the rules in the rule set and the rule factors;

[0155] The search module 304 is configured to receive a configured new rule and obtain a similar rule set of the new rule from the factor index table based on the rule factor of the new rule;

[0156] The calculation module 305 is used to calculate the inclusion relationship between the new rule and each similar rule in the similar rule set;

[0157] The optimization module 306 is configured to obtain a rule optimization action according to the inclusion relationship, and optimize the rule set based on the rule optimization action to obtain an updated rule set;

[0158] The matching module 307 is used to obtain business data according to the received business request and match the business data to the corresponding business scenario in the rule engine;

[0159] The business execution module 308 is configured to call the updated rule set corresponding to the business scenario as a target execution rule according to the business scenario, and process the business data according to the target execution rule.

[0160] It should be emphasized that in order to further ensure the privacy and security of the full rules, the above full rules can also be stored in a node of a blockchain.

[0161] Based on the above-mentioned business data processing device optimized based on the rule engine, the full amount of rules of the acquired rule engine are divided according to the business scenario to obtain the rule set corresponding to each business scenario, and a factor index table corresponding to the rule set is established. The similar rules of the new rule are obtained according to the factor index table, and the inclusion relationship between the new rule and the similar rule is calculated. The rule set is optimized according to the inclusion relationship, which can reduce the complexity of the rule base, make the rule base clearer and easier to maintain, and improve the maintainability of the rule engine; at the same time, it can reduce the computing burden of the rule engine, improve the performance and efficiency of the rule engine, and improve the accuracy and precision of rule matching. The optimized rule engine is easier to update rules, improves the update efficiency, and enables new rules to be quickly put online, realizing the hot deployment of new rules, thereby improving the ability of the rule engine to provide rule parsing services, and also improving the ability of the application system to provide services.

[0162] In some optional implementations of this embodiment, the search module 304 is further configured to:

[0163] Determine the business scenario in which the new rule exists and obtain a target rule set;

[0164] Obtaining a target factor index table of the target rule set, and extracting the target rule factor of the new rule;

[0165] According to each target rule factor, searching the target factor index table for a corresponding target rule as a similar rule;

[0166] All the similar rules are merged to obtain a similar rule set.

[0167] By searching for similar rules in the factor index table using the rule factor of the new rule, the search efficiency can be improved and the calculation burden of similar rules can be reduced; similar rules found can be merged, duplicate rules can be removed, and the search accuracy can be improved, so as to improve the efficiency and accuracy of subsequent optimization updates.

[0168] In this embodiment, the calculation module 305 is further configured to:

[0169] Calculating the inclusion degree and the inclusion degree between the new rule and the similar rule;

[0170] The inclusion relationship between the new rule and the similar rule is obtained according to the inclusion degree and the included degree.

[0171] By calculating the inclusion degree and the degree of being included between the new rule and similar rules, we can clearly understand the inclusion relationship between the new rule and similar rules, which is conducive to the subsequent optimization and update of the rule set.

[0172] In some optional implementations, the optimization module 306 includes an action decision submodule configured to:

[0173] When the inclusion relationship satisfies a first preset condition, determining that the first optimization action is to put the new rule online normally;

[0174] When the inclusion relationship satisfies a second preset condition, determining that the first optimization action is to merge the similar rules into the new rule;

[0175] When the inclusion relationship satisfies a third preset condition, determining that the first optimization action is to merge the new rule into the similar rule;

[0176] When the inclusion relationship satisfies a fourth preset condition, determining that the first optimization action is to replace the similar rule with the new rule;

[0177] When the inclusion relationship satisfies a fifth preset condition, the first optimization action is determined to be not putting the new rule online.

[0178] Optimizing repeated rules by reorganizing rule factors can reduce the computational burden of the rule engine, improve the performance and efficiency of the rule engine, reduce errors and conflicts caused by executing the same operations, and improve the accuracy and precision of rule matching.

[0179] In some optional implementations, the business data processing apparatus 300 based on rule engine optimization further includes a historical rule optimization module, which includes a traversal submodule, a search submodule, a calculation submodule, and an optimization submodule, wherein:

[0180] The traversal submodule is used to traverse all the rules in each of the rule sets and record the currently traversed rule as the current optimization rule;

[0181] The search submodule is used to obtain a current similar rule set of the current optimization rule from the factor index table based on the rule factor of the current optimization rule;

[0182] The calculation submodule is used to calculate the inclusion degree and the inclusion degree between the current optimization rule and each current similar rule in the current similar rule set;

[0183] The optimization submodule is used to optimize the rule set according to the inclusion degree and the inclusion degree.

[0184] In some optional implementations of this embodiment, the optimization submodule is further configured to:

[0185] When the inclusion degree is within the first preset range, or when the inclusion degree is within the first preset range, keeping the current optimization rule and the current similarity rule unchanged;

[0186] When the inclusion degree is within a second preset range and the inclusion degree is within a second preset range, merging the current optimization rule with the current similarity rule;

[0187] When the inclusion degree reaches a preset threshold, deleting the current optimization rule;

[0188] When the inclusion degree reaches a preset threshold, the current similarity rule is deleted.

[0189] By optimizing the historical rules for each business scenario in the rule engine, we can reduce the complexity of the rule base, reduce the computational burden of the rule engine, improve the accuracy and precision of rule matching, improve the maintainability of the rule engine, and reduce the difficulty of rule updates.

[0190] In this embodiment, the division module 302 is further configured to:

[0191] Obtain the rule configuration file corresponding to the business scenario;

[0192] The rule configuration file is parsed to obtain business rules of the business scenario, and the business rules are combined to obtain a rule set.

[0193] By parsing the rule configuration files of business scenarios to obtain business rules, the efficiency of obtaining business rules is improved.

[0194] To solve the above technical problems, the present application also provides a computer device. Figure 4 , Figure 4 This is a basic structural block diagram of the computer device in this embodiment.

[0195] The computer device 4 includes a memory 41, a processor 42, and a network interface 43 that are interconnected through a system bus. It should be noted that the figure only shows a computer device 4 with components 41-43, but it should be understood that it is not required to implement all the components shown, and more or fewer components can be implemented instead. Among them, those skilled in the art can understand that the computer device here is a device that can automatically perform numerical calculations and / or information processing according to pre-set or stored instructions, and its hardware includes but is not limited to microprocessors, application-specific integrated circuits (ASICs), programmable gate arrays (FPGAs), digital signal processors (DSPs), embedded devices, etc.

[0196] The computer device may be a desktop computer, notebook computer, PDA, cloud server, etc. The computer device may interact with the user via a keyboard, mouse, remote control, touchpad, or voice control device.

[0197] The memory 41 includes at least one type of readable storage medium, including flash memory, hard disk, multimedia card, card-type memory (e.g., SD or DX memory), random access memory (RAM), static random access memory (SRAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), programmable read-only memory (PROM), magnetic memory, magnetic disk, optical disk, etc. In some embodiments, the memory 41 can be an internal storage unit of the computer device 4, such as the hard disk or memory of the computer device 4. In other embodiments, the memory 41 can also be an external storage device of the computer device 4, such as a plug-in hard disk equipped on the computer device 4, a smart memory card (SMC), a secure digital (SD) card, a flash memory card, etc. Of course, the memory 41 can also include both the internal storage unit of the computer device 4 and its external storage device. In this embodiment, the memory 41 is generally used to store the operating system and various application software installed on the computer device 4, such as computer-readable instructions of the business data processing method based on rule engine optimization. In addition, the memory 41 can also be used to temporarily store various types of data that have been output or are to be output.

[0198] In some embodiments, the processor 42 may be a central processing unit (CPU), a controller, a microcontroller, a microprocessor, or other data processing chip. The processor 42 is generally used to control the overall operation of the computer device 4. In this embodiment, the processor 42 is used to execute computer-readable instructions stored in the memory 41 or process data, such as computer-readable instructions for executing the business data processing method based on rule engine optimization.

[0199] The network interface 43 may include a wireless network interface or a wired network interface. The network interface 43 is generally used to establish a communication connection between the computer device 4 and other electronic devices.

[0200] This embodiment implements the steps of the business data processing method based on rule engine optimization as in the above embodiment when the processor executes computer-readable instructions stored in the memory. By dividing the full amount of rules of the acquired rule engine according to the business scenario, a rule set corresponding to each business scenario is obtained, and a factor index table corresponding to the rule set is established. Similar rules of the new rule are obtained according to the factor index table, and the inclusion relationship between the new rule and the similar rule is calculated. The rule set is optimized according to the inclusion relationship, which can reduce the complexity of the rule base, make the rule base clearer and easier to maintain, and improve the maintainability of the rule engine; at the same time, it can reduce the computing burden of the rule engine, improve the performance and efficiency of the rule engine, and improve the accuracy and precision of rule matching. The optimized rule engine is easier to update rules, improves update efficiency, enables new rules to be quickly put online, and realizes hot deployment of new rules, thereby improving the ability of the rule engine to provide rule parsing services and the ability of the application system to provide services.

[0201] The present application also provides another embodiment, namely, providing a computer-readable storage medium, which stores computer-readable instructions, and the computer-readable instructions can be executed by at least one processor to enable the at least one processor to perform the steps of the business data processing method based on rule engine optimization as described above, by dividing the full amount of rules of the acquired rule engine according to business scenarios, obtaining a rule set corresponding to each business scenario, and establishing a factor index table corresponding to the rule set, obtaining similar rules of the new rule according to the factor index table, calculating the inclusion relationship between the new rule and the similar rule, and optimizing the rule set according to the inclusion relationship, which can reduce the complexity of the rule base, make the rule base clearer and easier to maintain, and improve the maintainability of the rule engine; at the same time, it can reduce the computing burden of the rule engine, improve the performance and efficiency of the rule engine, and also improve the accuracy and precision of rule matching. The optimized rule engine is easier to update rules, improves update efficiency, enables new rules to be quickly put online, and realizes hot deployment of new rules, thereby improving the ability of the rule engine to provide rule parsing services, and also improving the ability of the application system to provide services.

[0202] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus the necessary general hardware platform, and of course can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes a number of instructions for enabling a terminal device (which can be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods described in each embodiment of the present application.

[0203] Obviously, the embodiments described above are only some of the embodiments of the present application, rather than all of the embodiments. The preferred embodiments of the present application are given in the accompanying drawings, but they do not limit the patent scope of the present application. The present application can be implemented in many different forms. On the contrary, the purpose of providing these embodiments is to make the understanding of the disclosure of the present application more thorough and comprehensive. Although the present application has been described in detail with reference to the aforementioned embodiments, for those skilled in the art, it is still possible to modify the technical solutions described in the aforementioned specific embodiments, or to make equivalent replacements for some of the technical features therein. Any equivalent structure made using the contents of the present application specification and the accompanying drawings, directly or indirectly used in other related technical fields, is also within the scope of patent protection of the present application.

Claims

1. A business data processing method based on rule engine optimization, characterized in that: The steps include: Obtaining all rules of the rule engine, wherein each rule includes multiple rule factors and factor statements corresponding to each rule factor, and the factor statements have a logical operation relationship; Divide the full set of rules based on business scenarios to obtain rule sets for different business scenarios; Establishing a factor index table according to the reference relationship between the rules in the rule set and the rule factors; Receive a configured new rule, and obtain a similar rule set of the new rule from the factor index table based on the rule factor of the new rule; Calculating the inclusion relationship between the new rule and each similar rule in the similar rule set; Obtaining a rule optimization action according to the inclusion relationship, and optimizing the rule set based on the rule optimization action to obtain an updated rule set; Acquire business data according to the received business request, and match the business data to the corresponding business scenario in the rule engine; According to the business scenario, the corresponding updated rule set in the business scenario is called as a target execution rule, and the business data is processed according to the target execution rule.

2. The business data processing method based on rule engine optimization according to claim 1 is characterized in that: The step of obtaining a similar rule set of the new rule from the factor index table based on the rule factor of the new rule comprises: Determine the business scenario in which the new rule exists and obtain a target rule set; Obtaining a target factor index table of the target rule set, and extracting the target rule factor of the new rule; According to each target rule factor, searching the target factor index table for a corresponding target rule as a similar rule; All the similar rules are merged to obtain a similar rule set.

3. The business data processing method based on rule engine optimization according to claim 1 is characterized in that: The step of calculating the inclusion relationship between the new rule and each similar rule in the similar rule set includes: Calculating the inclusion degree and the inclusion degree between the new rule and the similar rule; The inclusion relationship between the new rule and the similar rule is obtained according to the inclusion degree and the included degree.

4. The business data processing method based on rule engine optimization according to claim 3 is characterized in that: The step of obtaining a rule optimization action according to the inclusion relationship includes: When the inclusion relationship satisfies a first preset condition, determining that the rule optimization action is to put the new rule online normally; When the inclusion relationship satisfies a second preset condition, determining that the rule optimization action is to merge the similar rules into the new rule; When the inclusion relationship satisfies a third preset condition, determining that the rule optimization action is to merge the new rule into the similar rule; When the inclusion relationship satisfies a fourth preset condition, determining the rule optimization action to replace the similar rule with the new rule; When the inclusion relationship satisfies a fifth preset condition, the rule optimization action is determined to be not putting the new rule online.

5. The business data processing method based on rule engine optimization according to claim 1 is characterized in that: After the step of establishing a factor index table based on the reference relationship between the rules in the rule set and the rule factors, the step further includes: Traversing all the rules in each of the rule sets, and recording the currently traversed rule as the current optimization rule; Based on the rule factor of the current optimization rule, obtaining a current similar rule set of the current optimization rule from the factor index table; Calculating the inclusion degree and the included degree between the current optimization rule and each current similar rule in the current similar rule set; The rule set is optimized according to the inclusion degree and the included degree.

6. The business data processing method based on rule engine optimization according to claim 5 is characterized in that: The step of optimizing the rule set according to the inclusion degree and the included degree comprises: When the inclusion degree is within the first preset range, or when the inclusion degree is within the first preset range, keeping the current optimization rule and the current similarity rule unchanged; When the inclusion degree is within a second preset range and the inclusion degree is within a second preset range, merging the current optimization rule with the current similarity rule; When the inclusion degree reaches a preset threshold, deleting the current optimization rule; When the inclusion degree reaches a preset threshold, the current similarity rule is deleted.

7. The business data processing method based on rule engine optimization according to any one of claims 1 to 6, characterized in that: The step of dividing the full set of rules based on business scenarios to obtain rule sets for different business scenarios includes: Obtain the rule configuration file corresponding to the business scenario; The rule configuration file is parsed to obtain business rules of the business scenario, and the business rules are combined to obtain a rule set.

8. A business data processing device based on rule engine optimization, characterized in that: include: An acquisition module, configured to acquire all rules of a rule engine, wherein each rule comprises a plurality of rule factors and a factor statement corresponding to each rule factor, wherein the factor statements have a logical operation relationship; A division module, configured to divide the full set of rules based on business scenarios to obtain rule sets for different business scenarios; An establishment module, configured to establish a factor index table according to a reference relationship between rules in the rule set and rule factors; A search module, configured to receive a configured new rule and obtain a similar rule set of the new rule from the factor index table based on the rule factor of the new rule; a calculation module, configured to calculate an inclusion relationship between the new rule and each similar rule in the similar rule set; an optimization module, configured to obtain a rule optimization action according to the inclusion relationship, and optimize the rule set based on the rule optimization action to obtain an updated rule set; A matching module is used to obtain business data according to the received business request and match the business data to the corresponding business scenario in the rule engine; The business execution module is used to call the updated rule set corresponding to the business scenario as a target execution rule according to the business scenario, and process the business data according to the target execution rule.

9. A computer device comprising a memory and a processor, wherein the memory stores computer-readable instructions, and when the processor executes the computer-readable instructions, the steps of the business data processing method based on rule engine optimization as described in any one of claims 1 to 7 are implemented.

10. A computer-readable storage medium, characterized in that The computer-readable storage medium stores computer-readable instructions, which, when executed by a processor, implement the steps of the business data processing method based on rule engine optimization according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • Self-adapting service choice device and method thereof, enquiry system and method thereof

    CN101398810A

  • Rule engine optimization method and device, data matching method and device, storage medium and terminal

    CN113641708A