Summary of the invention
The embodiment of the present invention provides a kind of business rule decision-making technique and device of rule-based engine, can utilize the scheme of editing business rule near " the business field language " of natural language to provide a kind of, and utilize the rule that edits to carry out system's automatic decision.
On the one hand, the embodiment of the present invention provides a kind of business rule decision-making technique of rule-based engine, and the business rule decision-making technique of described rule-based engine comprises: utilize a Class Options in the regulation engine of business field language to obtain respectively the business rule information of business object corresponding to the Class Options of user's input; The business rule information of the business object corresponding according to the Class Options of described user input is utilized business object model in the regulation engine of described service-oriented domain language to explain the storehouse, is explained the dissection process program and business object model metadata description database is resolved; The regulation engine that obtains described service-oriented domain language is resolved the business rule result of decision of rear correspondence.
Preferably, in an embodiment of the present invention, preserve the business object model metadata description with the expandable mark language XML form in described business object model metadata description database.
Preferably, in an embodiment of the present invention, come data of description object JSON form to preserve the business object model metadata description with the JavaScript grammer in described business object model metadata description database.
Preferably, in an embodiment of the present invention, described note dissection process program explains for resolving described business object model the handling procedure that the correspondence in the storehouse is explained.
Preferably, in an embodiment of the present invention, the navigation hint that occurs in the Class Options in the regulation engine of described service-oriented domain language derives from the information in described business object model metadata description database.
On the other hand, the embodiment of the present invention provides a kind of business rule decision making device of rule-based engine, it is characterized in that, the business rule decision making device of described rule-based engine comprises:
Information acquisition unit is used for utilizing a Class Options towards the regulation engine of business field language to obtain respectively the business rule information of business object corresponding to the Class Options of user's input;
The regulation engine of service-oriented domain language, the business rule information that is used for the business object corresponding according to the Class Options of described user's input is utilized business object model in the regulation engine of described service-oriented domain language to explain the storehouse, is explained the dissection process program and business object model metadata description database is resolved; The regulation engine that obtains described service-oriented domain language is resolved the business rule result of decision of rear correspondence.
Preferably, in an embodiment of the present invention, preserve the business object model metadata description with the expandable mark language XML form in described business object model metadata description database.
Preferably, in an embodiment of the present invention, come data of description object JSON form to preserve the business object model metadata description with the JavaScript grammer in described business object model metadata description database.
Preferably, in an embodiment of the present invention, described note dissection process program explains for resolving described business object model the handling procedure that the correspondence in the storehouse is explained.
Preferably, in an embodiment of the present invention, the navigation hint that occurs in the Class Options in the regulation engine of described service-oriented domain language derives from the information in described business object model metadata description database.
Technique scheme has following beneficial effect: because adopt the business rule decision-making technique of described rule-based engine to comprise: utilize a Class Options in the regulation engine of business field language to obtain respectively the business rule information of business object corresponding to the Class Options of user's input; The business rule information of the business object corresponding according to the Class Options of described user input is utilized business object model in the regulation engine of described service-oriented domain language to explain the storehouse, is explained the dissection process program and business object model metadata description database is resolved; The regulation engine that obtains described service-oriented domain language is resolved the technological means of the business rule result of decision of rear correspondence, so reached following technique effect: can utilize the method near " business field language " editor business rule of natural language, and utilize the rule that edits to carry out system's automatic decision.By technique scheme of the present invention, the office manager can edit business rule smoothly, improving production efficiency significantly, and fast responding market changes.
Embodiment
Below in conjunction with the accompanying drawing in the embodiment of the present invention, the technical scheme in the embodiment of the present invention is clearly and completely described, obviously, described embodiment is only the present invention's part embodiment, rather than whole embodiment.Based on the embodiment in the present invention, those of ordinary skills belong to the scope of protection of the invention not making the every other embodiment that obtains under the creative work prerequisite.
As shown in Figure 1, be the business rule decision-making technique process flow diagram of a kind of rule-based engine of the embodiment of the present invention, the business rule decision-making technique of described rule-based engine comprises:
101, utilize a Class Options in the regulation engine of business field language to obtain respectively the business rule information of business object corresponding to the Class Options of user's input;
102, the business rule information of the business object corresponding according to the Class Options of described user input is utilized business object model in the regulation engine of described service-oriented domain language to explain the storehouse, is explained the dissection process program and business object model metadata description database is resolved;
103, the regulation engine that obtains described service-oriented domain language is resolved the business rule result of decision of rear correspondence.
Preferably, in an embodiment of the present invention, preserve the business object model metadata description with the expandable mark language XML form in described business object model metadata description database.
Preferably, in an embodiment of the present invention, come data of description object JSON form to preserve the business object model metadata description with the JavaScript grammer in described business object model metadata description database.
Preferably, in an embodiment of the present invention, described note dissection process program explains for resolving described business object model the handling procedure that the correspondence in the storehouse is explained.
Preferably, in an embodiment of the present invention, the navigation hint that occurs in the Class Options in the regulation engine of described service-oriented domain language derives from the information in described business object model metadata description database.
As shown in Figure 2, be the business rule decision making device structural representation of a kind of rule-based engine of the embodiment of the present invention, the business rule decision making device of described rule-based engine comprises:
Information acquisition unit 21 is used for utilizing a Class Options towards the regulation engine of business field language to obtain respectively the business rule information of business object corresponding to the Class Options of user's input;
Theregulation engine 22 of service-oriented domain language, the business rule information that is used for the business object corresponding according to the Class Options of described user's input is utilized business object model in the regulation engine of described service-oriented domain language to explain the storehouse, is explained the dissection process program and business object model metadata description database is resolved; The regulation engine that obtains described service-oriented domain language is resolved the business rule result of decision of rear correspondence.
Preferably, in an embodiment of the present invention, preserve the business object model metadata description with the expandable mark language XML form in described business object model metadata description database.
Preferably, in an embodiment of the present invention, come data of description object JSON form to preserve the business object model metadata description with the JavaScript grammer in described business object model metadata description database.
Preferably, in an embodiment of the present invention, described note dissection process program explains for resolving described business object model the handling procedure that the correspondence in the storehouse is explained.
Preferably, in an embodiment of the present invention, the navigation hint that occurs in the Class Options in the regulation engine of described service-oriented domain language derives from the information in described business object model metadata description database.
Embodiment of the present invention said method or device technique scheme have following beneficial effect: because adopt the business rule decision-making technique of described rule-based engine to comprise: utilize a Class Options in the regulation engine of business field language to obtain respectively the business rule information of business object corresponding to the Class Options of user's input; The business rule information of the business object corresponding according to the Class Options of described user input is utilized business object model in the regulation engine of described service-oriented domain language to explain the storehouse, is explained the dissection process program and business object model metadata description database is resolved; The regulation engine that obtains described service-oriented domain language is resolved the technological means of the business rule result of decision of rear correspondence, so reached following technique effect: can utilize the method near " business field language " editor business rule of natural language, and utilize the rule that edits to carry out system's automatic decision.By technique scheme of the present invention, the office manager can edit business rule smoothly, improving production efficiency significantly, and fast responding market changes.
Below lifting application example describes:
Application example scheme of the present invention will be carried out the novelty expansion based on present existing regulation engine product, most regulation engine product is is all designed and developed based on object oriented language, in the statement of concrete business rule also based on the grammer that is similar to object oriented language and form of presentation, for example for the case of credit card application, express the rule of " if the applicant has the room that car is arranged; perhaps monthly income is more than 20000 yuan; providing so the credit card credit line is 15000 yuan ", the rule script that may edit:
In above-mentioned script, what Customer explained is the concept of " client ", the attribute that the client Customer of salary, hasCar, hasHouse statement has; What CreditCard explained is " credit card " concept, and the amount that the setCreditAmount statement arranges this credit card is 15000 yuan.
In view of the mode of this editing technique script unfriendly property to office manager's operation, application example of the present invention proposes a kind of regulation engine can service-oriented manager operation, and the rule editing that the office manager sees thes contents are as follows:
Rule " credit card is examined the amount rule "
When meeting the following conditions:
There is a client [customer]
Satisfy one of following condition:
Monthly pay is greater than 20000
Satisfy following all conditions:
It is true that the room is arranged
It is true that car is arranged
Carry out following action:
Newly set up object credit card [card]
Amount is 20000
Revise existing object [customer]
Credit card is [card]
Finish.
In order to set up the contact between corresponding concept, such as " Class Customer " and " client ", need a kind of description method for metadata to describe the program that original use object oriented language is write, the program of writing for Java language, can explain corresponding source files of program with explaining Annotation, as shown in Figure 3, explain for the business object model in the regulation engine of application example service-oriented domain language of the present invention the schematic diagram that storehouse, note dissection process program and business object model metadata description save as database.
Wherein " business object model note storehouse " for the interface of a cover application program secondary development of application example proposition of the present invention, is used for adding corresponding note; " explain the dissection process program " and be the corresponding handling procedure of explaining of the parsing of application example proposition of the present invention; " business object model metadata description " is the model of the preservation object-oriented metadata of application example proposition of the present invention, this set of model can be with XML(Extensible Markup Language, extend markup language) form or JSON(JavaScript Object Notation, come the data of description object with the JavaScript grammer) form is saved in database.
The office manager can use the regulation engine of application example proposition of the present invention to carry out corresponding rule editing afterwards, such as selecting by the mode of guide the business object of entrance, such as " client ", then do further attribute conditions based on this object and limit, the navigation hint that occurs all derives from " business object model metadata description " information of previous preservation.As shown in Figure 4, be the example schematic diagram of user's editing operation in the business rule decision-making of the rule-based engine of application example of the present invention.
Correspondence is related as shown in table 1 below in object oriented programming model, note model, business object metadata description:
Table 1
Business object model is explained the storehouse explanation:
Class: be described by " ABizObjModel " note, the concept of " business object " in corresponding " business object metadata description ", need to identify " business display Name " in note, such as just needing to use " client " this " business display Name ", " Customer " identify, in addition, minute class.path of this " business object " can be set, as " the bank credit field. retail credit ", this minute class.path be used for such is made category division;
Enumerate: the concept of enumerating in object oriented programming model is for to make restriction to the value of a certain class, this is similar to the value of doing for certain concept in certain field and limits, the concept of " business terms " in corresponding " business object metadata description " just can be defined as the values such as " premium customers ", " normal client ", " client temporarily " such as " customer type " in the bank credit field; Application example of the present invention uses " AEnumBizTerm " to explain and describes, and " AEnumBizTerm " needs to describe " the business display Name " that this is enumerated, for example " customer type " in explaining.For the enumerate key of specifically enumerating in enumerating, application example of the present invention uses " AEnumMember " to explain and describes, the concept of " business terms item " in corresponding " business object metadata description ", same " the business display Name " that need to describe enumerate key in this note is such as " premium customers ";
the attribute of class: in the method that application example of the present invention proposes, in the attribute of class and " business object model metadata description ", " service attribute " corresponding is divided into three kinds of situations: the first is that the attribute of class itself is basic data type, integer for example, numeric type, Boolean type, the date type, character string type etc., in this kind situation, application example of the present invention uses " ACommonBOMAttr " to explain and is described, need to describe the type of attribute in note, for example integer and " business display Name ", such as " age " uses the integer type, " business display Name " is " age ", this attribute is the sub-attribute of " client " business object, what the second was that the attribute of class quotes in object oriented programming model is another class, in this kind situation, application example of the present invention uses " ARefBOMAttr " to explain and describes, need to describe " the business display Name " that this attribute is quoted in note, such as having " holding credit card " attribute under " client ", what at this time " ARefBOMAttr " quoted is exactly " credit card " this business object, what the third was quoted in object oriented programming model for the attribute of class is that another enumerates class, application example of the present invention uses " ABizTermBOMAttr " to explain and is described, need to describe " the business display Name " that this attribute is quoted in note, such as " customer type " attribute that has under " client ",
The behavior of class: the concept of " business conduct " in the behavior corresponding " business object metadata description " of the class that application example of the present invention proposes, use " ASimpleBOMAction " to explain expression, " operational approach " of " obtaining the customer default probability " of behavior " getDefaultProbalitity " correspondence in " Customer " class for example, the end value of returning is " Default Probability ", and this value type is numeric type;
Public function: the concept of " public function " in the public function corresponding " business object metadata description " that application example of the present invention proposes, use " ACommonFunction " to explain expression, such as date processing, string processing, numerical operation etc.
Explain dissection process program and business object model metadata description:
The purpose of this program is the source program code of resolving after explaining, relation between analysis classes and class, attribute and method, various enumeration type and the public function of corresponding class, form the business object model metadata description, this description is saved in relational database with the XML form, and corresponding XML content class is similar to:
<BOM displayName=" client " packagePath=" the bank credit field. retail credit " ...
<BOMAttr displayName=" age " type=" string "/
......
</BOM>.
Utilize the XML data that produce to complete rule editing:
In the rule editing interface, " options " that the operation of all guides occurs all is based on the content in the XML data that meet the business object meta-model that the step produces, for example in " business object ", just can choose according to the form of classified navigation " Bank of Communications's loan. the Ward is managed and is borrowed. the retail credit client ", the navigate mode of other this attribute is also similarly, and " customer ID " in Fig. 4, " age " etc. are all corresponding to the affiliated BOMAttr of this BOM of retail credit client.
Application example of the present invention has proposed under a kind of prerequisite of utilizing current regulation engine prior art, can utilize the method near " business field language " editor business rule of natural language, and utilize the rule that edits to carry out system's automatic decision.By technique scheme of the present invention, the office manager can edit business rule smoothly, improving production efficiency significantly, and fast responding market changes.
Those skilled in the art can also recognize the various illustrative components, blocks (illustrative logical block) that the embodiment of the present invention is listed, the unit, and step can pass through electronic hardware, computer software, or both combinations realize.Be the clear replaceability (interchangeability) of showing hardware and software, above-mentioned various illustrative components (illustrative components), unit and step have been described their function generally.Such function is to realize depending on the designing requirement of specific application and whole system by hardware or software.Those skilled in the art can be for every kind of specific application, and can make ins all sorts of ways realizes described function, but this realization should not be understood to exceed the scope of embodiment of the present invention protection.
Various illustrative logical block described in the embodiment of the present invention, or the unit can pass through general processor, digital signal processor, special IC (ASIC), field programmable gate array or other programmable logic device, discrete gate or transistor logic, discrete hardware components, or the design of above-mentioned any combination realizes or operates described function.General processor can be microprocessor, and alternatively, this general processor also can be any traditional processor, controller, microcontroller or state machine.Processor also can realize by the combination of calculation element, for example digital signal processor and microprocessor, multi-microprocessor, Digital Signal Processor Core of one or more microprocessors associating, or any other similarly configuration realize.
Method described in the embodiment of the present invention or the step of algorithm can directly embed hardware, the software module of processor execution or the two combination.Software module can be stored in the storage medium of other arbitrary form in RAM storer, flash memory, ROM storer, eprom memory, eeprom memory, register, hard disk, moveable magnetic disc, CD-ROM or this area.Exemplarily, storage medium can be connected with processor so that processor can be from storage medium reading information, and can deposit write information to storage medium.Alternatively, storage medium can also be integrated in processor.Processor and storage medium can be arranged in ASIC, and ASIC can be arranged in user terminal.Alternatively, processor and storage medium also can be arranged in different parts in user terminal.
In one or more exemplary designs, the described above-mentioned functions of the embodiment of the present invention can realize in hardware, software, firmware or this three's combination in any.If realize in software, these functions can be stored on medium with computer-readable, or are transmitted on the medium of computer-readable with one or more instructions or code form.The computer-readable medium comprises the computer storage medium and is convenient to make allows computer program transfer to other local telecommunication media from a place.Storage medium can be the useable medium that any general or special computer can access.For example, such computer readable media can include but not limited to RAM, ROM, EEPROM, CD-ROM or other optical disc storage, disk storage or other magnetic storage device, or other anyly can be used for carrying or storage and can be read by general or special computer or general or special processor the medium of the program code of form with instruction or data structure and other.In addition, any connection can suitably be defined as the computer-readable medium, for example, if software is by a concentric cable, fiber optic cables, twisted-pair feeder, Digital Subscriber Line (DSL) or also being comprised in defined computer-readable medium with wireless way for transmittings such as infrared, wireless and microwave from a web-site, server or other remote resource.Described video disc (disk) and disk (disc) comprise Zip disk, radium-shine dish, CD, DVD, floppy disk and Blu-ray Disc, and disk is usually with the magnetic duplication data, and video disc carries out the optical reproduction data with laser usually.Above-mentioned combination also can be included in the computer-readable medium.
Above-described embodiment; purpose of the present invention, technical scheme and beneficial effect are further described; institute is understood that; the above is only the specific embodiment of the present invention; the protection domain that is not intended to limit the present invention; within the spirit and principles in the present invention all, any modification of making, be equal to replacement, improvement etc., within all should being included in protection scope of the present invention.