[go: up one dir, main page]
More Web Proxy on the site http://driver.im/

CN114024903A - Network switching method, device and gateway device - Google Patents

Network switching method, device and gateway device Download PDF

Info

Publication number
CN114024903A
CN114024903A CN202111315485.XA CN202111315485A CN114024903A CN 114024903 A CN114024903 A CN 114024903A CN 202111315485 A CN202111315485 A CN 202111315485A CN 114024903 A CN114024903 A CN 114024903A
Authority
CN
China
Prior art keywords
network
state
fixed
routing table
fixed network
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.)
Pending
Application number
CN202111315485.XA
Other languages
Chinese (zh)
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.)
Shenzhen Gongjin Electronics Co Ltd
Original Assignee
Shenzhen Gongjin Electronics 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 Shenzhen Gongjin Electronics Co Ltd filed Critical Shenzhen Gongjin Electronics Co Ltd
Priority to CN202111315485.XA priority Critical patent/CN114024903A/en
Publication of CN114024903A publication Critical patent/CN114024903A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/54Store-and-forward switching systems 
    • H04L12/56Packet switching systems
    • H04L12/5691Access to open networks; Ingress point selection, e.g. ISP selection
    • H04L12/5692Selection among different networks
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/66Arrangements for connecting between networks having differing types of switching systems, e.g. gateways

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Mobile Radio Communication Systems (AREA)

Abstract

本申请实施例公开了网络切换方法、装置及网关设备,网络切换方法应用于网关设备,所述方法包括与固网对应的第一广域网建立连接,并与移动网络对应的第二广域网建立连接;确定固网的网络通断状态,以及包括路由表项的当前网络;若所述当前网络为固网,且所述固网的网络通断状态为断开状态,删除所述固网的路由表项,并为所述移动网络配置路由表项;若所述当前网络为移动网络,且所述固网的网络通断状态为连通状态,删除所述移动网络的路由表项,并为所述固网配置路由表项。网关设备与移动网络保持联通状态,通过配置网络的路由表项的方式,将数据路由至配置了路由表项的网络,降低了固网与移动网络的切换时长。

Figure 202111315485

The embodiments of the present application disclose a network switching method, an apparatus, and a gateway device. The network switching method is applied to the gateway device, and the method includes establishing a connection with a first wide area network corresponding to a fixed network, and establishing a connection with a second wide area network corresponding to the mobile network; Determine the network on-off state of the fixed network and the current network including the routing table entry; if the current network is a fixed network and the network on-off state of the fixed network is a disconnected state, delete the routing table of the fixed network item, and configure a routing table entry for the mobile network; if the current network is a mobile network, and the network on-off state of the fixed network is a connected state, delete the routing table entry of the mobile network, and set the Fixed network configuration routing table entries. The gateway device maintains a state of communication with the mobile network, and routes data to the network configured with the routing table entry by configuring the routing table entry of the network, reducing the switching time between the fixed network and the mobile network.

Figure 202111315485

Description

Network switching method and device and gateway equipment
Technical Field
The present invention relates to the field of gateways, and in particular, to a network switching method and apparatus, and a gateway device.
Background
With the development of mobile Internet technology, gateway devices provide the ability to access services of the Internet (Internet) through a mobile network or a fixed network. When a physical link between the gateway device and the upper-level device is disconnected and a network node of an operator of the fixed network has a problem, the fixed network may be failed.
When the fixed network fails, the gateway equipment is switched to the mobile network so as to ensure that the user terminal can continuously access the Internet. In the switching process of the mobile network and the fixed network, the switching time is long, and a user using the network can obviously feel the interruption of the network and influence the user terminal to access the Internet.
Disclosure of Invention
In view of the defects in the prior art, embodiments of the present application provide a network switching method, a device, and a gateway device, so as to solve the problem that a switching duration is long in a switching process between a mobile network and a fixed network.
In a first aspect, an embodiment of the present application provides a network switching method, which is applied to a gateway device, and the network switching method includes:
establishing connection with a first wide area network corresponding to the fixed network, and establishing connection with a second wide area network corresponding to the mobile network;
determining the network on-off state of the fixed network and the current network comprising the routing table items;
if the current network is a fixed network and the network on-off state of the fixed network is a disconnected state, deleting the routing table entry of the fixed network and configuring the routing table entry for the mobile network;
and if the current network is a mobile network and the network on-off state of the fixed network is a connected state, deleting the routing table entry of the mobile network and configuring the routing table entry for the fixed network.
With reference to the first aspect, in a first possible implementation manner, the gateway device includes a first counter, and if the current network is a fixed network and a network on-off state of the fixed network is an off state, deleting a routing table entry of the fixed network and configuring a routing table entry for the mobile network includes:
and if the current network is a fixed network and the network on-off state of the fixed network is a disconnected state, adding one to the count of the first counter, and repeatedly executing the steps of determining the network on-off state of the fixed network and the current network comprising routing table entries, deleting the routing table entries of the fixed network and configuring the routing table entries for the mobile network until the count of the first counter reaches a first count threshold value.
With reference to the first aspect, in a second possible implementation manner, the gateway device includes a second counter, and if the current network is a mobile network and the network on-off state of the fixed network is a connected state, deleting a routing table entry of the mobile network and configuring a routing table entry for the fixed network includes:
and if the current network is a mobile network and the network on-off state of the fixed network is a connected state, adding one to the count of the second counter, and repeatedly executing the steps of determining the network on-off state of the fixed network and the current network comprising the routing table items, deleting the routing table items of the mobile network until the count of the second counter reaches a second count threshold value, and configuring the routing table items for the fixed network.
With reference to the first aspect, in a third possible implementation manner, after the determining the network on-off state of the fixed network and the current network including the routing table entry, the method further includes:
when the network on-off state of the fixed network is the off state, sending a first message to a message receiver, and receiving a first response message sent by the message receiver;
if the first response message does not comprise the MAC address corresponding to the gateway address of the fixed network, deleting the gateway address of the fixed network and restarting the DHCP process;
and if the first response message comprises the MAC address corresponding to the gateway address of the fixed network, executing the steps of determining the network on-off state of the fixed network and the current network comprising the routing list item.
With reference to the first aspect, in a fourth possible implementation manner, the determining a network on-off state of the fixed network includes:
sending a second message to a message receiver, and receiving a second response message sent by the message receiver;
if the second response message comprises the gateway address of the fixed network, determining that the network on-off state of the fixed network is a connected state;
and if the second response message does not comprise the gateway address of the fixed network, determining that the network on-off state of the fixed network is a disconnected state.
With reference to the first aspect, in a fifth possible implementation manner, after the determining the network on-off state of the fixed network and the current network including the routing table entry, the method further includes:
and if the current network is a fixed network and the network on-off state of the fixed network is a connected state, executing the steps of determining the network on-off state of the fixed network and the current network comprising the routing list items based on a preset time interval.
With reference to the first aspect, in a sixth possible implementation manner, after the connection is established with the first wide area network corresponding to the fixed network and the connection is established with the second wide area network corresponding to the mobile network, the determining a network on-off state of the fixed network and before the current network including the routing table entry further includes:
acquiring the link on-off state of the fixed network;
if the link on-off state of the fixed network is a connected state, starting a DHCP process and configuring a routing table item for the fixed network;
and if the link on-off state of the fixed network is the off state, configuring a routing table entry for the mobile network.
In a second aspect, an embodiment of the present application is a network switching apparatus applied to a gateway device, where the network switching apparatus includes:
the connection module is used for establishing connection with a first wide area network corresponding to the fixed network and establishing connection with a second wide area network corresponding to the mobile network;
the determining module is used for determining the network on-off state of the fixed network and the current network comprising the routing list items;
the mobile routing configuration module is used for deleting the routing table entry of the fixed network and configuring the routing table entry for the mobile network if the current network is the fixed network and the network on-off state of the fixed network is the off state;
and the fixed routing configuration module is used for deleting the routing table entry of the mobile network and configuring the routing table entry for the fixed network if the current network is the mobile network and the network on-off state of the fixed network is the connected state.
In a third aspect, an embodiment of the present application provides a gateway device, which includes a processor and a memory, where the memory stores a program or an instruction, and the program or the instruction is executed by the processor, so as to cause the gateway device to execute the steps of the network handover method described above.
In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, on which a program or instructions are stored, and the program or instructions, when executed by a processor, implement the steps of the network handover method described above.
The application provides a network switching method, which is applied to gateway equipment, and establishes connection with a first wide area network corresponding to a fixed network and a second wide area network corresponding to a mobile network; determining the network on-off state of the fixed network and the current network comprising the routing table items; if the current network is a fixed network and the network on-off state of the fixed network is a disconnected state, deleting the routing table entry of the fixed network and configuring the routing table entry for the mobile network; and if the current network is a mobile network and the network on-off state of the fixed network is a connected state, deleting the routing table entry of the mobile network and configuring the routing table entry for the fixed network. The gateway equipment and the mobile network are kept in a communication state, and data are routed to the network configured with the routing table items in a mode of configuring the routing table items of the network, so that the switching time of the fixed network and the mobile network is reduced.
Drawings
In order to more clearly illustrate the technical solution of the present invention, the drawings required to be used in the embodiments will be briefly described below, and it should be understood that the following drawings only illustrate some embodiments of the present invention, and therefore should not be considered as limiting the scope of the present invention. Like components are numbered similarly in the various figures.
Fig. 1 shows a flowchart of a network handover method provided in embodiment 1 of the present invention;
fig. 2 is a schematic structural diagram of a network switching apparatus according to embodiment 2 of the present invention.
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.
The components of embodiments of the present invention generally described and illustrated in the figures herein may be arranged and designed in a wide variety of different configurations. Thus, the following detailed description of the embodiments of the present invention, presented in the figures, is not intended to limit the scope of the invention, as claimed, but is merely representative of selected embodiments of the invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments of the present invention without making any creative effort, shall fall within the protection scope of the present invention.
Hereinafter, the terms "including", "having", and their derivatives, which may be used in various embodiments of the present invention, are only intended to indicate specific features, numbers, steps, operations, elements, components, or combinations of the foregoing, and should not be construed as first excluding the existence of, or adding to, one or more other features, numbers, steps, operations, elements, components, or combinations of the foregoing.
Furthermore, the terms "first," "second," "third," and the like are used solely to distinguish one from another and are not to be construed as indicating or implying relative importance.
Unless otherwise defined, all terms (including technical and scientific terms) used herein have the same meaning as commonly understood by one of ordinary skill in the art to which various embodiments of the present invention belong. The terms (such as those defined in commonly used dictionaries) should be interpreted as having a meaning that is consistent with their contextual meaning in the relevant art and will not be interpreted in an idealized or overly formal sense unless expressly so defined herein in various embodiments of the present invention.
Example 1
Referring to fig. 1, fig. 1 is a flowchart illustrating a network handover method according to embodiment 1 of the present invention. The network switching method in fig. 1 is applied to a gateway device, and includes the following steps:
step 101, establishing connection with a first wide area network corresponding to a fixed network, and establishing connection with a second wide area network corresponding to a mobile network.
It should be understood that the fixed network is also called a fixed network or a fixed network, and is a network for transmitting signals through a fixed medium such as a metal wire or an optical fiber line. A mobile network, also known as a cellular network, is a wireless network that does not rely on fixed devices. The wide area network, also called as an extranet or a public network, is a remote network connecting local area or metropolitan area network devices in different regions for communication. In this application, the first wide area network and the second wide area network may be networks provided by any operator, specifically, the wide area network may be a 4G network, a 5G network, or the like, and may also be a future communication network, such as a 6G network, and the like, which is not limited herein.
Taking the mobile network as an example, after the gateway device establishes connection with the second wide area network corresponding to the mobile network, the gateway device does not configure a routing table entry of the mobile network, that is, the mobile network is not used as a default wide area network for connection, and the gateway device does not access the internet through the mobile network. When the gateway device needs to access the internet through the mobile network, the routing table entry of the mobile network is configured to connect the mobile network as a default wide area network.
As an example, after the connection is established with the first wide area network corresponding to the fixed network and the connection is established with the second wide area network corresponding to the mobile network, the determining the network on-off state of the fixed network and before the current network including the routing table entry further includes:
acquiring the link on-off state of the fixed network;
if the link on-off state of the fixed network is a connected state, starting a DHCP process and configuring a routing table item for the fixed network;
and if the link on-off state of the fixed network is the off state, configuring a routing table entry for the mobile network.
When communicating over a fixed network, a link refers to a physical line, such as a cable or an optical fiber, between two devices. And if the link on-off state of the fixed network is the connected state, confirming that the gateway equipment is normally connected with equipment providing the fixed network through the link, and configuring a routing table item for the fixed network so as to access the Internet through the fixed network. And if the link on-off state of the fixed network is the off state, confirming that the gateway equipment is not connected with equipment providing the fixed network through the link, and configuring a routing table item for the mobile network so as to access the Internet through the mobile network.
It should be understood that DHCP (Dynamic Host Configuration Protocol) is a network Protocol of a local area network, and is used to manage and allocate IP addresses, so that devices in the local area network dynamically obtain information such as IP addresses and DNS addresses, and improve the utilization rate of the addresses. After the gateway equipment establishes connection with the first wide area network corresponding to the fixed network, the DHCP process is started to avoid faults caused by repeated use of addresses.
Step 102, determining the network on-off state of the fixed network and the current network comprising the routing list items.
In this application, the current network is one of a fixed network and a mobile network. Specifically, if a routing table entry is configured for the mobile network, the current network is the mobile network, that is, the gateway device currently accesses the internet through the mobile network. If the routing table entry is configured for the fixed network, the current network is the fixed network, that is, the gateway device currently accesses the internet through the fixed network.
After the gateway device establishes a connection with a first wide area network corresponding to a fixed network, if the fixed network provided by an operator fails, the fixed network cannot access the internet. And determining whether the network between the two devices is smooth or not by determining the network on-off state of the fixed network so as to determine the reason of the fixed network fault.
As an example, after determining the network on-off state of the fixed network and the current network including the routing table entry, the method further includes:
and if the current network is a fixed network and the network on-off state of the fixed network is a connected state, executing the steps of determining the network on-off state of the fixed network and the current network comprising the routing list items based on a preset time interval.
If the network on-off state of the fixed network is the connected state, the fixed network provided by the operator does not send a fault, and the mode of accessing the Internet through the fixed network is kept. Meanwhile, step 102 is executed based on a preset time interval, and when the network on-off state of the fixed network is ensured to be a disconnected state, the gateway equipment is switched to access the Internet through the mobile network in real time.
And 103, if the current network is a fixed network and the network on-off state of the fixed network is a disconnected state, deleting the routing table entry of the fixed network and configuring the routing table entry for the mobile network.
If the network on-off state of the fixed network is the off state, the internet cannot be normally accessed through the fixed network. And deleting the routing table entry of the fixed network, configuring the routing table entry for the mobile network, and connecting the mobile network as a default wide area network to ensure that the Internet can be continuously accessed.
And when the network on-off state of the fixed network is a connection state, accessing the Internet through the fixed network. Meanwhile, the gateway device maintains the second wan connection corresponding to the mobile network, and does not configure a routing table entry for the mobile network, and data is not routed to the mobile network. When the network on-off state of the fixed network is the off state, the routing table entry of the fixed network is deleted, and the routing table entry is configured for the mobile network, so that the data can be routed to the mobile network, and the switching time length between the mobile network and the fixed network is reduced.
As an example, the gateway device includes a first counter, and if the current network is a fixed network and the network on-off state of the fixed network is an off state, deleting the routing table entry of the fixed network and configuring the routing table entry for the mobile network includes:
and if the current network is a fixed network and the network on-off state of the fixed network is a disconnected state, adding one to the count of the first counter, and repeatedly executing the steps of determining the network on-off state of the fixed network and the current network comprising routing table entries, deleting the routing table entries of the fixed network and configuring the routing table entries for the mobile network until the count of the first counter reaches a first count threshold value.
The first count threshold may be any number of times, and is not limited herein. Taking the first count threshold as 3 for example, if the current network is still the fixed network and the network on-off state of the fixed network is the off state after the step 102 is continuously executed for 3 times, it is determined that the internet cannot be normally accessed through the fixed network at the current time. The mobile network is connected as a default wide area network to ensure continued access to the Internet.
And 104, if the current network is a mobile network and the network on-off state of the fixed network is a connected state, deleting the routing table entry of the mobile network and configuring the routing table entry for the fixed network.
The fixed network has the characteristic of being not easily influenced by the network environment relative to the mobile network, and if the current network is the mobile network and the network on-off state of the fixed network is the connected state, the internet can be normally accessed through the fixed network. And deleting the routing table entry of the mobile network, configuring the routing table entry for the fixed network, and connecting the fixed network as a default wide area network, so that the charging and the flow generated by using the mobile network are reduced. If the current network is a mobile network and the network on-off state of the fixed network is a disconnected state, the mode of accessing the Internet through the mobile network is maintained so as to ensure that the Internet can be continuously accessed.
As an example, the gateway device includes a second counter, and if the current network is a mobile network and the network on-off state of the fixed network is a connected state, deleting the routing table entry of the mobile network and configuring the routing table entry for the fixed network includes:
and if the current network is a mobile network and the network on-off state of the fixed network is a connected state, adding one to the count of the second counter, and repeatedly executing the steps of determining the network on-off state of the fixed network and the current network comprising the routing table items, deleting the routing table items of the mobile network until the count of the second counter reaches a second count threshold value, and configuring the routing table items for the fixed network.
The second count threshold may be any number of times, and is not limited herein. Taking the second count threshold as 3 for example, if the current network is still the mobile network and the network on-off state of the fixed network is the off state after continuously executing step 102 for 3 times, it is determined that the internet can be normally accessed through the fixed network at the current moment. The fixed network is used as a default wide area network for connection, so that the charging and the flow generated by using the mobile network are reduced.
As an example, after determining the network on-off state of the fixed network and the current network including the routing table entry, the method further includes:
when the network on-off state of the fixed network is the off state, sending a first message to a message receiver, and receiving a first response message sent by the message receiver;
if the first response message does not comprise the MAC address corresponding to the gateway address of the fixed network, deleting the gateway address of the fixed network and restarting the DHCP process;
and if the first response message comprises the MAC address corresponding to the gateway address of the fixed network, executing the steps of determining the network on-off state of the fixed network and the current network comprising the routing list item.
The MAC Address (Media Access Control Address, MAC Address) is used to uniquely identify a network card in the network. In the communication process, the MAC address and the IP address are in one-to-one correspondence. When receiving the data packet, the gateway device maps the IP address in the data packet into the MAC address, and sends the data packet to the device corresponding to the MAC address.
ARP (Address Resolution Protocol) is a Protocol for acquiring a MAC Address from an IP Address. And judging whether the MAC address corresponding to the IP address of the fixed network is obtained or not through the ARP message. And if the MAC address corresponding to the gateway address of the fixed network is not obtained, deleting the gateway address of the fixed network and restarting the DHCP process so as to redistribute the gateway address of the fixed network and avoid errors caused by gateway address conflict. If the MAC address corresponding to the gateway address of the fixed network is obtained, the gateway address of the fixed network is reserved, and step 102 is executed to wait for the network on-off state of the fixed network to be restored to the connection state from the disconnection state.
As an example, the determining the network on-off state of the fixed network includes:
sending a second message to a message receiver, and receiving a second response message sent by the message receiver;
if the second response message comprises the gateway address of the fixed network, determining that the network on-off state of the fixed network is a connected state;
and if the second response message does not comprise the gateway address of the fixed network, determining that the network on-off state of the fixed network is a disconnected state.
And sending the second message to a message receiver, and receiving and analyzing the second response message sent by the message receiver.
It should be understood that the second Message may be an icmp (Internet Control Message Protocol) Message, an ICMPv6(Internet Control Message Protocol version 6) Message, and the like, and is not limited herein. The message receiver may be any device that establishes a connection relationship with the gateway device, and is not limited herein. The gateway address may be an IP address, a DNS address, a MAC address, etc., and is not limited herein.
Taking the example that the message receiver sends the ICMP and the ICMPv6, if the response message includes gateway addresses such as IPv4 and IPv6, the network on-off state of the fixed network is determined to be a connected state. And if the response message does not contain the gateway address, determining that the network on-off state of the fixed network is the off state.
The application provides a network switching method, which is applied to gateway equipment, and establishes connection with a first wide area network corresponding to a fixed network and a second wide area network corresponding to a mobile network; determining the network on-off state of the fixed network and the current network comprising the routing table items; if the current network is a fixed network and the network on-off state of the fixed network is a disconnected state, deleting the routing table entry of the fixed network and configuring the routing table entry for the mobile network; and if the current network is a mobile network and the network on-off state of the fixed network is a connected state, deleting the routing table entry of the mobile network and configuring the routing table entry for the fixed network. The gateway equipment and the mobile network are kept in a communication state, and data are routed to the network configured with the routing table items in a mode of configuring the routing table items of the network, so that the switching time of the fixed network and the mobile network is reduced.
Example 2
Referring to fig. 2, fig. 2 is a schematic structural diagram of a network switching apparatus according to embodiment 2 of the present invention, which is applied to a gateway device, and the network switching apparatus 200 in fig. 2 includes:
a connection module 210, configured to establish a connection with a first wide area network corresponding to a fixed network and establish a connection with a second wide area network corresponding to a mobile network;
the determining module 220 is configured to determine a network on-off state of the fixed network and a current network including a routing table entry;
a mobile routing configuration module 230, configured to delete a routing table entry of the fixed network and configure a routing table entry for the mobile network if the current network is the fixed network and the network on-off state of the fixed network is the off state;
and a fixed routing configuration module 240, configured to delete a routing table entry of the mobile network and configure a routing table entry for the fixed network if the current network is the mobile network and the network on-off state of the fixed network is the connected state.
As an example, the mobile routing configuration module 230 is further configured to, if the current network is a fixed network and the network on-off state of the fixed network is an off state, increment a count of the first counter by one, and repeatedly perform the steps of determining the network on-off state of the fixed network and the current network including the routing table entry, delete the routing table entry of the fixed network and configure the routing table entry for the mobile network until the count of the first counter reaches a first count threshold.
As an example, the fixed routing configuration module 240 is further configured to, if the current network is a mobile network and the network on-off state of the fixed network is a connected state, increment a count of the second counter by one, and repeatedly perform the steps of determining the network on-off state of the fixed network and the current network including the routing table entry, until the count of the second counter reaches a second count threshold, delete the routing table entry of the mobile network, and configure the routing table entry for the fixed network.
As an example, the network switching apparatus 200 further includes:
the first message sending module is used for sending a first message to a message receiving party and receiving a first response message sent by the message receiving party when the network on-off state of the fixed network is a disconnected state;
the restarting module is used for deleting the gateway address of the fixed network and restarting the DHCP process if the first response message does not comprise the MAC address corresponding to the gateway address of the fixed network;
and the first execution module is used for executing the steps of determining the network on-off state of the fixed network and the current network comprising the routing table items if the first response message comprises the MAC address corresponding to the gateway address of the fixed network.
As an example, the determining module 220 is further configured to send a second message to a message receiver, and receive a second response message sent by the message receiver;
if the second response message comprises the gateway address of the fixed network, determining that the network on-off state of the fixed network is a connected state;
and if the second response message does not comprise the gateway address of the fixed network, determining that the network on-off state of the fixed network is a disconnected state.
As an example, the network switching apparatus 200 further includes:
and the second execution module is used for executing the steps of determining the network on-off state of the fixed network and the current network comprising the routing list items based on a preset time interval if the current network is the fixed network and the network on-off state of the fixed network is a connected state.
As an example, the network switching apparatus 200 further includes:
the link state acquisition module is used for acquiring the link on-off state of the fixed network;
the fixed network configuration module is used for starting a DHCP process and configuring a routing table item for the fixed network if the link on-off state of the fixed network is a connected state;
and the mobile network configuration module is used for configuring a routing table item for the mobile network if the link on-off state of the fixed network is a disconnection state.
The network switching apparatus 200 is configured to execute corresponding steps in the network switching method, and specific implementations of each function are not described one by one here. Note that the alternative example in embodiment 1 is also applied to the network switching apparatus 200 in embodiment 2.
The embodiment of the present application further provides a gateway device, which includes a processor and a memory, where the memory stores a program or an instruction, and the program or the instruction is executed by the processor, so that the gateway device executes the steps of the network switching method.
An embodiment of the present application further provides a computer-readable storage medium, where a program or an instruction is stored on the computer-readable storage medium, and when the program or the instruction is executed by a processor, the method implements the steps of the network handover method.
In the embodiments provided in the present application, it should be understood that the disclosed apparatus and method can be implemented in other ways. The apparatus embodiments described above are merely illustrative and, for example, the flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of apparatus, methods and computer program products according to various embodiments of the present invention. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
In addition, each functional module or unit in each embodiment of the present invention may be integrated together to form an independent part, or each module may exist separately, or two or more modules may be integrated to form an independent part.
The functions, if implemented in the form of software functional modules and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present invention or a part of the technical solution that contributes to the prior art in essence can be embodied in the form of a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a smart phone, a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
The above description is only for the specific embodiments of the present invention, but the scope of the present invention is not limited thereto, and any person skilled in the art can easily conceive of the changes or substitutions within the technical scope of the present invention, and all the changes or substitutions should be covered within the scope of the present invention.

Claims (10)

1.一种网络切换方法,其特征在于,应用于网关设备,所述方法包括:1. A network switching method, characterized in that, applied to a gateway device, the method comprising: 与固网对应的第一广域网建立连接,并与移动网络对应的第二广域网建立连接;establishing a connection with the first wide area network corresponding to the fixed network, and establishing a connection with the second wide area network corresponding to the mobile network; 确定固网的网络通断状态,以及包括路由表项的当前网络;Determine the network on/off status of the fixed network, and the current network including routing table entries; 若所述当前网络为固网,且所述固网的网络通断状态为断开状态,删除所述固网的路由表项,并为所述移动网络配置路由表项;If the current network is a fixed network, and the network on-off state of the fixed network is a disconnected state, delete the routing table entry of the fixed network, and configure a routing table entry for the mobile network; 若所述当前网络为移动网络,且所述固网的网络通断状态为连通状态,删除所述移动网络的路由表项,并为所述固网配置路由表项。If the current network is a mobile network, and the network on-off state of the fixed network is a connected state, delete the routing table entry of the mobile network, and configure a routing table entry for the fixed network. 2.根据权利要求1所述的网络切换方法,其特征在于,所述网关设备包括第一计数器,所述若所述当前网络为固网,且所述固网的网络通断状态为断开状态,删除所述固网的路由表项,并为所述移动网络配置路由表项,包括:2 . The network switching method according to claim 1 , wherein the gateway device comprises a first counter, and if the current network is a fixed network and the network on-off state of the fixed network is disconnected, 2 . state, delete the routing table entry of the fixed network, and configure the routing table entry for the mobile network, including: 若所述当前网络为固网,且所述固网的网络通断状态为断开状态,所述第一计数器的计数加一,并重复执行确定所述固网的网络通断状态,以及包括路由表项的当前网络的步骤,If the current network is a fixed network and the network on-off state of the fixed network is a disconnected state, the count of the first counter is incremented by one, and the determination of the network on-off state of the fixed network is performed repeatedly, and including the current network step of the routing table entry, 直至所述第一计数器的计数达到第一计数阈值时,删除所述固网的路由表项,并为所述移动网络配置路由表项。Until the count of the first counter reaches a first count threshold, the routing table entry of the fixed network is deleted, and the routing table entry is configured for the mobile network. 3.根据权利要求1所述的网络切换方法,其特征在于,所述网关设备包括第二计数器,所述若所述当前网络为移动网络,且所述固网的网络通断状态为连通状态,删除所述移动网络的路由表项,并为所述固网配置路由表项,包括:3 . The network switching method according to claim 1 , wherein the gateway device comprises a second counter, and if the current network is a mobile network and the network on-off state of the fixed network is a connected state. 4 . , delete the routing table entry of the mobile network, and configure the routing table entry for the fixed network, including: 若所述当前网络为移动网络,且所述固网的网络通断状态为连通状态,所述第二计数器的计数加一,并重复执行确定所述固网的网络通断状态,以及包括路由表项的当前网络的步骤,If the current network is a mobile network, and the network on-off state of the fixed network is a connected state, the count of the second counter is incremented by one, and the determination of the network on-off state of the fixed network is repeated, and the routing information is included. the current network step of the entry, 直至所述第二计数器的计数达到第二计数阈值时,删除所述移动网络的路由表项,并为所述固网配置路由表项。Until the count of the second counter reaches a second count threshold, delete the routing table entry of the mobile network, and configure the routing table entry for the fixed network. 4.根据权利要求1所述的网络切换方法,其特征在于,所述确定所述固网的网络通断状态,以及包括路由表项的当前网络之后,还包括:4. The network switching method according to claim 1, wherein after determining the network on-off state of the fixed network and the current network including the routing table entry, the method further comprises: 当所述固网的网络通断状态为断开状态时,发送第一报文至报文接收方,并接收所述报文接收方发送的第一回应报文;When the network on-off state of the fixed network is the off state, sending a first message to the message receiver, and receiving the first response message sent by the message receiver; 若第一回应报文不包括与所述固网的网关地址对应的MAC地址,删除所述固网的网关地址,并重启DHCP进程;If the first response message does not include the MAC address corresponding to the gateway address of the fixed network, delete the gateway address of the fixed network, and restart the DHCP process; 若第一回应报文包括与所述固网的网关地址对应的MAC地址,执行确定所述固网的网络通断状态,以及包括路由表项的当前网络的步骤。If the first response message includes the MAC address corresponding to the gateway address of the fixed network, the steps of determining the network on-off state of the fixed network and the current network including the routing table entry are performed. 5.根据权利要求1所述的网络切换方法,其特征在于,所述确定所述固网的网络通断状态,包括:5. The network switching method according to claim 1, wherein the determining the network on-off state of the fixed network comprises: 发送第二报文至报文接收方,并接收所述报文接收方发送的第二回应报文;sending a second message to the message receiver, and receiving the second response message sent by the message receiver; 若所述第二回应报文包括所述固网的网关地址,则确定所述固网的网络通断状态为连通状态;If the second response message includes the gateway address of the fixed network, determining that the network on-off state of the fixed network is a connected state; 若所述第二回应报文不包括所述固网的网关地址,则确定所述固网的网络通断状态为断开状态。If the second response message does not include the gateway address of the fixed network, it is determined that the network on-off state of the fixed network is a disconnected state. 6.根据权利要求1所述的网络切换方法,其特征在于,所述确定所述固网的网络通断状态,以及包括路由表项的当前网络之后,还包括:6. The network switching method according to claim 1, wherein after determining the network on-off state of the fixed network and the current network including the routing table entry, the method further comprises: 若所述当前网络为固网,且所述固网的网络通断状态为连通状态,基于预设的时长间隔,执行确定所述固网的网络通断状态,以及包括路由表项的当前网络的步骤。If the current network is a fixed network, and the network on-off state of the fixed network is a connected state, based on a preset time interval, determine the network on-off state of the fixed network and the current network including the routing table entry. A step of. 7.根据权利要求1所述的网络切换方法,其特征在于,所述与固网对应的第一广域网建立连接,与移动网络对应的第二广域网建立连接之后,所述确定固网的网络通断状态,以及包括路由表项的当前网络之前,还包括:7 . The network switching method according to claim 1 , wherein, after the connection is established with the first wide area network corresponding to the fixed network, and the connection is established with the second wide area network corresponding to the mobile network, the network connectivity of the fixed network is determined. 8 . down state, and before the current network including routing table entries, including: 获取所述固网的链路通断状态;Obtain the link status of the fixed network; 若所述固网的链路通断状态为连通状态,启用DHCP进程,并为所述固网配置路由表项;If the link on/off state of the fixed network is a connected state, enable the DHCP process, and configure a routing table entry for the fixed network; 若所述固网的链路通断状态为断开状态,为所述移动网络配置路由表项。If the link on/off state of the fixed network is a disconnected state, configure a routing table entry for the mobile network. 8.一种网络切换装置,其特征在于,应用于网关设备,所述装置包括:8. A network switching device, characterized in that, applied to a gateway device, the device comprising: 连接模块,用于与固网对应的第一广域网建立连接,并与移动网络对应的第二广域网建立连接;a connection module, configured to establish a connection with the first wide area network corresponding to the fixed network, and establish a connection with the second wide area network corresponding to the mobile network; 确定模块,用于确定固网的网络通断状态,以及包括路由表项的当前网络;A determination module, used to determine the network on-off state of the fixed network and the current network including the routing table entry; 移动路由配置模块,用于若所述当前网络为固网,且所述固网的网络通断状态为断开状态,删除所述固网的路由表项,并为所述移动网络配置路由表项;A mobile routing configuration module, configured to delete the routing table entry of the fixed network and configure a routing table for the mobile network if the current network is a fixed network and the network on-off state of the fixed network is a disconnected state item; 固定路由配置模块,用于若所述当前网络为移动网络,且所述固网的网络通断状态为连通状态,删除所述移动网络的路由表项,并为所述固网配置路由表项。A fixed routing configuration module, configured to delete the routing table entry of the mobile network and configure the routing table entry for the fixed network if the current network is a mobile network and the network on-off state of the fixed network is a connected state . 9.一种网关设备,其特征在于,包括处理器及存储器,所述存储器上存储有程序或指令,所述程序或指令被所述处理器执行时实现如权利要求1至7中任一项所述的网络切换方法的步骤。9. A gateway device, characterized in that it comprises a processor and a memory, wherein a program or an instruction is stored on the memory, and when the program or instruction is executed by the processor, any one of claims 1 to 7 is implemented The steps of the network switching method. 10.一种计算机可读存储介质,其特征在于,所述计算机可读存储介质上存储有程序或指令,所述程序或指令被处理器执行时实现如权利要求1至7中任一项所述的网络切换方法的步骤。10. A computer-readable storage medium, characterized in that, a program or an instruction is stored on the computer-readable storage medium, and when the program or instruction is executed by a processor, the implementation as claimed in any one of claims 1 to 7 is realized. The steps of the network switching method described above.
CN202111315485.XA 2021-11-08 2021-11-08 Network switching method, device and gateway device Pending CN114024903A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111315485.XA CN114024903A (en) 2021-11-08 2021-11-08 Network switching method, device and gateway device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111315485.XA CN114024903A (en) 2021-11-08 2021-11-08 Network switching method, device and gateway device

Publications (1)

Publication Number Publication Date
CN114024903A true CN114024903A (en) 2022-02-08

Family

ID=80062487

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111315485.XA Pending CN114024903A (en) 2021-11-08 2021-11-08 Network switching method, device and gateway device

Country Status (1)

Country Link
CN (1) CN114024903A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115277410A (en) * 2022-08-04 2022-11-01 深圳市共进电子股份有限公司 Gateway adjusting method, device, electronic equipment and storage medium

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1719926A (en) * 2004-07-06 2006-01-11 华为技术有限公司 Wireless link detecting method
US20080130572A1 (en) * 2005-01-31 2008-06-05 Junbiao Zhang Local Mobility Solution With Wired and Wireless Interface Switching
CN101764722A (en) * 2009-12-21 2010-06-30 中兴通讯股份有限公司 Method for detecting link and device and system thereof
CN105871667A (en) * 2016-03-24 2016-08-17 上海泓亚通信技术有限公司 Network switching method of gateway device
CN106470170A (en) * 2015-08-21 2017-03-01 中兴通讯股份有限公司 Method for switching network and device
CN109889409A (en) * 2019-03-15 2019-06-14 深圳市领佳物联科技有限公司 Cable network and wireless network double copies chain-circuit system and implementation method
CN112702202A (en) * 2020-12-23 2021-04-23 南方电网数字电网研究院有限公司 Ammeter communication link fault recovery method and device and computer equipment

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1719926A (en) * 2004-07-06 2006-01-11 华为技术有限公司 Wireless link detecting method
US20080130572A1 (en) * 2005-01-31 2008-06-05 Junbiao Zhang Local Mobility Solution With Wired and Wireless Interface Switching
CN101764722A (en) * 2009-12-21 2010-06-30 中兴通讯股份有限公司 Method for detecting link and device and system thereof
CN106470170A (en) * 2015-08-21 2017-03-01 中兴通讯股份有限公司 Method for switching network and device
CN105871667A (en) * 2016-03-24 2016-08-17 上海泓亚通信技术有限公司 Network switching method of gateway device
CN109889409A (en) * 2019-03-15 2019-06-14 深圳市领佳物联科技有限公司 Cable network and wireless network double copies chain-circuit system and implementation method
CN112702202A (en) * 2020-12-23 2021-04-23 南方电网数字电网研究院有限公司 Ammeter communication link fault recovery method and device and computer equipment

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
LEA LEHMANN: "Implementation of multimedia service mobility in fix/mobile converged networks", IEEE *
陈天力: "固网移动网融合技术UMA的深入研究", 电信快报 *

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115277410A (en) * 2022-08-04 2022-11-01 深圳市共进电子股份有限公司 Gateway adjusting method, device, electronic equipment and storage medium
CN115277410B (en) * 2022-08-04 2024-04-12 深圳市共进电子股份有限公司 Gateway adjustment method, device, electronic equipment and storage medium

Similar Documents

Publication Publication Date Title
US9185071B2 (en) Methods and systems for seamless network communications between devices running internet protocol version 6 and internet protocol version 4
EP2169877A1 (en) Processing method and device for qinq termination configuration
CN110752975A (en) Network sharing method and device
CN107809386B (en) IP address translation method, routing device and communication system
CN105207909B (en) A kind of method and network equipment sending information
CN113098722A (en) Multi-network card management method, device and computer readable storage medium
CN111614505A (en) Packet processing method and gateway device
CN113038594A (en) Network management registration method and device for MESH extended equipment
CN104426816B (en) A kind of virtual machine communication method and device
CN114024903A (en) Network switching method, device and gateway device
CN103051484B (en) Session service processing method, system and Session Border Controll
CN102761425B (en) Charging method and device
CN107786441B (en) Communication method, OpenFlow switch and communication system
WO2017161866A1 (en) Network connection method and device
CN105792385B (en) Communication method and device based on wireless local area network
KR101204339B1 (en) A method and network connectivity device for opening a network link
CN110290230B (en) Method, device and storage medium for detecting dialing mode supported by network environment
EP3200433A1 (en) Ipv6 address management method, device and terminal
CN108667944A (en) A kind of DHCP configuration methods and dhcp client
JP2004135108A (en) Communication control method, communication terminal, router, control program of communication terminal and control program of router
CN114826808B (en) User terminal access network method and device, user terminal and storage medium
US10404652B2 (en) Communication device, communication method, and program
CN113873503A (en) Gateway bridging networking method, device and router
US20250024346A1 (en) Systems and methods for receiving user equipment route selection policy rules
CN111526224B (en) Emergency network communication method, gateway and computer readable 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
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20220208