CN114844775A - Router fault transfer method, router and computer storage medium - Google Patents
Router fault transfer method, router and computer storage medium Download PDFInfo
- Publication number
- CN114844775A CN114844775A CN202110049042.4A CN202110049042A CN114844775A CN 114844775 A CN114844775 A CN 114844775A CN 202110049042 A CN202110049042 A CN 202110049042A CN 114844775 A CN114844775 A CN 114844775A
- Authority
- CN
- China
- Prior art keywords
- network connection
- router
- terminal equipment
- interface
- main interface
- 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.)
- Granted
Links
- 238000000034 method Methods 0.000 title claims abstract description 68
- 238000012546 transfer Methods 0.000 title abstract description 8
- 238000004891 communication Methods 0.000 claims abstract description 106
- 238000001514 detection method Methods 0.000 claims description 2
- 238000010586 diagram Methods 0.000 description 6
- RYGMFSIKBFXOCR-UHFFFAOYSA-N Copper Chemical compound [Cu] RYGMFSIKBFXOCR-UHFFFAOYSA-N 0.000 description 5
- 238000004590 computer program Methods 0.000 description 5
- 229910052802 copper Inorganic materials 0.000 description 5
- 239000010949 copper Substances 0.000 description 5
- 239000013307 optical fiber Substances 0.000 description 5
- 230000008878 coupling Effects 0.000 description 4
- 238000010168 coupling process Methods 0.000 description 4
- 238000005859 coupling reaction Methods 0.000 description 4
- 230000003993 interaction Effects 0.000 description 3
- 230000009286 beneficial effect Effects 0.000 description 2
- 230000005540 biological transmission Effects 0.000 description 2
- 230000006870 function Effects 0.000 description 2
- 230000008569 process Effects 0.000 description 2
- 238000012545 processing Methods 0.000 description 2
- 230000023402 cell communication Effects 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 230000004044 response Effects 0.000 description 1
- 239000000523 sample Substances 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L41/00—Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
- H04L41/06—Management of faults, events, alarms or notifications
- H04L41/0654—Management of faults, events, alarms or notifications using network fault recovery
- H04L41/0663—Performing the actions predefined by failover planning, e.g. switching to standby network elements
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L43/00—Arrangements for monitoring or testing data switching networks
- H04L43/08—Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters
- H04L43/0805—Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters by checking availability
- H04L43/0811—Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters by checking availability by checking connectivity
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Environmental & Geological Engineering (AREA)
- Data Exchanges In Wide-Area Networks (AREA)
Abstract
The application relates to a router failure transfer method, a router and a computer storage medium. The method comprises the following steps: judging whether a main interface of the router completes initialization of network connection; if the main interface completes the initialization of network connection, determining a first target communication protocol for the network connection between the main interface and the terminal equipment; detecting whether the main interface establishes network connection with the terminal equipment through the first target communication protocol; if the main interface establishes network connection with the terminal equipment through the first target communication protocol, the router establishes network connection with the terminal equipment through the main interface; and if the main interface does not establish network connection with the terminal equipment through the first target communication protocol, the router establishes network connection with the terminal equipment through an auxiliary interface. The method and the device solve the problem that the fault transfer method of the router is low in efficiency.
Description
Technical Field
The present invention relates to the field of communications, and in particular, to a router failover method, a router, and a computer storage medium.
Background
When the existing router is in network connection with a switch or terminal equipment through a main interface, if a network is disconnected or fails, an interface switch of the router needs to be manually operated to start a second interface, and network connection is established through the second interface when the network connection of the main interface is lost, so that the failure transfer method of the router is inefficient. In addition, if the network is disconnected or fails, the router sends a ping packet to a specific IP address (e.g., DNS server) to check the network connection status. However, the DNS server is liable to identify the ping packet as a Denial of Service (DoS) attack without responding to the ping packet, which causes an error in determining the network connection of the router, thereby further causing an inefficiency of the failover method of the router.
Disclosure of Invention
In view of the above, there is a need to provide a router and a failover method of the router to solve the problem of inefficiency of the failover method of the router.
A first aspect of the present application provides a method for failover of a router, where the method includes:
judging whether a main interface of the router completes initialization of network connection;
if the main interface completes the initialization of network connection, determining a first target communication protocol for the network connection between the main interface and the terminal equipment;
detecting whether the main interface establishes network connection with the terminal equipment through the first target communication protocol;
if the main interface establishes network connection with the terminal equipment through the first target communication protocol, the router establishes network connection with the terminal equipment through the main interface;
and if the main interface does not establish network connection with the terminal equipment through the first target communication protocol, the router establishes network connection with the terminal equipment through an auxiliary interface.
Optionally, the determining whether the primary interface of the router completes initialization of network connection includes:
sending a handshake signal to the terminal equipment when the main interface is in an idle state;
the main interface receives a reply signal sent by the terminal equipment responding to the handshake signal;
the main interface exchanges data with the terminal equipment to negotiate communication parameters;
and the main interface and the terminal equipment complete initialization after negotiating communication parameters.
Optionally, the detecting whether the main interface establishes a network connection with the terminal device through the first target communication protocol includes:
judging whether the main interface establishes network connection with the terminal equipment;
if the main interface establishes network connection with the terminal equipment, judging whether the main interface receives first notification information sent by the terminal equipment, wherein the first notification information indicates that the main interface is in communication connection with the terminal equipment through the first target communication protocol;
detecting whether the main interface is in network connection with the terminal equipment through the target communication protocol;
if the main interface and the terminal equipment are in network connection through the target communication protocol, the main interface completes initialization;
and if the main interface and the terminal equipment are not in network connection through the target communication protocol, the router establishes network connection with the terminal equipment through the auxiliary interface.
Optionally, the detecting whether the main interface is in network connection with the terminal device through the target communication protocol includes:
the main interface of the router sends an internet data packet searching request to the terminal equipment;
when the router receives second notification information which is sent by the terminal equipment and responds to the internet data packet searching request, the router determines that the main interface is in network connection with the terminal equipment through the target communication protocol;
and when the router does not receive second notification information which is sent by the terminal equipment and responds to the internet data packet searching request, determining that the main interface and the terminal equipment are not in network connection through the target communication protocol.
Optionally, the detecting whether the main interface is in network connection with the terminal device through the target communication protocol includes:
the router sends a preset website to the terminal equipment through the main interface;
when the router receives third notification information which is sent by the terminal equipment and responds to the preset website, the router determines that the main interface is in network connection with the terminal equipment through the target communication protocol;
and when the router does not receive third notification information which is sent by the terminal equipment and responds to the preset website, determining that the main interface and the router are not in network connection through the target communication protocol, wherein the third notification information is an IP address obtained by analyzing the preset website.
Optionally, the establishing, by the router, a network connection with the terminal device through the auxiliary interface includes:
judging whether the auxiliary interface initializes the network connection;
if the auxiliary interface initializes the network connection, determining a second target communication protocol for the network connection between the auxiliary interface and the terminal equipment;
judging whether the auxiliary interface establishes network connection with the terminal equipment;
and if the auxiliary interface establishes network connection with the terminal equipment, the auxiliary interface is in network connection with the terminal equipment through a second target communication protocol.
Optionally, the method further comprises:
if the auxiliary interface and the terminal equipment do not establish network connection;
the router judges whether the main interface completes the initialization of network connection or carries out network connection with the terminal equipment;
if the main interface completes initialization of network connection or performs network connection with the terminal equipment, the router is in network connection with the terminal equipment through the main interface;
if the main interface does not finish the initialization of network connection or the network connection with the terminal equipment is carried out;
and the network connection between the router and the terminal equipment fails.
Optionally, the method further comprises: if the auxiliary interface does not initialize the network connection, the auxiliary interface initializes the network connection, including:
the auxiliary interface sends a detection signal to acquire a communication quality parameter of the auxiliary interface when in an idle state;
judging whether the communication quality parameter of the auxiliary interface exceeds a preset threshold value;
if the communication quality parameter of the auxiliary interface exceeds a preset threshold value, the auxiliary interface carries out modulation initialization;
judging whether the auxiliary interface receives a modulation and demodulation command sent by the terminal equipment;
and if the auxiliary interface receives a modulation and demodulation command sent by the terminal equipment, the auxiliary interface completes the initialization of network connection.
Optionally, the method further comprises:
detecting whether the main interface is in network connection with the terminal equipment or not;
and if the main interface is in network connection with the terminal equipment, setting the main interface as a main line in network connection with the terminal equipment, and disconnecting the network connection between the auxiliary interface and the terminal equipment.
Optionally, the detecting whether the main interface is in network connection with the terminal device includes:
the router sends preset websites for preset times to the terminal equipment at preset time intervals through the main interface;
if the router receives third notification information which is sent by the terminal equipment and responds to the preset website, determining that the main interface is in network connection with the router;
and if the router does not receive third notification information which is sent by the terminal equipment and responds to the preset website, determining that the main interface is not in network connection with the router.
Optionally, the method further comprises:
the router judges whether the main interface is stable;
and establishing network connection with the terminal equipment through the auxiliary interface when the primary interface is determined to be unstable.
A second aspect of the present application provides a router comprising a memory and a processor:
wherein the memory is to store program instructions;
the processor is configured to read and execute the program instructions stored in the memory, and when the program instructions are executed by the processor, the router is enabled to execute the above-mentioned router failover method.
A third aspect of the present application provides a computer storage medium storing program instructions that, when run on a router, cause the router to perform the above-mentioned failover method of the router.
The fault transfer method of the router can quickly and accurately detect whether the main interface is in network connection with the terminal equipment, can switch the main interface to the auxiliary interface when the network connection between the main interface and the terminal equipment is detected, and is in network connection with the terminal equipment through the auxiliary interface, so that the fault transfer efficiency of the router is improved, and seamless communication between the router and the terminal equipment is ensured. In addition, if the router is in network connection with the terminal equipment through the auxiliary interface, and if the router detects that the main interface is in network connection with the terminal equipment, the network connection between the auxiliary interface and the terminal equipment is disconnected, and the network connection is performed with the terminal equipment through the main interface, so that the power consumption and the communication cost are reduced.
Drawings
Fig. 1 is a diagram of an application environment of a router according to an embodiment of the present invention.
Fig. 2 is a schematic diagram illustrating a router connected to a terminal device through a network according to an embodiment of the present invention.
Fig. 3 is a flowchart of a failover method of a router according to an embodiment of the present invention.
Fig. 4 is a flowchart of a method for a master interface of a router to complete initialization of a network connection according to an embodiment of the present invention.
Fig. 5 is a flowchart of a method for detecting whether a host interface establishes a network connection with a terminal device via a target communication protocol according to an embodiment of the present invention.
Fig. 6 is a flowchart of a specific method for establishing a network connection between a router and a terminal device through an auxiliary interface according to an embodiment of the present invention.
Fig. 7 is a flowchart of a method for initializing a network connection by an auxiliary interface according to an embodiment of the present invention.
Fig. 8 is a schematic structural diagram of a router according to an embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
It will be understood that when an element is referred to as being "electrically connected" to another element, it can be directly on the other element or intervening elements may also be present. When an element is referred to as being "electrically connected" to another element, it can be connected by contact, e.g., by wires, or by contactless connection, e.g., by contactless coupling.
Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention belongs. The terminology used in the description of the invention herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the invention. As used herein, the term "and/or" includes any and all combinations of one or more of the associated listed items.
Some embodiments of the invention are described in detail below with reference to the accompanying drawings. The embodiments described below and the features of the embodiments can be combined with each other without conflict.
Referring to fig. 1, an application environment diagram of a router 1 according to an embodiment of the present invention is shown. As shown in fig. 1, the router 1 is connected to a terminal device 3 via a network 2. In one embodiment, the terminal device is an exchange, and the exchange is communicatively connected to at least one user equipment or a base station, so that the router 1 performs data interaction with the user equipment or the base station through the network 2. In another embodiment, the terminal device 3 may be a user equipment or a base station, and thus the router 1 directly performs data interaction with the user equipment or the base station through the network 2. In this embodiment, the network 2 may be at least one of a transmission line, a network segment, a communication channel, a communication network, and a communication cable.
Referring to fig. 2, a schematic diagram of a router 1 connected to a terminal device 3 through a network 2 according to an embodiment of the present invention is shown. The router 1 comprises a primary interface 11, a secondary interface 12, a processor 13 and a memory 14. The processor 13 is connected to the main interface 11, the auxiliary interface 12, and the memory 14. The network 2 comprises a primary channel 21 and a backup channel 22. The main interface 11 of the router 1 is connected to the terminal device 3 through a main channel 21, and the auxiliary interface 11 of the router 1 is connected to the terminal device 3 through an auxiliary channel 22.
In this embodiment, the main interface 11 and the auxiliary interface 12 are wide area network interfaces (Wan interfaces), and the number of the main interface 11 and the auxiliary interface 12 is one or more. In one embodiment, the main interface 11 is an Asymmetric Digital Subscriber Line (ADSL) interface, and the auxiliary interface 12 is a cell communication interface. For example, the main interface 11 is an RJ45 interface. The auxiliary interface 12 is a 3G communication interface, a 4G communication interface or a 5G communication interface. In this embodiment, the main channel 21 and the backup channel 22 of the network 2 may be copper cables, optical fibers, other communication cables, or any combination thereof. In one embodiment, the primary channel 21 is not the same as the backup channel 22. For example, if the main channel 21 is a copper cable, the spare channel 22 may be an optical fiber; if the main channel 21 is an optical fiber, the spare channel 22 may be a copper cable. In another embodiment, the primary channel 21 is the same as the backup channel 22. For example, if the main channel 21 is a copper cable, the spare channel 22 may also be a copper cable; if the main channel 21 is an optical fiber, the spare channel 22 may also be an optical fiber.
In the present embodiment, the memory 14 is used for storing data and/or software codes. The memory 14 may be an internal storage unit in the router 1, such as a hard disk or a memory in the router 1. In another embodiment, the memory 14 may also be an external storage device in the router 1, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), or the like provided on the router 1. The processor 13 is configured to forward, process, and store data received by the router 1. In this embodiment, the Processor 13 may be a Central Processing Unit (CPU), other general-purpose Processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), an off-the-shelf Programmable Gate Array (FPGA) or other Programmable logic device, a discrete Gate or transistor logic device, a discrete hardware component, or the like. The processor 13 may be any conventional processor or the like, and the processor 13 may also be a control center of the router 1, and various interfaces and lines are used to connect various parts of the whole router 1.
Referring to fig. 3, a flowchart of a failover method of a router according to an embodiment of the invention is shown. The method is applied in a router 1. The order of the steps in the flow chart may be changed, and some steps may be omitted or combined according to different requirements. The method comprises the steps.
Step S301, determining whether the main interface 11 of the router 1 completes initialization of network connection. If the main interface 11 of the router 1 completes the initialization of the network connection, step S302 is executed, otherwise, if the main interface 11 of the router 1 does not complete the initialization of the network connection, step S305 is executed.
In this embodiment, the specific steps of the main interface 11 of the router 1 completing the initialization of the network connection refer to fig. 4 and the following detailed description of fig. 4.
Step S302, determining a target communication protocol for the network connection between the main interface 11 and the terminal device 3.
In this embodiment, the router 1 provides a protocol list, where the protocol list includes a plurality of communication protocols, and each communication protocol in the protocol list has a corresponding priority. The router 1 selects a communication protocol with the highest priority from the protocol list according to the order of priority as a target communication protocol for network connection between the main interface 11 and the terminal device 3.
In another embodiment, the router 1 randomly selects a communication protocol from the protocol list as a target communication protocol for the network connection between the main interface 11 and the terminal device 3. In this embodiment, the communication Protocol includes a Point-to-Point Protocol Over Ethernet (PPPOE) and a Dynamic Host Configuration Protocol (DHCP) of an Ethernet.
Step S303, detecting whether the host interface 11 establishes a network connection with the terminal device 3 through the target communication protocol.
If the main interface 11 establishes the network connection with the terminal device 3 through the target communication protocol, step S304 is executed, otherwise, if the main interface 11 does not establish the network connection with the terminal device 3 through the target communication protocol, step S305 is executed.
In this embodiment, specific method steps for detecting whether the host interface 11 establishes the network connection with the terminal device 3 through the target communication protocol refer to fig. 5, and the following detailed description of fig. 5.
Step S304, the router 1 establishes a network connection with the terminal device 3 through the main interface 11.
Step S305, the router 1 establishes a network connection with the terminal device 3 through the auxiliary interface 12. In this embodiment, reference may be made to fig. 6 and the following detailed description of fig. 6 for specific method steps of the router 1 establishing a network connection with the terminal device 3 through the auxiliary interface 12.
In this embodiment, after step S304, the method further includes: the router 1 judges whether the main interface 11 is stable; establishing a network connection with the terminal device 3 via the secondary interface 12 upon determining that the primary interface is unstable. In this embodiment, when the main interface 11 performs information interaction with the terminal device 3 through the main channel 21, the main interface 11 is stable; when the main channel 21 is disconnected from the terminal device 3, the main interface 11 is unstable. In this embodiment, the auxiliary interface 12 interacts information with the terminal device 3 via the backup channel 22.
Referring to fig. 4, a flowchart of a method for the host interface 11 of the router 1 to complete initialization of network connection according to an embodiment of the present invention is shown, which specifically includes the following steps.
Step S401, when the main interface 11 is in an idle state, sending a handshake signal to the terminal device 3;
step S402, the main interface 11 receives a reply signal sent by the terminal device 3 in response to the handshake signal;
step S403, the main interface 11 exchanges data with the terminal device 3 to negotiate communication parameters;
step S404, the main interface 11 and the terminal device 3 complete initialization after negotiating communication parameters.
In this embodiment, after the initialization of the main interface 11 is completed, the router 1 detects whether the main interface 11 establishes network connection with the terminal device 3 through the target communication protocol. Referring to fig. 5, a flowchart of a method for the router 1 to detect whether the host interface 11 establishes a network connection with the terminal device 3 through the target communication protocol is shown, which specifically includes the following steps.
Step S501, judging whether the main interface 11 establishes network connection with the terminal device 3; step S502 is executed if the main interface 11 establishes a network connection with the terminal device 3, otherwise step S505 is executed if the main interface 11 does not establish a network connection with the terminal device 3.
Step S502, determining whether the main interface 11 receives first notification information sent by the terminal device 3, where the first notification information indicates that the main interface 11 and the terminal device 3 perform network connection through a target communication protocol.
Step S503, detecting whether the main interface 11 and the terminal device 3 are in network connection through the target communication protocol. If the main interface 11 and the terminal device 3 are connected to each other via the target communication protocol, step S504 is executed, otherwise, if the main interface 11 and the terminal device 3 are not connected to each other via the target communication protocol, step S505 is executed.
In this embodiment, the main interface 11 of the router 1 sends a ping (Packet Internet Groper, Internet Packet discovery) request to the terminal device 3, and determines that the main interface 11 and the terminal device 3 perform network connection through the target communication protocol when receiving the second notification information sent by the terminal device 3 and responding to the ping request, and determines that the main interface 11 and the terminal device 3 do not perform network connection through the target communication protocol when not receiving the second notification information sent by the terminal device 3 and responding to the ping request.
In another embodiment, the router 1 sends a preset website to the terminal device 3 through the main interface 11, determines that the main interface 11 and the terminal device 3 perform network connection through the target communication protocol when receiving third notification information, sent by the terminal device 3, responding to the preset website, and determines that the main interface 11 and the terminal device 3 do not perform network connection through the target communication protocol when not receiving the third notification information, sent by the terminal device 3, responding to the preset website. And the third notification information is an IP address obtained after the preset website is analyzed.
In step S504, the main interface 11 completes initialization.
Step S505, the router 1 establishes a network connection with the terminal device 3 through the auxiliary interface 12.
Referring to fig. 6, a flowchart of a specific method for the router 1 to establish a network connection with the terminal device 3 through the auxiliary interface 12 is shown, which specifically includes the following steps.
Step S601, determining whether the auxiliary interface 12 of the router 1 initializes the network connection. If the auxiliary interface 12 of the router 1 performs initialization of network connection, step S602 is executed, otherwise, if the auxiliary interface 12 of the router 1 does not perform initialization of network connection, step S608 is executed.
In this embodiment, the specific steps of the auxiliary interface 12 of the router 1 to initialize the network connection refer to fig. 7, and the following detailed description of fig. 7.
Step S602, determining a target communication protocol for the network connection between the auxiliary interface 12 and the terminal device 3.
In this embodiment, the communication Protocol includes a Point-to-Point Protocol over Asynchronous Transfer Mode (pppoint), and a Point-to-Point Protocol (PPP).
Step S603, determining whether the auxiliary interface 12 establishes a network connection with the terminal device 3; step S604 is executed if the auxiliary interface 12 establishes a network connection with the terminal device 3, or step S605 is executed if the main interface 11 does not establish a network connection with the terminal device 3.
In step S604, the auxiliary interface 12 performs network connection with the terminal device 3 through the target communication protocol.
In step S605, the router 1 determines whether the main interface 11 completes initialization of network connection or performs network connection with the terminal device 3. Step S606 is executed if the main interface 11 completes initialization of network connection or performs network connection with the terminal device 3, and step S607 is executed if the main interface 11 does not complete initialization of network connection or performs network connection with the terminal device 3. In this embodiment, the specific process of the host interface 11 completing initialization of network connection may refer to the process steps shown in fig. 5.
Step S606, the router 1 is connected to the terminal device 3 through the main interface 11.
In step S607, the router 1 fails to connect to the terminal device 3 via the network.
Step S608, the auxiliary interface 12 of the router 1 initializes the network connection.
In the present embodiment, the auxiliary interface 12 is in communication connection with the terminal device 3 through the target communication protocol, so that the router 1 is in communication connection with the terminal device 3 through the auxiliary interface 12. However, in order to consider the communication cost, the router 1 in the present application preferentially considers the communication connection with the terminal device 3 through the host interface 11. After the router 1 performs network connection with the terminal device 3 through the auxiliary interface 12, the router 1 determines whether the main interface 11 completes initialization of network connection or performs network connection with the terminal device 3; if the main interface 11 completes initialization of network connection or performs network connection with the terminal device 3, the router 1 is in network connection with the terminal device 3 through the main interface 11.
Referring to fig. 7, a flowchart of a method for initializing a network connection by the auxiliary interface 12 according to an embodiment of the present invention is shown, which specifically includes the following steps.
Step S701, when the auxiliary interface 12 is in an idle state, sending a probe signal to obtain a communication quality parameter of the auxiliary interface 12.
In this embodiment, the communication quality parameters include an error rate and a data transmission rate.
Step S702, determining whether the communication quality parameter of the auxiliary interface 12 exceeds a preset threshold to support the router 1 to perform network connection with the terminal device 3 through the auxiliary interface 12. If the communication quality parameter of the auxiliary interface 12 exceeds the preset threshold, step S703 is executed, and if the communication quality parameter of the auxiliary interface 12 does not exceed the preset threshold, step S701 is executed again.
In step S703, the auxiliary interface 12 performs modulation initialization.
In this embodiment, the performing, by the auxiliary interface 12, modulation initialization includes: communication parameters for the auxiliary interface 12 to communicate are initialized.
Step S704, determining whether the auxiliary interface 12 receives the modem command sent by the terminal device 3. If the auxiliary interface 12 receives the modem command sent by the terminal device 3, step S705 is executed, otherwise, if the auxiliary interface 12 does not receive the modem command sent by the terminal device 3, step S701 is executed. In this embodiment, the modem command is an Attention command.
In step S705, the auxiliary interface 12 completes initialization.
In this embodiment, when the router 1 is connected to the terminal device 3 through the main interface 11, the method further includes: detecting whether the main interface 11 is in network connection with the terminal equipment 3; if the main interface 11 is in network connection with the terminal device 3, the main interface 11 is set as a main line in network connection with the terminal device 3, and the network connection between the auxiliary interface 12 and the terminal device 3 is disconnected.
In this embodiment, the detecting whether the main interface 11 is in network connection with the terminal device 3 includes: the router 1 sends preset websites for preset times to the terminal device 3 at preset time intervals through a main interface 11; if third notification information which is sent by the terminal device 3 and responds to the preset website is received, determining that the main interface 11 is in network connection with the router 1 through the target communication protocol; and if the third notification information responding to the preset website sent by the terminal device 3 is not received, determining that the main interface 11 and the router 1 are not in network connection through the target communication protocol.
In this embodiment, the method for transferring a failure of a router can quickly and accurately detect whether the main interface 11 and the terminal device 3 are in network connection, and when the network connection between the main interface 11 and the terminal device 3 is detected, the main interface 11 can be switched to the auxiliary interface 12, and the terminal device 3 is in network connection through the auxiliary interface 12, so that the efficiency of transferring a failure of the router 1 is improved, and seamless communication between the router 1 and the terminal device 3 is ensured. In addition, if the router 1 performs network connection with the terminal device 3 through the auxiliary interface 12, and if it is detected that the main interface 11 establishes network connection with the terminal device 3, the network connection between the auxiliary interface 12 and the terminal device 3 is disconnected, and the network connection is performed with the terminal device 3 through the main interface 11, so that power consumption and communication cost are reduced.
Fig. 8 is a schematic structural diagram of a router 1 according to an embodiment of the present application. In an embodiment of the present application, the devices of the router 1 may be connected by one or more communication buses 15. The memory 14 is used to store one or more computer programs 16. One or more computer programs 16 are configured to be executed by the processor 13. The one or more computer programs 16 comprise a plurality of instructions which, when executed by the processor 13, may implement the failover method of the router executed on the router 1 in the above-described embodiments to implement the failover functionality of the router 1.
The present embodiment also provides a computer storage medium, in which computer instructions are stored, and when the computer instructions are run on the router 1, the router 1 is caused to execute the relevant method steps to implement the failover method of the router in the foregoing embodiment.
The present embodiment also provides a computer program product, which when running on a computer, causes the computer to execute the relevant steps described above, so as to implement the failover method of the router in the above embodiments.
In addition, embodiments of the present application also provide an apparatus, which may be specifically a chip, a component or a module, and may include a processor and a memory connected to each other; the memory is used for storing computer execution instructions, and when the device runs, the processor can execute the computer execution instructions stored in the memory, so that the chip can execute the failover method of the router in the above-mentioned method embodiments.
The router, the computer storage medium, the computer program product, or the chip provided in this embodiment are all configured to execute the corresponding method provided above, and therefore, the beneficial effects achieved by the router may refer to the beneficial effects in the corresponding method provided above, which are not described herein again.
Through the above description of the embodiments, it is clear to those skilled in the art that, for convenience and simplicity of description, the foregoing division of the functional modules is merely used as an example, and in practical applications, the above function distribution may be completed by different functional modules according to needs, that is, the internal structure of the device may be divided into different functional modules to complete all or part of the above described functions.
In the several embodiments provided in the present application, it should be understood that the disclosed apparatus and method may be implemented in other ways. For example, the above-described device embodiments are merely illustrative, and for example, the division of the module or unit is only one logical division, and there may be other divisions when actually implemented, for example, a plurality of units or components may be combined or integrated into another device, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may be one physical unit or a plurality of physical units, that is, may be located in one place, or may be distributed to a plurality of different places. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit may be implemented in the form of hardware, or may also be implemented in the form of a software functional unit.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a readable storage medium. Based on such understanding, the technical solutions of the embodiments of the present application may be essentially or partially contributed to by the prior art, or all or part of the technical solutions may be embodied in the form of a software product, where the software product is stored in a storage medium and includes several instructions to enable a device (which may be a single chip, a chip, or the like) or a processor (processor) to execute all or part of the steps of the methods of the embodiments of the present application. And the aforementioned storage medium includes: various media capable of storing program codes, such as a usb disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk, or an optical disk.
Finally, it should be noted that the above embodiments are only used for illustrating the technical solutions of the present application and not for limiting, and although the present application is described in detail with reference to the preferred embodiments, it should be understood by those skilled in the art that modifications or equivalent substitutions can be made on the technical solutions of the present application without departing from the spirit and scope of the technical solutions of the present application.
Claims (13)
1. A method of failover of a router, the method comprising:
judging whether a main interface of the router completes initialization of network connection;
if the main interface completes the initialization of network connection, determining a first target communication protocol for the network connection between the main interface and the terminal equipment;
detecting whether the main interface establishes network connection with the terminal equipment through the first target communication protocol;
if the main interface establishes network connection with the terminal equipment through the first target communication protocol, the router establishes network connection with the terminal equipment through the main interface;
and if the main interface does not establish network connection with the terminal equipment through the first target communication protocol, the router establishes network connection with the terminal equipment through an auxiliary interface.
2. The method of router failover according to claim 1, wherein the determining whether the primary interface of the router completes initialization of the network connection includes:
sending a handshake signal to the terminal equipment when the main interface is in an idle state;
the main interface receives a reply signal sent by the terminal equipment responding to the handshake signal;
the main interface exchanges data with the terminal equipment to negotiate communication parameters;
and the main interface and the terminal equipment complete initialization after negotiating communication parameters.
3. The method of router failover according to claim 1, wherein said detecting whether the primary interface establishes a network connection with the end device over the first target communication protocol comprises:
judging whether the main interface establishes network connection with the terminal equipment;
if the main interface establishes network connection with the terminal equipment, judging whether the main interface receives first notification information sent by the terminal equipment, wherein the first notification information indicates that the main interface is in communication connection with the terminal equipment through the first target communication protocol;
detecting whether the main interface is in network connection with the terminal equipment through the target communication protocol;
if the main interface and the terminal equipment are in network connection through the target communication protocol, the main interface completes initialization;
and if the main interface and the terminal equipment are not in network connection through the target communication protocol, the router establishes network connection with the terminal equipment through the auxiliary interface.
4. The method of router failover according to claim 3, wherein said detecting whether the primary interface is networked with the end device via the target communication protocol comprises:
the main interface of the router sends an internet data packet searching request to the terminal equipment;
when the router receives second notification information which is sent by the terminal equipment and responds to the internet data packet searching request, the router determines that the main interface is in network connection with the terminal equipment through the target communication protocol;
and when the router does not receive second notification information which is sent by the terminal equipment and responds to the internet data packet searching request, determining that the main interface and the terminal equipment are not in network connection through the target communication protocol.
5. The method of router failover according to claim 3, wherein said detecting whether the primary interface is networked with the end device via the target communication protocol comprises:
the router sends a preset website to the terminal equipment through the main interface;
when the router receives third notification information which is sent by the terminal equipment and responds to the preset website, the router determines that the main interface is in network connection with the terminal equipment through the target communication protocol;
and when the router does not receive third notification information which is sent by the terminal equipment and responds to the preset website, determining that the main interface and the router are not in network connection through the target communication protocol, wherein the third notification information is an IP address obtained by analyzing the preset website.
6. The method of router failover according to claim 1, wherein the router establishing a network connection with the terminal device over the secondary interface comprises:
judging whether the auxiliary interface initializes the network connection;
if the auxiliary interface initializes the network connection, determining a second target communication protocol for the network connection between the auxiliary interface and the terminal equipment;
judging whether the auxiliary interface establishes network connection with the terminal equipment;
and if the auxiliary interface establishes network connection with the terminal equipment, the auxiliary interface is in network connection with the terminal equipment through a second target communication protocol.
7. The method of failover of a router of claim 6, the method further comprising:
if the auxiliary interface and the terminal equipment do not establish network connection;
the router judges whether the main interface completes the initialization of network connection or carries out network connection with the terminal equipment;
if the main interface completes initialization of network connection or performs network connection with the terminal equipment, the router is in network connection with the terminal equipment through the main interface;
if the main interface does not finish the initialization of network connection or the network connection with the terminal equipment is carried out;
and the network connection between the router and the terminal equipment fails.
8. The method of failover of a router of claim 6, the method further comprising: if the auxiliary interface does not perform the initialization of the network connection, the auxiliary interface performs the initialization of the network connection, including:
the auxiliary interface sends a detection signal to acquire a communication quality parameter of the auxiliary interface when in an idle state;
judging whether the communication quality parameter of the auxiliary interface exceeds a preset threshold value;
if the communication quality parameter of the auxiliary interface exceeds a preset threshold value, the auxiliary interface carries out modulation initialization;
judging whether the auxiliary interface receives a modulation and demodulation command sent by the terminal equipment;
and if the auxiliary interface receives a modulation and demodulation command sent by the terminal equipment, the auxiliary interface completes the initialization of network connection.
9. The method of failover of a router of claim 7, the method further comprising:
detecting whether the main interface is in network connection with the terminal equipment;
and if the main interface is in network connection with the terminal equipment, setting the main interface as a main line in network connection with the terminal equipment, and disconnecting the network connection between the auxiliary interface and the terminal equipment.
10. The method of router failover according to claim 9, wherein said detecting whether the primary interface is in network connection with the end device comprises:
the router sends preset websites for preset times to the terminal equipment at preset time intervals through the main interface;
if the router receives third notification information which is sent by the terminal equipment and responds to the preset website, determining that the main interface is in network connection with the router;
and if the router does not receive third notification information which is sent by the terminal equipment and responds to the preset website, determining that the main interface is not in network connection with the router.
11. The method of failover of a router of claim 1, the method further comprising:
the router judges whether the main interface is stable;
and establishing network connection with the terminal equipment through the auxiliary interface when the primary interface is determined to be unstable.
12. A router, the router comprising a memory and a processor:
wherein the memory is configured to store program instructions;
the processor configured to read and execute the program instructions stored in the memory, and when the program instructions are executed by the processor, cause the router to perform the failover method of the router according to any one of claims 1 to 11.
13. A computer storage medium, characterized in that it stores program instructions which, when run on a router, cause the router to perform a failover method of a router according to any one of claims 1 to 11.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110049042.4A CN114844775B (en) | 2021-01-14 | 2021-01-14 | Fault transfer method of router, router and computer storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110049042.4A CN114844775B (en) | 2021-01-14 | 2021-01-14 | Fault transfer method of router, router and computer storage medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN114844775A true CN114844775A (en) | 2022-08-02 |
CN114844775B CN114844775B (en) | 2024-08-20 |
Family
ID=82560884
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202110049042.4A Active CN114844775B (en) | 2021-01-14 | 2021-01-14 | Fault transfer method of router, router and computer storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN114844775B (en) |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20030161260A1 (en) * | 2002-02-25 | 2003-08-28 | Sundara Murugan | Method and apparatus for implementing automatic protection switching functionality in a distributed processor data router |
CN101051884A (en) * | 2007-05-09 | 2007-10-10 | 杭州华三通信技术有限公司 | Method and device for realizing interface backup |
CN102067523A (en) * | 2008-12-05 | 2011-05-18 | 思科技术公司 | Failover and failback of communication between a router and a network switch |
CN102158399A (en) * | 2011-02-26 | 2011-08-17 | 华为数字技术有限公司 | Method and system for realizing cross-board binding |
CN105847138A (en) * | 2015-01-12 | 2016-08-10 | 中兴通讯股份有限公司 | Business processing method and device |
CN111290986A (en) * | 2020-03-03 | 2020-06-16 | 深圳鲲云信息科技有限公司 | Bus interconnection system based on neural network |
-
2021
- 2021-01-14 CN CN202110049042.4A patent/CN114844775B/en active Active
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20030161260A1 (en) * | 2002-02-25 | 2003-08-28 | Sundara Murugan | Method and apparatus for implementing automatic protection switching functionality in a distributed processor data router |
CN101051884A (en) * | 2007-05-09 | 2007-10-10 | 杭州华三通信技术有限公司 | Method and device for realizing interface backup |
CN102067523A (en) * | 2008-12-05 | 2011-05-18 | 思科技术公司 | Failover and failback of communication between a router and a network switch |
CN102158399A (en) * | 2011-02-26 | 2011-08-17 | 华为数字技术有限公司 | Method and system for realizing cross-board binding |
CN105847138A (en) * | 2015-01-12 | 2016-08-10 | 中兴通讯股份有限公司 | Business processing method and device |
CN111290986A (en) * | 2020-03-03 | 2020-06-16 | 深圳鲲云信息科技有限公司 | Bus interconnection system based on neural network |
Non-Patent Citations (2)
Title |
---|
佚名: "Evaluating Backup Interfaces, Floating Static Routes, and Dialer Watch for DDR Backup", Retrieved from the Internet <URL:https://www.cisco.com/c/en/us/support/docs/dial-access/dial-on-demand-routing-ddr/10213-backup-main.html> * |
孔艺权: "网络路由备份技术设计及实验仿真", 实验室研究与探索, 15 May 2012 (2012-05-15) * |
Also Published As
Publication number | Publication date |
---|---|
CN114844775B (en) | 2024-08-20 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN102474515B (en) | Connection device certification | |
EP3036873B1 (en) | Dedicated control path architecture for stacked packet switches | |
CN108347351B (en) | Method, device and system for compatibility of dual Ethernet cards of equipment | |
EP2854369B1 (en) | Method and apparatus for detecting interface connection between devices | |
CN101953139B (en) | DHCP in response to Internet connectedness initializes | |
EP3310119B1 (en) | Method and apparatus for processing network connection | |
US20070223494A1 (en) | Method for the resolution of addresses in a communication system | |
CN110868278B (en) | Method for dual-computer redundancy of communication front-end processor of rail transit comprehensive monitoring system | |
US10148764B2 (en) | Backup wide area network connection for access points and routers | |
CN114598735B (en) | Data processing method and system | |
CN101958888A (en) | Configuration method of port negotiation capacity, communication port and communication device | |
CN112491603A (en) | Equipment configuration method, device, equipment and storage medium | |
CN103973468A (en) | Processing method and processing device for automatically setting Internet surfing mode | |
CN106656659B (en) | Network path selection method and network video recorder | |
CN103856411A (en) | Switching system connected with UART interface of router | |
JP4793739B2 (en) | Wireless LAN device, wireless LAN master / slave switching method, program for wireless LAN device | |
CN101227479A (en) | Method and apparatus of topology linkage | |
CN114844775B (en) | Fault transfer method of router, router and computer storage medium | |
CN112822088B (en) | Network connection method and device, electronic equipment, processor and storage medium | |
US9811496B2 (en) | Method and apparatus for detecting interface connection between devices | |
CN111327431B (en) | Charging policy obtaining method and device | |
CN103858105A (en) | Connection method | |
CN102932497A (en) | Method, device and system for obtaining internet protocol address | |
CN114286403A (en) | Switching method and switching device of Internet access mode of gateway device | |
CN115687223A (en) | Method and device for serial port communication of embedded equipment, embedded equipment, storage medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |