CN113435752A - Rule matching method and device based on inheritance reloading mechanism - Google Patents

Rule matching method and device based on inheritance reloading mechanism Download PDF

Info

Publication number
CN113435752A
CN113435752A CN202110727995.1A CN202110727995A CN113435752A CN 113435752 A CN113435752 A CN 113435752A CN 202110727995 A CN202110727995 A CN 202110727995A CN 113435752 A CN113435752 A CN 113435752A
Authority
CN
China
Prior art keywords
rule
service information
matching
information element
priority
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.)
Granted
Application number
CN202110727995.1A
Other languages
Chinese (zh)
Other versions
CN113435752B (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.)
Industrial and Commercial Bank of China Ltd ICBC
Original Assignee
Industrial and Commercial Bank of China Ltd ICBC
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 Industrial and Commercial Bank of China Ltd ICBC filed Critical Industrial and Commercial Bank of China Ltd ICBC
Priority to CN202110727995.1A priority Critical patent/CN113435752B/en
Publication of CN113435752A publication Critical patent/CN113435752A/en
Application granted granted Critical
Publication of CN113435752B publication Critical patent/CN113435752B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • 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
    • G06Q10/00Administration; Management
    • G06Q10/06Resources, workflows, human or project management; Enterprise or organisation planning; Enterprise or organisation modelling
    • G06Q10/063Operations research, analysis or 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/24Querying
    • G06F16/245Query processing
    • 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
    • G06Q40/00Finance; Insurance; Tax strategies; Processing of corporate or income taxes
    • G06Q40/02Banking, e.g. interest calculation or account maintenance
    • 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
    • G06Q40/00Finance; Insurance; Tax strategies; Processing of corporate or income taxes
    • G06Q40/08Insurance

