A data processing method, device, equipment and medium based on rule engine

By converting the rule parameter list of the rule engine and the original mapping conversion relation data into the target mapping conversion relation data, the mapping unit rule parameters are determined, which solves the problem of poor configurability and scalability when dealing with complex mapping relations. It realizes more efficient data maintenance and business rule development efficiency.

CN114328682BActive Publication Date: 2025-02-11AGRICULTURAL BANK OF CHINA
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202111568911.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-21
Publication Date
2025-02-11
Estimated Expiration
2041-12-21

AI Technical Summary

Technical Problem

In the prior art, when the rule engine processes mapping conversion processing where expressions are fixed but conditional branches are large, there are poor configurability and scalability, resulting in high data maintenance costs and low business rules development efficiency.

Method used

By obtaining the rule parameter list and original mapping conversion relational data of the rule engine, converting it into target mapping conversion relational data, and then determining the mapping unit rule parameters, and finally determining the input parameter data of the rule engine.

Benefits of technology

The transformation of complex mapping relationships to simplified mapping relationships is realized, the configurability and scalability of the rule engine are improved, the data maintenance costs are reduced, and the development efficiency of business rule scenario processing is improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114328682B_ABST
    Figure CN114328682B_ABST
Patent Text Reader

Abstract

The embodiment of the present invention discloses a data processing method, device, equipment and medium based on a rule engine. The data processing method based on the rule engine includes: obtaining a rule parameter list and original mapping conversion relationship data of the rule engine; wherein the original mapping conversion relationship data includes a complex mapping relationship of parameters in the rule parameter list; converting the original mapping conversion relationship data into target mapping conversion relationship data; wherein the target mapping conversion relationship data includes a simplified mapping relationship of parameters in the rule parameter list; determining a mapping unit rule parameter according to the rule parameter list and the target mapping conversion relationship data; and determining the input parameter data of the rule engine according to the mapping unit rule parameter. The technical solution of the embodiment of the present invention can improve the configurability and scalability of the rule engine, reduce the data maintenance cost of the rule engine, and improve the development efficiency of business rule scenario processing.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] Embodiments of the present invention relate to the field of computer technology, and in particular, to a data processing method, apparatus, device and medium based on a rule engine. Background Art

[0002] With the improvement of computer technology, rule engines have emerged, realizing the separation of business rules and business processing logic, which greatly facilitates the construction of application systems. The rule engine was originally developed from the inference engine. It is a component embedded in the application that supports the writing of business rules using predefined semantic modules. The rule engine can interpret business rules based on data input and make business decisions based on the input data and business rules.

[0003] However, the rule engine is not good at processing mapping conversions with fixed expressions but many conditional branches. When the data table and the rule engine are used together, complex business rule problems including mapping relationships can be solved, but the data table is highly dependent on the specific business. When the mapping relationship of the business changes, it is necessary to constantly update the data table or adjust the parameter table structure. It may even be necessary to introduce more data tables or modify a large number of data table structures, resulting in poor configurability and scalability of the rule engine, and high data maintenance costs. In addition, when the data table and the rule engine are used together, there is often a problem of insufficient abstraction level of the data table, which requires repeated development of similar businesses. Summary of the invention

[0004] The embodiments of the present invention provide a data processing method, apparatus, device and medium based on a rule engine, which can improve the configurability and scalability of the rule engine, reduce the data maintenance cost of the rule engine, and improve the development efficiency of business rule scenario processing.

[0005] In a first aspect, an embodiment of the present invention provides a data processing method based on a rule engine, comprising:

[0006] Obtaining a rule parameter list and original mapping conversion relationship data of a rule engine; wherein the original mapping conversion relationship data includes a complex mapping relationship of parameters in the rule parameter list;

[0007] Converting the original mapping conversion relationship data into target mapping conversion relationship data; wherein the target mapping conversion relationship data includes a simplified mapping relationship of parameters in the rule parameter list;

[0008] Determine mapping unit rule parameters according to the rule parameter list and target mapping conversion relationship data;

[0009] The input parameter data of the rule engine is determined according to the mapping unit rule parameters.

[0010] In a second aspect, an embodiment of the present invention further provides a data processing device based on a rule engine, comprising:

[0011] A data acquisition module is used to acquire a rule parameter list and original mapping conversion relationship data of a rule engine; wherein the original mapping conversion relationship data includes a complex mapping relationship of parameters in the rule parameter list;

[0012] A data conversion module, used to convert the original mapping conversion relationship data into target mapping conversion relationship data; wherein the target mapping conversion relationship data includes a simplified mapping relationship of parameters in the rule parameter list;

[0013] A mapping unit rule parameter determination module, used to determine mapping unit rule parameters according to the rule parameter list and target mapping conversion relationship data;

[0014] The input parameter data determination module is used to determine the input parameter data of the rule engine according to the mapping unit rule parameters.

[0015] In a third aspect, an embodiment of the present invention further provides an electronic device, the electronic device comprising:

[0016] one or more processors;

[0017] A storage device for storing one or more programs;

[0018] When the one or more programs are executed by the one or more processors, the one or more processors implement the data processing method based on the rule engine provided by any embodiment of the present invention.

[0019] In a fourth aspect, an embodiment of the present invention further provides a computer storage medium on which a computer program is stored, and when the program is executed by a processor, the rule engine-based data processing method provided by any embodiment of the present invention is implemented.

[0020] The technical solution of this embodiment obtains the rule parameter list of the rule engine and the original mapping conversion relationship data of the complex mapping relationship including the parameters in the rule parameter list, and then converts the original mapping conversion relationship data into the target mapping conversion relationship data of the simplified mapping relationship including the parameters in the rule parameter list, and further determines the mapping unit rule parameters according to the rule parameter list and the target mapping conversion relationship data, thereby determining the input parameter data of the rule engine according to the mapping unit rule parameters. In this solution, the original mapping conversion relationship data is converted into the target mapping conversion relationship data, and the conversion from the complex mapping relationship to the simplified mapping relationship can be realized. When the complex mapping relationship of the original mapping conversion relationship data changes, the mapping unit rule parameters can be determined according to the rule parameter list and the target mapping conversion relationship data, without the need to determine the mapping unit rule parameters through the rule parameter list and the original mapping conversion relationship data. This can avoid a large number of modifications to the data table structure and the introduction of more data tables due to changes in complex mapping relationships, so as to facilitate flexible configuration and expansion of the rule engine and improve the development efficiency of business rule scenario processing. It solves the problems of poor configurability and scalability of the rule engine, high data maintenance cost and low business rule development efficiency caused by changes in mapping relationships in the prior art, and can improve the configurability and scalability of the rule engine, reduce the data maintenance cost of the rule engine, and improve the development efficiency of business rule scenario processing. BRIEF DESCRIPTION OF THE DRAWINGS

[0021] Figure 1 is a flow chart of a data processing method based on a rule engine provided in the first embodiment of the present invention;

[0022] Figure 2 is a flow chart of a data processing method based on a rule engine provided in Embodiment 2 of the present invention;

[0023] Figure 3 This is a data flow diagram of a data processing system based on a rule engine provided in Embodiment 3 of the present invention;

[0024] Figure 4 It is a relationship diagram of core data of a data processing method based on a rule engine provided in the third embodiment of the present invention;

[0025] Figure 5 This is another data processing method based on a rule engine provided by the third embodiment of the present invention;

[0026] Figure 6 This is a traditional development mode of a rule engine provided by the third embodiment of the present invention;

[0027] Figure 7 This is an improved development mode of a rule engine provided by the third embodiment of the present invention;

[0028] Figure 8 is a schematic diagram of a data processing device based on a rule engine provided by a fourth embodiment of the present invention;

[0029] Fig. 9 This is a schematic diagram of the structure of an electronic device provided in Embodiment 5 of the present invention. DETAILED DESCRIPTION

