Rule engine function algorithm development tool and method

By building rules engine function algorithm development tools, using parser modules, template engine modules, back-end framework modules and database modules, the problems of complexity and learning difficulty of existing rules engine tools are solved, and wider application and popularization are achieved.

CN119883250APending Publication Date: 2025-04-25SHENZHEN YUANJING DIGITAL TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411848215.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-13
Publication Date
2025-04-25

AI Technical Summary

Technical Problem

The existing rules engine-based tools are complex in design and steep in learning curve, which makes developers need to invest a lot of time to master, increasing the difficulty of getting started and limiting the popularity and application scope of tools.

Method used

Provide a method for developing a rule engine function algorithm, including parser module, template engine module, back-end framework module and database module. Through these modules, the learning and use of the rule engine is simplified.

Benefits of technology

By simplifying the development tools of the rule engine, the learning and use thresholds are lowered, and the universality and application scope of the rule engine tools are improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119883250A_ABST
    Figure CN119883250A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of rule engines, in particular to a rule engine function algorithm development tool which comprises a parser module used for receiving and parsing a request instruction from a browser and selecting different components for processing according to the data type of request data to obtain parsed data; the template engine module is used for selecting a corresponding template engine to render the analysis data into a user-readable HTML page according to the obtained project requirements of the client, building and configuring business logic through the HTML page, and constructing a function algorithm development tool; the back-end framework module is used for integrating various back-end frameworks to provide technical support for the realization of business logic corresponding to the project requirements; and the database module is used for constructing a plurality of data storage schemes based on the plurality of relational databases, and storing the request data and the analysis data through the data storage schemes. The invention further provides a rule engine function algorithm development method. According to the invention, the universality of the rule engine tool can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of rule engines, and in particular to a rule engine function algorithm development tool and method. Background Art

[0002] As a component embedded in the application, the rule engine can separate business decisions and business logic from the application code, and use predefined semantic modules to write the purpose of business decisions. This separation makes the change and maintenance of business rules more flexible, allowing business experts and developers to adjust business rules without modifying the program code, so as to quickly respond to market changes and business needs.

[0003] However, in the prior art, tools based on rule engines are often complex in design and have a steep learning curve, requiring developers to invest a lot of time in learning to master them. This not only increases the difficulty of getting started, but also affects the popularization of rule engine tools and the expansion of their application scope.

[0004] The above defects deserve improvement. Summary of the invention

[0005] The present invention provides a rule engine function algorithm development method, device, equipment and medium, the main purpose of which is to solve the problem that the rule engine tool is difficult to learn and improve the versatility of the rule engine tool.

[0006] To achieve the above purpose, the present invention provides a rule engine function algorithm development method, including a parser module, a template engine module, a backend framework module and a database module:

[0007] The parser module is used to receive and parse the request instruction from the browser, obtain the request data, and select different components for processing according to the data type of the request data to obtain parsed data, wherein the components include ELLocal Parser and EL Custom Parser;

[0008] The template engine module is used to obtain the customer's project requirements, and select a corresponding template engine according to the project requirements to render the parsed data into a user-readable HTML page, and build a function algorithm development tool through the HTML page and the business logic configured based on the preset rule engine;

[0009] The backend framework module is used to integrate multiple backend frameworks to provide technical support for the implementation of business logic corresponding to the project requirements, and complete data preprocessing and calculation according to the rule engine algorithm;

[0010] The database module is used to construct a variety of data storage solutions based on a variety of relational databases, and store request data and parsed data through the data storage solutions.

[0011] Optionally, the parser module includes:

[0012] A request processing unit, configured to receive a request instruction from a browser, extract a request header, query parameters, path parameters and a request body in the request instruction, and parse the request header, query parameters, path parameters and request body to obtain a digital structure understandable to a server;

[0013] A data type identification unit, used to identify the data type of the requested data, and select a suitable processing component according to the data type for scheduling;

[0014] The data conversion unit is used to convert the original request data into a format that can be processed by the internal system and provide data mapping and conversion functions.

[0015] Optionally, the template engine module includes:

