Data processing method, device, equipment and storage medium based on rule engine

Through the data processing method based on the rule engine, the matching rule engine is automatically selected to process big data, which solves the problems in the existing technology of the complexity of combining the rule engine and big data and the low operating efficiency of non-professionals, and achieves efficient data processing and user Improved experience.

CN110297840BActive Publication Date: 2024-10-18PING AN BANK CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN201910429734.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2019-05-22
Publication Date
2024-10-18
Estimated Expiration
2039-05-22

AI Technical Summary

Technical Problem

In the existing technology, the rule engine is difficult to combine with big data, requires professional and technical personnel to operate, and is inefficient when applied to complex scenarios, making it difficult to meet the needs of non-professionals.

Method used

Provides a data processing method based on a rule engine. By receiving data acquisition instructions, preprocessing business data, calling a distributed computing engine, automatically selecting a matching rule engine and processing the data, the rule engine is closely integrated with big data without the need for professional expertise. Data technology and programming experience.

Benefits of technology

It improves the efficiency of non-professionals operating rule engines and big data, reduces error rates, is suitable for offline and real-time processing scenarios of big data, and enhances user experience and application scope.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN110297840B_ABST
    Figure CN110297840B_ABST
Patent Text Reader

Abstract

The present invention discloses a data processing method, device, equipment and storage medium based on a rule engine. The method comprises: receiving a data acquisition instruction including a processing target and a target data source, acquiring a business data set from the target data source; preprocessing all business data in the business data set according to a preset SQL processing rule to obtain a business data result set; calling a distributed computing engine to traverse the business data result set, and converting each group of business data in the business data result set into a first object; determining a business rule set matching the processing target from a preset rule database; determining the business rules in the business rule set according to the business data in the first object; selecting a rule engine according to the business rules, and calling the business rules through the selected rule engine to process the first object, and obtaining the output processing result. The data processing method based on the rule engine provided by the present invention can improve the operation efficiency of non-professionals.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of data processing, and in particular to a data processing method, device, equipment and storage medium based on a rule engine. Background Art

[0002] A rule engine is a component embedded in an application. Using a rule engine can reduce the complexity of implementing complex business logic components and improve the maintainability and scalability of applications. In the prior art, since the rule engine is not suitable for scenarios with large amounts of data and complex and changing rules, if the rule engine needs to be combined with big data, professionals with sufficient big data technology, programming expertise and programming experience are required. Therefore, if the rule engine needs to be combined with big data, professionals with strong professional skills are required. For non-professionals, it is very easy to make mistakes and the operation efficiency is low. Therefore, finding a technical solution that can solve the above problems has become an urgent problem for technical personnel in this field. Summary of the invention

[0003] Based on this, it is necessary to provide a data processing method, device, equipment and storage medium based on a rule engine to address the above technical problems, which can combine the rule engine with big data. The present invention is suitable for non-professionals and improves operational efficiency and user experience.

[0004] A data processing method based on a rule engine, comprising:

[0005] receiving a data acquisition instruction including a processing target and a target data source, and acquiring a business data set from the target data source, wherein the business data set includes at least one set of business data;

[0006] After pre-processing all the business data in the business data set according to the preset SQL processing rules, a business data result set is obtained;

[0007] Calling a distributed computing engine to traverse the business data result set, and converting each group of the business data in the business data result set into a first object;

[0008] Determine a business rule set matching the processing target from a preset rule database, wherein the business rule set includes at least one business rule;

[0009] Determine, according to the business data in the first object, the business rule in the business rule set that matches the business data;

[0010] A rule engine is selected according to the business rule matching the business data, and the first object is processed by calling the business rule matching the business data through the selected rule engine, and an output processing result is obtained, and the processing result corresponds to the processing target.

[0011] A data processing device based on a rule engine, comprising:

[0012] A receiving module, configured to receive a data acquisition instruction including a processing target and a target data source, and acquire a business data set from the target data source, wherein the business data set includes at least one set of business data;

[0013] A preprocessing module, used to preprocess all the business data in the business data set according to a preset SQL processing rule to obtain a business data result set;

[0014] A conversion module, used for calling a distributed computing engine to traverse the business data result set, and converting each group of the business data in the business data result set into a first object;

[0015] A first determination module, configured to determine a business rule set matching the processing target from a preset rule database, wherein the business rule set includes at least one business rule;

[0016] A second determination module, configured to determine the business rule in the business rule set that matches the business data according to the business data in the first object;

[0017] An acquisition module is used to select a rule engine according to the business rules matching the business data, and process the first object by calling the business rules matching the business data through the selected rule engine, and obtain the output processing result, which corresponds to the processing target.

[0018] A computer device comprises a memory, a processor and a computer program stored in the memory and executable on the processor, wherein the processor implements the above-mentioned data processing method based on a rule engine when executing the computer program.

[0019] A computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the data processing method based on the rule engine is implemented.

