CN109783151A - The method and apparatus of rule change - Google Patents

The method and apparatus of rule change Download PDF

Info

Publication number
CN109783151A
CN109783151A CN201711103749.9A CN201711103749A CN109783151A CN 109783151 A CN109783151 A CN 109783151A CN 201711103749 A CN201711103749 A CN 201711103749A CN 109783151 A CN109783151 A CN 109783151A
Authority
CN
China
Prior art keywords
rule
regulation engine
change
application system
regular
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201711103749.9A
Other languages
Chinese (zh)
Other versions
CN109783151B (en
Inventor
杨波
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Jingdong Century Trading Co Ltd
Beijing Jingdong Shangke Information Technology Co Ltd
Original Assignee
Beijing Jingdong Century Trading Co Ltd
Beijing Jingdong Shangke Information Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Jingdong Century Trading Co Ltd, Beijing Jingdong Shangke Information Technology Co Ltd filed Critical Beijing Jingdong Century Trading Co Ltd
Priority to CN201711103749.9A priority Critical patent/CN109783151B/en
Publication of CN109783151A publication Critical patent/CN109783151A/en
Application granted granted Critical
Publication of CN109783151B publication Critical patent/CN109783151B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

The embodiment of the present invention provides a kind of method and apparatus of rule change, can be realized regular dynamic and changes, and while rule change, rule match is without pause, also without stopping project;In addition, can also be achieved the real-time informing of rule change.This method comprises: according to the new regulation engine of change rule prebuild obtained from regular publishing center;Before the new regulation engine prebuild is completed, rule match is carried out using original regulation engine, and after the new regulation engine prebuild is completed, carries out rule match using the new regulation engine.

Description

The method and apparatus of rule change
Technical field
The present invention relates to field of computer technology more particularly to a kind of method and apparatus of rule change.
Background technique
In application system operational process, the condition for carrying out logic judgment is exactly system convention.Such as someone cannot Enterprise management system is accessed, or the reimbursement lower than 1000 yuan is without chief inspector's audit etc..During system operation, it may relate to And system convention needs the case where changing according to actual needs.
In the prior art, the scheme of the following two kinds rule change is generallyd use:
One, application system, which is shut down, carries out regular change
After application system starting, the rule file in this project is loaded, when rule changes, stops project, more Then new rule file restarts project to reload rule file;
Two, the rule change of rule-based poll and thread block
After application system starting, at regular intervals to regulation management central interrogation, whether rule changes.Work as discovery After rule variation, blocks the rule verification in rule application, carry out change regular in regulation engine.
In realizing process of the present invention, at least there are the following problems in the prior art for inventor's discovery:
1, during rule change, current business is blocked stopping, and project is caused to interrupt;2, rule changes not in time;3, All application systems all poll administrative centers, regulation management center pressure are excessive.
Summary of the invention
In view of this, the embodiment of the present invention provides a kind of method and apparatus of rule change, it can be realized regular dynamic and become More, while rule change, rule match is without pause, also without stopping project;In addition, can also be achieved the real-time of rule change Notice.
To achieve the above object, according to an aspect of an embodiment of the present invention, a kind of method of rule change is provided.
The method of the rule change of the embodiment of the present invention includes: according to the pre- structure of change rule obtained from regular publishing center Build new regulation engine;Before the new regulation engine prebuild is completed, rule match is carried out using original regulation engine, and After the new regulation engine prebuild is completed, rule match is carried out using the new regulation engine.
Optionally, in the method, it is based on ZooKeeper server construction rule publishing center.
Optionally, in basis before the new regulation engine of change rule prebuild that regular publishing center obtains, the side Method further include: before application system starting, embedding method engine packet;And after application system starting, according to from described The initial rules that regular publishing center obtains carry out regulation engine initialization using the regulation engine packet.
Optionally, the method also includes: will save from the rule that the regular publishing center obtains to local.
Optionally, in basis before the new regulation engine of change rule prebuild that regular publishing center obtains, the side Method further include: establish application system node, and the registration rule on the application system node in the regular publishing center Change monitoring event;And after rule changes, obtains regulation management center and push in the application system node Change rule.
Optionally, the method also includes: according to from regular publishing center obtain change rule prebuild it is newly regular During engine, according to rule change strategy preconfigured in the regular publishing center, determination is applicable in the new rule The entry-into-force time of the range of the application system server of engine and/or the new regulation engine.
To achieve the above object, according to another aspect of an embodiment of the present invention, a kind of device of rule change is provided.
The device of the rule change of the embodiment of the present invention includes: prebuild module, for obtaining according to from regular publishing center The new regulation engine of change rule prebuild taken;Matching module, for using before the new regulation engine prebuild is completed Original regulation engine carries out rule match, and after the new regulation engine prebuild is completed, is drawn using the new rule Hold up carry out rule match.
Optionally, in described device, it is based on ZooKeeper server construction rule publishing center.
Optionally, described device further include: regulation engine initialization module, for being embedded in front of application system starting Regulation engine packet;And after application system starting, according to the initial rules obtained from the regular publishing center, institute is utilized It states regulation engine packet and carries out regulation engine initialization.
Optionally, described device further include: preserving module, for the rule obtained from the regular publishing center to be saved To local.
Optionally, described device further include: rule monitors module, for establishing application system in the regular publishing center System node, and registration rule changes monitoring event on the application system node;And it after rule changes, obtains Regulation management center pushes to the rule of the change in the application system node.
Optionally, the prebuild module is also used to: being changed according to preconfigured rule in the regular publishing center Strategy determines the range for being applicable in the application system server of the new regulation engine and/or when coming into force of the new regulation engine Between.
To achieve the above object, according to an embodiment of the present invention in another aspect, providing a kind of electronic equipment.
The a kind of electronic equipment of the embodiment of the present invention includes: one or more processors;Storage device, for storing one Or multiple programs, when one or more of programs are executed by one or more of processors, so that one or more of The method that processor realizes the rule change of the embodiment of the present invention.
To achieve the above object, another aspect according to an embodiment of the present invention, provides a kind of computer-readable medium.
A kind of computer-readable medium of the embodiment of the present invention, is stored thereon with computer program, and described program is processed The method of the rule change of the embodiment of the present invention is realized when device executes.
One embodiment in foregoing invention has the following advantages that or the utility model has the advantages that because using the process in rule change In, using the technological means of prebuild regulation engine, need to stop project so overcoming rule change in the prior art, so that Rule match is forced the technical issues of pausing, and then reaches regular dynamic and change, and without stopping project, and rule change is same When, technical effect of the rule match without pause guarantees that application system is smooth, stable operation;By based on ZooKeeper building rule Then publishing center, so as to conveniently realize distributed, real-time rule push;By before application system starts, to Embedding method engine jar packet in application system, and after obtaining initial rules, regulation engine is initialized, so as to be convenient for answering Rule match is carried out according to incoming parameter with system;And while carrying out rule change, draw in the new rule of prebuild Before holding up not yet building completion, it can continue to carry out rule match using original regulation engine, so that project is without stopping, it is regular Matching is without pausing;It is saved by the initial rules and change rule that will be obtained from regular publishing center to the sheet of application system Ground, so as to which still rule can be obtained from local, to construct in application system in the case where the collapse of regular publishing center Regulation engine, so as to mitigate application system to the dependence of regular publishing center and regulation management center;And pass through The mechanism of this bedding storage can mitigate the pressure of application system access rule administrative center to greatest extent, improve rule The stability of administrative center;By establishing application system node in regular publishing center, and register monitoring event, so as to When rule changes, the rule after change is got in real time;By being pre-configured with regular change in regular publishing center Strategy, so as to which regulation engine is issued or be adjusted flexibly according to actual needs according to the gray scale of regular publication demand implementation rule Entry-into-force time.
Further effect possessed by above-mentioned non-usual optional way adds hereinafter in conjunction with specific embodiment With explanation.
Detailed description of the invention
Attached drawing for a better understanding of the present invention, does not constitute an undue limitation on the present invention.Wherein:
Fig. 1 is the schematic diagram of the main flow of the method for rule change according to an embodiment of the present invention;
Fig. 2 is adapted for realizing the general frame schematic diagram of the system of the method for the rule change of the embodiment of the present invention;
Fig. 3 is that the method for rule change according to an embodiment of the present invention carries out the logical schematic of regular publication;
Fig. 4 is the operation time diagram of the method implementation rule change of rule change according to an embodiment of the present invention;
Fig. 5 is that the method for rule change according to an embodiment of the present invention carries out the schematic diagram of rule classification storage;
Fig. 6 is the schematic diagram of the main modular of the device of rule change according to an embodiment of the present invention;
Fig. 7 is that the embodiment of the present invention can be applied to exemplary system architecture figure therein;
Fig. 8 is adapted for the structural representation of the computer system for the terminal device or server of realizing the embodiment of the present invention Figure.
Specific embodiment
Below in conjunction with attached drawing, an exemplary embodiment of the present invention will be described, including the various of the embodiment of the present invention Details should think them only exemplary to help understanding.Therefore, those of ordinary skill in the art should recognize It arrives, it can be with various changes and modifications are made to the embodiments described herein, without departing from scope and spirit of the present invention.Together Sample, for clarity and conciseness, descriptions of well-known functions and structures are omitted from the following description.
The technical solution of the rule change of the embodiment of the present invention, by the reality for changing rule using regular publishing center When, and during rule change, by the way of prebuild regulation engine during implementation rule change, rule match Without pause.
The following are the explanations of some technical terms involved in the embodiment of the present invention:
Cluster: the computer software and/or hardware loosely integrated by one group connects height, and closely cooperation is completed Calculate work;
It is distributed: one group of computer (computer), interlinked by network transmit message with communicate after and coordinate them Behavior and the system that is formed;
Http: hypertext transfer protocol (HTTP, H8perTe7t Transfer Protocol) is to interconnect web-based applications most For a kind of extensive network protocol;
Reverse Proxy: mode, which refers to, receives the connection request on internet with proxy server, then will The server being transmitted on internal network is requested, and the result obtained from server is returned to and requests to connect on internet Client, proxy server externally will appear as a Reverse Proxy at this time;
Long connection: multiple data packets can be continuously transmitted in a connection by referring to, during connecting holding, if do not counted It is sent according to packet, both sides is needed to send out link detecting packet;
Regulation engine: being a kind of insertion component in the application, realizes operational decision making from application code In separate, and write operational decision making using predefined semantic modules.Receive data input, explains business rule, and root Operational decision making is made according to business rule;
Rule management system: based on open source regulation engine drools building, rule editing, publication, checking system.This hair Rule management system in bright embodiment is also based on the building of other regulation engines, such as VisualRules, iLog etc., Action principle is identical.Rule management system in the embodiment of the present invention may be considered by regulation management center, rule publication The heart and these parts of the regulation engine composition for being embedded in application system;
Rule match refers to that regulation engine according to incoming parameter, carries out the judgement of condition, which matches in engine which Rule;
ZooKeeper:ZooKeeper is one distributed, the distributed application program coordination service of open source code, it Comprising a simple primitive collection, distributed application program can realize synchronous service, configuring maintenance and naming service based on it Equal;
Zookeeper has the following characteristics that
1. final consistency: no matter which Server client is connected to, showing it all is the same view, this is The most important performance of ZooKeeper;
2. reliability: there is simple, healthy and strong, good performance, if message m is received to a server, it It will be by all server receiving;
3. real-time: Zookeeper guarantees that client believes the update that server is obtained within the scope of a time interval The information of breath or server failure.But due to network delay etc., Zookeeper cannot be guaranteed that two clients can be same When the data that have just been updated, if necessary to latest data, it should call s8nc () interface before reading data;
4. waiting unrelated (wait-free): slow or failure client must not intervene the request of quick client, So that each client can be waited effectively;
5. atomicity: updating can only succeed or fail, without intermediate state;
6. succession: including global orderly and two kinds of partial order: global orderly refers to if message a exists on a server It is issued before message b, then message a will be published before message b on all Server;Partial order refers to if a message b exists It is issued after message a by the same sender, a will come before b.
Memory: a kind of electronic equipment being made into using semiconductor technology is used to storing data;
Maven: being a project management and synthesis tool.Maven provides developer and constructs a complete life Period frame.Development teams can be automatically performed the master tool construction of project, and Maven uses the bibliographic structure and default of standard Construct life cycle.In the embodiment of the present invention, regulation engine jar packet is embedded in application system using Maven, with implementation rule The initialization of engine;
Nginx: being a high performance HTTP and Reverse Proxy;
Tomcat: being the Web Application Server of a free open source code.In the embodiment of the present invention, regulation management Center can be the regulation management cluster being made of Tomcat application server.
Fig. 1 is the schematic diagram of the main flow of the method for rule change according to an embodiment of the present invention.
As shown in Figure 1, the method for the rule change of the embodiment of the present invention mainly includes the following steps:
Step S101: according to the new regulation engine of change rule prebuild obtained from regular publishing center.The mesh of this step Be realize application system obtains in real time change after system convention.In the embodiment of the present invention, it can be taken based on ZooKeeper Business device constructs regular publishing center.By the monitoring mechanism of ZooKeeper, the real-time release of change rule may be implemented.
During step S101 is according to regular prebuild regulation engine is changed, the rule change of the embodiment of the present invention Method can not stop so that implementation rule is matched.As shown in step S102.
Step S102: before the new regulation engine prebuild is completed, carrying out rule match using original regulation engine, And after the new regulation engine prebuild is completed, rule match is carried out using the new regulation engine.That is rule change In the process, it is interrupted without project, the pause without rule match.When there is external user to access application system, condition judgement is carried out When, application system selects regulation engine to carry out the matching of rule according to the parameter of input, without as relating in the prior art And rule change just needs the project of interrupting, and restarts application system.
In the embodiment of the present invention, according to from regular publishing center obtain the new regulation engine of change rule prebuild it Before, further includes: before application system starting, the embedding method engine packet into application system is to advise in the embodiment of the present invention Then engine jar packet;And after application system starting, according to the initial rules obtained from the regular publishing center, utilize The regulation engine packet carries out regulation engine initialization.
In the method for the rule change of the embodiment of the present invention, the initial rules that can will be obtained from the regular publishing center It saves with change rule to local, is such as, but not limited to stored in local disk.It so may be implemented when regular publishing center When collapse, the building that rule carries out regulation engine can also be locally obtained from application system.
In basis before the new regulation engine of change rule prebuild that regular publishing center obtains, the embodiment of the present invention The method of rule change can also include: to establish application system node in the regular publishing center, and in the application system Registration rule changes monitoring event on system node;And after rule changes, obtains regulation management center and push to institute The change rule in application system node is stated, and according to the new regulation engine of change rule prebuild of acquisition.
It, can also basis during regulation engine new according to the change rule prebuild obtained from regular publishing center Preconfigured rule change strategy, determines the application system service for being applicable in the new regulation engine in the rule publishing center The entry-into-force time of the range of device and/or the new regulation engine is issued so as to the gray scale of implementation rule, or according to reality The entry-into-force time of demand setting regulation engine.
Fig. 2 is adapted for realizing the general frame schematic diagram of the system of the method for the rule change of the embodiment of the present invention.
As shown in Fig. 2, in the embodiment of the present invention, the rule management system for realizing the method for rule change mainly includes Regulation management center, regular publishing center and include regulation engine in application system.
Wherein, regulation management center is substantially carried out editor and the rule effect of rule;Application system is in regular publishing center Rule is obtained from regular publishing center under normal circumstances, it, can be directly from application system under regular publishing center collapse case Local disk in obtain rule, or obtain rule from regulation management center, regular hierarchical storage mechanism is conducive to be promoted The high availability of rule management system;In addition, may be implemented using the regular publishing center of the monitoring mechanism of ZooKeeper node To the asynchronous Policy Change Notices of application system.
In the embodiment of the present invention, if not including regular publishing center, in order to which the change of implementation rule can substantially lead to Application system automatic regular polling regulation management center is crossed, or is carried out using the scheme that message queue MQ carries out Policy Change Notices. In the first scheme, application system needs automatic regular polling regulation management center, this scheme drawback is that rule changes not in time, poll Mechanism very big access pressure can be caused to regulation management center, influence rule editor test;In second scheme, use The drawbacks of message queue MQ progress Policy Change Notices, this scheme, changes for application system rule if it fails, can not then weigh It is newly obtained from message queue MQ and this time changes rule.
In the embodiment of the present invention, different rules can also be set in regular publishing center for different application systems and become It is more tactful, such as regulation engine timing come into force or come into force immediately.In addition, regular publishing center can also be to some application Certain machine of system server cluster is oriented publication, issues convenient for the gray scale of rule.It can match in regular publishing center Set change rule come into force on cluster any platform machine, by observe single machine operation result, judgment rule implementation effect, with Rule configuration is avoided to influence when something goes wrong wider.
Fig. 3 is that the method for rule change according to an embodiment of the present invention carries out the logical schematic of regular publication.
It is as shown in Figure 3:
1) regulation management center initializes the system node of regular publishing center, and regular number is stored under system node According to;
2) application system establishes connection using the ZooKeeper monitoring mechanism and regular publishing center of regular publishing center, And respective system node variation is monitored by registration rule altering event.Monitoring mechanism based on registered events avoids wheel Time interval caused by data is ask, once the perception change at once of rule change application system;
3) in regular publishing center, different application system nodes monitors oneself corresponding total node of rule, works as rule When change, change rule can be shifted onto each system node by regular total node by regulation management center, and to without rule The system node of change is without influence.
Fig. 4 is the operation time diagram of the method implementation rule change of rule change according to an embodiment of the present invention.
It is as shown in Figure 4:
In the embodiment of the present invention, when the application system starts up, a regulation engine is initialized, is changed in application system rule When, prebuild process is carried out, after the completion of to be built, replaces original regulation engine.During rule change, using prebuild The mode of new regulation engine carries out regular change, is put into caching by constructing a new regulation engine, avoids because of rule The pause of application system rule match caused by change.Such as Fig. 4, the user of application system is accessed, is drawn in unstructured good new rule It in the case where holding up, is matched using original regulation engine, while constructing new regulation engine in the memory of application system;? After new regulation engine building is completed, matched using new regulation engine.So far, in the embodiment of the present invention, in calling rule It when engine matching rule, checks in caching whether there is new regulation engine, there is new regulation engine then match with new, delete old Regular engine, so that implementation rule is matched clog-free.
In the embodiment of the present invention, if during the change of rule comes into force, needing rule not by the way of prebuild Engine refreshes rule (refer to and carry out regular change in original regulation engine, need to refresh regulation engine rule), and regulation engine While refreshing rule, it is that not can be carried out rule match, needs to block current business thread, becomes in this way in rule When more will traffic affecting execution efficiency, increase the response time of application system.
In the embodiment of the present invention, by the way of prebuild regulation engine, in addition to not stopping for rule match may be implemented Except, the clothes of the application system of new regulation engine can also be applicable according to the rule change strategy decision that regular publishing center pushes The range of device of being engaged in or regulation engine come into force at what time.It, can not be if carrying out regular refresh in original regulation engine The realization of the enterprising line discipline change strategy of the level of regulation engine.
Fig. 5 is that the method for rule change according to an embodiment of the present invention carries out the schematic diagram of rule classification storage.
It is as shown in Figure 5:
1) application system and regular publishing center communicate under normal conditions, obtain rule, do not depend on regulation management center, this Sample will not influence application since the update of regulation management centring system or the system failure cause in the case where can not providing service System carries out normal rule load;
2) regular publishing center itself not will do it program update, but regular publishing center can not mention in extreme circumstances When for service, application system can be drawn by the rule file that load is buffered in local disk come the rule constructed in application system It holds up, alleviates application system to the dependence of regular publishing center.By bedding storage mechanism, rule is alleviated to greatest extent Influence of the management system to application system.
To sum up, in the embodiment of the present invention, the main implementation steps of implementation rule change scheme are as follows:
One, regulation management center is disposed
The regulation management center cluster based on the Nginx tomcat acted on behalf of is disposed, when regulation management center starts, Regulation management center interdependent node can be detected and be initialized.Detection to regulation management center cluster includes: Nginx Proxy server can for example, by but be not limited to regularly send http request and advised to the mode of Tomcat application server Then in administrative center's cluster each server detection, according to response as a result, judge application server whether normal operation, if Abnormal mention kicks out of cluster, and recovery then rejoins.
Two, regular publishing center is disposed
Select at least 2N+1 platform that ZooKeeper service is installed as ZooKeeper server, ZooKeeper can be selected automatically It enumerates a manager leader and is responsible for ZooKeeper cluster management.It, can be from new choosing when clustered machine leader breaks down It lifts a new leader and carrys out coordination service, to ensure external service availability.Herein, the purpose of odd number platform server is selected It is to prevent in carrying out leader election process, there are two machine draw in votes, the case where so as to cause can not select leader Occur.
Three, regulation engine is embedded in application system by way of jar packet
Application system crosses Maven mode and introduces regulation engine jar packet, carries out regulation engine when application system starting Registration in regular publishing center of initialization and regular altering event, and the rule cache of this application system is entered into this clothes Business device disk.
Four, rule change publication
After business personnel's rule new in regulation management central service, the publication operation for changing rule, rule hair Cloth center notice will change the application system of rule, the application system switching law for needing rule to change, using new rule into Line discipline matching.
The method of rule publication according to an embodiment of the present invention can be seen that because using during rule change, Using the technological means of prebuild regulation engine, need to stop project so overcoming rule change in the prior art, so that rule Then matching is forced the technical issues of pausing, and then reaches regular dynamic and change, without stopping project, and while rule change, Technical effect of the rule match without pause guarantees that application system is smooth, stable operation;By based on ZooKeeper building rule Publishing center, so as to conveniently realize distributed, real-time rule push;By before application system starts, Xiang Ying With embedding method engine jar packet in system, and after obtaining initial rules, regulation engine is initialized, so as to convenient for application System carries out rule match according to incoming parameter;And while carrying out rule change, in the new regulation engine of prebuild Before not yet building is completed, it can continue to carry out rule match using original regulation engine, so that project is not necessarily to stop, rule With without pausing;It is saved by the initial rules and change rule that will be obtained from regular publishing center to the sheet of application system Ground, so as to which still rule can be obtained from local, to construct in application system in the case where the collapse of regular publishing center Regulation engine, so as to mitigate application system to the dependence of regular publishing center and regulation management center;And pass through The mechanism of this bedding storage can mitigate the pressure of application system access rule administrative center to greatest extent, improve rule The stability of administrative center;By establishing application system node in regular publishing center, and register monitoring event, so as to When rule changes, the rule after change is got in real time;By being pre-configured with regular change in regular publishing center Strategy, so as to which regulation engine is issued or be adjusted flexibly according to actual needs according to the gray scale of regular publication demand implementation rule Entry-into-force time.
Fig. 6 is the schematic diagram of the main modular of the device of rule change according to an embodiment of the present invention.
As shown in fig. 6, a kind of device 600 of rule change of the embodiment of the present invention specifically includes that 601 He of prebuild module Matching module 602.
Wherein, prebuild module 601 can be used for newly regular according to the change rule prebuild obtained from regular publishing center Engine;Matching module 602 can be used for before the new regulation engine prebuild is completed, and carry out rule using original regulation engine Matching, and after the new regulation engine prebuild is completed, rule match is carried out using the new regulation engine.
In the device 600 of the embodiment of the present invention, ZooKeeper server construction rule publishing center can be based on.
In addition, device 600 may also include that regulation engine initialization module (not shown), for opening in application system Before dynamic, embedding method engine packet;It is initial according to being obtained from the regular publishing center and after application system starting Rule carries out regulation engine initialization using the regulation engine packet.
Device 600 may also include that preserving module (not shown), the rule for will obtain from the regular publishing center It then saves to local.
In addition, device 600 may also include that rule monitors module (not shown), in the regular publishing center In establish application system node, and on the application system node registration rule change monitoring event;And work as rule After change, obtains regulation management center and push to the rule of the change in the application system node.
In the embodiment of the present invention, prebuild module 601 can also be used in: according to preconfigured in the regular publishing center Rule change strategy, determines the range for being applicable in the application system server of the new regulation engine and/or the new regulation engine Entry-into-force time.
From the above, it can be seen that because using during rule change, using the skill of prebuild regulation engine Art means need to stop project, so that the technology that rule match is forced to pause is asked so overcoming rule change in the prior art Topic, and then reach regular dynamic and change, without stopping project, and while rule change, rule match is imitated without the technology of pause Fruit guarantees that application system is smooth, stable operation;By constructing regular publishing center based on ZooKeeper, so as to easily Realize distributed, real-time rule push;By before application system starts, the embedding method engine jar into application system Packet, and after obtaining initial rules, regulation engine is initialized, so as to be advised convenient for application system according to incoming parameter Then match;And while carrying out rule change, before the new regulation engine of prebuild not yet constructs completion, it can continue Rule match is carried out using original regulation engine, so that project, without stopping, rule match is without pausing;By that will be sent out from rule The initial rules and change rule obtained in cloth center are saved to the local of application system, so as to collapse in regular publishing center In the case where bursting, still rule can be obtained from local, to construct the regulation engine in application system, so as to mitigate application Dependence of the system to regular publishing center and regulation management center;And it, can be maximum by the mechanism of this bedding storage The pressure of the mitigation application system access rule administrative center of limit improves the stability at regulation management center;By in rule Publishing center establishes application system node, and registers monitoring event, so as to be got in real time when rule changes Rule after change;By being pre-configured with rule change strategy in regular publishing center, so as to issue need according to rule The gray scale of implementation rule is asked to issue or be adjusted flexibly according to actual needs the regulation engine entry-into-force time.
Fig. 7 is shown can be using the regular variation of the embodiment of the present invention or the exemplary system of regular change device Framework 700.
As shown in fig. 7, system architecture 700 may include terminal device 701,702,703, network 704 and server 705. Network 704 between terminal device 701,702,703 and server 705 to provide the medium of communication link.Network 704 can be with Including various connection types, such as wired, wireless communication link or fiber optic cables etc..
User can be used terminal device 701,702,703 and be interacted by network 704 with server 705, to receive or send out Send message etc..Various telecommunication customer end applications, such as the application of shopping class, net can be installed on terminal device 701,702,703 (merely illustrative) such as the application of page browsing device, searching class application, instant messaging tools, mailbox client, social platform softwares.
Terminal device 701,702,703 can be the various electronic equipments with display screen and supported web page browsing, packet Include but be not limited to smart phone, tablet computer, pocket computer on knee and desktop computer etc..
Server 705 can be to provide the server of various services, such as utilize terminal device 701,702,703 to user The shopping class website browsed provides the back-stage management server (merely illustrative) supported.Back-stage management server can be to reception To the data such as information query request analyze etc. processing, and by processing result (such as target push information, product letter Breath -- merely illustrative) feed back to terminal device.
It should be noted that rule variation provided by the embodiment of the present invention is generally executed by server 705, accordingly Ground, regular change device are generally positioned in server 705.
It should be understood that the number of terminal device, network and server in Fig. 7 is only schematical.According to realization need It wants, can have any number of terminal device, network and server.
Below with reference to Fig. 8, it illustrates the computer systems 800 for the terminal device for being suitable for being used to realize the embodiment of the present invention Structural schematic diagram.Terminal device shown in Fig. 8 is only an example, function to the embodiment of the present invention and should not use model Shroud carrys out any restrictions.
As shown in figure 8, computer system 800 includes central processing unit (CPU) 801, it can be read-only according to being stored in Program in memory (ROM) 802 or be loaded into the program in random access storage device (RAM) 803 from storage section 808 and Execute various movements appropriate and processing.In RAM 803, also it is stored with system 800 and operates required various programs and data. CPU 801, ROM 802 and RAM 803 are connected with each other by bus 804.Input/output (I/O) interface 805 is also connected to always Line 804.
I/O interface 805 is connected to lower component: the importation 806 including keyboard, mouse etc.;It is penetrated including such as cathode The output par, c 807 of spool (CRT), liquid crystal display (LCD) etc. and loudspeaker etc.;Storage section 808 including hard disk etc.; And the communications portion 809 of the network interface card including LAN card, modem etc..Communications portion 809 via such as because The network of spy's net executes communication process.Driver 810 is also connected to I/O interface 805 as needed.Detachable media 811, such as Disk, CD, magneto-optic disk, semiconductor memory etc. are mounted on as needed on driver 810, in order to read from thereon Computer program be mounted into storage section 808 as needed.
Particularly, disclosed embodiment, the process described above with reference to flow chart may be implemented as counting according to the present invention Calculation machine software program.For example, embodiment disclosed by the invention includes a kind of computer program product comprising be carried on computer Computer program on readable medium, the computer program include the program code for method shown in execution flow chart.? In such embodiment, which can be downloaded and installed from network by communications portion 809, and/or from can Medium 811 is dismantled to be mounted.When the computer program is executed by central processing unit (CPU) 801, system of the invention is executed The above-mentioned function of middle restriction.
It should be noted that computer-readable medium shown in the present invention can be computer-readable signal media or meter Calculation machine readable storage medium storing program for executing either the two any combination.Computer readable storage medium for example can be --- but not Be limited to --- electricity, magnetic, optical, electromagnetic, infrared ray or semiconductor system, device or device, or any above combination.Meter The more specific example of calculation machine readable storage medium storing program for executing can include but is not limited to: have the electrical connection, just of one or more conducting wires Taking formula computer disk, hard disk, random access storage device (RAM), read-only memory (ROM), erasable type may be programmed read-only storage Device (EPROM or flash memory), optical fiber, portable compact disc read-only memory (CD-ROM), light storage device, magnetic memory device, Or above-mentioned any appropriate combination.In the present invention, computer readable storage medium can be it is any include or storage journey The tangible medium of sequence, the program can be commanded execution system, device or device use or in connection.And at this In invention, computer-readable signal media may include in a base band or as carrier wave a part propagate data-signal, Wherein carry computer-readable program code.The data-signal of this propagation can take various forms, including but unlimited In electromagnetic signal, optical signal or above-mentioned any appropriate combination.Computer-readable signal media can also be that computer can Any computer-readable medium other than storage medium is read, which can send, propagates or transmit and be used for By the use of instruction execution system, device or device or program in connection.Include on computer-readable medium Program code can transmit with any suitable medium, including but not limited to: wireless, electric wire, optical cable, RF etc. are above-mentioned Any appropriate combination.
Flow chart and block diagram in attached drawing are illustrated according to the system of various embodiments of the invention, method and computer journey The architecture, function and operation in the cards of sequence product.In this regard, each box in flowchart or block diagram can generation A part of one module, program segment or code of table, a part of above-mentioned module, program segment or code include one or more Executable instruction for implementing the specified logical function.It should also be noted that in some implementations as replacements, institute in box The function of mark can also occur in a different order than that indicated in the drawings.For example, two boxes succeedingly indicated are practical On can be basically executed in parallel, they can also be executed in the opposite order sometimes, and this depends on the function involved.Also it wants It is noted that the combination of each box in block diagram or flow chart and the box in block diagram or flow chart, can use and execute rule The dedicated hardware based systems of fixed functions or operations is realized, or can use the group of specialized hardware and computer instruction It closes to realize.
Being described in module involved in the embodiment of the present invention can be realized by way of software, can also be by hard The mode of part is realized.Described module also can be set in the processor, for example, can be described as: a kind of processor packet Include prebuild module and matching module.Wherein, the title of these modules is not constituted to the module itself under certain conditions It limits, for example, prebuild module can also be described as " for new according to the change rule prebuild obtained from regular publishing center Regulation engine ".
As on the other hand, the present invention also provides a kind of computer-readable medium, which be can be Included in equipment described in above-described embodiment;It is also possible to individualism, and without in the supplying equipment.Above-mentioned calculating Machine readable medium carries one or more program, when said one or multiple programs are executed by the equipment, makes Obtaining the equipment includes: according to the new regulation engine of change rule prebuild obtained from regular publishing center;Draw in the new rule Before holding up prebuild completion, rule match is carried out using original regulation engine, and complete in the new regulation engine prebuild Later, rule match is carried out using the new regulation engine.
Technical solution according to an embodiment of the present invention, because using during rule changes, using prebuild rule The technological means of engine needs to stop project, so that rule match is forced to pause so overcoming rule change in the prior art The technical issues of, and then reach regular dynamic and change, without stopping project, and while rule change, rule match is without pause Technical effect, guarantee that application system is smooth, stable operation;By constructing regular publishing center based on ZooKeeper, so as to To conveniently realize distributed, real-time rule push;By before application system starts, the embedding method into application system Engine jar packet, and after obtaining initial rules, regulation engine is initialized, so as to be convenient for application system according to incoming ginseng Number carries out rule match;And while carrying out rule change, before the new regulation engine of prebuild not yet constructs completion, It can continue to carry out rule match using original regulation engine, so that project, without stopping, rule match is without pausing;Passing through will The initial rules and change rule obtained from regular publishing center are saved to the local of application system, so as to send out in rule In the case that cloth center collapses, still rule can be obtained from local, to construct the regulation engine in application system, so as to Mitigate application system to the dependence of regular publishing center and regulation management center;And by the mechanism of this bedding storage, The pressure of application system access rule administrative center can be mitigated to greatest extent, improve the stability at regulation management center;It is logical Cross and establish application system node in regular publishing center, and register monitoring event, so as to rule change when, in real time Ground gets the rule after change;By being pre-configured with rule change strategy in regular publishing center, so as to according to rule It then issues the gray scale publication of demand implementation rule or the regulation engine entry-into-force time is adjusted flexibly according to actual needs.
Above-mentioned specific embodiment, does not constitute a limitation on the scope of protection of the present invention.Those skilled in the art should be bright It is white, design requirement and other factors are depended on, various modifications, combination, sub-portfolio and substitution can occur.It is any Made modifications, equivalent substitutions and improvements etc. within the spirit and principles in the present invention, should be included in the scope of the present invention Within.

Claims (14)

1. a kind of method of rule change characterized by comprising
According to the new regulation engine of change rule prebuild obtained from regular publishing center;
Before the new regulation engine prebuild is completed, rule match is carried out using original regulation engine, and described new After regulation engine prebuild is completed, rule match is carried out using the new regulation engine.
2. the method according to claim 1, wherein being advised in the method based on ZooKeeper server construction Then publishing center.
3. the method according to claim 1, wherein pre- according to the change rule obtained from regular publishing center Before constructing new regulation engine, the method also includes:
Before application system starting, embedding method engine packet;And
After application system starting, according to the initial rules obtained from the regular publishing center, the regulation engine is utilized Packet carries out regulation engine initialization.
4. method according to claim 1 or 3, which is characterized in that the method also includes: it will be from the rule publication The rule that the heart obtains is saved to local.
5. the method according to claim 1, wherein pre- according to the change rule obtained from regular publishing center Before constructing new regulation engine, the method also includes:
Application system node is established in the regular publishing center, and the registration rule change prison on the application system node Listen event;And
After rule changes, obtains regulation management center and push to the rule of the change in the application system node.
6. the method according to claim 1, wherein the method also includes: according to from regular publishing center During the new regulation engine of change rule prebuild of acquisition, become according to preconfigured rule in the regular publishing center It is more tactful, determine the range of application system server and/or coming into force for the new regulation engine for being applicable in the new regulation engine Time.
7. a kind of device of rule change characterized by comprising
Prebuild module, for according to the new regulation engine of change rule prebuild obtained from regular publishing center;
Matching module, for carrying out rule match using original regulation engine before the new regulation engine prebuild is completed, And after the new regulation engine prebuild is completed, rule match is carried out using the new regulation engine.
8. device according to claim 7, which is characterized in that in described device, advised based on ZooKeeper server construction Then publishing center.
9. device according to claim 7, which is characterized in that described device further include: regulation engine initialization module is used In before application system starts, embedding method engine packet;And after application system starting, issued according to from the rule The initial rules that center obtains carry out regulation engine initialization using the regulation engine packet.
10. the method according to claim 7 or 9, which is characterized in that described device further include: preserving module, for will be from The rule that the rule publishing center obtains is saved to local.
11. device according to claim 7, which is characterized in that described device further include: rule monitors module, is used for Application system node is established in the rule publishing center, and thing is monitored in registration rule change on the application system node Part;And after rule changes, obtains regulation management center and push to the rule of the change in the application system node.
12. device according to claim 7, which is characterized in that the prebuild module is also used to: being sent out according to the rule Preconfigured rule change strategy, determines the range for being applicable in the application system server of the new regulation engine in cloth center And/or the entry-into-force time of the new regulation engine.
13. a kind of electronic equipment characterized by comprising
One or more processors;
Storage device, for storing one or more programs,
When one or more of programs are executed by one or more of processors, so that one or more of processors are real Now such as method as claimed in any one of claims 1 to 6.
14. a kind of computer-readable medium, is stored thereon with computer program, which is characterized in that described program is held by processor Such as method as claimed in any one of claims 1 to 6 is realized when row.
CN201711103749.9A 2017-11-10 2017-11-10 Method and device for rule change Active CN109783151B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201711103749.9A CN109783151B (en) 2017-11-10 2017-11-10 Method and device for rule change

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201711103749.9A CN109783151B (en) 2017-11-10 2017-11-10 Method and device for rule change

