CN116506349A - Network link dual-backup method, device, equipment and storage medium - Google Patents

Network link dual-backup method, device, equipment and storage medium Download PDF

Info

Publication number
CN116506349A
CN116506349A CN202310474805.9A CN202310474805A CN116506349A CN 116506349 A CN116506349 A CN 116506349A CN 202310474805 A CN202310474805 A CN 202310474805A CN 116506349 A CN116506349 A CN 116506349A
Authority
CN
China
Prior art keywords
link
interface
main
network
backup
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
CN202310474805.9A
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.)
Hunan Leading Wisdom Telecommunication and Technology Co Ltd
Original Assignee
Hunan Leading Wisdom Telecommunication and Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Hunan Leading Wisdom Telecommunication and Technology Co Ltd filed Critical Hunan Leading Wisdom Telecommunication and Technology Co Ltd
Priority to CN202310474805.9A priority Critical patent/CN116506349A/en
Publication of CN116506349A publication Critical patent/CN116506349A/en
Pending legal-status Critical Current

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/22Alternate routing
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/24Multipath
    • H04L45/247Multipath using M:N active or standby paths
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/28Routing or path finding of packets in data switching networks using route fault recovery
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D30/00Reducing energy consumption in communication networks
    • Y02D30/50Reducing energy consumption in communication networks in wire-line communication networks, e.g. low power modes or reduced link rate

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Hardware Redundancy (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The application relates to a network link dual-backup method, device, equipment and storage medium. The method comprises the following steps: after the initialization of the network interface is completed, the main and standby links of the software are configured according to the state information of the network links in the network equipment. And storing interface information of the main link and the standby link into a link switching state machine, triggering a switching logic module after the link switching state machine receives an interrupt event, and backing up the current network link according to the interrupt event by the switching logic module. Restarting the software system according to the backed up current network link. The method can realize the automatic processing of network link faults and abnormal conditions, thereby improving the reliability and connectivity of the network.

Description

Network link dual-backup method, device, equipment and storage medium
Technical Field
The present invention relates to the field of embedded software link backup technologies, and in particular, to a network link dual backup method, device, equipment, and storage medium.
Background
With the wide application of embedded products in the fields of industry, military, communication and the like, the network communication requirement on embedded equipment is higher and higher, and in order to ensure the stability and reliability of data transmission, two Ethernet interfaces are generally required to be configured for mutual backup so as to ensure that one link can be automatically switched to a backup link under the fault or abnormal condition, and the connectivity and the reliability of the network are ensured.
The current network active-standby switching scheme has some technical problems, such as defining active-standby link interface devices when a software system is initialized, filtering PCI bus devices to initialize devices participating in active-standby binding, and not realizing automatic link switching logic, and manual intervention, which seriously affect the efficiency and reliability of network active-standby link switching.
Disclosure of Invention
In view of the foregoing, it is desirable to provide a network link dual backup method, apparatus, device, and storage medium that can improve efficiency and flexibility of network link configuration.
A network link dual backup method, the method comprising:
after the initialization of the network interface is completed, the main and standby links of the software are configured according to the state information of the network links in the network equipment.
And storing interface information of the main link and the standby link into a link switching state machine, triggering a switching logic module after the link switching state machine receives an interrupt event, and backing up the current network link according to the interrupt event by the switching logic module.
Restarting the software system according to the backed up current network link.
In one embodiment, the method further comprises: after the initialization of the network interface is completed, the state information of the first link and the state information of the second link are obtained according to the interface link bound by the network equipment, wherein the state information comprises an online state and an offline state. If the state information of the first link is consistent with the state information of the second link, configuring the interface of the first link as a main interface and the interface of the second link as a backup interface. Otherwise, the configuration state information is that the link interface corresponding to the online state is a main interface, and the link interface corresponding to the offline state is a backup interface. And configuring a main and standby link of the software according to the main interface and the standby interface.
In one embodiment, the method further comprises: if the state information of the first link and the state information of the second link are both in an offline state, configuring an interface of the first link as a main interface, distributing an IP address for the main interface, and configuring an interface of the second link as a backup interface, wherein the backup interface uses the MAC address of the main interface, and turning off the receiving and transmitting function. If the state information of the first link and the state information of the second link are both in an on-line state, configuring an interface of the first link as a main interface, distributing an IP address for the main interface, configuring an interface of the second link as a backup interface, and switching off a receiving and transmitting function by using an MAC address of the main interface. The main interface sends the data packet to the exchange of the opposite terminal to establish the MAC forwarding table item.
In one embodiment, the method further comprises: and the link switching state machine receives the interrupt event, and if the interrupt event is an access event, the switching logic module is triggered to backup the current network link according to the main interface in the access event. And if the interrupt event is a disconnection event, triggering the switching logic module to backup the current network link according to the backup interface in the disconnection event.
In one embodiment, the method further comprises: the link switching state machine receives the interrupt event, if the interrupt event is an access event, the switching logic module is triggered, and if the access interface is a main interface, the switching logic module sends a data packet to the opposite-end switch to backup the main and standby links. Otherwise, selecting the opposite interface of the link where the access interface is located as the main interface, if the state information of the opposite interface is in an off-line state, configuring the IP address of the access interface according to the interface information of the main link and the standby link stored by the link switching state machine, closing the receiving and transmitting functions of the opposite interface, and backing up the current network link. Otherwise, the main and standby links are backed up.
In one embodiment, the method further comprises: when the network equipment accesses the interface, triggering an access event of the network link, and sending the access event to the link switching state machine through the network equipment. When the network device disconnects the interface, a disconnection event of the network link is triggered, and the disconnection event is sent to the link switching state machine through the network device.
In one embodiment, the interface information of the active-standby link includes: the interface IP address of the first link, the data packet of the first link, the interface IP address of the second link and the data packet of the second link.
A network link dual backup apparatus, the apparatus comprising:
and the configuration module is used for configuring the main and standby links of the software according to the state information of the network link in the network equipment after the initialization of the Ethernet interface is completed.
The link backup module is used for storing the interface information of the main link and the standby link into the link switching state machine, the link switching state machine triggers the switching logic module after receiving the interrupt event, and the switching logic module backs up the current network link according to the interrupt event.
And the system updating module is used for restarting the software system according to the backed-up current network link.
A computer device comprising a memory storing a computer program and a processor which when executing the computer program performs the steps of:
after the initialization of the network interface is completed, the main and standby links of the software are configured according to the state information of the network links in the network equipment.
And storing interface information of the main link and the standby link into a link switching state machine, triggering a switching logic module after the link switching state machine receives an interrupt event, and backing up the current network link according to the interrupt event by the switching logic module.
Restarting the software system according to the backed up current network link.
A computer readable storage medium having stored thereon a computer program which when executed by a processor performs the steps of:
after the initialization of the network interface is completed, the main and standby links of the software are configured according to the state information of the network links in the network equipment.
And storing interface information of the main link and the standby link into a link switching state machine, triggering a switching logic module after the link switching state machine receives an interrupt event, and backing up the current network link according to the interrupt event by the switching logic module.
Restarting the software system according to the backed up current network link.
According to the network link dual-backup method, device, equipment and storage medium, the physical connection between the network equipment and the network can be realized through the network interface initialization, and the network equipment can be ensured to normally communicate with the outside. The method comprises the steps of configuring a main link and a standby link of software according to state information of a network link in network equipment, enabling the main link and the standby link to be tightly combined with change of the state information of the network link, storing interface information of the main link and the standby link through a link switching state machine, further dynamically linking the network interface state with the link state, triggering a switching logic module after the link switching state machine receives an interrupt event, utilizing the switching logic module to be responsible for processing logic of link switching, backing up the current network link, maintaining the main link and the standby link and the like. When the network link backup is completed, the software system needs to be restarted to ensure that all network configuration information and states are updated correctly, thereby forming a link backup mechanism, and realizing automatic processing of network link faults and abnormal conditions, thereby improving the reliability and connectivity of the network.
Drawings
FIG. 1 is a flow chart of a network link dual backup method according to an embodiment;
FIG. 2 is a flow chart illustrating steps of a network link dual backup method according to an embodiment;
FIG. 3 is a flow chart of switching logic after a link up interrupt event is generated by any one of the interfaces in the network link in one embodiment;
FIG. 4 is a flow chart of switching logic after a link down interrupt event is generated by any one of the interfaces in the network link in one embodiment;
FIG. 5 is a block diagram of a network link dual backup device in one embodiment;
fig. 6 is an internal structural diagram of a computer device in one embodiment.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application will be further described in detail with reference to the accompanying drawings and examples. It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the present application.
The network link dual-backup method is applied to the field of embedded equipment, and is particularly suitable for embedded products in the fields of industry, communication and the like, such as intelligent traffic equipment, intelligent manufacturing equipment, communication equipment and the like which need to carry out data transmission. In addition, for some application scenes with high requirements on network communication quality, such as online games, video live broadcasting and the like, the technical scheme can also be adopted to improve the stability and reliability of network transmission.
In one embodiment, as shown in fig. 1, a network link dual backup method is provided, which specifically includes the following steps:
step 102, after the initialization of the network interface is completed, the active and standby links of the software are configured according to the state information of the network link in the network device.
After all Ethernet interfaces in the system start to work, initializing through a network interface, designating any two interfaces in the Ethernet to participate in the binding of the active and standby links, and acquiring the state information of the first link and the state information of the second link according to the interface links bound by the network equipment, wherein the state information comprises an online state and an offline state.
Specifically, if the state information of the first link is consistent with the state information of the second link and is in an offline state, the interface of the first link is configured as a main interface, an IP address is allocated to the main interface, and the interface of the second link is configured as a backup interface, the backup interface may not be configured with the IP address or configure a garbage IP address such as 222.222.222.222, and the backup interface uses the MAC address of the main interface and turns off the transceiver function of the backup interface.
If the state information of the first link is consistent with the state information of the second link and is in an on-line state, configuring an interface of the first link as a main interface, distributing an IP address for the main interface, and configuring an interface of the second link as a backup interface, wherein the backup interface can be configured with no IP address or a garbage IP address such as 222.222.222.222, and the backup interface uses the MAC address of the main interface and turns off the receiving and transmitting functions of the backup interface. The main interface sends 1 to 3 data packets to the two-layer switch of the opposite terminal to establish the MAC forwarding table entry, and if the two-layer switch is not connected, the sending packet does not have any side effect. Otherwise, the configuration state information is that the link interface corresponding to the online state is a main interface, the link interface corresponding to the offline state is a backup interface, an IP address is allocated to the main interface, the backup interface may not configure the IP address or configure a garbage IP address such as 222.222.222.222, the backup interface uses the MAC address of the main interface, and turns off the transceiver function of the backup interface, and in addition, the main interface sends 1 to 3 data packets to the two-layer switch of the opposite end to establish the MAC forwarding table entry. And configuring a main and standby link of the software according to the main interface and the standby interface.
Further, the information of the configured main interface and the backup interface is fed back to the link backup system, so that the link backup system enters a working state, and any one of the two interfaces is waited for generating link state switching.
And 104, storing interface information of the main link and the standby link into a link switching state machine, triggering a switching logic module after the link switching state machine receives the interrupt event, and backing up the current network link according to the interrupt event by the switching logic module.
Specifically, when the network device accesses the interface, an access event of the network link is triggered, the access event is sent to the link switching state machine through the network device, the link switching state machine receives the access event, and the switching logic module is triggered to backup the current network link according to the main interface in the access event. And judging whether the access interface is a main interface or not, if the access interface is the main interface, according to the interface information of the main link and the standby link stored by the switching state machine, the IP address of the access interface is already configured, and at the moment, the switching logic module executing code sends 1 to 3 data packets to the opposite-end switch, so that the main link and the standby link of the software in the original network link are kept unchanged. Otherwise, selecting the opposite interface of the link where the access interface is located as the main interface, if the state information of the opposite interface is in an off-line state, the access interface is the main interface, configuring the IP address of the access interface according to the interface information of the main link and the standby link stored by the link switching state machine, opening the transceiving function, transmitting 1 to 3 data packets by the access interface at the same time, enabling the two-layer switch of the opposite end to establish the MAC forwarding table entry, in addition, closing the opposite interface to be the backup interface, not configuring the IP address or configuring a garbage IP address such as 222.222.222.222, and switching off the transceiving function of the backup interface and backing up the current network link. Otherwise, keeping the main and standby links of the software in the original network link unchanged.
Further, when the network device interface is disconnected, a disconnection event of the network link is triggered, the disconnection event is sent to the link switching state machine through the network device, the link switching state machine receives the disconnection event, and the switching logic module is triggered to backup the current network link according to the main interface in the disconnection event. And judging whether the disconnected interface is a backup interface or not, if the disconnected interface is the backup interface, keeping the main and backup links of the software in the original network link unchanged, maintaining the working state of the link backup system, and waiting for any one of the two interfaces to generate link state switching. On the contrary, the opposite-layer switch of the link where the disconnection interface is located is a backup interface, and further judges whether the state information of the opposite-layer interface is online, if yes, the switching logic module switches the main interface and the backup interface of the current network link, the opposite-layer interface is the main interface, an IP address is configured for the opposite-layer interface, the transceiving function of the opposite-layer interface is opened, 1 to 3 data packets are sent by the opposite-layer interface, the two-layer switch of the disconnection interface establishes an MAC forwarding table entry, meanwhile, the disconnection interface is the backup interface, the IP address is not configured or a garbage IP address such as 222.222.222.222 is configured, the transceiving function of the disconnection interface is turned off, and further the current network link of the backup is fed back to the link backup system, so that the link backup system enters the working state, and any one of the two interfaces is waited for generating the link state switching.
If not, keeping the main and standby links of the software in the original network link unchanged, maintaining the working state of the link backup system, and waiting for any one of the two interfaces to generate link state switching.
And 106, restarting the software system according to the backed-up current network link.
When the network links of all software in the system are switched, the software system needs to be restarted, so that the embedded product can be matched with the current network environment.
In the network link dual-backup method, the physical connection between the network equipment and the network can be realized through the initialization of the network interface, so that the network equipment can be ensured to normally communicate with the outside. The method comprises the steps of configuring a main link and a standby link of software according to state information of a network link in network equipment, enabling the main link and the standby link to be tightly combined with change of the state information of the network link, storing interface information of the main link and the standby link through a link switching state machine, further dynamically linking the network interface state with the link state, triggering a switching logic module after the link switching state machine receives an interrupt event, utilizing the switching logic module to be responsible for processing logic of link switching, backing up the current network link, maintaining the main link and the standby link and the like. When the network link backup is completed, the software system needs to be restarted to ensure that all network configuration information and states are updated correctly, thereby forming a link backup mechanism, and realizing automatic processing of network link faults and abnormal conditions, thereby improving the network.
In one embodiment, after the network interface is initialized, the state information of the first link and the state information of the second link are obtained according to the interface link bound by the network device, where the state information includes an online state and an offline state. If the state information of the first link is consistent with the state information of the second link, configuring the interface of the first link as a main interface and the interface of the second link as a backup interface. Otherwise, the configuration state information is that the link interface corresponding to the online state is a main interface, and the link interface corresponding to the offline state is a backup interface. And configuring a main and standby link of the software according to the main interface and the standby interface.
It is worth to say that, after the system initialization is completed, the interface links bound according to the network equipment can automatically acquire link state information and automatically configure the main and standby links, so that the process of system configuration is simplified, and the system can be automatically switched to the second link under the condition that the first link has a problem, so that the stability and usability of the system can be greatly improved, and the faults and downtime of the system caused by the network problem are reduced.
In one embodiment, if the state information of the first link and the state information of the second link are both offline, the interface of the first link is configured as a primary interface, an IP address is allocated to the primary interface, the interface of the second link is configured as a backup interface, and the backup interface uses the MAC address of the primary interface and turns off the transceiver function. If the state information of the first link and the state information of the second link are both in an on-line state, configuring an interface of the first link as a main interface, distributing an IP address for the main interface, configuring an interface of the second link as a backup interface, and switching off a receiving and transmitting function by using an MAC address of the main interface. The main interface sends the data packet to the exchange of the opposite terminal to establish the MAC forwarding table item.
It is worth to say that, under the condition that both links are in an offline state, an IP address can still be allocated to the main interface, so that the risk of system breakdown caused by the fact that the network interface cannot work normally is avoided; under the condition that both links are in an on-line state, by using the MAC address of the main interface for the backup interface and closing the receiving and transmitting functions, the backup interface can be ensured to be rapidly switched to the main interface and continue to transmit data when the main interface fails. In addition, the MAC forwarding table item is established by the exchanger which transmits the data packet to the opposite terminal through the main interface, so that the data packet can be ensured to be rapidly and accurately transmitted to the target address, and the data transmission efficiency is improved.
In one embodiment, the link switching state machine receives an interruption event, and if the interruption event is an access event, triggers the switching logic module to backup the current network link according to the main interface in the access event. And if the interrupt event is a disconnection event, triggering the switching logic module to backup the current network link according to the backup interface in the disconnection event.
In one embodiment, as shown in fig. 3, the link switching state machine receives an interrupt event, if the interrupt event is an access event, triggers the switching logic module, and if the access interface is a primary interface, the switching logic module sends a data packet to the opposite-end switch to backup the primary and backup links. Otherwise, selecting the opposite interface of the link where the access interface is located as the main interface, if the state information of the opposite interface is in an off-line state, configuring the IP address of the access interface according to the interface information of the main link and the standby link stored by the link switching state machine, closing the receiving and transmitting functions of the opposite interface, and backing up the current network link. Otherwise, the main and standby links are backed up.
Therefore, when an access or disconnection event occurs, the system can immediately trigger the switching logic module and backup the current network link according to the event type, so that the data transmission is ensured not to be interrupted, and the reliability and the stability of the system are improved. Meanwhile, according to the judgment of the opposite port interface state information, a proper interface can be automatically selected as a main interface, so that the trouble and the possibility of errors caused by manual configuration are avoided, and the automation and the quick response of link switching are realized. In addition, the receiving and transmitting function of the opposite port is closed, so that network attack can be effectively prevented, and the safety of the system is improved.
In one embodiment, when the network device accesses the interface, an access event of the network link is triggered, and the access event is sent to the link switching state machine through the network device. When the network device disconnects the interface, a disconnection event of the network link is triggered, and the disconnection event is sent to the link switching state machine through the network device.
In one embodiment, the interface information of the active-standby link includes: the interface IP address of the first link, the data packet of the first link, the interface IP address of the second link and the data packet of the second link.
In one embodiment, as shown in fig. 4, when the network device interface is disconnected, a disconnection event of the network link is triggered, the disconnection event is sent to the link switching state machine through the network device, the link switching state machine receives the disconnection event, and the switching logic module is triggered to backup the current network link according to the main interface in the disconnection event. And judging whether the disconnected interface is a backup interface or not, if the disconnected interface is the backup interface, keeping the main and backup links of the software in the original network link unchanged, maintaining the working state of the link backup system, and waiting for any one of the two interfaces to generate link state switching. On the contrary, the opposite-layer switch of the link where the disconnection interface is located is a backup interface, and further judges whether the state information of the opposite-layer interface is online, if yes, the switching logic module switches the main interface and the backup interface of the current network link, the opposite-layer interface is the main interface, an IP address is configured for the opposite-layer interface, the transceiving function of the opposite-layer interface is opened, 1 to 3 data packets are sent by the opposite-layer interface, the two-layer switch of the disconnection interface establishes an MAC forwarding table entry, meanwhile, the disconnection interface is the backup interface, the IP address is not configured or a garbage IP address such as 222.222.222.222 is configured, the transceiving function of the disconnection interface is turned off, and further the current network link of the backup is fed back to the link backup system, so that the link backup system enters the working state, and any one of the two interfaces is waited for generating the link state switching.
If not, keeping the main and standby links of the software in the original network link unchanged, maintaining the working state of the link backup system, and waiting for any one of the two interfaces to generate link state switching.
It should be understood that, although the steps in the flowcharts of fig. 1-4 are shown in order as indicated by the arrows, these steps are not necessarily performed in order as indicated by the arrows. The steps are not strictly limited to the order of execution unless explicitly recited herein, and the steps may be executed in other orders. Moreover, at least some of the steps in fig. 1-4 may include multiple sub-steps or stages that are not necessarily performed at the same time, but may be performed at different times, nor do the order in which the sub-steps or stages are performed necessarily occur sequentially, but may be performed alternately or alternately with at least a portion of the sub-steps or stages of other steps or steps.
In one embodiment, as shown in fig. 5, there is provided a network link dual backup apparatus, including: a configuration module 502, a link backup module 504, and a system update module 506, wherein:
and the configuration module 502 is configured to configure the active and standby links of the software according to the state information of the network link in the network device after the initialization of the ethernet interface is completed.
The link backup module 504 is configured to store interface information of the active and standby links to a link switching state machine, and the link switching state machine triggers a switching logic module after receiving an interrupt event, where the switching logic module backs up the current network link according to the interrupt event.
The system update module 506 is configured to restart the software system according to the backed up current network link.
For a specific limitation of a network link dual backup device, reference may be made to the limitation of a network link dual backup method hereinabove, and the description thereof will not be repeated here. Each module in the above-mentioned network link dual backup device may be implemented in whole or in part by software, hardware, and a combination thereof. The above modules may be embedded in hardware or may be independent of a processor in the computer device, or may be stored in software in a memory in the computer device, so that the processor may call and execute operations corresponding to the above modules.
In one embodiment, a computer device is provided, which may be a terminal, and the internal structure of which may be as shown in fig. 6. The computer device includes a processor, a memory, a network interface, a display screen, and an input device connected by a system bus. Wherein the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage media. The network interface of the computer device is used for communicating with an external terminal through a network connection. The computer program when executed by a processor implements a network link dual backup method. The display screen of the computer equipment can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer equipment can be a touch layer covered on the display screen, can also be keys, a track ball or a touch pad arranged on the shell of the computer equipment, and can also be an external keyboard, a touch pad or a mouse and the like.
It will be appreciated by those skilled in the art that the structures shown in fig. 5-6 are block diagrams of only some of the structures associated with the present application and are not intended to limit the computer device to which the present application may be applied, and that a particular computer device may include more or fewer components than shown, or may combine certain components, or have a different arrangement of components.
In one embodiment, a computer device is provided comprising a memory storing a computer program and a processor that when executing the computer program performs the steps of:
after the initialization of the network interface is completed, the main and standby links of the software are configured according to the state information of the network links in the network equipment.
And storing interface information of the main link and the standby link into a link switching state machine, triggering a switching logic module after the link switching state machine receives an interrupt event, and backing up the current network link according to the interrupt event by the switching logic module.
Restarting the software system according to the backed up current network link. In one embodiment, the processor when executing the computer program further performs the steps of: after the initialization of the network interface is completed, the state information of the first link and the state information of the second link are obtained according to the interface link bound by the network equipment, wherein the state information comprises an online state and an offline state. If the state information of the first link is consistent with the state information of the second link, configuring the interface of the first link as a main interface and the interface of the second link as a backup interface. Otherwise, the configuration state information is that the link interface corresponding to the online state is a main interface, and the link interface corresponding to the offline state is a backup interface. And configuring a main and standby link of the software according to the main interface and the standby interface.
In one embodiment, the processor when executing the computer program further performs the steps of: if the state information of the first link and the state information of the second link are both in an offline state, configuring an interface of the first link as a main interface, distributing an IP address for the main interface, and configuring an interface of the second link as a backup interface, wherein the backup interface uses the MAC address of the main interface, and turning off the receiving and transmitting function. If the state information of the first link and the state information of the second link are both in an on-line state, configuring an interface of the first link as a main interface, distributing an IP address for the main interface, configuring an interface of the second link as a backup interface, and switching off a receiving and transmitting function by using an MAC address of the main interface. The main interface sends the data packet to the exchange of the opposite terminal to establish the MAC forwarding table item.
In one embodiment, the processor when executing the computer program further performs the steps of: and the link switching state machine receives the interrupt event, and if the interrupt event is an access event, the switching logic module is triggered to backup the current network link according to the main interface in the access event. And if the interrupt event is a disconnection event, triggering the switching logic module to backup the current network link according to the backup interface in the disconnection event.
In one embodiment, the processor when executing the computer program further performs the steps of: the link switching state machine receives the interrupt event, if the interrupt event is an access event, the switching logic module is triggered, and if the access interface is a main interface, the switching logic module sends a data packet to the opposite-end switch to backup the main and standby links. Otherwise, selecting the opposite interface of the link where the access interface is located as the main interface, if the state information of the opposite interface is in an off-line state, configuring the IP address of the access interface according to the interface information of the main link and the standby link stored by the link switching state machine, closing the receiving and transmitting functions of the opposite interface, and backing up the current network link. Otherwise, the main and standby links are backed up.
In one embodiment, the processor when executing the computer program further performs the steps of: when the network equipment accesses the interface, triggering an access event of the network link, and sending the access event to the link switching state machine through the network equipment. When the network device disconnects the interface, a disconnection event of the network link is triggered, and the disconnection event is sent to the link switching state machine through the network device.
In one embodiment, a computer readable storage medium is provided having a computer program stored thereon, which when executed by a processor, performs the steps of:
after the initialization of the network interface is completed, the main and standby links of the software are configured according to the state information of the network links in the network equipment.
And storing interface information of the main link and the standby link into a link switching state machine, triggering a switching logic module after the link switching state machine receives an interrupt event, and backing up the current network link according to the interrupt event by the switching logic module.
Restarting the software system according to the backed up current network link.
In one embodiment, the computer program when executed by the processor further performs the steps of: after the initialization of the network interface is completed, the state information of the first link and the state information of the second link are obtained according to the interface link bound by the network equipment, wherein the state information comprises an online state and an offline state. If the state information of the first link is consistent with the state information of the second link, configuring the interface of the first link as a main interface and the interface of the second link as a backup interface. Otherwise, the configuration state information is that the link interface corresponding to the online state is a main interface, and the link interface corresponding to the offline state is a backup interface. And configuring a main and standby link of the software according to the main interface and the standby interface.
In one embodiment, the computer program when executed by the processor further performs the steps of: if the state information of the first link and the state information of the second link are both in an offline state, configuring an interface of the first link as a main interface, distributing an IP address for the main interface, and configuring an interface of the second link as a backup interface, wherein the backup interface uses the MAC address of the main interface, and turning off the receiving and transmitting function. If the state information of the first link and the state information of the second link are both in an on-line state, configuring an interface of the first link as a main interface, distributing an IP address for the main interface, configuring an interface of the second link as a backup interface, and switching off a receiving and transmitting function by using an MAC address of the main interface. The main interface sends the data packet to the exchange of the opposite terminal to establish the MAC forwarding table item.
In one embodiment, the computer program when executed by the processor further performs the steps of: and the link switching state machine receives the interrupt event, and if the interrupt event is an access event, the switching logic module is triggered to backup the current network link according to the main interface in the access event. And if the interrupt event is a disconnection event, triggering the switching logic module to backup the current network link according to the backup interface in the disconnection event.
In one embodiment, the computer program when executed by the processor further performs the steps of: the link switching state machine receives the interrupt event, if the interrupt event is an access event, the switching logic module is triggered, and if the access interface is a main interface, the switching logic module sends a data packet to the opposite-end switch to backup the main and standby links. Otherwise, selecting the opposite interface of the link where the access interface is located as the main interface, if the state information of the opposite interface is in an off-line state, configuring the IP address of the access interface according to the interface information of the main link and the standby link stored by the link switching state machine, closing the receiving and transmitting functions of the opposite interface, and backing up the current network link. Otherwise, the main and standby links are backed up.
In one embodiment, the computer program when executed by the processor further performs the steps of: when the network equipment accesses the interface, triggering an access event of the network link, and sending the access event to the link switching state machine through the network equipment. When the network device disconnects the interface, a disconnection event of the network link is triggered, and the disconnection event is sent to the link switching state machine through the network device.
Those skilled in the art will appreciate that implementing all or part of the above described methods may be accomplished by way of a computer program stored on a non-transitory computer readable storage medium, which when executed, may comprise the steps of the embodiments of the methods described above. Any reference to memory, storage, database, or other medium used in the various embodiments provided herein may include non-volatile and/or volatile memory. The nonvolatile memory can include Read Only Memory (ROM), programmable ROM (PROM), electrically Programmable ROM (EPROM), electrically Erasable Programmable ROM (EEPROM), or flash memory. Volatile memory can include Random Access Memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms such as Static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double Data Rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous Link DRAM (SLDRAM), memory bus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), among others.
The technical features of the above embodiments may be arbitrarily combined, and all possible combinations of the technical features in the above embodiments are not described for brevity of description, however, as long as there is no contradiction between the combinations of the technical features, they should be considered as the scope of the description.
The above examples merely represent a few embodiments of the present application, which are described in more detail and are not to be construed as limiting the scope of the invention. It should be noted that it would be apparent to those skilled in the art that various modifications and improvements could be made without departing from the spirit of the present application, which would be within the scope of the present application. Accordingly, the scope of protection of the present application is to be determined by the claims appended hereto.

Claims (10)

1. A network link dual backup method, the method comprising:
after the initialization of the network interface is completed, configuring a main link and a standby link of software according to the state information of the network link in the network equipment;
storing the interface information of the main link and the standby link into a link switching state machine, triggering a switching logic module after the link switching state machine receives an interrupt event, and backing up the current network link according to the interrupt event by the switching logic module;
restarting the software system according to the backed-up current network link.
2. The method of claim 1, wherein configuring the active and standby links of the software based on the status information of the interface links in the network device after the initialization of the network interface is completed, comprises:
after the initialization of the network interface is completed, acquiring the state information of a first link and the state information of a second link according to an interface link bound by the network equipment, wherein the state information comprises an online state and an offline state;
if the state information of the first link is consistent with the state information of the second link, configuring an interface of the first link as a main interface and an interface of the second link as a backup interface; otherwise, configuring the state information as a link interface corresponding to the online state as a main interface and a link interface corresponding to the offline state as a backup interface; and configuring a main and standby link of software according to the main interface and the standby interface.
3. The method of claim 2, wherein configuring the interface of the first link as a primary interface and the interface of the second link as a backup interface if the state information of the first link and the state information of the second link are consistent comprises:
if the state information of the first link and the state information of the second link are both in an offline state, configuring an interface of the first link as a main interface, distributing an IP address for the main interface, and configuring an interface of the second link as a backup interface, wherein the backup interface uses an MAC address of the main interface, and turning off a receiving and transmitting function;
if the state information of the first link and the state information of the second link are both in an on-line state, configuring an interface of the first link as a main interface, distributing an IP address for the main interface, and configuring an interface of the second link as a backup interface, wherein the backup interface uses an MAC address of the main interface, and turning off a receiving and transmitting function; and the main interface sends the data packet to a switch of the opposite terminal to establish a MAC forwarding table item.
4. The method of claim 3, wherein the link switch state machine triggers a switch logic module upon receipt of an interrupt event, the switch logic module backing up a current network link based on the interrupt event, comprising:
the link switching state machine receives an interruption event, and if the interruption event is an access event, the triggering switching logic module backs up a current network link according to a main interface in the access event; and if the interrupt event is a disconnection event, the triggering switching logic module backs up the current network link according to the backup interface in the disconnection event.
5. The method of claim 4, wherein the link switch state machine receives an outage event, and wherein if the outage event is an access event, the triggering switch logic module backs up a current network link according to a primary interface in the access event, comprising:
the link switching state machine receives an interrupt event, if the interrupt event is an access event, a switching logic module is triggered, and if the access interface is the main interface, the switching logic module sends a data packet to an opposite-end switch to backup the main and standby links; otherwise, selecting an opposite interface of the link where the access interface is located as the main interface, if the state information of the opposite interface is in an offline state, configuring an IP address of the access interface according to the interface information of the main link and the standby link stored by the link switching state machine, closing the receiving and transmitting function of the opposite interface, and backing up the current network link; otherwise, the main and standby links are backed up.
6. The method of claim 5, comprising, prior to the step of triggering a switch logic module after the link switch state machine receives an interrupt event:
triggering an access event of the network link when the network equipment accesses an interface, wherein the access event is sent to the link switching state machine through the network equipment;
when the network equipment disconnects an interface, triggering a disconnection event of the network link, wherein the disconnection event is sent to the link switching state machine through the network equipment.
7. The method according to any one of claims 2 to 6, wherein the interface information of the active-standby link includes: the interface IP address of the first link, the data packet of the first link, the interface IP address of the second link and the data packet of the second link.
8. A network link dual backup apparatus, the apparatus comprising:
the configuration module is used for configuring the main and standby links of the software according to the state information of the network link in the network equipment after the initialization of the Ethernet interface is completed;
the link backup module is used for storing the interface information of the main link and the standby link into a link switching state machine, the link switching state machine triggers a switching logic module after receiving an interrupt event, and the switching logic module backs up the current network link according to the interrupt event;
and the system updating module is used for restarting the software system according to the backed-up current network link.
9. A computer device comprising a memory and a processor, the memory storing a computer program, characterized in that the processor implements the steps of the method of any of claims 1 to 7 when the computer program is executed.
10. A computer readable storage medium, on which a computer program is stored, characterized in that the computer program, when being executed by a processor, implements the steps of the method of any of claims 1 to 7.
CN202310474805.9A 2023-04-27 2023-04-27 Network link dual-backup method, device, equipment and storage medium Pending CN116506349A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310474805.9A CN116506349A (en) 2023-04-27 2023-04-27 Network link dual-backup method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310474805.9A CN116506349A (en) 2023-04-27 2023-04-27 Network link dual-backup method, device, equipment and storage medium

Publications (1)

Publication Number Publication Date
CN116506349A true CN116506349A (en) 2023-07-28

Family

ID=87322558

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310474805.9A Pending CN116506349A (en) 2023-04-27 2023-04-27 Network link dual-backup method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN116506349A (en)

Similar Documents

Publication Publication Date Title
CN101110776B (en) Backup method, backup device and backup system for data business
CN112165429B (en) Link aggregation convergence method and device for distributed switching equipment
CN111740898B (en) Link switching method and device and service provider edge equipment
JP4405941B2 (en) Line redundancy method and relay apparatus used therefor
CN109768884A (en) The implementation method of communication system and its high availability, device and computer equipment
CN117459482B (en) Restarting method and device of switch, storage medium and electronic device
CN113515408A (en) Data disaster tolerance method, device, equipment and medium
WO2022217786A1 (en) Cross-network communicaton method, apparatus, and system for multi-bus network, and storage medium
CN103152209A (en) Application service operation processing system based on multi-machine hot backup
CN111490932B (en) Communication method and device
JP3908596B2 (en) Call server and its port switching method
CN116506349A (en) Network link dual-backup method, device, equipment and storage medium
JP2007304700A (en) System and method for address management in duplex node system
JP2009075710A (en) Redundant system
JP2001344125A (en) Dual node system
CN110391941B (en) Method for receiving and transmitting data by circuit board, circuit board and storage medium
CN106341323A (en) VRRP state synchronizing method and device
CN108270589B (en) Message processing method and related device
JP2009246475A (en) Communication system with redundancy composition, and system switching method of the system
JP2010136038A (en) Transmitter, and method for switching system in redundant configuration
CN110912837A (en) VSM system-based main/standby switching method and device
CN100413261C (en) Method and system of data recovering
CN115333944B (en) Virtual machine cluster IP resource configuration method, system, equipment and storage medium
CN115086579B (en) Video matrix redundancy backup method and device, terminal equipment and storage medium
CN117331863B (en) Power supply information communication method, system, electronic equipment and 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