[0020] The above-mentioned data processing method, device, equipment and storage medium based on the rule engine, the present invention receives a data acquisition instruction including a processing target and a target data source, obtains a business data set from the target data source, and the business data set includes at least one group of business data; pre-processes all the business data in the business data set according to a preset Sql processing rule to obtain a business data result set; calls a distributed computing engine to traverse the business data result set, and converts each group of the business data in the business data result set into a first object; determines a business rule set matching the processing target from a preset rule database, and the business rule set includes at least one business rule; determines the business rule matching the business data in the business rule set according to the business data in the first object; selects a rule engine according to the business rule matching the business data, and processes the first object by calling the business rule matching the business data through the selected rule engine, and obtains the output processing result, and the processing result corresponds to the processing target. The present invention automatically selects a rule engine that can match the business rules of the business data through the above-mentioned data processing process of the business data in the target data source, and then processes the first object converted from the business data by calling the business rules according to the rule engine. The above-mentioned processing process can closely combine the rule engine with the business data (big data) through the server, without the need for professionals with sufficient big data technology, programming expertise and programming experience to participate in the processing, and the rule engine and other expansion tools (such as distributed computing engines, various expansion interfaces, etc.) can be used repeatedly in conjunction with each other; the present invention is also applicable to different data processing scenarios such as offline processing of big data and real-time processing of big data. BRIEF DESCRIPTION OF THE DRAWINGS

[0021] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for use in the description of the embodiments of the present invention will be briefly introduced below. Obviously, the accompanying drawings in the following description are only some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying creative labor.

[0022] Figure 1 It is a schematic diagram of an application environment of a data processing method based on a rule engine in one embodiment of the present invention;

[0023] Figure 2 is a flow chart of a data processing method based on a rule engine in one embodiment of the present invention;

[0024] Figure 3 is a flow chart of step S20 of a data processing method based on a rule engine in an application environment in one embodiment of the present invention;

[0025] Figure 4 is a flow chart of step S50 of a data processing method based on a rule engine in an application environment in one embodiment of the present invention;

[0026] Figure 5 It is a flowchart diagram of the steps of a data processing method based on a rule engine in an embodiment of the present invention when the number of business rules in a business rule set that match the business data in the first object is zero in an application environment;

[0027] Figure 6 It is a flowchart of step S505 of the data processing method based on the rule engine in an application environment in one embodiment of the present invention;

[0028] Figure 7 is a schematic diagram of the structure of a data processing device based on a rule engine in one embodiment of the present invention;

[0029] Figure 8 is a schematic diagram of a computer device in one embodiment of the present invention. DETAILED DESCRIPTION

[0030] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0031] The data processing method based on the rule engine provided by the present invention can be applied in Figure 1 In an application environment, a client communicates with a server via a network. The client may be, but is not limited to, various personal computers, laptops, smart phones, tablet computers, and portable wearable devices. The server may be implemented as an independent server or a server cluster consisting of multiple servers.

[0032] In one embodiment, if Figure 2 As shown, a data processing method based on a rule engine is provided, and the method is applied in Figure 1 The server in the example is used as an example to illustrate the process, including the following steps:

[0033] S10, receiving a data acquisition instruction including a processing target and a target data source, and acquiring a business data set from the target data source, wherein the business data set includes at least one group of business data.

[0034] It can be understood that the processing target refers to a processing result that is expected to be obtained after the business data is processed in the present invention (which may include one or more data processing methods such as Sql processing rule processing, Java plug-in interface processing or rule engine processing, which can be specifically applied in the offline processing scenario of big data). For example, if the business data is pre-tax salary (including basic salary or performance salary), the processing results such as personal income tax, five social insurances and one housing fund or post-tax salary can be obtained after data processing. At this time, personal income tax, five social insurances and one housing fund or post-tax salary can be set as the processing target; the target data source may include but is not limited to relational databases (such as Oracle, Mysql, etc.), non-relational databases (such as Hbase, ElasticSearch, MongoDB, etc.) and files (such as Excel, CSV, etc.) or Message server (such as kafka or RocketMQ, etc.); specifically, when a processing target is received and the target data source where the business data required by the processing target is located is determined, the server receives a data acquisition instruction containing the processing target and the target data source, and acquires the business data from the business data set of the target data source; the business data set includes business data retrieved through multiple different plug-in interfaces (data sources of multiple plug-in interfaces can be used as target data sources). Since the business data retrieved from multiple different plug-in interfaces may have different data types (such as characters, arrays, strings, etc.), before the server acquires the business data from the business data set, the business data of different data types can be normalized first, and the business data with the same attributes can be integrated to obtain a business data set with integrity and compatibility.

[0035] S20, pre-processing all the business data in the business data set according to a preset SQL processing rule to obtain a business data result set.

