CN117539457A - Rule engine system based on NET expression directory tree - Google Patents

Rule engine system based on NET expression directory tree Download PDF

Info

Publication number
CN117539457A
CN117539457A CN202311295263.5A CN202311295263A CN117539457A CN 117539457 A CN117539457 A CN 117539457A CN 202311295263 A CN202311295263 A CN 202311295263A CN 117539457 A CN117539457 A CN 117539457A
Authority
CN
China
Prior art keywords
rule
net
net expression
engine
business
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202311295263.5A
Other languages
Chinese (zh)
Inventor
岳文斌
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Zhongzexing Beijing Asset Management Co ltd
Original Assignee
Zhongzexing Beijing Asset Management Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Zhongzexing Beijing Asset Management Co ltd filed Critical Zhongzexing Beijing Asset Management Co ltd
Priority to CN202311295263.5A priority Critical patent/CN117539457A/en
Publication of CN117539457A publication Critical patent/CN117539457A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/34Graphical or visual programming
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/10Requirements analysis; Specification techniques
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/40Transformation of program code
    • G06F8/41Compilation
    • G06F8/42Syntactic analysis
    • G06F8/427Parsing
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/40Transformation of program code
    • G06F8/41Compilation
    • G06F8/44Encoding
    • G06F8/447Target code generation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/71Version control; Configuration management

Landscapes

  • Engineering & Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Security & Cryptography (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention relates to a rule engine system based on a NET expression directory tree, which aims to provide an efficient rule engine implementation mode so as to better meet complex service requirements. The system comprises a visualized rule management module, a rule analysis module, a rule execution module and a log monitoring module. The rule base module is used for storing the business rules, the rule analysis module is used for analyzing the business rules stored in the rule base and packaging the analyzed rules into executable NET expressions, and the rule execution module is used for executing the NET expressions and the log monitoring module, so that the reliability and the stability of the system are improved. The invention has the advantages that the business rule is analyzed and packaged into the executable instruction through the visual interface, a large amount of business data can be processed more quickly, and the business processing efficiency is improved.

Description

Rule engine system based on NET expression directory tree
Technical Field
The invention relates to a rule engine system based on a NET expression directory tree, in particular to application of the rule engine system in the aspects of automatic decision and behavior control.
Background
In a changing business environment, the need for automated decision making and behavioral control is growing. In many enterprise IT business systems, there are often a large number of business rule configurations, and these business rules change as the decisions of the enterprise manager change. To accommodate such needs, business systems should be capable of quick and low cost updates. To accommodate such a requirement, it is common practice to take the configuration of the business rules out of the way, keeping it low-coupled with the business system. The rule engine, as an automated tool, is capable of making decisions, validations, and triggering actions based on predefined rules and conditions, which are what happens.
At present, the rule engines on the market are basically developed based on java drools and have mature schemes, but the main business of our department is developed based on the NET platform, so a rule engine based on the NET platform is urgently needed.
The NET platform serves as a widely used development framework, and provides convenience for constructing efficient and maintainable application programs.
The invention aims to combine the advantages of the NET expression directory tree and create a more flexible and efficient rule engine system.
Disclosure of Invention
In view of this, the present invention provides a rule engine system based on a NET expression directory tree for automated decision and behavior control. Specifically, the invention is realized by the following technical scheme.
In a first aspect, we provide a method of rule management for visualization.
The method enables business personnel to conveniently add, modify, edit and release rules through the visual interface according to business requirements. In addition, the rule version function is provided, so that the modification and the update of the rule can be effectively recorded and managed, meanwhile, the change process of the rule can be tracked, and the stability and the reliability of the rule are ensured. The rule management method not only improves the efficiency of business processing, but also reduces the risk caused by rule change.
Furthermore, we implement a number of different rule storage schemes including database storage, file storage, and distributed storage. The schemes can be flexibly selected and combined according to service requirements and system architecture so as to meet rule storage and management requirements in different scenes. Meanwhile, the security and reliability of rule storage are guaranteed, and rule data are prevented from being illegally acquired or tampered.
Secondly, we provide a rule test interface so that business personnel can test and verify rules conveniently. The interface provides a simulated test environment and a real data test environment to help business personnel to comprehensively test and verify rules in different scenes. In addition, the system also provides test report and error prompt functions to help business personnel to quickly locate and solve problems encountered in rule testing, and ensure accuracy and reliability of rules.
In a second aspect, we implement a rule parser that converts rule data through the parser into executable NET expression directory trees, thereby implementing complex condition decisions and operations. The rule analyzer adopts technologies such as a grammar analyzer, a semantic analyzer and the like, can deeply analyze and analyze the rule expression, and converts the rule expression into executable NET codes. By means of the rule parser, complex condition judgment and operation, such as arithmetic operation, logic operation, comparison operation, character string operation and the like, can be realized. In addition, we provide common methods that can be used in a rule management interface to handle user input such as format conversion, string processing, date comparison, date difference, etc. The method can help business personnel to rapidly process user input and perform corresponding verification and conversion so as to improve the convenience of newly-added editing business rules. Meanwhile, the self-defining method is provided, so that service personnel can self-define the method according to actual requirements, and the more flexible service processing requirements are met.
Because the rule parsing process is relatively time consuming, we provide the ability to cache the parsing results in order to improve performance. In particular, we store the parsed NET expression directory tree and related data in a cache so that it can be directly referenced and used in subsequent rule execution without parsing again. This approach can significantly reduce the time overhead of rule parsing, thereby improving the efficiency of rule execution. Various caching strategies, such as memory caching, distributed caching, etc., are provided to adapt to caching requirements in different scenarios. Meanwhile, the invalidation mechanism and the updating strategy of the cache are considered, and the accuracy and timeliness of the cache data are ensured. The caching mechanism not only improves the rule analysis performance, but also reduces the load and resource consumption of the system.
In a third aspect, we implement a high performance rule executor: the engine can intelligently process large-scale data according to the input of a user by utilizing the expression generated by the analyzer, and make instant decisions in a real-time scene. In order to meet the high performance requirement in a real-time scene, a multithreading parallel processing technology and a memory caching technology are adopted. The multi-thread parallel processing technology can distribute rule execution tasks to a plurality of threads to execute simultaneously, so that the overall processing speed is improved. The memory caching technology can directly output the result of the last step of caching by using the same input and rule after avoiding the expenditure of repeated calculation.
In a fourth aspect, we provide real-time monitoring and early warning functions to ensure high availability and stability of the system. The function timely discovers abnormal conditions and gives out early warning through monitoring various indexes of the system in real time, such as memory use conditions, CPU occupancy rate, rule execution abnormality and the like, so that business personnel can timely take corresponding measures to adjust and optimize the system. In order to realize the functions of real-time monitoring and early warning, various technical means such as a system performance monitoring tool, a custom monitoring script, an abnormality detection algorithm and the like are adopted. The technical means can monitor the running state of the system in an omnibearing way, discover potential problems and bottlenecks in time and provide decision basis and optimization suggestions for business personnel.
In the aspect of early warning, various early warning modes, such as mail notification, short message reminding, telephone warning and the like, are provided, so that service personnel can master the running state of the system at any time. Meanwhile, an early warning threshold value and a triggering condition are set, so that intelligent early warning is realized, and false report and missing report situations are avoided.
Through the real-time monitoring and early warning function, the system can be ensured to maintain stable performance under the conditions of high load and high concurrency, potential problems can be found and processed in time, and system faults and downtime are reduced. This not only improves the usability and reliability of the system, but also provides a safer and more efficient working environment for business personnel.
In a word, the real-time monitoring and reporting function enables business personnel to know the rule execution condition in time and conduct real-time business decision and adjustment. Meanwhile, the provision of the execution report and the system log also helps business personnel to analyze and check the problems, and improves the reliability and stability of the system.
Drawings
FIG. 1 is a schematic of a workflow diagram when a need changes when a rules engine is not in use.
FIG. 2 is a schematic workflow diagram when using a rules engine.
Fig. 3 is a schematic diagram of the constituent modules of the overall rule engine.
FIG. 4 is a specific rules engine execution flow diagram.
Description of the embodiments
The invention is further described below with reference to the accompanying drawings.
Fig. 1 and 2 illustrate, by way of comparison, mainly the variation in development flow before and after use of a rules engine.
FIG. 1 is a flow chart describing development without the use of a visualization rules engine.
Firstly, writing a demand document by service personnel: at this stage, business personnel or products are managed to write detailed requirements documents, including business requirements, functional requirements, user requirements, etc. These documents detail the goals, functional characteristics, and user requirements of the product, and typically contain elements such as prototype graphs, flowcharts, user stories, and the like.
Secondly, developer reads and understands the requirement document: once the requirements document is completed and communicated to the development team, the developer will carefully read and understand the document. In this process, how the developer does not understand the process, or the inaccuracy of the representation of the required document will directly lead to the error of the subsequent steps.
Then, the developer adds or modifies the background code: this is the stage of achieving the demand, and the developer will write code from the demand document.
Finally, release: after all the above steps, the software is finally repaired and optimized and then released to the production environment.
FIG. 2 is a flow chart describing the development of a case where a visualization rules engine is used.
First, business personnel define or modify rules on a visualization rule editor: at this stage, business personnel define the input and output models of the rules as needed, and then define the conversion relationships, i.e., rules, from the input to the output models.
Secondly, the developer interfaces with the rule engine: the developer directly prepares input data at the background code according to rules defined by service personnel, and transmits the input data to a rule engine, and the rule engine returns data of an output model.
Finally, release: after all the above steps, the software is finally repaired and optimized and then released to the production environment.
The benefits of using a visualization rules engine can be seen from a comparison of fig. 1 and 2.
Business personnel can intuitively and simply modify or add the rules in the visual rule editor, and the addition of developers is not required at all as long as the input model and the output model of the rules are unchanged.
The developer does not need to understand the business, and the professional is handed to the professional, so that the responsibility is clear and each person has his own role.
The business personnel directly issue the rule after editing the rule, and the background code is not required to be modified and the code is not required to be reissued. The purpose of timely adjusting business logic is achieved.
Fig. 3 is a diagram illustrating which components the presently developed rule engine consists of.
Rule management module: the user can create, edit, and manage rules through an intuitive interface. The NET expression directory tree is used by rules to define conditions and operations, thereby enabling flexible rule orchestration.
Rule parser: the NET expression directory tree can be analyzed and executed, and complex condition judgment and operation are realized.
Rule execution engine: the engine is capable of efficiently executing rules containing the NET expression directory tree using an expression directory tree parser. It can intelligently process large-scale data and make immediate decisions in real-time scenarios.
Real-time monitoring and reporting: the system has a real-time monitoring function and can track the rule execution state. Meanwhile, the system can generate detailed execution reports and logs to help users to perform performance analysis and problem investigation.
Fig. 4 is used to illustrate how the rules engine operates.
Firstly, after receiving the transmitted rule identification and data of an input model, a rule engine checks whether an output result is cached, and if so, the rule engine directly returns the output result; and if not, identifying a query rule definition according to the rule.
The check rule defines whether the analysis result is cached or not, if so, the cached NET expression is directly used; if not, then parsing rules are defined to the NET expression and caching the results.
The NET expression and the input data meter are used to output data.
And returning the data of the output model.

Claims (8)

1. The invention relates to a system of a rule engine based on a NET expression, which is characterized in that the system comprises:
a visual rule editor for adding or editing rule definitions in a language describing business logic in a special data structure;
a rule parser for parsing the rule definition into a NET expression and caching the parsed NET expression for later use;
the rule execution engine is used for inputting model data and the parsed NET expression and returning output data to the service system.
2. The NET expression based rule engine system of claim 1, wherein the visual rule editor comprises an interface designer for designing a user interface of the rule definition and a rule editor for editing logic of the rule definition.
3. A system of a rule engine based on a.net expression according to claim 1 or 2, wherein the rule parser compiles the rule definition into a.net expression using a.net compiler and caches the.net expression.
4. A system of a rule engine based on a NET expression according to any one of claims 1 to 3, wherein the rule execution engine comprises one or more rule executors for executing the NET expression and outputting the result.
5. The system of a NET expression based rules engine of any one of claims 1 to 4, further comprising a model data interface for interacting with business systems to input and output data.
6. The system of a NET expression based rule engine according to any one of claims 1 to 5, wherein the system further comprises a rule management module for managing and maintaining the rule definition.
7. A system of a rule engine based on a NET expression according to any one of claims 1 to 6, wherein the system is operable as a stand-alone software module or as an integral part of a larger system.
8. What has been described in the foregoing patent claims are only specific embodiments of the invention, and it is obvious to those skilled in the art that various modifications and improvements can be made in accordance with the invention, and these modifications and improvements are intended to be included in the scope of the invention.
CN202311295263.5A 2023-10-09 2023-10-09 Rule engine system based on NET expression directory tree Pending CN117539457A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311295263.5A CN117539457A (en) 2023-10-09 2023-10-09 Rule engine system based on NET expression directory tree

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311295263.5A CN117539457A (en) 2023-10-09 2023-10-09 Rule engine system based on NET expression directory tree

Publications (1)

Publication Number Publication Date
CN117539457A true CN117539457A (en) 2024-02-09

Family

ID=89792609

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311295263.5A Pending CN117539457A (en) 2023-10-09 2023-10-09 Rule engine system based on NET expression directory tree

Country Status (1)

Country Link
CN (1) CN117539457A (en)

Similar Documents

Publication Publication Date Title
US11847574B2 (en) Systems and methods for enriching modeling tools and infrastructure with semantics
CN112394922B (en) Decision configuration method, business decision method and decision engine system
US10558554B2 (en) Machine learning based software correction
US8566787B2 (en) System and method for improving modularity of large legacy software systems
De Silva et al. Controlling software architecture erosion: A survey
US11392485B2 (en) Auto test generator
JP2020504862A (en) Difference of executable data flow graph
CN110633189B (en) Intelligent operation and maintenance monitoring method and intelligent operation and maintenance monitoring system of IT system
JP2021106000A (en) Executable logic for processing keyed data in networks
Rogers et al. GALEN ten years on: Tasks and supporting tools
Yang et al. DevOps in practice for education management information system at ECNU
Meedeniya et al. Traceability establishment and visualization of software artefacts in devops practice: a survey
US8635601B2 (en) Method of calculating key performance indicators in a manufacturing execution system
CN117806980B (en) Automatic test case generating device based on large language model
CN117539457A (en) Rule engine system based on NET expression directory tree
CN116400950A (en) DevOps element pipeline system based on version control
CN114416064B (en) Distributed service arrangement system and method based on BPMN2.0
Tang Towards automation in software test life cycle based on multi-agent
Fill Semantic evaluation of business processes using SeMFIS
CN112181779B (en) Comprehensive processing method and system for AI metadata
Atkinson et al. Testing web-services using test sheets
Stanev et al. Architecture knowledge for software generation
Urbanics et al. Combined error propagation analysis and runtime event detection in process-driven systems
Meckler Procedure Model for Building Knowledge Graphs for Industry Applications
Song Design and Analysis of Data Curation Workflows

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication