Summary of the invention
It is fixing that the present invention mainly solves interlock in existing track traffic synthetic monitoring system, need the problem of again replacing monitoring software during amendment, provide the interlock service system be applied in track traffic synthetic monitoring system of a kind of flexible configuration, online updating, monitoring state.
Present invention also offers the interlock method of servicing be applied in track traffic synthetic monitoring system of a kind of flexible configuration, online updating, monitoring state.
Above-mentioned technical problem of the present invention is mainly solved by following technical proposals: a kind of interlock service system be applied in track traffic synthetic monitoring system, comprise configuration database, interlock client, interlock service end and control service end, configuration database is connected with interlock service end respectively with interlock client, interlock service end is connected with control service end
Configuration database: store interlock scheme, provides the configuration information of interlock, and link as the set from group function parallelization composition, the set that function is made up of set serial parallel, action is the control operation comprising precondition and postcondition; Configuration information comprises the precondition of interlock, function and action, and function, the precondition of action and postcondition.Wherein precondition for judging to link, the adjustment of function and action executing, satisfy condition, perform, do not satisfy condition, do not perform.Subsequent operation to be selected when postcondition is for judging that interlock performs unsuccessfully, comprises and unsuccessfully stopping afterwards, continues to perform, stops after failure after retry N time, continues execution after failed rear retry N time after failure.
Interlock client: trigger interlock by operation, and constantly obtain interlock current execution state, display interlock implementation status;
Interlock service end: load interlock from configuration database, then process interlock, and assign control command to control service end; Process interlock comprises the qualified interlock of detection automatically and performs, qualified interlock notice user operation detected and accept user to the request performed that links; Stop interlock, interrupt the interlock be in implementation, the follow-up step of current procedures does not continue to perform; The record of linkage status, by the state real time record of the current execution of interlock in configuration database, the state of interlock comprises all states of interlock, function and action, the state wherein linked be divided into run succeeded, perform neutralization perform unsuccessfully three kinds, the state of function is divided into and runs succeeded, performs neutralization and perform unsuccessfully three kinds, and the state of action is divided in execution, locking is unsuccessfully skipped successfully, locking failure terminating, run succeeded, unsuccessfully skip successfully, perform failure terminating six kinds.
Control service end: according to control command, action is performed.
Be applied to the interlock method of servicing in track traffic synthetic monitoring system, comprise the following steps:
Step 11: load interlock configuration information from configuration database;
Step 12: periodically detect the interlock whether having and meet interlock precondition;
Step 13: then return step 12 if not, if then judge whether interlock is in executing state, if then return step 12, then interlock executing state is labeled as just in commission if not, and triggering interlock performs interlock;
Step 14: whether interlock service terminates, and returns step 12 if not, if then terminate service;
The step wherein performing interlock in step 13 comprises:
Step 21: the function of linkage status and interlock, the state of action in Reconfigurations database;
Step 22: judge in interlock, whether function meets precondition successively;
Step 23: if then n-back test, enter next step, then whether the postcondition of arbitration functions is do not meet precondition then to terminate this interlock if not, then returns step 22 if not, if then terminate interlock, the executing state of function, interlock in Reconfigurations database;
Step 24: whether all linkage functions are all in complete state, then return step 22 if not, if then terminate this interlock;
Wherein in step 23, the step of n-back test is:
Step 31: press execution sequence and take out action from function, judge whether the precondition meeting this action;
Step 32: perform in team if then this action is joined, enter next step; Then judge that whether the postcondition of this action is terminate this action after precondition failure if not, if then terminate this action, then return step 31 if not;
Step 33: whether the postcondition judging action is that this action is skipped in failure, if then return step 31, then waits for the execution result of this action if not;
Step 34: whether action executing result success, then marks failure cause if not, and action in Reconfigurations database, function executing state, terminate this function; If then judge whether this function everything is all in complete state;
Step 35: then return step 31 if not, if then action in Reconfigurations database, function executing state, terminates this function.
The inventive method can record time and the state of the execution of same interlock scheme last time, the step of current n-back test, action and the state of n-back test, action before and real time record links.According to the configuration linkage scheme flexibly of practical situations in comprehensive monitoring system, comprise the precondition of linkage action execution, the configuration of postcondition, the connection in series-parallel execution sequence of configuration linkage action flexibly; And by the sustainable storage of database, ensure that interlock execution result is at interlock service crashes, the preservation in particular cases such as to restart, so that the grasp of operator to the implementation status of this interlock and the judgement to next step action executing.
As a kind of preferred version, also include online updating configuration step, this step comprises:
Step 41: load initial configuration from configuration database;
Step 42: the request of monitoring online updating configuration, if the request that receives enters next step;
Step 43: judge whether that existence is in executory interlock;
Step 44: if then return step 43, then reloads interlock configuration if not;
Step 45: whether the service of judging terminates, and then returns step 42 if not, if then terminate service.This programme makes interlock design to carry out online updating.
As a kind of preferred version, configuration information comprises interlock, the precondition of function and action and postcondition; Precondition for judging to link, the adjustment of function and action executing, satisfy condition, perform, do not satisfy condition, do not perform; Subsequent operation to be selected when postcondition is for judging that interlock performs unsuccessfully, comprises and unsuccessfully stopping afterwards, continues to perform, stops after failure after retry N time, continues execution after failed rear retry N time after failure.N is that number of retries can configure as required, and retry interval M also can configure second.
Therefore, advantage of the present invention is: 1. time and the state that can record the execution of same interlock scheme last time, the step of current n-back test, action and the state of n-back test, action before and real time record links.2., according to the configuration linkage scheme flexibly of practical situations in comprehensive monitoring system, comprise the precondition of linkage action execution, the configuration of postcondition, the connection in series-parallel execution sequence of configuration linkage action flexibly; 3. by the sustainable storage of database, ensure that interlock execution result is at interlock service crashes, the preservation in particular cases such as to restart, so that the grasp of operator to the implementation status of this interlock and the judgement to next step action executing; 4. online updating can be carried out.
Embodiment
Below by embodiment, and by reference to the accompanying drawings, technical scheme of the present invention is described in further detail.
Embodiment:
A kind of interlock service system be applied in track traffic synthetic monitoring system of the present embodiment, as shown in Figure 1, comprise configuration database 1, interlock client 4, interlock service end 2 and control service end 3, configuration database is connected with interlock service end respectively with interlock client, and interlock service end is connected with control service end.
Configuration database: store interlock scheme, provides the configuration information of interlock, and link as the set from group function parallelization composition, the set that function is made up of set serial parallel, action is the control operation comprising precondition and postcondition; Configuration information comprises interlock, the precondition of function and action and postcondition.Configuration information comprises interlock, the precondition of function and action and postcondition; Precondition for judging to link, the adjustment of function and action executing, satisfy condition, perform, do not satisfy condition, do not perform; Subsequent operation to be selected when postcondition is for judging that interlock performs unsuccessfully, comprises and unsuccessfully stopping afterwards, continues to perform, stops after failure after retry N time, continues execution after failed rear retry N time after failure.
Interlock client: trigger interlock by operation, and constantly obtain interlock current execution state, display interlock implementation status;
Interlock service end: load interlock from configuration database, then process interlock, and assign control command to control service end; Process interlock comprises the qualified interlock of detection automatically and performs, qualified interlock notice user operation detected and accept user to the request performed that links; Stop interlock, interrupt the interlock be in implementation, the follow-up step of current procedures does not continue to perform; The record of linkage status, by the state real time record of the current execution of interlock in configuration database, the state of interlock comprises all states of interlock, function and action, the state wherein linked be divided into run succeeded, perform neutralization perform unsuccessfully three kinds, the state of function is divided into and runs succeeded, performs neutralization and perform unsuccessfully three kinds, and the state of action is divided in execution, prepositionly unsuccessfully skip successfully, preposition failure terminating, run succeeded, unsuccessfully skip successfully, perform failure terminating six kinds.
As shown in Figure 2, the interlock method of servicing being applied to the interlock service system in track traffic synthetic monitoring system comprises the following steps:
Step 11: load interlock configuration information from configuration database;
Step 12: periodically detect the interlock whether having and meet interlock precondition;
Step 13: then return step 12 if not, if then judge whether interlock is in executing state, if then return step 12, then interlock executing state is labeled as just in commission if not, and triggering interlock performs interlock;
Step 14: whether interlock service terminates, and returns step 12 if not, if then terminate service;
As shown in Figure 3, the step wherein performing interlock in step 13 comprises:
Step 21: the function of linkage status and interlock, the state of action in Reconfigurations database;
Step 22: judge in interlock, whether function meets precondition successively;
Step 23: if then n-back test, enter next step, then whether the postcondition of arbitration functions is do not meet precondition then to terminate this interlock if not, then returns step 22 if not, if then terminate interlock, the executing state of function, interlock in Reconfigurations database;
Step 24: whether all linkage functions are all in complete state, then return step 22 if not, if then terminate this interlock;
As shown in Figure 3, wherein the step of n-back test is in step 23:
Step 31: press execution sequence and take out action from function, judge whether the precondition meeting this action;
Step 32: perform in team if then this action is joined, enter next step; Then judge that whether the postcondition of this action is terminate this action after precondition failure if not, if then terminate this action, then return step 31 if not;
Step 33: whether the postcondition judging action is that this action is skipped in failure, if then return step 31, then waits for the execution result of this action if not;
Step 34: whether action executing result success, then marks failure cause if not, and action in Reconfigurations database, function executing state, terminate this function; If then judge whether this function everything is all in complete state;
Step 35: then return step 31 if not, if then action in Reconfigurations database, function executing state, terminates this function.
As shown in Figure 5, method also includes online updating configuration step, and this step comprises:
Step 41: load initial configuration from configuration database;
Step 42: the request of monitoring online updating configuration, if the request that receives enters next step;
Step 43: judge whether that existence is in executory interlock;
Step 44: if then return step 43, then reloads interlock configuration if not;
Step 45: whether the service of judging terminates, and then returns step 42 if not, if then terminate service.
The present invention will be described to exemplify an object lesson below.Such as be configured with four interlocks from configuration database, be respectively interlock L1, L2, L3, L4.The triggering precondition of L1 is manual triggers, the triggering precondition of L2 is within every 1 hour, trigger once during 23:00 from 1:00 on December 4th, 2014 on December 4th, 2014, the triggering precondition of L3 is 13:00 triggering on December 4th, 2014, and the triggering precondition of L4 is for trigger as item point A=0.
Wherein L1, L2, L3, L4 can be performed by interlock client manual triggers, and wherein L2 can perform in periodically serviced triggering, and L3 can be triggered at special time, and L4 also can be triggered when satisfying condition.
When the time reaches 1:00 on the 4th December in 2014, L2 is triggered and is in execution, at this moment interface manual triggers L2, and the L2 that at this moment periodic condition triggers also is in executing state, and so the order of manual triggers is left in the basket; When serving startup, when the time is 1:05 on the 4th December in 2014, L2 can not be triggered immediately, is by the time triggered by periodic condition during 2:00 on the 4th December in 2014.
When the time reaches 13:00 on the 4th December in 2014, L2 and L3 can be triggered, and can not be triggered more than on December 4th, 2014 13:00, L3 when serving and starting by fixed point.
When serving startup, when meeting item point A=0, interlock L4 can not be triggered, and only have when item point changes to 0 from non-zero value, L4 is triggered.
Below more specifically for the L1 that links, setting interlock L1 precondition is that L1 is successfully triggered, and in postcondition, number of retries is all 3 times.As shown in Figure 7, F1, F2, F3, F4, F5 are five functions parallel under L1, and the precondition of F1 is item point B=1, and the precondition of other four functions is item point B=0.
The precondition of A2 is C=0, and stop after precondition failure, postcondition is unsuccessfully skip.
The precondition of A3 is D=0, and skip after precondition failure, postcondition is failure terminating.
The precondition of A4 is E=0, and skip after precondition failure, postcondition is that failed retry is skipped.
The precondition of A5 is G=0, skips after precondition failure, and postcondition is that failed retry stops.
The precondition of A6 is H=0, and skip after precondition failure, postcondition is unsuccessfully skip.
The precondition of A7 is I=0, and skip after precondition failure, postcondition is unsuccessfully skip.
The precondition of A8 is J=0, and skip after precondition failure, postcondition is that failed retry is skipped.
The precondition of A9 is K=0, and skip after precondition failure, postcondition is failure terminating.
The precondition of A10 is M=0, and skip after precondition failure, postcondition is that failed retry is skipped.
The precondition of A11 is N=0, skips after precondition failure, and postcondition is that failed retry stops.
The precondition of A12 is P=0, and skip after precondition failure, postcondition is unsuccessfully skip.
The precondition of A13 is R=0, and stop after precondition failure, postcondition is unsuccessfully skip.
The precondition of A14 is Q=0, and skip after precondition failure, postcondition is failure terminating.
Current environment is item point B=0, C=0, D=1, E=0, G=0, H=0, I=0, J=0, K=0 M=0, N=0, P=0, R=1, Q=0, so,
F1 does not meet precondition, and A1 does not perform, and functional mark is for perform failure.
F2 meets precondition, perform the action under F2, A2 meets precondition, perform A2, due to the postcondition of A2 be unsuccessfully after skip this action continuation n-back test, the result of A2 does not affect subsequent action execution, can continue to perform A3, A3 does not meet precondition, and skip this action executing after the precondition failure of A3, then F2 is labeled as and runs succeeded.
F3 meets precondition, perform an action A4, A4 meets precondition to start to perform, the postcondition of A4 is that unsuccessfully rear retry stops, then the operation result of A4 can affect the execution result of whole F3, so need to wait for that A4 could perform next action after complete, if A4 once runs succeeded and just represents and run succeeded in number of retries 3 times, if A4 runs succeeded, then continue to judge that the precondition of A5 continues to perform F3, if A4 fails to run succeeded in number of retries, then mark A4 and perform failure, and mark whole F3 and perform failure, do not continue to perform subsequent action.Under the prerequisite that A4 runs succeeded, A5 meets precondition to be continued to perform, and the postcondition of A5 is success after failed retry, and so the execution result of A5 does not affect the execution result of F3, then can judge the precondition of A6 simultaneously, and perform A6.
F4 meets precondition, start the precondition judging A7 action, A7 meets precondition, then start to perform, A7 postcondition does not affect the execution result of F4, then judge the precondition of A8 simultaneously, start to perform A8, the result of A8 does not affect the result of F4 yet, then judge the precondition of A9, start to perform A9, if A9 runs succeeded, then continue subsequent action, A7 while if A9 execution is failed, A8 is also complete, then marking A9 and F4 performs unsuccessfully, A7 while if A9 execution is failed, A8 have do not have complete, then will complete action mark do not had to be that action is interrupted.Under the prerequisite that A9 runs succeeded, A10, A11, A12 judge precondition simultaneously, can start to perform, and when in the end an action completes, run succeeded for F4 is labeled as.
F5 meets precondition, judges the precondition of A13, and A13 does not meet precondition and stops F5 after precondition failure, then mark A13 and do not meet precondition, and flag F 5 performs failure.
Specific embodiment described herein is only to the explanation for example of the present invention's spirit.Those skilled in the art can make various amendment or supplement or adopt similar mode to substitute to described specific embodiment, but can't depart from spirit of the present invention or surmount the scope that appended claims defines.
Although more employ configuration database, interlock service end herein, control the term such as service end, interlock client, do not get rid of the possibility using other term.These terms are used to be only used to describe and explain essence of the present invention more easily; The restriction that they are construed to any one additional is all contrary with spirit of the present invention.