[0036] In this step, the Sql processing rule contains at least one (can contain multiple) Sql statements that can implement a certain preprocessing operation. This Sql processing rule can complete the preprocessing of business data (one or more of the preprocessing operations such as screening processing, filtering processing and grouping aggregation processing); the business data result set is the data processing result corresponding to each business data in the business data set after the business data is preprocessed.

[0037] In this embodiment, the business data in the business data set obtained from the target data source in step S10 is preprocessed, including screening and filtering the existing and useless business data, and then grouping and aggregating the required business data, so that the required business data can be further determined from a large amount of business data, and the required business data can be standardized to obtain a tidier business data result set (at this time, the business data in the business data result set is completely consistent with the processing target, and there is no useless data, and it has been grouped and aggregated), and the workload of the rule engine can be reduced.

[0038] Furthermore, if Figure 3 As shown, the step S20 includes:

[0039] S201, confirming a preprocessing type for preprocessing the business data set, wherein the preprocessing type includes one or more of screening processing, filtering processing, and grouping and aggregation processing.

[0040] In this step, the screening process, filtering process and grouping aggregation process in the preprocessing type are performed.

[0041] S202: Retrieve a corresponding SQL rule template according to the preprocessing type.

[0042] It is understandable that since the Sql rule templates corresponding to each preprocessing type are different, the Sql rule template may be composed of Sql rule templates corresponding to multiple preprocessing types; each Sql rule template can generate a Sql processing rule after filling in the corresponding data attributes in its preset position, and the Sql processing rule can perform at least one preprocessing operation.

[0043] S203: Acquire data attributes input by the user that correspond to the preprocessing type.

[0044] Specifically, the user can input the data attribute corresponding to the desired preprocessing type in the input interface. For example, if the input data attribute is screening processing, a corresponding operation can be generated in the next step.

[0045] S204: insert the data attribute into a preset position in the Sql rule template, and generate a Sql processing rule associated with the data attribute, wherein the Sql processing rule is used to perform preprocessing corresponding to the preprocessing type.

[0046] Understandably, each Sql processing rule may have at least one Sql statement, and each Sql statement can complete its corresponding function. That is, through the above steps S201 to S204, a complete Sql processing rule can be generated, and in this process, the user does not need to be familiar with the Sql programming language to complete the generation rule of the Sql processing rule, so it can be widely used by non-professionals.

[0047] S205: Test whether the SQL processing rule is a correct statement through a preset test interface.

[0048] In this step, the Sql statement in the Sql processing rule may fail to obtain the final business data result (i.e., the running result) due to individual reasons (for example, in the business data set obtained in step S10, when the attribute value corresponding to the data attribute in the Sql processing rule cannot be obtained, the Sql processing rule cannot be run and preprocessed at this time). Therefore, it is only necessary to run the Sql processing rule through the preset test interface to verify whether the Sql statement in the Sql processing rule is a correct statement. When the Sql processing rule is correct, the preprocessing corresponding to the data attribute and the preprocessing type can be performed through the preset test interface. That is, in this embodiment, the process of testing whether the Sql processing rule is a correct statement only needs to call the preset test interface to be automatically performed, which reduces the error probability of the Sql processing rule. At the same time, the process does not require the participation of professionals familiar with the Sql programming language, thus greatly expanding the scope of application and improving the test efficiency.

[0049] S206, if the Sql processing rule is a correct statement, execute the Sql processing rule and return the business data result corresponding to the preprocessing type and the data attribute from the test interface, and put the business data result into the business data result set.

[0050] In this step, when the Sql processing rule is a correct statement, this Sql processing rule is directly used to pre-process all business data in the business data set, and the business data results corresponding to each group of business data are put into the business data result set.

[0051] S207: If the Sql processing rule is an erroneous statement, prompt the user that the Sql processing rule is erroneous.

[0052] In this step, when the Sql processing rule is an error statement, it means that no business data result can be obtained by using this Sql processing rule. At this time, it is necessary to prompt that the Sql processing rule is wrong, and at the same time, the error of the Sql processing rule can be prompted and modified at the wrong place (at the same time, the user can be prompted with a modification method that can be referred to according to the modification record of the previous historical user), or the user is prompted to return to step S201 to regenerate a new Sql processing rule.

[0053] S30, calling a distributed computing engine to traverse the business data result set, and converting each group of the business data in the business data result set into a first object.

[0054] It can be understood that distributed computing is a computing method, which is relative to centralized computing. With the development of computing technology, some applications require huge computing power to complete. If centralized computing is used, it will take a long time to complete. Distributed computing (which can be summarized as the process of data reading, computing and storing) decomposes the application into many small parts and assigns them to multiple computers for processing, which can save overall computing time and greatly improve computing efficiency. At this time, distributed computing engines (such as Mapreduce, Spark, etc.) can be applied to distributed computing. Specifically, since the amount of data in the business data result set may be very large, at this time, calling the distributed computing engine to traverse the business data result set can distribute the business data in the business data result set so that each group (or multiple groups) of business data (i.e., records) therein is assigned to different computers for processing, and each group of business data processed in different computers is converted into a first object (i.e., Po, Persisent Object, persistent object), after converting business data into Po object, the Po object can be directly processed through business rules (the business rules match the Po object, that is, the business rules can be used to process the Po object) to obtain the processing result, or the Po object can be converted into other objects if necessary, and then processed through other business rules (other business rules match other objects and can process other objects) to obtain the processing result.