[0030] The present invention will be further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention, rather than to limit the present invention.

[0031] It should also be noted that, for ease of description, only the part relevant to the present invention but not all content is shown in the accompanying drawings. It should be mentioned before discussing exemplary embodiments in more detail that some exemplary embodiments are described as processing or methods depicted as flow charts. Although the flow chart describes each operation (or step) as sequential processing, many operations therein can be implemented in parallel, concurrently or simultaneously. In addition, the order of each operation can be rearranged. When its operation is completed, the processing can be terminated, but it can also have additional steps not included in the accompanying drawings. The processing can correspond to methods, functions, procedures, subroutines, subprograms, etc.

[0032] Embodiment 1

[0033] Application systems whose business rules change frequently usually need to use rule engines. Rule engines can separate business rules from program codes, improve the readability of business rules and the maintainability of the system, but rule engines also have limitations. Building an application system that is easy to understand, scalable and maintain requires not only the reasonable use of rule engines, but also the reasonable design and management of the input parameters of the rule engines. The description of rules by rule engines is particularly suitable for replacing if else structures. In some business scenarios (such as pricing management of bank deposit and loan businesses, user credit rating assessment, and automatic volume adjustment of smart devices, etc.), the rule conditions are relatively fixed but there are many conditional branches. If the rule engine is used directly, there will be many rule files, program blocks in rule files, and conditional branches, which is not conducive to improving the readability and maintainability of business rules. At this time, it is usually necessary to integrate the rule engine with the parameter table, implement part of the mapping rules based on the data table, so that the rule engine can focus on the processing of core rule logic and reduce the complexity of the rule text. That is, in scenarios that include both complex business rules and mapping conversions, combine the rule engine with the parameter table, query the parameter values ​​required by the rule engine from the parameter table based on the system input parameters, combine them into the input parameters of the rule engine, and then call the rule engine to finally get the rule processing results.

[0034] However, when the mapping rules of the business change, it may be necessary to continuously add parameter tables or adjust the structure of parameter tables. In addition, the abstract level of business rules is not high enough, so the system construction of similar businesses requires repeated development (for example, for business systems in similar scenarios, similar parameter tables are maintained and similar parameter table query codes are written). However, the data processing method based on engine rules of this solution can improve the configurability and scalability of the rule engine, reduce the data maintenance cost of the rule engine, and improve the development efficiency of business rule scenario processing. The specific optional implementation method of the data processing method of engine rules of this solution can refer to the following embodiments.

[0035] Figure 1 This is a flow chart of a data processing method based on a rule engine provided by the first embodiment of the present invention. This embodiment is applicable to the case of flexibly configuring the rule engine. The method can be executed by a data processing device based on a rule engine. The device can be implemented by software and / or hardware and can generally be integrated in an electronic device. The electronic device can be a terminal device or a server device. The embodiment of the present invention does not limit the type of electronic device that executes the task scheduling method. Figure 1 As shown, the method includes the following operations:

[0036] S110, obtaining a rule parameter list of a rule engine and original mapping conversion relationship data.

[0037] Among them, the rule parameter list can be a parameter list associated with the business rules of the rule engine and affecting the output results of the rule engine. The original mapping conversion relationship data can be data determined by business needs and characterizing unprocessed mapping conversion relationships. The original mapping conversion relationship data may include complex mapping relationships of parameters in the rule parameter list. The complex mapping relationship may be a many-to-one mapping relationship other than a two-to-one mapping relationship. Exemplarily, the complex mapping relationship may include a mapping relationship between at least three parameters in the rule parameter list and a preset value.

[0038] In the embodiment of the present invention, the rule parameter list of the rule engine and the original mapping conversion relationship data can be determined according to business requirements.

[0039] S120: Convert the original mapping conversion relationship data into target mapping conversion relationship data.

[0040] The target mapping conversion relationship data may be the result of the mapping conversion relationship conversion of the original mapping conversion relationship data. The target mapping conversion relationship data may include a simplified mapping relationship of the parameters in the rule parameter list. The mapping relationship complexity of the simplified mapping relationship is lower than that of the complex mapping relationship. Exemplarily, the simplified mapping relationship may include a mapping relationship between at most two parameters in the rule parameter list and a preset value.

[0041] In the embodiment of the present invention, the complex mapping relationship of the parameters in the rule parameter list of the original mapping conversion relationship data may be split to obtain the target mapping conversion relationship data including the simplified mapping relationship of the parameters in the rule parameter list.

[0042] S130: Determine mapping unit rule parameters according to the rule parameter list and target mapping conversion relationship data.

[0043] The mapping unit rule parameters may be determined by the rule parameter list and the target mapping conversion relationship data, and are data associated with the parameters input to the rule engine, and are used to generate the input parameters of the rule engine.

[0044] In the embodiment of the present invention, the assignment results of the parameters in the rule parameter list may be determined first, and then the mapping unit rule parameters may be determined according to the assignment results of the parameters in the rule parameter list and the target mapping conversion relationship data.

[0045] S140: Determine input parameter data of the rule engine according to the mapping unit rule parameters.

[0046] The input parameter data may be determined according to the mapping unit rule parameters and are parameters that need to be input into the rule engine.

[0047] In the embodiment of the present invention, if the rule engine can identify the data format of the mapping unit rule parameter, the mapping unit rule parameter is used as the input parameter data of the rule engine. If the rule engine cannot identify the data format of the mapping unit rule parameter, the input parameter data of the rule engine is determined according to the data format that the rule engine can identify and the mapping unit rule parameter.

[0048] The technical solution of this embodiment obtains the rule parameter list of the rule engine and the original mapping conversion relationship data of the complex mapping relationship including the parameters in the rule parameter list, and then converts the original mapping conversion relationship data into the target mapping conversion relationship data of the simplified mapping relationship including the parameters in the rule parameter list, and further determines the mapping unit rule parameters according to the rule parameter list and the target mapping conversion relationship data, thereby determining the input parameter data of the rule engine according to the mapping unit rule parameters. In this solution, the original mapping conversion relationship data is converted into the target mapping conversion relationship data, and the conversion from the complex mapping relationship to the simplified mapping relationship can be realized. When the complex mapping relationship of the original mapping conversion relationship data changes, the mapping unit rule parameters can be determined according to the rule parameter list and the target mapping conversion relationship data, without the need to determine the mapping unit rule parameters through the rule parameter list and the original mapping conversion relationship data. This can avoid a large number of modifications to the data table structure and the introduction of more data tables due to changes in complex mapping relationships, so as to facilitate flexible configuration and expansion of the rule engine and improve the development efficiency of business rule scenario processing. It solves the problems of poor configurability and scalability of the rule engine, high data maintenance cost and low business rule development efficiency caused by changes in mapping relationships in the prior art, and can improve the configurability and scalability of the rule engine, reduce the data maintenance cost of the rule engine, and improve the development efficiency of business rule scenario processing.

[0049] Embodiment 2

[0050] Figure 2 is a flow chart of a data processing method based on a rule engine provided by the second embodiment of the present invention. This embodiment is specific based on the above embodiment. In this embodiment, the original mapping conversion relationship data can be converted into the target mapping conversion relationship data. The specific process is: obtaining the target mapping unit data; splitting the original mapping conversion relationship data according to the target mapping unit data to obtain the target mapping conversion relationship data. Correspondingly, Figure 2 As shown, the method includes the following operations:

[0051] S210: Obtain a rule parameter list of a rule engine and original mapping conversion relationship data.

[0052] S220: Acquire target mapping unit data.

[0053] The target mapping unit data may represent the mapping unit corresponding to the simplified mapping relationship, and is used to determine the number of original images of each simplified mapping relationship in the target mapping conversion relationship data. Exemplarily, assuming that a non-empty set A has a corresponding relationship with a non-empty set B, and an element a in the non-empty set A has a mapping relationship with b in the non-empty set B, and the mapping relationship is recorded as f, then b can be called the image of element a under mapping f, and element a is called the original image of element b under mapping f.