[0016] Requirements analysis unit, used to analyze the customer's project requirements, determine the required template features, and select the appropriate template engine based on project requirements;

[0017] Data binding unit, used to bind the data passed by the parser module to the selected template, and handle variable replacement and expression evaluation in the template;

[0018] The page rendering unit is used to render the bound data into an HTML page using a template engine, and optimize the generated HTML page, wherein the optimization of the generated HTML page includes compressing and merging resources.

[0019] Optionally, the backend framework module includes:

[0020] Business logic unit, which is used to process business rules and decision making and implement specific business logic;

[0021] The framework integration unit is used to integrate different backend frameworks, provide a unified interface, and route requests to the correct services and methods;

[0022] The middleware management unit is used to manage dependencies between services and integrate and configure middleware, including authentication, logging, and error handling.

[0023] Optionally, the database module includes:

[0024] Data connection unit, used to manage data connections, including the creation and management of connection pools;

[0025] The data access unit is used to perform data addition, deletion, and modification operations, provide the abstraction of the data access layer, the interaction details of the layered database, and define the mapping relationship between the data model and the database;

[0026] The data model unit is used to define the data model, map the database table structure, manage database transactions, and ensure data consistency.

[0027] Optionally, the database module further includes:

[0028] Data cache unit, used to integrate cache services (such as Redis) to improve data access speed and manage the life cycle and consistency of cached data.

[0029] In order to solve the above problems, the present invention also provides a rule engine function algorithm development method, the method comprising:

[0030] Receive and parse the request instruction from the browser through the parser module, query the database resource, obtain the request data from the database resource, and select different components for processing according to the data type of the request data to obtain parsed data;

[0031] The client's project requirements are obtained through the template engine module, and the corresponding template engine is selected according to the project requirements to render the parsed data into a user-readable HTML page. A function algorithm development tool is constructed through the HTML page and the business logic configured based on the preset rule engine.

[0032] Optionally, the method for creating the rule engine includes:

[0033] Acquire function information input by a user through a browser, wherein the function information includes a function name and parameter information of a rule function, and the parameter information includes a type and a value range of an input parameter;

[0034] Obtaining rule information input by a user in the form of a web page of a browser, wherein the rule information includes at least one conditional expression composed of input parameters, a priority for each conditional expression, and an expected derivation result corresponding to each conditional expression;

[0035] Generate a rule engine configuration file based on the function name, the parameter information and the rule information;

[0036] A rule engine is generated based on the rule engine configuration file and the preset template engine.

[0037] The embodiment of the present invention receives and parses the request instruction from the browser through the parser module, queries the database resources, obtains the request data from the database resources, and selects different components for processing according to the data type of the request data to obtain the parsed data; obtains the customer's project requirements through the template engine module, and selects the corresponding template engine according to the project requirements to render the parsed data into a user-readable HTML page, and constructs a function algorithm development tool through the HTML page and the business logic based on the preset rule engine configuration. Therefore, the rule engine function algorithm development tool and method proposed by the present invention solve the problem that the rule engine tool is difficult to learn and improves the versatility of the rule engine tool. BRIEF DESCRIPTION OF THE DRAWINGS

[0038] Figure 1 A schematic diagram of a functional module design constructed by a rule engine function algorithm development tool provided in one embodiment of the present invention;

[0039] Figure 2 A product architecture diagram constructed by a rule engine function algorithm development tool provided by an embodiment of the present invention;

[0040] Figure 3 A product interface diagram constructed by a rule engine function algorithm development tool provided by an embodiment of the present invention;

[0041] Figure 4 A detailed diagram of the left interface of a product interface diagram constructed by a rule engine function algorithm development tool provided in an embodiment of the present invention;

[0042] Figure 5 This is a detailed diagram of the right side of the product interface diagram constructed by the rule engine function algorithm development tool provided in one embodiment of the present invention. DETAILED DESCRIPTION

[0043] The following is further explained in detail through specific implementation methods.

[0044] Reference Figure 1 As shown, the present invention provides a rule engine function algorithm development tool, which is used to apply the rule engine and build an algorithm development tool, which includes: a parser module, a template engine module, a backend framework module and a database module. Each module is responsible for a specific data processing task and interacts with the upper and lower layers through a standardized interface to ensure the smooth operation of the entire system.

[0045] Among them, the rule engine is a software component used to manage and execute business rules by separating business logic from application code and defining and storing it in the form of rules.

[0046] Furthermore, the rule engine function algorithm development tool refers to a tool used to create, test, deploy and monitor the rules and algorithms used in the engine. The tool can also provide a visual interface that allows users to define and manage business rules in a non-programming manner.

[0047] In the present invention, the product architecture diagram constructed by the rule engine function algorithm development tool is as follows Figure 2 As shown, the parser module includes a local parser and a custom parser, which are responsible for parsing different types of data formats (such as XML and JSON), corresponding to the function of the parser module, which can convert data into a format that the system can process; the template engine module is a script plug-in, which can be regarded as a part of the template engine, allowing users to write custom logic and rules for processing and generating data; the back-end framework module includes a builder and an EL executor, the builder part is responsible for building and organizing the data processing process, similar to the controller and route in the back-end framework, which is used to define how data flows through the system, and the EL executor is to perform the core expression language (EL) parsing and execution, which is regarded as the business logic processing part in the back-end framework; the database template includes a rule storage plug-in (such as SQL, Zookeeper, Etcd, Nacos, Apollo, Redis and other plug-ins), which is used to store and manage rules, equivalent to the database module, and provides data persistence and rule management functions.

[0048] In addition, there is a context manager responsible for generating and exchanging data contexts, which is usually handled by session management or state management mechanisms in the backend framework, and a LiteFlow executor, which is responsible for executing specific data processing flows, including conditional judgment and node execution, which can be regarded as a workflow or task scheduling module in the backend framework.

[0049] Furthermore, the parser module is used to receive and parse the request instruction from the browser, obtain the request data, and select different components for processing according to the data type of the request data to obtain parsed data, wherein the components include EL Local Parser and EL Custom Parser;

[0050] The template engine module is used to obtain the project requirements of the customer and select a corresponding template engine according to the project requirements to render the parsed data into a user-readable HTML page;

[0051] The backend framework module is used to integrate multiple backend frameworks to provide technical support for the implementation of business logic corresponding to the project requirements, and complete data preprocessing and calculation according to the rule engine algorithm;

[0052] The database module is used to construct a variety of data storage solutions based on a variety of relational databases, and store request data and parsed data through the data storage solutions.

[0053] Furthermore, the rule engine includes: a rule base, an inference engine and a memory, wherein the rule base is used to store business plans, the inference engine is responsible for argumentation and matching rules, and sending the matching results to the memory for processing, and the memory is a working memory for storing currently processed data objects and intermediate results that comply with business rules.

[0054] In the embodiment of the present invention, EL Local Parser and EL Custom Parser are both parser components. EL Local Parser is a built-in EL parser specially customized for a specific application or framework. It is designed to understand EL expressions in a specific format and may contain some application-specific extensions and optimizations. This parser is usually integrated into the application to parse and execute EL expressions. EL Custom Parser refers to a user-defined EL parser that allows developers to extend or modify the parsing behavior of EL according to specific requirements. In some cases, the standard EL parser may not meet all requirements, so developers can create their own parsers to handle specific syntax or functions.

[0055] For example, in ESLint, you can specify a custom JavaScript parser through the parser configuration item so that ESLint can understand non-standard JavaScript syntax or experimental features. Similarly, in the Spring framework, you can create a custom EL parser by implementing the ExpressionParser interface to support custom functions or specific expression syntax.

[0056] In addition, there are steps for core process optimization, which can improve the efficiency of data processing by optimizing the core EL parsing execution process, introducing metadata management, context managers and other mechanisms.

[0057] In general, EL Local Parser is specifically used to process common JavaScript data types, such as JSON, XML, etc., to ensure the correctness and consistency of data formats. EL Custom Parser provides support for custom data types, allowing users to expand data type parsing capabilities according to actual needs. Through the collaborative work of these two parsers, the system can flexibly cope with various complex data inputs.