[0055] In this embodiment, by calling a distributed computing engine, a large number of business data result sets (ie, big data) are processed in a distributed manner, which can save processing time, improve processing efficiency, and further improve the conversion efficiency of the business data in the business data result set into the first object.

[0056] S40, determining a business rule set matching the processing target from a preset rule database, wherein the business rule set includes at least one business rule.

[0057] It is understandable that the business rules included in the business rule set that matches the processing target all refer to business rules that can process business data and the processing results obtained after the data processing match the processing target. The business rule set and the business rules therein can be named according to the processing target, etc. The rule content in the business rule can be set according to the requirements, and all business rules (or business rule sets) are stored in the preset rule database.

[0058] In another embodiment, a business rule set matching the processing target may not be found in the preset rule database (that is, the business rule set matching the processing target is empty), and the user may be notified that there is no business rule set corresponding to the processing target in the preset rule database, or the user may be notified to add new business rules. At this time, the newly added business rules input through the business rule adding interface may be received, and the newly added business rules may be stored in the business rule set corresponding to the preset rule database (if the business rule set does not exist, a new business rule set may be created based on the processing result corresponding to the newly added business rule).

[0059] S50: Determine the business rule in the business rule set that matches the business data according to the business data in the first object.

[0060] It is understandable that, since different business data can be calculated to obtain different processing results through different business rules, different business rules matching the business data can also be determined by different business data. For example, if the business data is pre-tax wage data (including basic wage or performance wage), and the processing target is individual tax, if the business rule can obtain the individual tax processing result after data processing based on the pre-tax wage data (part or all of the pre-tax wage data), the business rule matches the pre-tax wage data (business data); for example, if the business data is the deposit business data of a business manager's client, and the processing target is individual tax, if the business rule can calculate the commission of the business manager based on the deposit business data (part or all of the deposit business data), the business rule is the business rule matching the deposit business data; specifically, if the business data in the first object contains all the business data to be input in the business rule (all the business data required for the business rule to calculate the corresponding processing result), it can be determined as the business rule matching the business data in the first object; if the business data in the first object does not contain all the business data to be input in the business rule, it means that the business data in the first object is not the business data matching the business rule.

[0061] In this embodiment, since the business rule engine processes more than one type of business data, and the processed business data may also include multiple business rules corresponding to it, the established business rule set is matched with the processing target corresponding to the business data, and the business rules that match the business data in the first pair of objects are determined in the matched business rule set, thereby avoiding direct matching of business data with business rules, and further reducing the matching time of business rules.

[0062] Furthermore, if Figure 4 As shown, the step S50 includes:

[0063] S501: Determine whether the number of the business rules in the business rule set that match the business data in the first object is greater than one.

[0064] It is understandable that the number of business rules in the business data set that match the business data in the first object may be zero, one, or more than two (greater than one).

[0065] S502: If the number of the business rules in the business rule set that match the business data in the first object is greater than one, all the business rules in the business rule set are determined as business rules to be matched by the rule engine in the business rule set.

[0066] In this step, when the number of business rules in the business rule set that match the business data is greater than one, all the business rules in the business rule set can be selected as business rules to be matched by the rule engine in the business rule set, that is, the business rules selected for data processing and obtaining processing results can include multiple ones.

[0067] In this embodiment, by determining whether the number of business rules in the business rule set that match the business data in the first object is greater than one, corresponding measures can be taken based on the number of matched business rules, thereby preventing the variability of the number of matched business rules from affecting the processing results of the rule engine.

[0068] In one embodiment, after step S501, the method further includes:

[0069] If the number of the business rules in the business rule set that match the business data in the first object is equal to one, the business rule in the business rule set is determined as the business rule of the rule engine to be matched.

[0070] In this step, when the number of business rules in the business rule set that matches the business data is equal to one, it can be directly selected and enter step S60 to match the rule engine according to the business rule.

[0071] In one embodiment, if Figure 5 As shown, after step S501, the following further includes:

[0072] S503: If the number of the business rules in the business rule set that match the business data in the first object is zero, obtain other business rules in the business rule set and obtain the to-be-input business data required by the other business rules.

[0073] S504, calling the preset custom function and interceptor according to the conversion relationship between the business data in the first object and the business data to be input required by other business rules, and converting the first object containing the business data into a second object containing the business data to be input through the preset custom function and the interceptor.

[0074] S505: Determine the other business rules as business rules to be matched by the rule engine.

[0075] In this embodiment, when the number of business rules in the business rule set that match the business data in the first object is equal to zero, it may be that the business data in the first object does not match all the business rules in the business rule set. At this time, you can first determine another business rule in the business rule set that can still obtain a processing result that matches the processing target, and use the other business rules as business rules that need to be processed later (that is, business rules that match the rule engine); thereafter, call the preset custom function (UDF function) and interceptor (Interceptor) through the Java plug-in interface to convert the first object into a second object (the second object contains all the business data to be input required in other business rules), obtain the second object that matches the other business rules in the business rule set, and obtain the processing result that matches the processing target after the second object is processed by other business rules in the subsequent steps. Understandably, if there are no other business rules in the business rule set, or the first object cannot be converted (no corresponding custom function and interceptor) to a second object containing business data to be input for other business rules; at this time, you can prompt the user to switch the selected processing target or prompt the user to add new business rules or add custom functions and interceptors.

[0076] In this embodiment, when the number of business rules matching the business data in the first object in the business rule set is zero, the first object containing the business data is converted into a second object containing the business data to be input through a preset custom function and an interceptor, and the business rules matching the second object are used as the business rules to be matched by the rule engine. This ensures that when no business rules are matched, the server can determine a business rule matching the second object.

[0077] Furthermore, if Figure 6 As shown, the step S504 includes:

[0078] S5041, calling the preset custom function through the Java plug-in interface, and inputting the business data in the first object into the preset custom function to run, and obtaining an operation result, which is composed of multiple objects.

[0079] In this embodiment, a UDF function (preset custom function) can be customized in Hive. Specifically, it is necessary to write the code related to the UDF function in advance (that is, to inherit the UDF class according to the UDF specification) and create a temporary function, package the code into a jar package and upload it to the server, add the jar package from the server to hive, bind the temporary function to the class related to the code written in the jar package, and finally call the UDF function to run the first object.

[0080] S5042: calling the preset interceptor through the Java plug-in interface to intercept the preset behavior object in the running result, and recording other objects in the running result except the preset behavior object as the second object.

[0081] It is understandable that the Interceptor provides a mechanism for developers to define a behavior before it is executed (the behavior is the above-mentioned behavior object). Interceptors are a decentralized programming method that can separate common required functions from unrelated classes; at the same time, they can share a behavior. Once the behavior changes, there is no need to modify many classes, only the behavior; Interceptors separate many functions and greatly reduce the amount of code.

[0082] S60, selecting a rule engine according to the business rules matching the business data, and processing the first object by calling the business rules matching the business data through the selected rule engine, and obtaining an output processing result, wherein the processing result corresponds to the processing target.

[0083] It can be understood that the business rules include multiple rule parameters. Since each business rule has different rule parameters (rule parameters can be represented by code), and different rule parameters require different rule engines to process, the rule engine can call the business rule only when the rule engine can process the rule parameters of the business rule (that is, the rule parameters support the rule engine); therefore, the rule engine can be selected according to the business rules (rule parameters in the business rules) (the rule engine can be used to process the rule parameters in the business rules, that is, the rule engine can call the business rules), and the corresponding business rules are called according to the determined rule engine to process the data of the first object to obtain a processing result, and the processing result is the same as the processing target.

[0084] In this embodiment, since different rule engines correspond to different rule parameters and business rules are established based on rule parameters, by selecting a rule engine through business rules that match business data, a rule engine that can truly and successfully process business data can be quickly determined.

[0085] Furthermore, after step S60, the following steps are also included:

[0086] A. Generate a mapping relationship table according to each group of the business data in the business data result set and the processing result corresponding to each group of the business data, and store the mapping relationship table in a target data storage source.

[0087] In this step, the processing result and each group of business data in the corresponding business data result set can generate a mapping relationship table according to a certain mapping relationship (such as table name, index name, file name, etc.). That is, this embodiment can ensure that the processing result presents a relationship label with various connections, which is convenient for personnel to view.

[0088] Furthermore, the mapping relationship table includes business data corresponding to different stored data attributes, and after step A, it also includes:

[0089] The target data corresponding to each of the storage data attributes in the mapping relationship table in other data sources is obtained through a preset plug-in interface, and the target data is stored in the mapping relationship table in the target data storage source.

[0090] In this step, the target data of other data sources is business data that can be used to integrate the business data in the mapping relationship table, but the target data should be a preset storage data attribute (the same as the data attribute of each business data in the mapping relationship table). That is, this embodiment can integrate the target data in other data sources into the mapping relationship table, so that the mapping relationship table can be comprehensive.

[0091] Furthermore, before step S60, the following steps are also included:

[0092] The business rules are preconfigured and stored in the self-preset rule database, wherein the business rules include the corresponding relationship between the business data to be input and the processing result, and the rule parameters for supporting the rule engine.

