CN111443943B - Attribute dynamic configuration method based on rule engine - Google Patents

Attribute dynamic configuration method based on rule engine Download PDF

Info

Publication number
CN111443943B
CN111443943B CN202010416989.XA CN202010416989A CN111443943B CN 111443943 B CN111443943 B CN 111443943B CN 202010416989 A CN202010416989 A CN 202010416989A CN 111443943 B CN111443943 B CN 111443943B
Authority
CN
China
Prior art keywords
rule
dynamic
logic
rules
attribute
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.)
Active
Application number
CN202010416989.XA
Other languages
Chinese (zh)
Other versions
CN111443943A (en
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.)
State Grid Jiangsu Electric Power Co Ltd
Jiangsu Electric Power Information Technology Co Ltd
Original Assignee
State Grid Jiangsu Electric Power Co Ltd
Jiangsu Electric Power Information Technology 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 State Grid Jiangsu Electric Power Co Ltd, Jiangsu Electric Power Information Technology Co Ltd filed Critical State Grid Jiangsu Electric Power Co Ltd
Priority to CN202010416989.XA priority Critical patent/CN111443943B/en
Publication of CN111443943A publication Critical patent/CN111443943A/en
Application granted granted Critical
Publication of CN111443943B publication Critical patent/CN111443943B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/71Version control; Configuration management
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/23Updating
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q50/00Information and communication technology [ICT] specially adapted for implementation of business processes of specific business sectors, e.g. utilities or tourism
    • G06Q50/06Energy or water supply

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • Business, Economics & Management (AREA)
  • General Physics & Mathematics (AREA)
  • Health & Medical Sciences (AREA)
  • Economics (AREA)
  • Software Systems (AREA)
  • Water Supply & Treatment (AREA)
  • Computer Security & Cryptography (AREA)
  • Tourism & Hospitality (AREA)
  • Primary Health Care (AREA)
  • General Business, Economics & Management (AREA)
  • Marketing (AREA)
  • Human Resources & Organizations (AREA)
  • Strategic Management (AREA)
  • General Health & Medical Sciences (AREA)
  • Public Health (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Stored Programmes (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

The invention discloses a dynamic attribute configuration method based on a rule engine, which is used as an attribute feature of dynamic configuration by collecting a demand change point, analyzing demand change granularity and realizing a foreground and background penetration requirement corresponding to the dynamic configuration; defining a rule file or rule base, and the rule logic has strong readability and can be maintained by a user; the execution rule engine realizes dynamic configuration of attributes, including dynamic display, addition, modification, deletion, storage of logical models and physical models, and automatic derivation of logic. The invention can modify the rule logic which is easy to understand and receive by a user through the foreground, realize the dynamic adding, deleting and storing of the business object attribute from the page to the database, and does not need to modify code logic for redeployment, thereby having important practical value for rapidly meeting the changeable demands of the user and reducing the informatization cost.

Description

Attribute dynamic configuration method based on rule engine
Technical Field
The invention belongs to the field of informatization, and relates to a dynamic attribute configuration method based on a rule engine.
Background
The traditional software generally establishes different service models according to different actual requirements and is solidified into heterogeneous database tables; when it is desired to add or modify properties to certain business objects, code developers are typically required to perform field addition and save functions from foreground to background. Therefore, a method is needed to achieve dynamic maintenance of attributes.
The rule engine is developed by an inference engine, which enables the separation of business decisions from application code.
Disclosure of Invention
The invention aims to provide a dynamic attribute configuration method based on a rule engine, when the attribute of a business object needs to be newly added or modified, a user can complete the dynamic addition of the attribute through foreground configuration.
In order to achieve the above purpose, the technical scheme of the invention is as follows:
a dynamic attribute configuration method based on a rule engine is characterized by comprising the following steps:
s1, collecting a demand change point, analyzing demand change granularity and realizing a foreground and background through requirement corresponding to dynamic configuration, wherein the foreground and background through requirement is used as an attribute characteristic of the dynamic configuration;
s2, defining a rule file or rule base, wherein the rule logic has strong readability and can be maintained by a user;
s3, the execution rule engine realizes dynamic configuration of the attributes, including dynamic display, addition, modification, deletion, storage and automatic derivation of the logic model and the physical model.
Preferably, in S2, a decision table is used as a rule display mode to define a feature rule of attribute dynamic configuration; and S3, searching whether the condition of the information element is met according to the rule by executing the rule engine, and respectively executing the custom methods of the display layer, the business logic layer and the persistence layer to realize the dynamic generation of the attribute logic model and the physical model.
The working principle of the invention is as follows: the rule base is established by using the decision table, the rule base contains all basic characteristics and variable demand characteristics which are needed to be saved when the attributes are newly added or modified, and the basic characteristics and variable demand characteristics are executed by a rule engine to realize dynamic maintenance of the attributes: when the server initializes the page, the attribute of the business object is dynamically displayed; when the user inputs data, the function of checking the attribute characteristics according to the rules and automatically deriving the attributes is realized.
The beneficial effects of the invention are as follows:
the rule engine is used for realizing the dynamic display, addition, modification, deletion and storage of the attributes of the business objects, so that the cost of software development and reconstruction is effectively reduced;
the separation of business decisions from application code is achieved. The dynamic adding, deleting and storing of the business object attribute from the page to the database can be realized by modifying the rule logic which is easy to understand and receive by a user through the foreground, code logic is not required to be modified for redeployment, and the method has important practical value for rapidly meeting the variable demands of the user and reducing the informatization cost.
Drawings
FIG. 1 is a schematic diagram of a rule engine based attribute dynamic configuration method of the present invention.
Table 1 automatic deriving logic decision table rules for business activities;
table 2 item attribute rule base table structure.
Detailed Description
The invention mainly relates to a rule engine, which is an engine for judging whether the rule engine can match with real-time conditions of running time to execute actions specified in the rule according to specified filtering conditions contained in the rule.
The treatment process is carried out in four stages: the information service accepts the event and converts it into information elements, which are then passed to the queue manager, and finally the rule engine receives the information elements and applies the rules carried by them to execute until no more information elements are present in the queue manager.
The rule engine sequentially receives the information elements from the queue manager and then checks the rules in the rule set carried by the information elements according to the rule definition sequence. The first rule is checked and its conditional filter is evaluated, and if the value is false, all actions associated with this rule are ignored and the next rule is continued. If the filter value of the second rule is true, all actions related to the rule are executed according to the defined sequence, and the next rule is continued after the execution is finished. After all rules in the information element are executed, the information element is destroyed, and then the next information element is received from the queue manager. Two special actions are not considered in this process: discard actions (Discard actions) and Include actions (Include actions). If the discard is performed, the discard will skip all the next rules in the information element and destroy the information element, and the rule engine will continue to receive the next information element in the queue manager. An include action is in fact an action that includes other existing rule sets in the action. If the containing action is executed, the rule engine pauses and enters the contained rule set, and after the execution is finished, the rule engine returns to the original pause place to continue execution. This process will be performed recursively.
The terms of the related art terms of the present invention are explained as follows:
1. business Object (Business Object): is a component for retrieving and managing data, and is a simple real-world software abstraction.
2. Decision table: a two-dimensional table structure for summarizing a large number of rules sharing the same set of conditions, whose activities are based on variable values of those conditions.
3. Information element (InformationUnit): an information element is a basic building block of a rules engine, which is an object that contains all the information of a particular event. These information include: messages, application identifications of events generated, information element types, related rule sets, general methods, general attributes, and some system related information, etc.
4. Rule set (rule set): each rule contains a condition filter and a plurality of actions. A condition filter may contain a plurality of filter conditions. The conditional filter is a combination of a plurality of boolean expressions, the combined result of which is still of a boolean type. When the program is running, the action will be performed with the conditional filter value true. In addition to the general execution actions, there are three more specific actions, which are: the actions of discarding, including and persisting the information element object content.
Queue manager: the queue manager is used to manage queues of information element objects from different information services.
The following describes the embodiments of the present invention further with reference to the drawings and examples. The following examples are only for more clearly illustrating the technical aspects of the present invention, and are not intended to limit the scope of the present invention.
A dynamic attribute configuration method based on a rule engine comprises the following steps:
s1, collecting a demand change point, analyzing demand change granularity and realizing a foreground and background through requirement corresponding to dynamic configuration, wherein the foreground and background through requirement is used as an attribute characteristic of the dynamic configuration;
for example, in the project management service, the project information attribute is changed frequently, and the project information attribute is various in project types, and focus points are different; secondly, because of the need for lean management of the business, the project attribute may need to be continuously increased. In general, the attributes of a key business object in a system generally need to be dynamically maintained and extended.
S2, defining a rule file or rule base, wherein the rule logic has strong readability and can be maintained by a user;
there are various defining methods for business rules, and decision points in a business process are generally suitable for definition by rules. Business rules are described in terms of logic of the "if-then-else" type, where if is a particular set of business conditions that are satisfied, then is a particular operation that is performed, else is some other operation that may be performed. It is best practice to partition rules into atomic units. The decision table is used as a rule display mode for summarizing a large number of rules sharing the same set of conditions and the activities of which are based on variable values of the conditions. The benefits of this approach are increased rule understanding, reduced rule errors, and improved rule testing accuracy.
Taking the automatic deriving rules of business activities, asset types and specialty subdivision in the power grid project attribute as an example, the partial data of the rule decision table are listed, and the partial data are shown in table 1.
TABLE 1 automatic derived logic decision table rules (section) for business activity, asset type, and specialty subdivision
Figure 475704DEST_PATH_IMAGE002
Note that: each row represents a separate rule.
In the invention, the rule base is stored in a decision table mode. Taking a project business object as an example, according to the carding result of the variable demand attribute characteristics in S1, the rule is obtained as shown in Table 2.
S3, the execution rule engine realizes dynamic configuration of the attributes, including dynamic display, addition, modification, deletion, storage and automatic derivation of the logic model and the physical model.
For example, for the cost grid operation project type, the newly added attribute "business activity" only needs to add one row of records in the project attribute rule base, as shown in table 2. When a server loads an input page of a cost-power grid operation and maintenance project, a rule engine reads the record, invokes a display method, dynamically increases a field with a display name of 'business activity' on the page, and has a data type of a character string, whether the data type is read-only (a user foreground cannot be filled in) or not, has non-empty verification, adopts a text box Textfield for display, and has a width of 120; when the user clicks for saving after entering m pieces of item information, each item contains n items of attributes, and then the related rule is also n items. A total of m x n checks need to be performed, which total contains m x n information elements. The rule engine firstly loads m x n pieces of information elements into the queue manager, triggers a control method of the service logic layer when checking rules in turn, and includes actions when executing a condition "special call method" (service activity derivative rule). An include action is in fact an action that includes other rule sets in the action. The contain action, if executed, will pause and enter the contained rule set.
The business activity derivation rules are now read (table 1), with the execution result being business activity automatic assignment of "substation maintenance", asset type automatic assignment of "capital", and specialty subdivision automatic assignment of "substation". After the action is executed, the rule engine returns to the original suspended place to continue execution, and the rule engine calls a save method to persist the item information in the database. After all rules in the information element are executed, the information element is destroyed, and then the next information element is received from the queue manager. Until all m×n pieces of information elements are executed. Finally, if all m items input by the user accord with the rule, the m items are stored in the database, so that dynamic addition, storage and verification of the item attributes are realized.
And if the user needs to add or modify a certain item attribute in the later period, only a certain line rule needs to be added or modified, and code reconstruction is not needed.
The invention realizes the dynamic adding, deleting and storing of the business object attribute from the page to the database without modifying the code logic for redeployment, and has important practical value for rapidly meeting the changeable demands of users and reducing the informatization cost.
Table 2 item Attribute rule base Table Structure
Figure DEST_PATH_IMAGE003
/>

Claims (3)

1. A dynamic attribute configuration method based on a rule engine is characterized by comprising the following steps:
s1, collecting a demand change point, analyzing demand change granularity and realizing a foreground and background through requirement corresponding to dynamic configuration, wherein the foreground and background through requirement is used as an attribute characteristic of the dynamic configuration;
s2, defining a rule file or rule base, wherein the rule logic has strong readability and is maintained by a user;
s3, implementing the rule engine to realize dynamic configuration of the attributes, including dynamic display, addition, modification, deletion, storage and automatic derivation of the logic model and the physical model;
s3, searching whether the condition of the information element is met according to the rule by executing the rule engine, and respectively executing the custom methods of the display layer, the business logic layer and the persistence layer to realize the dynamic generation of the attribute logic model and the physical model;
the execution rule engine is specifically as follows:
1) The rule engine sequentially receives the information elements from the queue manager, and then checks the rules in the rule set carried by the information elements according to the rule definition sequence;
2) Checking the first rule and evaluating its conditional filter, if the value is false, all actions associated with the rule are ignored and the next rule is continued to be executed; if the filter value of the second rule is true, all actions related to the rule are executed according to the defined sequence, and the next rule is continued after the execution is finished;
3) After all rules in the information element are executed, the information element is destroyed, and then the next information element is received from the queue manager; two special actions are not considered in this process: discarding the action and including the action; if the discard action is executed, skipping all the rules which are next in the information element, destroying the information element, and continuing to receive the next information element in the queue manager by the rule engine; an include action is in fact an action that includes other existing rule sets in the action; if the containing action is executed, the rule engine pauses and enters the contained rule set, and after the execution is finished, the rule engine returns to the original pause place to continue to execute; this process will be performed recursively.
2. The method for dynamically configuring attributes based on a rule engine according to claim 1, wherein in S2, a decision table is used as a rule showing mode to define feature rules for dynamically configuring attributes.
3. The method of claim 2, wherein the rules are described in terms of logic of the "if-then-else" type, where if is a particular set of business conditions that are satisfied, then is a particular operation that is performed, else is some other operation that can be performed; dividing the rule into atomic units; the decision table is used as a rule display mode for summarizing a plurality of rules sharing the same set of conditions, and the activities of the rules are based on variable values of the conditions.
CN202010416989.XA 2020-05-18 2020-05-18 Attribute dynamic configuration method based on rule engine Active CN111443943B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010416989.XA CN111443943B (en) 2020-05-18 2020-05-18 Attribute dynamic configuration method based on rule engine

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010416989.XA CN111443943B (en) 2020-05-18 2020-05-18 Attribute dynamic configuration method based on rule engine

