A method and apparatus for restoring initial configuration
By setting the TC to offline state after the TM receives the recovery command in the SmartMC network, and managing the TC's state transition through election and response messages, the TM's recovery operation is started only after all TCs have completed configuration recovery. This solves the configuration failure problem caused by the TM restarting before the TC and improves the reliability of network recovery.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- NEW H3C TECH CO LTD
- Filing Date
- 2023-09-26
- Publication Date
- 2026-07-17
Smart Images

Figure CN117459396B_ABST
Abstract
Description
Technical Field
[0001] This specification relates to the field of communication technology, and in particular to a method and apparatus for restoring an initial configuration. Background Technology
[0002] With the development of network technology, the number of network devices deployed in the network is gradually increasing, and the coverage area is also gradually expanding. Staff need to perform a lot of work to manage these network devices. In order to improve network maintainability and staff maintenance efficiency, SmartMC (Smart Management Center) technology has emerged.
[0003] SmartMC technology enables centralized management of network devices. These devices can be configured with different roles: TM (Topology Master) and TC (Topology Client). The TM is configured to power the TC, and both the TM and TC are elected from among the network devices in the SmartMC network. After staff configure the TM, it can synchronize its configuration information to the TC in the SmartMC network, thereby improving network maintenance efficiency.
[0004] When it's necessary to restore the initial configuration of network devices in a SmartMC network, both the TM and TC will perform the restoration process. After completing the restoration, either the TM or TC will restart. However, if the TM completes the restoration and restarts before the TC, the TC's power supply will be interrupted, resulting in a passive restart before the TC has completed its initial configuration restoration. The restarted TC will then elect a new TM within the SmartMC network. The newly elected TM will synchronize its configuration with the TC, causing all devices in the SmartMC network to be synchronized to their pre-restoration configuration. This leads to the failure of the initial configuration restoration process and reduces the reliability of the SmartMC network's initial configuration restoration. Summary of the Invention
[0005] To overcome the problems existing in related technologies, this specification provides a method and apparatus for restoring the initial configuration.
[0006] In conjunction with a first aspect of the embodiments described herein, this application provides a method for restoring an initial configuration, applied to a TM, comprising:
[0007] If a restore command to restore the initial configuration is received, the managed TC will be set to offline status;
[0008] The system periodically sends a first election message carrying a reset cell to the TC, so that the TC in the open state can perform the operation of restoring the initial configuration, or the TC in the non-open state can send a response message to the TM.
[0009] If a response message is received from the TC, the TC corresponding to the response message is set to the connected state;
[0010] If it is determined that all managed TCs are in a connected state, then the operation to restore the initial configuration is initiated.
[0011] Optionally, after initiating the operation to restore the initial configuration, the following may also be included:
[0012] Periodically broadcast second election messages without reset cells to the SmartMC network, and receive broadcast second election messages without reset cells in the SmartMC network;
[0013] Based on the priority carried in the second election message received within a preset time period and its own priority, the device role is determined, where the device role includes TM and TC.
[0014] Furthermore, after determining its own device role, it also includes:
[0015] If this device is elected as the TM, it will synchronize its configuration with the TC in the SmartMC network.
[0016] In conjunction with a second aspect of the embodiments described herein, this application provides a method for restoring an initial configuration, applied to a TC, comprising:
[0017] Receive the first election message sent by TM, which carries a reset cell;
[0018] If the system is in the initial setup state, then initiate the process of restoring the initial configuration.
[0019] If the system is not in an open state, a response message is sent to the TM to cause the TM to put the TC in the connected state and to initiate the operation of restoring the initial configuration when all managed TCs are in the connected state.
[0020] Furthermore, after initiating the operation to restore the initial configuration, the following is also included:
[0021] Periodically broadcast second election messages without reset cells to the SmartMC network, and receive broadcast second election messages without reset cells in the SmartMC network;
[0022] Based on the priority carried in the second election message received within a preset time period and its own priority, the device role is determined, where the device role includes TM and TC.
[0023] In conjunction with a third aspect of the embodiments described herein, this application provides an apparatus for restoring an initial configuration, applied to a TM, comprising:
[0024] The state switching unit is used to put the managed TC into offline state if a recovery command to restore the initial configuration is received.
[0025] The sending unit is used to periodically send a first election message carrying a reset cell to the TC, so that the TC in the open state can perform the operation of restoring the initial configuration, or the TC in the non-open state can send a response message to the TM.
[0026] The receiving unit is configured to set the TC corresponding to the TC to a connected state if it receives a response message sent by the TC.
[0027] The reset unit is used to initiate the operation of restoring the initial configuration if it is determined that all managed TCs are in a connected state.
[0028] Optionally, the sending unit is also configured to periodically broadcast a second election message without a reset cell to the SmartMC network, and to receive the broadcast second election message without a reset cell in the SmartMC network.
[0029] The device also includes:
[0030] The election unit is used to determine its own device role based on the priority carried in the second election message received within a preset time period and its own priority. The device roles include TM and TC.
[0031] Optionally, the device may also include:
[0032] The synchronization unit is used to synchronize its own configuration with the TC in the SmartMC network if the device is elected as the TM.
[0033] In conjunction with a fourth aspect of the embodiments described herein, this application provides an apparatus for restoring an initial configuration, applied to a TC, comprising:
[0034] The receiving unit is used to receive the first election message sent by the TM, which carries the reset cell;
[0035] The reset unit is used to initiate the operation of restoring the initial configuration if the system is in the open state; if the system is not in the open state, it sends a response message to the TM to make the TM put the TC in the connected state and start the operation of restoring the initial configuration when all managed TCs are in the connected state.
[0036] Optionally, the device may also include:
[0037] The transmitting unit is used to periodically broadcast a second election message without a reset cell to the SmartMC network, and to receive the broadcast second election message without a reset cell in the SmartMC network.
[0038] The election unit is used to determine its own device role based on the priority carried in the second election message received within a preset time period and its own priority. The device roles include TM and TC.
[0039] In conjunction with the fifth aspect of the embodiments of this specification, this application provides a network device including a transceiver, a processor, and a machine-readable storage medium storing machine-executable instructions that can be executed by the processor, the processor being prompted by the machine-executable instructions to implement the method steps described above for either the TM or the TC.
[0040] In conjunction with the sixth aspect of the embodiments of this specification, this application provides a machine-readable storage medium storing machine-executable instructions that, when invoked and executed by a processor, cause the processor to: implement the method steps described above for either the TM or the TC.
[0041] The technical solutions provided by the embodiments in this specification may include the following beneficial effects:
[0042] In the embodiments described in this specification, when the TM receives a recovery command to restore the initial configuration, it switches the managed TCs to offline state and sends a first election message carrying a reset cell. When the TC in the SmartMC network determines that it is in the open state, it initiates the operation to restore the initial configuration. When it determines that it is in the non-open state, it sends a response message to the TM. When the TM receives the response message, it switches the corresponding TC to connected state. When the TM determines that all the managed TCs have been switched to connected state, it then initiates the operation to restore the initial configuration. This avoids the problem that the TM restarts before the TCs during the restoration process, which would cause the TC power supply to be cut off and the restoration of the initial configuration to fail, thus improving the reliability of the SmartMC network in restoring the initial configuration.
[0043] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and are not intended to limit this specification. Attached Figure Description
[0044] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this specification and, together with the description, serve to explain the principles of this specification.
[0045] Figure 1 This is a flowchart of a method for restoring the initial configuration according to this application, applied to the TM in a SmartMC network;
[0046] Figure 2 This is a network structure diagram to which the method for restoring the initial configuration involved in this application applies;
[0047] Figure 3 This is a flowchart of a method for restoring the initial configuration according to this application, applied to a TC in a SmartMC network;
[0048] Figure 4 This is a schematic diagram of the network structure to which a method for restoring the initial configuration according to an embodiment of this application applies;
[0049] Figure 5 This is a schematic diagram of the network structure to which a method for restoring the initial configuration according to an embodiment of this application applies, wherein the router is in the process of restarting to restore the initial configuration;
[0050] Figure 6 This is a schematic diagram of a device for restoring an initial configuration according to this application, applied to a TM in a SmartMC network;
[0051] Figure 7 This is a schematic diagram of a device for restoring the initial configuration according to this application, which is applied to a TC in a SmartMC network;
[0052] Figure 8 This is a schematic diagram of the structure of a network device involved in this application. Detailed Implementation
[0053] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numbers in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this specification.
[0054] This application provides a method for restoring the initial configuration, applicable to TM, such as... Figure 1 As shown, it includes:
[0055] S100. If a recovery command to restore the initial configuration is received, the managed TC is set to offline status.
[0056] In such Figure 2 The SmartMC network shown can deploy multiple network devices (Network Device 1-Network Device 4). The device roles of the network devices in the SmartMC network are all in an unactivated state; the network devices have not yet started working as members of the SmartMC network.
[0057] After the network devices are powered on, they enter the automatic election process. Network devices in the SmartMC network, based on their factory configuration, consider themselves to be TMs and periodically broadcast election messages at set intervals (e.g., 5 seconds). These election messages may carry information such as the bridge MAC (Media Access Control) address, network identifier (NetID), network size (i.e., the number of member devices in the current SmartMC network), the IP address of the preset VLAN (Virtual Local Area Network) interface (VLAN interface1), and priority. The bridge MAC address can be used to identify a network device. The NetID identifies which SmartMC network the network device belongs to. Each network device is configured with a default NetID at the factory to enable the network devices in the network to form a self-organizing SmartMC network. The priority is used to elect a unique TM in the SmartMC network. This priority can be a value calculated based on pre-configured priority parameters, including but not limited to device type and current device role. A SmartMC network may include, but is not limited to, routers, switches, ACs (Access Controllers), and APs (Access Points).
[0058] After a preset time period (e.g., 20 seconds), each network device will determine the TM (Manager Controller) based on the election messages received from other network devices within that time period, according to the priority of each network device in the election messages. Alternatively, if a network device does not receive an election message within the preset time period, it will default to being the TM. The TM will broadcast a discovery message at the aforementioned set period (5 seconds) to announce its TM identity. The TC (Controller Group) records the TM's device information and unicasts a SmartMC discovery ACK message back to the TM.
[0059] Afterwards, staff can search for and access the Fast Network's wireless network on their terminals, log in to the Fast Network management platform, and click the "Start Using" button. The Fast Network management platform automatically distributes LLDP (Link Layer Discovery Protocol), NETCONF (network configuration), and local user configurations to member devices. Once the TM receives the SmartMC discovery message ACK from the TC, it establishes a NETCONF connection with the member device using the default username (admin) and password, and obtains detailed information about the TC through this session (such as member device port information, LLDP neighbor information, STP information, device type, software version, etc.).
[0060] The TC sends a SmartMC unicast login request message to the TM (the login request message contains information such as the bridge MAC address and IP address of VLAN-interface1). After receiving the TC's login request message, the TM replies with a login confirmation message, adding the TC to the SmartMC network. At this point, the TC is online, and its information can be viewed on the TM using commands. The TM uses the NETCONF connection to obtain its own and each TC's LLDP neighbor information to form the SmartMC network topology.
[0061] The TM can configure a new access password and generate a new NetID to distinguish it from the factory default NetID, as well as network parameter configurations, within the existing SmartMC network. This process is considered as setting up the SmartMC network, enabling all network devices in the SmartMC network to synchronize their access passwords and configurations. The TM then sets the TC in the SmartMC network to a connected state, indicating that the TC has established a connection with the TM and can exchange data with it.
[0062] It should be noted that the time for network devices to exchange election messages will be shorter than a preset time period to ensure that each network device can receive election messages sent by other network devices as much as possible. A state table can be stored in the TM, recording the correspondence between TCs and their states. A TC can be in an connected or offline state. By receiving a TC's response message for the election message or other agreed-upon interaction methods, the offline state can be switched to the connected state.
[0063] During the operation of a SmartMC network, users may need to restore the configuration of the network devices to their initial state. However, since the TM in the initial state periodically synchronizes its configuration with other network devices in the SmartMC network, if the TM performs the initial configuration restoration operation first, a new TM will be re-elected in the SmartMC network and synchronize its configuration with other network devices. Subsequently, when the original TM comes back online, it will receive the configuration synchronized by the new TM, thus preventing the SmartMC network from completing the initial configuration restoration.
[0064] To avoid the aforementioned problems, when a terminal accesses the TM and sends a restore command to the TM to restore the initial configuration, the TM can switch the state of the TC it maintains from connected to offline. Since the TM sets the TC to connected state during normal operation, after the TC completes its configuration restoration, the TC will attempt to re-establish a connection with the TM, and the TM will restore it to connected state. Therefore, the TM can confirm whether the TC has completed the configuration restoration by obtaining the current state of the TC.
[0065] It should be noted that offline and connected states are mutually exclusive, as are open and closed states. However, there is no mutual exclusion between whether a network device is open and whether it is connected; they may coexist. For example, a network device may be in a closed state but has already established a connection with the TM, or a network device may be in an open state but has been set offline by the TM.
[0066] S101. Periodically send a first election message carrying a reset cell to the TC to enable the TC in the open state to perform the operation of restoring the initial configuration, or to enable the TC in the non-open state to send a response message to the TM.
[0067] After receiving the recovery command, the TM performs configuration recovery on the network devices in the SmartMC network, that is, broadcasts a first election message to the SmartMC network. Unlike the election message mentioned above (hereinafter referred to as the second election message), the first election message carries a reset information element. The reset information element is used to indicate that the TC that receives the first election message starts the operation of restoring the initial configuration. The operation of restoring the initial configuration includes, but is not limited to, storing the currently processed data, loading the stored initial configuration, and restarting the device.
[0068] After the TM broadcasts the first election message, it waits for the TC's response message. For the TC, if configuration recovery has not yet been triggered, it will initiate configuration recovery upon receiving the first election message. If the TC has already completed the initial configuration recovery operation, i.e., after restarting, the TC enters a non-started state. At this time, when a TC in the non-started state receives the first election message, it will not perform the initial configuration recovery operation again, but will instead send an ACK message to the TM and will not synchronize its configuration with the TM.
[0069] S102. If a response message is received from the TC, the TC corresponding to the response message is set to the connected state.
[0070] When the TM receives a response message from a TC, it can set the TC to a connected state in the information maintained by the TM, thus confirming that the TC has completed configuration recovery.
[0071] S103. If it is determined that all managed TCs are in a connected state, then start the operation to restore the initial configuration.
[0072] If the TM determines, based on the recorded correspondence between TCs and their states, that all TCs in the SmartMC network are already connected, it indicates that all TCs in the current SmartMC network have completed the initial configuration restoration operation. At this point, the TM begins the initial configuration restoration operation. Since other network devices in the SmartMC network have already restored their initial configurations and are in a non-initial state, no configuration synchronization will be performed, thus improving the reliability of the SmartMC network's initial configuration restoration.
[0073] During the process of restoring the original TM to its initial configuration, the multiple TCs connected to it also undergo power outages and restarts. Since the TCs have already completed the restoration of their initial configurations, even if the original TM is not temporarily elected as the TM, the configuration will not be synchronized back to the configuration before restoration because the initial configurations of all TCs in the SmartMC network have been restored.
[0074] Optionally, after step S103, initiating the operation to restore the initial configuration, the following steps are also included:
[0075] S104. Periodically broadcast a second election message without a reset cell to the SmartMC network, and receive the broadcast second election message without a reset cell in the SmartMC network.
[0076] After the original TM completes the initial configuration restoration operation, a second election message is broadcast periodically again. This second election message does not carry a reset cell. Furthermore, the SmartMC network receives the second election message previously sent by the new TM (the network device selected as the TM during the original TM's initial configuration restoration process). In other words, the TMs that receive the second election message only conduct an election; the configuration restoration triggered by the first election message is not performed again.
[0077] S105. Determine your own device role based on the priority carried in the second election message received within the preset time period and your own priority.
[0078] The device roles include TM and TC. The original TM and the new TM periodically send a second election message. For example, this period can be set to 5 seconds. In order to reliably elect a unique TM in the SmartMC network, the preset time period can be set to 20 seconds. In this way, it is possible to ensure that each network device can reliably receive the second election message.
[0079] Upon receiving the second election message, the network device can obtain the priority carried by the message and its own priority. For example, the TM can be a router in the SmartMC network. This router acts as a gateway and has a higher priority. Even if other network devices are selected as the new TM during the restart of the original TM, they will still be switched to the TM again after the original TM comes back online due to its higher priority.
[0080] Other network devices, due to their lower priority, are elected as TCs.
[0081] Furthermore, after determining its own device role in step S105, the process also includes:
[0082] S106. If this device is elected as the TM, it synchronizes its own configuration with the TC in the SmartMC network.
[0083] After devices in a SmartMC network determine their roles, if the SmartMC network is configured to be in an open state, the TM (Manager Controller) begins synchronizing its configuration with other network devices, including but not limited to access passwords. Based on the TM's synchronization, network devices in the SmartMC network achieve unified configuration.
[0084] Correspondingly, this application also provides a method for restoring the initial configuration, applied to TC, such as... Figure 3 As shown, it includes:
[0085] S300 receives the first election message sent by TM, carrying a reset cell.
[0086] S301. If the system is in the initial state, start the operation to restore the initial configuration.
[0087] S302. If the system is not in an open state, send a response message to the TM to make the TM put the TC in the connected state and start the operation to restore the initial configuration when all managed TCs are in the connected state.
[0088] Based on the first election message carrying the reset information cell received, the TC determines, according to its current state, whether to perform the operation of restoring the initial configuration or to send a response message to the TM.
[0089] The TM determines whether the TC has completed the initial configuration restoration operation based on whether it receives a response message from the TC. If it has, the TC re-establishes a connection with the original TM; otherwise, the TC remains offline. During the initial configuration restoration process of the original TM, one of the original TCs may be elected as the new TM. However, after the original TM restores its initial configuration, the new TM will still be switched back to TC based on the election message.
[0090] Optionally, after step S302, initiating the operation to restore the initial configuration, the following steps are also included:
[0091] S303. Periodically broadcast a second election message without a reset cell to the SmartMC network, and receive the broadcast second election message without a reset cell in the SmartMC network.
[0092] S304. Determine your own device role based on the priority carried in the second election message received within the preset time period and your own priority.
[0093] The device roles include TM and TC. The TC completes the initial configuration restoration process, establishes a connection with the original TM, and determines its own device role as TC. Afterward, it receives the configuration synchronized by the original TM and maintains operation within the SmartMC network.
[0094] The following describes a method for restoring an initial configuration according to a specific implementation method. SmartMC networks, such as... Figure 4 As shown, the system includes a router acting as a gateway, a switch, a security device, and four access points (APs). Three APs are connected to the switch, the switch is connected to the router, the other AP is connected to the security device, the security device is connected to the router, and the router is connected to the internet. Power is supplied between the network devices via PoE (Power Over Ethernet).
[0095] S1, the router, switch, security device and AP exchange the second election message, the router is identified as TM, and the switch and AP are identified as TC.
[0096] S2, routers, switches, security devices, and APs obtain device information in the network through SmartMC, NETCONF, and LLDP protocols, establish connections, and generate network topology.
[0097] In the priority policy configuration, the router has a higher priority than the security device, the security device has a higher priority than the access point (AP), and the AP has a higher priority than the switch.
[0098] In the initial stage of SmartMC network establishment, based on the configured correspondence between device types and priority parameters, and the inherent configuration of each network device, routers, switches, security devices, and access points (APs) each identify themselves as TMs (Managers) according to their initial configurations. They broadcast a second election message throughout the network, carrying the determined priority and device identifier (e.g., bridge MAC address). When a network device receives a second election message from another network device, it determines the recipient of the message based on the device identifier and compares its own priority with its acquired priority. If the router's priority is higher, it continues to broadcast the second election message periodically; otherwise, it identifies itself as a TC (Controller). Through this election process, routers are selected as TMs, and switches and APs are selected as TCs. After determining their roles, the router acting as the TM continues to send second election messages to announce its TM status to the TCs. The TC records the TM's device information and replies with an acknowledgment message, thus enabling the TM to manage the TC. At this point, the TM records the TC's device information and corresponding status; the current TC is in a connected state.
[0099] S3. Users access the router acting as TM through their terminals to perform the initial setup.
[0100] During the setup process, the user connects to the wireless fast network used for setup via their terminal, thereby gaining access to the TM's configuration page. On the configuration page, an access password is set, and the start button is clicked, causing the TM to generate the SmartMC network's NetID. Subsequently, through message exchange between the TM and TC, the TC is put into setup mode, and the SmartMC network can operate. This password is used for users to log in to the TM via their terminal. Because some network devices in the SmartMC network may malfunction, all network devices have the potential to be selected as the TM. Therefore, all network devices in the SmartMC network need to record the configured access password to facilitate subsequent user login management.
[0101] S4. The user accesses the TM via the terminal to determine and perform configuration recovery on the SmartMC network. The TM switches the managed TCs to offline status and broadcasts the first election message carrying the reset cell.
[0102] After receiving the recovery command from the user, the TM puts the managed TC into offline mode. Subsequently, the TM broadcasts a first election message. The message type and other information of this first election message are the same as those of the second election message; however, unlike the second election message, the first election message carries a reset element. This reset element can be set in a reserved field of the election message.
[0103] S5 and TC receive the first election message, parse the first election message, and obtain the reset information cell.
[0104] S6. The TC determines whether to restore the initial configuration based on its current state. If it is in the initial state, it initiates the restoration of the initial configuration, and the TC completes the restoration after restarting. If it is in the non-initial state, it sends a response message to the TM for the election message.
[0105] S7. The TM receives the response message sent by the TC and switches the corresponding TC from offline to connected state. The TM checks the status of each TC it has recorded. If the TM determines that not all the managed TCs have switched to connected state, it waits. If the TM determines that all the managed TCs have switched to connected state, it jumps to S8.
[0106] After receiving the response message, the TM confirms that the TC has completed configuration recovery, establishes a connection with the TC, and puts the TC into the connected state. At this time, the router in the SmartMC network is still the TM.
[0107] When S8 and TM determine that all TCs are in a connected state, they initiate the operation to restore the initial configuration.
[0108] During the process of restoring the TM to its initial configuration, a reboot will occur, during which the current TC will continue to operate. When the TC determines that the TM is offline, a new TM needs to be elected in the SmartMC network. At this time, the original TC will consider the TM as offline and will not exchange election messages that do not include reset cells.
[0109] like Figure 5As shown, within the range of the switch and three APs on the left, assuming one AP is selected as TM A, and within the range of the security device and one AP on the right, assuming the security device is selected as TM B, the SmartMC networks on both sides are effectively split. Since both sides are restored to their initial configurations, the NetID is updated to the default NetID. After the router restarts, its NetID will also be restored to the default NetID. Because it is the same as the NetID of the SmartMC networks on both sides, they will be merged.
[0110] S9. After the merger, the router broadcasts an election message in the SmartMC network that does not carry a reset cell.
[0111] Through the exchange of election messages, it can be determined that in the merged SmartMC network, the router has the highest priority and performs a switch between TM and TC. The previously established TM A and TM B are switched to TC, and the router switches to TM, restoring the previous state. Figure 4 The network status is shown. At this point, all network devices in the SmartMC network have completed the process of restoring their initial configuration.
[0112] exist Figure 5 After the SmartMC network is re-established, users can access the router acting as the TM (Technical Manager) via their terminals to generate the NetID and configure the access password, thus completing the initial setup of the SmartMC network. Subsequently, the router acting as the TM can synchronize its configuration with other network devices acting as the TC (Treatment Center) within the SmartMC network.
[0113] Correspondingly, this application also provides a device for restoring the initial configuration, applied to a TM, such as... Figure 6 As shown, it includes:
[0114] The state switching unit is used to put the managed TC into offline state if a recovery command to restore the initial configuration is received.
[0115] The sending unit is used to periodically send a first election message carrying a reset cell to the TC, so that the TC in the open state can perform the operation of restoring the initial configuration, or the TC in the non-open state can send a response message to the TM.
[0116] The receiving unit is configured to set the TC corresponding to the TC to a connected state if it receives a response message sent by the TC.
[0117] The reset unit is used to initiate the operation of restoring the initial configuration if it is determined that all managed TCs are in a connected state.
[0118] Optionally, the sending unit is also configured to periodically broadcast a second election message without a reset cell to the SmartMC network, and to receive the broadcast second election message without a reset cell in the SmartMC network.
[0119] The device also includes:
[0120] The election unit is used to determine its own device role based on the priority carried in the second election message received within a preset time period and its own priority. The device roles include TM and TC.
[0121] Optionally, the device may also include:
[0122] The synchronization unit is used to synchronize its own configuration with the TC in the SmartMC network if the device is elected as the TM.
[0123] Correspondingly, this application also provides a device for restoring the initial configuration, applied to a TC, such as... Figure 7 As shown, it includes:
[0124] The receiving unit is used to receive the first election message sent by the TM, which carries the reset cell;
[0125] The reset unit is used to initiate the operation of restoring the initial configuration if the system is in the open state; if the system is not in the open state, it sends a response message to the TM to make the TM put the TC in the connected state and start the operation of restoring the initial configuration when all managed TCs are in the connected state.
[0126] Optionally, the device may also include:
[0127] The sending unit is used to periodically broadcast a second election message without a reset cell to the SmartMC network, and to receive the broadcast second election message without a reset cell in the SmartMC network.
[0128] The election unit is used to determine its own device role based on the priority carried in the second election message received within a preset time period and its own priority. The device roles include TM and TC.
[0129] Correspondingly, this application also provides a network device, such as Figure 8 As shown, it includes a transceiver, a processor, and a machine-readable storage medium storing machine-executable instructions that can be executed by the processor, which is prompted by the machine-executable instructions to implement the method steps described above for any of the TM or TC.
[0130] Correspondingly, this application also provides a machine-readable storage medium storing machine-executable instructions, which, when called and executed by a processor, cause the processor to implement the method steps described above for any of the TM or TC.
[0131] In the embodiments described in this specification, when the TM receives a recovery command to restore the initial configuration, it switches the managed TCs to offline state and sends a first election message carrying a reset cell. When the TC in the SmartMC network determines that it is in the open state, it initiates the operation to restore the initial configuration. When it determines that it is in the non-open state, it sends a response message to the TM. When the TM receives the response message, it switches the corresponding TC to connected state. When the TM determines that all the managed TCs have been switched to connected state, it then initiates the operation to restore the initial configuration. This avoids the problem that the TM restarts before the TCs during the restoration process, which would cause the TC power supply to be cut off and the restoration of the initial configuration to fail, thus improving the reliability of the SmartMC network in restoring the initial configuration.
[0132] It should be understood that this specification is not limited to the precise structure described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope.
[0133] The above description is merely a preferred embodiment of this specification and is not intended to limit this specification. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this specification shall be included within the scope of protection of this specification.
Claims
1. A method for restoring an initial configuration, characterized in that, Applied to management devices™, including: If a recovery command to restore the initial configuration is received, the managed member device TC will be set to offline status; The system periodically sends a first election message carrying a reset cell to the TC, so that the TC in the open state can perform the operation of restoring the initial configuration, and the TC in the non-open state can send a response message to the TM. If a response message is received from the TC, the TC corresponding to the response message is set to the connected state; If it is determined that all managed TCs are in a connected state, then the operation to restore the initial configuration is initiated.
2. The method according to claim 1, characterized in that, Following the operation of initiating the restoration of the initial configuration, the following is also included: Periodically broadcast second election messages without reset cells to the SmartMC network of the intelligent management center, and receive broadcast second election messages without reset cells in the SmartMC network; Based on the priority carried in the second election message received within a preset time period and its own priority, the device role is determined, wherein the device role includes TM and TC.
3. The method according to claim 2, characterized in that, After determining its own device role, the process also includes: If this device is elected as the TM, it will synchronize its configuration with the TC in the SmartMC network.
4. A method for restoring an initial configuration, characterized in that, Applied to TC, including: The TC is set to offline state after the TM receives the recovery instruction to restore the initial configuration, and receives the first election message sent by the TM carrying the reset information cell; If the system is in the initial setup state, then initiate the process of restoring the initial configuration. If the system is not in an open state, a response message is sent to the TM to cause the TM to put the TC in a connected state and to put all the managed TCs in a connected state. The TM then initiates the operation to restore the initial configuration.
5. The method according to claim 4, characterized in that, Following the operation of initiating the restoration of the initial configuration, the following is also included: Periodically broadcast second election messages without reset cells to the SmartMC network, and receive broadcast second election messages without reset cells in the SmartMC network; Based on the priority carried in the second election message received within a preset time period and its own priority, the device role is determined, wherein the device role includes TM and TC.
6. An apparatus for restoring an initial configuration, characterized in that, Applied to TM, including: The state switching unit is used to put the managed TC into offline state if a recovery command to restore the initial configuration is received. The sending unit is used to periodically send a first election message carrying a reset cell to the TC, so that the TC in the open state can perform the operation of restoring the initial configuration, and the TC in the non-open state can send a response message to the TM. The receiving unit is configured to set the TC corresponding to the TC to a connected state if it receives a response message sent by the TC. The reset unit is used to initiate the operation of restoring the initial configuration if it is determined that all managed TCs are in a connected state.
7. The apparatus according to claim 6, characterized in that, The sending unit is also used to periodically broadcast a second election message without a reset cell to the SmartMC network, and to receive the broadcast second election message without a reset cell in the SmartMC network. The device further includes: An election unit is used to determine its own device role based on the priority carried in a second election message received within a preset time period and its own priority, wherein the device role includes TM and TC.
8. The apparatus according to claim 7, characterized in that, Also includes: The synchronization unit is used to synchronize its own configuration with the TC in the SmartMC network if the device is elected as the TM.
9. An apparatus for restoring an initial configuration, characterized in that, Applied to TC, including: The receiving unit is used to receive the first election message carrying a reset cell sent by the TM after the TC is set to offline state after the TM receives the recovery instruction to restore the initial configuration. The reset unit is used to initiate the operation of restoring the initial configuration if the system is in an open state; if the system is not in an open state, it sends a response message to the TM to cause the TM to put the TC in a connected state and to put all the managed TCs in a connected state, and the TM initiates the operation of restoring the initial configuration.
10. The apparatus according to claim 9, characterized in that, Also includes: The transmitting unit is used to periodically broadcast a second election message without a reset cell to the SmartMC network, and to receive the broadcast second election message without a reset cell in the SmartMC network. An election unit is used to determine its own device role based on the priority carried in a second election message received within a preset time period and its own priority, wherein the device role includes TM and TC.
11. A network device, characterized in that, The device includes a transceiver, a processor, and a machine-readable storage medium storing machine-executable instructions that can be executed by the processor, which in turn cause the processor to perform the steps of the method according to any one of claims 1-3 or 4-5.
12. A machine-readable storage medium, characterized in that, The device stores machine-executable instructions that, when invoked and executed by a processor, cause the processor to perform the steps of the method described in any one of claims 1-3 or 4-5.