[0093] It is understandable that the business data to be input is the business data required for data processing through business rules. If the business data in the first object needs to be processed through business rules, the business data of the first object should contain all the business data to be input in the business rules; after the business data in the first object is processed through business rules, a processing result is generated, that is, a processing result corresponding to the business data to be input (that is, the above-mentioned processing target). It is understandable that since each business rule has different rule parameters (rule parameters can be represented by codes), and different rule parameters require different rule engines to process, the rule engine can only call the business rule when the rule engine can process the rule parameters of the business rule (that is, the rule parameters support the rule engine); it is understandable that the rule parameters in the business rule may include a mixture of code and data attribute values.

[0094] Furthermore, before step S60, the method further includes:

[0095] Receiving business rule modification information input by a business rule modification interface, and modifying the business rule in the preset rule database according to the business rule modification information; or

[0096] Receive the newly added business rules input by the business rule adding interface, and store the newly added business rules in the self-preset rule database.

[0097] It is understandable that when a business changes, the user modifies the business rules according to the business changes, generates business rule modification information, inputs the business rule modification information through the business rule modification interface, and uses the business rule modification information to modify the business rules in the corresponding business rule set in the preset database.

[0098] Similarly, when there is a new business, the user writes a new business rule according to the new business, inputs the new business rule through the business rule adding interface, and stores the new business rule in the preset database and the new business rule set corresponding to the new business rule.

[0099] In summary, the above provides a data processing method based on a rule engine, which receives a data acquisition instruction including a processing target and a target data source, obtains a business data set from the target data source, and the business data set includes at least one group of business data; pre-processes all the business data in the business data set according to a preset Sql processing rule to obtain a business data result set; calls a distributed computing engine to traverse the business data result set, and converts each group of the business data in the business data result set into a first object; determines a business rule set matching the processing target from a preset rule database, and the business rule set includes at least one business rule; determines the business rule matching the business data in the business rule set according to the business data in the first object; selects a rule engine according to the business rule matching the business data, and processes the first object by calling the business rule matching the business data through the selected rule engine, and obtains the output processing result, and the processing result corresponds to the processing target. The present invention automatically selects a rule engine that can match the business rules of the business data through the above-mentioned data processing process of the business data in the target data source, and then processes the first object converted from the business data by calling the business rules according to the rule engine. The above-mentioned processing process can closely combine the rule engine with the business data (big data) through the server, without the need for professionals with sufficient big data technology, programming expertise and programming experience to participate in the processing, and the rule engine and other expansion tools (such as distributed computing engines, various expansion interfaces, etc.) can be used repeatedly in conjunction with each other; the present invention is also applicable to different data processing scenarios such as offline processing of big data and real-time processing of big data.

[0100] It should be understood that the order of execution of the steps in the above embodiment does not necessarily mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiment of the present invention.

[0101] In one embodiment, a data processing device based on a rule engine is provided, and the data processing device based on the rule engine corresponds one-to-one to the data processing method based on the rule engine in the above embodiment. Figure 7 As shown, the data processing device based on the rule engine includes a receiving module 11, a preprocessing module 12, a conversion module 13, a first determination module 14, a second determination module 15 and an acquisition module 16. The functional modules are described in detail as follows:

[0102] A receiving module 11 is used to receive a data acquisition instruction including a processing target and a target data source, and acquire a business data set from the target data source, wherein the business data set includes at least one set of business data;

[0103] A preprocessing module 12 is used to preprocess all the business data in the business data set according to a preset SQL processing rule to obtain a business data result set;

[0104] A conversion module 13, configured to call a distributed computing engine to traverse the business data result set, and convert each group of the business data in the business data result set into a first object;

[0105] A first determination module 14, configured to determine a business rule set matching the processing target from a preset rule database, wherein the business rule set includes at least one business rule;

[0106] A second determination module 15, configured to determine the business rule in the business rule set that matches the business data according to the business data in the first object;

[0107] The acquisition module 16 is used to select a rule engine according to the business rules matching the business data, and process the first object by calling the business rules matching the business data through the selected rule engine, and obtain the output processing result, which corresponds to the processing target.

[0108] Furthermore, the preprocessing module includes:

[0109] A confirmation submodule, used to confirm the preprocessing type of the business data set, wherein the preprocessing type includes one or more of screening processing, filtering processing and grouping aggregation processing;

[0110] A calling submodule, used to call the corresponding Sql rule template according to the preprocessing type;

[0111] A first acquisition submodule, used to acquire data attributes input by a user corresponding to the preprocessing type;

[0112] A generating submodule, used for inserting the data attribute into a preset position in the Sql rule template, generating a Sql processing rule associated with the data attribute, the Sql processing rule being used for performing preprocessing corresponding to the preprocessing type;

[0113] The test submodule is used to test whether the SQL processing rule is a correct statement through a preset test interface;

[0114] an execution submodule, for executing the Sql processing rule if it is a correct statement, returning the business data result corresponding to the preprocessing type and the data attribute from the test interface, and placing the business data result into the business data result set;