Publications (2)

Publication Number Publication Date
CN111443943A CN111443943A (en) 2020-07-24
CN111443943B true CN111443943B (en) 2023-05-12

Family

ID=71655265

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010416989.XA Active CN111443943B (en) 2020-05-18 2020-05-18 Attribute dynamic configuration method based on rule engine

Country Status (1)

Country Link
CN (1) CN111443943B (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105630617A (en) * 2015-12-28 2016-06-01 山东中创软件工程股份有限公司 Business processing method and system based on rule engine
CN106789186A (en) * 2016-12-02 2017-05-31 山东中创软件商用中间件股份有限公司 A kind of regulation management method and device, UMP monitoring systems and monitoring method
CN109542935A (en) * 2018-10-11 2019-03-29 平安科技(深圳)有限公司 A kind of execution method, storage medium and the server of regulation engine

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105630617A (en) * 2015-12-28 2016-06-01 山东中创软件工程股份有限公司 Business processing method and system based on rule engine
CN106789186A (en) * 2016-12-02 2017-05-31 山东中创软件商用中间件股份有限公司 A kind of regulation management method and device, UMP monitoring systems and monitoring method
CN109542935A (en) * 2018-10-11 2019-03-29 平安科技(深圳)有限公司 A kind of execution method, storage medium and the server of regulation engine

Also Published As

Publication number Publication date
CN111443943A (en) 2020-07-24

Similar Documents

Publication Publication Date Title
CN101923557A (en) Data analysis system and method
US20190151758A1 (en) Unique virtual entity creation based on real world data sources
CN112988123B (en) DDD-oriented software design method and system
CN114063992B (en) Modeling method and system of low-code development platform
CN103488674A (en) Computing system and method for implementing and controlling thereof
CN111930366A (en) Rule engine implementation method and system based on JIT real-time compilation
Liang et al. QoS-aware web service selection with internal complementarity
CN112288397A (en) Flow template configuration method, flow execution method and device and electronic equipment
CN113391901A (en) RPA robot management method, device, equipment and storage medium
CN114385437A (en) Data quality analysis system and method
CN111443943B (en) Attribute dynamic configuration method based on rule engine
CN111401849A (en) Flow tool self-defined node configuration method
CN113918534A (en) Policy processing system and method
Zheng et al. Modeling the adaption rule in context-aware systems
CN112380218B (en) ETL-based automatic triggering method for summarizing data tables of data warehouse layers
CN112363774B (en) Method and device for configuring Storm real-time task
CN114282541A (en) Live broadcast platform information security detection method and device, equipment, medium and product thereof
CN115033590A (en) Multi-domain data fusion method, device and storage medium
US20040193561A1 (en) Knowledge processing system
CN113722141A (en) Method and device for determining delay reason of data task, electronic equipment and medium
CN110990643A (en) GoJS-based complex task visualization method, terminal device and storage medium
CN117850764B (en) Design modeling method and device based on integrated model driving architecture
CN116860227B (en) Data development system and method based on big data ETL script arrangement
EP4365788A1 (en) Automatic data coverage reduction based on graph readability
CN113076317B (en) Big data-based data processing method, device, equipment and readable storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant