Rule-based data service publishing method and apparatus

By employing a rule-based data service publishing method and utilizing a rule engine for data cleaning and querying, the problem of low efficiency in data querying and statistics under the complex business context of the resource industry is solved, and efficient data service publishing is achieved.

CN115481157BActive Publication Date: 2025-11-14SHANGHAI SHUHUI SYST TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211150828.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Priority Date
2022-05-17
Filing Date
2022-09-21
Publication Date
2025-11-14
Estimated Expiration
2042-09-21

AI Technical Summary

Technical Problem

Existing technologies cannot achieve dynamic data querying and statistics in the context of complex business operations in the resource industry, resulting in low efficiency.

Method used

The rule-based data service publishing method utilizes a rule engine to receive rule execution requests, read rule configuration content and business data, perform data cleaning, querying and post-service processing, and finally publish the data service through a REST interface.

Benefits of technology

It improves the efficiency of complex data querying and statistics, and enables efficient data service publishing in different business scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115481157B_ABST
    Figure CN115481157B_ABST
Patent Text Reader

Abstract

This invention provides a rule-based data service publishing method and apparatus. The method includes: receiving a rule execution request sent by a front-end; reading rule configuration content and business data pre-stored in a database according to the rule execution request, and initializing a rule engine; obtaining the pre-services in the rule configuration content through a pre-introduced JAVA reflection mechanism, and cleaning the business data according to the pre-services to obtain cleaned business data; querying the cleaned business data through a built-in data engine to obtain query results; performing post-service processing on the cleaned business data based on the query results to obtain processed data, and feeding the processed data back to the front-end; receiving a descriptive state transition REST interface confirmed by the front-end based on the processed data, and publishing the data service based on the REST interface. This method can improve the efficiency of complex data querying and data statistics.
Need to check novelty before this filing date? Find Prior Art

Description

[0001] This application claims priority to Chinese Patent Application No. 202210536371.6, filed on May 17, 2022, entitled "Rule-Based Data Service Publishing Method and Apparatus", the entire contents of which are incorporated herein by reference. Technical Field

[0002] This invention relates to the field of data processing technology, and in particular to a rule-based data service publishing method and apparatus. Background Technology

[0003] Currently, the informatization of the natural resources industry is developing rapidly, covering different business systems such as land, planning, ocean, and forestry. Data assets are classified and standardized differently under different business systems.

[0004] In existing technologies, dynamic data querying is achieved through a system under a single background, and data statistics are performed manually. However, dynamic data querying and statistics under the complex business background of the resource industry cannot be achieved.

[0005] Therefore, there is an urgent need for a data service publishing method for different business scenarios. Summary of the Invention

[0006] In view of this, embodiments of the present invention provide a rule-based data service publishing method and apparatus to address the challenges of complex data queries and the slowness of manual statistics.

[0007] To achieve the above objectives, the embodiments of the present invention provide the following technical solutions:

[0008] The first aspect of this invention discloses a rule-based data service publishing method, applicable to rule engines, the method comprising:

[0009] Receive rule execution requests sent from the front end;

[0010] According to the rule execution request, read the rule configuration content and business data pre-stored in the database, and initialize the rule engine;

[0011] By using a pre-introduced JAVA reflection mechanism, the pre-services in the rule configuration are obtained, and the business data is cleaned according to the pre-services to obtain cleaned business data.

[0012] The cleaned business data is queried using the built-in data engine to obtain query results;

[0013] Based on the query results, the cleaned business data is processed by post-service to obtain processed data, and the processed data is fed back to the front end.

[0014] Receive the expressive state transition REST interface confirmed by the front end based on the processed data, and publish data services based on the REST interface.

[0015] Optionally, the process of pre-storing the rule configuration content in the database includes:

[0016] Load the data engine;

[0017] Based on the data engine, the front-end page displays the business data table definition, which includes the business data table and field definitions.

[0018] The system receives rule configuration content defined and configured by the front end based on the business database. The rule configuration content includes at least the business data table, field data, query statement and data filtering conditions configured based on the selected query operation type, as well as the front-end service and the back-end service.

[0019] The rule configuration content is stored in the database.

[0020] Optionally, the step of querying the cleaned business data using the built-in data engine to obtain query results includes:

[0021] The built-in data engine reads the query statements and data filtering conditions from the rule configuration content, and concatenates the various query statements to obtain the concatenated query statement.

[0022] Using the concatenated query statement, the main identifier in the business data table that meets the data filtering conditions is retrieved through the main query method;

[0023] Based on the primary identifier, other business data tables in the business data are associated through subqueries to obtain other business data fields.

[0024] Optionally, based on the query results, post-processing is performed on the cleaned business data to obtain processed data, including:

[0025] Based on the other business data fields, the cleaned business data is grouped to obtain the processed data;

[0026] or,

[0027] Based on the other business data fields, data statistics are performed on the cleaned business data to obtain the processed data.

[0028] Optionally, receiving the expressive state transition REST interface confirmed by the frontend based on the processed data and publishing data services based on the REST interface includes:

[0029] Receive the data result processing method selected by the front end based on the processed data;

[0030] If the data result processing method is the first processing method, the processed data is stored in the database;

[0031] If the data result processing method is the second processing method, the service is registered through the JAVA reflection mechanism to obtain a RESTful HTTP interface with expressive state transition.

[0032] Data services are published based on the HTTP interface.

[0033] Optional, also includes:

[0034] Upon receiving a request from the front-end to cancel the data publishing service, the data publishing service is canceled based on the REST interface.

[0035] A second aspect of this invention discloses a rule-based data service publishing apparatus, applicable to rule engines, the apparatus comprising:

[0036] The receiving module is used to receive rule execution requests sent by the front end;

[0037] The reading module is used to execute requests according to the rules, read the rule configuration content and business data pre-stored in the database, and initialize the rule engine;

[0038] The cleaning module is used to obtain the pre-services in the rule configuration content through a pre-introduced JAVA reflection mechanism, and clean the business data according to the pre-services to obtain cleaned business data.

[0039] The query module is used to query the cleaned business data through the built-in data engine and obtain query results;

[0040] The post-service processing module is used to perform post-service processing on the cleaned business data based on the query results, obtain the processed data, and feed the processed data back to the front end;

[0041] The publishing module is used to receive the descriptive state transition REST interface confirmed by the front end based on the processed data and publish data services based on the REST interface.

[0042] Optionally, it also includes: a pre-storage module for pre-storing rule configuration content in the database;

[0043] The pre-storage module includes:

[0044] A loading unit is used to load the data engine;

[0045] The display unit is used to display the business data table definition on the page corresponding to the front end based on the data engine. The business data table definition includes the business data table and field definitions.

[0046] The receiving unit is configured to receive the rule configuration content defined and configured by the front end based on the business database. The rule configuration content includes at least the business data table, field data, query statement and data filtering conditions configured based on the selected query operation type, the front-end service and the back-end service.

[0047] A storage unit is used to store the rule configuration content in a database.

[0048] Optionally, the query module includes:

[0049] The reading and splicing unit is used to read the query statements and data filtering conditions in the rule configuration content through the built-in data engine, splice the various query statements, and obtain the spliced ​​query statement;

[0050] The query unit is used to use the concatenated query statement to query the main identifier in the business data table that meets the data filtering conditions through the main query method;

[0051] The association unit is used to associate other business data tables in the business data based on the main identifier through a subquery method to obtain other business data fields.

[0052] Optionally, the post-service processing module is specifically used for:

[0053] Based on the other business data fields, the cleaned business data is grouped to obtain the processed data;

[0054] or,

[0055] Based on the other business data fields, data statistics are performed on the cleaned business data to obtain the processed data.

[0056] Based on the above embodiments of the present invention, a rule-based data service publishing method and apparatus are provided. The method includes: receiving a rule execution request sent by a front-end; reading rule configuration content and business data pre-stored in a database according to the rule execution request, and initializing the rule engine; obtaining the pre-service in the rule configuration content through a pre-introduced JAVA reflection mechanism, and cleaning the business data according to the pre-service to obtain cleaned business data; querying the cleaned business data through a built-in data engine to obtain query results; performing post-service processing on the cleaned business data based on the query results to obtain processed data, and feeding the processed data back to the front-end; receiving a descriptive state transition REST interface confirmed by the front-end based on the processed data, and publishing a data service based on the REST interface. In this solution, after reading the rule configuration content and business data, the business data is cleaned according to the pre-service, and the cleaned business data is queried and processed by post-service to obtain processed data. Upon receiving the REST interface confirmed by the front-end based on the processed data, the data service is published based on the REST interface, thereby improving the efficiency of complex data query and data statistics. Attached Figure Description

[0057] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on the provided drawings without creative effort.

[0058] Figure 1 A flowchart illustrating a rule-based data service publishing method provided in an embodiment of the present invention;

[0059] Figure 2 A schematic diagram illustrating a process for pre-storing rule configuration content in a database, as provided in an embodiment of the present invention;

[0060] Figure 3 This is a schematic diagram of a process for querying cleaned business data, provided as an embodiment of the present invention.

[0061] Figure 4 This invention provides a schematic diagram of a process for publishing data services based on a REST interface, as illustrated in an embodiment of the present invention.

[0062] Figure 5 This is a schematic diagram of a rule-based data service publishing method provided in an embodiment of the present invention.

[0063] Figure 6This is a schematic diagram of a rule-based data service publishing device provided in an embodiment of the present invention. Detailed Implementation

[0064] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0065] In this application, the terms "comprising," "including," or any other variations thereof are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.

[0066] The terms "first," "second," "third," "fourth," etc. (if present) in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments described herein can be implemented in a sequence other than that illustrated or described herein.

[0067] As can be seen from the background technology, existing data service methods cannot realize dynamic data querying and statistics in the complex business context of the resource industry.

[0068] Therefore, this invention provides a rule-based data service publishing method and apparatus. In this solution, after reading the rule configuration content and business data, the business data is cleaned according to the front-end service, and the cleaned business data is queried and processed by the back-end service to obtain the processed data. When the front-end confirms the external release of the processed data through the REST interface, the data service is published based on the REST interface, thereby improving the efficiency of complex data query and data statistics.

[0069] like Figure 1 The diagram shown is a flowchart of a rule-based data service publishing method provided in an embodiment of the present invention. This method is applicable to rule engines.

[0070] This method mainly includes the following steps:

[0071] Step S101: Receive the rule execution request sent by the front end.

[0072] In step S101, the rule execution request is obtained by the user through triggering the rule execution service button on the front end.

[0073] Understandably, users can trigger the rule engine to execute rule services by clicking a button on the front end.

[0074] Optionally, in one specific embodiment, the rule execution request is obtained based on a pre-set scheduled task program.

[0075] It is understandable that a scheduled task program is set to trigger the rule engine to execute rule services at regular intervals.

[0076] In the specific implementation of step S101, the user sends a rule execution request to the rule engine through the front end according to the rule service requirements, and the rule engine receives the rule execution request.

[0077] Step S102: Based on the rule execution request, read the rule configuration content and business data pre-stored in the database, and initialize the rule engine.

[0078] In the specific implementation step S102, when the rule engine receives the rule execution request sent by the front end, it reads the pre-stored rule configuration content and business data from the database according to the rule execution request and initializes the rule engine.

[0079] Optionally, step S102 involves reading the rule configuration content and business data pre-stored in the database according to the rule execution request, and initializing the rule engine, as follows: Figure 2 The diagram illustrates a process for pre-storing rule configuration content in a database according to an embodiment of the present invention, mainly including the following steps:

[0080] Step S201: Load the data engine.

[0081] In the specific implementation step S201, when the user opens the rule configuration page (on the front end), the rule engine loads the built-in data engine.

[0082] Step S202: Based on the data engine, make the corresponding page on the front end display the business data table definition.

[0083] In step S202, the business data table definition includes the business data table and field definitions.

[0084] In the specific implementation step S202, after loading the data engine, the rule engine displays the business data table definition on the rule configuration page based on the data engine. In other words, the corresponding front-end page (rule configuration page) displays the business data table definition.

[0085] Following this, based on the business data table definition, users can directly select the table and fields to query by checking boxes, or configure the query by writing SQL statements.

[0086] Step S203: Receive the rule configuration content defined by the front end based on the business database.

[0087] In step S203, the rule configuration content includes at least the business data table, field data, query statement and data filtering conditions, pre-service and post-service configured based on the selected query operation type.

[0088] Among them, data filtering conditions include, but are not limited to, data generated at a time greater than a certain time and data within a specific business scope.

[0089] Pre-processing services include, but are not limited to, removing junk data and comparing business metrics.

[0090] Post-processing services include, but are not limited to, data computation, statistics, and analysis.