Landscapes

  • Engineering & Computer Science (AREA)
  • Business, Economics & Management (AREA)
  • Theoretical Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Physics & Mathematics (AREA)
  • Economics (AREA)
  • Finance (AREA)
  • Accounting & Taxation (AREA)
  • Strategic Management (AREA)
  • Development Economics (AREA)
  • Marketing (AREA)
  • Human Resources & Organizations (AREA)
  • General Business, Economics & Management (AREA)
  • Entrepreneurship & Innovation (AREA)
  • Technology Law (AREA)
  • Tourism & Hospitality (AREA)
  • Quality & Reliability (AREA)
  • Operations Research (AREA)
  • Game Theory and Decision Science (AREA)
  • Educational Administration (AREA)
  • Computational Linguistics (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention provides a rule matching method and device based on an inheritance overloading mechanism, which can be used in the financial field or other fields. The method comprises the following steps: extracting service information elements to be matched with the rules from the service information; determining a rule set corresponding to the service information element according to the service information element; wherein the rule set comprises priority rules; and according to a special rule or a father node rule in the rule set, carrying out rule matching on the service information element by using the priority rule to obtain an optimal rule. The invention overcomes the defects of complicated rule customization and low rule matching performance efficiency in the prior art, can realize the universal setting of a public service rule and the unique setting of a special service rule, adopts a priority setting mode in rule matching, can effectively improve the efficiency in rule matching, has the advantages of flexible use, wide application range and the like, and can be applied to more service systems.

Description

Rule matching method and device based on inheritance reloading mechanism
Technical Field
The present invention relates to the technical field of rule matching, and in particular, to a rule matching method and apparatus based on an inheritance reloading mechanism.
Background
In application systems in professional fields such as banks and insurance, a large number of business rules exist, and the rules meeting business conditions are often required to be defined, analyzed and matched.
Currently, the industry generally processes such rules by using a rule engine, and the rule engine usually uses a RETE algorithm when matching the rules. Dividing the business rules into different rule sets, finding out the rule set corresponding to the information element when the rule engine receives the information element to be processed, then taking out the rules in the rule set one by one, evaluating the conditions of the rules by a filter, and if the values are false, neglecting actions related to the rules and continuously executing the next rule; if the value is true, the rule is considered a hit and the engine performs the action associated with the rule as defined.
The preferred method based on the rule of RETE algorithm has the following disadvantages: one, each rule in the rule set must cover all the usage dimensions, and how many scenarios exist in each usage dimension requires independent customization of many rules. There is no association or multiplexing relationship between the rules, and the rules are more cumbersome to customize and maintain in a complex business scenario. And secondly, taking out the rules in each rule set one by one and matching the rules one by one. Matching rules results in a large loss of system performance when there are a large number of rules in the rule set.
Disclosure of Invention
Aiming at the problems in the prior art, the embodiments of the present invention mainly aim to provide a rule matching method and apparatus based on an inheritance overloading mechanism, which overcome the disadvantages of tedious rule customization and low rule matching performance efficiency in the prior art, and can effectively improve the rule matching efficiency.
In order to achieve the above object, an embodiment of the present invention provides a rule matching method based on an inheritance reloading mechanism, where the method includes:
extracting service information elements to be matched with the rules from the service information;
determining a rule set corresponding to the service information element according to the service information element; wherein the rule set comprises priority rules;
and according to a special rule or a father node rule in the rule set, carrying out rule matching on the service information element by using the priority rule to obtain an optimal rule.
Optionally, in an embodiment of the present invention, the performing, according to a special rule or a parent node rule in the rule set, rule matching on the service information element by using the priority rule includes:
if the rule set is known to have a special rule, performing rule matching on the service information element according to the priority rule and the rule element of the special rule;
and if the rule set is known to have no special rule, performing rule matching on the service information element according to the priority rule and the rule element of the father node rule in the rule set.
Optionally, in an embodiment of the present invention, the method further includes: and if more than one optimization rule is known, determining the only optimization rule according to the number of rule elements in each optimization rule.
Optionally, in an embodiment of the present invention, the method further includes: and analyzing and matching the unique optimization rule according to the service information element to obtain an analysis result, and sending the analysis result to a service system.
The embodiment of the invention also provides a rule matching device based on the inheritance reloading mechanism, which comprises:
the information element module is used for extracting the service information elements to be matched with the rules from the service information;
the rule set module is used for determining a rule set corresponding to the service information element according to the service information element; wherein the rule set comprises priority rules;
and the optimization rule module is used for carrying out rule matching on the service information element by utilizing the priority rule according to a special rule or a father node rule in the rule set to obtain an optimization rule.
Optionally, in an embodiment of the present invention, the preference rule module includes:
a special rule unit, configured to perform rule matching on the service information element according to the priority rule and a rule element of a special rule if it is known that the rule set contains the special rule;
and the father node rule unit is used for matching the business information element according to the priority rule and the rule elements of the father node rule in the rule set if the fact that no special rule exists in the rule set is known.
Optionally, in an embodiment of the present invention, the apparatus further includes: and the saturation module is used for determining the only optimized rule according to the number of rule elements in each optimized rule if more than one optimized rule is known.
Optionally, in an embodiment of the present invention, the apparatus further includes: and the rule analysis module is used for analyzing and matching the unique optimized rule according to the service information element to obtain an analysis result and sending the analysis result to a service system.
The invention also provides an electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor implements the method when executing the program.
The present invention also provides a computer-readable storage medium storing a computer program for executing the above method.
The invention overcomes the defects of complicated rule customization and low rule matching performance efficiency in the prior art, can realize the universal setting of a public service rule and the unique setting of a special service rule, adopts a priority setting mode in rule matching, can effectively improve the efficiency in rule matching, has the advantages of flexible use, wide application range and the like, and can be applied to more service systems.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art that other drawings can be obtained based on these drawings without creative efforts.
FIG. 1 is a flowchart of a rule matching method based on an inheritance reloading mechanism according to an embodiment of the present invention;
FIG. 2 is a flow chart of rule matching in an embodiment of the present invention;
FIG. 3 is a schematic diagram of a system architecture for applying a rule matching method based on an inheritance reloading mechanism in an embodiment of the present invention;
FIG. 4 is a schematic structural diagram of a rule definition apparatus according to an embodiment of the present invention;
FIG. 5 is a schematic diagram of a rule selection apparatus according to an embodiment of the present invention;
FIG. 6 is a flowchart illustrating the operation of a system applying a rule matching method based on an inheritance reloading mechanism in an embodiment of the present invention;
FIG. 7 is a diagram illustrating a product structure of a general supply chain of a bank in an embodiment of the present invention;
FIG. 8 is a schematic structural diagram of a rule matching apparatus based on an inheritance reloading mechanism according to an embodiment of the present invention;
FIG. 9 is a schematic diagram of a preferred rule module according to an embodiment of the present invention;
FIG. 10 is a block diagram of a rule matching apparatus based on an inheritance reloading mechanism according to an embodiment of the present invention;
FIG. 11 is a schematic diagram illustrating a rule matching apparatus based on an inheritance reloading mechanism according to another embodiment of the present invention;
fig. 12 is a schematic structural diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
The embodiment of the invention provides a rule matching method and device based on an inheritance reloading mechanism, which can be used in the financial field or other fields.
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Fig. 1 is a flowchart illustrating a rule matching method based on an inheritance reloading mechanism according to an embodiment of the present invention, where an execution subject of the rule matching method based on the inheritance reloading mechanism provided by the embodiment of the present invention includes, but is not limited to, a computer. The method shown in the figure comprises the following steps:
step S1, extracting the service information element to be rule-matched from the service information.
Among them, there are a large number of business rules and business information in application systems in professional fields such as banks and insurance. Specifically, service information elements, such as supply chain information, trade information, financing information, deposit information, and payment information, may be extracted from the service information. Wherein, different service information needs to match with the corresponding service rule.
Step S2, according to the service information element, determining a rule set corresponding to the service information element; wherein the rule set includes priority rules.
The service information includes key elements, such as supply chain, customer, etc. Different key requirements correspond to different rule sets, and the rule sets are established in advance. Specifically, the rule set is a set formed by rules, each rule set is composed of one or more rule records, and the rules in the rule set are predefined.
Further, each rule in the rule set includes at least one rule element, the rule elements constituting the dimensions used by the rule, such as: region, network point, service type, organization. Specifically, the rule set includes a priority rule, the priority rule defines the priority of rule elements in selection, and elements included in the same rule have higher priority and are preferentially hit when matched.
Further, the rule set may include special rules or parent node rules. Specifically, the special rule or the father node rule defines the inheritance relationship among different rules, and a tree-shaped hierarchical structure similar to a multi-branch tree is constructed.
And step S3, according to the special rule or father node rule in the rule set, using the priority rule to match the service information element to obtain the preferred rule.
And if the rule set has special rules, matching according to the special rules. And if no special rule exists in the rule set, matching according to the father node rule. Further, there may be one or more special rules or parent node rules in the rule set.
Furthermore, according to the priority rule, the business information elements are matched according to the priority sequence between the rule elements in the special rule or the father node rule. If a plurality of rules which accord with the service information element exist, the rule which is matched with the rule element with high priority is preferably selected as the preferred rule.
As an embodiment of the present invention, as shown in fig. 2, performing rule matching on the service information element according to a special rule or a parent node rule in the rule set by using the priority rule includes:
step S21, if it is known that the rule set has a special rule, the business information element is matched with the rule according to the priority rule and the rule element of the special rule;
and step S22, if it is known that no special rule exists in the rule set, performing rule matching on the service information element according to the priority rule and the rule element of the father node rule in the rule set.
The priority rule defines the priority of rule elements during selection, and the elements contained in the same rule have higher priority and are preferentially hit during matching.
Further, if a special rule exists in the rule set, matching is performed according to the special rule. And if no special rule exists in the rule set, matching according to the father node rule. Further, there may be one or more special rules or parent node rules in the rule set.
In an embodiment of the present invention, as shown in fig. 7, the general financial supply chain business of a certain bank is divided into vertical chain, horizontal chain, data chain and other scenes, each scene can handle different varieties such as electronic warranty, digital credit voucher, electronic warehouse receipt and the like, each variety can designate different core enterprises, trading markets, supply chains and sub-customers, and a multi-branch tree-shaped product relationship structure is formed. According to the business transaction requirements, a whole set of supply chain transaction rules such as supply chain information, trade information, financing information, payment information and the like are required to be set at each level of the tree and are used for parameter control when a client transacts supply chain business. When the bank sets and selects the rule parameters, in order to facilitate different organizations and customers, a set of general parameters is set at the upper layer and the upper layer rules are multiplexed by default at the lower layer instead of setting a set at each level completely, namely the inheritance of the rules; according to different business scene requirements, the lower layer can also rewrite the rules of the upper layer and store the rules as a version of the lower layer, namely the reloading of the rules. For example, a set of supply chain rules a may be set for a vertical chain electronic warranty product, the following core enterprise a inherits the electronic warranty product rules a and stores the same as a set of supply chain rules aa, and the other core enterprise B inherits the electronic warranty product rules a, customizes and modifies the same, reloads the same, and stores the same as another set of supply chain rules bb.
Furthermore, the inheritance word is originally used for an inheritance class in the JAVA programming language, and represents that a new subclass is constructed on the basis of an existing parent class, and the subclass can multiplex all methods and domains of the parent class. In the invention, inheritance represents inheritance of a business rule, the business rule of the next level is constructed on the basis of the business rule of the previous level, and all the business rules and threshold values of the previous level can be multiplexed by the next level.
Furthermore, the reloading method originally used for the class in the JAVA programming language is a reloading method, and multiple methods are allowed to have the same name and different parameters in the same class; or the same method of the parent class can be extended in the subclass of the inherited class, which is rewriting. In the invention, the overloading represents redefinition of a business rule, and the business rule of the next level flexibly customizes the business rule of the level by rewriting the rule of the previous level or reloading the business rule of the same level.
As an embodiment of the present invention, the method further comprises: and if more than one optimization rule is known, determining the only optimization rule according to the number of rule elements in each optimization rule.
And if a plurality of rules with the same priority can be matched, judging which rule element of the plurality of optimization rules is more, wherein the more rule elements have higher saturation, and the rule with the highest preferred saturation is used as the only optimization rule for matching.
In this embodiment, the method further includes: and analyzing and matching the unique optimization rule according to the service information element to obtain an analysis result, and sending the analysis result to a service system.
And analyzing and matching the unique optimization rule according to the service information element, acquiring a final analysis result and transmitting the final analysis result to a service system.
In an embodiment of the present invention, as shown in fig. 3, a schematic structural diagram of a system applying a rule matching method based on an inheritance reloading mechanism in an embodiment of the present invention is shown, and the system shown in the figure is composed of a rule defining device 1, a rule processing device 2 and a rule executing device 3.
The rule definition device 1 is responsible for defining and storing the business rules, the rule processing device 2 is responsible for optimizing and analyzing the rules, and the rule execution device 3 is responsible for executing the selected rules and feeding back the results to the business system 4.
1. Rule definition device
As shown in fig. 4, the rule definition means is composed of a rule set definition unit 11, a rule record definition unit 12, a rule element definition unit 13, a rule element priority definition unit 14, and a rule inheritance relationship definition unit 15.
a) Rule set definition Unit 11
A set of rules is defined, each rule set consisting of one or more rule records.
b) Rule record definition unit 12
Rule record information is defined, each rule belonging to a rule set and consisting of one or more rule elements.
c) Rule element definition unit 13
Rule elements constitute the dimensions used by the rule, for example: region, network point, service type, organization.
Each rule element can customize a default use scene as default, and the default use scene is used as a condition applicable to all scenes; the rule elements are set to specific values if the rule elements are uniquely set for a specific scene.
d) Rule element priority definition unit 14
The priority of the rule elements in selection is defined, and the higher the priority of the elements contained in the same rule, the higher the priority of the elements is, the better the elements are hit in the matching process.
e) Rule inheritance relationship definition unit 15
Defining inheritance relations among different rules, and constructing a tree-shaped hierarchical structure similar to a multi-branch tree. Defining a father node business rule of the level at a level (1) layer of the tree; at the level (2) layer of the tree, a two-step rule customization mode is provided: firstly, an inheritance mode is adopted, and the rule of level (1) is inherited by default; secondly, a reloading mode is adopted, personalized customization can be carried out on the basis of inheritance rules according to needs, and a level (2) level reloaded business rule is formed. The rule of level (2) is an inheritance or rewrite relationship relative to level (1), and the rule on different nodes of level (2) is a heavy-load relationship. And by analogy, customizing the rule inheritance reloading mode from the root node to the leaf node of the tree in sequence.
2. Rule selection device
As shown in fig. 5, the rule selecting device includes a rule set selecting unit 21, an override rule selecting unit 22, a default rule selecting unit 23, a rule priority selecting unit 24, and a rule saturation selecting unit 25.
a) Rule set selection unit 21
And selecting a corresponding rule set according to the service information element.
b) Override rule selection unit 22
And searching the definition of the inheritance relationship of the rule according to the service information element, and if a special rule of the inheritance relationship is defined, preferably selecting the special rule.
c) Default rule selection unit 23
And selecting a default rule according to the service information element.
d) Rule priority selection unit 24
For multiple rules in the same rule set, the rules are preferred according to the priority of the rule elements.
e) Regular saturation selection unit 25
For multiple rules in the same rule set, the rule is preferred based on the saturation of the rule element.
3. Rule-preferred Overall Process flow
As shown in fig. 6, rule preference for the service information element can be realized based on the rule definition and rule selection means. The specific treatment process comprises the following steps:
a) acquiring service information element 31:
and extracting information elements needing rule matching from the service information.
b) Selection rule set 32:
and matching the rule set corresponding to the service according to the key elements in the service information element.
c) Selecting a special rule 33:
and searching the rule inheritance relationship definition unit 15 according to the rule set selected in the step 32, and if a special rule is defined, taking out the special rule which can be matched with the service information element for subsequent processing. (refer to fig. 7) for example, according to the rule of business element query core enterprise a, find the inherited special rule aa saved by core enterprise B for subsequent processing; or inquiring the rule of the core enterprise B, finding out the special rule bb which is saved by the core enterprise B after the overload, and then carrying out subsequent processing by taking the bb rule as the rule of the core enterprise B.
d) Selecting the default rule 34:
if there is no special rule in step 33, the rule inheritance relationship definition unit 15 is searched, and the parent node rule is taken as the default rule for subsequent processing. (refer to fig. 7) for example, the rule of the core enterprise a is queried according to the business elements, if the core enterprise a does not customize any rule, the rule inheritance relationship definition unit 15 is searched, the electronic warranty product of the parent node of the core enterprise a is found, and the rule a is taken as the default rule and is taken as the rule of the core enterprise a for subsequent processing.
e) Rule priority selection 35:
for one or more rules extracted in step 33 or 34, the rule element priority definition unit 14 is searched, and the service information elements are subjected to rule matching according to the priority order among the rule elements. If there are multiple rules that fit the service information element, it is preferable to match the rule with the rule element having the highest priority first.
f) Rule saturation selection 36:
if there are multiple rules with the same priority to be matched in step 35, the rule element definition unit 13 is searched to see which rule element of the multiple rules is more, and the rule with the highest saturation is preferably matched if the more elements are considered to be more saturated.
g) Preferred rule output 37:
and if the unique rule can be determined according to the flow, selecting the rule and transmitting the rule to a rule execution device for analysis processing.
4. Rule execution device 3
And analyzing and matching the most preferable rule output by the rule processing device according to the service information element to obtain a final matching result, and transmitting the final matching result to the service system 4.
The invention provides a rule definition mode based on inheritance reloading and a rule optimization mode based on priority and saturation, improves the RETE algorithm of the traditional rule engine, and can obtain better improvement on the quantity complexity of rule customization and the performance and efficiency of rule analysis. The method is flexible to use and wide in application range, and can be applied to business systems such as banks and insurance systems with more application of rule engines.
The invention overcomes the defects of complicated rule customization and low rule matching performance efficiency in the prior art, can realize the universal setting of a public service rule and the unique setting of a special service rule, adopts a priority setting mode in rule matching, can effectively improve the efficiency in rule matching, has the advantages of flexible use, wide application range and the like, and can be applied to more service systems.
Fig. 8 is a schematic structural diagram of a rule matching apparatus based on an inheritance reloading mechanism according to an embodiment of the present invention, where the apparatus shown in the drawing includes:
and the information element module 10 is used for extracting the service information element to be matched with the rule from the service information.
Among them, there are a large number of business rules and business information in application systems in professional fields such as banks and insurance. Specifically, service information elements, such as supply chain information, trade information, financing information, deposit information, and payment information, may be extracted from the service information. Wherein, different service information needs to match with the corresponding service rule.
A rule set module 20, configured to determine, according to the service information element, a rule set corresponding to the service information element; wherein the rule set includes priority rules.
The service information includes key elements, such as supply chain, customer, etc. Different key requirements correspond to different rule sets, and the rule sets are established in advance. Specifically, the rule set is a set formed by rules, each rule set is composed of one or more rule records, and the rules in the rule set are predefined.
Further, each rule in the rule set includes at least one rule element, the rule elements constituting the dimensions used by the rule, such as: region, network point, service type, organization. Specifically, the rule set includes a priority rule, the priority rule defines the priority of rule elements in selection, and elements included in the same rule have higher priority and are preferentially hit when matched.
Further, the rule set may include special rules or parent node rules. Specifically, the special rule or the father node rule defines the inheritance relationship among different rules, and a tree-shaped hierarchical structure similar to a multi-branch tree is constructed.
And the optimization rule module 30 is configured to perform rule matching on the service information element by using the priority rule according to a special rule or a father node rule in the rule set, so as to obtain an optimization rule.
And if the rule set has special rules, matching according to the special rules. And if no special rule exists in the rule set, matching according to the father node rule. Further, there may be one or more special rules or parent node rules in the rule set.
Furthermore, according to the priority rule, the business information elements are matched according to the priority sequence between the rule elements in the special rule or the father node rule. If a plurality of rules which accord with the service information element exist, the rule which is matched with the rule element with high priority is preferably selected as the preferred rule.
Further, if there are a plurality of rules with the same priority that can be matched, it is determined which rule element of the plurality of preference rules is more, the saturation is higher as more rule elements are more, and the rule with the highest saturation is preferably matched as the only preference rule.
As an embodiment of the present invention, as shown in fig. 9, the preference rule module 30 includes:
a special rule unit 31, configured to perform rule matching on the service information element according to the priority rule and a rule element of a special rule if it is known that the rule set contains the special rule;
and a father node rule unit 32, configured to perform rule matching on the service information element according to the priority rule and a rule element of a father node rule in the rule set if it is known that no special rule exists in the rule set.
As an embodiment of the present invention, as shown in fig. 10, the apparatus further includes: and the saturation module 40 is configured to determine a unique optimization rule according to the number of rule elements in each optimization rule if it is known that there is more than one optimization rule.
In this embodiment, as shown in fig. 11, the apparatus further includes: and the rule analysis module 50 is used for analyzing and matching the unique optimized rule according to the service information element to obtain an analysis result, and sending the analysis result to a service system.
Based on the same application concept as the rule matching method based on the inheritance reloading mechanism, the invention also provides the rule matching device based on the inheritance reloading mechanism. Because the principle of solving the problem of the rule matching device based on the inheritance reloading mechanism is similar to that of the rule matching method based on the inheritance reloading mechanism, the implementation of the rule matching device based on the inheritance reloading mechanism can refer to the implementation of the rule matching method based on the inheritance reloading mechanism, and repeated parts are not repeated.
The invention overcomes the defects of complicated rule customization and low rule matching performance efficiency in the prior art, can realize the universal setting of a public service rule and the unique setting of a special service rule, adopts a priority setting mode in rule matching, can effectively improve the efficiency in rule matching, has the advantages of flexible use, wide application range and the like, and can be applied to more service systems.
The invention also provides an electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor implements the method when executing the program.
The present invention also provides a computer-readable storage medium storing a computer program for executing the above method.
As shown in fig. 12, the electronic device 600 may further include: communication module 110, input unit 120, audio processing unit 130, display 160, power supply 170. It is noted that the electronic device 600 does not necessarily include all of the components shown in fig. 12; furthermore, the electronic device 600 may also comprise components not shown in fig. 12, which may be referred to in the prior art.
As shown in fig. 12, the central processor 100, sometimes referred to as a controller or operational control, may include a microprocessor or other processor device and/or logic device, the central processor 100 receiving input and controlling the operation of the various components of the electronic device 600.
The memory 140 may be, for example, one or more of a buffer, a flash memory, a hard drive, a removable media, a volatile memory, a non-volatile memory, or other suitable device. The information relating to the failure may be stored, and a program for executing the information may be stored. And the central processing unit 100 may execute the program stored in the memory 140 to realize information storage or processing, etc.
The input unit 120 provides input to the cpu 100. The input unit 120 is, for example, a key or a touch input device. The power supply 170 is used to provide power to the electronic device 600. The display 160 is used to display an object to be displayed, such as an image or a character. The display may be, for example, an LCD display, but is not limited thereto.
The memory 140 may be a solid state memory such as Read Only Memory (ROM), Random Access Memory (RAM), a SIM card, or the like. There may also be a memory that holds information even when power is off, can be selectively erased, and is provided with more data, an example of which is sometimes called an EPROM or the like. The memory 140 may also be some other type of device. Memory 140 includes buffer memory 141 (sometimes referred to as a buffer). The memory 140 may include an application/function storage section 142, and the application/function storage section 142 is used to store application programs and function programs or a flow for executing the operation of the electronic device 600 by the central processing unit 100.
The memory 140 may also include a data store 143, the data store 143 for storing data, such as contacts, digital data, pictures, sounds, and/or any other data used by the electronic device. The driver storage portion 144 of the memory 140 may include various drivers of the electronic device for communication functions and/or for performing other functions of the electronic device (e.g., messaging application, address book application, etc.).
The communication module 110 is a transmitter/receiver 110 that transmits and receives signals via an antenna 111. The communication module (transmitter/receiver) 110 is coupled to the central processor 100 to provide an input signal and receive an output signal, which may be the same as in the case of a conventional mobile communication terminal.
Based on different communication technologies, a plurality of communication modules 110, such as a cellular network module, a bluetooth module, and/or a wireless local area network module, may be provided in the same electronic device. The communication module (transmitter/receiver) 110 is also coupled to a speaker 131 and a microphone 132 via an audio processor 130 to provide audio output via the speaker 131 and receive audio input from the microphone 132 to implement general telecommunications functions. Audio processor 130 may include any suitable buffers, decoders, amplifiers and so forth. In addition, an audio processor 130 is also coupled to the central processor 100, so that recording on the local can be enabled through a microphone 132, and so that sound stored on the local can be played through a speaker 131.
As will be appreciated by one skilled in the art, embodiments of the present invention may be provided as a method, system, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
The principle and the implementation mode of the invention are explained by applying specific embodiments in the invention, and the description of the embodiments is only used for helping to understand the method and the core idea of the invention; meanwhile, for a person skilled in the art, according to the idea of the present invention, there may be variations in the specific embodiments and the application scope, and in summary, the content of the present specification should not be construed as a limitation to the present invention.

Claims (10)

1. A rule matching method based on an inheritance reloading mechanism is characterized by comprising the following steps:
extracting service information elements to be matched with the rules from the service information;
determining a rule set corresponding to the service information element according to the service information element; wherein the rule set comprises priority rules;
and according to a special rule or a father node rule in the rule set, carrying out rule matching on the service information element by using the priority rule to obtain an optimal rule.
2. The method of claim 1, wherein the rule matching the service information element according to a special rule or a parent node rule in the rule set by using the priority rule comprises:
if the rule set is known to have a special rule, performing rule matching on the service information element according to the priority rule and the rule element of the special rule;
and if the rule set is known to have no special rule, performing rule matching on the service information element according to the priority rule and the rule element of the father node rule in the rule set.
3. The method of claim 1, further comprising: and if more than one optimization rule is known, determining the only optimization rule according to the number of rule elements in each optimization rule.
4. The method of claim 3, further comprising: and analyzing and matching the unique optimization rule according to the service information element to obtain an analysis result, and sending the analysis result to a service system.
5. An apparatus for rule matching based on an inheritance reloading mechanism, the apparatus comprising:
the information element module is used for extracting the service information elements to be matched with the rules from the service information;
the rule set module is used for determining a rule set corresponding to the service information element according to the service information element; wherein the rule set comprises priority rules;
and the optimization rule module is used for carrying out rule matching on the service information element by utilizing the priority rule according to a special rule or a father node rule in the rule set to obtain an optimization rule.
6. The apparatus of claim 5, wherein the preference rule module comprises:
a special rule unit, configured to perform rule matching on the service information element according to the priority rule and a rule element of a special rule if it is known that the rule set contains the special rule;
and the father node rule unit is used for matching the business information element according to the priority rule and the rule elements of the father node rule in the rule set if the fact that no special rule exists in the rule set is known.
7. The apparatus of claim 5, further comprising: and the saturation module is used for determining the only optimized rule according to the number of rule elements in each optimized rule if more than one optimized rule is known.
8. The apparatus of claim 7, further comprising: and the rule analysis module is used for analyzing and matching the unique optimized rule according to the service information element to obtain an analysis result and sending the analysis result to a service system.
9. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor implements the method of any one of claims 1 to 4 when executing the computer program.
10. A computer-readable storage medium, characterized in that the computer-readable storage medium stores a computer program for executing the method of any one of claims 1 to 4.
CN202110727995.1A 2021-06-29 2021-06-29 Rule matching method and device based on inheritance reloading mechanism Active CN113435752B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110727995.1A CN113435752B (en) 2021-06-29 2021-06-29 Rule matching method and device based on inheritance reloading mechanism

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110727995.1A CN113435752B (en) 2021-06-29 2021-06-29 Rule matching method and device based on inheritance reloading mechanism

Publications (2)

Publication Number Publication Date
CN113435752A true CN113435752A (en) 2021-09-24
CN113435752B CN113435752B (en) 2024-06-04

Family

ID=77757653

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110727995.1A Active CN113435752B (en) 2021-06-29 2021-06-29 Rule matching method and device based on inheritance reloading mechanism

Country Status (1)

Country Link
CN (1) CN113435752B (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107291733A (en) * 2016-03-31 2017-10-24 阿里巴巴集团控股有限公司 A kind of method and device for rule matching
CN107846366A (en) * 2016-09-19 2018-03-27 中兴通讯股份有限公司 A kind of method and a device for rule matching
US20190197141A1 (en) * 2017-12-22 2019-06-27 International Business Machines Corporation Interactive adjustment of decision rules

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107291733A (en) * 2016-03-31 2017-10-24 阿里巴巴集团控股有限公司 A kind of method and device for rule matching
CN107846366A (en) * 2016-09-19 2018-03-27 中兴通讯股份有限公司 A kind of method and a device for rule matching
US20190197141A1 (en) * 2017-12-22 2019-06-27 International Business Machines Corporation Interactive adjustment of decision rules

Also Published As

Publication number Publication date
CN113435752B (en) 2024-06-04

Similar Documents

Publication Publication Date Title
CN111949522B (en) Automatic testing method and device for user interface
CN112732571A (en) Test data generation method and device
CN112784112A (en) Message checking method and device
CN112035676B (en) User operation behavior knowledge graph construction method and device
CN112052391B (en) Data pushing method, device and system
CN113435752A (en) Rule matching method and device based on inheritance reloading mechanism
CN112396511A (en) Distributed wind control variable data processing method, device and system
CN115965456A (en) Data change analysis method and device
CN114840525A (en) Work order processing method and device
CN112732243B (en) Data processing method and device for generating functional components
CN111767435B (en) User behavior analysis method and device
CN113709059A (en) Link flow recording method and node
CN113419957A (en) Rule-based big data offline batch processing performance capacity scanning method and device
CN113568888A (en) Index recommendation method and device
CN113157582A (en) Method and device for determining execution sequence of test script
CN111930420A (en) Non-invasive generic code level gray scale routing system and method
CN112308570A (en) Method and device for generating business rule output value
CN112085497A (en) User account data processing method and device
CN113010514A (en) Hot loading method and device
CN111401395A (en) Data processing method, terminal equipment and storage medium
CN111353765A (en) Outbound method and device based on data mining
KR102267560B1 (en) Method for Managing Modified Record of Data Which Can Reduce Size of Data Stored in Block Chain
CN115834773A (en) Outbound call completion rate improving method and device based on AUTOML framework
CN111638904B (en) Data configuration restoration method and device and readable storage medium
CN115880548A (en) Picture processing model optimization method and device

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