CN104202199B - Detect Interface status and according to the method and system of Interface status Processing Interface failure - Google Patents

Detect Interface status and according to the method and system of Interface status Processing Interface failure Download PDF

Info

Publication number
CN104202199B
CN104202199B CN201410469377.1A CN201410469377A CN104202199B CN 104202199 B CN104202199 B CN 104202199B CN 201410469377 A CN201410469377 A CN 201410469377A CN 104202199 B CN104202199 B CN 104202199B
Authority
CN
China
Prior art keywords
interface
network
status
address value
network segment
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.)
Active
Application number
CN201410469377.1A
Other languages
Chinese (zh)
Other versions
CN104202199A (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.)
Shaanxi Zhongbian Testing Technology Co.,Ltd.
Original Assignee
Shanghai Feixun Data Communication Technology 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 Shanghai Feixun Data Communication Technology Co Ltd filed Critical Shanghai Feixun Data Communication Technology Co Ltd
Priority to CN201410469377.1A priority Critical patent/CN104202199B/en
Publication of CN104202199A publication Critical patent/CN104202199A/en
Application granted granted Critical
Publication of CN104202199B publication Critical patent/CN104202199B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The present invention provides a kind of detection Interface status and according to the method for Interface status Processing Interface failure, including:A Virtual File System is created when starting communication terminal device;Pre-defined signal process function and socket function;By the associated input and output control data of web socket to obtain the title of network interface card and first interface state return value and network interface card information is obtained from Virtual File System;Judge whether acquired network interface card information matches with network interface card;If acquired network interface card information is matched with the network interface card, whether first interface is judged in connection status according to first interface state return value, if it is not, sending alarm prompt user;If so, whether detection first interface and second interface are in the same network segment;If two interfaces are in the same network segment, call signal processing function reconfigures network parameter.The present invention solves WAN mouthfuls of routing device and LAN mouthfuls in the case that in the same network segment, client can not connect online the problem of, improves resource utilization ratio.

Description