[0091] In the specific implementation step S203, the user configures the rules based on the business database through the front end and feeds them back to the rule engine. The rule engine receives the rule configuration content defined by the front end based on the business database.

[0092] Preferably, the user selects the business data table to be queried through the front end, configures the query for the business data table, obtains the corresponding rule configuration content, and feeds it back to the rule engine. The rule engine receives the rule configuration content defined and configured by the front end based on the business database.

[0093] Preferably, the user selects the field to be queried through the front end, configures the query for that field, obtains the corresponding rule configuration content, and feeds it back to the rule engine. The rule engine receives the rule configuration content defined and configured by the front end based on the business database.

[0094] Preferably, the user writes an SQL statement through the front end, queries the SQL statement to obtain the corresponding rule configuration content, and feeds it back to the rule engine. The rule engine receives the rule configuration content defined and configured by the front end based on the business database.

[0095] Understandably, configuration personnel can directly select the target query table or directly enter the query SQL statement in the rule configuration interface to configure the query.

[0096] Step S204: Store the rule configuration content in the database.

[0097] In step S204, the database includes, but is not limited to, Oracle, MySQL, and PostgreSQL.

[0098] It should be noted that, in this embodiment of the invention, multi-source data connections are supported, such as Oracle, MySQL, and PostgreSQL.

[0099] In the specific implementation step S204, the received rule configuration content is stored in the database.

[0100] Step S103: Obtain the pre-configured services in the rule configuration by using the pre-introduced JAVA reflection mechanism, and clean the business data according to the pre-configured services to obtain the cleaned business data.

[0101] In step S103, cleaning the business data includes, but is not limited to, filtering the business data by business, filtering by role, and processing junk data.

[0102] In the specific implementation of step S103, the rule engine pre-introduces a JAVA reflection mechanism. After initializing the rule engine, the rule engine first obtains the pre-service in the rule configuration content through the pre-introduced JAVA reflection mechanism, and then cleans the business data according to the pre-service to obtain the cleaned business data.

[0103] Understandably, the business data is cleaned by removing junk data through pre-processing services.

[0104] The business data is processed by comparing business metrics according to the pre-service, resulting in cleaned business data.

[0105] Step S104: Use the built-in data engine to query the cleaned business data and obtain the query results.

[0106] In the specific implementation of step S104, the cleaned business data is queried through the built-in data engine according to the data filtering conditions in the rule configuration to obtain the query results.

[0107] Optionally, step S104 involves querying the cleaned business data using the built-in data engine to obtain the query results, such as... Figure 3 The diagram shown illustrates a process for querying cleaned business data according to an embodiment of the present invention, mainly including the following steps:

[0108] Step S301: Using the built-in data engine, read the query statements and data filtering conditions in the rule configuration content, concatenate the various query statements, and obtain the concatenated query statement.

[0109] It should be noted that concatenating the various query statements is equivalent to dynamically concatenating the relevant rules.

[0110] In the specific implementation step S301, the rule engine first reads the query statement and data filtering conditions in the rule configuration content through the built-in data engine. After reading the query statement and data filtering conditions, it concatenates the various query statements to obtain the concatenated query statement.

[0111] Step S302: Using the concatenated query statement, query the main identifier in the business data table that meets the data filtering conditions through the main query method.

[0112] In step S302, the main identifier can be represented by id.

[0113] In the specific implementation step S302, the rule engine uses the concatenated query statement to query the main identifier in the business data table that meets the data filtering conditions through the main query method.

[0114] Understandably, the rule engine uses the concatenated query statement to query the main identifier of the business data table in the business data that only meets the data filtering conditions through the main query method.

[0115] It should be noted that when the main query only performs conditional filtering, it only queries key identifiers and removes business data that does not meet the data filtering conditions.

[0116] Step S303: Based on the primary identifier, use a subquery method to associate other business data tables in the business data to obtain other business data fields.

[0117] In the specific implementation step S303, the rule engine uses the main identifier and subqueries to associate other business data tables in the business data to obtain other business data fields.

[0118] It is understandable that the main identifier obtained after the query is used as the filtering condition, and other business data tables in the business data are associated through subqueries to obtain other business data fields.

[0119] Step S105: Based on the query results, perform post-service processing on the cleaned business data to obtain the processed data, and then feed the processed data back to the front end.

[0120] In the specific implementation step S105, the rule engine first obtains the post-service in the rule configuration content through the pre-introduced JAVA reflection mechanism. Then, based on the query results, it performs post-service processing on the cleaned business data to obtain the processed data and feeds the processed data back to the front end.

[0121] Understandably, based on the query results, the cleaned business data is processed to obtain the processed data.

[0122] Based on the query results, statistical processing is performed on the cleaned business data to obtain the processed data.

[0123] Based on the query results, data analysis and processing are performed on the cleaned business data to obtain the processed data.

[0124] Optionally, step S105, based on the query results, performs post-processing on the cleaned business data to obtain processed data, including:

[0125] Based on other business data fields, the cleaned business data is grouped to obtain the processed data.

[0126] Optionally, step S105, based on the query results, performs post-processing on the cleaned business data to obtain processed data, including:

[0127] Based on other business data fields, data statistics are performed on the cleaned business data to obtain the processed data.

[0128] Step S106: Receive the expressive state transition REST interface confirmed by the front end based on the processed data, and publish the data service based on the REST interface.

[0129] In the specific implementation step S106, after receiving the processed data from the rule engine, the front end confirms the publicly released descriptive state transition REST interface based on the processed data, and feeds back the confirmed publicly released REST interface to the rule engine. The rule engine receives the REST interface and publishes data services based on the REST interface.

[0130] Optionally, step S106 involves receiving the expressive state transition REST interface released by the front end based on the processed data confirmation, and publishing data services based on the REST interface, such as... Figure 4 The diagram shown illustrates a process for publishing data services based on a REST interface, as provided in an embodiment of the present invention. The process mainly includes the following steps:

[0131] Step S401: Receive the data result processing method selected by the front end based on the processed data.

[0132] In step 401, the data result processing methods include a first processing method and a second processing method.

[0133] In the specific implementation step S401, after receiving the processed data from the rule engine, the front end selects a data result processing method based on the processed data and sends the selected data result processing method to the rule engine. The rule engine then receives the data result processing method selected by the front end based on the processed data.

[0134] Understandably, users select the data result processing method through the rule configuration interface (on the front end).

[0135] Step S402: Determine whether the data result processing method is the first processing method. If yes, proceed to step S403; otherwise, proceed to step S404.

[0136] Step S403: Store the processed data in the database.

[0137] In the specific implementation step S403, if the data result processing method selected by the front end based on the processed data is determined to be the first processing method, then the processed data is stored in the database.

[0138] Step S404: Register the service using the JAVA reflection mechanism to obtain a REST-style HTTP interface for representational state transition.

[0139] In the specific implementation step S404, if it is determined that the data result processing method selected by the front end based on the processed data is not the first processing method, that is, if it is determined that the data result processing method selected by the front end based on the processed data is the second processing method, then the service is registered through the JAVA reflection mechanism to obtain the REST-style HTTP interface for expressive state transition.

[0140] In other words, services are registered using Java reflection, providing a REST-style HTTP interface for external applications to call.

[0141] Step S405: Publish data services based on the HTTP interface.

[0142] In the specific implementation of step S405, after obtaining the required HTTP interface, the rule engine publishes data services based on the HTTP interface.

[0143] Optionally, after executing step S106 (receiving the expressive state transition REST interface published by the front end based on the processed data confirmation) and publishing the data service based on the REST interface, or after executing step S405 (publishing the data service based on the HTTP interface), the process further includes:

[0144] Upon receiving a request from the frontend to cancel the data publishing service, the data publishing service is canceled based on the REST interface.

[0145] It should be noted that users can publish, cancel, and perform other operations on API services through the API management interface (on the front end).

[0146] In other words, when the rules engine receives an API service publish request or API service cancellation request from the front end, it publishes or cancels the API service.

[0147] To better understand the above explanation, as follows: Figure 5 The diagram shown is a schematic diagram of a rule-based data service publishing method provided by an embodiment of the present invention.

[0148] exist Figure 5 First, business personnel or developers enter data query rules through the front-end page and store them in the persistent database. That is, the user opens the rule configuration interface (the back-end initializes the database, reads the database tables and field definitions), configures multi-level query content, data filtering conditions, front-end services and back-end services, obtains the rule configuration content, and saves the rule configuration content to the database.

[0149] Secondly, when the rule engine receives a rule execution request from the front end, it reads the pre-stored rule configuration content and business data from the database according to the rule execution request, and initializes the rule engine.

[0150] Secondly, after initializing the rule engine, the rule engine first obtains the pre-configured services in the rule configuration through the pre-introduced JAVA reflection mechanism, and then cleans the business data according to the pre-configured services to obtain the cleaned business data.

[0151] Secondly, the rules engine, through its built-in data engine, queries the cleaned business data based on the data filtering conditions specified in the rule configuration to obtain the query results. It should be noted that this process involves dynamic rule concatenation, and the data engine involves multi-source data connections and multi-level query engines; please refer to the relevant explanations above for details.

[0152] Secondly, based on the query results, the rules engine performs post-processing on the cleaned business data to obtain the processed data, and then feeds the processed data back to the front end.

[0153] Finally, when the rules engine receives the expressive state transition REST interface that the front-end (API service management interface) confirms based on the processed data, it publishes the data service based on the REST interface.

[0154] Based on the above-described principle diagram of a rule-based data service publishing method, this embodiment of the invention also provides a specific example for explanation.

[0155] For example, query all planning-related business indicator data handled by a certain department under a certain bureau since *** and analyze whether the indicator data meets the standards.

[0156] Users open the rule configuration interface (backend initializes the database, reads database tables and field definitions), configure multi-level query content (the main query only queries the main business table and the main identifier, and the subquery SQL retrieves relevant indicator field data by associating with other business data tables through the main identifier), filter conditions (processing time greater than *** years, business scope equal to planning category), front-end services (institutional services - filtering corresponding departments, general filtering services - removing empty and junk data), and back-end services (data statistics, comparison services - adding comparison result data after comparison is completed). The rule engine executes and finally generates a dynamic HTTP interface, which is published for external applications to call.

[0157] This invention provides a rule-based data service publishing method. The method involves receiving a rule execution request from a front-end; reading pre-stored rule configuration content and business data from a database according to the request, and initializing a rule engine; using a pre-introduced Java reflection mechanism to obtain pre-services from the rule configuration content, and cleaning the business data according to these pre-services to obtain cleaned business data; querying the cleaned business data using a built-in data engine to obtain query results; performing post-service processing on the cleaned business data based on the query results to obtain processed data, and feeding the processed data back to the front-end; and receiving a REST interface for descriptive state transitions from the front-end based on the processed data, and publishing the data service based on the REST interface. In this solution, after reading the rule configuration content and business data, the business data is cleaned according to the pre-services, and the cleaned business data is queried and processed by post-services to obtain processed data. Upon receiving the REST interface from the front-end confirming the processed data, the data service is published based on the REST interface, thereby improving the efficiency of complex data querying and data statistics.

[0158] Compared with the above embodiments of the present invention Figure 1Corresponding to the rule-based data service publishing method shown, this embodiment of the invention also provides a rule-based data service publishing apparatus, which is suitable for rule engines, such as... Figure 6 As shown, the rule-based data service publishing device includes: a receiving module 61, a reading module 62, a cleaning module 63, a query module 64, a post-service processing module 65, and a publishing module 66.

[0159] The receiving module 61 is used to receive rule execution requests sent by the front end.

[0160] The reading module 62 is used to read the rule configuration content and business data pre-stored in the database according to the rule execution request, and initialize the rule engine.

[0161] The cleaning module 63 is used to obtain the pre-services in the rule configuration content through the pre-introduced JAVA reflection mechanism, and clean the business data according to the pre-services to obtain the cleaned business data.

[0162] The query module 64 is used to query the cleaned business data through the built-in data engine and obtain the query results.

[0163] The post-service processing module 65 is used to perform post-service processing on the cleaned business data based on the query results, obtain the processed data, and feed the processed data back to the front end.

[0164] The publishing module 66 is used to receive the descriptive state transition REST interface confirmed by the front end based on the processed data and publish data services based on the REST interface.

[0165] Optionally, based on the above Figure 6 The rule-based data service publishing device shown combines Figure 6 The rule-based data service publishing device is further equipped with a pre-storage module 67, which is used to pre-store the rule configuration content in the database.

[0166] The pre-storage module 67 includes:

[0167] The loading unit is used to load the data engine.

