Summary of the invention
For solving defective of the prior art and deficiency, the invention provides a kind of method of avoiding the foundation link of communication abnormality, with the abnormal conditions of timely feedback device.
In order to reach the foregoing invention purpose, the method that the present invention avoids the unusual foundation of network management terminal and communication between devices to link may further comprise the steps:
(1) network management terminal sends detection packet to equipment;
(2) network management terminal judges whether to receive device acknowledge, if do not receive that device acknowledge then changes step (3) over to; If receive and then continue device acknowledge to judge whether to login this equipment, can not login and then change step (3) over to according to the equipment state sign; Can then login then zero clearing timer of this equipment; Change step (4) over to;
(3) network management terminal judges not receive whether the number of times of replying reaches setting, changes step (1) if reach over to after setting is then redistributed socket, does not then directly change step (1) over to if reach setting;
(4), after the mutual time of free of data reaches setting, revise described equipment state sign and change step (1) over to according to the mutual time of the free of data of described timer record.
Wherein, the step of this equipment of login comprises in the described step (2): if described equipment state is masked as 0, and logging device then, otherwise change step (3) over to.
Wherein, described step (3) is specially: the network management terminal judgement does not receive in limiting time whether the number of times of replying reaches setting, if reach setting, then close original socket, redistribute socket, to not receive the number of times zero setting of replying, and change step (1) over to equipment transmission detection packet; If do not reach setting, then directly change step (1) over to and send detection packet to equipment, the number of times of replying do not received in record simultaneously.
Compared with prior art, the present invention has adopted the technical measures that send detection packet according to concrete condition, has obtained the progress on the managerial ability, has reached timely feedback device abnormality and has had the effect of certain recovery capability; Simultaneously, the equipment of normal management is not sent detection packet, reduced taking of Internet resources, improved overall performance.
Embodiment
Below in conjunction with accompanying drawing the present invention is described in detail.
Fig. 2 is the flow chart that the present invention avoids the unusual foundation of network management terminal and devices communicating to link.As shown in Figure 2, the method for the invention adopts the strategy of timed sending detection packet, and in time feedback device is unusual, repairs unusual within the specific limits; For avoiding taking a large amount of Internet resources, to controlling the opportunity of sending out detection packet, promptly connection status is identified simultaneously, cooperate timing mechanism, whether decision sends detection packet.The flow process of this method is as follows:
(1) network management terminal sends detection packet to equipment, determines whether communication link is normal;
(2) network management terminal judges whether to receive device acknowledge, if do not receive that device acknowledge then changes step (3) over to; If receive device acknowledge, then equipment is carried out normal management;
(3) the network management terminal judgement does not receive whether the number of times of replying reaches setting, after then redistributing socket, setting changes step (1) if reach over to, if not reaching setting then changes step (1) over to,, recover management automatically to equipment with timely detecting link state.
Wherein, the network management terminal in the described step (2) carries out normal management to equipment and is specially:
(21) judge whether according to the equipment state sign can beaching accommodation for network management terminal, if can not then change step (3) over to by beaching accommodation, if beaching accommodation then then changes step (22) over to;
(22) network management terminal and equipment carry out data interaction;
(23) judge whether the data interaction between network management terminal and the equipment is finished,, change step (22) over to if do not finish data interaction; If finish data interaction, then zero clearing timer;
(24) the record mutual time of free of data;
(25) judge whether the mutual time of free of data reach setting,, change step (1) over to after then revising the equipment state sign if reach setting; Then do not change step (24) over to if reach setting.
Wherein, judging whether and can be specially by beaching accommodation in the described step (21) according to equipment state:
(211) if equipment state is masked as 0, beaching accommodation then, otherwise change step (3) over to.
Wherein, described step (3) is specially: network management terminal judges not receive in limiting time whether the number of times of replying reaches setting, if reach, then closes original socket, redistributes socket, and sends detection packet to equipment; If do not reach, then send detection packet to equipment.
Fig. 3 is the flow chart of the present invention in specific operation process.
Embodiment 1
The flow process of method that the equipment 1 under the normal management state of being in detects communication link is as follows:
(a) 1 data interactions of webmaster and equipment are finished, and reset timer restarts timing;
(b) if data interaction takes place once more, execution in step (a), otherwise execution in step (c) in 3 minutes;
(c) Status Flag of removing equipment 1 sends detection packet to equipment.
Embodiment 2
When equipment 2 was in nonsupervisor mode unusually owing to socket, the flow process of the method that connects was as follows:
(A) webmaster sends detection packet to equipment 2, the timer reclocking that resets, and wait acknowledge, the number of times of replying do not received in record simultaneously;
(B) timing arrives, and webmaster detects does not receive the number of times of replying;
(C) if do not receive that the number of times of replying reaches limit value, then close original socket, redistribute socket, send detection packet to equipment 2;
(D), then send and reply (redistributing socket, the unusual releasing) to webmaster if equipment 2 is received detection packet;
(E) after webmaster is received and is replied, beaching accommodation then.
By above step, to have finished under the communication abnormality state, webmaster and equipment room are set up chained task and have been realized timely feedback communication Link State, increase network utilization and repaired automatically the function such as unusual that is caused by socket.
Certainly; the present invention also can have other various embodiments; under the situation that does not deviate from spirit of the present invention and essence thereof; those skilled in the art work as can make various corresponding changes and distortion according to the present invention, but these corresponding changes and distortion all should belong to the protection range of the appended claim of the present invention.