Specific implementation mode
In order to make those skilled in the art more fully understand the technical solution in this specification, below in conjunction with this explanation
Attached drawing in book embodiment is clearly and completely described the technical solution in this specification embodiment, it is clear that described
Embodiment be only a part of the embodiment in this specification, instead of all the embodiments.Base in this manual one
A or multiple embodiments, the every other reality that those of ordinary skill in the art are obtained without creative efforts
Example is applied, the range of this specification embodiment protection should be all belonged to.
In the processing logic of operation system, can usually there be the logic judgment rule of a large amount of similar if ... then ....
In general operation system, if such rule judges that seldom operating personnel can be write with hard code and extremely be done in this way
Logic judgment.But such logic is excessively inflexible, if change slightly occurs for logic, needs to change code logic
It moves and needs to issue again and reach the standard grade, this is very dumb for an operation system, and bad maintenance.
There are such a application scenarios in one example:The clearing form of changing section order is needed, this change point pair
Settlement of transactions influence is very big, needs gradually to cut stream to reduce risks.There are buyerId (buyer id), sellerId in order business
(seller id), tens fields of tkBizTag (order mark) ..., if using existing usual manner under the scene
As soon as multiple stream fields of cutting cut the scene of stream to limit using section hard coded and do, very dumb, simple this cuts stream will
Upper multiple line.If cutting the increase and decrease of stream field or change, may influence to run on the line of entire order account settlement business.
Therefore there is such technical need:Flexible and changeable stream mode is cut using a kind of, you can is supported to according to order pair
It carries out cutting stream when meeting certain condition as any one parameter, such as meet the requirements according to order type field, certain buyer id.Needle
To case above, a kind of general rules processing engine of this specification embodiment, can flexible executing rule matching primitives, and
Make it possible to support various diversified business rule matchings.The rule configuration of polymorphic type and changeable rule can be supported simultaneously
Then element.
Some supports and the place that Aviator carries out regulation adaptation may be used in some embodiments of this specification embodiment
Reason.
Aviator is an expression formula engine, he is equivalent to carries out precompile to an expression formula, then passes through interface again
The real parameter of transmission is called to enter, instead of the variable of expression formula, to be then back to the result of evaluation of expression formula.Aviator is propped up at present
Hold most of arithmetic operation symbol, including arithmetic operator, relational operator, logical operator, bit arithmetic symbol, canonical matching operation
Symbol (=~), ternary expressions (:), and support the priority and bracket force priority grade of operator, it might even be possible to it is self-defined
Function, so, Aviator can cover all type expression substantially in rule compiling.
Aviator is realized based on java.In one example, if realizing an a+b with java>The calculating of c, that is just
A function is write, it is a, b, c to enter ginseng, then makes a decision whether a+b is more than c inside function.For example function is as follows:
public boolean compare(int a,int b,int c){
return a+b>c
}
Then call function compare (100,200,150) judges 100+200>Whether 150 is true.
However, if not being at this time judgement 100,200,150, but 1.5,2.5,3.5 that will write a java letter again
It is several classes of seemingly as follows:
public boolean compare(double a,double b,double c){
return a+b>c
}
The realization approach of Aviator and the evaluator of other lightweights are quite different, other evaluators are typically all to pass through
The mode of explanation is run, and Aviator is then to give JVMJava Virtual directly by Expression Compiling at Java bytecode
Machine (Java Virtual Machine) goes to execute.Avaitor can mask these parameter type information, for example a+b>C both can be with
For mathematical expression, character string comparison can be used for.
Meanwhile if not with Aviator, that then needs to write different expression formulas and judges for different expression formulas
Function.
In brief, Aviator is an expression formula engine, and Aviator tables are used in some embodiments of this specification
Up to causing, the logic of expression formula judgement can be encapsulated, many kinds of parameters type and various expression formula can be adapted to.Certainly, it needs
It is noted that being not precluded in some other embodiments for this specification can also use other expression formula engines or design
Language comes the compiling of implementation rule, adaptation etc., such as Ognl, MVEL, JSEL, Fel.
This specification embodiment is illustrated for the application scenarios specifically supported below by Aviator by one.
Specifically, a kind of matched processing engine of business rule that Fig. 1, which is this specification, to be provided (or abbreviation general rule engine)
The system structure diagram of embodiment.Although present description provides such as following embodiments or method operating procedures shown in the drawings
Or device, system structure, but in the method or device or system can wrap based on routine or without performing creative labour
Include less operating procedure or modular unit after more or part merges.There is no necessary causal steps in logicality
In rapid or structure, the execution sequence of these steps or the modular structure of device are not limited to this specification embodiment or shown in the drawings
Execution sequence or modular structure.Device in practice, server or the end product application of the method or modular structure
When, it method or modular structure carry out sequence execution shown in the drawings or parallel can either be executed (such as simultaneously according to embodiment
The environment of row processor or multiple threads, the even implementation environment including distributed treatment, server cluster).
As shown in Fig. 1 system architectures, this embodiment scheme can be for all different business modules, by a rule
The heart is supported, and regular center can include various processor.Processor herein can refer to the processor of a certain typing rule,
Including the Logical processing unit for Different Rule type logically divided, general processor generally can be used, but also may be used
By the processor of service definition concrete type.Certainly, this specification embodiment is not excluded for for different type rule using different
Entity hardware on processor handle respectively, may include specifically the rule match that processor handles a type,
Or a processor cluster carries out adaptation processing.In one embodiment, the processor may be configured to a logic
The business rule adaptation processing of one type of processor response for single typing rule of upper division uses a processing
Device responds the business rule adaptation processing of a type.The rule match processor of one type can carry out the parameter of input
Rule match, and return to matched logic rules and corresponding operation logic.
For all types of rules, different types of rule can be all stored in a tables of data by general rule engine
In.And type, operator and connector are few and relatively fixed due to quantity, it is possible to be configured to support storage text
Part.Certainly specific storage mode can be self-defined.Wherein type refers to rule type, general universal class, but right
In some fixed business rules, it may be defined to specific type and system facilitated to realize use.The general rule is at one
In example, Map when such as can be input<String,Object>, output is Map<String,String>, this general rule
There is no specific class to define, be exactly a map object, particular content can be designed in inside object internal logic, processor
The either special business operation of special class processing can not be done.
In a little embodiments of one of this specification, a processor can correspond to a rule-like.For example, a model draws
It holds up, can have shunting rule, the input for shunting rule is model based coding, user id, and output is model version.Such as model
A is encoded, if user's id tail numbers are 9, uses the model of version 1.
And a for example question and answer engine, it can have model carry regular.The input of model carry rule is question and answer field
Scape, output are model based coding lists.Such as question and answer scene a, then allows while using 3 Question-Answering Models of A, B, C.
The general rule engine that this specification provides can perceive the business needs of current type when operation code is realized
What kind of rule, it may not be necessary to perceive what typing rule is other business have.For example, it is responsible for model shunting, then
The rule of sensor model shunting class can be only needed, but can need not go the rule of perception Question-Answering Model carry class.
When actually executing, processor can be led the strictly all rules of corresponding classification into memory in initialization, and to every
The execution condition of one rule is compiled and is cached.The business rule of each type can be considered as a business rule
Set, which includes multiple Different treatments for different business parameter.In this way, each business can individually unite
One sends rule match request to a general rule engine, and general rule engine can be looked for according to the type of service of business module
To corresponding, the processor of goal rule type, then according to incoming industry in the business rule set of the processor cache
Parameter of being engaged in searches the business rule of adaptation.If found, logic rules and/or corresponding operation logic can be returned.
System structure of this specification based on above-mentioned general rule engine is realized, a kind of matched place of business rule is also provided
Reason method.Specifically, Fig. 2 is a kind of method flow schematic diagram of embodiment of the method that this specification provides, specifically may be used
To include:
S0:Rule match request is received, the rule match request includes service parameter and type of service;
S2:Determine that the goal rule type for corresponding to regular center, the rule center include according to the type of service
The business rule set for the Different Rule type for compiling and caching in advance;
S4:The business rule of adaptation are searched in the business rule set of the goal rule type according to the service parameter
Then;
S6:Return to the execution logic of the business rule of the adaptation found.
The rule match request may include the solicited message that business side is sent, and the business side can be according to reality
Border application scenarios are determined and divide, such as different business modules or different user access sides etc..The rule match
May include that (or business side asks for type of service belonging to the incoming service parameter in business side and the business side in request
Seek matched type of service).
The scheme of the method and general rule engine that this specification embodiment provides can be realized, different type
Rule all returns 11% unified model, can be avoided for different type, safeguards the trouble of different data.More support
Flexible alteration ruler logic, rule are related to variable and the corresponding execution logic of rule, can accomplish real time modifying and reality
Shi Shengxiao, the publication again for avoiding system are reached the standard grade.Rule match logical abstraction, operation system can only can be needed simultaneously
It is concerned about input and output, it may not be necessary to understand adaptation procedure, hard-coded logic can be avoided well in this way, it is flexible to support
Business rule matches and executes subsequent operation.
The application of the realization and method of this specification general rule engine is specifically described using example with one below.
All expression formula Rule Informations can be all placed on a table to safeguard and update by this programme.
Rule:About the rule mentioned in this specification embodiment, this example is situated between only for constant value comparison rule
It continues, such as A>150 or A>150&&B<100||A in(1,3,5,7,9).In these rules, each rule can split into multiple
Subexpression, such as:
A>150 can split into subexpression A>150;
A>150&&B<100 | | A in (1,3,5,7,9) can split into subexpression A>150、B<100、A in(1,3,5,
7,9)。
If be attached using symbol there are multiple subexpressions in an expression formula, between them, it is referred to as herein
For connector.
And in subexpression above, it can be there are one variate-value, a constant value, such as A>150, variate-value A, constant
Value is 150, or such as A in (1,3,5,7,9), variate-value A, and constant value is (1,3,5,7,9).Each variate-value with often
Between magnitude, also there are symbol connection, referred to herein as operator.
Only it is to lift a more intelligible field it should be noted that being introduced by constant value comparison rule in this example
Most scenes of scape and business scenario carry out the innovation introduction of this specification example scheme.Similar union variable
Constant value compares, such as A+B>150, it can also be realized on general rule engine, only be to need to make necessity on system is realized
Upgrading, compared with this example only be realize on difference.So this specification is not to going out constant value comparison rule
Other regular such as executable expressions, ternary operator, array manipulation, position budgets in addition, canonical matching are introduced, ability
Field technique personnel illustrate that the content introduction of example scheme may not need being extended of creative work, combination, change based on this
Shape and conversion process.
Operator:Operator is used for variate-value and constant value in concatenate rule, analogy rule A>150, operator is more than
Number (>) then it is connected to variables A and constant 150.The operator of general rule engine divides two types, one kind to be simple types, packet
Contain:=,!=, >=,≤,>、<, another kind of is discrete operations symbol, including:IN, NOTIN.This two generic operation symbol can be covered substantially
All rules judge combination.
Connector:Connector can be used for connecting multiple subexpressions in a rule, and so that them is combined can
Express some rule.It suppose rule A>150&&B<100 | | A in (1,3,5,7,9), wherein Lian Jiefu && with | | be connected to sublist
Up to formula A>150、B<100 and A in (1,3,5,7,9).The connector that general rule engine uses in the present embodiment contains following
It is several:(、)、&&、||.
Regular expression:In regular expression, a rule can be expressed using json character strings.Usually at one
In regular json strings, including two elements, are formulaFactors and formulaFormat, formulaFactors respectively
It is a json array, indicates subexpression, formulaFormat then expression formats, with connector and placeholder
To express.Each subexpression is a json string again, wherein can comprising 4 elements, factorCode, factorType,
FactorValue, operatorCode indicate respectively variable in character string, types of variables (java types), constant value and
Operator.It gives one example and is described as follows:
{
"formulaFactors":[
{"factorCode":"type",factorType":"STRING","factorValue":"STANDARD","
operatorCode":"=" },
{"factorCode":"tag_id_list","factorType":"STRING","factorValue":"
[253,232,290]","operatorCode":"IN"},
{"factorCode":"tag_id_list","factorType":"STRING","factorValue":"
[227,184]","operatorCode":"NOTIN"},
{"factorCode":"type","factorType":"STRING","factorValue":"
KBASECORE","operatorCode":"=" },
{"factorCode":"cat_id","factorType":"STRING","factorValue":"[213487,
0]","operatorCode":"NOTIN"}
],
"formulaFormat":[" (", " %s ", " && ", " %s ", " && ", " %s ", ") ", " | | ", " (", " % ", "
s",")"]
In above-mentioned formulaFormat, each placeholder %s indicates a son expression in formulaFactors
Formula indicates in order.So if json character strings above are translated into an expression formula, expression formula is as follows:
(type=STANDARD&&tag_id_list IN [253,232,290] &&tag_id_list NOTIN [227,
184]) | | (type=KBASECORE&&cat_id NOTIN [213487,0]).
Rule type:In general rule engine, universal class and customization type, universal class are supported.Such as it can
Directly to use Map<String,Object>Do the input and output of engine, and self-defined type of service then can rule input
Output is tied to some customized business object up.
Rule list:
The realization purpose of general rule engine, in addition to that in order to support various rule adaptation, can also support to return to adaptation
Operating Guideline afterwards.This can apply and be attached to the handling result return that operation system does rule judgement.The present embodiment is logical
With in regulation engine, the information of rule list storage can be as follows shown in table 1:
Table 1
Trigger condition |
Execute logic |
Rule type |
Wherein, rule type expresses the specific object returned in processing after current rule, and trigger condition with hold
Row logic is all expressed with regular expression, indicates the respective logic to be executed after judgment rule and adaptation respectively.Such as one
It is a robot and the associated configuration rule of algorithm model as follows, wherein trigger condition is as follows in a example:
Above rule express, if model code be MODE00000001 and robot code be ALIR00003082 or
Person ALIR00003078, then model version use 20170306151518_90.Therefore, in some embodiments of this specification, institute
It may include the trigger condition compiled in advance and corresponding execution logic to state the business rule in business rule set;
Correspondingly, the business rule of the adaptation includes corresponding to the trigger condition of incoming service parameter satisfaction
Business rule.
Processor:Processor can be used for safeguarding compiling, adaptation and the return processing logic of a rule-like.Unless there are spy
Different to require, otherwise this illustrates that the internal logic of the processor in some embodiments is the same, and difference is only for tieing up
Different classes of rule is protected, to convenient when certain rule-like changes, only corresponding processor is compiled again into line discipline
It translates.Therefore, in some embodiments of this specification, different rule types may be used and use different processor response business
The adaptation processing mode of rule, the processor includes the logical process list for Different Rule type divided in logic
Member.Certainly, it is all handled using a processor or processor cluster using for example all types of rules of other modes
This specification scheme may be implemented, this specification is not excluded for carrying out using powerful processor while for multiple types
Rule carries out the mode of matching treatment.
Processor can be led the strictly all rules of corresponding classification into memory, and held to each rule in initialization
Row condition is compiled and is cached.Such as in one embodiment, the difference that the rule center compiles and caches in advance is advised
Then the business rule set of type may include:
The business rule of corresponding types is imported into memory when the processor initializes, it can be to described using Aviator
The trigger condition for the JSON string formats that business rule uses is compiled and is cached.
If it is desired that Aviator can be compiled the trigger condition json strings of storage in this implementation, processor may be used also
To be translated to json strings, the intelligible expression formulas of Aviator are translated into.It, can be by corresponding compiling byte after compiled
Code, and be stored in together in a compiler object with the execution logic under rule.It, can after processor is completed to initialize
To obtain a compiler list, each compiler in list contains there are one trigger condition compiling bytecode and corresponding holds
Row logic.The processor of such a rule type can according to the service parameter the goal rule type business advise
The compiler of adaptation is searched in then gathering.
Therefore, in another embodiment of the method that this specification provides, the rule center includes compiling in advance
And the business rule set of the Different Rule type cached may include:
S20:The trigger condition is compiled using Aviator;
S22:Respectively will it is compiled after the corresponding compiling bytecode of trigger condition and trigger condition is corresponding belongs to same
Execution logic under a rule is stored in a compiler object, obtains compiler list;
Correspondingly, described search adaptation according to the service parameter in the business rule set of the goal rule type
Business rule include the volume for searching adaptation in the business rule set of the goal rule type according to the service parameter
Translate device.
In other embodiments, if the only rule of a universal class, the input and output of the input of processor
It is a Map object, variable parameter and corresponding processing logic parameter can be placed in Map.For some fixed business
Type, this specification embodiment can be entering ginseng and go out ginseng all to make a Java object into and obtain then by Java reflex mechanisms
All parameter values for entering ginseng are taken, Map objects is then changed into and is adapted to Aviator, while can also be reflected by Java
The processing logical message of output is all filled out in Java object and is exported by mechanism.Here the attribute name in requirement object is only needed
And type will in regular expression variable name and type be consistent and above-mentioned steps can be completed.
Regular center:Regular center can be responsible for interacting with each business module.Business module is according to needed for oneself
The rule type wanted is passed to rule match request.Rule match request may include incoming service parameter (entering ginseng), also may be used
To include the type of service of business module (or other business sides).Regular center can find suitable processing according to specific type
Device simultaneously allows processor to execute real logic.When it is implemented, this specification embodiment is not limited in the rule match request
Certain field information for including type of service may include the rule type of request in itself in rule match request, should
The rule type of request is usually corresponding with type of service (the including scene type) that business side is current, therefore this specification embodiment
Middle rule match request contains the embodiment of the rule type of request, and regular center can directly determine executing rule at this time
The processor (goal rule type) of adaptation.Message source marking, timestamp etc. of other modes such as rule match request can be with
The information of characterization business side identity or type can be understood as containing industry in the request of the rule match described in the present embodiment
Service type.
A kind of embodiment that this specification provides can be applied to the general rule including one or more servers and draw
In the system architecture held up.The system may include single computer unit, can also include the clothes of multiple servers composition
The server architecture of business device cluster or distributed system.In general rule engine, regular center on startup, can be
All rules are all loaded into memory, and allow different processors that they are all carried out precompile.Then business is being transported
When row, regular center can be asked to carry out rule match, and incoming current business parameter according to their needs.Regular center can
According to type of service, to select corresponding processor, current business information is then passed into processor, processor oneself
The rule of adaptation is found in rule base, then up returns to rule.Fig. 3 is the rule at the regular center that this specification provides
In regular center, it is (i.e. above-mentioned to divide in logic to have multiple rule processors in such as Fig. 3 for matched design structural schematic diagram
Processor), different types of rule, inside different processors.And compiler can be changed into advance per rule.Compiler
In have the trigger condition of corresponding specific business rule and execute logic, trigger condition can be compiled into bytecode.One compiling
Device includes compiled trigger condition and corresponding execution logic.One of purposes of compiler is, does condition coupling, matching
It is upper, then the corresponding logic that executes of this compiler is exported as his result.Execution logic in business rule, does not need
It is compiled, service logic can be done later in condition coupling by executing logic.
For example a robot platform has robot scene shunting rule, model of place carry rule, model shunting
Rule, robot turn various business rule information such as artificial rule.These information can be loaded into memory when system starts,
Then different types of business rule executes compiling and adaptation by different processor.
When a robot scene initializes, it is necessary to which whether judgment models will execute shunting.It can ask at this time
Regular center returns to diffluent information, and informs the current scene information in regular center (incoming service parameter), including scene,
The current business informations such as time, user.Then regular center can give this adaptation to machine according to the scene classification rule of request
Device people's scene shunts rule processor to be adapted to, which can look for whether the information of adaptation based on current rule, such as
Fruit has, then returns to the specific rules information of scene shunting.
The business rule of each type at the regular center of spy described in one or more embodiments of this specification, rule
Offline structure in advance, design may be used in then table.This specification be not excluded for the regular center, rule list using online structure/
The mode of update/maintenance can construct regular center or rule list online in the case where computer capacity is enough, can be with
Online use is synchronized, allows general rule engine that can accomplish real time modifying and come into force in real time.
Each embodiment of the above method is described in a progressive manner in this specification, identical between each embodiment
Just to refer each other for similar part, and each embodiment focuses on the differences from other embodiments.Correlation
Place illustrates referring to the part of embodiment of the method.
The embodiment of the method that the embodiment of the present application is provided can be in mobile terminal, terminal, server or class
As execute in arithmetic unit.For running on the server, Fig. 4 is at a kind of business rule matching of the embodiment of the present invention
The hardware block diagram of the server of reason.As shown in figure 4, server 10 may include one or more (only showing one in figure)
(processor 102 can include but is not limited to the processing dress of Micro-processor MCV or programmable logic device FPGA etc. to processor 102
Set), memory 104 for storing data and the transmission module 106 for communication function.Those of ordinary skill in the art
It is appreciated that structure shown in Fig. 4 is only to illustrate, the structure of above-mentioned electronic device is not caused to limit.For example, server
10 may also include more than shown in Fig. 4 or less component, such as can also include other processing hardware, such as relationship type
Or non-relational stack room, or with the configuration different from shown in Fig. 4.
Memory 104 can be used for storing the software program and module of application software, such as the search in the embodiment of the present invention
Corresponding program instruction/the module of method, processor 102 are stored in software program and module in memory 104 by operation,
To perform various functions application and data processing, that is, realize the processing method of above-mentioned navigation interactive interface content displaying.It deposits
Reservoir 104 may include high speed random access memory, may also include nonvolatile memory, as one or more magnetic storage fills
It sets, flash memory or other non-volatile solid state memories.In some instances, memory 104 can further comprise relative to place
The remotely located memory of device 102 is managed, these remote memories can pass through network connection to terminal 10.Above-mentioned network
Example include but not limited to internet, intranet, LAN, mobile radio communication and combinations thereof.
Transmission module 106 is used to receive via a network or transmission data.Above-mentioned network specific example may include
The wireless network that the communication providers of terminal 10 provide.In an example, transmission module 106 includes that a network is suitable
Orchestration (Network Interface Controller, NIC), can be connected with other network equipments by base station so as to
Internet is communicated.In an example, transmission module 106 can be radio frequency (Radio Frequency, RF) module,
For wirelessly being communicated with internet.
Based on the matched processing method of a kind of business rule described in above-mentioned each embodiment, this specification also provides one kind
The matched processing unit of business rule.The device may include the system for having used this specification embodiment the method
(including distributed system), software (application), module, component, server, client etc. simultaneously combine setting for necessary implementation hardware
Standby device.Based on same innovation thinking, the processing unit such as the following examples institute in a kind of embodiment that this specification provides
It states.Since the implementation that device solves the problems, such as is similar to method, the reality of the specific processing unit of this specification embodiment
The implementation that may refer to preceding method is applied, overlaps will not be repeated.Although device described in following embodiment preferably with
Software is realized, but the realization of the combination of hardware or software and hardware is also that may and be contemplated.Specifically, such as Fig. 5
Shown, Fig. 5 is the matched processing unit embodiment of a kind of business rule that can be used for server-side that this specification provides
Modular structure schematic diagram, may include specifically:
Regular center module 101 can be used for receiving rule match request, and the rule match request includes service parameter
And type of service;It is additionally operable to determine the goal rule type for corresponding to regular center according to the type of service;In the rule
Feel the business rule set for the Different Rule type that storage is compiled and cached in advance;
Classification adaptation module 102, can be used for triggering the corresponding processor of the goal rule type and is advised in the target
The business rule of adaptation is then searched in the corresponding business rule set of type;
Rule returns to module 103, can be used for returning the execution logic of the business rule of the adaptation found.
Certainly, the processor can may include separated on entity hardware such as the aforementioned rule processor
Processor can also include the processing unit divided in logic, and the rule processor of one type of processing can be a hardware
Processor can also be that multiple hardware processors are realized jointly.
The matched processing method of business rule that this specification embodiment provides can be executed by processor in a computer
Corresponding program instruction realizes, such as using the c++ language of windows operating systems the ends PC realize or other for example
The necessary hardware realization of the corresponding application design language set of Linux, android, iOS system, or it is based on quantum calculation
Processing logic realization of machine etc..Specifically, the matched processing equipment of business rule that this specification provides realizes the above method
In embodiment, the processing equipment may include processor and the memory for storing processor-executable instruction, described
Processor is realized when executing described instruction:
Rule match request is received, the rule match request includes service parameter and type of service;
The goal rule type for corresponding to regular center is determined according to the type of service, the rule center includes advance
The business rule set of Different Rule type for compiling and caching;
The business rule of adaptation is searched in the business rule set of the goal rule type according to the service parameter;
Return to the execution logic of the business rule of the adaptation found.
In another embodiment of the processing equipment, the business rule in the business rule set includes compiling in advance
Trigger condition and corresponding execution logic;
Correspondingly, the business rule of the adaptation includes corresponding to the trigger condition of incoming service parameter satisfaction
Business rule.
Fig. 6 is one embodiment structural schematic diagram for the business rule matching treatment equipment that this specification provides.
In another embodiment of the processing equipment, the rule center includes the Different Rule for compiling and caching in advance
The business rule set of type includes:
The trigger condition is compiled using Aviator;
Respectively will it is compiled after the corresponding compiling bytecode of trigger condition and trigger condition is corresponding belongs to the same rule
Execution logic under then is stored in a compiler object, obtains compiler list;
Correspondingly, described search adaptation according to the service parameter in the business rule set of the goal rule type
Business rule include the volume for searching adaptation in the business rule set of the goal rule type according to the service parameter
Translate device.
In another embodiment of the processing equipment, different processor response industry is used using different rule types
The adaptation processing mode for rule of being engaged in, the processor includes the logical process list for Different Rule type divided in logic
Member.
In another embodiment of the processing equipment, it is adapted to using the business rule of one type of a processor response
Processing.
In another embodiment of the processing equipment, the rule center Different Rule type that compiles and cache in advance
Business rule set include:
The business rule of corresponding types is imported into memory when the processor initializes, it can be to described using Aviator
The trigger condition for the JSON string formats that business rule uses is compiled and is cached.
The program instruction of above-mentioned realization processing equipment can be stored in a variety of computer readable storage mediums.The calculating
Machine readable storage medium storing program for executing may include the physical unit for storing information, can by after information digitalization again with using electricity, magnetic
Or the media of the modes such as optics are stored.Computer readable storage medium described in the present embodiment, which has, may include:It utilizes
Electric energy mode stores the device of information such as, various memory, such as RAM, ROM;The device of information is stored in the way of magnetic energy such as,
Hard disk, floppy disk, tape, core memory, magnetic bubble memory, USB flash disk;Using optical mode store information device such as, CD or
DVD.Certainly, also readable storage medium storing program for executing of other modes, such as quantum memory, graphene memory etc..This specification
Involved in the instruction in device or server or client or system ibid describe.
The embodiment for the processing equipment that this specification provides, can provide a kind of general rules processing engine, can
Flexible executing rule matching primitives, while supporting the rule configuration of polymorphic type and changeable rale element.It can be with inhomogeneity
Type rule all returns 11% unified model, greatly reduces for different type, safeguards the complexity of different data, significantly
It improves business rule matching and safeguards effect.Support flexible alteration ruler logic, rule is related to variable and rule is corresponding holds
Row logic can accomplish real time modifying and come into force in real time that the publication again for avoiding system is reached the standard grade.Rule match is patrolled simultaneously
Abstract is collected, operation system can only need to be concerned about input and output, it may not be necessary to understand adaptation procedure, this can keep away well
Exempt from hard-coded logic, it is flexible to support business rule matching and execute subsequent operation, greatly improve business rule matching efficiency.
It should be noted that this specification embodiment device described above, processing equipment, according to related method embodiment
Description can also include other embodiments.Concrete implementation mode is referred to the description of embodiment of the method, herein not
It repeats one by one.
Each embodiment in this specification is described in a progressive manner, identical similar portion between each embodiment
Point just to refer each other, and each embodiment focuses on the differences from other embodiments.Especially for hardware+
For program class embodiment, since it is substantially similar to the method embodiment, so description is fairly simple, related place is referring to side
The part of method embodiment illustrates.
It is above-mentioned that this specification specific embodiment is described.Other embodiments are in the scope of the appended claims
It is interior.In some cases, the action recorded in detail in the claims or step can be come according to different from the sequence in embodiment
It executes and desired result still may be implemented.In addition, the process described in the accompanying drawings not necessarily require show it is specific suitable
Sequence or consecutive order could realize desired result.In some embodiments, multitasking and parallel processing be also can
With or it may be advantageous.
Although this application provides the method operating procedure as described in embodiment or flow chart, based on conventional or noninvasive
The labour for the property made may include more or less operating procedure.The step of being enumerated in embodiment sequence is only numerous steps
A kind of mode in execution sequence does not represent and unique executes sequence.It, can when device or client production in practice executes
With according to embodiment, either method shown in the drawings sequence is executed or parallel executed (such as at parallel processor or multithreading
The environment of reason).
Although mentioning the compiling of Aviator expression formula engines, regular tableau format class in this specification embodiment and content
The operations such as data acquisition, judgement, interaction, calculating, the judgement of type, general rule automotive engine system framework or the like and data description,
But this specification embodiment is not limited to meet industry communication standard, standard Aviator grammers, communication protocol
With situation described in normal data model/template or this specification embodiment.The right way of conduct is made in certain professional standards or use by oneself
In formula or the practice processes of embodiment description embodiment modified slightly can also realize above-described embodiment it is identical, it is equivalent or
The implementation result being anticipated that after close or deformation.Using these modifications or deformed data acquisition, storage, judgement, processing side
The embodiment of the acquisitions such as formula still may belong within the scope of the optional embodiment of this specification.
In the 1990s, the improvement of a technology can be distinguished clearly be on hardware improvement (for example,
Improvement to circuit structures such as diode, transistor, switches) or software on improvement (improvement for method flow).So
And with the development of technology, the improvement of current many method flows can be considered as directly improving for hardware circuit.
Designer nearly all obtains corresponding hardware circuit by the way that improved method flow to be programmed into hardware circuit.Cause
This, it cannot be said that the improvement of a method flow cannot be realized with hardware entities module.For example, programmable logic device
(Programmable Logic Device, PLD) (such as field programmable gate array (Field Programmable Gate
Array, FPGA)) it is exactly such a integrated circuit, logic function determines device programming by user.By designer
Voluntarily programming comes a digital display circuit " integrated " on a piece of PLD, designs and makes without asking chip maker
Dedicated IC chip.Moreover, nowadays, substitution manually makes IC chip, this programming is also used instead mostly " patrols
Volume compiler (logic compiler) " software realizes that software compiler used is similar when it writes with program development,
And the source code before compiling also write by handy specific programming language, this is referred to as hardware description language
(Hardware Description Language, HDL), and HDL is also not only a kind of, but there are many kind, such as ABEL
(Advanced Boolean Expression Language)、AHDL(Altera Hardware Description
Language)、Confluence、CUPL(Cornell University Programming Language)、HDCal、JHDL
(Java Hardware Description Language)、Lava、Lola、MyHDL、PALASM、RHDL(Ruby
Hardware Description Language) etc., VHDL (Very-High-Speed are most generally used at present
Integrated Circuit Hardware Description Language) and Verilog.Those skilled in the art also answer
This understands, it is only necessary to method flow slightly programming in logic and is programmed into integrated circuit with above-mentioned several hardware description languages,
The hardware circuit for realizing the logical method flow can be readily available.
Controller can be implemented in any suitable manner, for example, controller can take such as microprocessor or processing
The computer for the computer readable program code (such as software or firmware) that device and storage can be executed by (micro-) processor can
Read medium, logic gate, switch, application-specific integrated circuit (Application Specific Integrated Circuit,
ASIC), the form of programmable logic controller (PLC) and embedded microcontroller, the example of controller includes but not limited to following microcontroller
Device:ARC 625D, Atmel AT91SAM, Microchip PIC18F26K20 and Silicone Labs C8051F320, are deposited
Memory controller is also implemented as a part for the control logic of memory.It is also known in the art that in addition to
Pure computer readable program code mode is realized other than controller, can be made completely by the way that method and step is carried out programming in logic
Controller is obtained in the form of logic gate, switch, application-specific integrated circuit, programmable logic controller (PLC) and embedded microcontroller etc. to come in fact
Existing identical function.Therefore this controller is considered a kind of hardware component, and to including for realizing various in it
The device of function can also be considered as the structure in hardware component.Or even, it can will be regarded for realizing the device of various functions
For either the software module of implementation method can be the structure in hardware component again.
System, device, module or the unit that above-described embodiment illustrates can specifically realize by computer chip or entity,
Or it is realized by the product with certain function.It is a kind of typically to realize that equipment is computer.Specifically, computer for example may be used
Think personal computer, laptop computer, vehicle-mounted human-computer interaction device, cellular phone, camera phone, smart phone, individual
Digital assistants, media player, navigation equipment, electronic mail equipment, game console, tablet computer, wearable device or
The combination of any equipment in these equipment of person.
Although this specification embodiment provides the method operating procedure as described in embodiment or flow chart, based on conventional
May include either more or less operating procedure without creative means.The step of being enumerated in embodiment sequence be only
A kind of mode in numerous step execution sequences does not represent and unique executes sequence.Device or end product in practice is held
When row, can according to embodiment either method shown in the drawings sequence execute or it is parallel execute (such as parallel processor or
The environment of multiple threads, even distributed data processing environment).The terms "include", "comprise" or its any other change
Body is intended to non-exclusive inclusion, so that process, method, product or equipment including a series of elements are not only wrapped
Those elements are included, but also include other elements that are not explicitly listed, or further include for this process, method, product
Or the element that equipment is intrinsic.In the absence of more restrictions, being not precluded in the process including the element, side
There is also other identical or equivalent elements in method, product or equipment.
For convenience of description, it is divided into various modules when description apparatus above with function to describe respectively.Certainly, implementing this
The function of each module is realized can in the same or multiple software and or hardware when specification embodiment, it can also be by reality
Show the module of same function by the combination realization etc. of multiple submodule or subelement.Device embodiment described above is only
Schematically, for example, the division of the unit, only a kind of division of logic function, can there is other draw in actual implementation
The mode of dividing, such as multiple units or component can be combined or can be integrated into another system, or some features can be ignored,
Or it does not execute.Another point, shown or discussed mutual coupling, direct-coupling or communication connection can be by one
The INDIRECT COUPLING of a little interfaces, device or unit or communication connection can be electrical, machinery or other forms.
It is also known in the art that other than realizing controller in a manner of pure computer readable program code, it is complete
Entirely can by by method and step carry out programming in logic come so that controller with logic gate, switch, application-specific integrated circuit, programmable
The form of logic controller and embedded microcontroller etc. realizes identical function.Therefore this controller is considered one kind
Hardware component, and the structure that the device for realizing various functions that its inside includes can also be considered as in hardware component.Or
Person even, can will be considered as either the software module of implementation method can be hardware again for realizing the device of various functions
Structure in component.
The present invention be with reference to according to the method for the embodiment of the present invention, the flow of equipment (system) and computer program product
Figure and/or block diagram describe.It should be understood that can be realized by computer program instructions every first-class in flowchart and/or the block diagram
The combination of flow and/or box in journey and/or box and flowchart and/or the block diagram.These computer programs can be provided
Instruct the processor of all-purpose computer, special purpose computer, Embedded Processor or other programmable data processing devices to produce
A raw machine so that the instruction executed by computer or the processor of other programmable data processing devices is generated for real
The device for the function of being specified in present one flow of flow chart or one box of multiple flows and/or block diagram or multiple boxes.
These computer program instructions, which may also be stored in, can guide computer or other programmable data processing devices with spy
Determine in the computer-readable memory that mode works so that instruction generation stored in the computer readable memory includes referring to
Enable the manufacture of device, the command device realize in one flow of flow chart or multiple flows and/or one box of block diagram or
The function of being specified in multiple boxes.
These computer program instructions also can be loaded onto a computer or other programmable data processing device so that count
Series of operation steps are executed on calculation machine or other programmable devices to generate computer implemented processing, in computer or
The instruction executed on other programmable devices is provided for realizing in one flow of flow chart or multiple flows and/or block diagram one
The step of function of being specified in a box or multiple boxes.
In a typical configuration, computing device includes one or more processors (CPU), input/output interface, net
Network interface and memory.
Memory may include computer-readable medium in volatile memory, random access memory (RAM) and/or
The forms such as Nonvolatile memory, such as read-only memory (ROM) or flash memory (flash RAM).Memory is computer-readable medium
Example.
Computer-readable medium includes permanent and non-permanent, removable and non-removable media can be by any method
Or technology realizes information storage.Information can be computer-readable instruction, data structure, the module of program 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), moves
State random access memory (DRAM), other kinds of random access memory (RAM), read-only memory (ROM), electric erasable
Programmable read only memory (EEPROM), fast flash memory bank or other memory techniques, read-only disc read only memory (CD-ROM) (CD-ROM),
Digital versatile disc (DVD) or other optical storages, magnetic tape cassette, tape magnetic disk storage or other magnetic storage apparatus
Or any other non-transmission medium, it can be used for storage and can be accessed by a computing device information.As defined in this article, it calculates
Machine readable medium does not include temporary computer readable media (transitory media), such as data-signal and carrier wave of modulation.
It will be understood by those skilled in the art that the embodiment of this specification can be provided as method, system or computer program production
Product.Therefore, in terms of this specification embodiment can be used complete hardware embodiment, complete software embodiment or combine software and hardware
Embodiment form.Moreover, it wherein includes computer available programs that this specification embodiment, which can be used in one or more,
Implement in the computer-usable storage medium (including but not limited to magnetic disk storage, CD-ROM, optical memory etc.) of code
The form of computer program product.
This specification embodiment can describe in the general context of computer-executable instructions executed by a computer,
Such as program module.Usually, program module includes routines performing specific tasks or implementing specific abstract data types, journey
Sequence, object, component, data structure etc..This specification embodiment can also be put into practice in a distributed computing environment, in these points
In cloth computing environment, by executing task by the connected remote processing devices of communication network.In Distributed Calculation ring
In border, program module can be located in the local and remote computer storage media including storage device.
Each embodiment in this specification is described in a progressive manner, identical similar portion between each embodiment
Point just to refer each other, and each embodiment focuses on the differences from other embodiments.Especially for system reality
For applying example, since it is substantially similar to the method embodiment, so description is fairly simple, related place is referring to embodiment of the method
Part explanation.In the description of this specification, reference term " one embodiment ", " some embodiments ", " example ",
The description of " specific example " or " some examples " etc. means specific features described in conjunction with this embodiment or example, structure, material
Or feature is contained at least one embodiment or example of this specification embodiment.In the present specification, to above-mentioned term
Schematic representation be necessarily directed to identical embodiment or example.Moreover, description specific features, structure, material or
Person's feature may be combined in any suitable manner in any one or more of the embodiments or examples.In addition, in not conflicting feelings
Under condition, those skilled in the art by different embodiments or examples described in this specification and different embodiment or can show
The feature of example is combined.
The foregoing is merely the embodiments of this specification embodiment, are not limited to this specification embodiment.It is right
For those skilled in the art, this specification embodiment can have various modifications and variations.It is all in this specification embodiment
Any modification, equivalent replacement, improvement and so within spirit and principle, the right that should be included in this specification embodiment are wanted
Within the scope of asking.