Summary of the invention
The object of the present invention is to provide a kind of peripheral equipment interlock detection method and device, the business stagnation problem that the business that can solve better starts rear discovery peripheral equipment fault and causes.
According to an aspect of the present invention, provide a kind of peripheral equipment interlock detection method, comprising:
Whether controller is in idle condition to business judges;
If judge, described business is in idle condition, then initiate interlock to its peripheral equipment and detect request, and the interlock waited for the described interlock of its peripheral equipment response to detect request and reply detects response;
Controller, according to wait result, judges whether to report the warning message being used to indicate corresponding peripheral equipment and having broken down.
Preferably, whether described controller is in business the step that idle condition judges and comprises:
If when controller has started and do not received the task sign on from kiosk, then judged that business is in idle condition.
Preferably, whether described controller is in business the step that idle condition judges and comprises:
If controller receives the task END instruction from kiosk, and do not receive next task sign on, then judge that business is in idle condition.
Preferably, described controller, according to wait result, judges whether to report the step being used to indicate the warning message that corresponding peripheral equipment has broken down to comprise:
If the interlock not receiving corresponding peripheral equipment within the default stand-by period detects response or receives the interlock being used to refer to peripheral equipment exception detect response, then controller determines to report the warning message being used to indicate corresponding peripheral equipment and having broken down.
Preferably, at described controller according to wait result, after judging whether to report the step being used to indicate the warning message that corresponding peripheral equipment has broken down, also comprise:
What if receive within the default stand-by period, all peripheral equipments replied be used to refer to, and corresponding peripheral equipment links normally detects response, then controller starts self-inspection timer interval time;
When the timing of described self-inspection timer interval time reaches default self-inspection interval time and do not receive task sign on yet, described controller is again initiated interlock to its peripheral equipment and is detected request.
Preferably, described controller has the middleware supporting that various peripheral equipment self-checking command calls, the self-inspection interface that controller provides by calling described middleware, initiates interlock detect request to its peripheral equipment.
According to a further aspect in the invention, provide a kind of peripheral equipment interlock pick-up unit, comprising:
Judge module, for whether being in idle condition to business judges;
Detection module, for when judging that described business is in idle condition, the peripheral equipment to controller is initiated interlock and is detected request, and the interlock waited for the described interlock of described peripheral equipment response to detect request and reply detects response;
Processing module, for according to wait result, judges whether to report the warning message being used to indicate corresponding peripheral equipment and having broken down.
Preferably, when described processing module does not receive the interlock detection response of corresponding peripheral equipment or receives the interlock detection response being used to refer to peripheral equipment exception within the default stand-by period, determine to report the warning message being used to indicate corresponding peripheral equipment and having broken down.
Preferably, described processing module comprises self-inspection timer interval time, if described processing module receive within the default stand-by period all peripheral equipments reply be used to refer to corresponding peripheral equipment link normally detect response, then start described self-inspection timer interval time, and when the timing of described self-inspection timer interval time reaches default self-inspection interval time and do not receive task sign on yet, again initiate interlock to described peripheral equipment by described detection module and detect request.
Preferably, described detection module has the middleware supporting that described peripheral equipment self-checking command calls, and by calling the self-inspection interface that described middleware provides, initiating interlock detect request to described peripheral equipment.
Compared with prior art, beneficial effect of the present invention is:
The present invention is each peripheral equipment of cycle detection under business idle condition, can find the fault of peripheral equipment in advance, avoids business to start rear discovery peripheral equipment fault and the business that causes is stagnated.
Embodiment
Below in conjunction with accompanying drawing to a preferred embodiment of the present invention will be described in detail, should be appreciated that following illustrated preferred embodiment is only for instruction and explanation of the present invention, is not intended to limit the present invention.
Fig. 1 is the peripheral equipment interlock detection method block diagram that the embodiment of the present invention provides, and as shown in Figure 1, step comprises:
Step S101: whether controller is in idle condition to business judges.
(1) when controller has started and do not receive first task sign on from kiosk, business is in idle condition;
(2) when controller receives the task END instruction from kiosk, and when not receiving next task sign on, business is in idle condition.
Step S102: initiate interlock to its peripheral equipment when controller judges that described business is in idle condition and detect request, and the interlock waited for the described interlock of its peripheral equipment response to detect request and reply detects response.
Step S103: controller, according to wait result, judges whether to report the warning message being used to indicate corresponding peripheral equipment and having broken down.
Specifically comprise following three kinds of situations:
If 1 interlock not receiving corresponding peripheral equipment within the default stand-by period detects response, then controller determines to report the warning message being used to indicate corresponding peripheral equipment and breaking down;
If 2 receive the interlock being used to refer to peripheral equipment exception within the default stand-by period detect response, then controller determines to report the warning message being used to indicate corresponding peripheral equipment and breaking down;
If 3 receive within the default stand-by period all peripheral equipments reply be used to refer to corresponding peripheral equipment link normally detect response, illustrate that all peripheral equipments all do not detect fault, now do not need to report warning message.
Further, self-inspection timer interval time can also be set, when peripheral equipment fault not detected, start self-inspection timer interval time, if monitor the task sign on from kiosk in the timing of described self-inspection timer interval time, then controller resets described self-inspection timer interval time, and stops timing; If when the timing of described self-inspection timer interval time reaches default self-inspection interval time and do not receive task sign on yet, described controller is again initiated interlock to its peripheral equipment and is detected request.
Described controller has the middleware supporting that various peripheral equipment self-checking command calls, the self-inspection interface that controller provides by calling described middleware, initiates interlock detect request to its peripheral equipment.
Fig. 2 is the peripheral equipment interlock pick-up unit block diagram that the embodiment of the present invention provides, and as shown in Figure 2, comprising: judge module 10, detection module 20, processing module 30.
Judge module 10 for whether being in idle condition to business judges.Specifically, when controller has started and do not received first task sign on from kiosk, it judges that business is in idle condition, or, when controller receives the task END instruction from kiosk, and when not receiving next task sign on, judgement business is in idle condition.
Detection module 20 is for when judging that described business is in idle condition, and the peripheral equipment to controller is initiated interlock and detected request, and the interlock waited for the described interlock of described peripheral equipment response to detect request and reply detects response.
Processing module 30, for according to wait result, judges whether to report the warning message being used to indicate corresponding peripheral equipment and having broken down.Specifically, if the interlock not receiving corresponding peripheral equipment within the default stand-by period detects response, then processing module 30 determines to report the warning message being used to indicate corresponding peripheral equipment and having broken down; The interlock being used to refer to peripheral equipment exception if receive within the default stand-by period detects response, then processing module 30 determines to report the warning message being used to indicate corresponding peripheral equipment and having broken down; If receive within the default stand-by period all peripheral equipments reply be used to refer to corresponding peripheral equipment link normally detect response, illustrate that all peripheral equipments all do not detect fault, now processing module 30 does not need to report warning message.
Described processing module 30 comprises self-inspection timer interval time further, if processing module 30 receive within the default stand-by period all peripheral equipments reply be used to refer to corresponding peripheral equipment link normally detect response, namely all peripheral equipments all do not detect fault, then start self-inspection timer interval time.If when the timing of self-inspection timer interval time reaches default self-inspection interval time and do not receive task sign on yet, detection module 20 is again initiated interlock to described peripheral equipment and is detected request; If monitor the task sign on from kiosk in the timing of self-inspection timer interval time, then start peripheral equipment and execute the task, reset self-inspection timer interval time, and stop the timing of self-inspection timer interval time.
Detection module 20 has the middleware supporting that various peripheral equipment self-checking command calls, and by calling the self-inspection interface that described middleware provides, initiating interlock detect request to described peripheral equipment.
Device described in the present embodiment can be arranged in the controller.
Whether the present invention, by each peripheral equipment of cycle detection under national treasury business idle condition, accomplishes that peripheral equipment fault gives warning in advance, and removes warning at failture evacuation by controller, can failure judgement get rid of according to this, thus omits the verification step after failture evacuation.
Fig. 3 is that the peripheral equipment interlock that the embodiment of the present invention provides detects topological diagram, and as shown in Figure 3, controller is connected by variety classes physical interface with its peripheral equipment, such as, connect card reader by USB interface, connect sweep gate by LAN interface, connect lattice door and warning lamp by RS232 interface.Above-mentioned peripheral equipment self possesses self-checking function, and controller end built-inly can call the self-inspection interface of self-checking command, by the free design logic of controller application program, and by the self-checking function of described each peripheral equipment of self-inspection interface reasonable employment.That is, the peripheral equipment such as card reader, warning lamp, sweep gate and lattice door has self-checking function and provides the self-checking command called, to carry out equipment self-inspection; Controller has middleware, supports that various peripheral equipment self-checking command calls, provides a self-inspection interface to controller application program, can trigger a self-inspection of all peripheral equipments, and collect self-detection result by calling this interface.
The self-inspection interface that controller application call middleware provides, starts in conjunction with service logic or terminates to call, and calls continuously interval time by the self-inspection of setting.Such as, under business idle condition, first time self-inspection, controller is by calling self-inspection interface, trigger above-mentioned four peripheral equipment self-inspections, if the self-detection result display of above-mentioned four peripheral equipments is normal, then after self-inspection interval time of setting, call above-mentioned four peripheral equipments of self-inspection interface triggering and carry out second time self-inspection, self-inspection flow process is afterwards identical with second time self-inspection.
Fig. 4 is the peripheral equipment interlock overhaul flow chart that the embodiment of the present invention provides, existing controller peripheral equipment is when designing, and increasing self detecting function also provides self-inspection interface, in conjunction with two generation goods send out the service logic of system, cycle detection is carried out, as shown in Figure 4 in the appropriate time period.
Controller application operational scheme comprises:
Step 1: controller starts, and normally enter standby interface, now not yet receive first task sign on from kiosk, judgement business is in idle condition, initiates interlock to peripheral equipment and detects.
Step 2: self-detection result is fed back to controller after carrying out self-inspection by peripheral equipment, self-detection result comprises three kinds:
(1) receive abnormality code, illustrate that peripheral equipment may break down, need to carry out alarm;
(2) do not receive the code of feedback, illustrate that peripheral equipment may break down, need to carry out alarm;
(3) receive normal code, illustrate and peripheral equipment fault do not detected, do not carry out alert process.
When after peripheral equipment Failure elimination, controller can remove warning.
Step 3: start self-inspection timer interval time, and the task sign on from kiosk is monitored.
(1) if do not monitor the task sign on from kiosk when the timing of self-inspection timer interval time reaches default self-inspection interval time yet, then again initiate interlock and detect, and perform step 2;
(2) if monitor the task sign on from kiosk in the timing of self-inspection timer interval time, then control its peripheral equipment start and start to perform the task that described task sign on specifies, now peripheral equipment can not carry out equipment self-inspection.
Wherein, described peripheral equipment can be sweep gate, lattice door, identification card reader, alarm lamp etc., and described task sign on can be used to start the one or more instructions entering duty in sweep gate, lattice door, identification card reader, alarm lamp.
It should be noted that, because peripheral equipment is all single-threaded process, self-inspection cannot be carried out when other instruction of execution simultaneously, namely need to stop detecting the interlock of peripheral equipment in the stage of executing the task, so in conjunction with service logic and actual use scenes, special disposal business starts the equipment self-inspection logic with service ending two critical points.Specifically, when business starts, controller stops peripheral equipment self-inspection, starts to execute the task; When service ending, controller starts peripheral equipment self-inspection.
Step 4: controller is monitored the task END instruction from kiosk, if monitor the task END instruction from kiosk, then according to described task END instruction, control its peripheral equipment and end task, now business is in idle condition.
Described task END instruction is used to make whole peripheral equipment such as sweep gate, lattice door, identification card reader, alarm lamp enter the instruction of idle condition, i.e. the current national treasury business not needing to perform, controls peripheral equipment power cut-off state.
Step 5: repeated execution of steps 3 and step 4, namely controller performs in the circulation of business idle phase and detects the interlock of peripheral equipment;
It should be noted that, not fixing from the overhaul period of each peripheral equipment, and possibly cannot return self-inspection information in time during each peripheral equipment fault, controller is caused to receive the increase of peripheral equipment self-checking feedback cycle, therefore, in order to ensure that high-frequency detects under peripheral equipment normal condition, fault can be notified at once, can not be longer than because of the self-checking feedback cycle of faulty equipment the self-checking command that the cycle preset causes controller to send again to queue up, cause program threads to continue to increase and cause controller to crash, the present invention has carried out logical process to calling of equipment self-inspection interface, become fixed interval from fixed cycle recursive call to call continuously, that is, fixed time intervals again after determining to receive all self-checking feedbacks, initiate next self-inspection.
In sum, the present invention has following technique effect:
The present invention can be applied in People's Bank of China's cash exchequer, and detect peripheral equipments such as sweep gate, lattice door, identification card reader, alarm lamps under business idle condition, give warning in advance equipment failure, avoids national treasury business to stagnate.
Although above to invention has been detailed description, the present invention is not limited thereto, those skilled in the art of the present technique can carry out various amendment according to principle of the present invention.Therefore, all amendments done according to the principle of the invention, all should be understood to fall into protection scope of the present invention.