[0058] Further, backend frameworks refer to software libraries or tool sets used to develop server-side applications. They can provide various functionalities such as routing, database connectivity, authentication, template engines, etc., thereby simplifying the development process.

[0059] In the present invention, the acquired data can be parsed via a parser module, and the parser module includes:

[0060] A request processing unit, configured to receive a request instruction from a browser, extract a request header, query parameters, path parameters and a request body in the request instruction, parse the request header, query parameters, path parameters and request body to obtain a digital structure understandable by a server, wherein the request instruction may be an HTTP request;

[0061] A data type identification unit, used to identify the data type of the requested data, and select a suitable processing component according to the data type for scheduling;

[0062] The data conversion unit is used to convert the original request data into a format that can be processed by the internal system and provide data mapping and conversion functions.

[0063] In the present invention, the data of the bound template can be rendered via a template engine module to generate a user-readable interface, and the template engine module includes:

[0064] Requirements analysis unit, used to analyze the customer's project requirements, determine the required template features, and select the appropriate template engine based on project requirements;

[0065] Data binding unit, used to bind the data passed by the parser module to the selected template, and handle variable replacement and expression evaluation in the template;

[0066] The page rendering unit is used to render the bound data into an HTML page using a template engine, and optimize the generated HTML page, wherein the optimization of the generated HTML page includes compressing and merging resources.

[0067] The template engine module is responsible for rendering the parsed data into user-readable HTML pages. This module integrates three popular template engines: Jade, Nunjucks, and Erb. Each template engine has its own unique syntax and features, which can meet the preferences and project requirements of different development teams. Developers can choose the appropriate template engine for page rendering according to the actual situation of the project, thereby improving development efficiency and user experience.

[0068] In addition, the template engine module also includes a modular and plug-in management unit, which is used to manage modular and plug-in backend components and provide component loading, unloading and management;

[0069] The script execution unit is used to execute business logic written in scripting languages ​​such as Lua and Aviator, and provides script compilation, execution, and monitoring;

[0070] The service orchestration unit is used to manage and schedule backend services to respond to clients and handle dependencies and collaboration between servers.

[0071] The error handling unit is used to handle errors that may occur during the parsing process and return an appropriate response.

[0072] In the present invention, multiple backend frameworks can be integrated via the backend framework module to provide technical support for the implementation of business logic. The backend framework module includes:

[0073] Business logic unit, which is used to process business rules and decision making and implement specific business logic;

[0074] The framework integration unit is used to integrate different backend frameworks, provide a unified interface, and route requests to the correct services and methods;

[0075] The middleware management unit is used to manage dependencies between services and integrate and configure middleware, including authentication, logging, error handling, etc.

[0076] Furthermore, the backend framework layer integrates a variety of backend frameworks and technologies, such as Grunt, Express.js, Node.js, etc., to provide rich support for the implementation of business logic. These frameworks not only provide efficient data processing capabilities, but also reduce system complexity through modularization and plug-in, and improve system scalability and maintainability. In addition, the architecture also supports scripting languages ​​such as Lua and Aviator, allowing developers to implement complex business logic by writing scripts.

[0077] Furthermore, the backend framework layer emphasizes the ability to integrate multiple technologies and support multiple database solutions, which are the concrete manifestations of component-based design. Through componentization, the system can flexibly respond to changes. Whether it is adding new functions, adjusting business processes or optimizing user experience, it can be achieved by adjusting the arrangement of components without large-scale reconstruction of the entire system.

[0078] In the present invention, a variety of data storage schemes can be prepared to store data via a database module, and the database module includes:

[0079] Data connection unit, used to manage data connections, including the creation and management of connection pools;

[0080] The data access unit is used to perform data addition, deletion, and modification operations, provide the abstraction of the data access layer, the interaction details of the layered database, and define the mapping relationship between the data model and the database;

[0081] The data model unit is used to define the data model, map the database table structure, manage database transactions, and ensure data consistency.