Detect Interface status and according to the method and system of Interface status Processing Interface failure
Technical field
The invention belongs to computer communication complex technical field, more particularly to a kind of detection Interface status and according to interface shape The method and system of state Processing Interface failure.
Background technology
Router is a kind of computer network facility, provides routing and forwarding two kinds of important mechanisms, is connection LAN, wide The equipment of domain net.Lan interfaces (LAN interface) are mainly used for router and LAN connection.Router is connected with wide area network Interface is known as Wide Area Network interface (wan interface).Router is connected between LAN and wide area network, wide area network between LAN Bridge.Router is connected by cable with interface, configures or obtain corresponding network address, could be given and is normally connected to interconnection Net.The network equipment is connected by wan interface with first line of a couplet equipment, if cable is not inserted or network interface does not get up, network connects Mouth is off.If the LAN interface of first line of a couplet equipment and router is in the same network segment, router LAN interface can not Network address is obtained, wan interface status indicator lamp at this time no matter is to look at and is also to look at Interface status, router is all just Often, but client can not obtain network address always, be not easy to network management personnel's discovery.
The whether normal method of detection router interface is network overhaul personnel most easy detection network interface state at present Whether whether normal method is to look at interface lamp bright.If interface lamp is just always on, just it is not easy to find network device interface failure original Cause, if the LAN interface and wan interface of router are in the same network segment, such case is not easy to find very much, and causes to route Device can not obtain address always, and second line of a couplet client can not surf the Internet.Therefore, it is possible to detect Interface status automatically, and repair network Failure can be in shorter time communication back to normal.
Therefore, a kind of detection Interface status how is provided and according to the method and system of Interface status Processing Interface failure, with Communication terminal device of the prior art is solved, particularly router, can not in the case of connection LAN interface and wan interface It is automatic to detect wan interface connection status and know network failure as early as possible, and communication terminal device is in LAN interface and wan interface In the case of the same network segment, the defects of client can not connect internet can not be solved, it is real to have become practitioner in the art urgently Technical problem to be solved.
The content of the invention
In view of the foregoing deficiencies of prior art, it is an object of the invention to provide a kind of detection Interface status and evidence to connect The method and system of mouth state processing interface fault, for solving communication terminal device in the prior art, particularly router exists In the case of connecting LAN interface and wan interface, wan interface connection status can not be detected automatically and know network failure as early as possible, and And communication terminal device is in the same network segment in LAN interface and wan interface, can not solve client can not connect interconnection The problem of net.
In order to achieve the above objects and other related objects, one aspect of the present invention provides a kind of detection Interface status and according to interface The method of state processing interface fault, applied to first interface, second interface, multiple network interface cards communication terminal device, net Network parameter configuration on the communication terminal device, including:It is virtual to create one when starting the communication terminal device for step 1 File system;Step 2 pre-defines one to be reconfigured when the first interface and second interface are in the same network segment The signal process function of network parameter and the socket function to create web socket;Step 3 passes through the network set The associated input and output control data of word is connect to obtain the title of the network interface card and first interface state return value and from the void Intend obtaining network interface card information in file system;Step 4 according to the network interface card information and the title of network interface card got, judges acquired Whether network interface card information matches with the network interface card;Step 5, if acquired network interface card information is matched with the network interface card, according to Whether first interface state return value judges the first interface in connection status, if it is not, then sending alarm to prompt user Interface fault, which occurs, in the first interface makes user handle the interface fault;If so, continue to execute next step;Step Six, whether the first interface and second interface are detected in the same network segment;If the first interface and second interface are in same One network segment then calls the signal process function to reconfigure the network parameter of the communication terminal device so that described One interface and second interface are not at the same network segment.
Optionally, the IP address value of the network parameter including first interface and the IP of gateway address value and second interface Location is worth and gateway address value.
Optionally, the first interface is detected in the step 6 and whether second interface further wraps in the same network segment It includes:The IP address value and gateway address value and the IP address value of second interface and gateway address value of acquisition first interface;It is right respectively The IP address value of the first interface and the progress logical operation of gateway address value, the IP address value of the second interface and gateway Location value carries out logical operation to obtain the network segment of the network segment of first interface and second interface;According to the net of the first interface got The network segment of section and second interface detects the first interface and whether the second interface is in the same network segment.
Optionally, the logical operation refers to that logical AND operates.
Optionally, it is described to detect Interface status and reconfiguring described lead to according to the method for Interface status Processing Interface failure After the network parameter for believing terminal device, further include:The network parameter that reconfigures is preserved, is sent and is restarted the communication terminal and set Standby enabled instruction.
Optionally, when the first interface state return value is 0x0, then it represents that the first interface is off; When the first interface state return value is 0x10, then it represents that the first interface is in connection status.
Optionally, performed in the step 5 and send alarm to prompt interface fault order occur for the first interface After user handles the interface fault, into wait state, wait continuing to detect described first in default waiting period and connect The connection status of mouth;Being performed in the step 6 calls the signal process function to reconfigure the communication terminal device Network parameter so that the first interface and second interface be not at the same network segment after, into wait state, default etc. It treats to wait in the period and continues to detect the connection status of the first interface, afterwards return to step one.
Another aspect of the present invention also provides a kind of detection Interface status and according to the system of Interface status Processing Interface failure, should For the communication terminal device with first interface, second interface and multiple network interface cards, network parameter configuration is whole in the communication In end equipment, including:Initialization module, for creating a Virtual File System when starting the communication terminal device;In advance Definition module, for pre-defining one reconfiguring network when the first interface and second interface are in the same network segment The signal process function of parameter and the socket function to create web socket;Acquisition module, for passing through the network The input and output control data of sockets associated is to obtain the title of the network interface card and first interface state return value, from the void Intend obtaining network interface card information in file system;First judgment module, for according to the network interface card information and the title of network interface card got, sentencing Whether acquired network interface card information of breaking matches with the network interface card;Second judgment module, for judging in first judgment module Judge that the first interface is according to the first interface state return value when acquired network interface card information is matched with the network interface card It is no to be in connection status, if it is not, then calling to send alarm so that first interface described in user to be prompted interface fault order use occur Family handles the alarm module of the interface fault;If so, it calls to detect whether the first interface and second interface are located In the detection module of the same network segment;If the first interface and second interface are in the same network segment, the predefined mould is called The signal process function that block defines reconfigures the network parameter of the communication terminal device so that the first interface and Two interfaces are not at the same network segment.
Optionally, alarm is sent in alarm module execution to prompt interface fault order occur for the first interface User calls a timing module after handling the interface fault, and the timing module makes for setting a default waiting period The communication terminal device is waited for, and is waited in default waiting period and is continued the connection for detecting the first interface State;The detection module call signal processing function reconfigure the network parameter so that the first interface and Second interface is not at also calling the timing module after the same network segment, and the communication terminal device is made to be waited for, It is waited in default waiting period and continues to detect the connection status of the first interface.
Optionally, the detection module further includes:Acquiring unit, for obtaining the IP address value of first interface and gateway Location is worth and the IP address value of second interface and gateway address value;Logical operations unit, for respectively to the IP of the first interface Address value carries out logical operation with gateway address value, and the IP address value and gateway address value of the second interface carry out logical operation To obtain the network segment of the network segment of first interface and second interface.
As described above, the present invention's detects Interface status and according to the method and system of Interface status Processing Interface failure, tool There is following advantageous effect:It is of the present invention to detect Interface status and according to the method and system solution of Interface status Processing Interface failure WAN mouthfuls of routing device side and LAN mouthfuls determined in the case that in the same network segment, client can not connect online the problem of, it can be with When WAN mouthfuls of connections disconnect, user is reminded to plug cable, prevents user from can not connect internet, preferably handles network Failure improves resource utilization ratio.
Description of the drawings
Fig. 1 is shown as the detection Interface status of the present invention and illustrates according to the method flow of Interface status Processing Interface failure Figure.
Fig. 2 is shown as present invention detection Interface status and according to the tool of step S7 in the method for Interface status Processing Interface failure Body flow diagram.
Fig. 3 is shown as present invention detection Interface status and according to the system principle structural representation of Interface status Processing Interface failure Figure.
Fig. 4 is shown as present invention detection Interface status and according to detection module in the system of Interface status Processing Interface failure Theory structure schematic diagram.
Component label instructions
10 detect Interface status and according to the system of Interface status Processing Interface failure
101 initialization modules
102 predefined modules
103 acquisition modules
104 first judgment modules
105 second judgment modules
106 alarm modules
107 detection modules
108 timing modules
109 memory modules
100 starting modules
1071 acquiring units
1072 logical operations units
1073 detection units
S1~S10 steps
Specific embodiment
Illustrate embodiments of the present invention below by way of specific specific example, those skilled in the art can be by this specification Disclosed content understands other advantages and effect of the present invention easily.The present invention can also pass through in addition different specific realities The mode of applying is embodied or practiced, the various details in this specification can also be based on different viewpoints with application, without departing from Various modifications or alterations are carried out under the spirit of the present invention.It should be noted that in the case where there is no conflict, following embodiment and implementation Feature in example can be mutually combined.
It should be noted that the diagram provided in following embodiment only illustrates the basic structure of the present invention in a schematic way Think, then only the display component related with the present invention rather than component count, shape and size during according to actual implementation in schema It draws, kenel, quantity and the ratio of each component can be a kind of random change during actual implementation, and its assembly layout kenel It is likely more complexity.
The present invention, in connection LAN interface and wan interface, is provided for communication terminal device, particularly router A kind of automatic detection Interface status situation simultaneously solves to be in the same network segment in both sides interface, and client can not connect The situation of net.When WAN mouthfuls of connections disconnect, user is reminded to plug cable.At WAN mouthfuls the same network segment is in LAN interface Under, it solves the problems, such as this, prevents user from can not connect internet, preferably handle network failure.Detection interface of the present invention Simultaneously finger daemon is not required according to the method and system of Interface status Processing Interface failure in state, independent to carry out, and improves system money Source utilization rate.
Embodiment one
The present embodiment provides a kind of detection Interface status and according to the method for Interface status Processing Interface failure, applied to The communication terminal device of first interface, second interface and multiple network interface cards, network parameter are configured on the communication terminal device. In the present embodiment, the communication terminal device be router, the first interface be WAN (LAN) interface, second interface For LAN (wide area network) interface.Referring to Fig. 1, being shown as detection Interface status and according to the method for Interface status Processing Interface failure Flow diagram.As shown in Figure 1, described detect Interface status and include according to the method for Interface status Processing Interface failure:
S1 creates a Virtual File System when starting the communication terminal device.The Virtual File System is insertion The PROC file system that will be created in formula linux system start-up course.The PROC file system is a pseudo file system, It is only existed among memory, and is not take up external space.It is the operation of access system kernel data in a manner of file system Interface is provided.User and application program can obtain the information of system by PROC, and can change some parameters of kernel.By It is that dynamic changes in the information of system, such as process, so when user or application program read PROC file system, PROC texts Part system is that dynamic reads information needed from system kernel and submits.
S2 pre-defines a signal process function and socket function, and the signal process function is to described first Interface and second interface reconfigure the signal process function of network parameter when being in the same network segment.The socket function to Create web socket, i.e. UDP (User Datagram Protocol, User Datagram Protocol) socket.Wherein, the letter Number processing function be SIGUSRI signal process functions, the socket function be socket functions.
S3, by the associated input and output control data of the web socket to obtain the title of the network interface card and first Interface status return value;The filec descriptor of the PROC file system just can be got after UDP socket establishment, It can be obtained by using the filec descriptor use got and the associated input and output control data of the UDP socket The title of network interface card and wan interface state return value into the router.In the present embodiment, wan interface state return value is 0x0 or 0x10, wherein, when the first interface state return value is 0x0, represent that the first interface is off. When the first interface state return value is 0x10, represent that the first interface is in connection status.In this step S3, also From the Virtual File System, i.e., obtain network interface card information from the PROC file system.
S4, according to the network interface card information and the title of network interface card acquired, judge acquired network interface card information whether with the road It is matched by network interface card in equipment;If the network interface card information got is matched with network interface card in the routing device, step S5 is continued to execute. If the network interface card information got is mismatched with network interface card in the routing device, return to step S1.
S5 if acquired network interface card information is matched with the network interface card, judges according to the first interface state return value Whether the first interface if the first interface state return value be 0x0, represents the first interface in connection status It is off, then performs step S6, that is, send alarm and make user so that first interface described in user to be prompted interface fault occur The interface fault is handled, and is transferred to step S10, i.e., into wait state, is waited in default waiting period and continues to detect The connection status of the first interface;If the first interface state return value is 0x10, represent that the first interface is in Connection status then continues to execute next step S7.In the present embodiment, second interface 22 is given tacit consent to, i.e. LAN mouthfuls is in connection shape State.
S7, when the first interface is in connection status, continue to detect the first interface and the second interface be It is no to be in the same network segment;If the first interface and second interface are not in the same network segment, step S10 is transferred to, i.e., into wait State waits in default waiting period and continues the connection status for detecting the first interface, performed the step S10 it Return to step S1 afterwards, the default stand-by period can be by artificially setting;If the first interface and second interface are in same The network segment then performs step S8.Referring to Fig. 2, being shown as the idiographic flow schematic diagram of step S7, step S7 comprises the following steps:
S71 obtains the IP address value of the first interface and the gateway address value of the first interface and described second connects The IP address value of mouth and the gateway address value of second interface.
S72 carries out logical AND to the IP address value of the first interface and the gateway address value of the first interface respectively Operation, the IP address value of the second interface and the gateway address value of second interface carry out logical AND operation to obtain first interface The network segment and second interface the network segment.
S73 detects the first interface and described according to the network segment of the first interface got and the network segment of second interface Whether second interface is in the same network segment, if so, step S8 is performed, if it is not, being then transferred to step S10.
S8 is calling the signal process function to reconfigure the network parameter of the routing device so that described the One interface and second interface are not at the same network segment.
S9 after the network parameter for reconfiguring the routing device, preserves the network parameter reconfigured, sends and restart The enabled instruction of the routing device, return to step S1, Xun Huan perform the detection Interface status and are handled according to Interface status and connect The method of mouth failure, until closing the routing device.
In the present embodiment, it is otherwise described to detect Interface status and connect according to Interface status processing unless closing routing device The method of mouthful failure processing detection first interface connection status always.
Detection Interface status described in the present embodiment simultaneously solves routing and sets according to the method for Interface status Processing Interface failure Standby side WAN mouthful and LAN mouthfuls in the case that in the same network segment, client can not connect online the problem of, and can be in WAN mouthfuls of companies When connecing disconnection, user is reminded to plug cable, prevents user from can not connect internet, preferably handles network failure, improved Resource utilization ratio.
Embodiment two
The present embodiment provides a kind of detection Interface status and according to the system 10 of Interface status Processing Interface failure, applied to tool There are first interface, second interface, the communication terminal device of multiple network interface cards, network parameter is configured on the communication terminal device. In the present embodiment, the communication terminal device is router 2, and the first interface 21 is WAN (LAN) interface, and second connects Mouth 22 is LAN (wide area network) interface.Referring to Fig. 3, being shown as detection Interface status and according to Interface status Processing Interface failure The theory structure schematic diagram of system.As shown in Fig. 2, described detect Interface status and according to the system of Interface status Processing Interface failure 10 include:Initialization module 101, predefined module 102, acquisition module 103, the first judgment module 104, the second judgment module 105th, alarm module 106, detection module 107, timing module 108, memory module 109, starting module 100.Wherein, the detection Module 107 includes acquiring unit 1071, logical operations unit 1072 and detection unit 1073.
The initialization module 101 is used to create a Virtual File System when starting the routing device 2.The void It is the PROC file system that will be created in embedded Linux system start-up course to intend file system.
The predefined module 102 being connected with the initialization module 101 is for pre-defining one to described the One interface 21 and second interface 22 reconfigure the signal process function of network parameter and to create net when being in the same network segment The socket function of network socket.Wherein, the signal process function be SIGUSRI signal process functions, the socket letter It counts as socket functions, i.e. UDP (User Datagram Protocol, User Datagram Protocol) socket.
The acquisition module 103 being connected with the predefined module 102 is used for through the associated input of the web socket Control data is exported to obtain the title of the network interface card and first interface state return value and be obtained from the PROC file system Take network interface card information;
First judgment module 104 being connected with the acquisition module 103 be used for according to the network interface card information that acquires and The title of network interface card judges whether acquired network interface card information matches with the network interface card.That is if the network interface card information with Network interface card in routing device 2 is corresponding, just illustrates the two matching.
The second judgment module 105 being connected with first judgment module 104 is used to judge in first judgment module The first interface 21 is judged according to the first interface state return value when acquired network interface card information is matched with the network interface card Whether in connection status, if the first interface 21 is off, call to send alarm to prompt user institute It states first interface 21 and the alarm module 106 that interface fault makes user handle the interface fault occurs;If the first interface 21 In connection status, then call to detect the first interface 21 and whether second interface 22 is in the detection mould of the same network segment Block 107;If the first interface 21 and second interface 22 are in the same network segment, call what the predefined module 102 defined Signal process function reconfigure the network parameter of the routing device 2 so that the first interface 21 and second interface 22 not In the same network segment.If first interface 21 and second interface 22 are in the same network segment, then the namely WAN of first interface 21 Mouth can not obtain IP address, then user also just cannot connect to internet, so stilling need call signal processing function again Configure the network parameter of routing device 2.
106 pieces of the mould of alarm, which performs, sends alarm to prompt interface fault occur for the first interface 21 to make user A timing module 109 being connected with the alarm module 106, the timing module 109 can be called after handling the interface fault For setting a default waiting period, the routing device 2 is made to be waited for, waited in default waiting period after The connection status of the continuous detection first interface 21.
Referring to Fig. 4, being shown as the theory structure schematic diagram of detection module, the detection module 107 includes:
For obtaining the IP of the gateway address value of the IP address value of first interface 21 and first interface 21 and second interface 22 The acquiring unit 1071 of the gateway address value of address value and second interface.
For carrying out logical operation to the IP address value and 21 gateway address value of first interface of the first interface 21 respectively, The IP address value of the second interface 22 and the gateway address value of second interface 22 carry out logical AND operation to obtain first interface The logical operations unit 1072 of 21 network segment and the network segment of second interface 22.And
For the network segment of first interface 21 and second interface 22 arrived according to 1072 logical operation of logical operations unit The network segment detect the detection unit 1073 whether first interface 21 and second interface 22 are in the same network segment.
It is also adjusted after the detection module 107 detects the first interface 21 and second interface 22 is not at the same network segment With the timing module 109, the routing device is made to be waited for, waited in default waiting period and continue to detect institute State the connection status of first interface 21.Detect that the first interface 21 and second interface 22 are in the detection module 107 The signal process function for agreeing to after the network segment the predefined module 102 be called to define reconfigures the network of the routing device 2 Parameter makes the memory module 109 preserve again so that the first interface 21 and second interface 22 are not at the same network segment The network parameter of configuration sends and restarts enabled instruction to the starting module 100 of the routing device 2 its is made to restart the road By equipment 2.In the present embodiment, it is described to detect Interface status and be constantly according to the system 10 of Interface status Processing Interface failure The state of the connection status of WAN mouthfuls of detection is until close routing device 2.
Detection Interface status described in the present embodiment is simultaneously solved according to the method and system of Interface status Processing Interface failure WAN mouthfuls of routing device side and LAN mouthfuls, and can be in the case that in the same network segment, client can not connect online the problem of When WAN mouthfuls of connections disconnect, user is reminded to plug cable, prevents user from can not connect internet, preferably handle network event Barrier, improves resource utilization ratio.
So the present invention effectively overcomes various shortcoming of the prior art and has high industrial utilization.
The above-described embodiments merely illustrate the principles and effects of the present invention, and is not intended to limit the present invention.It is any ripe Know the personage of this technology all can carry out modifications and changes under the spirit and scope without prejudice to the present invention to above-described embodiment.Cause This, those of ordinary skill in the art is complete without departing from disclosed spirit and institute under technological thought such as Into all equivalent modifications or change, should by the present invention claim be covered.

Claims (7)

1. a kind of detect Interface status and according to the method for Interface status Processing Interface failure, applied to first interface, second The router of interface and multiple network interface cards, first interface are wan interface, and second interface is LAN interface, and network parameter is configured in institute It states on router, which is characterized in that including:
Step 1 creates a Virtual File System when starting the router;
Step 2, pre-defined one joins to reconfigure network when the first interface and second interface are in the same network segment Several signal process functions and the socket function to create web socket;
Step 3, by the associated input and output control data of the web socket to obtain the title of the network interface card and first Interface status return value and obtain network interface card information from the Virtual File System;
Step 4, according to the network interface card information and the title of network interface card got, judge acquired network interface card information whether with the net Card matching;
Step 5 if acquired network interface card information is matched with the network interface card, judges according to the first interface state return value Whether the first interface is in connection status, if it is not, then sending alarm so that first interface described in user to be prompted interface event occur Barrier makes user handle the interface fault;If so, continue to execute next step;
Whether step 6 detects the first interface and second interface in the same network segment;If the first interface and second connects Mouth then calls the signal process function to reconfigure the network parameter of the router so that described in the same network segment First interface and second interface are not at the same network segment;
The network parameter includes the IP address value of first interface and the IP address value and gateway of gateway address value and second interface Address value;
The first interface is detected in the step 6 and whether second interface further comprises in the same network segment:
The IP address value and gateway address value and the IP address value of second interface and gateway address value of acquisition first interface;
Logical operation, the IP address of the second interface are carried out to the IP address value and gateway address value of the first interface respectively Value and gateway address value carry out logical operation to obtain the network segment of the network segment of first interface and second interface;
The first interface and the second interface are detected according to the network segment of the first interface got and the network segment of second interface Whether the same network segment is in.
2. according to claim 1 detect Interface status and according to the method for Interface status Processing Interface failure, feature exists In:The logical operation refers to that logical AND operates.
3. according to claim 1 detect Interface status and according to the method for Interface status Processing Interface failure, feature exists In:The detection Interface status is simultaneously joined according to the method for Interface status Processing Interface failure in the network for reconfiguring the router After number, further include:The network parameter reconfigured is preserved, sends the enabled instruction for restarting the router.
4. according to claim 1 detect Interface status and according to the method for Interface status Processing Interface failure, feature exists In:
When the first interface state return value is 0x0, then it represents that the first interface is off;
When the first interface state return value is 0x10, then it represents that the first interface is in connection status.
5. according to claim 1 detect Interface status and according to the method for Interface status Processing Interface failure, feature exists In:
Execution sends alarm and makes user's processing institute so that first interface described in user to be prompted interface fault occur in the step 5 After stating interface fault, into wait state, waited in default waiting period and continue the connection shape for detecting the first interface State;
Performed in the step 6 call the signal process function to reconfigure the network parameter of the router so that After the first interface and second interface be not at the same network segment, into wait state, waited in default waiting period Continue to detect the connection status of the first interface, afterwards return to step one.
6. a kind of detect Interface status and according to the system of Interface status Processing Interface failure, applied to first interface, second The router of interface and multiple network interface cards, first interface are wan interface, and second interface is LAN interface, and network parameter is configured in institute It states on router, which is characterized in that including:
Initialization module, for creating a Virtual File System when starting the router;
Predefined module, for pre-defining one matching somebody with somebody again when the first interface and second interface are in the same network segment Put the signal process function of network parameter and the socket function to create web socket;
Acquisition module, for obtaining the title of the network interface card by the associated input and output control data of the web socket With first interface state return value, network interface card information is obtained from the Virtual File System;
First judgment module, for according to the network interface card information and the title of network interface card got, judging that acquired network interface card information is It is no to be matched with the network interface card;
Second judgment module, for the root when first judgment module judges that acquired network interface card information is matched with the network interface card Whether the first interface is judged in connection status according to the first interface state return value, if it is not, then calling to send It alerts that first interface described in user is prompted the alarm module that interface fault makes user handle the interface fault occur;If so, It then calls to detect the first interface and whether second interface is in the detection module of the same network segment;If the first interface The same network segment is in second interface, then the signal process function of the predefined module definition is called to reconfigure the routing The network parameter of device is so that the first interface and second interface are not at the same network segment;
The detection module includes:
Acquiring unit, for obtaining the IP address value and gateway of the IP address value of first interface and gateway address value and second interface Address value;
Logical operations unit, for carrying out logical operation, institute to the IP address value and gateway address value of the first interface respectively It states the IP address value of second interface and gateway address value carries out logical operation to obtain the network segment of first interface and second interface The network segment.
7. according to claim 6 detect Interface status and according to the system of Interface status Processing Interface failure, feature exists In:
The alarm module execution send alarm with prompt for the first interface occur interface fault make user processing institute A timing module is called after stating interface fault, the timing module makes the router for setting a default waiting period It is waited for, is waited in default waiting period and continue the connection status for detecting the first interface;
The detection module call signal processing function reconfigure the network parameter so that the first interface and Second interface is not at also calling the timing module after the same network segment, and the router is made to be waited for, default etc. It treats to wait in the period and continues to detect the connection status of the first interface.
CN201410469377.1A 2014-09-16 2014-09-16 Detect Interface status and according to the method and system of Interface status Processing Interface failure Active CN104202199B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201410469377.1A CN104202199B (en) 2014-09-16 2014-09-16 Detect Interface status and according to the method and system of Interface status Processing Interface failure

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201410469377.1A CN104202199B (en) 2014-09-16 2014-09-16 Detect Interface status and according to the method and system of Interface status Processing Interface failure

Publications (2)

Publication Number Publication Date
CN104202199A CN104202199A (en) 2014-12-10
CN104202199B true CN104202199B (en) 2018-05-25

Family

ID=52087429

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201410469377.1A Active CN104202199B (en) 2014-09-16 2014-09-16 Detect Interface status and according to the method and system of Interface status Processing Interface failure

Country Status (1)

Country Link
CN (1) CN104202199B (en)

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105897479B (en) * 2016-04-18 2019-10-22 上海斐讯数据通信技术有限公司 Detect the method and gateway of the Wide Area Network interface of gateway
CN106021076A (en) * 2016-05-13 2016-10-12 广东欧珀移动通信有限公司 Display method and terminal
CN106126408A (en) * 2016-06-28 2016-11-16 浪潮(北京)电子信息产业有限公司 A kind of its diagnosis processing method based on linux network interface card mistake and system
CN106209391A (en) * 2016-07-13 2016-12-07 上海斐讯数据通信技术有限公司 A kind of wireless router and method for connecting network
CN106850447A (en) * 2017-02-22 2017-06-13 上海斐讯数据通信技术有限公司 Routing device and interface allocation method
CN108199874B (en) * 2017-12-29 2020-10-09 上海司南卫星导航技术股份有限公司 Network fault detection and repair method, GNSS receiver and computer readable medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102025792A (en) * 2009-09-22 2011-04-20 国基电子(上海)有限公司 Router and IP address setting method thereof
CN103227844A (en) * 2013-04-19 2013-07-31 深圳市吉祥腾达科技有限公司 Method and device for automatically solving secondary route IP conflict in DHCP
CN103401735A (en) * 2013-08-19 2013-11-20 上海斐讯数据通信技术有限公司 Method and system for indicating errors in routing device
CN103812728A (en) * 2014-02-13 2014-05-21 普联技术有限公司 Network diagnostic method, system and router

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102025792A (en) * 2009-09-22 2011-04-20 国基电子(上海)有限公司 Router and IP address setting method thereof
CN103227844A (en) * 2013-04-19 2013-07-31 深圳市吉祥腾达科技有限公司 Method and device for automatically solving secondary route IP conflict in DHCP
CN103401735A (en) * 2013-08-19 2013-11-20 上海斐讯数据通信技术有限公司 Method and system for indicating errors in routing device
CN103812728A (en) * 2014-02-13 2014-05-21 普联技术有限公司 Network diagnostic method, system and router

Also Published As

Publication number Publication date
CN104202199A (en) 2014-12-10

Similar Documents

Publication Publication Date Title
CN104202199B (en) Detect Interface status and according to the method and system of Interface status Processing Interface failure
US20200007402A1 (en) Host network analyzer
WO2018040016A1 (en) Protocol converter and protocol conversion method
CN101494560B (en) Method, apparatus and system for configuring master-salve network device
CN104158642A (en) Method and system for providing backup for software defined network controller
CN106603359B (en) The communicating control method and device of PLC system
WO2020238747A1 (en) Serial port output path switching method, system and apparatus, and switch
CN109245926B (en) Intelligent network card, intelligent network card system and control method
CN108347351A (en) Method, device and system for compatibility of dual Ethernet cards of equipment
CN114064208A (en) Method and device for detecting application service state, electronic equipment and storage medium
CN101873236A (en) Method and system for testing message
CN103517375B (en) A kind of to multiple mobile equipment identification, the method for communication and device
CN109002411A (en) Automatically configure the method, system and the GPU extension box that can be automatically configured of GPU extension box
CN106301803A (en) A kind of chip power supply control method, device and communication equipment
CN106557362A (en) It is applied to the task immigration method and system of intelligent robot
CN103401735B (en) Indicate the wrong method and system in routing device
CN107332739B (en) Network detecting method, network detection device and intelligent terminal
CN106506265B (en) Detection fpga chip hangs dead method and device
CN105335328A (en) Backboard I2C bus deadlock elimination method and system as well as electronic equipment
CN105429907B (en) Serial ports automatic identification equipment and method
CN105049294A (en) Automatic testing method for port state switching of EAPS (Ethernet Automatic Protection Switching) protocol MASTER switch
CN112910910B (en) Method, device, equipment and storage medium for processing OPCDA protocol message
CN104007944A (en) Debugging printing method and system
CN106972963A (en) Enabling for business module enables control method after control method, collapse are restarted
CN109547317B (en) Method and device for establishing connection tunnel

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
EXSB Decision made by sipo to initiate substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
TR01 Transfer of patent right

Effective date of registration: 20201202

Address after: 313021 industrial function area of Donglin Town, Huzhou City, Zhejiang Province

Patentee after: ZHEJIANG YUANTE NEW MATERIAL Co.,Ltd.

Address before: 201616 Shanghai city Songjiang District Sixian Road No. 3666

Patentee before: Phicomm (Shanghai) Co.,Ltd.

TR01 Transfer of patent right
TR01 Transfer of patent right
TR01 Transfer of patent right

Effective date of registration: 20210524

Address after: Room 10242, No. 260, Jiangshu Road, Xixing street, Binjiang District, Hangzhou City, Zhejiang Province

Patentee after: Hangzhou Jiji Intellectual Property Operation Co.,Ltd.

Address before: 313021 industrial functional zone, Donglin Town, Huzhou City, Zhejiang Province

Patentee before: ZHEJIANG YUANTE NEW MATERIAL Co.,Ltd.

EE01 Entry into force of recordation of patent licensing contract

Application publication date: 20141210

Assignee: Hangzhou xiaobuzhixue Information Technology Co.,Ltd.

Assignor: Hangzhou Jiji Intellectual Property Operation Co.,Ltd.

Contract record no.: X2021330000454

Denomination of invention: Method and system for detecting interface state and handling interface fault according to interface state

Granted publication date: 20180525

License type: Common License

Record date: 20211019

EE01 Entry into force of recordation of patent licensing contract
EE01 Entry into force of recordation of patent licensing contract

Application publication date: 20141210

Assignee: Hangzhou national software industry base Co.,Ltd.

Assignor: Hangzhou Jiji Intellectual Property Operation Co.,Ltd.

Contract record no.: X2021330000669

Denomination of invention: Method and system for detecting interface state and handling interface fault according to interface state

Granted publication date: 20180525

License type: Common License

Record date: 20211103

EE01 Entry into force of recordation of patent licensing contract
TR01 Transfer of patent right

Effective date of registration: 20221228

Address after: 313000 room 1019, Xintiandi commercial office, Yishan street, Wuxing District, Huzhou, Zhejiang, China

Patentee after: Huzhou YingLie Intellectual Property Operation Co.,Ltd.

Address before: Room 10242, No. 260, Jiangshu Road, Xixing street, Binjiang District, Hangzhou City, Zhejiang Province

Patentee before: Hangzhou Jiji Intellectual Property Operation Co.,Ltd.

TR01 Transfer of patent right
TR01 Transfer of patent right

Effective date of registration: 20240105

Address after: 710077 G1-415, 7th Floor, Xixian Talent Building, Century Avenue, Fengdong New City, Xixian New District, Xi'an City, Shaanxi Province

Patentee after: Shaanxi Zhongbian Testing Technology Co.,Ltd.

Address before: 313000 room 1019, Xintiandi commercial office, Yishan street, Wuxing District, Huzhou, Zhejiang, China

Patentee before: Huzhou YingLie Intellectual Property Operation Co.,Ltd.

TR01 Transfer of patent right