[0054] In the embodiment of the present invention, the target mapping unit data may be determined according to actual application requirements, so as to determine the number of original images under the simplified mapping relationship according to the target mapping unit data.

[0055] S230: Split the original mapping conversion relationship data according to the target mapping unit data to obtain target mapping conversion relationship data.

[0056] In an embodiment of the present invention, the original image and the image under the complex mapping relationship corresponding to the original mapping conversion relationship data can be determined according to the original mapping conversion relationship data, and then the number of original images under the simplified mapping relationship can be determined according to the target mapping unit data, and the original image under the complex mapping relationship can be split according to the number of original images under the simplified mapping relationship to obtain the target mapping conversion relationship data.

[0057] In an optional embodiment of the present invention, the original mapping conversion relationship data is split according to the target mapping unit data to obtain the target mapping conversion relationship data, which may include: determining an initial original image data group according to the original mapping conversion relationship data; wherein the initial original image data group may include at least three initial original image data under a complex mapping relationship; splitting the initial original image data group according to the target mapping unit data to determine each original image unit data group to be processed; wherein the original image unit data group to be processed may include at most two original image data to be processed under a simplified mapping relationship; determining the target mapping conversion relationship data according to each original image unit data group to be processed and the simplified mapping relationship of each original image unit data group to be processed.

[0058] Among them, the initial original image data group can be a set of original image data of a complex mapping relationship of the original mapping conversion relationship data. The initial original image data can be the data in the initial original image data group. The original image unit data group to be processed can be the original image data under a simplified mapping relationship. The original image data to be processed can be the data in the original image unit data group to be processed. Exemplarily, assuming that the three elements A, B and C have a complex mapping relationship with D of the original mapping conversion relationship data, the initial original image data groups are A, B and C, the image of the initial original image data group under the complex mapping relationship is D, and the initial original image data are A, B and C respectively. Assuming that the two elements C and E have a simplified mapping relationship with D, the original image unit data group to be processed is C and E, and the image of the original image unit data group to be processed under the simplified mapping relationship is D.

[0059] In an embodiment of the present invention, the original mapping conversion relationship data can be parsed to obtain the complex mapping relationship of the parameters in the rule parameter list, and the initial original image data group including at least three initial original image data under the complex mapping relationship of the parameters in the rule parameter list is determined, and then the number of original images under the simplified mapping relationship of the parameters in the rule parameter list is determined according to the target mapping unit data, and the initial original image data group is further split according to the number of original images under the simplified mapping relationship to obtain each original image unit data group to be processed. After obtaining each original image unit data group to be processed, the simplified mapping relationship corresponding to each original image unit data group to be processed can be further determined, and the target mapping conversion relationship data can be determined according to the original image unit data group to be processed and the simplified mapping relationship of each original image unit data group to be processed.

[0060] Exemplarily, according to the original mapping conversion relationship data, it is determined that the three elements A, B and C and D form a three-to-one complex mapping relationship. When the target mapping unit data is a two-to-one mapping relationship (simplified mapping relationship), the three-to-one complex mapping relationship can be divided into a simplified mapping relationship between the two elements A and B and E, and a simplified mapping relationship between the two elements C and E and D.

[0061] S240: Determine mapping unit rule parameters according to the rule parameter list and the target mapping conversion relationship data.

[0062] In an optional embodiment of the present invention, the mapping unit rule parameters may include interface rule parameter values. Before determining the mapping unit rule parameters based on the rule parameter list and the target mapping conversion relationship data, it may also include: when it is determined that the parameter source type of the rule parameter list is an interface type, obtaining application interface data, and determining the interface rule parameter value based on the application interface data; determining the mapping unit rule parameters based on the rule parameter list and the target mapping conversion relationship data may include: determining the mapping unit rule parameters based on the rule parameter list, the interface rule parameter value and the target mapping conversion relationship data.

[0063] The interface rule parameter value may be the result of assigning a parameter in a rule parameter list obtained from an interface. The parameter source type may be the source type of the result of assigning a parameter in a rule parameter list. The application interface data may be the data obtained through the application interface when the parameter source type is an interface type.

[0064] In an embodiment of the present invention, the rule parameter list can be parsed to determine the parameter source type of the parameters in the rule parameter list. If the parameter source type of the rule parameter list is an interface type, the application interface data can be obtained from the application interface, and then the application interface data can be parsed to obtain the interface rule parameter value, and the interface rule parameter value corresponding to the parameter in the rule parameter list and the simplified mapping relationship of the parameter in the rule parameter list of the target mapping conversion relationship data are determined, and then the mapping unit rule parameter is determined according to the interface rule parameter value corresponding to each parameter in the rule parameter list and the simplified mapping relationship of the target mapping conversion relationship data.

[0065] In an optional embodiment of the present invention, the target mapping conversion relationship data may include built-in mapping conversion relationship data and external mapping conversion relationship data. Determining the mapping unit rule parameters according to the rule parameter list and the target mapping conversion relationship data may include: when it is determined that the parameter source type of the rule parameter list is a built-in conversion table type, obtaining the built-in mapping conversion relationship details data; determining the rule parameter association information according to the built-in mapping conversion relationship data; determining the mapping unit rule parameters according to the rule parameter association information, the interface rule parameter value and the built-in mapping conversion relationship details data; when it is determined that the parameter source type of the rule parameter list is an external conversion table type, querying the external mapping conversion relationship data based on the query rule to obtain the mapping unit rule parameters.

[0066] For different parameters in the rule parameter list, the mapping conversion relationship will be different in structure and quantity. For example, when performing loan pricing management, to convert the loan days into a term code, you only need to use the built-in mapping conversion relationship details data with fewer records. To match a risk cost adjustment coefficient based on factors such as the institution, loan business type, and user credit rating, or to query the customer's comprehensive contribution information based on the customer number, you need to access a built-in mapping conversion relationship details data with more fields and a larger number of records.

[0067] In order to cope with such differences, the data processing device based on the rule engine can map and transform the parameters in the rule parameter list through built-in mapping conversion relationship data and external mapping conversion relationship data.

[0068] Among them, the built-in mapping conversion relationship data can be data associated with parameters in the rule parameter list configured in an electronic device that executes a data processing method based on a rule engine. The external mapping conversion relationship data can be data that is configured in an electronic device that executes a data processing method based on a rule engine or outside an electronic device that executes a data processing method based on a rule engine, and determines the mapping unit rule parameters. The built-in conversion table type can characterize that the source of the parameters of the rule parameter list is the built-in mapping conversion relationship data. The built-in mapping conversion relationship details data can be data associated with the built-in mapping conversion relationship data, and is used to determine the mapping unit rule parameters based on the built-in mapping conversion relationship data. The rule parameter association information can be part of the data in the built-in mapping conversion relationship data, which is used to determine the mapping unit rule parameters. The external conversion table type can characterize that the source of the parameters of the rule parameter list is the external mapping conversion relationship data. The query rule can be a data matching rule for determining the mapping unit rule parameters based on the external mapping conversion relationship data.

[0069] In an embodiment of the present invention, the rule parameter list can be parsed. If the parameter source type of the parameter in the rule parameter list is a built-in conversion table type, the built-in mapping conversion relationship details data is further obtained, and the built-in mapping conversion relationship data is queried according to the parameter of the rule parameter list whose parameter source type is the built-in conversion table type, so as to obtain the rule parameter association information. After obtaining the rule parameter association information and the built-in mapping conversion relationship details data, the assignment result of the parameter of the rule parameter list whose parameter source type is the built-in conversion table type can be further obtained, and then the built-in mapping conversion relationship details data is queried according to the assignment result of the parameter of the rule parameter list whose parameter source type is the built-in conversion table type and the rule parameter association information, so as to obtain the mapping unit rule parameter corresponding to the parameter whose parameter source type is the built-in conversion table type. If the parameter source type of the parameter in the rule parameter list is an external conversion table type, the external mapping conversion relationship data corresponding to the parameter in the rule parameter list can be further determined, and then the query rule can be determined according to the key field of the parameter in the rule parameter list, so as to query the external mapping conversion relationship data according to the query rule, so as to obtain the mapping unit rule parameter.

[0070] For example, the built-in mapping conversion relationship data can process mapping conversion relationships with less than 2 original images and a small number of mapping conversions (such as less than 3 times) at a time, while the external mapping conversion relationship data can process more complex mapping conversion relationships. For many-to-one original mapping conversion relationships with a small number of mapping conversions, the mapping conversion of parameters in the rule parameter list can also be implemented according to the built-in mapping conversion relationship data, because the many-to-one original mapping conversion relationship can be decomposed into multiple two-to-one mapping conversion relationships.

[0071] In an optional embodiment of the present invention, determining mapping unit rule parameters based on rule parameter association information, interface rule parameter values, and built-in mapping conversion relationship details data may include: obtaining a mapping conversion priority; determining parameter source name data and conversion type data based on the rule parameter association information; querying built-in mapping conversion relationship details data according to the mapping conversion priority based on the parameter source name data, conversion type data, and interface rule parameter values ​​to obtain mapping unit rule parameters.

[0072] Among them, the conversion type data can be used to characterize the mapping type of the simplified mapping relationship. Exemplarily, the mapping type can include but is not limited to the interval conversion type and the mapping conversion type. The interval conversion type can be the type of mapping conversion between a data interval and a preset numerical value. The mapping conversion type can be the type of mapping conversion between a data value and a preset numerical value. The parameter source name data can be data characterizing the name of the original image under the simplified mapping relationship. The mapping conversion priority can be the priority of the mapping conversion.

[0073] In an embodiment of the present invention, the mapping conversion priority can be determined according to the business needs of the mapping conversion, and then the rule parameter association information can be parsed to obtain parameter source name data and conversion type data, thereby determining the assignment result of the parameter in the rule parameter list corresponding to the parameter source name data according to the parameter source name data and the interface rule parameter value, and further determining the mapping unit rule parameter according to the built-in mapping conversion relationship details data based on the assignment result of the parameter in the rule parameter list corresponding to the parameter source name data and the conversion type data according to the mapping conversion priority.

[0074] S250: Determine input parameter data of the rule engine according to the mapping unit rule parameters.

[0075] In an optional embodiment of the present invention, determining the input parameter data of the rule engine according to the mapping unit rule parameters may include: performing data format conversion on the mapping unit rule parameters to obtain the input parameter data of the rule engine; after determining the input parameter data of the rule engine according to the mapping unit rule parameters, it may also include: calling the target rule set of the rule engine; performing data processing on the input parameter data according to the target rule set to obtain the execution result of the rule engine.

[0076] The target rule set may be a rule set preset in the rule engine for implementing business requirements. The rule engine execution result may be a result of the rule engine processing the input parameter data according to the rule set configured by the rule engine.

[0077] In an embodiment of the present invention, when the rule engine cannot recognize the mapping unit rule parameters, the mapping unit rule parameters can be converted into a data format to obtain input parameter data in a data format that the rule engine can recognize, and then the target rule set built into the rule engine is called to perform data processing on the input parameter data through the target rule set to obtain the rule engine execution result.

[0078] Exemplarily, the rule engine may include the IBM ODM rule engine, the Drools rule engine, and the Easy-Rule rule engine. The IBM ODM rule engine supports the organization of rules by directory and file, and can also connect multiple rules in series through a rule execution flowchart to form a target rule set. The Drools rule engine and the Easy-Rule rule engine can support multiple target rule sets, each of which can contain multiple rule contents.

[0079] The core syntax of the IBM ODM rule engine can be:

[0080] If conditional expression then;

[0081] Assignment expressions;

[0082] otherwise;

[0083] Assignment expression.

[0084] The core syntax of the Drools rule engine can be:

[0085] attribute

[0086] when

[0087] LHS

[0088] then

[0089] RHS

[0090] end.

[0091] The core syntax of the Easy-Rule rule engine is:

[0092] Rule name;

[0093] Description of the rule;

[0094] Priority;

[0095] Conditional expressions;

[0096] The resulting expression.

[0097] The technical solution of this embodiment obtains the rule parameter list of the rule engine and the original mapping conversion relationship data to further obtain the target mapping unit data, thereby splitting the original mapping conversion relationship data according to the target mapping unit data to obtain the target mapping conversion relationship data, and then determining the mapping unit rule parameters according to the rule parameter list and the target mapping conversion relationship data, so as to determine the input parameter data of the rule engine according to the mapping unit rule parameters. In this solution, the original mapping conversion relationship data is converted into the target mapping conversion relationship data, which can realize the conversion from a complex mapping relationship to a simplified mapping relationship. When the complex mapping relationship of the original mapping conversion relationship data changes, the mapping unit rule parameters can be determined according to the rule parameter list and the target mapping conversion relationship data, without the need to determine the mapping unit rule parameters through the rule parameter list and the original mapping conversion relationship data. This can avoid a large number of modifications to the data table structure and the introduction of more data tables due to changes in complex mapping relationships, so as to facilitate flexible configuration and expansion of the rule engine and improve the development efficiency of business rule scenario processing. It solves the problems of poor configurability and scalability of the rule engine, high data maintenance cost and low business rule development efficiency caused by changes in mapping relationships in the prior art, and can improve the configurability and scalability of the rule engine, reduce the data maintenance cost of the rule engine, and improve the development efficiency of business rule scenario processing.

[0098] Embodiment 3

[0099] Embodiment 3 of the present invention provides an optional embodiment of a data processing method based on a rule engine, and its specific implementation can be found in the following embodiments. Among them, technical terms that are the same as or corresponding to the above embodiments are not repeated here.

[0100] Figure 3 Schematic diagram of data flow of a data processing system based on a rule engine provided by the third embodiment of the present invention. Figure 3As shown, the data processing system based on the rule engine includes a data processing device based on the rule engine and a rule engine. The data processing device based on the rule engine can receive parameter data input into the data processing system of the rule engine, and the data processing device based on the rule engine abstracts the received parameter data into a rule parameter list. In the rule parameter list, the elements of simple data types may include one parameter, and the elements of complex data types may include multiple parameters. The elements of the rule parameter list may be attributes of the input parameter data that affect the execution result of the rule engine, including both the attributes of the input parameter data finally passed to the rule engine and the attributes of the parameters for calculating the input parameter data value. The parameters in the rule parameter list and the parameter assignment results can be encapsulated in a Map<String,Object> In the data structure, the processing of the parameters in the rule parameter list is converted into the operation of the Map data structure. The code of the parameter in the rule parameter list corresponds to the Key in the Map data structure, and the value corresponding to the Key is the assignment result of the parameter in the rule parameter list. The data processing device based on the rule engine performs mapping conversion processing on the parameters in the rule parameter list to obtain input parameter data, and sends the input parameter data to the rule engine. The rule engine performs data processing on the input parameter data according to the target rule set and outputs the execution result.

[0101] Taking the data processing of generating loan term code based on the legal person loan days parameter as an example, the data stored in the rule parameter list is shown in Table 1:

[0102] Table 1 Rule parameter list 1

[0103]

[0104] Taking the data processing of obtaining the comprehensive contribution of customers by contribution date and customer number as an example, the data stored in the rule parameter list is shown in Table 2:

[0105] Table 2 Rule parameter list 2

[0106]

[0107] As shown in Table 1 and Table 2, the basic attributes of the parameters in the rule parameter list include: business type, parameter name, parameter code, value type (Boolean, value, string, date, etc.), parameter source and parameter source tag. The parameters in the rule parameter list can also include attributes such as processing priority, default value, verification rule, and verification rule reference value. NU represents the numeric type, and CH represents the string type. 01 in the parameter source represents that the parameter source type is the interface type, and 02 represents that the parameter source type is the conversion table type. X in the parameter source tag represents that the parameter source type is the built-in conversion table type. When the parameter source is 02 and the parameter source tag is not X, it indicates that the parameter source type is an external conversion table type.

[0108] When the parameter source type is an interface type, the attribute value of the parameter source tag is the name of the application interface. When the parameter source type is a built-in conversion table type, the attribute value of the parameter source tag is the built-in mapping conversion relationship data. When the parameter source type is an external conversion table type, the attribute value of the parameter source tag is the tag of the external mapping conversion relationship data. The default value can be pre-set, and the parameters in the rule parameter list that are not obtained are set to the default value (such as 0, etc.). The verification rules may include being greater than a certain value, less than a certain value, or within a certain data interval, etc. The verification rule reference value may be the data corresponding to the verification rule. When the verification rule is greater than 0, the verification rule reference value is 0. PM_CLIVALCOM, VALCOM in the parameter source tag indicates that the parameters in the rule parameter list come from the VALCOM field in the external mapping conversion relationship data PM_CLIVALCOM.

[0109] Exemplarily, the built-in mapping conversion relationship data can be shown in the form of Table 3:

[0110] Table 3 Built-in mapping conversion relationship table

[0111]

[0112] As shown in Table 3, the main fields of the built-in mapping conversion relationship table are business type, parameter code, source parameter 1 code, source parameter 2 code, conversion type and conversion extension information. Among them, the value of the conversion type field may include common conversion types such as addition, string left interception, dictionary mapping, interval mapping, two-to-one dictionary mapping, etc. The conversion extension information field can record different extended information (such as the length of the left interception and the interval opening and closing type of the interval conversion, etc.) according to different conversion types. [] represents a fully closed interval, () represents a fully open interval, and 04 in the conversion type represents the interval conversion type. The source parameter 1 code can represent the code of the original image 1 under the mapping relationship. The source parameter 2 code can represent the code of the original image 2 under the mapping relationship. The source parameter 2 code is empty, indicating that the source parameter 1 has a one-to-one mapping relationship with the target parameter. The target parameter can be the original image under the mapping relationship in the built-in mapping conversion relationship details data. The target parameter code can be the code representing the original image under the mapping relationship in the built-in mapping conversion relationship data. The details of the mapping conversion relationship are described by the built-in mapping conversion relationship details data.

[0113] Exemplarily, the built-in mapping conversion relationship details data can be shown in the form of Table 4:

[0114] Table 4 Built-in mapping conversion relationship details

[0115]

[0116] Among them, the assignment result of source parameter 1 can be the value corresponding to Key1 when source parameter 1 is Key1. The assignment result of source parameter 2 can be the value corresponding to Key2 when source parameter 2 is Key2. When the assignment result of source parameter 1 is 0 and the assignment result of source parameter 2 is 2, the image of the assignment result of source parameter 1 and the assignment result of source parameter 2 under the mapping conversion relationship is D001. Similarly, it can be determined that when the assignment result of source parameter 1 is 2 and the assignment result of source parameter 2 is 7, the image of the assignment result of source parameter 1 and the assignment result of source parameter 2 under the mapping conversion relationship is D007. The conversion details ID can be the ID of the simplified mapping relationship, which is used to distinguish different simplified mapping relationships.

[0117] Exemplarily, when the rule parameter list is Table 2, the external mapping conversion relationship data can be displayed in the form of Table 5:

[0118] Table 5 External mapping conversion relationship table

[0119]

[0120] Among them, EQ means field equivalence matching. When it is necessary to determine the assignment result of dte, DTE can be used as the matching field to determine the assignment result of dte in the external mapping conversion relationship data PM_CLIVALCOM by field equivalence matching. When it is necessary to determine the assignment result of custId, CUST_ID can be used as the matching field to determine the assignment result of custId in the external mapping conversion relationship data PM_CLIVALCOM by field equivalence matching. In addition to the matching types given in Table 5, this solution can also support the Between matching type. When the matching type is Between, the matching field name includes matching field 1 and matching field 2. Matching field 1 is used as the starting field to be matched, and matching field 2 is used as the ending field to be matched to obtain the assignment result of the corresponding parameters in PM_CLIVALCOM.

[0121] By graphically processing Table 1, Table 2, Table 3, Table 4 and Table 5, we can obtain the core data relationship diagram of the data processing method based on the rule engine. For details, see Figure 4That is, the core data for building the built-in mapping conversion relationship data is determined according to the core data of the built-in mapping conversion relationship details table, and the core data for building the rule parameter list is determined according to the core data for building the built-in mapping conversion relationship data and the core data for building the external mapping conversion relationship data. Among them, the core data of the built-in mapping conversion relationship details table includes the conversion rule ID, the target parameter code, the source parameter 1 assignment result, the source parameter 2 assignment result and the target parameter. The core data of the built-in mapping conversion relationship data includes the business type, the target parameter code, the source parameter 1 code, the source parameter 2 code, the conversion type and the conversion extension information. The core data of the rule parameter list includes the business type, the parameter code, the value type, the parameter source, the parameter source tag and the processing priority, etc. The core data of the external mapping conversion relationship data includes the business type, the parameter code, the external table name, the matching type and the matching field name.

[0122] Figure 5 Another data processing method based on a rule engine is provided in the third embodiment of the present invention. Figure 5 As shown, firstly, the parameters whose parameter source type is the interface type are traversed from the rule parameter list, the application interface data are obtained from the application interface according to the parameter source tag of the parameter, and the corresponding parameter assignment result is parsed from the application interface data to assign the parameter, so as to perform default value processing and verification rule verification. If the assignment result is not parsed and the default value attribute has a value, the parameter whose assignment result is not parsed is assigned a default value. If a verification rule exists, the parameter assignment result is verified according to the verification rule to further determine whether all parameters whose parameter source type is the interface type have completed the assignment. If all parameters whose parameter source type is the interface type have not completed the assignment, then return to execute the operation of parsing the corresponding parameter assignment result from the application interface data to assign the parameter until all parameters whose parameter source type is the interface type have completed the assignment. If all parameters of the parameter source type of the interface type have completed the assignment, then the parameters of the conversion table type are further traversed according to the rule parameter list, and the mapping conversion relationship is sorted according to the mapping conversion priority, and then it is determined whether the parameter source type is an external conversion table type. If the parameter source type is a built-in conversion table type, the built-in mapping conversion relationship data and the built-in mapping conversion relationship details data are queried to determine the parameter assignment result. Specifically: the source parameter information (such as the source parameter code, etc.) and the conversion type information are obtained according to the built-in mapping conversion relationship data, and then the parameter is converted according to the conversion type to obtain the target parameter assignment result. If the conversion type is a mapping conversion type, the built-in mapping conversion relationship details data is queried according to the parameter assignment result to obtain the target parameter assignment result. If the parameter source type is an external conversion table type, the external mapping conversion relationship data is queried, and a SQL statement is dynamically constructed to obtain the target parameter assignment result.

[0123] After obtaining the assignment result of the target parameter, perform default value processing and verification rule verification, assign default values ​​to parameters that have not been assigned but have default value attributes. If there are verification rules, verify the assignment result of the parameter according to the verification rules, and then determine whether all parameters of the conversion table type have completed the assignment. If all parameters of the conversion table type have not completed the assignment, return to execute the operation of determining whether the parameter source type is an external conversion table type until all parameters of the conversion table type have completed the assignment. If all parameters of the conversion table type have completed the assignment, combine the parameter assignment results (mapping unit rule parameters) into the input parameter data of the rule engine, call the rule engine to process the input parameter data, and obtain the rule engine execution result.

[0124] Exemplarily, an electronic device that executes a data processing method based on a rule engine can dynamically maintain a rule parameter list and target mapping conversion relationship data, and has management functions for basic information of the rule parameter list, management functions for built-in mapping conversion relationship data and built-in mapping conversion relationship details data, and management functions for external mapping conversion relationship data (i.e., management functions for mapping relationships between rule parameter lists and external mapping conversion relationship data). The basic information management function of the rule parameter list includes querying, viewing, adding, modifying, and deleting parameters in the rule parameter list. The basic information that can be maintained in the rule parameter list in the add and modify interface includes parameter code, parameter name, value type, parameter source (interface or conversion table), parameter source tag (interface field name, tag of built-in mapping conversion relationship data or external mapping conversion relationship data), processing priority, default value, verification rule, and verification rule reference value, etc.

[0125] In the parameter query interface of the rule parameter list, you can further maintain the external mapping conversion relationship data, including viewing, adding, modifying and deleting the built-in mapping conversion relationship data. In the new or modified interface of the built-in mapping conversion relationship data, you can maintain the target parameter code, source parameter 1 code, source parameter 2 code (can be empty), conversion type, and conversion extension information (if it is a left truncation, the attribute value of the conversion extension information is filled in with the truncation length; if it is an interval conversion, the attribute value of the conversion extension information is filled in with the open and closed type of the interval). Maintenance of the built-in mapping conversion relationship details data includes querying, adding, modifying and deleting the built-in mapping conversion relationship details data. The basic attributes of the built-in mapping conversion relationship details data include the source parameter 1 assignment result, the source parameter 2 assignment result and the target parameter.

[0126] In the rule parameter query list interface, you can query, add, modify, and delete external mapping conversion relationship data. The basic properties of external mapping conversion relationship data include parameter code, external table name, match type (EQ or Between), match field name (if the match type is EQ, the match field name is a single field name, if the match type is Between, the match field name is two field names separated by commas), etc.

[0127] The electronic device executing the data care method based on the rule engine can abstract the factors affecting the execution result of the rule engine into a rule parameter list, and<String,Object> Object management simplifies the processing of rule input parameters and improves the versatility of mapping conversion relationships. When adding a rule parameter, you only need to dynamically add a key to this Map object without modifying the code. A set of data models is used to describe and dynamically manage the parameters in the rule parameter list and the common mapping conversion relationships between rule parameters. The parameters in the rule parameter list and their conversion relationships can be dynamically maintained according to business needs. Among them, the basic information model of the rule parameter list covers the common types and properties of the rule engine input parameters, and the mapping conversion relationships of the rule parameter list cover the most commonly used data conversion relationships. In addition, the types of the parameters in the rule parameter list and the types of mapping conversion relationships can be dynamically expanded as needed, which improves the versatility of the system and reduces the development of duplicate code.

[0128] Figure 6 This is a traditional development mode of a rule engine provided by the third embodiment of the present invention, such as Figure 6 As shown, taking the pricing system of bank deposit and loan business as an example, according to the traditional development model, for different business baselines (such as corporate loan pricing calculation, personal loan pricing calculation and corporate deposit pricing calculation), it is necessary to develop module programs such as parameter parsing, parameter verification, parameter conversion and parameter table query, rule engine encapsulation and calling, and finally the corresponding rule set of the rule engine processes the input parameter data encapsulated and called by the rule engine (using the corporate loan pricing rule set to process the input parameter data related to corporate loan pricing calculation, using the personal loan pricing rule set to process the input parameter data related to personal loan pricing, and using the corporate deposit pricing rule set to process the input parameter data of corporate deposit pricing). However, the existing development model is prone to form a silo.

[0129] Figure 7 This is an improved development mode of a rule engine provided by the third embodiment of the present invention, such as Figure 7As shown, the electronic device that executes the data processing method based on the rule engine can perform parameter analysis, parameter verification, parameter conversion and parameter table query, rule engine packaging and calling in the pricing procedures of different business baselines (corporate loan pricing, personal loan pricing and corporate deposit pricing), and finally the corresponding rule set of the rule engine processes the input parameter data sent by the rule engine packaging and calling (using the corporate loan pricing rule set to process the input parameter data related to corporate loan pricing, using the personal loan pricing rule set to process the input parameter data related to personal loan pricing, and using the corporate deposit pricing rule set to process the input parameter data of corporate deposit pricing). Each operation of the electronic device that executes the data processing method based on the rule engine can respectively use a common module to implement the corresponding function, without the need to configure a specific module for the same operation (such as parameter analysis, etc.) in different business baselines, that is, the parameter analysis operations of different businesses can use a common parameter analysis module to perform parameter analysis.

[0130] It can be seen that by using an electronic device that executes a data processing method based on a rule engine, the development of similar and repeated codes for different business modules can be reduced, the configurability and scalability of the rule engine can be improved, and data maintenance costs can be reduced.

[0131] It should be noted that any arrangement and combination of the technical features in the above embodiments also falls within the protection scope of the present invention.

[0132] Embodiment 4

[0133] Figure 8 is a schematic diagram of a data processing device based on a rule engine provided by a fourth embodiment of the present invention, such as Figure 8 As shown, the device includes: a data acquisition module 310, a data conversion module 320, a mapping unit rule parameter determination module 330 and an input parameter data determination module 340, wherein:

[0134] The data acquisition module 310 is used to acquire the rule parameter list and the original mapping conversion relationship data of the rule engine; wherein the original mapping conversion relationship data includes the complex mapping relationship of the parameters in the rule parameter list;

[0135] The data conversion module 320 is used to convert the original mapping conversion relationship data into target mapping conversion relationship data; wherein the target mapping conversion relationship data includes a simplified mapping relationship of parameters in the rule parameter list;

[0136] A mapping unit rule parameter determination module 330, configured to determine a mapping unit rule parameter according to the rule parameter list and target mapping conversion relationship data;

[0137] The input parameter data determination module 340 is used to determine the input parameter data of the rule engine according to the mapping unit rule parameters.

[0138] The technical solution of this embodiment obtains the rule parameter list of the rule engine and the original mapping conversion relationship data of the complex mapping relationship including the parameters in the rule parameter list, and then converts the original mapping conversion relationship data into the target mapping conversion relationship data of the simplified mapping relationship including the parameters in the rule parameter list, and further determines the mapping unit rule parameters according to the rule parameter list and the target mapping conversion relationship data, thereby determining the input parameter data of the rule engine according to the mapping unit rule parameters. In this solution, the original mapping conversion relationship data is converted into the target mapping conversion relationship data, and the conversion from the complex mapping relationship to the simplified mapping relationship can be realized. When the complex mapping relationship of the original mapping conversion relationship data changes, the mapping unit rule parameters can be determined according to the rule parameter list and the target mapping conversion relationship data, without the need to determine the mapping unit rule parameters through the rule parameter list and the original mapping conversion relationship data. This can avoid a large number of modifications to the data table structure and the introduction of more data tables due to changes in complex mapping relationships, so as to facilitate flexible configuration and expansion of the rule engine and improve the development efficiency of business rule scenario processing. It solves the problems of poor configurability and scalability of the rule engine, high data maintenance cost and low business rule development efficiency caused by changes in mapping relationships in the prior art, and can improve the configurability and scalability of the rule engine, reduce the data maintenance cost of the rule engine, and improve the development efficiency of business rule scenario processing.

[0139] Optionally, the data conversion module 320 is specifically configured to obtain target mapping unit data; split the original mapping conversion relationship data according to the target mapping unit data to obtain the target mapping conversion relationship data.

[0140] Optionally, the data conversion module 320 is specifically used to determine an initial original image data group based on the original mapping conversion relationship data; wherein the initial original image data group includes at least three initial original image data under the complex mapping relationship; split the initial original image data group according to the target mapping unit data to determine each original image unit data group to be processed; wherein the original image unit data group to be processed includes at most two original image data to be processed under the simplified mapping relationship; determine the target mapping conversion relationship data based on each of the original image unit data groups to be processed and the simplified mapping relationship of each of the original image unit data groups to be processed.

[0141] Optionally, the mapping unit rule parameters include interface rule parameter values, and the data processing based on the rule engine also includes an interface rule parameter value determination module, which is used to obtain application interface data when it is determined that the parameter source type of the rule parameter list is an interface type, and determine the interface rule parameter value according to the application interface data. The mapping unit rule parameter determination module 330 is specifically used to determine the mapping unit rule parameters according to the rule parameter list, the interface rule parameter value and the target mapping conversion relationship data.

[0142] Optionally, the target mapping conversion relationship data includes built-in mapping conversion relationship data and external mapping conversion relationship data. The mapping unit rule parameter determination module 330 is specifically used to obtain the built-in mapping conversion relationship details data when it is determined that the parameter source type of the rule parameter list is a built-in conversion table type; determine the rule parameter association information according to the built-in mapping conversion relationship data; determine the mapping unit rule parameters according to the rule parameter association information, the interface rule parameter value and the built-in mapping conversion relationship details data; when it is determined that the parameter source type of the rule parameter list is an external conversion table type, query the external mapping conversion relationship data based on the query rule to obtain the mapping unit rule parameters.

[0143] Optionally, a mapping unit rule parameter determination module 330 is specifically used to obtain a mapping conversion priority; determine parameter source name data and conversion type data according to the rule parameter association information; query the built-in mapping conversion relationship details data according to the mapping conversion priority based on the parameter source name data, the conversion type data and the interface rule parameter value to obtain the mapping unit rule parameters.

[0144] Optionally, the input parameter data determination module 340 is specifically used to convert the data format of the mapping unit rule parameters to obtain the input parameter data of the rule engine. The data processing based on the rule engine also includes a rule engine execution module, which is used to call the target rule set of the rule engine; the input parameter data is processed according to the target rule set to obtain the rule engine execution result.

[0145] The above-mentioned data processing device based on the rule engine can execute the data processing method based on the rule engine provided by any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method. For technical details not described in detail in this embodiment, please refer to the data processing method based on the rule engine provided by any embodiment of the present invention.

[0146] Since the data processing device based on the rule engine described above is a device that can execute the data processing method based on the rule engine in the embodiment of the present invention, based on the data processing method based on the rule engine described in the embodiment of the present invention, the technical personnel in the field can understand the specific implementation of the data processing device based on the rule engine in this embodiment and its various variations, so how the data processing device based on the rule engine implements the data processing method based on the rule engine in the embodiment of the present invention will not be described in detail here. As long as the technical personnel in the field implement the device used by the data processing method based on the rule engine in the embodiment of the present invention, it belongs to the scope of protection of this application.

[0147] Embodiment 5

[0148] Fig. 9 This is a schematic diagram of the structure of an electronic device provided in Embodiment 5 of the present invention. Fig. 9 A block diagram of an electronic device 412 suitable for implementing embodiments of the present invention is shown. Fig. 9 The electronic device 412 shown is only an example and should not limit the functions and scope of use of the embodiments of the present invention. The electronic device 412 may be, for example, a computer device or a server device.

[0149] like Fig. 9 As shown, the electronic device 412 is in the form of a general purpose computing device. The components of the electronic device 412 may include, but are not limited to: one or more processors 416, a storage device 428, and a bus 418 connecting different system components (including the storage device 428 and the processor 416).

[0150] Bus 418 represents one or more of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, a processor, or a local bus using any of a variety of bus architectures. For example, these architectures include but are not limited to Industry Standard Architecture (ISA) bus, Micro Channel Architecture (MCA) bus, Enhanced ISA bus, Video Electronics Standards Association (VESA) local bus, and Peripheral Component Interconnect (PCI) bus.

[0151] The electronic device 412 typically includes a variety of computer system readable media. These media can be any available media that can be accessed by the electronic device 412, including volatile and non-volatile media, removable and non-removable media.

[0152] The storage device 428 may include computer system readable media in the form of volatile memory, such as random access memory (RAM) 430 and / or cache memory 432. The electronic device 412 may further include other removable / non-removable, volatile / non-volatile computer system storage media. By way of example only, the storage system 434 may be used to read and write non-removable, non-volatile magnetic media ( Fig. 9 not shown, usually called a "hard drive"). Although Fig. 9 Not shown in the figure, a disk drive for reading and writing a removable non-volatile disk (e.g., a "floppy disk"), and an optical disk drive for reading and writing a removable non-volatile optical disk (e.g., a read-only optical disk (Compact Disc-Read Only Memory, CD-ROM), a digital video disk (Digital Video Disc-Read Only Memory, DVD-ROM) or other optical media) may be provided. In these cases, each drive may be connected to the bus 418 via one or more data medium interfaces. The storage device 428 may include at least one program product having a set (e.g., at least one) of program modules that are configured to perform the functions of the various embodiments of the present invention.

[0153] A program 436 having a set (at least one) of program modules 426 may be stored, for example, in a storage device 428, such program modules 426 including, but not limited to, an operating system, one or more application programs, other program modules, and program data, each of which or some combination thereof may include an implementation of a network environment. Program modules 426 generally perform the functions and / or methods of the embodiments described herein.

[0154] The electronic device 412 may also communicate with one or more external devices 414 (e.g., keyboard, pointing device, camera, display 424, etc.), may also communicate with one or more devices that enable a user to interact with the electronic device 412, and / or communicate with any device that enables the electronic device 412 to communicate with one or more other computing devices (e.g., network card, modem, etc.). Such communication may be performed through an input / output (I / O) interface 422. In addition, the electronic device 412 may also communicate with one or more networks (e.g., a local area network (LAN), a wide area network (WAN) and / or a public network, such as the Internet) through a network adapter 420. As shown, the network adapter 420 communicates with other modules of the electronic device 412 through a bus 418. It should be understood that although not shown in the figure, other hardware and / or software modules can be used in conjunction with the electronic device 412, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, disk arrays (Redundant Arrays of Independent Disks, RAID) systems, tape drives, and data backup storage systems.

[0155] The processor 416 executes various functional applications and data processing by running the program stored in the storage device 428, such as implementing the data processing method based on the rule engine provided in the above-mentioned embodiment of the present invention, including: obtaining a rule parameter list and original mapping conversion relationship data of the rule engine; wherein the original mapping conversion relationship data includes a complex mapping relationship of the parameters in the rule parameter list; converting the original mapping conversion relationship data into target mapping conversion relationship data; wherein the target mapping conversion relationship data includes a simplified mapping relationship of the parameters in the rule parameter list; determining the mapping unit rule parameters according to the rule parameter list and the target mapping conversion relationship data; and determining the input parameter data of the rule engine according to the mapping unit rule parameters.

[0156] The technical solution of this embodiment obtains the rule parameter list of the rule engine and the original mapping conversion relationship data of the complex mapping relationship including the parameters in the rule parameter list, and then converts the original mapping conversion relationship data into the target mapping conversion relationship data of the simplified mapping relationship including the parameters in the rule parameter list, and further determines the mapping unit rule parameters according to the rule parameter list and the target mapping conversion relationship data, thereby determining the input parameter data of the rule engine according to the mapping unit rule parameters. In this solution, the original mapping conversion relationship data is converted into the target mapping conversion relationship data, and the conversion from the complex mapping relationship to the simplified mapping relationship can be realized. When the complex mapping relationship of the original mapping conversion relationship data changes, the mapping unit rule parameters can be determined according to the rule parameter list and the target mapping conversion relationship data, without the need to determine the mapping unit rule parameters through the rule parameter list and the original mapping conversion relationship data. This can avoid a large number of modifications to the data table structure and the introduction of more data tables due to changes in complex mapping relationships, so as to facilitate flexible configuration and expansion of the rule engine and improve the development efficiency of business rule scenario processing. It solves the problems of poor configurability and scalability of the rule engine, high data maintenance cost and low business rule development efficiency caused by changes in mapping relationships in the prior art, and can improve the configurability and scalability of the rule engine, reduce the data maintenance cost of the rule engine, and improve the development efficiency of business rule scenario processing.

[0157] Embodiment 6

[0158] Embodiment 6 of the present invention also provides a computer storage medium storing a computer program, which, when executed by a computer processor, is used to execute the data processing method based on the rule engine described in any of the above embodiments of the present invention, including: obtaining a rule parameter list and original mapping conversion relationship data of the rule engine; wherein the original mapping conversion relationship data includes a complex mapping relationship of the parameters in the rule parameter list; converting the original mapping conversion relationship data into target mapping conversion relationship data; wherein the target mapping conversion relationship data includes a simplified mapping relationship of the parameters in the rule parameter list; determining the mapping unit rule parameters according to the rule parameter list and the target mapping conversion relationship data; and determining the input parameter data of the rule engine according to the mapping unit rule parameters.

[0159] The computer storage medium of the embodiment of the present invention can adopt any combination of one or more computer-readable media. The computer-readable medium can be a computer-readable signal medium or a computer-readable storage medium. The computer-readable storage medium can be, for example, but not limited to, a system, device or device of electricity, magnetism, light, electromagnetic, infrared, or semiconductor, or any combination of the above. More specific examples (non-exhaustive list) of computer-readable storage media include: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this document, a computer-readable storage medium can be any tangible medium containing or storing a program, which can be used by an instruction execution system, a device or a device or used in combination with it.

[0160] Computer-readable signal media may include data signals propagated in baseband or as part of a carrier wave, which carry computer-readable program code. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than a computer-readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device.

[0161] The program code contained on the computer-readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wire, optical cable, radio frequency (RF), etc., or any suitable combination of the foregoing.

[0162] Computer program code for performing the operations of the present invention may be written in one or more programming languages ​​or a combination thereof, including object-oriented programming languages ​​such as Java, Smalltalk, C++, and conventional procedural programming languages ​​such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0163] Note that the above are only preferred embodiments of the present invention and the technical principles used. Those skilled in the art will understand that the present invention is not limited to the specific embodiments described herein, and that various obvious changes, readjustments and substitutions can be made by those skilled in the art without departing from the scope of protection of the present invention. Therefore, although the present invention has been described in more detail through the above embodiments, the present invention is not limited to the above embodiments, and may include more other equivalent embodiments without departing from the concept of the present invention, and the scope of the present invention is determined by the scope of the appended claims.

Claims

1. A data processing method based on a rule engine, characterized in that: include: Obtaining a rule parameter list and original mapping conversion relationship data of a rule engine; wherein the original mapping conversion relationship data includes a complex mapping relationship of parameters in the rule parameter list; Converting the original mapping conversion relationship data into target mapping conversion relationship data; wherein the target mapping conversion relationship data includes a simplified mapping relationship of parameters in a rule parameter list; Determine mapping unit rule parameters according to the rule parameter list and the target mapping conversion relationship data; Determining input parameter data of the rule engine according to the mapping unit rule parameters; The converting of the original mapping conversion relationship data into target mapping conversion relationship data includes: Get the target mapping unit data; Determine an initial original image data group according to the original mapping conversion relationship data; wherein the initial original image data group includes at least three initial original image data under the complex mapping relationship; Determine each to-be-processed original image unit data group by splitting the initial original image data group according to the target mapping unit data; wherein the to-be-processed original image unit data group includes at most two to-be-processed original image data under the simplified mapping relationship; The target mapping conversion relationship data is determined according to each of the to-be-processed original image unit data groups and the simplified mapping relationship of each of the to-be-processed original image unit data groups.

2. The method according to claim 1, characterized in that The mapping unit rule parameter includes an interface rule parameter value, and before determining the mapping unit rule parameter according to the rule parameter list and the target mapping conversion relationship data, it also includes: In the case where it is determined that the parameter source type of the rule parameter list is an interface type, obtaining application interface data, and determining the interface rule parameter value according to the application interface data; The determining of mapping unit rule parameters according to the rule parameter list and the target mapping conversion relationship data includes: The mapping unit rule parameters are determined according to the rule parameter list, the interface rule parameter values ​​and the target mapping conversion relationship data.

3. The method according to claim 2, characterized in that The target mapping conversion relationship data includes built-in mapping conversion relationship data and external mapping conversion relationship data, and the determining of mapping unit rule parameters according to the rule parameter list and the target mapping conversion relationship data includes: In the case where it is determined that the parameter source type of the rule parameter list is a built-in conversion table type, acquiring built-in mapping conversion relationship details data; determining rule parameter association information according to the built-in mapping conversion relationship data; determining the mapping unit rule parameter according to the rule parameter association information, the interface rule parameter value and the built-in mapping conversion relationship details data; When it is determined that the parameter source type of the rule parameter list is an external conversion table type, the external mapping conversion relationship data is queried based on the query rule to obtain the mapping unit rule parameter.

4. The method according to claim 3, characterized in that The determining the mapping unit rule parameter according to the rule parameter association information, the interface rule parameter value and the built-in mapping conversion relationship details data includes: Get the mapping conversion priority; Determine parameter source name data and conversion type data according to the rule parameter association information; The built-in mapping conversion relationship details data is queried according to the parameter source name data, the conversion type data and the interface rule parameter value according to the mapping conversion priority to obtain the mapping unit rule parameters.

5. The method according to claim 1, characterized in that The step of determining the input parameter data of the rule engine according to the mapping unit rule parameters includes: Performing data format conversion on the mapping unit rule parameters to obtain input parameter data of the rule engine; After determining the input parameter data of the rule engine according to the mapping unit rule parameters, the method further includes: The target rule set to call the rule engine; The input parameter data is processed according to the target rule set to obtain a rule engine execution result.

6. A data processing device based on a rule engine, characterized in that: include: A data acquisition module, used to acquire a rule parameter list and original mapping conversion relationship data of a rule engine; wherein the original mapping conversion relationship data includes a complex mapping relationship of parameters in the rule parameter list; A data conversion module, used to convert the original mapping conversion relationship data into target mapping conversion relationship data; wherein the target mapping conversion relationship data includes a simplified mapping relationship of parameters in a rule parameter list; A mapping unit rule parameter determination module, used to determine mapping unit rule parameters according to the rule parameter list and the target mapping conversion relationship data; An input parameter data determination module, used to determine the input parameter data of the rule engine according to the mapping unit rule parameters; The data conversion module is specifically used to obtain target mapping unit data; determine an initial original image data group according to the original mapping conversion relationship data; wherein the initial original image data group includes at least three initial original image data under the complex mapping relationship; split the initial original image data group according to the target mapping unit data to determine each original image unit data group to be processed; wherein the original image unit data group to be processed includes at most two original image data to be processed under the simplified mapping relationship; determine the target mapping conversion relationship data according to each of the original image unit data groups to be processed and the simplified mapping relationship of each of the original image unit data groups to be processed.

7. An electronic device, characterized in that: The electronic device comprises: one or more processors; A storage device for storing one or more programs; When the one or more programs are executed by the one or more processors, the one or more processors implement the rule engine-based data processing method as described in any one of claims 1-5.

8. A computer storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the rule engine-based data processing method as described in any one of claims 1 to 5 is implemented.

Citation Information

Patent Citations

  • Parameter conversion method and device based on rule engine, equipment and medium

    CN112698971A

  • Business process control method, device and equipment and computer readable storage medium

    CN113762652A