CN117336162A - Network equipment configuration synchronization method, device, equipment and storage medium - Google Patents

Network equipment configuration synchronization method, device, equipment and storage medium Download PDF

Info

Publication number
CN117336162A
CN117336162A CN202210720600.XA CN202210720600A CN117336162A CN 117336162 A CN117336162 A CN 117336162A CN 202210720600 A CN202210720600 A CN 202210720600A CN 117336162 A CN117336162 A CN 117336162A
Authority
CN
China
Prior art keywords
network
configuration data
network device
configuration
equipment
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
CN202210720600.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.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen 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 Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN202210720600.XA priority Critical patent/CN117336162A/en
Publication of CN117336162A publication Critical patent/CN117336162A/en
Pending legal-status Critical Current

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/08Configuration management of networks or network elements
    • H04L41/0803Configuration setting
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/08Configuration management of networks or network elements
    • H04L41/0803Configuration setting
    • H04L41/0823Configuration setting characterised by the purposes of a change of settings, e.g. optimising configuration for enhancing reliability
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/08Configuration management of networks or network elements
    • H04L41/0803Configuration setting
    • H04L41/0823Configuration setting characterised by the purposes of a change of settings, e.g. optimising configuration for enhancing reliability
    • H04L41/0836Configuration setting characterised by the purposes of a change of settings, e.g. optimising configuration for enhancing reliability to enhance reliability, e.g. reduce downtime

Landscapes

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

Abstract

The embodiment of the disclosure discloses a network equipment configuration synchronization method, a device, equipment and a storage medium, and relates to the technical field of computer networks, wherein the method comprises the following steps: connecting a first network device with a second network device, and configuring the first network device as a main device; transmitting network configuration data to first network equipment, and recording the first network configuration data and a first configuration quantity identifier thereof; the first network configuration data is sent to the second network equipment, and the second network configuration data and the second configuration quantity identification thereof are recorded; and determining that the first network equipment is abnormal, wherein the second configuration quantity identifier is not equal to the first configuration quantity identifier, sending target network configuration data in the first network configuration data to the second network equipment, and setting the second network equipment as the main equipment. The network equipment configuration synchronization method has higher reliability and can ensure the execution of related services. The present disclosure may be used to configure network routing or scheduling.

Description

Network equipment configuration synchronization method, device, equipment and storage medium
Technical Field
The disclosure relates to the technical field of computer networks, and in particular relates to a network device configuration synchronization method, a device, equipment and a storage medium.
Background
A computer network is a system that can connect various decentralized network devices with independent functions, and implement resource sharing and information transfer with well-functioning software. With the development of computer network technology, more complex functions can be implemented by each network device through more complex configuration of each network device.
However, the network device may be abnormal during operation. Moreover, after the network device generates an abnormality, one network device may not be reconfigured in a short time to replace the abnormal network device, and the reliability of the network device to execute the related service is low. For this situation, there is a need for a method that can configure a network device in advance in a computer network as a slave device, and synchronize the configuration of the network device as a master device to the slave device in time when an abnormality occurs in the network device as the master device, so as to ensure execution of related services.
Disclosure of Invention
The embodiment of the disclosure provides a network equipment configuration synchronization method, a device, equipment and a storage medium, which can be used for synchronizing network equipment configuration with higher reliability, thereby guaranteeing the execution of related services.
The embodiment of the disclosure provides a network device configuration synchronization method, which is executed by a controller and comprises the following steps: connecting a first network device with a second network device, and configuring the first network device as a master device and the second network device as a slave device; transmitting network configuration data to the first network equipment, and recording the first network configuration data successfully transmitted to the first network equipment and a first configuration quantity identifier thereof; the first network configuration data which is determined to be successfully sent to the first network equipment is sent to the second network equipment, and second network configuration data which is determined to be successfully sent to the second network equipment and a second configuration quantity identifier thereof are recorded; determining that the first network device is abnormal, the second configuration quantity identifier is unequal to the first configuration quantity identifier, sending target network configuration data in the first network configuration data to the second network device according to the second configuration quantity identifier and the first configuration quantity identifier, and setting the second network device as a master device.
The embodiment of the disclosure provides a network device configuration synchronization method, which is executed by a first network device and comprises the following steps: receiving first network configuration data sent by a controller; storing the first network configuration data into a volatile storage device of the first network device, and returning response data corresponding to the first network configuration data to the controller, wherein the response data corresponding to the first network configuration data is used for indicating the first network device to successfully receive the first network configuration data; receiving a current persistence instruction sent by the controller, wherein the current persistence instruction is sent to the first network device when the controller detects that a current preset time interval is reached; and according to the current persistence instruction, storing the first network configuration data which is received in the last preset time interval and stored in the volatile storage device into a nonvolatile storage device of the first network equipment.
The embodiment of the disclosure provides a network device configuration synchronization apparatus, which is executed by a controller, and comprises: the connection module is used for connecting the first network equipment and the second network equipment, configuring the first network equipment as a master equipment and configuring the second network equipment as a slave equipment; the sending module is used for sending the network configuration data to the first network equipment and recording the first network configuration data which is successfully sent to the first network equipment and the first configuration quantity identifier thereof; the sending module is further configured to send the first network configuration data that is determined to be successfully sent to the first network device to the second network device, and record second network configuration data that is determined to be successfully sent to the second network device and a second configuration quantity identifier thereof; the processing module is used for determining that the first network equipment is abnormal, the second configuration quantity identifier is unequal to the first configuration quantity identifier, sending target network configuration data in the first network configuration data to the second network equipment according to the second configuration quantity identifier and the first configuration quantity identifier, and setting the second network equipment as a main equipment.
In some exemplary embodiments, the sending module is configured to save, in a first list, the first network configuration data that is successfully sent to the first network device; according to the first network configuration data added in the first list, the first configuration quantity identifier is increased; the sending module is used for storing the second network configuration data which is successfully sent to the second network equipment in a second list form; increasing the second configuration quantity identifier according to the second network configuration data added in the second list; the processing module is configured to obtain a list length of the first list when the first network device is determined to be abnormal and the second configuration quantity identifier is smaller than the first configuration quantity identifier; determining initial target network configuration data from the first network configuration data according to the list length, the second configuration quantity identifier and the first configuration quantity identifier; and sending the initial target network configuration data to the end of the first list as the target network configuration data to the second network device.
In some exemplary embodiments, the processing module is further configured to determine that the first network device is abnormal, and the second configuration quantity identifier is equal to the first configuration quantity identifier, and set the second network device as a master device.
In some exemplary embodiments, the sending module is further configured to send, when the current preset time interval is detected to reach, a current persistence instruction to the first network device, where the current persistence instruction is used to instruct the first network device to store, in a nonvolatile storage of the first network device, first network configuration data that is received in a previous preset time interval and stored in the volatile storage; recording an index of the corresponding first network configuration data in the first list in the process of storing the first network configuration data in the nonvolatile storage device of the first network equipment in the last preset time interval; when the next preset time interval is detected, if the list length of the first list is not equal to the index of the corresponding first network configuration data in the first list, a next persistence instruction is sent to the first network device, the next persistence instruction is used for indicating the first network device, and the first network configuration data which is received in the current preset time interval and stored in the volatile storage device is stored in the nonvolatile storage device.
In some exemplary embodiments, the sending module is further configured to send, to the first network device, the first network configuration data that is not stored in the nonvolatile storage device and is not stored in the nonvolatile storage device, and then resend the first network configuration data in the current preset time interval to the first network device, in response to a configuration replay instruction for the first network device.
In some exemplary embodiments, the sending module is configured to record, when retransmitting corresponding first network configuration data to the first network device, an index of the successfully retransmitted first network configuration data in the first list; and if the first network equipment is detected to be disconnected in the retransmission process, retransmitting the first network configuration data which is not saved to the nonvolatile storage device to the first network equipment from the recorded index of the successfully retransmitted first network configuration data in the first list after the first network equipment is reconnected.
The embodiment of the disclosure provides a network device configuration synchronization apparatus, which is executed by a first network device, and comprises: the receiving module is used for receiving the first network configuration data sent by the controller; the storage module is used for storing the first network configuration data into a volatile storage device of the first network equipment and returning response data corresponding to the first network configuration data to the controller, wherein the response data corresponding to the first network configuration data is used for indicating the first network equipment to successfully receive the first network configuration data; the receiving module is further configured to receive a current persistence instruction sent by the controller, where the current persistence instruction is sent to the first network device when the controller detects that a current preset time interval is reached; and the storage module is further used for storing the first network configuration data which is received in the last preset time interval and stored in the volatile storage device into the nonvolatile storage device of the first network equipment according to the current persistence instruction.
The embodiment of the disclosure provides a computer device, which comprises a processor, a memory and an input-output interface; the processor is respectively connected with the memory and the input/output interface, wherein the input/output interface is used for receiving data and outputting data, the memory is used for storing a computer program, and the processor is used for calling the computer program so that the computer device containing the processor executes the network device configuration synchronization method in any embodiment of the disclosure.
The disclosed embodiments provide a computer readable storage medium storing a computer program adapted to be loaded and executed by a processor to cause a computer device having the processor to perform the network device configuration synchronization method in any of the embodiments of the disclosure.
Embodiments of the present disclosure provide a computer program product or computer program comprising computer instructions stored in a computer readable storage medium. The processor of the computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions to cause the computer device to perform the network device configuration synchronization method provided in the various alternatives in any of the embodiments of the present disclosure.
According to the technical scheme provided by the embodiment of the disclosure, the first network configuration data and the first configuration quantity identifier thereof successfully transmitted to the master device and the second network configuration data and the second configuration quantity identifier thereof successfully transmitted to the slave device can be controlled by the controller, so that when the occurrence of the abnormality of the master device is detected, the configuration of the slave device can be faster up to the same as that of the master device, and the synchronization of the configuration of the master device and the slave device is realized. Therefore, the network equipment configuration synchronization has higher reliability, thereby guaranteeing the execution of related services.
Drawings
FIG. 1 is a schematic illustration of an implementation environment provided by embodiments of the present disclosure.
Fig. 2 is a schematic diagram of another implementation environment provided by embodiments of the present disclosure.
Fig. 3 is a flowchart of a network device configuration synchronization method provided in an embodiment of the present disclosure.
Fig. 4 is a schematic diagram of a first list and a second list provided in an embodiment of the disclosure.
Fig. 5 is a schematic diagram of network device configuration synchronization performed by a controller according to an embodiment of the present disclosure.
Fig. 6 is a process schematic diagram of a network device configuration synchronization method according to an embodiment of the present disclosure.
Fig. 7 is a schematic diagram of a network device configuration synchronization apparatus according to an embodiment of the present disclosure.
Fig. 8 is a schematic diagram of another network device configuration synchronization apparatus according to an embodiment of the disclosure.
Fig. 9 is a schematic structural diagram of a computer device according to an embodiment of the present disclosure.
Detailed Description
The technical solutions in the embodiments of the present disclosure will be clearly and completely described below with reference to the drawings in the embodiments of the present disclosure.
Furthermore, the drawings are merely schematic illustrations of the present disclosure and are not necessarily drawn to scale. The same reference numerals in the drawings denote the same or similar parts, and thus a repetitive description thereof will be omitted. Some of the block diagrams shown in the figures are functional entities and do not necessarily correspond to physically or logically separate entities. These functional entities may be implemented in software or in one or more hardware modules or integrated circuits or in different networks and/or processor devices and/or microcontroller devices.
For ease of understanding, the following first explains several concepts to which the present disclosure relates:
cloud computing (clouding) is a computing model that distributes computing tasks across a large pool of computers, enabling various application systems to acquire computing power, storage space, and information services as needed. The network that provides the resources is referred to as the "cloud". Resources in the cloud are infinitely expandable in the sense of users, and can be acquired at any time, used as needed, expanded at any time and paid for use as needed.
As a basic capability provider of cloud computing, a cloud computing resource pool (abbreviated as a cloud platform, generally called IaaS (Infrastructure as a Service, infrastructure as a service) platform) is established, in which multiple types of virtual resources are deployed for external clients to select for use.
According to the logic function division, a PaaS (Platform as a Service ) layer can be deployed on an IaaS (Infrastructure as a Service ) layer, and a SaaS (Software as a Service, software as a service) layer can be deployed above the PaaS layer, or the SaaS can be directly deployed on the IaaS. PaaS is a platform on which software runs, such as a database, web container, etc. SaaS is a wide variety of business software such as web portals, sms mass senders, etc. Generally, saaS and PaaS are upper layers relative to IaaS.
The embodiment of the disclosure provides a network device configuration synchronization method, as shown in fig. 1, which shows a schematic diagram of an implementation environment provided by the embodiment of the disclosure. The implementation environment may include: a controller 11, a first network device 12, a second network device 13, and a recording means 14. The controller 11 may communicate with the first network device 12, the second network device 13, and the recording apparatus 14, respectively.
The controller 11 may set the first network device 12 as a master device through the method provided by the embodiments of the present disclosure, and meanwhile, the controller 11 may also send network configuration data to the first network device 12, and may record, through the recording apparatus 14, the first network configuration data and the first configuration number identifier thereof that are successfully sent to the first network device 12. The first network device 12 may receive the first network configuration data.
In addition, the controller 11 may send the first network configuration data determined to be successfully sent to the first network device 12 to the second network device 13, and may record the second network configuration data and the second configuration number identifier thereof, which are successfully sent to the second network device 13, through the recording means 14. The second network device 13 may receive the second network configuration data. When the controller 11 detects that the first network device 12 is abnormal, the controller 11 may implement synchronization of the network configuration between the first network device 12 and the second network device 13 according to the second configuration data identifier and the first configuration number identifier, and set the second network device 13 as a master device after implementing the synchronization.
In some exemplary embodiments, the controller 11 may be connected to any number of network devices, for example, as shown in fig. 1, the controller 11 connects two network devices, a first network device 12 and a second network device 13. Alternatively, the controller 11 may be connected to at least one network device in addition to the first network device 12 and the second network device 13, which is not limited herein.
The controller 11, the first network device 12, the second network device 13, and the recording apparatus 14 may be located in a terminal or a server, which is shown in fig. 1 by way of example only and is not intended to limit the present application. The server may be an independent physical server, a server cluster or a distributed system formed by a plurality of physical servers, or a cloud server providing cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDNs (Content Delivery Network, content delivery networks), basic cloud computing services such as big data and artificial intelligent platforms, and the like. The terminal may be, but is not limited to, a smart phone, a tablet computer, a notebook computer, a desktop computer, a smart speaker, a smart watch, etc. The terminal and the server may be directly or indirectly connected through wired or wireless communication, which is not limited herein.
It should be noted that the controller 11 and the recording device 14 may be located at different terminals or different servers, or may be located at the same terminal or the same server, or the controller 11 itself may include a recording function, that is, the controller 11 does not need to be connected to the recording device 14. The first network device 12 and the second network device 13 may be located at different terminals or different servers, or may be located at the same terminal or the same server. The embodiments of the present disclosure are not limited in this regard.
For example, a schematic diagram of an implementation environment in which the controller 11 and the recording device 14 are located in the same server, and the first network device 12 and the second network device 13 are located in the same server may be shown in fig. 2. Operations performed by the controller 11, the first network device 12, the second network device 13, and the recording apparatus 14 in fig. 2 may be the same as those in fig. 1, and will not be described here again.
Those skilled in the art will appreciate that the numbers of the controllers 11, the first network devices 12, the second network devices 13, and the recording apparatuses 14 in fig. 1 and 2 are schematic, and any number of the controllers 11, the first network devices 12, the second network devices 13, and the recording apparatuses 14 may be provided according to actual needs. The embodiments of the present disclosure are not limited in this regard.
The present exemplary embodiment will be described in detail below with reference to the accompanying drawings and examples.
First, in the embodiments of the present disclosure, a network device configuration synchronization method is provided, which may be performed by any computer device having computing processing capability, and the method is hereinafter applied to the controller 11 in fig. 1 or fig. 2 as an example.
Fig. 3 illustrates a flowchart of a network device configuration synchronization method in an embodiment of the present disclosure, and as illustrated in fig. 3, the network device configuration synchronization method provided in the embodiment of the present disclosure may include the following S301 to S304.
S301, a controller is connected with a first network device and a second network device, and configures the first network device as a master device and the second network device as a slave device.
The embodiments of the present disclosure do not limit the types of the first network device and the second network device, and the types of the first network device and the second network device may be limited according to the application scenario. In one possible implementation, the disclosure may be applied in a cloud network scenario, where a network device built based on NFV (Network Functions Virtualization, network function virtualization) may be configured to synchronize, so the first network device and the second network device may be network devices built based on NFV. In another possible implementation manner, the present disclosure may be applied to configuration synchronization of gateway devices, so the first network device and the second network device may be programmable gateways, or may also be switches, firewalls, or the like, which is not limited by the embodiments of the present disclosure.
In some embodiments, the first network device and the second network device are programmable gateway devices that are configured based on NFV, i.e., NFV gateways. The network device constructed by the FNV can be controlled by the controller, so that finer network instructions can be issued. Compared with general network equipment, the programmable gateway does not need special hardware or customized operation system, can run on any x86 architecture server, can run in a binary or dock (an application container engine) container in any linux (an operation system) system, and can improve the universality of the network equipment. Meanwhile, the programmable gateway can support the separation of the transfer control, and keep the connection with the controller of the cloud through the remote service call client running on the gateway, and can support almost any type of network protocol configuration, for example, the programmable gateway can support VXLAN (Virtual Extensible LAN, virtual extensible local area network) protocol, IPSEC (Internet Protocol Security ) protocol, GRE (Generic Routing Encapsulation, generic routing encapsulation) protocol, NAT (Network Address Translation ) protocol, NQA (Network Quality Analyzer, network quality analysis) protocol, and the like.
For example, when the first network device and the second network device are both network devices built based on NFV, that is, NFV network devices, a remote service invocation client may be included in both the first network device and the second network device. The controller may connect the first network device by connecting a remote service invocation client in the first network device and may connect the second network device by connecting a remote service invocation client in the second network device.
In an exemplary embodiment, the controller may have an initial configuration of the network device, and after the controller connects the first network device and the second network device, the controller may configure the first network device and the second network device according to the initial configuration. The embodiment of the present disclosure does not limit the content of the initial configuration, and the initial configuration may be defined based on experience or application scenario, for example, the initial configuration may be that a first network device connected is a master device, and then one or more (two or more) second network devices connected are slave devices.
It should be noted that, in the embodiment of the present disclosure, the number of network devices connected to the controller is not limited, the controller is merely used as an example to connect the first network device and the second network device, and the controller may be connected to at least one network device in addition to the first network device and the second network device. When the controller configures the first network device as a master device, then the second network device, as well as other network devices connected thereto, may be configured as slaves.
The master device is illustratively a network device coupled to the controller and configured to perform the associated services. The slave device is a network device which is connected with the controller and is used for replacing the master device according to the instruction of the controller to execute related services when the master device is abnormal.
S302, the controller sends network configuration data to the first network equipment and records the first network configuration data which is successfully sent to the first network equipment and the first configuration quantity identification thereof.
The embodiment of the disclosure does not limit the content of the network configuration data, and the content of the network configuration data can be determined according to different application scenes. For example, in a cloud network scenario, the first network device may be a programmable gateway. The programmable gateway is used for carrying out communication protocol conversion, data format conversion or language conversion between the two different networks when forwarding the traffic of one network to the other network. The network configuration data may be data for scheduling traffic according to network quality, and data for delivering routes reported by the network device, etc. In addition, it should be noted that, the first network configuration data is the network configuration data that is successfully transmitted from the controller to the first network device. Thus, the first network configuration data is included in the network configuration data.
In some embodiments, the controller may send the network configuration data to the first network device by using a synchronous sending method, that is, after the first network device receives one piece of the first network configuration data successfully, the controller may send another piece of the network configuration data to the first network device. For example, the synchronous transmission may be implemented by a thread blocking manner, i.e. the controller may transmit a piece of network configuration data to the first network device through a thread. The controller then waits for the first network device to return response data corresponding to the piece of network configuration data to the controller. The controller may suspend the thread during the waiting period, and the controller does not issue other network configuration data to the first network device through the thread until the controller receives response data corresponding to the piece of network configuration data returned by the first network device. The controller may then re-wake the thread and send a second piece of network configuration data to the first network device.
Illustratively, the first network device may include a volatile storage device therein, for example, the volatile storage device may be a memory. After the controller sends the network configuration data to the first network device, the first network device may receive the first network configuration data sent by the controller; storing the first network configuration data in a volatile storage device of the first network device, and returning response data corresponding to the first network configuration data to the controller, wherein the response data corresponding to the first network configuration data can be used for indicating the first network device to successfully receive the first network configuration data.
In some embodiments, recording the first network configuration data and the first configuration quantity identification thereof that were successfully sent to the first network device may include: storing first network configuration data which is successfully transmitted to the first network equipment in a first list form; the first configuration quantity identification is incremented according to the first network configuration data added in the first list.
In an exemplary embodiment, the controller may save a piece of first network configuration data directly in the form of a first list each time the controller determines that the piece of first network configuration data was successfully transmitted to the first network device. Alternatively, the controller may control a recording apparatus, for example, a Redis (Remote Dictionary Server, remote dictionary service), or any apparatus having a recording function, to store the piece of first network configuration data in the form of a first list. The first network device may also correspond to a first configuration quantity identifier, where the first configuration quantity identifier indicates a quantity of first network configuration data successfully received by the first network device. For example, each time the controller sends a piece of first network configuration data to the first network device, the controller may control to increment the number corresponding to the first configuration quantity identifier by one according to the first network configuration data added in the first list. Taking the example that the first network device receives three pieces of first network configuration data successfully after self-initialization, at this time, three pieces of first network configuration data are stored in the first list, and the number corresponding to the first configuration number identifier is 3. Then, after the first network device successfully receives the fourth piece of first network configuration data, the controller may save the fourth piece of first network configuration data in the first list. And the controller may increase the number corresponding to the first configuration number identifier from 3 to 4 according to the fourth piece of first network configuration data added in the first list.
S303, the controller transmits the first network configuration data which is determined to be successfully transmitted to the first network device to the second network device, and records the second network configuration data which is successfully transmitted to the second network device and the second configuration quantity identifier thereof.
It should be noted that, the second network configuration data is first network configuration data that is successfully sent from the first network configuration data that is sent by the controller to the second network device. Thus, the second network configuration data is included in the first network configuration data.
In an exemplary embodiment, after the controller receives response data corresponding to the first network configuration data returned by the first network device, the controller may send the first network configuration data to the second network device through an asynchronous sending method. In some embodiments, the asynchronous transmission method is that the controller may send one piece of first network configuration data to the second network device without determining that the second network device has successfully received the other piece of first network configuration data. The controller may send a first piece of network configuration data to the second network device via a thread, for example. Then, if the controller needs to send another piece of first network configuration data, the controller can send the first network configuration data through another thread in real time.
In an exemplary embodiment, the second network device may also be the same as the first network device, and may include a volatile storage device. The second network device may receive second network configuration data asynchronously sent by the controller; and storing the second network configuration data into a volatile storage device of the second network device, and returning response data corresponding to the second network configuration data to the controller, wherein the response data corresponding to the second network configuration data can be used for indicating the second network device to successfully receive the second network configuration data.
When the second network device successfully receives a piece of first network configuration data, the second network device can return response data corresponding to the piece of first network configuration data to the controller.
In some embodiments, recording the second network configuration data and the second configuration quantity identification thereof that were successfully sent to the second network device may include: storing second network configuration data which is successfully transmitted to the second network equipment in a second list form; and incrementing a second configuration quantity identifier according to the added second network configuration data in the second list.
In an exemplary embodiment, the controller may save a piece of the first network configuration data directly in the form of the first list each time the controller determines that the second network configuration data was successfully transmitted to the second network device. Or the controller may control a recording means to save the second network configuration data, which is successfully transmitted to the second network device, in the form of a second list. The recording means may be, for example, the same recording means that holds the first network configuration data that was successfully sent to the first network device. Also, the method of the controller storing the second network configuration data successfully transmitted to the second network device in the form of the second list may be the same as the method of controlling the storage of the first network configuration data successfully transmitted to the first network device in the form of the first list. The method for incrementing the second configuration quantity identifier by the controller may be the same as the method for incrementing the first configuration quantity identifier, which is not described here.
S304, the controller determines that the first network device is abnormal, the second configuration quantity identifier is not equal to the first configuration quantity identifier, and the target network configuration data in the first network configuration data is sent to the second network device according to the second configuration quantity identifier and the first configuration quantity identifier, and the second network device is set as the master device.
In some embodiments, determining that the first network device is abnormal and the second configuration quantity identifier is not equal to the first configuration quantity identifier, and transmitting the target network configuration data in the first network configuration data to the second network device according to the second configuration quantity identifier and the first configuration quantity identifier may include: when the first network equipment is determined to be abnormal and the second configuration quantity identifier is smaller than the first configuration quantity identifier, acquiring the list length of a first list; determining initial target network configuration data from the first network configuration data according to the list length, the second configuration quantity identifier and the first configuration quantity identifier; and sending the initial target network configuration data to the end of the first list as target network configuration data to the second network device. The embodiment of the disclosure does not limit the situation of the first network device abnormality, for example, the first network device may be considered to be abnormal in the case that the first network device is disconnected from the controller, or the first network device cannot operate, or the like.
For example, when the controller determines that the first network device is abnormal, the controller may read the second configuration quantity identifier and the first configuration quantity identifier in the above-described recording apparatus. When the first configuration quantity identifier is not equal to the second configuration quantity identifier, the second network device cannot be directly set as the master device, and the second network device can replace the first network device only by making the second network configuration data stored in the second network device consistent with the first network configuration data stored in the first network device.
Illustratively, the target network configuration data initiated in the first network configuration data may be obtained according to a calculation performed by the following formula (1).
L 1 -(ID 1 -ID 2 )=X (1)
Wherein L is 1 Representing the list length of the first list, ID 1 For the first configuration quantity identification, ID 2 And identifying the second configuration quantity, wherein X is the position of the initial target network configuration data in the first list.
Illustratively, as shown in FIG. 4, the first configuration quantity is identified as 10, the second configuration quantity is identified as 8, and the second configuration quantity is identified as less than the first configuration quantity. For the embodiment of fig. 4, the first list may have a list length of 10. The above values can then be taken into formula (1) above to obtain: 10- (10-8) =8. Thus, the location in the first list to which the initial target network configuration data corresponds may be 8.
The initial target network configuration data may then be sent to the second network device as target network configuration data to the end of the first list. For the embodiment of fig. 4, the first network configuration data corresponding to the 8 th first network configuration data in the first list to the end in the first list may be used as the target network configuration data. The target network configuration data may then be sent to the second network device in the order in the first list. After the second device successfully receives the target network configuration data, the controller may set the second network device as a master device.
According to the method provided by the embodiment of the disclosure, when the first network device is abnormal, the configuration condition of the second network device can be determined through the first list and the second list, and when the configuration condition of the second list is that the second network device receives less second network configuration data than the first network device, the controller can send the target network device to the second network device. Therefore, the configuration condition of the second network device is not lagged behind that of the first network device, and the second network device can be ensured to replace the first network device to operate as a master device. Therefore, the embodiment of the disclosure further improves the reliability of the network equipment configuration synchronization and the reliability of the network equipment executing related services.
In other embodiments, when the controller determines that the first network device is abnormal and the second configuration quantity identifier is not equal to the first configuration quantity identifier, the controller may directly acquire all the first network configuration data recorded currently, and take all the first network configuration data as the target network configuration data. The controller may then send the target network configuration data to the second network device in sequence. The second network device may receive the target network configuration data, and may detect whether the received target network configuration data and the second network configuration data are repeated, and if so, perform a deduplication or a coverage operation. At this time, the second network device may be set as the master device.
In an exemplary embodiment, the network device configuration synchronization method provided by the present disclosure may further include: the controller determines that the first network device is abnormal, and the second configuration quantity identifier is equal to the first configuration quantity identifier, and sets the second network device as the master device.
For example, when the second configuration quantity identifier is equal to the first configuration quantity identifier, the first network configuration data stored in the first network device at this time is proved to be the same as the second network configuration data stored in the second network device, so that the second network device can be directly set as the master device.
In some embodiments, the network device configuration synchronization method provided by the present disclosure may further include: when the controller detects that the current preset time interval is reached, a current persistence instruction is sent to the first network equipment, wherein the current persistence instruction is used for indicating the first network equipment, and the first network configuration data which is received in the last preset time interval and stored in the volatile storage device is stored in the nonvolatile storage device of the first network equipment; recording an index of the corresponding first network configuration data in a first list in the process of storing the first network configuration data in the last preset time interval in a nonvolatile storage device of the first network equipment; when the next preset time interval is detected, if the list length of the first list is not equal to the index of the corresponding first network configuration data in the first list, a next persistence instruction is sent to the first network equipment, the next persistence instruction is used for indicating the first network equipment, and the first network configuration data which is received in the current preset time interval and stored in the volatile storage device is stored in the nonvolatile storage device.
In an exemplary embodiment, the current preset time interval may be set by pre-configuring a timer to the controller. The length of the current preset time interval is not set in the embodiment of the present disclosure, for example, the length of the current preset time interval may be 30 minutes, or may be 20 minutes. Taking the length of the current preset time interval as an example of 30 minutes, the current preset time interval is the time from the current moment to 30 minutes before the current moment. Similarly, the last preset time interval is the time from 30 minutes before the current time to 60 minutes before the current time.
It should be noted that, in an application scenario, for example, in a cloud network, the frequency of traffic scheduling and routing changes may be higher, and thus the frequency of the controller sending network configuration data may also be higher. When the first network device receives a first network configuration data, the first network configuration data may be first stored in a volatile storage device (e.g., a memory) so that the first configuration data may be validated in real time. In order to avoid the loss of the first network configuration data in the volatile storage device, the received first network configuration data needs to be stored in a nonvolatile storage device, for example, the nonvolatile storage device may be a magnetic disk. Because the first network device may suspend operation when the first network configuration data is stored in the nonvolatile storage device, in order to ensure efficient operation of the first network device, the controller may not frequently send the persistence command, i.e., the length of the current preset time interval is not too short.
In an exemplary embodiment, the controller sends the current persistence instructions to the first network device. The first network device may receive a current persistence instruction sent by the controller. The first network device may then store the first network configuration data received in the last preset time interval and stored in the volatile storage into the nonvolatile storage of the first network device according to the current persistence instruction. Taking the current preset time interval as 30 minutes as an example, when the distance from the last persistence command to be sent is 30 minutes, the controller detects that the current preset time interval is reached, the controller sends the current persistence command to the first network device, the first network device receives the current persistence command, and first network configuration data which is received in the last preset time interval and stored in the volatile storage device is stored in the nonvolatile storage device of the first network device.
For example, the first network device may copy the first network configuration data received in the last preset time interval and stored in the volatile storage device, and paste the first network configuration data into the nonvolatile storage device of the first network device. Alternatively, the first network device may copy the first network configuration data received in the previous preset time interval and stored in the volatile storage device, and paste the first network configuration data into the nonvolatile storage device of the first network device. The first network configuration data originally stored in the volatile storage may then be deleted.
In one possible implementation, the three pieces of first network configuration data with positions 6 to 8 in the first list are stored in the nonvolatile storage of the first network device in a current persistence instruction. Thereafter, the controller may record an index of the corresponding first network configuration data in the first list, in which embodiment the index of the corresponding first network configuration data may be 8. After the current persistence instruction is completed and before the first network device receives the new first network configuration data, the index of the corresponding first network configuration data in the first list is the same as the length of the first list. When the controller detects that the next preset time interval is reached, the length of the first list and the index of the corresponding first network configuration data in the first list can be compared, and when the comparison result is that the lengths are different, a next persistence instruction is sent to the first network device. When the comparison result is that the lengths are the same, the next persistence instruction can not be sent, and when the controllers detect that the next preset time interval is reached, and the list length of the first list is unequal to the index of the corresponding first network configuration data in the first list, the controllers send the next persistence instruction.
According to the method provided by the embodiment of the disclosure, the current persistence instruction can be sent to ensure that the sent first network configuration data is not lost in the first network device, so that the reliability of network device configuration synchronization is improved. And the reliability of the first network device for executing the related service is improved. Further, by recording the index of the corresponding first network configuration data in the first list, the controller can be prevented from issuing an invalid next persistence instruction, and the flexibility of the controller in sending the next persistence instruction is improved.
In some embodiments, the network device configuration synchronization method provided by the present disclosure may further include: when the controller detects that the current first preset time interval is reached, a current first persistence instruction is sent to the second network equipment, the first current persistence instruction is used for indicating the second network equipment, and second network configuration data which is received in the last preset time interval and stored in the volatile storage device is stored in the nonvolatile storage device of the second network equipment; recording the index of the corresponding second network configuration data in a second list in the process of storing the second network configuration data in the last first preset time interval in a nonvolatile storage device of the second network equipment; and when the next first preset time interval is detected, if the list length of the second list is unequal to the index of the corresponding second network configuration data in the second list, sending a next first persistence instruction to the second network equipment, wherein the next first persistence instruction is used for indicating the second network equipment, and storing the second network configuration data which is received in the current first preset time interval and stored in the volatile storage device into the nonvolatile storage device.
The current first preset time interval may be the same as the length of the current preset time interval, or may be different from the length of the current preset time interval, which is not limited in the present disclosure. Moreover, the method of the operation performed by the controller on the second network device may be the same as the method of the controller on the first network device, which is not described herein. In addition, the second network device may receive the current first persistence instruction sent by the controller, and an operation performed by the second network device according to the current first persistence instruction may be the same as a method for performing a corresponding operation by the first network device according to the current persistence instruction.
In some embodiments, the network device configuration synchronization method provided by the present disclosure may further include: in response to a configuration replay instruction for the first network device, the controller stores the first network configuration data within a current preset time interval in the nonvolatile storage device, and then retransmits the first network configuration data which is transmitted to the first network device and is not stored in the nonvolatile storage device to the first network device.
The embodiments of the present disclosure do not limit the transmission scenario of the configuration replay instruction for the first network device, for example, it may be manually transmitted by an operation and maintenance person in case the operation state of the first network device is not as expected. Alternatively, the controller may detect the operation state of the first network device, and when the operation state of the first network device is detected to be less than expected, the controller actively transmits the operation state.
It should be noted that, the configuration playback instruction described above may be directed to other network devices connected to the controller, for example, the second network device, in addition to the first network device. The first network device is exemplified herein, but is not intended to limit the present application.
In some embodiments, the controller may determine the first network configuration data sent to the first network device and not stored to the nonvolatile storage by reading the first list in the recording apparatus.
In some embodiments, after storing the first network configuration data in the nonvolatile storage device in the current preset time interval, the first network configuration data that is sent to the first network device and is not stored in the nonvolatile storage device is resent to the first network device, which may include: recording the index of the successfully retransmitted first network configuration data in a first list when retransmitting the corresponding first network configuration data to the first network device; if the first network equipment is detected to be disconnected in the retransmission process, after the first network equipment is reconnected, retransmitting the first network configuration data which is not saved to the nonvolatile storage device to the first network equipment from the recorded index of the successfully retransmitted first network configuration data in the first list.
In one possible embodiment, when the corresponding first network configuration data is retransmitted to the first network device, the controller may directly record an index of the successfully retransmitted first network configuration data in the first list. Or the controller may control a temporary recording means to record the index of the successfully retransmitted first network configuration data in the first list. The temporary recording device may be the same recording device as the recording device described above, or may be a different recording device. Taking the first list of indexes 8, 9, 10, 11 respectively of the first network configuration data that needs to be retransmitted to the first network device as an example. After the controller sends two corresponding first network configuration data with indexes 8 and 9 to the first network device, the controller detects that the first network device is disconnected from the controller. After the first network device reconnects the controller, the controller may simply retransmit the first network configuration data corresponding to indices 10 and 11 to the first network device.
The method provided by the embodiment of the disclosure can avoid the abnormal operation of the first network device caused by the abnormal transmission of the first network configuration data through the configuration replay instruction, and improves the reliability of the network device configuration synchronization. Further, by recording the index of the successfully retransmitted first network configuration data in the first list, the controller can be prevented from repeatedly transmitting the corresponding first network configuration data to the first network device again due to disconnection of the first network device, and the flexibility of configuration replay of the controller is improved.
According to the method provided by the embodiment of the disclosure, the first network configuration data and the first configuration quantity identifier thereof successfully transmitted to the master device and the second network configuration data and the second configuration quantity identifier thereof successfully transmitted to the slave device can be recorded through the controller, so that when the occurrence of the abnormality of the master device is detected, the configuration of the slave device can be faster up to the same as that of the master device, and the synchronization of the configuration of the master device and the slave device is realized. Therefore, the network equipment configuration synchronization has higher reliability, thereby guaranteeing the execution of related services.
In an exemplary embodiment, a schematic diagram of a controller for network device configuration synchronization may be shown in fig. 5. In fig. 5, a controller 500 may include a state management module 501, a configuration management module 502, and a connection management module 503. The first network device 504 may include a first remote service invocation client 505, a first memory 506, and a first disk 507. Second network device 508 may include a second remote service invocation client 509, a second memory 510, and a second disk 511.
The state management module 501 in the controller 500 may be configured to be responsible for a network device operation state, a connection state, a master-slave relationship maintenance switch, etc., for example, a master-slave relationship between the first network device 504 and the second network device 508 may be stored in the state management module 501. The configuration management module 502 may be configured to implement management of specific service configurations of the first network device 504 and the second network device 508. The connection management module 503 may be configured to establish a connection with the first network device 504 and the second network device 508.
In order to enable the first network device 504 and the second network device 508 to support a high-frequency and flexible scheduling manner, the first network device 504 and the second network device 508 may both be NFV network devices. After the first network device 504 and the second network device 508 are initialized, the controller 500 may connect the first network device 504 by connecting the first remote service invocation client 505 in the first network device 504 and may connect the second network device 508 by connecting the second remote service invocation client 509 in the second network device 508. Wherein the first memory 506 of the first network device 504 may be used to store the first network configuration data received by the first network device 504. The second memory 510 of the second network device 508 may be used to store second network configuration data received by the second network device 508. Additionally, the first disk 507 in the first network device 504 may be used to save the first network configuration data received in the last preset time interval and stored in the first memory 506 when the first network device 504 receives the current persistence instruction. The second disk 511 in the second network device 508 may be configured to store the second network configuration data received in the first memory 510 and stored in the second memory 510 during the previous first preset time interval when the second network device 508 receives the current first persistence command.
As shown in fig. 6, a process schematic diagram of a network device configuration synchronization method provided in an embodiment of the disclosure may include the following steps.
S601, the first network device and the first network device are on line and respectively establish connection with the controller. The implementation of this step may be referred to above in step S301, and will not be described here again.
S602, the controller stores information and master-slave relationship of the master device and the slave device. The implementation of this step may be referred to above in step S301, and will not be described here again.
S603, the controller needs to send new network configuration data. In an exemplary embodiment, in an application scenario of the cloud network, the controller may be configured to control the gateway device, where the first network device and the second network device are both programmable gateways. In this application scenario, the controller may need to send new network configuration data when traffic scheduling or routing changes are needed.
S604, network configuration data is transmitted to the first network device (synchronous transmission). The implementation of this step may be referred to above in step S302, and will not be described here again.
S605 records the first network configuration data that was successfully sent to the first network device in a cache (e.g., redis, although the disclosure is not limited thereto). The buffer is the recording device in the step S302, and the implementation manner of this step may refer to the step S302, which is not described herein.
S606, the first network configuration data is transmitted to the second network device (asynchronous transmission). The implementation of this step may be referred to above in step S303, and will not be described here again.
S607, the second network configuration data successfully sent to the second network device is recorded in the cache. The implementation of this step may be referred to above in step S303, and will not be described here again.
Fig. 7 is a schematic diagram of a network device configuration synchronization apparatus according to an embodiment of the disclosure, where the apparatus is executed by a controller. As shown in fig. 7, the network device configuration synchronization apparatus provided in the embodiment of the present disclosure may include a connection module 701, a sending module 702, and a processing module 703.
The connection module 701 is configured to connect the first network device and the second network device, and configure the first network device as a master device, and the second network device as a slave device; a sending module 702, configured to send network configuration data to a first network device, and record the first network configuration data and a first configuration number identifier thereof that are successfully sent to the first network device; the sending module 702 is further configured to send the first network configuration data determined to be successfully sent to the first network device to the second network device, and record second network configuration data and a second configuration number identifier thereof that are successfully sent to the second network device; the processing module 703 is configured to determine that the first network device is abnormal, and the second configuration number identifier is not equal to the first configuration number identifier, send the target network configuration data in the first network configuration data to the second network device according to the second configuration number identifier and the first configuration number identifier, and set the second network device as a master device.
In some exemplary embodiments, the sending module 702 is configured to store, in a first list, first network configuration data that is successfully sent to the first network device; according to the added first network configuration data in the first list, a first configuration quantity identifier is increased; a sending module 702, configured to store, in a second list, second network configuration data that is successfully sent to the second network device; controlling to increment a second configuration quantity identifier according to the second network configuration data added in the second list; a processing module 703, configured to determine that the first network device is abnormal, and when the second configuration number identifier is smaller than the first configuration number identifier, acquire a list length of the first list; determining initial target network configuration data from the first network configuration data according to the list length, the second configuration quantity identifier and the first configuration quantity identifier; and sending the initial target network configuration data to the end of the first list as target network configuration data to the second network device.
In some exemplary embodiments, the processing module 703 is further configured to determine that the first network device is abnormal, and the second configuration quantity identifier is equal to the first configuration quantity identifier, and set the second network device as a master device.
In some exemplary embodiments, the sending module 702 is further configured to send, when the current preset time interval is detected to reach, a current persistence instruction to the first network device, where the current persistence instruction is used to instruct the first network device to store, in the nonvolatile storage of the first network device, the first network configuration data received in the previous preset time interval and stored in the volatile storage; recording an index of the corresponding first network configuration data in a first list in the process of storing the first network configuration data in the last preset time interval in a nonvolatile storage device of the first network equipment; when the next preset time interval is detected, if the list length of the first list is not equal to the index of the corresponding first network configuration data in the first list, a next persistence instruction is sent to the first network equipment, the next persistence instruction is used for indicating the first network equipment, and the first network configuration data which is received in the current preset time interval and stored in the volatile storage device is stored in the nonvolatile storage device.
In some exemplary embodiments, the sending module 702 is further configured to send, after storing the first network configuration data in the nonvolatile storage device in the current preset time interval in response to a configuration replay instruction for the first network device, the first network configuration data that is sent to the first network device and not stored in the nonvolatile storage device, to resend the first network configuration data to the first network device.
In some exemplary embodiments, the sending module 702 is configured to record, when retransmitting the corresponding first network configuration data to the first network device, an index of the successfully retransmitted first network configuration data in the first list; if the first network equipment is detected to be disconnected in the retransmission process, after the first network equipment is reconnected, retransmitting the first network configuration data which is not saved to the nonvolatile storage device to the first network equipment from the recorded index of the successfully retransmitted first network configuration data in the first list.
According to the device provided by the embodiment of the disclosure, the first network configuration data and the first configuration quantity identifier thereof successfully transmitted to the master device and the second network configuration data and the second configuration quantity identifier thereof successfully transmitted to the slave device can be recorded through the controller, so that when the occurrence of the abnormality of the master device is detected, the configuration of the slave device can be faster up to the same as that of the master device, and the synchronization of the configuration of the master device and the slave device is realized. Therefore, the network equipment configuration synchronization has higher reliability, thereby guaranteeing the execution of related services.
Fig. 8 is a schematic diagram of another network device configuration synchronization apparatus provided in an embodiment of the present disclosure, which is executed by a first network device. As shown in fig. 8, the network device configuration synchronization apparatus provided by the embodiment of the present disclosure may include a receiving module 801 and a storage module 802.
A receiving module 801, configured to receive first network configuration data sent by a controller;
a storage module 802, configured to store the first network configuration data in a volatile storage device of the first network device, and return response data corresponding to the first network configuration data to the controller, where the response data corresponding to the first network configuration data is used to indicate that the first network device receives the first network configuration data successfully;
the receiving module 801 is further configured to receive a current persistence instruction sent by the controller, where the current persistence instruction is sent to the first network device when the controller detects that a current preset time interval is reached;
the storage module 802 is further configured to store, in a nonvolatile storage of the first network device, the first network configuration data received in the previous preset time interval and stored in the volatile storage according to the current persistence command.
Referring to fig. 9, fig. 9 is a schematic structural diagram of a computer device according to an embodiment of the present disclosure. As shown in fig. 9, a computer device in an embodiment of the present disclosure may include: one or more processors 901, memory 902, and input-output interfaces 903. The processor 901, memory 902, and input-output interface 903 are connected via a bus 904. The memory 902 is used for storing a computer program, which includes program instructions, and the input output interface 903 is used for receiving data and outputting data, such as for data interaction between a host and a computer device, or for data interaction between virtual machines in the host; the processor 901 is configured to execute program instructions stored in the memory 902.
The processor 901 may perform the following operations, among others: connecting the first network device with the second network device, and configuring the first network device as a master device and the second network device as a slave device; transmitting network configuration data to the first network equipment, and recording the first network configuration data successfully transmitted to the first network equipment and the first configuration quantity identifier thereof; the method comprises the steps of sending first network configuration data which are determined to be successfully sent to first network equipment to second network equipment, and recording second network configuration data which are successfully sent to the second network equipment and second configuration quantity identifiers of the second network configuration data; determining that the first network device is abnormal, wherein the second configuration quantity identifier is not equal to the first configuration quantity identifier, and sending target network configuration data in the first network configuration data to the second network device according to the second configuration quantity identifier and the first configuration quantity identifier, and setting the second network device as a master device.
Alternatively, the processor 901 may perform the following operations: receiving first network configuration data sent by a controller; storing the first network configuration data into a volatile storage device of the first network device, and returning response data corresponding to the first network configuration data to the controller, wherein the response data corresponding to the first network configuration data is used for indicating the first network device to successfully receive the first network configuration data; receiving a current persistence instruction sent by a controller, wherein the current persistence instruction is sent to first network equipment when the controller detects that a current preset time interval is reached; and according to the current persistence instruction, storing the first network configuration data which is received in the last preset time interval and stored in the volatile storage device into the nonvolatile storage device of the first network equipment.
In some possible implementations, the processor 901 may be a central processing unit (central processing unit, CPU), which may also be other general purpose processors, digital signal processors (digital signal processor, DSP), application specific integrated circuits (application specific integrated circuit, ASIC), off-the-shelf programmable gate arrays (field-programmable gate array, FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, or the like. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
The memory 902 may include read only memory and random access memory and provides instructions and data to the processor 901 and the input output interface 903. A portion of the memory 902 may also include non-volatile random access memory. For example, the memory 902 may also store information of device type.
In a specific implementation, the computer device may execute, through each built-in functional module, an implementation manner provided by each step in any method embodiment described above, and specifically may refer to an implementation manner provided by each step in a diagram shown in the method embodiment described above, which is not described herein again.
Embodiments of the present disclosure provide a computer device comprising: a processor, an input-output interface, and a memory, where the processor obtains a computer program in the memory, and performs the steps of the method shown in any of the embodiments above.
The embodiments of the present disclosure further provide a computer readable storage medium, where the computer readable storage medium stores a computer program, where the computer program is adapted to be loaded by the processor and execute the network device configuration synchronization method provided by each step in any of the foregoing embodiments, and specifically refer to an implementation manner provided by each step in any of the foregoing embodiments, which is not described herein again. In addition, the description of the beneficial effects of the same method is omitted. For technical details not disclosed in the embodiments of the computer-readable storage medium according to the present disclosure, please refer to the description of the embodiments of the method according to the present disclosure. As an example, a computer program may be deployed to be executed on one computer device or on multiple computer devices at one site or distributed across multiple sites and interconnected by a communication network.
The computer readable storage medium may be the network device configuration synchronization apparatus provided in any of the foregoing embodiments or an internal storage unit of the computer device, for example, a hard disk or a memory of the computer device. The computer readable storage medium may also be an external storage device of the computer device, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) card, a flash card (flash card) or the like, which are provided on the computer device. Further, the computer-readable storage medium may also include both internal storage units and external storage devices of the computer device. The computer-readable storage medium is used to store the computer program and other programs and data required by the computer device. The computer-readable storage medium may also be used to temporarily store data that has been output or is to be output.
The disclosed embodiments also provide a computer program product or computer program comprising computer instructions stored in a computer readable storage medium. The processor of the computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions to cause the computer device to perform the methods provided in the various alternatives of any of the embodiments described above.
The terms first, second and the like in the description and in the claims and drawings of the embodiments of the disclosure are used for distinguishing between different objects and not for describing a particular sequential order. Furthermore, the term "include" and any variations thereof is intended to cover a non-exclusive inclusion. For example, a process, method, apparatus, article, or device that comprises a list of steps or elements is not limited to the list of steps or modules but may, in the alternative, include other steps or modules not listed or inherent to such process, method, apparatus, article, or device.
Those of ordinary skill in the art will appreciate that the elements and algorithm steps described in connection with the embodiments disclosed herein may be embodied in electronic hardware, in computer software, or in a combination of the two, and that the elements and steps of the examples have been generally described in terms of function in this description to clearly illustrate the interchangeability of hardware and software. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the solution. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present disclosure.
The methods and related devices provided by the embodiments of the present disclosure are described with reference to the method flowcharts and/or structure diagrams provided by the embodiments of the present disclosure, and each flowchart and/or block of the method flowcharts and/or structure diagrams may be implemented by computer program instructions, and combinations of flowcharts and/or block diagrams. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable application display device to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable application display device, create means for implementing the functions specified in the flowchart flow or flows and/or structural diagram block or blocks. These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable application display device to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or structural diagram block or blocks. These computer program instructions may also be loaded onto a computer or other programmable application display device to cause a series of operational steps to be performed on the computer or other programmable device to produce a computer implemented process such that the instructions which execute on the computer or other programmable device provide steps for implementing the functions specified in the flowchart flow or flows and/or structures block or blocks.
The foregoing disclosure is merely illustrative of the presently preferred embodiments of the present disclosure, and it is not intended to limit the scope of the claims hereof, as defined by the appended claims.

Claims (12)

1. A method of synchronizing configuration of a network device, the method performed by a controller comprising:
connecting a first network device with a second network device, and configuring the first network device as a master device and the second network device as a slave device;
transmitting network configuration data to the first network equipment, and recording the first network configuration data successfully transmitted to the first network equipment and a first configuration quantity identifier thereof;
the first network configuration data which is determined to be successfully sent to the first network equipment is sent to the second network equipment, and second network configuration data which is determined to be successfully sent to the second network equipment and a second configuration quantity identifier thereof are recorded;
determining that the first network device is abnormal, the second configuration quantity identifier is unequal to the first configuration quantity identifier, sending target network configuration data in the first network configuration data to the second network device according to the second configuration quantity identifier and the first configuration quantity identifier, and setting the second network device as a master device.
2. The method of claim 1, wherein recording the first network configuration data and the first configuration quantity identification thereof that were successfully sent to the first network device comprises:
storing the first network configuration data successfully transmitted to the first network equipment in a first list form;
according to the first network configuration data added in the first list, the first configuration quantity identifier is increased;
wherein recording the second network configuration data and the second configuration quantity identifier thereof which are successfully sent to the second network device, includes:
storing the second network configuration data successfully transmitted to the second network equipment in a second list form;
increasing the second configuration quantity identifier according to the second network configuration data added in the second list;
the determining that the first network device is abnormal, the second configuration quantity identifier is unequal to the first configuration quantity identifier, and sending the target network configuration data in the first network configuration data to the second network device according to the second configuration quantity identifier and the first configuration quantity identifier comprises:
When the first network equipment is determined to be abnormal and the second configuration quantity identifier is smaller than the first configuration quantity identifier, acquiring the list length of the first list;
determining initial target network configuration data from the first network configuration data according to the list length, the second configuration quantity identifier and the first configuration quantity identifier;
and sending the initial target network configuration data to the end of the first list as the target network configuration data to the second network device.
3. The method of any one of claims 1 or 2, wherein the method further comprises:
and determining that the first network equipment is abnormal, wherein the second configuration quantity identifier is equal to the first configuration quantity identifier, and setting the second network equipment as a master equipment.
4. The method of claim 2, wherein the method further comprises:
when the current preset time interval is detected to be reached, a current persistence instruction is sent to the first network equipment, wherein the current persistence instruction is used for indicating the first network equipment to store first network configuration data which is received in the last preset time interval and stored in a volatile storage device into a nonvolatile storage device of the first network equipment;
Recording an index of the corresponding first network configuration data in the first list in the process of storing the first network configuration data in the nonvolatile storage device of the first network equipment in the last preset time interval;
when the next preset time interval is detected, if the list length of the first list is not equal to the index of the corresponding first network configuration data in the first list, a next persistence instruction is sent to the first network device, the next persistence instruction is used for indicating the first network device, and the first network configuration data which is received in the current preset time interval and stored in the volatile storage device is stored in the nonvolatile storage device.
5. The method of claim 4, wherein the method further comprises:
and responding to a configuration replay instruction for the first network equipment, storing the first network configuration data in the current preset time interval into the nonvolatile storage device, and then retransmitting the first network configuration data which is transmitted to the first network equipment and is not stored into the nonvolatile storage device to the first network equipment.
6. The method of claim 5, wherein after storing the first network configuration data within the current preset time interval in the nonvolatile storage device, the first network configuration data that is sent to the first network device and is not stored in the nonvolatile storage device is retransmitted to the first network device, comprising:
recording the index of the successfully retransmitted first network configuration data in the first list when retransmitting the corresponding first network configuration data to the first network equipment;
and if the first network equipment is detected to be disconnected in the retransmission process, retransmitting the first network configuration data which is not saved to the nonvolatile storage device to the first network equipment from the recorded index of the successfully retransmitted first network configuration data in the first list after the first network equipment is reconnected.
7. A method of network device configuration synchronization, the method performed by a first network device, comprising:
receiving first network configuration data sent by a controller;
storing the first network configuration data into a volatile storage device of the first network device, and returning response data corresponding to the first network configuration data to the controller, wherein the response data corresponding to the first network configuration data is used for indicating the first network device to successfully receive the first network configuration data;
Receiving a current persistence instruction sent by the controller, wherein the current persistence instruction is sent to the first network device when the controller detects that a current preset time interval is reached;
and according to the current persistence instruction, storing the first network configuration data which is received in the last preset time interval and stored in the volatile storage device into a nonvolatile storage device of the first network equipment.
8. A network device configuration synchronization apparatus, the apparatus being executed by a controller, comprising:
the connection module is used for connecting the first network equipment and the second network equipment, configuring the first network equipment as a master equipment and configuring the second network equipment as a slave equipment;
the sending module is used for sending the network configuration data to the first network equipment and recording the first network configuration data which is successfully sent to the first network equipment and the first configuration quantity identifier thereof;
the sending module is further configured to send the first network configuration data that is determined to be successfully sent to the first network device to the second network device, and record second network configuration data that is determined to be successfully sent to the second network device and a second configuration quantity identifier thereof;
The processing module is used for determining that the first network equipment is abnormal, the second configuration quantity identifier is unequal to the first configuration quantity identifier, sending target network configuration data in the first network configuration data to the second network equipment according to the second configuration quantity identifier and the first configuration quantity identifier, and setting the second network equipment as a main equipment.
9. A network device configuration synchronization apparatus, the apparatus being executed by a first network device, comprising:
the receiving module is used for receiving the first network configuration data sent by the controller;
the storage module is used for storing the first network configuration data into a volatile storage device of the first network equipment and returning response data corresponding to the first network configuration data to the controller, wherein the response data corresponding to the first network configuration data is used for indicating the first network equipment to successfully receive the first network configuration data;
the receiving module is further configured to receive a current persistence instruction sent by the controller, where the current persistence instruction is sent to the first network device when the controller detects that a current preset time interval is reached;
And the storage module is further used for storing the first network configuration data which is received in the last preset time interval and stored in the volatile storage device into the nonvolatile storage device of the first network equipment according to the current persistence instruction.
10. A computer device, comprising a processor, a memory, and an input-output interface;
the processor is respectively connected with the memory and the input/output interface, wherein the input/output interface is used for receiving data and outputting data, the memory is used for storing a computer program, and the processor is used for calling the computer program so that the computer device executes the network device configuration synchronization method according to any one of claims 1-6;
alternatively, the network device configuration synchronization method of claim 7.
11. A computer readable storage medium, characterized in that the computer readable storage medium stores a computer program adapted to be loaded and executed by a processor to cause a computer device having the processor to perform the network device configuration synchronization method of any of claims 1-6;
Alternatively, the network device configuration synchronization method of claim 7.
12. A computer program product comprising a computer program, characterized in that the computer program, when executed by a processor, implements the network device configuration synchronization method of any of claims 1-6;
alternatively, the network device configuration synchronization method of claim 7.
CN202210720600.XA 2022-06-23 2022-06-23 Network equipment configuration synchronization method, device, equipment and storage medium Pending CN117336162A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210720600.XA CN117336162A (en) 2022-06-23 2022-06-23 Network equipment configuration synchronization method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210720600.XA CN117336162A (en) 2022-06-23 2022-06-23 Network equipment configuration synchronization method, device, equipment and storage medium

Publications (1)

Publication Number Publication Date
CN117336162A true CN117336162A (en) 2024-01-02

Family

ID=89288880

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210720600.XA Pending CN117336162A (en) 2022-06-23 2022-06-23 Network equipment configuration synchronization method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN117336162A (en)

Similar Documents

Publication Publication Date Title
US10313282B1 (en) Flexible middleware messaging system
CN110262902B (en) Information processing method and system, medium, and computing device
CN112583931B (en) Message processing method, message middleware, electronic device, and storage medium
US20170163478A1 (en) Method,electronic device and system for updating client configuration in key-value pair database
CN109361525B (en) Method, device, control terminal and medium for restarting distributed deployment of multiple services
CN110868278B (en) Method for dual-computer redundancy of communication front-end processor of rail transit comprehensive monitoring system
CN103631652A (en) Method and system for achieving virtual machine migration
CN107979640B (en) Data transmission method and device
CN111585801A (en) ZigBee device upgrading method and related device
CN113411363A (en) Uploading method of image file, related equipment and computer storage medium
CN112583630A (en) Device management method, device, system, device and storage medium
CN104092661A (en) Serial port communication method and apparatus of virtual machines
CN108989157B (en) Method and device for controlling intelligent equipment
CN110233791B (en) Data deduplication method and device
US11973824B2 (en) Method for data transmission of audio and video in end-to-end system
CN115098301B (en) Snapshot generation method and system for stateful application in cloud primary scene
CN114697334B (en) Method and device for executing scheduling task
CN117336162A (en) Network equipment configuration synchronization method, device, equipment and storage medium
CN104468767A (en) Method and system for detecting cloud storage data collision
CN107948105B (en) Method and system for controlling port state of equipment
CN113141236A (en) Message processing method and device
CN109871288A (en) Execute method, apparatus, equipment and the medium of android system order
CN112383617A (en) Method, device, terminal equipment and medium for long connection
CN107948232B (en) Hook API-based proxy implementation method, data transmission method, device and system
CN114760199B (en) SDN-based network configuration information issuing method, system 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