[0082] Furthermore, the database module integrates a variety of backend frameworks and technologies, such as Grunt, Express.js, Node.js, etc., to provide rich support for the implementation of business logic. These frameworks not only provide efficient data processing capabilities, but also reduce system complexity through modularization and plug-in, and improve system scalability and maintainability. In addition, the architecture also supports scripting languages ​​such as Lua and Aviator, allowing developers to implement complex business logic by writing scripts.

[0083] In addition, the database module also includes: an access object (DAO) unit, which is used to provide an abstraction of the data access layer, encapsulate the details of database interaction, and define the mapping relationship between the data model and the database table;

[0084] Data cache unit, which is used to integrate cache services (such as Redis) to improve data access speed and manage the life cycle and consistency of cached data;

[0085] Configuration management unit, used to support the integration of configuration centers (such as Nacos and Apollo) and manage dynamic configuration and environment variables.

[0086] Furthermore, the database module also supports the "data access" function, allowing users to quickly import data from a variety of data sources, including but not limited to databases, files, network APIs, etc., providing a convenient data source for subsequent data processing. It has built-in rich mathematical and logical operations, including mathematical functions such as "exponential function", "sine", "cosine", "tangent", "inverse sine", "inverse cosine", "inverse tangent", and logical operations such as "logical AND", "logical OR", "logical XOR", "logical XOR", etc., to meet users' complex calculation and logical judgment needs. The product interface is shown in the figure below. Figure 3 , Figure 4 and Figure 5As shown. Users can combine multiple operation steps and logical judgments in the form of flowcharts to build a data processing process that meets their needs. Each node in the flowchart can be configured independently, including data input, operation parameters, output settings, etc. Supports the "interface call" function, and users can expand the functions of the tool by calling external APIs or custom functions. This makes the product have good scalability and flexibility, and can adapt to different business scenarios and needs. Provides a variety of data processing and analysis functions, such as "addition", "subtraction", "multiplication", "division", "average", "median", "minimum", "maximum", etc., to help users quickly complete data cleaning, conversion and analysis. Supports "judgment" and "interval judgment" functions, allowing users to execute different logical branches according to data conditions to achieve complex data logic control. Provides "return value" and "return status" functions, users can obtain the return value and status information of the node, and integrates the "algorithm model library", which contains a variety of commonly used algorithm models. Users can directly call these models for data analysis and prediction to improve work efficiency and accuracy.

[0087] Furthermore, the data analysis and programming auxiliary tool shown in the design drawing of this product has the characteristics of graphical interface design, comprehensive data access capability, powerful mathematical and logical operation support, flexible process construction, interface call and extensibility, data processing and analysis functions, conditional judgment and logical control, output and return value management, algorithm model library, ease of use and high efficiency, etc., aiming to provide users with an efficient and convenient data processing and programming auxiliary tool.

[0088] In addition, the present invention also provides a rule engine function algorithm development method, which specifically includes the following steps:

[0089] Receive and parse the request instruction from the browser through the parser module, query the database resource, obtain the request data from the database resource, and select different components for processing according to the data type of the request data to obtain parsed data;

[0090] The client's project requirements are obtained through the template engine module, and the corresponding template engine is selected according to the project requirements to render the parsed data into a user-readable HTML page. A function algorithm development tool is constructed through the HTML page and the business logic configured based on the preset rule engine.

[0091] The method for creating the rule engine includes:

[0092] Acquire function information input by a user through a browser, wherein the function information includes a function name and parameter information of a rule function, and the parameter information includes a type and a value range of an input parameter;

[0093] Obtaining rule information input by a user in the form of a web page of a browser, wherein the rule information includes at least one conditional expression composed of input parameters, a priority for each conditional expression, and an expected derivation result corresponding to each conditional expression;

[0094] Generate a rule engine configuration file based on the function name, the parameter information and the rule information;

[0095] A rule engine is generated based on the rule engine configuration file and the preset template engine.

[0096] Finally, it should be noted that the above is only a specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any changes or substitutions that can be easily thought of by a person skilled in the art within the technical scope disclosed by the present invention should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention shall be based on the protection scope of the claims.

Claims

1. A rule engine function algorithm development tool, characterized in that: Including parser module, template engine module, backend framework module and database module: The parser module is used to receive and parse the request instruction from the browser, obtain the request data, and select different components for processing according to the data type of the request data to obtain parsed data, wherein the components include ELLocal Parser and EL Custom Parser; The template engine module is used to obtain the customer's project requirements, and select a corresponding template engine according to the project requirements to render the parsed data into a user-readable HTML page, build and configure business logic through the HTML page, and construct a function algorithm development tool; The backend framework module is used to integrate multiple backend frameworks to provide technical support for the implementation of business logic corresponding to the project requirements, and complete data preprocessing and calculation according to the rule engine algorithm; The database module is used to construct a variety of data storage solutions based on a variety of relational databases, and store request data and parsed data through the data storage solutions.

2. The rule engine function algorithm development tool according to claim 1, characterized in that: The parser module comprises: A request processing unit, configured to receive a request instruction from a browser, extract a request header, query parameters, path parameters and a request body in the request instruction, and parse the request header, query parameters, path parameters and request body to obtain a digital structure understandable to a server; A data type identification unit, used to identify the data type of the requested data, and select a suitable processing component according to the data type for scheduling; The data conversion unit is used to convert the original request data into a format that can be processed by the internal system and provide data mapping and conversion functions.

3. The rule engine function algorithm development tool according to claim 1, characterized in that: The template engine module includes: Requirements analysis unit, used to analyze the customer's project requirements, determine the required template features, and select the appropriate template engine based on project requirements; Data binding unit, used to bind the data passed by the parser module to the selected template, and handle variable replacement and expression evaluation in the template; The page rendering unit is used to render the bound data into an HTML page using a template engine, and optimize the generated HTML page, wherein the optimization of the generated HTML page includes compressing and merging resources.

4. The rule engine function algorithm development tool according to claim 1, characterized in that: The backend framework module includes: Business logic unit, which is used to process business rules and decision making and implement specific business logic; The framework integration unit is used to integrate different backend frameworks, provide a unified interface, and route requests to the correct services and methods; The middleware management unit is used to manage dependencies between services and integrate and configure middleware, including authentication, logging, and error handling.

5. The rule engine function algorithm development tool according to claim 1, characterized in that: The database module comprises: Data connection unit, used to manage data connections, including the creation and management of connection pools; The data access unit is used to perform data addition, deletion, and modification operations, provide the abstraction of the data access layer, the interaction details of the layered database, and define the mapping relationship between the data model and the database; The data model unit is used to define the data model, map the database table structure, manage database transactions, and ensure data consistency.

6. The rule engine function algorithm development tool according to claim 1, characterized in that: The database module also includes: Data cache unit, which is used to integrate cache services (such as Redis) to improve data access speed and manage the life cycle and consistency of cached data.

7. The rule engine function algorithm development method according to claim 1, characterized in that: The method comprises: Receive and parse the request instruction from the browser through the parser module, query the database resource, obtain the request data from the database resource, and select different components for processing according to the data type of the request data to obtain parsed data; The client's project requirements are obtained through the template engine module, and the corresponding template engine is selected according to the project requirements to render the parsed data into a user-readable HTML page. A function algorithm development tool is constructed through the HTML page and the business logic configured based on the preset rule engine.

8. The rule engine function algorithm development method according to claim 1, characterized in that: The method for creating the rule engine includes: Acquire function information input by a user through a browser, wherein the function information includes a function name and parameter information of a rule function, and the parameter information includes a type and a value range of an input parameter; Obtaining rule information input by a user in the form of a web page of a browser, wherein the rule information includes at least one conditional expression composed of input parameters, a priority for each conditional expression, and an expected derivation result corresponding to each conditional expression; Generate a rule engine configuration file based on the function name, the parameter information and the rule information; A rule engine is generated based on the rule engine configuration file and the preset template engine.