[0168] The display unit is used to enable the corresponding front-end page to display the business data table definition based on the data engine.

[0169] The business data table definition includes the business data table and field definitions.

[0170] The receiving unit is used to receive the rule configuration content defined by the front end based on the business database.

[0171] The rule configuration content includes at least the business data table, field data, query statement and data filtering conditions, front-end services and back-end services configured based on the selected query operation type.

[0172] Storage unit, used to store rule configuration content in the database.

[0173] Optionally, based on the above Figure 6 The rule-based data service publishing device shown includes a query module 64, comprising:

[0174] The read and concatenate unit is used to read the query statements and data filtering conditions in the rule configuration content through the built-in data engine, concatenate the various query statements, and obtain the concatenated query statement.

[0175] The query unit is used to retrieve the main identifiers in the business data table that meet the data filtering conditions using the concatenated query statement and the main query method.

[0176] The association unit is used to associate other business data tables in the business data based on the main identifier and through subqueries to obtain other business data fields.

[0177] Optionally, based on the above Figure 6 The rule-based data service publishing device shown includes a back-end service processing module 65, which is specifically used for:

[0178] Based on other business data fields, the cleaned business data can be grouped to obtain processed data; or, based on other business data fields, the cleaned business data can be statistically analyzed to obtain processed data.

[0179] Optionally, based on the above Figure 6 The rule-based data service publishing device shown includes a publishing module 66, comprising:

[0180] The receiving unit is used to receive the data result processing method selected by the front end based on the processed data.

[0181] The first processing unit is used to store the processed data in the database if the data result processing method is the first processing method.

[0182] The second processing unit is used to register services through the JAVA reflection mechanism if the data result processing method is the second processing method, and obtain a REST-style HTTP interface for expressive state transition.

[0183] The publishing unit is used to publish data services based on the HTTP interface.

[0184] Optionally, based on the above Figure 6The rule-based data service publishing apparatus shown includes a publishing module 66, which is further configured to:

[0185] Upon receiving a request from the frontend to cancel the data publishing service, the data publishing service is canceled based on the REST interface.

[0186] It should be noted that the specific principles and execution processes of each module or unit in the rule-based data service publishing device disclosed in the above embodiments of the present invention are the same as those of the rule-based data service publishing method of the present invention. Please refer to the corresponding parts of the rule-based data service publishing method disclosed in the above embodiments of the present invention, and they will not be repeated here.

[0187] This invention provides a rule-based data service publishing device that receives rule execution requests from a front-end; reads pre-stored rule configuration content and business data from a database according to the request, and initializes a rule engine; obtains pre-processed services from the rule configuration content using a pre-introduced Java reflection mechanism, and cleans the business data according to the pre-processed services to obtain cleaned business data; queries the cleaned business data using a built-in data engine to obtain query results; performs post-processing on the cleaned business data based on the query results to obtain processed data, and feeds the processed data back to the front-end; and receives a REST interface for descriptive state transitions published externally based on the processed data from the front-end, and publishes data services based on the REST interface. In this solution, after reading the rule configuration content and business data, the business data is cleaned according to the pre-processed services, and the cleaned business data is queried and processed by post-processing services to obtain processed data. Upon receiving the REST interface for external publication from the front-end based on the processed data, the data service is published based on the REST interface, thereby improving the efficiency of complex data querying and data statistics.

[0188] The various embodiments in this specification are described in a progressive manner. Similar or identical parts between embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. In particular, for system or system embodiments, since they are basically similar to method embodiments, the description is relatively simple, and relevant parts can be referred to the descriptions in the method embodiments. The systems and system embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without creative effort.

[0189] Those skilled in the art will further recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementations should not be considered beyond the scope of this invention.

[0190] The above description of the disclosed embodiments enables those skilled in the art to make or use the invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the invention. Therefore, the invention is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A rule-based data service publishing method, characterized in that, Applicable to rule engines, the method includes: Receive rule execution requests sent from the front end; According to the rule execution request, read the rule configuration content and business data pre-stored in the database, and initialize the rule engine; By using a pre-introduced JAVA reflection mechanism, the pre-services in the rule configuration are obtained, and the business data is cleaned according to the pre-services to obtain cleaned business data. The cleaned business data is queried using the built-in data engine to obtain query results; Based on the query results, the cleaned business data is processed by post-services to obtain processed data, and the processed data is fed back to the front end. The post-services include data calculation, statistics and analysis. Receive the expressive state transition REST interface confirmed by the front end based on the processed data, and publish data services based on the REST interface.

2. The method according to claim 1, characterized in that, The process of pre-storing the rule configuration content in the database includes: Load the data engine; Based on the data engine, the front-end page displays the business data table definition, which includes the business data table and field definitions. The system receives rule configuration content defined and configured by the front end based on the business database. The rule configuration content includes at least the business data table, field data, query statement and data filtering conditions configured based on the selected query operation type, as well as the front-end service and the back-end service. The rule configuration content is stored in the database.

3. The method according to claim 1, characterized in that, The process involves querying the cleaned business data using a built-in data engine to obtain query results, including: The built-in data engine reads the query statements and data filtering conditions in the rule configuration content, concatenates the various query statements, and obtains the concatenated query statement. Using the concatenated query statement, the main identifier in the business data table that meets the data filtering conditions is retrieved through the main query method; Based on the primary identifier, other business data tables in the business data are associated through subqueries to obtain other business data fields.

4. The method according to claim 3, characterized in that, Based on the query results, the cleaned business data undergoes post-service processing to obtain processed data, including: Based on the other business data fields, the cleaned business data is grouped to obtain the processed data; or, Based on the other business data fields, data statistics are performed on the cleaned business data to obtain the processed data.

5. The method according to claim 1, characterized in that, The step of receiving the expressive state transition REST interface confirmed by the frontend based on the processed data and publishing data services based on the REST interface includes: Receive the data result processing method selected by the front end based on the processed data; If the data result processing method is the first processing method, the processed data is stored in the database; If the data result processing method is the second processing method, the service is registered through the JAVA reflection mechanism to obtain a RESTful HTTP interface with expressive state transition. Data services are published based on the HTTP interface.

6. The method according to claim 1, characterized in that, Also includes: Upon receiving a request from the front-end to cancel the data publishing service, the data publishing service is canceled based on the REST interface.

7. A rule-based data service publishing device, characterized in that, For use with a rules engine, the apparatus includes: The receiving module is used to receive rule execution requests sent by the front end; The reading module is used to execute requests according to the rules, read the rule configuration content and business data pre-stored in the database, and initialize the rule engine; The cleaning module is used to obtain the pre-services in the rule configuration content through a pre-introduced JAVA reflection mechanism, and clean the business data according to the pre-services to obtain cleaned business data. The query module is used to query the cleaned business data through the built-in data engine and obtain query results; The post-service processing module is used to perform post-service processing on the cleaned business data based on the query results, obtain the processed data, and feed the processed data back to the front end. The post-service includes data calculation, statistics, and analysis. The publishing module is used to receive the descriptive state transition REST interface confirmed by the front end based on the processed data and publish data services based on the REST interface.

8. The apparatus according to claim 7, characterized in that, Also includes: The pre-storage module is used to pre-store rule configuration content in the database; The pre-storage module includes: A loading unit is used to load the data engine; The display unit is used to display the business data table definition on the page corresponding to the front end based on the data engine. The business data table definition includes the business data table and field definitions. The receiving unit is configured to receive the rule configuration content defined and configured by the front end based on the business database. The rule configuration content includes at least the business data table, field data, query statement and data filtering conditions configured based on the selected query operation type, the front-end service and the back-end service. A storage unit is used to store the rule configuration content in a database.

9. The apparatus according to claim 7, characterized in that, The query module includes: The reading and splicing unit is used to read the query statements and data filtering conditions in the rule configuration content through the built-in data engine, splice the various query statements, and obtain the spliced ​​query statement; The query unit is used to use the concatenated query statement to query the main identifier in the business data table that meets the data filtering conditions through the main query method; The association unit is used to associate other business data tables in the business data based on the main identifier through a subquery method to obtain other business data fields.

10. The apparatus according to claim 9, characterized in that, The post-service processing module is specifically used for: Based on the other business data fields, the cleaned business data is grouped to obtain the processed data; or, Based on the other business data fields, data statistics are performed on the cleaned business data to obtain the processed data.

Citation Information

Patent Citations

  • Big data real-time storage, processing and querying system

    CN106815338A

  • System and method for applying a business rule management system to a customer relationship management system

    US20140122377A1