CN102968309A - Method and device for realizing rule matching based on rule engine - Google Patents

Method and device for realizing rule matching based on rule engine Download PDF

Info

Publication number
CN102968309A
CN102968309A CN2012105073033A CN201210507303A CN102968309A CN 102968309 A CN102968309 A CN 102968309A CN 2012105073033 A CN2012105073033 A CN 2012105073033A CN 201210507303 A CN201210507303 A CN 201210507303A CN 102968309 A CN102968309 A CN 102968309A
Authority
CN
China
Prior art keywords
rule
index entry
index
priority
matched
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
CN2012105073033A
Other languages
Chinese (zh)
Other versions
CN102968309B (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.)
Asiainfo Lian Technology (china) Co Ltd
Original Assignee
Asiainfo Lian Technology (china) 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 Asiainfo Lian Technology (china) Co Ltd filed Critical Asiainfo Lian Technology (china) Co Ltd
Priority to CN201210507303.3A priority Critical patent/CN102968309B/en
Publication of CN102968309A publication Critical patent/CN102968309A/en
Application granted granted Critical
Publication of CN102968309B publication Critical patent/CN102968309B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Machine Translation (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

The embodiment of the invention discloses a method and a device for realizing rule matching based on a rule engine. The method specifically comprises the following steps: receiving an event required to be matched, wherein the event comprises at least one attribute value; judging whether a preset index entry of any rule to be matched is matched with the attribute value in the event or not; and if the preset index entry of any rule to be matched is matched with the attribute value in the event, determining a target rule to be matched, which corresponds to the matched index entry; and matching a rule condition of the target rule to be matched and the attribute value in the event. According to the invention, the rules required to be matched are screened through the adoption of the indexes, so that the number of the rules required to be matched is reduced, and the performance of the rule engine and the rule matching efficiency are improved when the rule matching is needed.

Description

A kind of rule matching method and device of realizing rule-based engine
Technical field
The present invention relates to the Data Matching technical field, be specifically related to a kind of rule matching method and device of realizing rule-based engine.
Background technology
Regulation engine is a kind of assembly that is embedded in the application program, and most of regulation engines all support the rule of simple scripting language to realize, supports the embedding exploitation of general development language.Regulation engine has been realized operational decision making is separated from application code, and use predefined semantic module to write operational decision making, application program is by submitting to data or object to come the triggering rule engine to regulation engine, call corresponding rule by regulation engine, and then trigger corresponding operation.The operation that a common rule comprises one group of rule condition and carries out under this rule condition, the strictly all rules condition that and if only if in should rule are when all the match is successful, and regulation engine will trigger the lower all operations execution of this rule.
Therefore, when regular quantity is more, use prior art to carry out rule match, need for each regular strictly all rules condition that the match is successful, just can match desire rule.
At present, in a fairly large number of situation of rule, find out the method for the rule of needs coupling by mating each regular strictly all rules condition, so that in the process of searching the rule that needs coupling, need to judge whether to mate regular more, reduced to a certain extent the performance of regulation engine, so that the efficient of rule match is lower.
Summary of the invention
Inefficient problem for the solution rule coupling the invention provides a kind of rule matching method and device of realizing rule-based engine.
The invention provides a kind of rule matching method of realizing rule-based engine, described method comprises,
Receive the event that needs coupling, described event comprises at least one property value;
Judge whether to exist the default index entry of arbitrary rule to be matched and the coupling of the property value in the described event;
If so, then determine the corresponding target of the index entry rule to be matched of coupling;
The rule condition of described target rule to be matched and the property value in the described event are mated.
Preferably, describedly judge whether to exist before the default index entry of arbitrary rule to be matched and the property value in the described event mate, also comprise:
Sort according to the index entry set that default ordering rule is preset arbitrary described rule;
According to the order of each index entry after the ordering, the priority of each index entry in the index entry set is set.
Preferably, the described default index entry of arbitrary described rule the set according to default ordering rule sorts, and is specially;
The index entry of arbitrary relation of equality is set to the first priority;
With in the set of described index entry except other index entries of the index entry that is set to the first priority, sort according to the preset order rule;
Accordingly, described according to the order of each index entry after the ordering, the priority of each index entry in the index entry set is set, be specially:
According to the order of each index entry after the ordering, the priority except other index entries of the index entry that is set to the first priority is set in the index entry set.
Preferably, the described index entry and the property value in the described event that exist arbitrary rule to be matched to preset of judging whether mates, and is specially:
The quantity of supposing described rule to be matched is N, and then the index entry quantity of n rule to be matched is Mn, and described n is the natural number that is not more than N;
If the index entry quantity Mn of n rule equals 1, then judge an index entry coupling that whether has a property value and described n rule in the described event.
Preferably, the described index entry and the property value in the described event that exist arbitrary rule to be matched to preset of judging whether mates, and is specially:
Suppose that described regular quantity to be matched is N, then the index entry quantity of n rule to be matched is Mn, and described n is the natural number that is not more than N;
If the index entry quantity Mn of n rule, then judges the first priority index item coupling that whether has a property value and described n rule in the described event greater than 1;
If, then according to the corresponding relation of the first priority index item and the second priority index item, determine the second priority index item of described n rule, and judge whether have a property value and described the second priority index item coupling in the described event, the rest may be inferred, until judge whether to exist property value in the described event and the Mn priority index item coupling of described n rule.
The present invention also provides a kind of rule match device of realizing rule-based engine, and described device comprises:
Receiver module is used for receiving the event that needs coupling, and described event comprises at least one property value;
Judge module is used for judging whether to exist the property value of the default index entry of arbitrary rule to be matched and described event to mate;
The first determination module is used in the result of described judge module determining the corresponding target of the index entry rule to be matched of mating when being;
Matching module is used for the rule condition of described target rule to be matched and the property value of described event are mated.
Preferably, described device also comprises:
Order module is used for sorting according to the index entry set that default ordering rule is preset arbitrary described rule;
First arranges module, is used for the order according to each index entry after the ordering, and the priority of each index entry in the index entry set is set.
Preferably, described order module comprises:
Second arranges module, and the index entry that is used for arbitrary relation of equality is set to the first priority;
The ordering submodule, other index entries for described index entry being gathered except the index entry that is set to the first priority sort according to the preset order rule;
Accordingly, described first arranges module, specifically is used for:
According to the order of each index entry after the ordering in the described ordering submodule, the priority except other index entries of the index entry that is set to the first priority is set in the index entry set.
Preferably, described judge module comprises:
Obtain submodule, the quantity that is used for obtaining described rule to be matched is N, and the index entry quantity of n rule to be matched is Mn, and described n is the natural number that is not more than N;
Whether first judges submodule, is used under the index entry quantity Mn of n rule equals 1 situation, judge to exist a property value and a described n regular index entry to mate in the described event.
Preferably, described judge module comprises:
Obtain submodule, the quantity that is used for obtaining described rule to be matched is N, and the index entry quantity of n rule to be matched is Mn, and described n is the natural number that is not more than N;
The second judge module, be used for index entry quantity Mn n rule greater than 1 situation under, judge whether exist a property value and described n regular the first priority index item to mate in the described event;
The 3rd judges submodule, be used for the described second result who judges submodule when being, corresponding relation according to the first priority index item and the second priority index item, determine the second priority index item of described n rule, and judge whether have a property value and described the second priority index item coupling in the described event, the rest may be inferred, until judge whether to exist property value in the described event and the Mn priority index item coupling of described n rule.
Compared with prior art, the present invention at first receives the event that needs coupling, and described event comprises at least one property value; Judge whether to exist the default index entry of arbitrary rule to be matched and the coupling of the property value in the described event; If so, then determine the corresponding target of the index entry rule to be matched of coupling; The rule condition of described target rule to be matched and the property value in the described event are mated.The present invention utilizes index to need the screening of the rule of coupling, so that when the needs rule match, reduced the quantity that needs the rule of coupling, has improved the performance of regulation engine and the efficient of rule match.
Description of drawings
In order to be illustrated more clearly in the technical scheme in the embodiment of the present application, the accompanying drawing of required use was done to introduce simply during the below will describe embodiment, apparently, accompanying drawing in the following describes only is some embodiment of the application, for those of ordinary skills, under the prerequisite of not paying creative work, can also obtain according to these accompanying drawings other accompanying drawing.
Fig. 1 is the process flow diagram of rule matching method of the rule-based engine of realization of the embodiment of the invention one;
Fig. 2 is the process flow diagram of rule matching method of the rule-based engine of realization of the embodiment of the invention two;
Fig. 3 is the structural drawing of rule match device of the rule-based engine of realization of the embodiment of the invention three;
Fig. 4 is the structure drawing of device of the order module 302 of the embodiment of the invention three;
Fig. 5 is judge module 304 structural drawing that the index entry quantity in rule of the embodiment of the invention three equaled 1 o'clock;
Fig. 6 be the embodiment of the invention three at the index entry quantity of rule judge module 304 structural drawing greater than 1 o'clock.
Embodiment
Below in conjunction with the accompanying drawing in the embodiment of the present application, the technical scheme in the embodiment of the present application is clearly and completely described, obviously, described embodiment only is the application's part embodiment, rather than whole embodiment.Based on the embodiment among the application, those of ordinary skills are not making the every other embodiment that obtains under the creative work prerequisite, all belong to the scope of the application's protection.
Embodiment one,
With reference to figure 1, Fig. 1 is a kind of process flow diagram of realizing the rule matching method embodiment one of rule-based engine provided by the invention, and present embodiment specifically can comprise:
Step 101, reception need the event of coupling, and described event comprises at least one property value.
In this area, regulation engine is triggered by the reception event, and then calls corresponding rule and event is mated according to the event that receives, if the match is successful, then triggers all operations that this rule that the match is successful can trigger.Present embodiment has mainly solved the event how basis receives, and matches the rule corresponding with this event in the list of rules of storage strictly all rules.
In the present embodiment, the event that at first receive to need coupling, event can be understood as " operation of being identified by control ", and said event can comprise a property value herein, also can comprise a plurality of property values, any one property value of described event can be complementary with arbitrary rule condition of rule.For example, any one event can be " red eye is bright ", and " red eye is bright " is a property value of this event at this moment, can be complementary with the rule condition of arbitrary rule; Any one event also can be " red eye is bright; greensignal light is also bright simultaneously ", wherein, " red eye is bright " " greensignal light is also bright " is respectively the property value of this event, and the property value of above-mentioned two events also can be complementary with two rule conditions of arbitrary rule.
In the practical operation, receiving needs the mode of match event a lot, belongs to prior art, so do not repeat them here, the mode that receives simultaneously the event that needs coupling does not affect the enforcement of present embodiment.
Step 102, judge whether to exist the default index entry of arbitrary rule to be matched and the property value in the described event to mate, if so, then enter step 103.
In the present embodiment, each rule to be matched comprises some rule conditions, for example, if " red eye is bright; greensignal light is also bright simultaneously, then can trigger the A program and automatically move " is a rule, wherein, " red eye is bright " and " greensignal light is also bright " is respectively rule condition wherein, the operation that " triggering the A program moves automatically " is triggered when all being matched to merit for this regular rule condition.The rule condition that index entry arranges condition that meets of each rule to be matched is set to index entry at first in advance, for example, " red eye is bright " can be set to index entry.Secondly, the property value of the event that receives and the index entry of setting are complementary, for example, if the arbitrary property value in the event that receives is " red eye is bright ", this property value can the match is successful with " red eye is bright " this rule condition that is set to index entry so, in a word, if the property value in the event can mate with any one regular all set index entry, then enter step 103.
Concrete, index entry arranges condition can be the rule condition of " relation of equality ", for example, if a rule condition of certain rule is " age equals 20 ", then can be set to this regular index entry by " age equals 20 " this rule condition.
In the practical operation, each rule to be matched can arrange an index entry, also a plurality of index entries can be set.
Concrete, according to the index entry that condition setting is set of " relation of equality " during for " age equals 20 ", if a property value in the event that receives also is " age equals 20 ", so, " age equals 20 " as the event attribute value can be complementary with " age equals 20 " as index entry.
It should be noted that, in the practical operation, usually the first priority index item of rule index item is set to have " relation of equality " rule condition, and other priority index items except the first priority can be set to have the rule condition of " relation of equality " or " not waiting relation ".
The if there is no default index entry and the coupling of the property value in the described event of arbitrary rule to be matched, the then rule that is not complementary with the event of reception of explanation.
The corresponding target of the index entry rule to be matched of step 103, definite coupling.
In the present embodiment, the rule for the treatment of that all index entries are all mated all is used as target rule to be matched, for example, if the index entry of a rule is " age is greater than 18 ", another regular index entry is " age equals 20 " simultaneously, and a property value of the event that receives is " age is greater than 18 ", all can mate as " age is greater than 18 " of a property value of this event and " age is greater than 18 " and " age equals 20 " as the index entry of two rules respectively so, above-mentioned two rules that all index entries have been mated in explanation all are used as target rule to be matched, are used for the further coupling of the rule condition of subsequent step.
Step 104, the rule condition of described target rule to be matched and the property value in the described event are mated.
In the present embodiment, the rule condition of the target rule to be matched determined and property value in the event that receives are mated.
In the practical operation, present embodiment can be complementary the strictly all rules condition of the target rule to be matched determined and all properties value in the event that receives, if the match is successful fully, this target rule to be matched and the event matches success that receives is described, otherwise it fails to match.
In the practical operation, present embodiment also can be complementary other property values except the property value that the match is successful except in index entry other rule conditions partly that the match is successful and the event that receives of target rule to be matched, if the match is successful, this target rule to be matched and the event matches success that receives then are described, otherwise it fails to match.For example, the rule condition of supposing a rule is " red eye is bright " and " greensignal light is also bright ", if with above-mentioned " red eye is bright " this rule condition as index entry, a property value in the event that receives also is in the situation of " red eye is bright ", the match is successful can to determine the property value of event of " red eye is bright " this rule condition that is used as index entry of above-mentioned rule and reception, want to reach the purpose that above-mentioned rule is matched to merit this moment, only needs other property values with the rule of " greensignal light the is also bright " index that the match is successful except " red eye is bright " and the event that receives the match is successful to get final product.
Present embodiment at first receives the event that needs coupling, and described event comprises at least one property value, and next judges whether to exist the default index entry of arbitrary rule to be matched and the coupling of the property value in the described event; If so, then determine the corresponding target of the index entry rule to be matched of coupling, at last the rule condition of described target rule to be matched and the property value in the described event are mated.Compared with prior art, present embodiment utilizes index to need the screening of the rule of coupling, so that when the needs rule match, reduced the quantity that needs the rule of coupling, has improved the performance of regulation engine and the efficient of rule match.
Embodiment two,
With reference to figure 2, Fig. 2 is a kind of process flow diagram of realizing the rule matching method embodiment two of rule-based engine provided by the invention, because the step 201 among the embodiment two is identical with step 101, step 103~104 among the embodiment one with step 205~206, so no longer it is given unnecessary details in the present embodiment.
Present embodiment specifically can comprise:
Step 201, reception need the event of coupling, and described event comprises at least one property value.
Step 202, according to default ordering rule to arbitrary described rule default index entry set sort.
In the present embodiment, each regular index entry is set at first, the index entry that each is regular is respectively as its corresponding index entry set, next arranges the ordering rule with the index entry ordering, at last, according to the ordering rule that sets in advance, the index entry set that each rule is corresponding is sorted.
Concrete, the clooating sequence that sets in advance can be that the rule index item of " equaling relation " is set to high priority.For example, the rule condition of supposing a rule is " age equals 20 " and " height is greater than 170 ", then can be according to " equaling relation " for the index entry of high priority arrange condition, " age equals 20 " this rule condition that " equals relation " is set to index entry.
Step 203, according to the order of each index entry after the ordering, the priority of each index entry in the index entry set is set.
In the present embodiment, according to the ordering rule that is used for ordering that sets in advance to index entry set sort, according to the order of the index entry after the ordering, index entry is carried out the priority setting.
Concrete, the index entry that is arranged in the anterior locations of index entry order can be set to higher priority.For example, the set of the index entry of a rule comprises A, B, C and four index entries of D, and it is rear according to default ordering rule ordering to be the order of B, C, A, D, and priority orders is B>C>A>D so.
Concrete, the B index entry in the index entry set of above-mentioned rule is the first priority index item, the first priority index item can be the rule condition of " relation of equality ", introduces in detail in the step 102 in embodiment one, does not repeat them here.C, A in simultaneously this index entry set and D index entry be respectively second and third, the level Four index entry, they can be the rule condition of " relation of equality ", also can be the rule condition of " unequal " relation, for example, if a rule condition of certain rule is " age is greater than 20 ", then also " age is greater than 20 " can be set to second and third or level Four index entry of this rule.
Step 204, judge whether to exist the default index entry of arbitrary rule to be matched and the property value in the described event to mate, if so, then enter step 205.
In the present embodiment, the quantity of supposing rule to be matched is N, and then the index entry quantity of n rule to be matched is Mn, and this n is the natural number that is not more than N;
If the index entry quantity Mn of n rule equals 1, then judge an index entry coupling that whether has a property value and this n rule in the event that receives, if exist, then enter step 205.
If the index entry quantity Mn of n rule is greater than 1, then judge the first priority index item coupling that whether has a property value and described n rule in the event that receives, if exist, then according to the corresponding relation of the first priority index item and the second priority index item, determine the second priority index item of this n rule, and judge whether have a property value and described the second priority index item coupling in the event that receives, the rest may be inferred, until judge whether to exist a property value in the event of reception and the Mn priority index item coupling of described n rule.
It should be noted that N, n and Mn in the present embodiment all get natural number.
The below is take the rule of n=5, Mn=2 as example:
Reference table 1, table 2, table 1 are the corresponding table of index entry and the index entry of the second priority of the first priority of the 5th rule, and table 2 is the index entry of the second priority of the 5th rule and the corresponding table of rule sign.
The property value of supposing the event that regulation engine receives is " age equals 20 " " height is greater than 170 " and " undergraduate course educational background ".At first, by the processing of regulation engine, can be complementary as " age equals 20 " of the first priority and " age equals 20 " as a property value of the event that receives.Secondly, reference table 1, by the corresponding relation of the first priority index item and the second priority index item, the second priority index item corresponding to the first priority index item definite and that the match is successful.Again, in the event that judge to receive except with the first priority index item property value that the match is successful other property values whether have with the second priority index and be complementary mutually, just in time be complementary with the second priority index item " height is greater than 170 " of this rule for " height is greater than 170 " property value in the event of regulation engine reception this moment.At last, reference table 2 by the corresponding relation of the second priority index item with rule sign, is determined the rule sign corresponding with the second priority index item that the match is successful, and then is convenient to the definite of rule that the complete quilt in the subsequent step mates.
Table 1
The first priority index item The second priority index item
Age equals 20 Height is greater than 170
Table 2
The second priority index item The rule sign
Height is greater than 170 The 5th rule
Wherein, for convenience's sake, only listed and can embody thought of the present invention and can realize minimum data of the present invention in table 1 and the table 2, in actual applications, those skilled in the art can expand data according to the version of table 1 and table 2.
Also need to prove, relate to the example of concrete data in the embodiment of the invention, all arrange in order to make things convenient for those skilled in the art to understand the present invention, these data can not be considered to being restriction of the present invention.
The corresponding target of the index entry rule to be matched of step 205, definite coupling.
Step 206, the rule condition of described target rule to be matched and the property value in the described event are mated.
Present embodiment sorts index entry, and the index after the utilization ordering needs the screening of the rule of coupling, so that when the needs rule match, reduced the quantity that needs the rule of coupling, has improved the performance of regulation engine and the efficient of rule match.
Embodiment three,
With reference to figure 3, Fig. 3 is a kind of structure drawing of device of realizing the rule match device embodiment three of rule-based engine provided by the invention, and present embodiment specifically can comprise:
Receiver module 301 is used for receiving the event that needs coupling, and described event comprises at least one property value;
Order module 302 is used for sorting according to the index entry set that default ordering rule is preset arbitrary described rule;
With reference to figure 4, Fig. 4 is the structural drawing of order module 302, and order module 302 specifically comprises:
Second arranges module 401, and the index entry that is used for arbitrary relation of equality is set to the first priority;
Ordering submodule 402, other index entries for described index entry being gathered except the index entry that is set to the first priority sort according to the preset order rule;
First arranges module 303, is used for the order according to each index entry after the ordering, and the priority of each index entry in the index entry set is set.
When described order module 302 adopts the structure of Fig. 4 to realize, described first arranges module 303 is used for order according to each index entry after described ordering submodule 402 orderings, and the priority except other index entries of the index entry that is set to the first priority is set in the index entry set.
Judge module 304 is used for judging whether to exist the property value of the default index entry of arbitrary rule to be matched and described event to mate;
With reference to figure 5, judge module 304 structural drawing that Fig. 5 equals at 1 o'clock for regular index entry quantity, described judge module 304 specifically comprises:
Obtaining submodule 501, is N for the quantity of obtaining described rule to be matched, and the index entry quantity of n rule to be matched is Mn;
Whether first judges submodule 502, is used under the index entry quantity Mn of n rule equals 1 situation, judge to exist a property value and a described n regular index entry to mate in the described event.
With reference to figure 6, Fig. 6 be the index entry quantity of rule greater than 1 o'clock judge module 304 structural drawing, described judge module 304 specifically comprises:
Obtaining submodule 501, is N for the quantity of obtaining described rule to be matched, and the index entry quantity of n rule to be matched is Mn;
The second judge module 601, be used for index entry quantity Mn n rule greater than 1 situation under, judge whether exist a property value and described n regular the first priority index item to mate in the described event;
The 3rd judges submodule 602, be used for the described second result who judges submodule when being, corresponding relation according to the first priority index item and the second priority index item, determine the second priority index item of described n rule, and judge whether have a property value and described the second priority index item coupling in the described event, the rest may be inferred, until judge whether to exist property value in the described event and the Mn priority index item coupling of described n rule.
The first determination module 305 is used in the result of described judge module determining the corresponding target of the index entry rule to be matched of mating when being;
Matching module 306 is used for the rule condition of described target rule to be matched and the property value of described event are mated.
Index after the present embodiment utilization ordering needs the screening of the rule of coupling, so that when the needs rule match, reduced the quantity that needs the rule of coupling, has improved the performance of regulation engine and the efficient of rule match.
For device embodiment, because it corresponds essentially to embodiment of the method, so relevant part gets final product referring to the part explanation of embodiment of the method.Device embodiment described above only is schematic, wherein said unit as the separating component explanation can or can not be physically to separate also, the parts that show as the unit can be or can not be physical locations also, namely can be positioned at a place, perhaps also can be distributed on a plurality of network element.Can select according to the actual needs wherein some or all of module to realize the purpose of present embodiment scheme.Those of ordinary skills namely can understand and implement in the situation of not paying creative work.
Need to prove, in this article, relational terms such as the first and second grades only is used for an entity or operation are made a distinction with another entity or operation, and not necessarily requires or hint and have the relation of any this reality or sequentially between these entities or the operation.And, term " comprises ", " comprising " or its any other variant are intended to contain comprising of nonexcludability, thereby not only comprise those key elements so that comprise process, method, article or the equipment of a series of key elements, but also comprise other key elements of clearly not listing, or also be included as the intrinsic key element of this process, method, article or equipment.Do not having in the situation of more restrictions, the key element that is limited by statement " comprising ... ", and be not precluded within process, method, article or the equipment that comprises described key element and also have other identical element.
More than rule matching method and the device of the rule-based engine of realization that the embodiment of the invention is provided be described in detail, used specific case herein principle of the present invention and embodiment are set forth, the explanation of above embodiment just is used for helping to understand method of the present invention and core concept thereof; Simultaneously, for one of ordinary skill in the art, according to thought of the present invention, all will change in specific embodiments and applications, in sum, this description should not be construed as limitation of the present invention.

Claims (10)

1. a rule matching method of realizing rule-based engine is characterized in that, described method comprises,
Receive the event that needs coupling, described event comprises at least one property value;
Judge whether to exist the default index entry of arbitrary rule to be matched and the coupling of the property value in the described event;
If so, then determine the corresponding target of the index entry rule to be matched of coupling;
The rule condition of described target rule to be matched and the property value in the described event are mated.
2. method according to claim 1 is characterized in that, describedly judges whether to exist before the default index entry of arbitrary rule to be matched and the property value in the described event mate, and also comprises:
Sort according to the index entry set that default ordering rule is preset arbitrary described rule;
According to the order of each index entry after the ordering, the priority of each index entry in the index entry set is set.
3. method according to claim 2 is characterized in that, the described default index entry of arbitrary described rule the set according to default ordering rule sorts, and is specially;
The index entry of arbitrary relation of equality is set to the first priority;
With in the set of described index entry except other index entries of the index entry that is set to the first priority, sort according to the preset order rule;
Accordingly, described according to the order of each index entry after the ordering, the priority of each index entry in the index entry set is set, be specially:
According to the order of each index entry after the ordering, the priority except other index entries of the index entry that is set to the first priority is set in the index entry set.
4. method according to claim 3 is characterized in that, the described index entry and the property value in the described event that exist arbitrary rule to be matched to preset of judging whether mates, and is specially:
The quantity of supposing described rule to be matched is N, and then the index entry quantity of n rule to be matched is Mn, and described n is the natural number that is not more than N;
If the index entry quantity Mn of n rule equals 1, then judge an index entry coupling that whether has a property value and described n rule in the described event.
5. method according to claim 3 is characterized in that, the described index entry and the property value in the described event that exist arbitrary rule to be matched to preset of judging whether mates, and is specially:
Suppose that described regular quantity to be matched is N, then the index entry quantity of n rule to be matched is Mn, and described n is the natural number that is not more than N;
If the index entry quantity Mn of n rule, then judges the first priority index item coupling that whether has a property value and described n rule in the described event greater than 1;
If, then according to the corresponding relation of the first priority index item and the second priority index item, determine the second priority index item of described n rule, and judge whether have a property value and described the second priority index item coupling in the described event, the rest may be inferred, until judge whether to exist property value in the described event and the Mn priority index item coupling of described n rule.
6. rule match device of realizing rule-based engine is characterized in that described device comprises:
Receiver module is used for receiving the event that needs coupling, and described event comprises at least one property value;
Judge module is used for judging whether to exist the property value of the default index entry of arbitrary rule to be matched and described event to mate;
The first determination module is used in the result of described judge module determining the corresponding target of the index entry rule to be matched of mating when being;
Matching module is used for the rule condition of described target rule to be matched and the property value of described event are mated.
7. device according to claim 6 is characterized in that, described device also comprises:
Order module is used for sorting according to the index entry set that default ordering rule is preset arbitrary described rule;
First arranges module, is used for the order according to each index entry after the ordering, and the priority of each index entry in the index entry set is set.
8. device according to claim 7 is characterized in that, described order module comprises:
Second arranges module, and the index entry that is used for arbitrary relation of equality is set to the first priority;
The ordering submodule, other index entries for described index entry being gathered except the index entry that is set to the first priority sort according to the preset order rule;
Accordingly, described first arranges module, specifically is used for:
According to the order of each index entry after the ordering in the described ordering submodule, the priority except other index entries of the index entry that is set to the first priority is set in the index entry set.
9. device according to claim 8 is characterized in that, described judge module comprises:
Obtain submodule, the quantity that is used for obtaining described rule to be matched is N, and the index entry quantity of n rule to be matched is Mn, and described n is the natural number that is not more than N;
Whether first judges submodule, is used under the index entry quantity Mn of n rule equals 1 situation, judge to exist a property value and a described n regular index entry to mate in the described event.
10. device according to claim 8 is characterized in that, described judge module comprises:
Obtain submodule, the quantity that is used for obtaining described rule to be matched is N, and the index entry quantity of n rule to be matched is Mn, and described n is the natural number that is not more than N;
The second judge module, be used for index entry quantity Mn n rule greater than 1 situation under, judge whether exist a property value and described n regular the first priority index item to mate in the described event;
The 3rd judges submodule, be used for the described second result who judges submodule when being, corresponding relation according to the first priority index item and the second priority index item, determine the second priority index item of described n rule, and judge whether have a property value and described the second priority index item coupling in the described event, the rest may be inferred, until judge whether to exist property value in the described event and the Mn priority index item coupling of described n rule.
CN201210507303.3A 2012-11-30 2012-11-30 A kind of rule matching method and device realizing rule-based engine Active CN102968309B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201210507303.3A CN102968309B (en) 2012-11-30 2012-11-30 A kind of rule matching method and device realizing rule-based engine

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201210507303.3A CN102968309B (en) 2012-11-30 2012-11-30 A kind of rule matching method and device realizing rule-based engine

Publications (2)

Publication Number Publication Date
CN102968309A true CN102968309A (en) 2013-03-13
CN102968309B CN102968309B (en) 2016-01-20

Family

ID=47798467

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201210507303.3A Active CN102968309B (en) 2012-11-30 2012-11-30 A kind of rule matching method and device realizing rule-based engine

Country Status (1)

Country Link
CN (1) CN102968309B (en)

Cited By (15)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103473642A (en) * 2013-09-10 2013-12-25 中国科学院沈阳自动化研究所 Method for rule engine for production dispatching
CN105573737A (en) * 2014-10-30 2016-05-11 中国科学院声学研究所 Method for increasing operating efficiency of rule engines
CN105573726A (en) * 2014-10-10 2016-05-11 阿里巴巴集团控股有限公司 Rule processing method and equipment
CN105635328A (en) * 2014-10-31 2016-06-01 中国科学院声学研究所 Method for improving rule engine response speed
CN105677725A (en) * 2015-12-30 2016-06-15 南京途牛科技有限公司 Preset parsing method for tourism vertical search engine
CN106909543A (en) * 2015-12-22 2017-06-30 阿里巴巴集团控股有限公司 The method for mode matching and device of a kind of regulation engine
CN107390995A (en) * 2017-07-31 2017-11-24 阿里巴巴集团控股有限公司 A kind of ladder numerical value method to set up and device
CN107491484A (en) * 2017-07-17 2017-12-19 阿里巴巴集团控股有限公司 A kind of data matching method, device and equipment
CN107656755A (en) * 2016-07-24 2018-02-02 平安科技(深圳)有限公司 The edit methods and device of regulation engine
CN108874847A (en) * 2017-12-26 2018-11-23 北京安天网络安全技术有限公司 Matching process, device, electronic equipment and the storage medium of custom rule
CN109858906A (en) * 2018-12-30 2019-06-07 贝壳技术有限公司 A kind of dynamic expansion method and system of rule
CN111818111A (en) * 2019-04-11 2020-10-23 华为技术有限公司 Host and server
CN112258208A (en) * 2020-07-24 2021-01-22 北京沃东天骏信息技术有限公司 Object matching method, device, equipment and storage medium
CN112561500A (en) * 2021-02-25 2021-03-26 深圳平安智汇企业信息管理有限公司 Salary data generation method, device, equipment and medium based on user data
CN115129324A (en) * 2022-07-28 2022-09-30 北京天融信网络安全技术有限公司 Rule matching method, device, electronic equipment and medium

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106528870B (en) * 2016-12-05 2018-06-08 贵州国信通电子商务有限公司 A kind of big data intelligent analysis system

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1894689A (en) * 2003-08-29 2007-01-10 伏泰劳普蒂克斯有限公司 Method, device and software for querying and presenting search results
JP2009069971A (en) * 2007-09-11 2009-04-02 Nomura Research Institute Ltd Data processing system
CN102135974A (en) * 2010-08-06 2011-07-27 华为软件技术有限公司 Data source selecting method and system
CN102147795A (en) * 2010-02-05 2011-08-10 北京四维图新科技股份有限公司 Method and device for searching points of interest as well as navigation system
CN102375853A (en) * 2010-08-24 2012-03-14 中国移动通信集团公司 Distributed database system, method for building index therein and query method
CN102426569A (en) * 2010-12-17 2012-04-25 百度在线网络技术(北京)有限公司 Method and equipment for screening and sorting material data
US20120215569A1 (en) * 2011-02-18 2012-08-23 Amadeus S.A.S. Method, system and computer program to provide fares detection from rules attributes
CN102722531A (en) * 2012-05-17 2012-10-10 北京大学 Query method based on regional bitmap indexes in cloud environment

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1894689A (en) * 2003-08-29 2007-01-10 伏泰劳普蒂克斯有限公司 Method, device and software for querying and presenting search results
JP2009069971A (en) * 2007-09-11 2009-04-02 Nomura Research Institute Ltd Data processing system
CN102147795A (en) * 2010-02-05 2011-08-10 北京四维图新科技股份有限公司 Method and device for searching points of interest as well as navigation system
CN102135974A (en) * 2010-08-06 2011-07-27 华为软件技术有限公司 Data source selecting method and system
CN102375853A (en) * 2010-08-24 2012-03-14 中国移动通信集团公司 Distributed database system, method for building index therein and query method
CN102426569A (en) * 2010-12-17 2012-04-25 百度在线网络技术(北京)有限公司 Method and equipment for screening and sorting material data
US20120215569A1 (en) * 2011-02-18 2012-08-23 Amadeus S.A.S. Method, system and computer program to provide fares detection from rules attributes
CN102722531A (en) * 2012-05-17 2012-10-10 北京大学 Query method based on regional bitmap indexes in cloud environment

Cited By (21)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103473642A (en) * 2013-09-10 2013-12-25 中国科学院沈阳自动化研究所 Method for rule engine for production dispatching
CN105573726A (en) * 2014-10-10 2016-05-11 阿里巴巴集团控股有限公司 Rule processing method and equipment
CN105573726B (en) * 2014-10-10 2018-12-28 阿里巴巴集团控股有限公司 A kind of rules process method and equipment
CN105573737A (en) * 2014-10-30 2016-05-11 中国科学院声学研究所 Method for increasing operating efficiency of rule engines
CN105635328A (en) * 2014-10-31 2016-06-01 中国科学院声学研究所 Method for improving rule engine response speed
CN106909543A (en) * 2015-12-22 2017-06-30 阿里巴巴集团控股有限公司 The method for mode matching and device of a kind of regulation engine
CN106909543B (en) * 2015-12-22 2020-08-25 阿里巴巴集团控股有限公司 Pattern matching method and device of rule engine
CN105677725A (en) * 2015-12-30 2016-06-15 南京途牛科技有限公司 Preset parsing method for tourism vertical search engine
CN107656755A (en) * 2016-07-24 2018-02-02 平安科技(深圳)有限公司 The edit methods and device of regulation engine
CN107491484A (en) * 2017-07-17 2017-12-19 阿里巴巴集团控股有限公司 A kind of data matching method, device and equipment
CN107491484B (en) * 2017-07-17 2020-08-28 阿里巴巴集团控股有限公司 Data matching method, device and equipment
CN107390995B (en) * 2017-07-31 2020-11-17 创新先进技术有限公司 Ladder numerical value setting method and device
CN107390995A (en) * 2017-07-31 2017-11-24 阿里巴巴集团控股有限公司 A kind of ladder numerical value method to set up and device
CN108874847A (en) * 2017-12-26 2018-11-23 北京安天网络安全技术有限公司 Matching process, device, electronic equipment and the storage medium of custom rule
CN109858906A (en) * 2018-12-30 2019-06-07 贝壳技术有限公司 A kind of dynamic expansion method and system of rule
CN111818111A (en) * 2019-04-11 2020-10-23 华为技术有限公司 Host and server
CN111818111B (en) * 2019-04-11 2021-10-15 华为技术有限公司 Host and server
CN112258208A (en) * 2020-07-24 2021-01-22 北京沃东天骏信息技术有限公司 Object matching method, device, equipment and storage medium
CN112561500A (en) * 2021-02-25 2021-03-26 深圳平安智汇企业信息管理有限公司 Salary data generation method, device, equipment and medium based on user data
CN112561500B (en) * 2021-02-25 2021-05-25 深圳平安智汇企业信息管理有限公司 Salary data generation method, device, equipment and medium based on user data
CN115129324A (en) * 2022-07-28 2022-09-30 北京天融信网络安全技术有限公司 Rule matching method, device, electronic equipment and medium

Also Published As

Publication number Publication date
CN102968309B (en) 2016-01-20

Similar Documents

Publication Publication Date Title
CN102968309A (en) Method and device for realizing rule matching based on rule engine
US7702619B2 (en) Methods and systems for joining database tables using indexing data structures
CN103098056B (en) A kind of method of sequence, device and terminal
CN103262074A (en) Parallel repartitioning index scan
CN103220412B (en) Mobile terminal schedule management method and system
CN103034663A (en) Information searching method and equipment
WO2010120465A2 (en) Testing efficiency and stability of a database query engine
CN105975537A (en) Sorting method and device of application program
JP2007188509A (en) Retrieval result providing method and two-stage retrieval system execution method
CN102207935A (en) Method and system for establishing index
CN102955829A (en) Method, device and equipment for sequencing resource items
CN109388636A (en) Business datum is inserted into database method, apparatus, computer equipment and storage medium
CN106649385B (en) Data reordering method and device based on HBase database
CN104123329B (en) Searching method and device
CN102364475A (en) System and method for sequencing search results based on identity recognition
CN110555034B (en) Data query paging method, device, server and medium
CN105550180A (en) Data processing method, device and system
CN105787379A (en) Information management method and system as well as electronic device
CN112115121B (en) Real-time data quality detection system for data management
CN104463460B (en) Processing method and processing device for the waiting information that network data is launched
CN115129324B (en) Rule matching method, device, electronic equipment and medium
CN100565495C (en) File index is handled
KR100886607B1 (en) Method of effectively performing limited-union based multiple-queries in a database management system
CN108846119A (en) A kind of arrangement method, storage device and the mobile terminal of word cognition degree
CN101546306A (en) Method and system for searching patent documentation by utilizing IPC classification

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C53 Correction of patent of invention or patent application
CB02 Change of applicant information

Address after: 100086, three or four floor, CLP information building, 6 South Avenue, Haidian District, Beijing, Zhongguancun

Applicant after: AsiaInfo Science & Technology (China) Co., Ltd.

Address before: 100086, three or four floor, CLP information building, 6 South Avenue, Haidian District, Beijing, Zhongguancun

Applicant before: AsiaInfo LIAN Technology (China) Co., Ltd.

COR Change of bibliographic data

Free format text: CORRECT: APPLICANT; FROM: ASIAINFO-LINKAGE (CHINA) CO., LTD. TO: ASIAINFO SCIENCE + TECHNOLOGY (CHINA) CO., LTD.

C53 Correction of patent of invention or patent application
CB02 Change of applicant information

Address after: 100193 Beijing city northwest of Haidian District Wang Road No. 10 hospital of eastern Asia LIAN's global R & D center headquarters building

Applicant after: AsiaInfo Science & Technology (China) Co., Ltd.

Address before: 100086, three or four floor, CLP information building, 6 South Avenue, Haidian District, Beijing, Zhongguancun

Applicant before: AsiaInfo Science & Technology (China) Co., Ltd.

C14 Grant of patent or utility model
GR01 Patent grant