[0115] The prompt submodule is used to prompt the user that the Sql processing rule is incorrect if the Sql processing rule is an incorrect statement.

[0116] Furthermore, the second determining module includes:

[0117] A judging submodule, used for judging whether the number of the business rules in the business rule set that match the business data in the first object is greater than one;

[0118] The first determination submodule is configured to determine all the business rules in the business rule set as business rules to be matched by the rule engine in the business rule set if the number of the business rules in the business rule set that match the business data in the first object is greater than one.

[0119] Furthermore, the judgment submodule also includes:

[0120] A second acquisition submodule, configured to acquire other business rules in the business rule set and acquire the to-be-input business data required by the other business rules if the number of the business rules in the business rule set that match the business data in the first object is zero;

[0121] a conversion submodule, used to call a preset custom function and an interceptor according to a conversion relationship between the business data in the first object and the business data to be input required by the other business rules, and convert the first object containing the business data into a second object containing the business data to be input through the preset custom function and the interceptor;

[0122] The second determining submodule is used to determine the other business rules as business rules to be matched by the rule engine.

[0123] Furthermore, the conversion submodule includes:

[0124] A calling unit, configured to call the preset custom function through a Java plug-in interface, and input the business data in the first object into the preset custom function for execution, to obtain an execution result, wherein the execution result is composed of a plurality of objects;

[0125] The recording unit is used to call the preset interceptor through the Java plug-in interface, intercept the preset behavior object in the running result, and record other objects in the running result except the preset behavior object as the second object.

[0126] Furthermore, the data processing device based on the rule engine also includes:

[0127] A generation module is used to generate a mapping relationship table according to each group of the business data in the business data result set and the processing results corresponding to each group of the business data, and store the mapping relationship table in a target data storage source.

[0128] Furthermore, the data processing device based on the rule engine also includes:

[0129] A configuration module is used to pre-configure the business rules and store the business rules in the self-preset rule database. The business rules include the corresponding relationship between the business data to be input and the processing results, as well as rule parameters for supporting the rule engine.

[0130] For the specific definition of the data processing device based on the rule engine, please refer to the definition of the data processing method based on the rule engine above, which will not be repeated here. Each module in the above-mentioned data processing device based on the rule engine can be implemented in whole or in part by software, hardware and a combination thereof. The above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.

[0131] In one embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as follows: Figure 8 As shown. The computer device includes a processor, a memory, a network interface and a database connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store data involved in the data processing method based on the rule engine. The network interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a data processing method based on the rule engine is implemented.

[0132] In one embodiment, a computer device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the steps of the data processing method based on the rule engine in the above embodiment are implemented, such as Figure 2 Alternatively, when the processor executes the computer program, the functions of each module / unit of the data processing device based on the rule engine in the above embodiment are realized, for example Figure 7 The functions of modules 11 to 16 are shown in Figure 1. To avoid repetition, they will not be described here.

[0133] In one embodiment, a computer-readable storage medium is provided on which a computer program is stored. When the computer program is executed by a processor, the steps of the data processing method based on the rule engine in the above embodiment are implemented, such as Figure 2 Alternatively, when the computer program is executed by the processor, the functions of each module / unit of the data processing device based on the rule engine in the above embodiment are realized, for example Figure 7 The functions of modules 11 to 16 are shown in Figure 1. To avoid repetition, they will not be described here.

[0134] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided by the present invention can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).

[0135] Those skilled in the art can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example. In actual applications, the above-mentioned functions can be distributed and completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above.

[0136] The embodiments described above are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. Such modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention, and should all be included in the protection scope of the present invention.

Claims

1. A data processing method based on a rule engine, characterized in that: include: receiving a data acquisition instruction including a processing target and a target data source, and acquiring a business data set from the target data source, wherein the business data set includes at least one set of business data; After pre-processing all the business data in the business data set according to the preset SQL processing rules, a business data result set is obtained; After preprocessing all the business data in the business data set according to the preset SQL processing rules, a business data result set is obtained, including: confirming a preprocessing type for preprocessing the business data set, wherein the preprocessing type includes one or more of screening processing, filtering processing, and grouping and aggregation processing; According to the preprocessing type, the corresponding Sql rule template is retrieved; Acquire data attributes corresponding to the preprocessing type input by the user; Inserting the data attribute into a preset position in the Sql rule template, generating a Sql processing rule associated with the data attribute, the Sql processing rule being used to perform preprocessing corresponding to the preprocessing type; Test whether the Sql processing rule is a correct statement through a preset test interface; If the Sql processing rule is a correct statement, the Sql processing rule is executed and the business data result corresponding to the preprocessing type and the data attribute is returned from the test interface, and the business data result is placed in the business data result set; If the Sql processing rule is an error statement, prompt the user that the Sql processing rule is wrong; Calling a distributed computing engine to traverse the business data result set, and converting each group of the business data in the business data result set into a first object; Determine a business rule set matching the processing target from a preset rule database, wherein the business rule set includes at least one business rule; Determine, according to the business data in the first object, the business rule in the business rule set that matches the business data; A rule engine is selected according to the business rule matching the business data, and the first object is processed by calling the business rule matching the business data through the selected rule engine, and an output processing result is obtained, and the processing result corresponds to the processing target.

2. The data processing method based on rule engine according to claim 1, characterized in that: The determining, according to the business data in the first object, the business rule in the business rule set that matches the business data includes: Determining whether the number of the business rules in the business rule set that match the business data in the first object is greater than one; If the number of the business rules in the business rule set that match the business data in the first object is greater than one, all the business rules in the business rule set are determined as business rules to be matched by the rule engine in the business rule set.

3. The data processing method based on rule engine according to claim 2, characterized in that: After determining whether the number of the business rules in the business rule set that match the business data in the first object is greater than one, the method further includes: If the number of the business rules in the business rule set that match the business data in the first object is zero, obtaining other business rules in the business rule set and obtaining the to-be-input business data required by the other business rules; Retrieving a preset custom function and an interceptor according to a conversion relationship between the business data in the first object and the business data to be input required by the other business rules, and converting the first object containing the business data into a second object containing the business data to be input through the preset custom function and the interceptor; The other business rules are determined as business rules to be matched by the rule engine.

4. The data processing method based on rule engine according to claim 3 is characterized in that: The step of calling a preset custom function and an interceptor according to a conversion relationship between the business data in the first object and the business data to be input required by other business rules, and converting the first object containing the business data into a second object containing the business data to be input through the preset custom function and the interceptor, includes: Calling the preset custom function through a Java plug-in interface, and inputting the business data in the first object into the preset custom function to run, to obtain an operation result, wherein the operation result is composed of multiple objects; The preset interceptor is called through the Java plug-in interface to intercept the preset behavior object in the running result, and other objects in the running result except the preset behavior object are recorded as the second object.

5. The data processing method based on rule engine according to claim 1, characterized in that: After selecting a rule engine according to the business rule matching the business data, and processing the first object by calling the business rule matching the business data through the selected rule engine, and obtaining the output processing result, the method further includes: A mapping relationship table is generated according to each group of the business data in the business data result set and the processing result corresponding to each group of the business data, and the mapping relationship table is stored in a target data storage source.

6. The data processing method based on rule engine according to claim 1, characterized in that: Before selecting a rule engine according to the business rule matching the business data, invoking the business rule matching the business data by the selected rule engine to process the first object, and obtaining the output processing result, the method further includes: The business rules are preconfigured and stored in the self-preset rule database, wherein the business rules include the corresponding relationship between the business data to be input and the processing result, and the rule parameters for supporting the rule engine.

7. A data processing device based on a rule engine, characterized in that: include: A receiving module, configured to receive a data acquisition instruction including a processing target and a target data source, and acquire a business data set from the target data source, wherein the business data set includes at least one set of business data; A preprocessing module, used to preprocess all the business data in the business data set according to a preset SQL processing rule to obtain a business data result set; The preprocessing module is further used for: confirming a preprocessing type for preprocessing the business data set, wherein the preprocessing type includes one or more of screening processing, filtering processing, and grouping and aggregation processing; According to the preprocessing type, the corresponding Sql rule template is retrieved; Acquire data attributes corresponding to the preprocessing type input by the user; Inserting the data attribute into a preset position in the Sql rule template, generating a Sql processing rule associated with the data attribute, the Sql processing rule being used to perform preprocessing corresponding to the preprocessing type; Test whether the Sql processing rule is a correct statement through a preset test interface; If the Sql processing rule is a correct statement, the Sql processing rule is executed and the business data result corresponding to the preprocessing type and the data attribute is returned from the test interface, and the business data result is placed in the business data result set; If the Sql processing rule is an error statement, prompt the user that the Sql processing rule is wrong; A conversion module, used for calling a distributed computing engine to traverse the business data result set, and converting each group of the business data in the business data result set into a first object; A first determination module, configured to determine a business rule set matching the processing target from a preset rule database, wherein the business rule set includes at least one business rule; A second determination module, configured to determine the business rule in the business rule set that matches the business data according to the business data in the first object; An acquisition module is used to select a rule engine according to the business rules matching the business data, and process the first object by calling the business rules matching the business data through the selected rule engine, and obtain the output processing result, which corresponds to the processing target.

8. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the rule engine-based data processing method according to any one of claims 1 to 6 is implemented.

9. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the rule engine-based data processing method according to any one of claims 1 to 6 is implemented.

Citation Information

Patent Citations

  • Data query system and data query engine device

    CN101576921A

  • Tag-based mobile internet page design system and method

    CN101706821A

  • Service processing method and service processing system based on rule engine

    CN107977441A

  • Business processing method, system and related equipment based on visualization rule engine

    CN109144374A

  • Data quality & integrity engine

    US20050066240A1