Publications (2)

Publication Number Publication Date
CN109783151A true CN109783151A (en) 2019-05-21
CN109783151B CN109783151B (en) 2022-07-05

Family

ID=66484424

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201711103749.9A Active CN109783151B (en) 2017-11-10 2017-11-10 Method and device for rule change

Country Status (1)

Country Link
CN (1) CN109783151B (en)

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110297859A (en) * 2019-06-10 2019-10-01 恩亿科(北京)数据科技有限公司 The method and apparatus for handling real time data
CN111639084A (en) * 2020-04-10 2020-09-08 深圳市华智有为科技有限公司 Dynamic rule generation method and system, application terminal and management terminal
CN111767157A (en) * 2019-08-07 2020-10-13 北京京东尚科信息技术有限公司 Request processing method and device based on service grid
CN112799647A (en) * 2021-04-12 2021-05-14 四川新网银行股份有限公司 Business personnel-oriented rule engine adapter device identification method
CN112988277A (en) * 2021-03-31 2021-06-18 建信金融科技有限责任公司 Rule file loading method, device, server and medium
CN113341757A (en) * 2021-07-02 2021-09-03 佛山市淇特科技有限公司 Smart home equipment linkage method, device, equipment and storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104536325A (en) * 2014-12-31 2015-04-22 西安诺瓦电子科技有限公司 Method and device for determining LED control system strategy
CN105426748A (en) * 2014-09-18 2016-03-23 腾讯科技(深圳)有限公司 Rule file updating method and device
CN105656989A (en) * 2015-12-10 2016-06-08 天津海量信息技术有限公司 Distributed computing method based on hive mind
CN106372778A (en) * 2016-08-23 2017-02-01 江苏亿科达科技发展有限公司 Vehicle scheduling system and method based on dynamic rule engine
CN107133039A (en) * 2017-04-28 2017-09-05 九次方大数据信息集团有限公司 The construction method and device of regulation engine

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105426748A (en) * 2014-09-18 2016-03-23 腾讯科技(深圳)有限公司 Rule file updating method and device
CN104536325A (en) * 2014-12-31 2015-04-22 西安诺瓦电子科技有限公司 Method and device for determining LED control system strategy
CN105656989A (en) * 2015-12-10 2016-06-08 天津海量信息技术有限公司 Distributed computing method based on hive mind
CN106372778A (en) * 2016-08-23 2017-02-01 江苏亿科达科技发展有限公司 Vehicle scheduling system and method based on dynamic rule engine
CN107133039A (en) * 2017-04-28 2017-09-05 九次方大数据信息集团有限公司 The construction method and device of regulation engine

