Embodiment
In the embodiment of the present application, when receiving service request, it can first determine what is carried in the service request
The corresponding dimension mark of each pending data information, afterwards can be according to the rule set pre-saved, it is determined that including
Each rule of all dimension marks of the service request, finally just can be according to each rule undetermined as rule undetermined
Corresponding dimension mark, it is determined that the most regular rule to be matched with the service request undetermined of correspondence dimension mark
Then.It can be seen that, regulation engine, can be without artificial to rule when carrying out rule match using the present processes
The each rule concentrated carries out priority setting, and choice accuracy highest rule match gives the service request,
The operational efficiency of regulation engine is improved, while also improving matching precision.
It is specifically real below in conjunction with the application to make the purpose, technical scheme and advantage of the application clearer
Apply example and technical scheme is clearly and completely described corresponding accompanying drawing.Obviously, it is described
Embodiment is only some embodiments of the present application, rather than whole embodiments.Based on the implementation in the application
Example, the every other implementation that those of ordinary skill in the art are obtained under the premise of creative work is not made
Example, belongs to the scope of the application protection.
The rule match process that Fig. 1 provides for the embodiment of the present application, specifically includes following steps:
S101:Receive service request.
In the embodiment of the present application, matching between service request and rule is generally carried out by regulation engine, and
When typically only service request quantity, regular quantity are a lot (that is, when reaching the quantity of enterprise-level), just need
Will be using the request of rule engine technique finishing service and matching between rule.So, in this application, can
The service request is received by the server of operation rule engine, and can be specifically somebody's turn to do by regulation engine reception
Service request.
Further, since the effect of the service request is the regulation engine is determined that one matches with the service request
Rule, so carry some pending data messages in the service request, also, due to each data
Information is probably the data of different dimensions, so can also be identified by the data message pre-saved with dimension
Mapping table, determines the corresponding dimension mark of each data message that the service request is carried.
Wherein, the data message in dimension mark mapping table with that can include mark, the data of data message
Coding, dimension mark, span of data message of information etc., the data message is corresponding with dimension mark
Relation table can be by manually pre-establishing and being stored in the regulation engine, so that the regulation engine can be distinguished not
The data message of same latitude.
For example, it is assumed that the regulation engine A of e-commerce platform have received service request α, wherein, the industry
Business request α carries 3 data messages:Seller's identity (identification, id), cashier production
Product code, cashier service identification.It is further assumed that the data message in the regulation engine is corresponding with dimension mark
Relation table, as shown in table 1.
Data message is identified |
Data message is encoded |
Dimension is identified |
Seller id |
sellerId |
1 |
Partner id |
partnered |
2 |
Platform Type |
platformtyp |
3 |
Cashier product code |
product |
4 |
Cashier service identification |
bizIdentity |
5 |
Table 1
It can be seen that, mapping table is identified by the data message and dimension, regulation engine A can determine this
The corresponding dimension of data message that service request α is carried, which is identified, is respectively, and 1,3,5.
It should be noted that the regulation engine can be located in a single equipment, many can also be located at
In the system of equipment composition.
S102:According to the rule set pre-saved, it is determined that all dimension marks carried comprising the service request
Some rules known, are used as rule undetermined.
In the embodiment of the present application, after it have received the service request, the regulation engine just can be according to advance
The rule set of preservation, it is determined that the rule matched with the service request, as rule undetermined, also, with this
The rule of service request matching need to include all dimensions mark carried in the service request.
In addition, the rule set is the intersection of strictly all rules in the regulation engine, also, determine for convenience each
The data area that the precision and each rule of rule are related to, each rule preserved in the rule set, except
Record outside the regular mark and the regular logical operation expression formula, also preserve the rule corresponding
The corresponding dimension mark of each data message being related in logical operation expression formula, i.e. the rule includes dimension mark
Know.
Specifically, the regulation engine is identified according to all dimensions carried in the service request, the rule is traveled through
The strictly all rules of concentration, and the rule comprising all dimensions mark carried in the service request is defined as treating
Set pattern then, after the strictly all rules in the rule set is traveled through, determines some rules undetermined.
Continue to use the example above, it is assumed that it is as shown in table 2 to there is rule set in regulation engine A.
Table 2
It can be seen that, regulation engine A can determine each regular corresponding dimension mark by the rule set.
Also, because regulation engine A has determined that each dimension that service request α is carried in step S101
Scale is known:1st, 3,5, so regulation engine A can travel through strictly all rules in the rule set, and
It is determined that the rule of all dimensions mark comprising the service request is rule undetermined.Then, due to Rule3 and
The dimension included in Rule4 identifies 1,3,5 and 1,3,4,5 and includes owning in service request α
Dimension is identified, so regulation engine A can determine that Rule3 and Rule4 is rule undetermined.
S103:In each rule undetermined, it is determined that the most rules undetermined of the dimension mark included, as with institute
State the rule of service request matching.
In the embodiment of the present application, because the regular quantity preserved in the rule set of the regulation engine can be very
It is many, so after regulation engine traversal should press rule set, some rules undetermined may be can determine whether, and by
In for each rule undetermined, the rule undetermined is all that all dimensions comprising the service request are identified
, it is possible to think that the rule undetermined is matched with service request, i.e. service request can with it is many
Individual rule match undetermined.But, due to typically the corresponding industry of the service request can only be performed using a rule
Business, so now also needing to determine most accurate rule, and gives the service request by the rule match.
Then, in this application after each rule undetermined is determined, in addition it is also necessary to further determine that each rule undetermined
Middle precision highest rule undetermined, and precision highest rule undetermined is matched as with the service request
Rule.Think in this application:For each rule, if the dimension mark that the rule is included is more,
Illustrate that the limitation that the rule is used is more, then can determine that the regular precision is higher.Then, it is
Can be by the service request and the high rule match of precision, therefore in this application, by each rule undetermined
Most rules undetermined are identified comprising dimension, as precision highest rule undetermined in each rule undetermined, with this
Service request is matched.
Specifically, the application provide it is a kind of determine that dimension mark is most regular method undetermined (that is, it is determined that
Precision highest regular method undetermined), first, the regulation engine is every for what is determined in step s 102
Individual rule undetermined, is identified according to the corresponding dimension of strictly all rules in the rule set, determines the rule correspondence undetermined
Vector.Wherein, each element in each regular vector undetermined is corresponding with strictly all rules in the rule set
Dimension mark is corresponded, also, for each element in each regular vector undetermined, if the element
Corresponding dimension mark corresponds to the rule undetermined, then the value of the element is set into 1 (that is, when in the rule
When being identified in the presence of the dimension, then determine that the value that the dimension identifies corresponding element is in the vector of the rule
1), if the corresponding dimension mark of the element is not corresponded to and the rule undetermined, the value of the element is set to 0
(that is, when dimension mark is not present in the rule, then determine that the dimension is identified in the vector of the rule
0) value of corresponding element is.By the above method, the regulation engine just can determine that in each regular vector
The value of each element, has also determined that each regular vectorial value undetermined.
Secondly, the element of correspondence position enters in the vector that the regulation engine will can be determined for each rule undetermined
Row logic or computing, it is determined that final vector, i.e. by comprising all regular all dimensions marks undetermined to
Amount, is used as final vector.
Finally, rule undetermined corresponding with the final vector can be defined as corresponding dimension by the regulation engine
The most rule undetermined of mark and will it is corresponding with the final vector it is undetermined it is regular as with the service request
The rule matched somebody with somebody.
Continue to use the example above, regulation engine A can determine the rule set according to the rule set in table 2 first
The corresponding dimension of middle strictly all rules is designated:1st, 2,3,4,5, then, for each rule undetermined,
The regulation engine can determine the regular vector undetermined.Specifically, for Rule3, because this waits to establish rules
The dimension included in then is designated 1,3,5, it is possible to which the vector for determining Rule3 is (1,0,1,0,1), i.e.
For first element in Rule3 vector, because the corresponding dimension of the element is designated 1, and Rule3
In comprising the dimension mark, so the value of first element is set into 1.Similarly, it may be determined that Rule3
Second element, third element, fourth element, the value of The Fifth Element in vector are respectively 0,1,0,1.
Rule4 is then directed to, the vector that can similarly determine Rule4 is (1,0,1,1,1).
Further, regulation engine A can for the Rule3 and the Rule4 vector (1,0,1,0,1) determined and
The element of correspondence position in (1,0,1,1,1) carries out logic or computing, i.e. the first element in Rule3 vector
The second element in logic or computing, Rule3 vector is carried out with first element in Rule4 vector
Logical operation ... etc. is carried out with second element in Rule4 vector, then regulation engine A can
Using determine final vector asWherein | | represent correspondence
The element of position carries out logic or computing.
Finally, due to which Rule4 vector is consistent with the final vector, so regulation engine A can be determined
Rule4 is that corresponding dimension identifies most rules undetermined, and using Rule4 as with service request α
The rule matched somebody with somebody.
Pass through rule matching method as shown in Figure 1, it is seen then that receiving service request in the regulation engine
During the rule of matching, it is no longer necessary to priority setting is carried out to rule, it need to only be carried according to the service request
All dimensions mark determine after each rule undetermined, identified further according to each regular corresponding dimension undetermined, it is determined that
Comprising the most rules undetermined of dimension mark, be used as the rule matched with the service request.So that passing through this
The described method of application, can be without carrying out priority level initializing to each rule in the rule set, it is to avoid people
The error for the matching precision that work setting priority is brought, can match the higher rule of precision for the service request
Then, the operational efficiency of regulation engine is improved, matching precision is improved.
Certainly, except above by each regular vector undetermined, it is determined that final vector, and most at last with this most
The corresponding rule undetermined of vector, is defined as beyond the most regular method undetermined of corresponding dimension mark eventually,
Other method can also be used to determine precision highest rule undetermined in each rule undetermined in this application, as long as
The most rule undetermined of dimension mark can be found, just within the protection domain of the application.
In addition, in step s 103, after the regulation engine determines final vector, due to there may be not
Have regular situation undetermined corresponding with the final vector, so in this application, when not with this it is final to
Measure Ying Yu it is undetermined regular when, the number of dimension that the regulation engine can also be included according to each rule undetermined mark
Amount, determines each the first regular weighted value undetermined, and the undetermined rule maximum by the first weighted value is determined, makees
For the rule matched with the service request.Wherein, think in this application:For each rule, the rule
Comprising dimension mark quantity it is more, then the first weighted value of the rule is bigger.Specifically, the rule is drawn
The quantity for the dimension mark that directly can be included each rule undetermined is held up, each the first regular weight undetermined is used as
Value.
For example, it is assumed that for service request β, regulation engine determines 3 rules undetermined:Rule7、
Rule8, Rule9, and this 3 rules undetermined include dimension mark be respectively:1st, 3,5,6 and 1,
4th, 6 and 1,3,6, then Rule7, Rule8, Rule9 vector be respectively (1,0,1,0,1,1,0,0,0),
(1,0,0,1,0,1,0,0,0), (1,0,1,0,0,1,0,0,0), and assume that the final vector determined is (1,0,1,0,1,1,0,0,1), so
Rule7, Rule8, Rule9 not with the final vectorial corresponding rule, then the regulation engine can determine that Rule7,
Rule8, Rule9 dimension mark quantity be respectively:4th, 3,3, and the regulation engine can also be true
The first weighted value for determining Rule7, Rule8, Rule9 is respectively:4、3、3.Then, the regulation engine is most
It can determine that Rule7 the first weighted value is maximum eventually, i.e. determine that Rule7 precision is higher, and by Rule7
It is used as the rule matched with service request β.
Further, due to based on above-mentioned situation, so being deposited there is also the maximum rule undetermined of the first weighted value
In more than two situations.Then now, the data message corresponding to each dimension is identified equally exists important
Property difference (it is exactly a relatively unessential data letter that e.g., user id, which is compared to for account amount of money,
Breath), it is possible to corresponding second weighted value is determined for each dimension mark, to represent that the dimension is identified
The significance level of corresponding data information, then in this application, the second weighted value that can be identified according to each dimension,
It is determined that the rule finally matched with the service request.
Specifically, in this application, should when the maximum rule undetermined of the first weighted value has two or more
Regulation engine can also be for the maximum rule undetermined of each first weighted value, according to each dimension pre-saved
Second weighted value of mark, determine all dimensions that the rule undetermined includes identify corresponding second weighted value it
With, as the 3rd regular weighted value undetermined, finally in the maximum each rule undetermined of the first weighted value,
The maximum rule undetermined of 3rd weighted value is defined as the most rule undetermined of corresponding dimension mark.
Continue to use the example above, it is assumed that for service request β, the regulation engine further defines Rule10, also,
The dimension that Rule10 is included is designated 1,3,4,6, and the vector of the Rule10 is (1,0,1,1,0,1,0,0,0), can
See, Rule10 and Rule7 the first weighted value are all 4, so now the regulation engine can also be according to Rule10
Second weighted value sum of all dimensions mark included with Rule7, determines the 3rd of Rule10 and Rule7
Weighted value, it is further assumed that the weight of each dimension mark is as shown in table 3.
Dimension is identified |
Second weight |
1 |
10 |
2 |
20 |
3 |
30 |
4 |
30 |
5 |
40 |
6 |
60 |
7 |
10 |
8 |
50 |
9 |
90 |
Table 3
It can be seen that, the second weighted value sum of all dimensions mark that Rule10 and Rule7 is included is respectively:130
With 140.Then the regulation engine can determine that Rule7 the 3rd weighted value is maximum, and using Rule7 as
The rule matched with service request β.
Further, by dimension identifies all dimensions mark that the maximum rule undetermined of quantity is included
Weighted value sum, it is not necessarily maximum in each rule undetermined, so in this application, when not with
When the final vector is corresponding undetermined regular, i.e. the most rule undetermined of the dimension mark that includes has two
During the above, the regulation engine can yet determine the institute included in the rule undetermined first for each rule undetermined
There is the second weighted value sum that dimension is identified, as the 3rd regular weighted value undetermined, then by the 3rd weight
The rule that the maximum rule undetermined of value is matched as the service request, without considering further that each regular dimension undetermined
The quantity that scale is known, i.e. the not only maximum rule undetermined of the weighted value of consideration rate first, but for each
Rule undetermined determine each the 3rd regular weight undetermined it.
Based on the rule match process shown in Fig. 1, the embodiment of the present application also provides a kind of rule match device,
As shown in Figure 2.
Fig. 2 is that the embodiment of the present application provides a kind of structural representation of rule match device, is specifically included:
Receiving module 201, for receiving service request, wherein, carried in the service request and some wait to locate
Manage the corresponding dimension mark of data message;
Module 202 is investigated, for according to the rule set pre-saved, it is determined that being carried comprising the service request
All dimensions mark some rules, be used as rule undetermined;
Matching module 203, in each rule undetermined, it is determined that the dimension mark included it is most wait establish rules
Then, as the rule matched with the service request.
The matching module 203 according in the rule set specifically for for each rule undetermined, owning
The corresponding dimension mark of rule, determines the regular corresponding vector undetermined, wherein, it is each in the vector
Element dimension mark corresponding with strictly all rules in the rule set is corresponded, for each element, if
The corresponding dimension mark of the element corresponds to the rule undetermined, then the value of the element is set into 1, if this yuan
The corresponding dimension mark of element is not corresponded to and the rule undetermined, then the value of the element is set into 0, will be for each
The element of correspondence position carries out logic or computing in the vector that rule undetermined is determined, it is determined that final vector, will be with
The corresponding rule undetermined of the final vector, is defined as the most rules undetermined of corresponding dimension mark.
First weight matching module 204, for when in the absence of it is corresponding undetermined regular with the final vector when,
For each rule undetermined, the number of elements that the value of element in the corresponding vector of the rule undetermined is 1 is determined,
As the first regular weighted value undetermined, in each rule undetermined, by the first weighted value it is maximum wait establish rules
Then it is defined as the most rule undetermined of corresponding dimension mark.
Second weight matching module 205, for there is two or more when the maximum rule undetermined of the first weighted value
When, it is corresponding according to each dimension mark pre-saved for the rule undetermined that each first weighted value is maximum
Second weighted value, determines that all dimensions that the rule undetermined is included identify corresponding second weighted value sum, makees
For the 3rd regular weighted value undetermined, in the maximum each rule undetermined of the first weighted value, by the 3rd weight
The maximum rule undetermined of value is defined as the most rule undetermined of corresponding dimension mark.
The second weight matching module 205 is additionally operable to, when comprising the most rules undetermined of dimension mark deposit
In two or more, for the rule undetermined that each first weighted value is maximum, according to each dimension pre-saved
Corresponding second weighted value is identified, determines that all dimensions that the rule undetermined is included identify corresponding second weight
It is worth sum, it is in each rule undetermined, the 3rd weighted value is maximum as the 3rd regular weighted value undetermined
Rule undetermined, be used as the rule matched with the service request.
Specifically, above-mentioned rule match device as shown in Figure 2 can be located in server, specifically can position
In the regulation engine of server, the server can be a single equipment or multiple devices
The system of composition.
In a typical configuration, computing device includes one or more processors (CPU), input/defeated
Outgoing interface, network interface and internal memory.
Internal memory potentially includes the volatile memory in computer-readable medium, random access memory
And/or the form, such as read-only storage (ROM) or flash memory (flash RAM) such as Nonvolatile memory (RAM).
Internal memory is the example of computer-readable medium.
Computer-readable medium includes permanent and non-permanent, removable and non-removable media can be by appointing
What method or technique realizes that information is stored.Information can be computer-readable instruction, data structure, program
Module or other data.The example of the storage medium of computer includes, but are not limited to phase transition internal memory
(PRAM), static RAM (SRAM), dynamic random access memory (DRAM), its
Random access memory (RAM), read-only storage (ROM), the electrically erasable of his type are read-only
Memory (EEPROM), fast flash memory bank or other memory techniques, read-only optical disc read-only storage
(CD-ROM), digital versatile disc (DVD) or other optical storages, magnetic cassette tape, tape magnetic
Disk storage or other magnetic storage apparatus or any other non-transmission medium, can be calculated available for storage
The information that equipment is accessed.Defined according to herein, computer-readable medium does not include temporary computer-readable matchmaker
The data-signal and carrier wave of body (transitory media), such as modulation.
It should also be noted that, term " comprising ", "comprising" or its any other variant are intended to non-row
His property is included, so that process, method, commodity or equipment including a series of key elements not only include
Those key elements, but also other key elements including being not expressly set out, or also include for this process,
Method, commodity or the intrinsic key element of equipment.In the absence of more restrictions, by sentence " including
One ... " key element that limits, it is not excluded that in the process including the key element, method, commodity or set
Also there is other identical element in standby.
It will be understood by those skilled in the art that embodiments herein can be provided as method, system or computer journey
Sequence product.Therefore, the application can using complete hardware embodiment, complete software embodiment or combine software and
The form of the embodiment of hardware aspect.Moreover, the application can be used wherein includes calculating one or more
Machine usable program code computer-usable storage medium (include but is not limited to magnetic disk storage, CD-ROM,
Optical memory etc.) on the form of computer program product implemented.
Embodiments herein is the foregoing is only, the application is not limited to.For this area skill
For art personnel, the application can have various modifications and variations.All institutes within spirit herein and principle
Any modification, equivalent substitution and improvements of work etc., should be included within the scope of claims hereof.