Detailed description of the invention
For making the purpose of the application, technical scheme and advantage clearly, below in conjunction with the application specific embodiment and corresponding accompanying drawing, technical scheme is clearly and completely described.Obviously, described embodiment is only some embodiments of the present application, rather than whole embodiments.Based on the embodiment in the application, the every other embodiment that those of ordinary skill in the art obtain under not making creative work premise, broadly fall into the scope of the application protection.
As shown in Figure 1, the application intelligent rules model in rule attribute include static attribute and dynamic attribute, static attribute is fixed the attribute set by static state, including such as service priority, estimates the static attributes such as consuming time, above-mentioned static attribute belongs to fixing attribute, it is impossible to variation.And dynamic attribute is the dynamic attribute along with the implementation status of rule model changes, including such as rule the amount of calling every day, operation result properties of distributions, dynamic thresholding attribute, run the dynamic attributes such as operation consuming time, average is consuming time.And rule Dynamic attribute values is by ratio-dependent corresponding between each Dynamic attribute values, when each Dynamic attribute values changes, rule Dynamic attribute values is according to following variation accordingly.Accordingly, the property value of rule is also by the ratio-dependent between static attribute value and Dynamic attribute values, and when the Dynamic attribute values variation of rule, the property value of rule also changes therewith.By the way, the property value of each rule in rule model can change along with the variation of corresponding Dynamic attribute values.In this application, intelligent rules model is the priority and logical operations relation that are performed according to each rule and builds, and priority and logical operations relation that each rule is performed are that the property value according to rule is determined.When each intelligent rules model is fabricated, for rule each in rule model, priority and logical operations relation that each rule is performed also can be dynamically adjusted, and this dynamic adjustment is the change of the property value according to each rule and carries out.
As shown in Figure 2, the expression formula of binary tree structure of a kind of embodiment (AandD) or (CandD) for the intelligent rules model of the application, it logical operator or including being positioned at the branch node of tree and two logical operator and, and it is positioned at the regular A of the leaf node of tree, rule B, rule C, rule D, in above-mentioned rule model (AandD) or (CandD), because the priority level of bracket is the highest, therefore, the logical operations relation of the and between the preferential regular A performed in bracket and rule B, and the logical operations relation of the and between regular C and rule D in bracket, perform result by above-mentioned two again and perform the logical operations relation of or.Rule A, rule B, rule C, rule D all can be performed separately, not premised on the execution of other rules.
The intelligent rules model of the application is configured to the mode of dual-thread or multithreading and performs, as shown in Figure 3, the embodiment of dual-thread for the intelligent rules model of the application, when executing rule model (AandB) or (CandD), assume that rule A, rule B, rule C, the rule priority that is performed of D order from high to low are followed successively by: rule A, rule D, rule B, rule C, judge according to the logical relation between above-mentioned each rule, this rule model can be built into two queues, that is, queue 1 and queue 2 perform.Priority order from high to low according to above-mentioned rule, repeating query these 4 rules are added in queue 1 and queue 2, namely, queue 1 comprises rule A and rule B, queue 2 comprises rule D and rule C, again by priority order from high to low according to the rule comprised in respective queue of thread 1 and thread 2, perform the rule comprised in queue 1 and queue 2 respectively simultaneously, namely, thread 1 performs the regular A and the rule B that comprise in queue 1 successively, and thread 2 performs the regular D and the rule C that comprise in queue 2 successively.As shown in Figure 3, under the scene of above-mentioned deque, if connected by the afterbody of the two queue, can obtaining a two ends priority is high, middle priority is low " dique ", two threads can the executing rule successively from the two ends of this dique to centre respectively.
Under the executive mode of above-mentioned deque and dual-thread, can quickly perform all of rule in rule model (AandB) or (CandD), it is possible to improve the execution efficiency of intelligent rules model.In the rule model performing other complexity, it is also possible to rule model is split into plural queue, in two or more threads, perform corresponding rule by the priority level being performed order of individual queue.
Execution process and the execution result of the rule of the intelligent rules model of the application export with the form of form, it is possible to show respective rule in commission corresponding such as left and right fiducial value intuitively, perform result, trigger the situation of reason, distribution of results, the amount of calling etc..When run into need analysis rule to run and trigger reason time, it is possible to present quickly through form and situation when also meta-rule performs, the dynamic attribute of rule can also be analyzed simultaneously and find rule Problems existing etc..
The intelligent rules model of the application is upon execution, the function of execution limit, limit short circuit can be realized, described rule is shorted i.e. rule and is not carried out when meeting certain condition, as: assume that the first rule makes logic "and" operation with Second Rule, if it is false that the first rule performs result, then Second Rule meets the condition not performed, and Second Rule does not perform;And for example: assuming that the first rule does logical "or" computing with Second Rule, if it is ture that the first rule performs result, then Second Rule meets the condition not performed, and Second Rule does not perform.As shown in Figure 4, for instance during executing rule model (AandB) or (CandD), this rule model is built into queue 1 and queue 2 performs., the regular A performing initiating terminal and rule D that lay respectively at queue 1 and queue 2 are performed in thread 1 and thread 2 simultaneously at first, and the priority level of the rule being arranged in the position performing initiating terminal of queue 1 and queue 2 is the highest in respective queue.As the execution result false of rule A, rule B can be shorted, and rule B is not carried out, and the execution result false of rule A is directly copied to rule B, and the execution result of principle combinations (AandB) is false, and performs result with this and carry out subsequent arithmetic.And simultaneously, when the operation result of rule D is true, C is not short-circuit for rule, rule C continues to be performed, after the execution result false of principle combinations (CandD) the i.e. execution result of queue 2 with aforementioned rule combination (AandB) i.e. queue 1 finally performs the logical operations of Or, what obtain rule model (AandB) or (CandD) finally performs result.The mode of limit execution limit short circuit by the way, it is possible to by the rule short circuit of unnecessary execution, the execution of shortening rule model is consuming time and performs burden, is effectively improved execution efficiency.
As seen in figs. 5-6, the structure of intelligent rules model provided for embodiments herein and the method for execution, specifically include following steps:
S101: the equipment that processes accepts to build the triggering request of rule model.
In embodiments herein, described process equipment can make terminal, it is possible to is server, and wherein, described terminal includes but not limited to: personal computer (PersonalComputer, PC), mobile phone, panel computer etc..Process equipment accepts to trigger request, prepares to build rule model.
S102: process device build rule model configuration platform.
Described process equipment transfers corresponding rule from rule model container.For configuring corresponding rule model.
S103: process device build rule model platform.
The property value of each rule that described process device analysis is transferred, including its static attribute value and Dynamic attribute values, process equipment determines the property value of each rule according to the static attribute value of each rule and Dynamic attribute values, property value further according to each rule determines its priority being performed and logical operations relation, the corresponding rule model of dynamic construction.
S104: process equipment calls and executing rule model.
Process equipment performs the rule model that above-mentioned configuration is good, it is built at least more than one queue, and the height of the priority level being performed order with individual queue, sequentially or simultaneously performed in dual-thread or multithreading, carried out in the way of the short circuit of execution limit, limit in performing composition.Obtaining after performing result, process equipment carries out subsequent arithmetic.
S105: process the execution process of device analysis rule model and perform result.
The variation according to the dynamic attribute of each rule in the execution result of rule model of the process equipment, resets the Dynamic attribute values of each rule and the property value of corresponding rule.The executions process of the rule of rule model and perform result and export with the form of form, it is shown that respective rule such as left and right fiducial value in commission, execution result, triggering reason, distribution of results, the amount of calling etc. situation.
By said process, process the equipment situation according to the variation of the property value of rule, dynamically adjust the execution priority between each rule and logical operations relation the corresponding rule model of dynamic construction, to improve the execution efficiency of rule model.
A kind of embodiment of the intelligent rules model system of the application introduced below
Receiving unit 201, is used for accepting triggering command;
Transfer unit 201, for transferring corresponding rule from rule container;
Analytic unit 202, the attribute of the rule for transferring described in analyzing, it is performed priority and logical operations relation with what determine each rule;
Dispensing unit 203, for the result according to above-mentioned analytic unit, dynamically configures corresponding rule model;
Performance element 204, for performing the rule model that above-mentioned configuration is good, and obtains execution result;
Output unit 205, for exporting the execution process of above-mentioned rule and execution result with report form.
A kind of concrete application scenarios is introduced below in conjunction with embodiment.
Such as, when user by mobile phone perform its on-line payment account carry out delivery operation time, payment platform needs the operator to account to carry out authentication, with the risk that control account is stolen.In verification process, the equipment that processes of payment platform performs certification by building the intelligent rules model identity to operator, the such as cipher authentication to account, account operates the certification in place, the international mobile device international identity code (InternationalMobileEquipmentIdentity of the mobile phone of operational account, IMEI) certification, the certification of short message certification code.And set the cipher authentication of account as rule A, it is rule B that account operates the certification in place, the international mobile device international identity code (InternationalMobileEquipmentIdentity of the mobile phone of operational account, IMEI) certification is rule C, and the certification of short message certification code is rule D.As shown in Figure 7, process equipment is when receiving request and account being carried out delivery operation, above-mentioned rule is transferred from rule container, rule A can be placed into the first end primary importance 11 of the expression formula of rule model, rule D is placed into the second end primary importance 21 of the expression formula of rule model, rule B is placed into the first end second position 12, rule C is placed into the second end second position 22, it is built into new intelligent rules model (AandB) or (CandD) with this, process equipment performs this rule model (AandB) or (CandD), the operator of account is carried out authentication.At the password of account with operatively meet the requirements, or when the IMEI of the mobile phone of operational account and short message certification code meet the requirements, the identity processing device authentication operation person is legal.
Refer to shown in Fig. 4, process equipment is when performing above-mentioned intelligent rules model (AandB) or (CandD), first queue 1 and queue 2 it are built into, the regular A and rule D that lay respectively at the position performing initiating terminal of queue 1 and queue 2 are performed in thread 1 and thread 2 simultaneously at first, and namely cipher authentication and short message certification are performed simultaneously in processing.As the execution result false of rule A, namely when cipher authentication reports an error, rule B is shorted and does not perform, the execution result of rule A is directly copied to rule B, namely certification is not done in the operation place of account, and directly with false as a result, the execution result of (AandB) is false, this stage, the authentication failure of the operator of account.Simultaneously, when the operation result of rule D is true, i.e. short message certification success, C is not short-circuit for rule, rule C continues to be performed, namely the IMEI of certification mobile phone is continued, such as the execution result of rule C is also true, namely the certification success of the IMEI of mobile phone, then the execution result of (CandD) is true, and after the last execution result false with aforementioned (AandB) performs the logical operations of Or, the final result that performs obtaining rule model (AandB) or (CandD) is true, the operator's identity processing device authentication account is legal, performs delivery operation.Otherwise, when the execution result of (AandB) is false, if execution result (CandD) is also false, the operator's identity then processing device authentication account is illegal, follows the mode of execution limit, limit short circuit in the execution process of (AandB) and (CandD).
After payment platform performs a period of time, the dynamic attribute of the regular A in rule container, regular B, regular C and rule D changes, such as the operation of rule B is consuming time shorter, it is suitable for preferential execution, dynamic attribute variation at above-mentioned rule B reaches the value of certain triggering, and the attribute of rule B changes therewith.When process equipment accepts request structure corresponding rule model, the execution order of each rule is redefined after to the analysis of the attribute of each rule, rule B can be placed into the first end primary importance 11 of the expression formula of rule model, rule D is placed into the second end primary importance 21 of the expression formula of rule model, rule A is placed into the first end second position 12, rule C is placed into the second end second position 22, is built into new intelligent rules model (BandA) or (CandD).When account is operated, rule model also can be first built into queue 1 and queue 2, now, rule B and rule D is positioned at the position performing initiating terminal of queue 1 and queue 2, on queue is built after, process equipment can in thread 1 and thread 2 simultaneously preferential executing rule B and rule D, such as, when the execution result of rule B is false, the i.e. operation place mistake of account, rule A is shorted, i.e. the password of not reauthentication account, but directly using the execution result false of rule A as performing result, then the execution result of (BandA) is false.So, the equipment that processes is when performing (BandA), and the spent time is the time spent by executing rule B, and because the execution time of rule B is shorter, the time spent by (BandA) that performs just is shorter by.Above-described embodiment illustrates the intelligent rules model of the application attribute according to each rule, and process equipment dynamically adjusts the priority of the execution order between each rule, to improve the execution efficiency of rule model.In other embodiments, the logical operations relation between each rule in the intelligent rules model of the application can also be dynamically adjusted, such as above-mentioned intelligent rules model (AandB) or (CandD) is after the dynamic attribute of each rule changes, process equipment can also the logical operations relation of dynamic each rule between regulation rule model, such as (AorD) or (BandC), or other intelligent rules models such as (AandD) and (CorD), the purpose adjusted is premised on the execution efficiency to improve rule model, guarantee that the execution result of rule model meets demand simultaneously.
By the way, the regular execution sequence of the intelligent rules model of the application equipment that can be processed dynamically adjusts according to the variation of the attribute of each rule, and with dual-thread, the mode of execution limit, limit short circuit performs the expression formula of intelligent rules model, effectively improves the execution efficiency of the intelligent rules model of the application.Especially when multiple users perform to operate simultaneously, it is possible to effectively alleviating the burden of process equipment, lifting processes the treatment effeciency of equipment.The execution result of rule
Those skilled in the art are it should be appreciated that embodiments of the invention can be provided as method, system or computer program.Therefore, the present invention can adopt the form of complete hardware embodiment, complete software implementation or the embodiment in conjunction with software and hardware aspect.And, the present invention can adopt the form at one or more upper computer programs implemented of computer-usable storage medium (including but not limited to disk memory, CD-ROM, optical memory etc.) wherein including computer usable program code.
The present invention is that flow chart and/or block diagram with reference to method according to embodiments of the present invention, equipment (system) and computer program describe.It should be understood that can by the combination of the flow process in each flow process in computer program instructions flowchart and/or block diagram and/or square frame and flow chart and/or block diagram and/or square frame.These computer program instructions can be provided to produce a machine to the processor of general purpose computer, special-purpose computer, Embedded Processor or other programmable data processing device so that the instruction performed by the processor of computer or other programmable data processing device is produced for realizing the device of function specified in one flow process of flow chart or multiple flow process and/or one square frame of block diagram or multiple square frame.
These computer program instructions may be alternatively stored in and can guide in the computer-readable memory that computer or other programmable data processing device work in a specific way, the instruction making to be stored in this computer-readable memory produces to include the manufacture of command device, and this command device realizes the function specified in one flow process of flow chart or multiple flow process and/or one square frame of block diagram or multiple square frame.
These computer program instructions also can be loaded in computer or other programmable data processing device, make on computer or other programmable devices, to perform sequence of operations step to produce computer implemented process, thus the instruction performed on computer or other programmable devices provides for realizing the step of function specified in one flow process of flow chart or multiple flow process and/or one square frame of block diagram or multiple square frame.
In a typical configuration, computing equipment includes one or more processor (CPU), input/output interface, network interface and internal memory.
Internal memory potentially includes the forms such as the volatile memory in computer-readable medium, random access memory (RAM) and/or Nonvolatile memory, such as read only memory (ROM) or flash memory (flashRAM).Internal memory is the example of computer-readable medium.
Computer-readable medium includes permanent and impermanency, removable and non-removable media can by any method or technology to realize 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 it is not limited to phase transition internal memory (PRAM), static RAM (SRAM), dynamic random access memory (DRAM), other kinds of random access memory (RAM), read only memory (ROM), Electrically Erasable Read Only Memory (EEPROM), fast flash memory bank or other memory techniques, read-only optical disc read only memory (CD-ROM), digital versatile disc (DVD) or other optical storage, magnetic cassette tape, the storage of tape magnetic rigid disk or other magnetic storage apparatus or any other non-transmission medium, can be used for the information that storage can be accessed by a computing device.According to defining herein, computer-readable medium does not include temporary computer readable media (transitorymedia), such as data signal and the carrier wave of modulation.
It can further be stated that, term " includes ", " comprising " or its any other variant are intended to comprising of nonexcludability, so that include the process of a series of key element, method, commodity or equipment not only include those key elements, but also include other key elements being not expressly set out, or also include the key element intrinsic for this process, method, commodity or equipment.When there is no more restriction, statement " including ... " key element limited, it is not excluded that there is also other identical element in including the process of described key element, method, commodity or equipment.
It will be understood by those skilled in the art that embodiments herein can be provided as method, system or computer program.Therefore, the application can adopt the form of complete hardware embodiment, complete software implementation or the embodiment in conjunction with software and hardware aspect.And, the application can adopt the form at one or more upper computer programs implemented of computer-usable storage medium (including but not limited to disk memory, CD-ROM, optical memory etc.) wherein including computer usable program code.
The foregoing is only embodiments herein, be not limited to the application.To those skilled in the art, the application can have various modifications and variations.All make within spirit herein and principle any amendment, equivalent replacement, improvement etc., should be included within claims hereof scope.