Invention content
The purpose of the present invention is to provide a kind of peripheral equipment linkage detection method and device, can preferably solve business and open
Business stagnation problem caused by discovery peripheral equipment failure after beginning.
According to an aspect of the invention, there is provided a kind of peripheral equipment linkage detection method, including:
Controller is judged whether business is in idle condition;
If judging, the business is in idle condition, and linkage detection request is initiated, and wait for outside it to its peripheral equipment
The linkage detection response for joining the equipment response linkage detection request and replying;
Controller is used to indicate the alarm that corresponding peripheral equipment broken down and disappears according to waiting for as a result, judging whether to report
Breath.
Preferably, whether the controller is in idle condition the step of judging to business and includes:
If controller has been turned on and do not receive the task sign on from kiosk, judge that business is in idle shape
State.
Preferably, whether the controller is in idle condition the step of judging to business and includes:
If controller receives the task END instruction from kiosk, and does not receive next task sign on, then judge
Business is in idle condition.
Preferably, the controller is used to indicate corresponding peripheral equipment and has occurred according to waiting for as a result, judging whether to report
The step of warning message of failure, includes:
If it does not receive the linkage detection response of corresponding peripheral equipment within the default stand-by period or receives and be used to refer to external connection
The linkage detection response of unit exception, then controller, which determines to report, is used to indicate the alarm that corresponding peripheral equipment has broken down and disappears
Breath.
Preferably, it is used to indicate corresponding peripheral equipment in the controller and has sent out according to waiting for as a result, judging whether to report
After the step of warning message of raw failure, further include:
If it receives the corresponding peripheral equipment that is used to refer to that all peripheral equipments are replied within the default stand-by period normally to join
Dynamic detection responds, then controller starts self-test interval timer;
When the timing of the self-test interval timer reaches default self-test interval time and does not receive task yet
During sign on, the controller initiates linkage detection request to its peripheral equipment again.
Preferably, the controller has the middleware for supporting that various peripheral equipment self-checking commands call, and controller passes through
The self-test interface that the middleware is called to provide initiates linkage detection request to its peripheral equipment.
According to another aspect of the present invention, a kind of peripheral equipment linkage detection device is provided, including:
Judgment module, for judging whether business is in idle condition;
Detection module, for when judging that the business is in idle condition, linkage to be initiated to the peripheral equipment of controller
Detection request, and the linkage detection response for waiting for the peripheral equipment response linkage detection request and replying;
Processing module, for being used to indicate corresponding peripheral equipment and having broken down according to waiting for as a result, judging whether to report
Warning message.
Preferably, the processing module do not received within the default stand-by period corresponding peripheral equipment linkage detection response or
Receive be used to refer to peripheral equipment exception linkage detection response when, determine to report be used to indicate corresponding peripheral equipment occurred therefore
The warning message of barrier.
Preferably, the processing module includes self-test interval timer, if the processing module is in default wait for
In receive that all peripheral equipments reply the corresponding peripheral equipment that is used to refer to normally link detection response, then start it is described from
Interval timer is examined, and reaches default self-test interval time and still in the timing of the self-test interval timer
When not receiving task sign on, linkage detection request is initiated to the peripheral equipment from the detection module again.
Preferably, the detection module has the middleware for supporting that the peripheral equipment self-checking command calls, and passes through calling
The self-test interface that the middleware provides initiates linkage detection request to the peripheral equipment.
Compared with prior art, the beneficial effects of the present invention are:
The present invention each peripheral equipment of cycle detection under business idle state can find the failure of peripheral equipment in advance,
Business is avoided to find business stagnation caused by peripheral equipment failure after starting.
Specific embodiment
Below in conjunction with attached drawing to a preferred embodiment of the present invention will be described in detail, it should be understood that described below is excellent
Embodiment is selected to be merely to illustrate and explain the present invention, is not intended to limit the present invention.
Fig. 1 is peripheral equipment linkage detection method block diagram provided in an embodiment of the present invention, as shown in Figure 1, step includes:
Step S101:Controller is judged whether business is in idle condition.
(1) when controller has been turned on and does not receive first task sign on from kiosk, business is in sky
Not busy state;
(2) when controller receives the task END instruction from kiosk, and does not receive next task sign on, industry
Business is in idle condition.
Step S102:Controller judges that initiating linkage detection to its peripheral equipment when the business is in idle condition asks
It asks, and the linkage detection response for waiting for its peripheral equipment response linkage detection request and replying.
Step S103:Controller according to wait for as a result, judge whether to report be used to indicate corresponding peripheral equipment occurred therefore
The warning message of barrier.
Specifically include following three kinds of situations:
If the linkage for the 1, not receiving corresponding peripheral equipment within the default stand-by period detects response, controller determines to report
It is used to indicate the warning message that corresponding peripheral equipment breaks down;
If the 2, receiving the linkage detection response for being used to refer to peripheral equipment exception within the default stand-by period, controller is true
Surely it reports and is used to indicate the warning message that corresponding peripheral equipment breaks down;
If the 3rd, receive that all peripheral equipments reply within the default stand-by period to be used to refer to corresponding peripheral equipment normal
Linkage detection response, illustrates that failure is not detected in all peripheral equipments, does not need to report warning message at this time.
Further, a self-test interval timer can also be set, when peripheral equipment failure is not detected, opened
Dynamic self-test interval timer, if being monitored in the timing of the self-test interval timer from kiosk
Task sign on, then controller resets the self-test interval timer, and stops timing;If at the self-test interval
Between the timing of timer when reaching default self-test interval time and not receiving task sign on yet, the controller is again
Linkage detection request is initiated to its peripheral equipment.
The controller has the middleware for supporting that various peripheral equipment self-checking commands call, and controller passes through described in calling
The self-test interface that middleware provides initiates linkage detection request to its peripheral equipment.
Fig. 2 is peripheral equipment linkage detection device block diagram provided in an embodiment of the present invention, as shown in Fig. 2, including:Judge mould
Block 10, detection module 20, processing module 30.
Judgment module 10 is used to judge whether business is in idle condition.Specifically, it has been opened in controller
It moves and judges that business is in idle condition when not receiving first task sign on from kiosk, alternatively, working as controller
When receiving the task END instruction from kiosk, and not receiving next task sign on, judge that business is in idle condition.
Detection module 20 is used for when judging that the business is in idle condition, and linkage is initiated to the peripheral equipment of controller
Detection request, and the linkage detection response for waiting for the peripheral equipment response linkage detection request and replying.
Processing module 30 is used to be used to indicate corresponding peripheral equipment and broken down according to waiting for as a result, judging whether to report
Warning message.If specifically, the linkage for not receiving corresponding peripheral equipment within the default stand-by period detects response, handle
Module 30, which determines to report, is used to indicate the warning message that corresponding peripheral equipment has broken down;If it is received within the default stand-by period
The linkage detection response of peripheral equipment exception is used to refer to, then processing module 30, which determines to report, has been used to indicate corresponding peripheral equipment
The warning message to break down;If it receives the corresponding external connection that is used to refer to that all peripheral equipments are replied within the default stand-by period to set
Standby normal linkage detection response, illustrates that failure is not detected in all peripheral equipments, processing module 30 does not need to report at this time
Warning message.
The processing module 30 further comprises self-test interval timer, if processing module 30 is in the default stand-by period
The corresponding peripheral equipment that is used to refer to for inside receiving that all peripheral equipments reply normally links detection response, i.e., all peripheral equipments
Failure is not detected, then starts self-test interval timer.If reach in the timing of self-test interval timer
When presetting self-test interval time and not receiving task sign on yet, detection module 20 initiates to link to the peripheral equipment again
Detection request;If monitoring the task sign on from kiosk in the timing of self-test interval timer,
Start peripheral equipment and perform task, reset self-test interval timer, and stop the timing of self-test interval timer.
Detection module 20 has the middleware for supporting that various peripheral equipment self-checking commands call, by calling the middleware
The self-test interface of offer initiates linkage detection request to the peripheral equipment.
Device described in the present embodiment can be set in the controller.
The present invention accomplishes that peripheral equipment failure shifts to an earlier date by each peripheral equipment of cycle detection under national treasury business idle state
Early warning, and released and alarmed by controller in troubleshooting, failure judgement whether can exclude according to this, after omitting troubleshooting
Verification step.
Fig. 3 is peripheral equipment provided in an embodiment of the present invention linkage detection topological diagram, as shown in figure 3, controller with outside it
Connection equipment is connected by variety classes physical interface, for example, connecting card reader by USB interface, is connected and scanned with LAN interface
Door connects lattice door and warning lamp by RS232 interface.Above-mentioned peripheral equipment itself has a self-checking function, and controller end can be with
The built-in self-test interface for calling self-checking command is closed by the free design logic of controller application program, and by the self-test interface
Reason uses the self-checking function of each peripheral equipment.That is, the peripheral equipments such as card reader, warning lamp, sweep gate and lattice door
With self-checking function and the self-checking command of calling is provided, to carry out equipment self-inspection;Controller has middleware, supports various external connections
Equipment self-inspection instruction calls provide a self-test interface to controller application program, all outer by the way that this interface is called to can trigger
Join a self-test of equipment, and collect self-detection result.
The self-test interface that controller application call middleware provides starts or terminates to call with reference to service logic, and
It is continuously called by the self-test interval time of setting.For example, under business idle state, first time self-test, controller passes through calling
Self-test interface, trigger aforementioned four peripheral equipment self-test, if the self-detection result of aforementioned four peripheral equipment show normally,
After the self-test interval time of setting, self-test interface triggering aforementioned four peripheral equipment is called to carry out second of self-test, later certainly
It is identical with second of self-test to examine flow.
Fig. 4 is peripheral equipment linkage overhaul flow chart provided in an embodiment of the present invention, and existing controller peripheral equipment exists
During design, increase self detecting function and self-test interface is provided, with reference to the service logic of two generation goods hair system, in the appropriate time
Duan Jinhang cycle detections, as shown in Figure 4.
Controller application operation flow includes:
Step 1:Controller starts, and normally enters standby interface, not yet receives first from kiosk at this time and appoints
Business sign on, judges that business is in idle condition, and linkage detection is initiated to peripheral equipment.
Step 2:After peripheral equipment carries out self-test, self-detection result is fed back into controller, self-detection result includes three kinds:
(1) abnormality code is received, illustrates that peripheral equipment may break down, needs to carry out alarm;
(2) code of feedback is not received, illustrates that peripheral equipment may break down, and needs to carry out alarm;
(3) normal code is received, illustrates peripheral equipment failure is not detected, without alert process.
After peripheral equipment Failure elimination, controller can release alarm.
Step 3:Start self-test interval timer, and the task sign on from kiosk is monitored.
(1) if not monitoring to come from yet when the timing of self-test interval timer reaches default self-test interval time
The task sign on of kiosk then re-initiates linkage detection, and performs step 2;
(2) if monitoring the task sign on from kiosk in the timing of self-test interval timer,
Its peripheral equipment is then controlled to start and starts to perform the task that the task sign on is specified, peripheral equipment cannot carry out at this time
Equipment self-inspection.
Wherein, the peripheral equipment can be sweep gate, lattice door, identification card reader, alarm lamp etc., the task
Sign on can be for starting one or more of sweep gate, lattice door, identification card reader, alarm lamp into work
Make the instruction of state.
It should be noted that because peripheral equipment is all single thread processing, it can not be when other instructions be performed simultaneously
Self-test is carried out, that is, linkage detection of the task phase needs stopping to peripheral equipment is being performed, so with reference to service logic and reality
Usage scenario, special disposal business start the equipment self-inspection logic with two critical points of service ending.Specifically, work as business
During beginning, controller stops peripheral equipment self-test, starts execution task;When service ending, controller starts peripheral equipment certainly
Inspection.
Step 4:Controller is monitored the task END instruction from kiosk, if monitoring appointing from kiosk
Business END instruction, then according to the task END instruction, control its peripheral equipment to end task, and business is in idle shape at this time
State.
The task END instruction is for making whole external connections such as sweep gate, lattice door, identification card reader, alarm lamp
Equipment enters the instruction of idle state, i.e., the national treasury business performed currently without needs controls peripheral equipment power cut-off state.
Step 5:Step 3 and step 4 are repeated, i.e. controller is performed in business idle phase cycle to peripheral equipment
Linkage detection;
It should be noted that each peripheral equipment is not fixed from the overhaul period, and possibly can not during each peripheral equipment failure
Self-test information is returned in time, controller is caused to receive the increase of peripheral equipment self-checking feedback period, therefore, in order to ensure that external connection is set
High-frequency detects under standby normal condition, can notify failure at once, and will not be longer than because of the self-checking feedback period of faulty equipment
The self-checking command that the preset period causes controller to send out is lined up, and program threads is caused, which to continue to increase, causes controller dead
Machine, the present invention has carried out logical process to the calling of equipment self-inspection interface, when becoming fixed intervals from fixed cycle recursive call
Between continuously call, that is to say, that the fixed time intervals again after determining to receive all self-checking feedbacks initiate next self-test.
In conclusion the present invention has following technique effect:
The present invention can be applied in people's row cash exchequer, to sweep gate, lattice door, identification under business idle state
The peripheral equipments such as card reader, alarm lamp are detected, and give warning in advance equipment fault, and national treasury business is avoided to stagnate.
Although the present invention is described in detail above, but the invention is not restricted to this, those skilled in the art of the present technique
It can be carry out various modifications with principle according to the present invention.Therefore, all modifications made according to the principle of the invention, all should be understood to
Fall into protection scope of the present invention.