Cited By (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110297859A (en) * 2019-06-10 2019-10-01 恩亿科(北京)数据科技有限公司 The method and apparatus for handling real time data
CN110297859B (en) * 2019-06-10 2021-07-06 恩亿科(北京)数据科技有限公司 Method and apparatus for processing real-time data
CN111767157A (en) * 2019-08-07 2020-10-13 北京京东尚科信息技术有限公司 Request processing method and device based on service grid
CN111767157B (en) * 2019-08-07 2024-05-17 北京京东尚科信息技术有限公司 Request processing method and device based on service grid
CN111639084A (en) * 2020-04-10 2020-09-08 深圳市华智有为科技有限公司 Dynamic rule generation method and system, application terminal and management terminal
CN112988277A (en) * 2021-03-31 2021-06-18 建信金融科技有限责任公司 Rule file loading method, device, server and medium
CN112988277B (en) * 2021-03-31 2023-06-30 建信金融科技有限责任公司 Rule file loading method, device, server and medium
CN112799647A (en) * 2021-04-12 2021-05-14 四川新网银行股份有限公司 Business personnel-oriented rule engine adapter device identification method
CN112799647B (en) * 2021-04-12 2021-11-23 四川新网银行股份有限公司 Business personnel-oriented rule engine adapter device identification method
CN113341757A (en) * 2021-07-02 2021-09-03 佛山市淇特科技有限公司 Smart home equipment linkage method, device, equipment and storage medium

Also Published As

Publication number Publication date
CN109783151B (en) 2022-07-05

Similar Documents

Publication Publication Date Title
CN109783151A (en) The method and apparatus of rule change
CN108304250A (en) Method and apparatus for the node for determining operation machine learning task
CN109408286A (en) Data processing method, device, system, computer readable storage medium
CN110019087A (en) Data processing method and its system
CN109257320A (en) Message storage method and device
CN110427304A (en) O&M method, apparatus, electronic equipment and medium for banking system
CN110351366A (en) A kind of service scheduling method of Internet application, system and computer readable storage medium
CN113193947B (en) Method, apparatus, medium, and program product for implementing distributed global ordering
CN112631800A (en) Kafka-oriented data transmission method and system, computer equipment and storage medium
CN111444077A (en) Method and device for generating flow node test data
CN110728498A (en) Information interaction method and device
CN116719622A (en) Service flow arranging method and service flow arranging system
CN109960212A (en) Task sending method and device
CN110019214A (en) The method and apparatus that data split result is verified
CN112817562A (en) Service processing method and device
CN109726988A (en) A kind of flow engine call method, device, electronic equipment and readable storage medium storing program for executing
CN108959636A (en) Data processing method, device, system, computer-readable medium
CN112445860B (en) Method and device for processing distributed transaction
CN109947736A (en) The method and system calculated in real time
CN110807058B (en) Method and system for exporting data
CN114840319A (en) Method and device for processing service requirements
CN116302561A (en) State control method, device, equipment and storage medium for application instance
CN110333930A (en) Digital Platform system
CN116010065A (en) Distributed task scheduling method, device and equipment
CN114756301A (en) Log processing method, device and system

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant