CN100359457C - Method for realizing normal working of communication interface based on sending interruption - Google Patents

Method for realizing normal working of communication interface based on sending interruption Download PDF

Info

Publication number
CN100359457C
CN100359457C CNB2004100986816A CN200410098681A CN100359457C CN 100359457 C CN100359457 C CN 100359457C CN B2004100986816 A CNB2004100986816 A CN B2004100986816A CN 200410098681 A CN200410098681 A CN 200410098681A CN 100359457 C CN100359457 C CN 100359457C
Authority
CN
China
Prior art keywords
communication interface
duty
working state
sign
normal
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.)
Expired - Fee Related
Application number
CNB2004100986816A
Other languages
Chinese (zh)
Other versions
CN1790252A (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.)
Huawei Technologies Co Ltd
Original Assignee
Huawei Technologies 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 Huawei Technologies Co Ltd filed Critical Huawei Technologies Co Ltd
Priority to CNB2004100986816A priority Critical patent/CN100359457C/en
Publication of CN1790252A publication Critical patent/CN1790252A/en
Application granted granted Critical
Publication of CN100359457C publication Critical patent/CN100359457C/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Computer And Data Communications (AREA)

Abstract

The present invention provides a method for realizing the normal work of communication interfaces based on sending interruption. The present invention is mainly characterized in that the working state of a single board communication interface is determined, and the storage state of a single board sending buffer is determined; when the working state of the communication interface is under a non-working state and the storage state of the sending buffer is not blank, the communication interface can be determined to be under an abnormal working state, and the communication interface is initialized. The present invention can accurately position the abnormal working state of the single board communication interface in time, namely a deadlock state, and when the abnormal working state of the communication interface is determined, the communication interface can be automatically initialized to make the communication interface automatically recover the normal working state, so that the technical scheme provided by the present invention obtains the purpose of enhancing the availability of a system.

Description

A kind of based on sending the method that the communication interface of interrupting realizes operate as normal
Technical field
The present invention relates to electronic equipment, be specifically related to a kind of based on sending the method that the communication interface of interrupting realizes operate as normal.
Background technology
At present, each veneer of the communications field generally all can be used communication processor, the communication processor of veneer uses its communication interface that carries and other veneers or peripheral hardware etc. to carry out data transmission, carries out debug print output etc. as veneer by the communication interface that communication processor carries.
When the communication interface of communication processor adopts transmission down trigger mode to send data,, can make the communication interface of veneer be in deadlock state, thereby make veneer enter the deadlock state if this communication interface occurs sending the situation that interruption is lost.
Be example to print communication interface below, the process of communication interface generation deadlock state is described.
Article one, the implementation of print statement mainly comprises two parts, and the information that first is to use printf will need to print is stored in the printing buffer storage; Second portion is that communication interface will be printed the type information of storing in the buffer storage and output on the hyper terminal one by one.
At present, first adopts the obstruction mode that the information that needs in the printf to print is stored in and prints in the buffer storage, be in full state if promptly print buffer storage, printf will get clogged, and wait until that always the printing buffer storage can put down the information that needs to print and just can withdraw from.Second portion then mainly adopts the down trigger mode that sends.
When communication interface adopts transmission down trigger mode output print information, if losing one in the output print information process, communication interface sends interruption, communication interface is in off working state, print buffer storage and then be in full state always, printf will get clogged, thereby cause communication interface to be in deadlock state, veneer enters the deadlock state.
When communication interface is in deadlock state, can only make communication interface recover normal duty by the mode of manual outage, system availability is poor.
Summary of the invention
The invention provides a kind of method, make communication interface when being in deadlock state, can recover normal duty automatically, realized improving the purpose of system availability based on the communication interface realization operate as normal that sends interruption.
For achieving the above object, provided by the invention a kind of based on sending the method that the communication interface of interrupting realizes operate as normal, comprising:
A, determine the duty of single board communication interface;
B, determine that described veneer sends the store status of buffer memory;
C, be the store status of off working state and described transmission buffer memory when being non-NULL, determine that described communication interface is in abnormal operating state in the duty of described communication interface, and the described communication interface of initialization.
Described veneer comprises: based on sending the printout veneer that interrupts.
Described communication interface is: serial communication interface or parallel communication interface.
Also comprise before the described method: the duty sign that the single board communication interface is set;
Described duty sign is represented duty or expression off working state;
Described duty sign triggers to send in communication interface and is expressed as described duty when interrupting;
And described step a comprises: determine according to described duty sign whether the single board communication interface triggers transmission and interrupt.
Described step a further comprises:
A1, regularly detect the duty sign of described single board communication interface according to predetermined time interval;
A2, judge that described duty sign represents that described duty still represents described off working state;
If described duty sign is represented described duty, described duty sign is set to represent described off working state, and returns described step a1;
If described duty sign is represented described off working state, to described step b.
Described method also comprises: the predetermined failure number of times that described communication interface is in abnormal operating state is set; And described duty sign is set to represent that the step of described off working state also comprises among the described step a2:
The note sub-value of described predetermined failure number of times resets.
Described step c further comprises:
The store status of judging described transmission buffer memory is that dummy status still is non-dummy status;
If the store status of described transmission buffer memory is a dummy status, the note sub-value of the predetermined failure that resets number of times;
If the store status of described transmission buffer memory is non-dummy status, be described predetermined failure time number scale, and when described note sub-value reaches described predetermined failure number of times, determine that described communication interface is in abnormal operating state, and the described communication interface of initialization.
Description by technique scheme can learn obviously that the present invention can determine duty, the off working state of communication interface simply and easily by the duty sign is set for communication interface; By the off working state of single board communication interface and the store status of transmission buffer memory, can locate the abnormal operating state of single board communication interface fast, i.e. deadlock state; By predetermined time interval, predetermined failure number of times are set, make the present invention can carry out the abnormal operating state of single board communication interface in time, accurately locate; When the present invention is in abnormal operating state in definite communication interface,, make communication interface can revert to normal duty automatically by initialize communication interface; Thereby realized improving the purpose of system availability by technical scheme provided by the invention.
Description of drawings
Fig. 1 is the process flow diagram that communication interface of the present invention realizes operate as normal.
Embodiment
The communication interface of veneer is when adopting the mode that sends interruption that the data in its transmission buffer memory are sent, if the single board communication interface is non-NULL again in the store status of the transmission buffer memory that is in off working state and this veneer, so, this communication interface must be to be in abnormal operating state, i.e. deadlock state.Communication interface can revert to normal duty automatically by initialization when being in deadlock state.Therefore, core of the present invention is: the duty of determining the single board communication interface, determine that veneer sends the store status of buffer memory, in the duty of described communication interface is that the store status of off working state and described transmission buffer memory is when being non-NULL, determine that described communication interface is in abnormal operating state, and the described communication interface of initialization.Thereby the present invention can locate fast to the deadlock state of communication interface, and makes communication interface can recover normal duty automatically by initialize communication interface, efficiently solves the problem of the system availability difference that exists in the prior art.
Based on core concept of the present invention technical scheme provided by the invention is further described below.
Communication interface among the present invention comprises: serial communication interface and parallel communication interface.
The present invention at first needs to determine the duty of communication interface, determines that the method for the duty of communication interface has a lot, as by judging whether communication interface has methods such as triggering transmission interruption at the fixed time at interval.
The present invention can adopt the method for the duty sign that the single board communication interface is set to determine the duty of communication interface.The duty sign of the communication interface of setting of the present invention can be represented the two states of communication interface: duty or off working state.
When the single board communication interface triggered the transmission interruption, the duty sign of communication interface should be set to duty.
The present invention can regularly detect the duty sign of communication interface according to predetermined time interval, and predetermined time interval can be set according to the real needs of veneer.The process that regularly detects according to predetermined time interval can start by cycle timer.
When detecting the duty sign of communication interface, if when detecting the duty of communication interface and being masked as duty, represent that this communication interface can trigger transmission and interrupt, be in normal operating conditions, this duty sign is set to off working state, so that determine whether communication interface can also trigger transmission and interrupt.If when detecting the duty of communication interface and being masked as off working state, the store status that needs further to send buffer memory according to veneer determine whether this communication interface is in abnormal operating state.
When the duty of determining communication interface is masked as off working state, determine that veneer sends the store status of buffer memory, when the store status of clean culture transmission buffer memory is non-NULL, can determine that communication interface is in deadlock state.
For guaranteeing that further the present invention determines that communication interface is in the accuracy of deadlock state, the present invention also is provided with the predetermined failure number of times that communication interface is in abnormal operating state, if reach in the store status process of determining the transmission buffer memory at duty sign according to predetermined time interval continuous detecting communication interface, determine that continuously communication interface is in off working state, and the transmission buffer memory is that the number of times of non-NULL reaches the predetermined failure number of times, determine that then this communication interface necessarily is in abnormal operating state, remove the deadlock state of communication interface by the method for initialization single board communication interface, make communication interface can continue to trigger to send and interrupt, proceed normal data transmission procedure.
Below with the serial communication interface of printout veneer be example in conjunction with the accompanying drawings 1 pair of technical scheme provided by the invention be described in detail.
As shown in Figure 1,, the duty sign of the serial communication interface of printout veneer is set, when the duty sign of this serial communication interface triggers the transmission interruption at this serial communication interface, is duty in step 100.The predetermined failure number of times that serial communication interface is in abnormal operating state being set, being set to the inferior initial note sub-value of predetermined failure time number scale, is zero as initial note sub-value.If for predetermined failure time number scale realizes that by register then register resets.The predetermined time interval of the duty sign that detects serial communication interface is set according to the real needs of printout veneer.
To step 110, adopt methods such as cycle timer, regularly detect the duty sign of serial communication interface according to predetermined time interval.
To step 120, judge the duty sign of serial communication interface, if the duty of serial communication interface is masked as duty, to step 121, the duty sign of serial communication interface is revised as off working state, and the register of predetermined failure number of times resets.
To step 110, continue regularly to detect the duty sign of serial communication interface according to predetermined time interval.
In step 120, if the duty of serial communication interface is masked as off working state, to step 130, whether the store status of judging the printing buffer memory of printing veneer is empty, if print the store status of buffer memory is empty, and the expression serial communication interface is in normal operating conditions, to step 131, do not change the duty of serial communication interface, the register of predetermined failure number of times resets.
In step 130, be non-NULL if print the store status of buffer memory, to step 140, be the counter value increase by 1 of the inferior register of predetermined failure time number scale.
To step 150, judge whether the counter value of register reaches the predetermined failure number of times, if counter value does not reach the predetermined failure number of times,, continue regularly to detect the duty sign of serial communication interface according to predetermined time interval to step 110.
In step 150, if counter value reaches the predetermined failure number of times, to step 160, determine that serial communication interface is in deadlock state, the initialization serial communication interface recovers the normal duty of serial communication interface, this deadlock problem that solves serial communication interface finishes, to step 110, continue regularly to detect the duty sign of serial communication interface, so that determine and solve the abnormal operating state of serial communication interface once more according to predetermined time interval.
Though described the present invention by embodiment, those of ordinary skills know, the present invention has many distortion and variation and do not break away from spirit of the present invention, and the claim of application documents of the present invention comprises these distortion and variation.

Claims (7)

1, a kind of method based on the communication interface realization operate as normal that sends interruption is characterized in that, comprising:
A, determine whether the single board communication interface triggers and send to interrupt;
B, determine that described veneer sends the store status of buffer memory;
C, do not trigger in described communication interface and send to interrupt and the store status of described transmission buffer memory when being non-NULL, determine that described communication interface is in abnormal operating state, and the described communication interface of initialization.
2, as claimed in claim 1 a kind of based on sending the method that the communication interface of interrupting realizes operate as normal, it is characterized in that described veneer comprises: based on sending the printout veneer that interrupts.
3, as claimed in claim 1 a kind of based on sending the method that the communication interface of interrupting realizes operate as normal, it is characterized in that described communication interface is: serial communication interface or parallel communication interface.
4, as claim 1,2 or 3 described a kind of methods, it is characterized in that, also comprise before the described method based on the communication interface realization operate as normal that sends interruption:
The duty sign of single board communication interface is set;
Described duty sign is represented duty or expression off working state;
Described duty sign triggers to send in communication interface and is expressed as described duty when interrupting;
And described step a comprises: determine according to described duty sign whether the single board communication interface triggers transmission and interrupt.
5, as claimed in claim 4 a kind of based on sending the method that the communication interface of interrupting realizes operate as normal, it is characterized in that described step a further comprises:
A1, regularly detect the duty sign of described single board communication interface according to predetermined time interval;
A2, judge that described duty sign represents that described duty still represents described off working state;
If described duty sign is represented described duty, described duty sign is set to represent described off working state, and returns described step a1;
If described duty sign is represented described off working state, to described step b.
6, as claimed in claim 5 a kind of based on sending the method that the communication interface of interrupting realizes operate as normal, it is characterized in that described method also comprises:
The predetermined failure number of times that described communication interface is in abnormal operating state is set;
And described duty sign is set to represent that the step of described off working state also comprises among the described step a2:
The note sub-value of described predetermined failure number of times resets.
7, as claimed in claim 6 a kind of based on sending the method that the communication interface of interrupting realizes operate as normal, it is characterized in that described step c further comprises:
The store status of judging described transmission buffer memory is that dummy status still is non-dummy status;
If the store status of described transmission buffer memory is a dummy status, the note sub-value of the predetermined failure that resets number of times;
If the store status of described transmission buffer memory is non-dummy status, be described predetermined failure time number scale, and when described note sub-value reaches described predetermined failure number of times, determine that described communication interface is in abnormal operating state, and the described communication interface of initialization.
CNB2004100986816A 2004-12-16 2004-12-16 Method for realizing normal working of communication interface based on sending interruption Expired - Fee Related CN100359457C (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CNB2004100986816A CN100359457C (en) 2004-12-16 2004-12-16 Method for realizing normal working of communication interface based on sending interruption

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CNB2004100986816A CN100359457C (en) 2004-12-16 2004-12-16 Method for realizing normal working of communication interface based on sending interruption

Publications (2)

Publication Number Publication Date
CN1790252A CN1790252A (en) 2006-06-21
CN100359457C true CN100359457C (en) 2008-01-02

Family

ID=36788149

Family Applications (1)

Application Number Title Priority Date Filing Date
CNB2004100986816A Expired - Fee Related CN100359457C (en) 2004-12-16 2004-12-16 Method for realizing normal working of communication interface based on sending interruption

Country Status (1)

Country Link
CN (1) CN100359457C (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101853187B (en) * 2010-04-30 2012-07-11 美的集团有限公司 Automatic recovery method for UART communication interruption of microcontroller

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN87103247A (en) * 1986-04-30 1987-12-30 阿特阿公司 Interface circuitry for communicating by means of messages
US20020042856A1 (en) * 2000-08-31 2002-04-11 Hartwell David W. Anti-starvation interrupt protocol
US6567414B2 (en) * 1998-10-30 2003-05-20 Intel Corporation Method and apparatus for exiting a deadlock condition

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN87103247A (en) * 1986-04-30 1987-12-30 阿特阿公司 Interface circuitry for communicating by means of messages
US6567414B2 (en) * 1998-10-30 2003-05-20 Intel Corporation Method and apparatus for exiting a deadlock condition
US20020042856A1 (en) * 2000-08-31 2002-04-11 Hartwell David W. Anti-starvation interrupt protocol

Also Published As

Publication number Publication date
CN1790252A (en) 2006-06-21

Similar Documents

Publication Publication Date Title
KR100968641B1 (en) Point-to-point link negotiation method and apparatus
CN111104272B (en) CAN bus controller testing method based on RX and TX
CN102622150A (en) Static eliminating method for touch screen
EP3395577B1 (en) Repair method and repair chip for remanufactured ink cartridge, and remanufactured ink cartridge
CN101562906A (en) Method and device for automatically adapting to wireless data cards with multiple formats
CN100444147C (en) Master device, control method thereof, and electronic device having master device
CN105225316A (en) A kind of dormancy of electron key low-power consumption power supply plan and awakening method
CN102156584A (en) Touch screen terminal and method for solving deadlock of touch screen
CN101626288A (en) UART device with Baud rate detection and set function and detection and set method thereof
CN102681739A (en) Static elimination method for touch screen
CN109885521A (en) A kind of interruption processing method, system and electronic equipment and storage medium
CN100543713C (en) Prevent the method and apparatus of lpc bus deadlock
CN101009684B (en) Monitoring device and method for single-board operation state in the distributed system
CN105634502A (en) Realization method of key scanning based on state machine
CN101350995B (en) Awakening method between mobile terminal modules and multi-mode terminal using the same
CN102866873A (en) Method for detecting state of seat with computer
CN100359457C (en) Method for realizing normal working of communication interface based on sending interruption
CN106897177A (en) A kind of method and system based on mobile terminal system of fingerprints short-circuit detecting and protection
CN201707675U (en) Computer isolation card
CN112526898B (en) Serial port line plug detection circuit and embedded equipment
CN1975701B (en) Master machine driving external equipment method and system
CN112380066A (en) Server maintenance and debugging device based on domestic platform and server
CN101136756B (en) Electric self-checking method, system and BMC chip on network long-range control host machine
CN104038387B (en) Line detecting method on frame-type switch business board
CN101739115A (en) Simplified type host computer and method for wakening same

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant
CF01 Termination of patent right due to non-payment of annual fee
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20080102

Termination date: 20191216