A kind of software-hardware synergism prevents the repositioning method of system in case of system halt interrupting service
Technical field
The present invention relates to utilize software-hardware synergism to finish in a kind of electronic equipment and prevent the repositioning method of system in case of system halt, in particular in the reseting logic circuit design of communication field, cooperate jointly with hardware by software, anti-locking system operation is crashed and is caused the repositioning method of service disconnection.
Background technology
In the electronic equipment of prior art, for appearring in anti-locking system, the CPU race extremely or under the abnormal situation of work can carry out reset processing timely, all designed reseting logic in the system.
For a veneer, its general reseting logic is simply to be finished by the chip that resets of a band house dog, feeds the mode of dog by software and controls resetting of whole plate.This way probably can cause the newsletter of whole communication network to interrupt.When dead, do not had feeding-dog signal as running at software, veneer can be restarted.During to system software version updating, also have in the time of need restarting software resetting system or veneer.Or cause by sudden task under the situation that the CPU working load increases the weight of at some, make software can't provide feeding-dog signal timely, though at this moment CPU and software but still can cause that veneer or system equipment reset, and cause service disconnection all in operate as normal.
For the total system of equipment, system to the reset schemes of each ply-yarn drill also compare simple, security is very low.Generally be to give each ply-yarn drill a reset signal, indicate and currently whether will carry out one board forced resetting that this way causes easily because the interference on the line makes the ply-yarn drill maloperation, causes the phenomenon of whole sheet reset from master control borad.
Therefore, prior art awaits to continue to improve and development.
Summary of the invention
Purpose of the present invention is exactly that reseting logic was too simple in the past in order to solve, reset signal is not distinguished, resetting in any case all can cause restarting of whole veneer, the technical matters that causes service disconnection designs a kind of reset schemes that can solve the software-hardware synergism operation of above various imperfection situations.
Technical scheme of the present invention comprises:
A kind of software-hardware synergism prevents the repositioning method of system in case of system halt interrupting service, and it may further comprise the steps:
A, under the system exception situation, select software reset or hardware reset;
B, for the software reset who causes by the software reason, system only partly resets to CPU, and service part is not handled, and is constantly professional when guaranteeing the software reset;
C, if system has surpassed the software reset of pre-determined number in the given time, then carry out hardware reset.
Described method, wherein, the condition of described hardware reset also comprises:
Power on, by reset key, hard reset order under the webmaster, ply-yarn drill receives that forced resetting signal or veneer self check do not pass through.
Described method, wherein, described software reset's condition also comprises:
After downloading and finish, version restarts or receives software reset's order that master control borad issues.
Described method, wherein, described step C also comprises: a programmable logic device (PLD) is set in the described system, wherein be provided with two counters, one first counter is a house dog, and the numeral that its zero clearing control end needs CPU to write hello dog byte in the given time changes once at least, otherwise overflows; One second counter is counted the number of times that overflows of described first counter, overflows when counting pre-determined number; After this second counter overflows, cut off of the input of crystal oscillator clock, make the described chip that resets produce the output that resets, form the hardware reset process to the chip that resets.
Described method, wherein, described step C also comprises: the count value of this second counter is read back by the number of times byte of overflowing of software, and being used for judging is that hardware is restarted or software restarting.
Described method, wherein, described step C also comprises: the count value of described second counter is made amendment by the number of times byte of overflowing of software, to produce hardware reset when described first counter overflows next time.
A kind of software-hardware synergism provided by the present invention prevents the repositioning method of system in case of system halt interrupting service, has improved the stability of system greatly, and the reset signal under the different situations has been carried out Intelligent treatment, has strengthened the dirigibility of system reset; Reduced the possibility of the service disconnection that exceptional reset causes.
Description of drawings
Fig. 1 is the FB(flow block) that resets of the inventive method;
Fig. 2 is the watchdog reset logic diagram of the inventive method.
Embodiment
Below in conjunction with accompanying drawing, will carry out comparatively detailed explanation to each preferred embodiment of the present invention.
Described software-hardware synergism of the present invention prevents the repositioning method of system in case of system halt interrupting service, the scheme that has adopted software reset and hardware reset to combine, can produce different homing actions according to producing unusual situation difference, thereby reach the minimum that influences system and business.
Resetting in the inventive method is divided into two big classes: hardware reset and software reset, the software reset wherein CPU part that only resets, and the chip of service part is not operated, thereby business is had the influence of interruption.Hardware reset then is that all chips that can carry out reset operation on the veneer are carried out reset operation, the whole sheet reset of saying usually just, and this moment can interrupting service, exerts an influence, so non-to the essential sheet reset of not putting in order.
The condition that reseting logic described in the preferred embodiment of the present invention produces has following several, carries out corresponding reset operation according to the difference of the condition of generation.
|
Hardware reset |
The software reset |
The generation condition |
1, power on 2, by " hard reset " order under reset key 3, the webmaster, ply-yarn drill receives that forced resetting signal 4, veneer self check that master control borad sends do not pass through |
1, version restarts 2 after downloading and finishing, receives that " software reset " order 3, software run and flies under the master control borad |
|
5, software reset N time at the appointed time |
|
Reset effect |
Return to the state when powering on |
Resetting does not influence single board service |
Homing action |
CPU, special chip reset, and programmable logic device (PLD) is downloaded again |
Cpu reset |
Hardware implementation mode |
1, the chip that resets satisfies reset condition, produce hardware reset 2, programmable logic device (PLD) monitors the forced resetting signal that master control borad provides, then produce hardware reset 3, when overflowing, house dog detects the numeration of once overflowing number of times, if be N-1, then produce hardware reset |
Under the situation that house dog enables, if CPU software is fed dog normally at software feeding-dog signal was not provided in the cycle, then house dog is overflowed, and CPU is resetted |
Software realization mode |
CPU is provided with the reseting register of special chip, closes house dog earlier, will overflow the number of times numeration then and be set to N |
CPU carries out the endless loop program, does not feed house dog |
For the software reset who is caused by the software reason, system only partly resets to CPU, and service part is not handled, and is constantly professional when guaranteeing the software reset.If the software reset has appearred N time in system in the given time, then may problem be arranged total system, can't deal with problems by the software reset, veneer or system carry out hardware reset, and this moment, business can be interrupted.This times N is the basis numeral that system's characteristics can be defined by the user separately, and the described schedule time also can be preestablished according to system's characteristics separately by the user.
Be provided with 2 counters in the described complex programmable logic device (CPLD) of the inventive method, as depicted in figs. 1 and 2, first counter 1 is a house dog, the numeral (0/1) that its zero clearing control end needs CPU software to write hello dog byte in the software programmable official hour changes once at least, otherwise overflows.The time of overflowing of this counter can be done corresponding adjusting according to the busy not busy degree of CPU, can suitably the time be extended, in this case as long as corresponding regulate overflowing counting control and just can realizing of counter.First counter 1 overflows software reset's pin that end is connected to CPU, produces software reset's process.The counting of first counter 1 can enable byte control by dongle to be stopped/starting.
The number of times that overflows of 2 pairs first counters 1 of second counter is counted, and overflows when counting N.After second counter 2 overflows, cut off of the input of crystal oscillator clock, make the chip that resets produce the output that resets, form the hardware reset process to the chip that resets.The count value of this second counter 2 can be read back by the number of times byte of overflowing of software, and being used for judging is that hardware is restarted or software restarting.The count value of second counter 2 can be made amendment by the number of times byte of overflowing of software, be modified as N-1 after, if first counter 1 overflows once more, will produce hardware reset.Software starts the back at every turn will be given in official hour and overflow number of times byte register and write 0, if to guarantee under the normal condition in the stipulated time that first counter 1 overflows N time then produces hardware reset.
Also use the management clock signal of master control borad to gather the signal that master control borad offers the forced resetting line of ply-yarn drill in the CPLD, the use shift register compares, here the forced resetting signal adopts the tagged word of a string serial to represent, after monitoring this tagged word, cut off of the input of crystal oscillator clock to the chip that resets, make the chip that resets produce the output that resets, form the hardware reset process.Can effectively leach the undesired signal on the forced resetting line like this, prevent maloperation.
This logic of the inventive method is described in detail as follows:
The chip that resets in the described veneer is responsible for hardware reset, and its output that resets is connected to the resetting pin of CPU, programmable logic device (PLD) and each special chip.The hand-reset input of the described chip that resets is connected to the hand-reset end of the chip that resets, and produces the hardware reset operation by reset key.The house dog input end of the described chip that resets is connected to programmable logic device (PLD), provide clock signal by programmable logic device (PLD) for it, programmable logic device (PLD) stops to provide clock signal when producing one of following situation, the chip that resets produces hardware reset: house dog was once overflowed time counting number and reached N time in the stipulated time, or, when the forced resetting signal that master control borad sends is the tagged word of regulation.
Be provided with a house dog program in the programmable logic device (PLD) on the described veneer, the dog that feeds that requires in software dictates feeds dog (control level variation) once in the time at least, otherwise house dog overflows, and CPU is resetted.Software uses house dog hello dog byte position to write " 0 "/" 1 " and feeds dog.House dog can be under an embargo (such as start, during version updating), software uses house dog enable switch byte to write " 0 " to forbid house dog work.Logic defaults to this steering logic to forbid house dog work in the programmable logic device (PLD).
Also have the number of times that logic was once overflowed house dog to count in the programmable logic device (PLD) of the present invention, carry out hardware reset when having produced watchdog reset again after N-1 time when counting down to.Software overflows the number of times zero clearing with house dog after will be at the fixed time, to guarantee the logic of " if having in the stipulated time overflow just carry out hardware reset above N house dog ".Software uses house dog to overflow number of times byte position and writes zero and remove house dog and overflow time counting number.
The count value of the number of times that house dog was once overflowed behind the described hardware reset is 0, can use house dog once to overflow number of times and differentiate soft/sign of restarting firmly as software.When the number of times that once overflowed when house dog is 0, show it is to restart firmly; When the number of times that once overflowed when house dog is not 0, show it is soft reboot.Software reads house dog and overflows the corresponding house dog in number of times byte position and once overflowed number of times.Software can be revised house dog and once overflow number of times, and after being write as N-1, house dog is overflowed once more, will produce hardware reset, thereby realizes the software control hardware reset.
The inventive method is distinguished the reset signal under the different situations by the co-operating of software and hardware, and does suitable processing, and some software or CPU are run resetting of waiting indefinitely and cause, is guaranteeing that recovery system normally moves under the unbroken situation of communication traffic.Repositioning method of the present invention has improved the stability of system greatly, and the reset signal under the different situations has been carried out Intelligent treatment, has strengthened the dirigibility of system reset; Reduced the possibility of the service disconnection that exceptional reset causes.
Should be understood that above-mentioned description at specific embodiment is comparatively detailed, can not therefore think the restriction to scope of patent protection of the present invention, scope of patent protection of the present invention should be as the criterion with claims.