A method and system for realizing uninterrupted service when a master control device goes online and offline
The method of sending and comparing configuration files between control and business cards in dual-control board systems prevents service disruptions by avoiding reboots, ensuring continuous business operations.
Patent Information
- Application Number
- CN202310099263.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-02-01
- Publication Date
- 2025-07-15
- Estimated Expiration
- 2043-02-01
AI Technical Summary
When the main control board is offline and then online, the business board needs to be restarted to ensure the consistency of configuration, resulting in business interruption.
Send the current startup configuration file to the service board before the main control board is offline, and send the latest startup configuration file after it is re-on. The service board compares the differences between the two. If there is no difference, do not restart, otherwise clear the current configuration and execute the latest configuration file.
It realizes that there is no need to restart the service board when the main control board is offline and re-launched, ensuring business continuity and avoiding business interruptions. It is suitable for single master and dual master control board devices.
Smart Images

Figure CN116208499B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of communication technologies, and particularly to a method and system for realizing uninterrupted services when a master control device goes offline and then comes online. Background Art
[0002] Currently, distributed dual-master control devices are widely used in network communication due to their high reliability. Generally, this type of device consists of three types of single boards: a primary master control board, a standby master control board, and a service board. The master control board mainly completes functions such as device management and service management, and the service board completes actual communication functions such as packet forwarding.
[0003] During the operation of the device, the master control board sends control instructions to the service board, and the master control board stores the configuration file. The service board mainly executes the instructions sent by the master control board and does not store any configuration. In the case where both master control boards go offline, the service board is in a trusteeship state. Even in the trusteeship state, the service board can maintain normal operation of the service. When the master control board comes back online, in order to maintain the consistency of the service configuration on the service board and the configuration on the master control board, the usual approach is to restart the service board, and then when the master control board comes back online again, the configuration file is executed, so as to ensure the consistency of the service configuration. However, such an operation will cause the service to be interrupted during the period when the service board is restarted. Summary of the Invention
[0004] The purpose of the present invention is to overcome the deficiencies of the prior art. In order to solve the problem that the service board needs to be restarted to ensure the consistency of the service configuration in the scenario where the master control board goes offline and then comes back online, and then the service is interrupted during the period when the service board is restarted, the present invention provides a method for realizing uninterrupted services when a master control device goes offline and then comes online to ensure that the service board does not need to be restarted in the scenario where the master control board comes back online after going offline, so as to ensure that the service is not interrupted and the continuity of the service is maintained.
[0005] In order to achieve the expected effect, the present invention adopts the following technical solutions:
[0006] The present invention discloses a method for realizing uninterrupted services when a master control device goes offline and then comes online, including:
[0007] Before the main master control card goes offline, send the current first startup configuration file to the service board;
[0008] After the master control board comes back online, send the latest second startup configuration file to the service board;
[0009] The service board compares the obtained first startup configuration file with the second startup configuration file. When the second startup configuration file covers each instruction of the first startup configuration file, the service board is not restarted; otherwise, the current configuration of the service board is cleared, and the second startup configuration file is executed.
[0010] Furthermore, the service board card and the main control board card are connected through a local network protocol, and the local network protocol is a layer 2 network protocol or a layer 3 network protocol.
[0011] Furthermore, when the service board card receives the information of the main control board card for the first time or the startup configuration file of the main control board card changes, the service board card downloads the startup configuration file of the main control board card to the local through the local network protocol.
[0012] Furthermore, the service board card and the main control board card confirm their online and offline status by sending keep-alive messages. When the keep-alive message from the peer is not received within the specified time, it is determined that the peer has gone offline; when the main control board card goes offline and the service board card does not receive the information of the service board card within the specified time, the timeout processing task of the service board card will be triggered and the offline time of the main control board card will be recorded.
[0013] Furthermore, when the service board card successfully or unsuccessfully obtains the startup configuration file from the main control board card reaches a certain number of times respectively, the service board card adds a mark indicating that the acquisition of the startup configuration file is completed in the keep-alive message, and then sends the message to the main control board card. When the main control board card receives the keep-alive message from the service board card, it sets the online mark of the service board card.
[0014] Furthermore, when the service board card obtains the second startup configuration file from the main control board card, it judges whether the main control board card has ever been online through the existing information. If the main control board card is restarted after going offline, the first startup configuration file is compared with the second startup configuration file, and the comparison result is sent to the main control board card, and the main control board card decides whether to restart the service board card.
[0015] Furthermore, before the main control board card goes offline, a command to save the configuration file must be executed once.
[0016] Furthermore, the type of the main control board card is a single main control board card device or a dual main control board card device.
[0017] Furthermore, for a dual main control board card device, when the active main control board card goes offline, the time for the standby main control board card to become the new active main control board card should be shorter than the time for the device to determine that the main control board card has gone offline.
[0018] The present invention also discloses a system for realizing uninterrupted service when the main control device goes online and offline, including:
[0019] A main control board card, before the main board control card goes offline, it sends the current first startup configuration file to the service board card; after the main control board card is restarted online, it sends the latest second startup configuration file to the service board card;
[0020] Service board card, the service board card compares the first startup configuration file with the second startup configuration file. When the second startup configuration file overwrites each instruction of the first startup configuration file, the service board card is not restarted. Otherwise, the current configuration of the service board card is cleared and the second startup configuration file is executed.
[0021] Compared with the prior art, the present invention has the following beneficial effects: In the scenario where the traditional main control board card goes offline and then comes back online, the service board card needs to be restarted to ensure the configuration consistency between the main control board card and the service board card, which then leads to service interruption during the restart process of the service board card. The present invention discloses a method and system for realizing non-interruption of services when the main control device goes offline and comes back online. The method includes: before the main control board card goes offline, sending the current first startup configuration file to the service board card; after the main control board card comes back online, sending the latest second startup configuration file to the service board card; the service board card compares the obtained first startup configuration file with the second startup configuration file. When the second startup configuration file overwrites each instruction of the first startup configuration file, the service board card is not restarted. Otherwise, the current configuration of the service board card is cleared and the second startup configuration file is executed. The present invention can realize that the service board card is not restarted in the scenario where the main control board card goes offline and comes back online, thereby ensuring service non-interruption, maintaining service continuity, and improving work efficiency. The design of the present invention supports both single main control board card type devices and dual main control board card type devices, and has a wide application range. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] In order to more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the drawings required for use in the description of the embodiments or the prior art. Obviously, the following described drawings are only some embodiments of the present invention. For those of ordinary skill in the art, without creative efforts, other drawings can also be obtained based on these drawings.
[0023] Figure 1 It is an example diagram of normal negotiation between the main control board card and the service board card of a method for realizing non-interruption of services when the main control device goes offline and comes back online provided by an embodiment of the present invention;
[0024] Figure 2 It is an example diagram of the main control board card coming back online after going offline in a method for realizing non-interruption of services when the main control device goes offline and comes back online provided by an embodiment of the present invention;
[0025] Figure 3 It is a flowchart of a method for realizing non-interruption of services when the main control device goes offline and comes back online provided by an embodiment of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0026] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0027] See also Figures 1 to 3 The present invention discloses a method for realizing uninterrupted service when a master control device goes offline or online, comprising:
[0028] First, a local network protocol connection is established between the service board and the main control board for communication and file transfer, wherein the file transfer is implemented based on the file transfer protocol, and the file transfer protocol is implemented based on the local network protocol.
[0029] Before the main control board goes offline, it sends the current first startup configuration file to the service board; the service board obtains the latest startup configuration file of the main control board through the local network protocol, in order to prepare for comparison with the startup configuration file after the subsequent re-online.
[0030] After the main control board comes back online, it sends the latest second startup configuration file to the service board; the service board obtains the latest startup configuration file of the main control board through the local network protocol.
[0031] The service board compares the first startup configuration file with the second startup configuration file. When the second startup configuration file overwrites the instructions of the first startup configuration file, the service board is not restarted. Otherwise, the current configuration of the service board is cleared and the second startup configuration file is executed. The specific comparison results include the following:
[0032] If the number of instructions in the startup configuration file after the main control board comes back online is exactly the same as the number before it goes offline, that is, every instruction contained in the startup configuration file before the main control board goes offline can be found in the startup configuration file after the main control board comes back online, then the business board will not be restarted and the main control board does not need to execute the configuration file. The main control board does not need to perform any action except recording the business board information.
[0033] If the number of instructions in the startup configuration file after the main control board comes back online corresponds one to one and is greater than that before it goes offline, that is, every instruction contained in the startup configuration file before the main control board goes offline can be found in the startup configuration file after the main control board comes back online, but the startup configuration file after the main control board comes back online contains more instructions, then the business board will not be restarted, but the main control board needs to execute the configuration file, and send more instructions contained in the startup configuration file after the main control board comes back online to the business board, so as to ensure the consistency of the configuration of the main control board and the business board.
[0034] If the number of instructions in the startup configuration file after the main control board card is back online is less than that before it went offline, clear the current configuration of the service board card and execute the latest startup configuration file. That is, some instructions cannot be found in the startup configuration file after the main control board card is back online. To ensure the consistency between the configuration of the service board card and the main control board card, the main control board card needs to send instructions to clear the configuration on the service board card, and then immediately execute the startup configuration file to send the latest instructions to the service board card.
[0035] In a preferred embodiment, the service board card and the main control board card confirm their online and offline status by sending keep-alive messages. When the keep-alive message from the peer is not received within the specified time, it is determined that the peer has gone offline; when the main control board card goes offline, if the service board card does not receive information from the service board card within the specified time, it will trigger the timeout processing task of the service board card and record the time when the main control board card goes offline.
[0036] Such as Figure 1 shown is an example diagram of the normal negotiation between the main control board card and the service board card of a method for realizing uninterrupted service when the main control device goes online and offline provided by an embodiment of the present invention. The negotiation process between the service board card and the main control board card mainly involves the sending and receiving of keep-alive messages between the service board card and the main control board card, recording the information of each other, and the service board card downloading the startup configuration file of the main control board card. Of course, the focus of the present invention is to introduce the scenario where the main control board card goes offline and then comes back online. However, in order to better understand the present invention, it is very necessary to introduce the process of normal negotiation between the service board card and the main control board card first, so as to clearly understand the difference between the first online of the main control board card and the online again after going offline.
[0037] Step 101: The service board card first records its own relevant main information in the keep-alive data packet, and then transmits it through the communication protocol between the service board card and the main control board card, and broadcasts the message. When the main control board card receives the keep-alive data packet from the service board card for the first time, it parses the service board card information contained in the data packet and records the main information among them.
[0038] It should be noted that here it mainly involves what information the service board card needs to carry in the keep-alive data packet. The main information includes the source address of the communication. When the main control receives the keep-alive data packet, it can reply to the data packet according to this source address. It can also include information such as the slot where the service board card is located and the result of obtaining the startup configuration file from the main control. These information are all required in the interaction between the two parties.
[0039] In a preferred embodiment, the service board and the main control board are connected through a local network protocol, and the local network protocol is a layer 2 network protocol or a layer 3 network protocol. The local network protocol is the network protocol for communication between the service board and the main control board. There are many ways to implement the communication protocol, and the communication protocol can be a layer 2 network communication protocol or a layer 3 network communication protocol. Since it is not the key content of the present invention and the implementation methods are diverse, it will not be described in detail here.
[0040] Step 102: After the main control board receives the keep-alive data packet from the service board, the main control board records the relevant information of the service board and learns of the existence of the service board. At this time, the main control board also needs to send a keep-alive data packet to the service board to transfer the relevant information of the main control board to the service board.
[0041] When the service board receives the keep-alive data packet from the main control board for the first time, it first records the relevant information of the main control board, confirms that the main control board is not offline and then online, and the service board needs to start a task of downloading the startup configuration file from the main control board. To download the startup configuration file from the main control board, the file transfer protocol needs to be used. The file transfer protocol will not be introduced in detail here. To ensure the reliability of file acquisition, two sets of file transfer protocols can be designed. In the case where one protocol fails, the file transfer protocol can be replaced to obtain the file.
[0042] In a preferred embodiment, when the service board receives the information of the main control board for the first time or the startup configuration file of the main control board changes, the service board downloads the startup configuration file of the main control board to the local through the local network protocol. The service board receiving the information of the main control board for the first time includes the situation where the main control board is offline and then online again.
[0043] In a preferred embodiment, when the service board obtains the second startup configuration file from the main control board, it determines whether the main control board has ever been online through the existing information. If the main control board is offline and then online again, the first startup configuration file is compared with the second startup configuration file, and the comparison result is sent to the main control board, and the main control board decides whether to restart the service board.
[0044] It should be noted that the emphasis on downloading the startup configuration file from the main control board is to ensure that the service board has obtained the startup configuration file of the main control board at least once, so as to avoid the situation of having no startup configuration file to compare when the main control is offline and then online again.
[0045] Step 103: Add the keep-alive message mark received from the master control board to the data packet and unicast it. Add the mark indicating the completion of obtaining the startup configuration file. The master control board confirms that the service board is online based on the fact that the service board has received the keep-alive message mark sent by itself.
[0046] When the service board finishes downloading the startup configuration file from the master control board or fails to download the startup configuration file a certain number of times, the service board should add the mark indicating the completion of obtaining the startup configuration file to the keep-alive message and then send the message to the master control board.
[0047] It should be noted that, first of all, during program design, every effort should be made to ensure the successful download of the startup configuration file. If there are problems with the download configuration file channel, the mark indicating the completion of downloading the startup configuration file should also be forcibly set when the number of failures to download the startup configuration file reaches a certain number. Otherwise, the master control board will think that the service board is not ready yet and will not register the service board on the master control board temporarily, resulting in the service board being unable to go online for a long time, thus violating the original intention of the invention.
[0048] When the master control board receives the keep-alive message from the service board and finds that the service board has successfully downloaded the startup configuration file, it starts the registration of the service board and sets the mark indicating that the service board is online. So far, the task of negotiating the online status between the service board and the master control board has been completed.
[0049] In a preferred embodiment, when the service board successfully obtains the startup configuration file from the master control board or fails to obtain it a certain number of times respectively, the service board adds the mark indicating the completion of obtaining the startup configuration file to the keep-alive message and then sends the message to the master control board. When the master control board receives the keep-alive message from the service board, it sets the mark indicating that the service board is online.
[0050] Step 104: The master control board executes the save configuration command and adds the mark indicating the change of the startup configuration file to the keep-alive message. The service board re-obtains the startup configuration file according to the mark indicating the change of the startup configuration file in the keep-alive message.
[0051] This step mainly describes that when the device is running stably and the user configures a lot of instructions on the device, in order to ensure that the configuration is not lost after the device restarts, the user executes the save configuration instruction. In this case, the master control board needs to notify the service board to download the latest startup configuration file.
[0052] To ensure that the startup configuration file obtained on the service board is the latest, the module for the master board to interact with the service board needs to sense that the startup configuration file has changed. After the startup configuration file changes, the master board needs to record it and then add a flag indicating that the startup configuration file of the master board has changed when sending the next keep-alive message. When the service board receives the keep-alive message from the master board, according to the flag bit in the message, it knows that the startup configuration file of the master board has changed and needs to immediately redownload the startup configuration file of the master board. Here, the service board also needs to start a task to complete the download of the startup configuration file of the master board. In a preferred embodiment, when the number of failed downloads reaches a certain number, the download of the startup configuration file is stopped.
[0053] As Figure 2 shown is an example diagram of the master board going offline and then coming back online for a method provided by an embodiment of the present invention to ensure that services are not interrupted when the master device goes offline and online.
[0054] In a preferred embodiment, before the master board goes offline, a command to save the configuration file must be executed.
[0055] Step 201: Before the master board goes offline, to ensure the smooth use of the present invention, a configuration-saving instruction needs to be executed, and a flag indicating a change in the startup configuration file is added to the keep-alive message. The service board knows from the content of the keep-alive message that it needs to re-obtain the startup configuration file and starts a task to obtain the startup configuration file. In this way, the service board can sense that the startup configuration file of the master board has changed and needs to redownload the startup configuration file of the master.
[0056] It should be noted that the reason for executing a configuration-saving instruction first here is that before the master goes offline, the user may have made a lot of configurations. One is to prevent the loss of configurations, and the other is that the service board has already executed the instructions issued by the master board. If the master board does not have these instructions after coming back online, it will cause the instructions actually executed by the service board to not match the instructions in the startup configuration file, resulting in configuration inconsistencies and not meeting the original intention of the design of the present invention.
[0057] After the user executes the configuration-saving instruction, the current configurations executed on the master board are saved. In a very short time after these operations are completed, the service board can obtain the latest startup configuration file, and then the user can pull out the master board.
[0058] Step 202: After the main control board is pulled out, if the service board does not receive the keep-alive message from the main control board for a continuous period of time, the service board can determine that the main control board has gone offline, record the offline time of the main control board, which will be used as the basis for judgment when the main control board comes back online again.
[0059] In a preferred embodiment, the type of the main control board is a single main control board device or a dual main control board device. In a preferred embodiment, for a dual main control board device, when the active main control board goes offline, the time for the standby main control board to become the new active main control board should be shorter than the time for the device to determine that the main control board has gone offline. In the case of a single main control board, after the main control board is pulled out, it is impossible for the service board to receive the keep-alive message from the main control board again. However, in the case of a dual main control board, when the active main control board is pulled out, before the standby main control board becomes the new active main control board, the service board also cannot receive the keep-alive message from the main control board because the service board only interacts with the active main control board. Therefore, the time for determining that the main control board has gone offline should be longer than the time for the standby main control board to determine that it has become the new active main control board. From this, it can be seen that the design of the present invention supports both single main control board type devices and dual main control board type devices.
[0060] Step 203: When the service board detects that the main control board has come back online, obtain the startup configuration file of the main control board, and compare the content of the startup configuration file before the main control board went offline with the current startup configuration file.
[0061] Regardless of whether the main control board exists or not, the service board continuously sends out keep-alive messages. When the main control board is inserted again, the main control board will receive the keep-alive message from the service board, and then the main control board will reply with a keep-alive message to the service board. At this time, the service board checks the flag it recorded and knows that the main control board has been online before, but then it went offline and is now back online.
[0062] When the service board detects that the main control board has come back online after going offline, it also creates a task to download the startup configuration file from the main control board. However, different from the scenario where the service board and the main control board negotiate normally, in this scenario, the service board not only needs to obtain the startup configuration file of the main control board, but also needs to compare the startup configuration file before the main control board went offline with the latest obtained startup configuration file. The result of the comparison of the startup configuration files directly relates to what actions the main control board needs to take to ensure the consistency of the configurations of the main control board and the service board without restarting the service board, which is the most critical part of the present invention.
[0063] Step 204: After the service board downloads the startup configuration file of the main control board and finishes comparing the startup configuration files, the service board records the comparison result of the startup configuration files before and after the main control board goes offline and then comes back online in the keep-alive message, and transfers the result to the main control board. The main control board makes corresponding actions according to the comparison result of the configuration files to ensure that the service board does not restart and to ensure the consistency of the configurations of the service board and the main control board. In a preferred embodiment, the comparison result of the startup configuration files can be transferred to the main control board for the main control board to decide whether to restart the service board, or the service board itself can control whether to restart.
[0064] The present invention also discloses a system for realizing uninterrupted service during the online and offline of the main control device, including:
[0065] A main control board, before going offline, the main control board sends the current first startup configuration file to the service board; after the main control board comes back online, the main control board sends the latest second startup configuration file to the service board;
[0066] A service board, the service board compares the first startup configuration file with the second startup configuration file. When the second startup configuration file covers each instruction of the first startup configuration file, the service board does not restart, otherwise clears the current configuration of the service board and executes the second startup configuration file.
[0067] First, establish a local network protocol connection between the service board and the main control board for communication and file transfer. Among them, the file transfer is implemented based on the file transfer protocol, and the file transfer protocol is implemented based on the local network protocol.
[0068] Before the main control board goes offline, it sends the current first startup configuration file to the service board; the service board obtains the latest startup configuration file of the main control board through the local network protocol, which is for preparation for comparison with the startup configuration file after coming back online later.
[0069] After the main control board comes back online, it sends the latest second startup configuration file to the service board; the service board obtains the latest startup configuration file of the main control board through the local network protocol.
[0070] The service board compares the obtained first startup configuration file with the second startup configuration file. When the second startup configuration file covers each instruction of the first startup configuration file, the service board does not restart, otherwise clears the current configuration of the service board and executes the second startup configuration file. The specific comparison results include the following situations:
[0071] If the number of instructions in the startup configuration file after the main control board card comes back online is exactly the same as that before it went offline, that is, every instruction included in the startup configuration file before the main control board went offline can be found in the startup configuration file after the main control board card comes back online, then the service board card does not need to be restarted and the main control board card does not need to execute the configuration file. The main control board card does not need to perform any actions except recording the service board card information.
[0072] If the number of instructions in the startup configuration file after the main control board card comes back online is one-to-one corresponding and more than that before it went offline, that is, every instruction included in the startup configuration file before the main control board went offline can be found in the startup configuration file after the main control board card comes back online, but the startup configuration file after the main control board card comes back online contains more instructions, then the service board card does not need to be restarted, but the main control board card needs to execute the configuration file, and send the additional instructions included in the startup configuration file after the main control board card comes back online to the service board card to ensure the consistency of the configurations of the main control board card and the service board card.
[0073] If the number of instructions in the startup configuration file after the main control board card comes back online is less than that before it went offline, clear the current configuration of the service board card and execute the latest startup configuration file. That is, some instructions cannot be found in the startup configuration file after the main control board card comes back online. To ensure the consistency of the configuration of the service board card with that of the main control board card, the main control board card needs to send instructions to clear the configuration on the service board card, and then immediately execute the startup configuration file to send the latest instructions to the service board card.
[0074] In a preferred embodiment, the service board card and the main control board card confirm their online and offline status by sending keep-alive messages. When the keep-alive message from the peer is not received within the specified time, it is determined that the peer has gone offline; when the main control board card goes offline, if the service board card does not receive the information of the service board card within the specified time, it will trigger the timeout processing task of the service board card and record the time when the main control board card goes offline.
[0075] As Figure 1 shown is an example diagram of the normal negotiation between the main control board card and the service board card of a method for realizing non-interruption of services when the main control device goes online and offline provided by an embodiment of the present invention. The negotiation process between the service board card and the main control board card mainly involves sending and receiving keep-alive messages between the service board card and the main control board card, recording the information of each other, and the service board card downloading the startup configuration file of the main control board card. Of course, the focus of the present invention is to introduce the scenario where the main control board card comes back online after going offline. However, in order to better understand the present invention, it is very necessary to introduce the process of normal negotiation between the service board card and the main control board card before, so as to clearly understand the difference between the first online of the main control board card and its coming back online after going offline.
[0076] Step 101: The service board first records its own relevant main information in the keep-alive data packet, and then transmits it through the communication protocol between the service board and the main control board, and broadcasts the message. When the main control board receives the keep-alive data packet from the service board for the first time, it parses the service board information contained in the data packet and records the main information among them.
[0077] It should be noted that here it mainly involves what information the service board needs to carry in the keep-alive data packet. The main information includes the source address of the communication. After the main control receives the keep-alive data packet, it can reply to the data packet according to this source address. It can also include information such as the slot where the service board is located and the result of obtaining the startup configuration file from the main control. These information are all required in the interaction between the two parties.
[0078] In a preferred embodiment, the service board and the main control board are connected through a local network protocol, and the local network protocol is a layer-2 network protocol or a layer-3 network protocol. The local network protocol is the network protocol for communication between the service board and the main control board. There are many implementation methods for the communication protocol. The communication protocol can be a layer-2 network communication protocol or a layer-3 network communication protocol. Since it is not the key content of the present invention and the implementation methods are various, it will not be described in detail here.
[0079] Step 102: After the main control board receives the keep-alive data packet from the service board, the main control board records the relevant information of the service board and knows the existence of the service board. At this time, the main control board also needs to send a keep-alive data packet to the service board to transfer the relevant information of the main control board to the service board.
[0080] When the service board receives the keep-alive data packet from the main control board for the first time, it first records the relevant information of the main control board, confirms that the main control board is not offline and then goes online again. The service board then needs to start a task of downloading the startup configuration file from the main control board. To download the startup configuration file from the main control board, a file transfer protocol is required. Here, the file transfer protocol will not be introduced in detail. In order to obtain the reliability of the file, two sets of file transfer protocols can be designed. In the case where one of the protocols fails, the file transfer protocol can be replaced to obtain the file.
[0081] In a preferred embodiment, when the service board receives the information of the main control board for the first time or the startup configuration file of the main control board changes, the service board downloads the startup configuration file of the main control board to the local through the local network protocol. The service board receiving the information of the main control board for the first time includes the situation where the main control board goes offline and then goes online again.
[0082] In a preferred embodiment, when the service board obtains the second startup configuration file from the master board, it determines whether the master board has ever been online based on the existing information. If the master board is restarted after going offline, the first startup configuration file is compared with the second startup configuration file, and the comparison result is sent to the master board, which decides whether to restart the service board.
[0083] It should be noted that the emphasis on downloading the startup configuration file from the master board is to ensure that the service board has obtained the startup configuration file of the master board at least once, so as to avoid the situation where there is no startup configuration file to compare when the master goes offline and then comes back online.
[0084] Step 103: Mark the received keep-alive message of the master board and add it to the data packet for unicast transmission. Add the mark indicating that the acquisition of the startup configuration file is completed. The master board confirms the online status of the service board based on the mark of the keep-alive message it has sent and received by the service board.
[0085] When the service board completes downloading the startup configuration file from the master board or fails to download the startup configuration file a certain number of times, the service board should add the mark indicating that the acquisition of the startup configuration file is completed to the keep-alive message, and then send the message to the master board.
[0086] It should be noted that, first of all, when designing the program, every effort should be made to ensure the success of downloading the startup configuration file. If there is a problem with the channel for downloading the configuration file, the mark indicating that the download of the startup configuration file is completed should also be forcibly set when the failure to download the startup configuration file reaches a certain number of times. Otherwise, the master board will think that the service board is not ready yet and will not register the service board on the master board temporarily, resulting in the service board being unable to go online for a long time, thus violating the original intention of the invention.
[0087] When the master board receives the keep-alive message of the service board and finds that the service board has successfully downloaded the startup configuration file, it starts the registration of the service board and sets the online mark of the service board. So far, the task of negotiating the online status between the service board and the master board has been completed.
[0088] In a preferred embodiment, when the service board successfully obtains the startup configuration file from the master board or fails to obtain it a certain number of times respectively, the service board adds the mark indicating that the acquisition of the startup configuration file is completed to the keep-alive message, and then sends the message to the master board. When the master board receives the keep-alive message of the service board, it sets the online mark of the service board.
[0089] Step 104: The main control board executes the save configuration command and adds a startup configuration file change flag to the keep-alive message. The service board re-obtains the startup configuration file according to the startup configuration file change flag in the keep-alive message.
[0090] This step mainly describes that when the device is running stably and the user has configured a lot of instructions on the device, in order to ensure that the configuration is not lost after the device restarts, the user executes the save configuration instruction. In this case, the main control board needs to notify the service board to download the latest startup configuration file.
[0091] To ensure that the startup configuration file obtained on the service board is the latest, the module for interaction between the main control board and the service board needs to sense that the startup configuration file has changed. When the startup configuration file changes, the main control board needs to record it, and then add a flag indicating that the startup configuration file of the main control board has changed when sending the next keep-alive message. When the service board receives the keep-alive message from the main control board, according to the flag bit of the message, it knows that the startup configuration file of the main control board has changed and needs to immediately re-download the startup configuration file of the main control board. Here, the service board also needs to start a task to complete the download of the startup configuration file of the main control board. In a preferred embodiment, when the number of download failures reaches a certain number, the download of the startup configuration file is stopped.
[0092] Such as Figure 2 shown is an example diagram of the main control board going offline and then coming back online for a method provided by an embodiment of the present invention to achieve uninterrupted service when the main control device goes online and offline.
[0093] In a preferred embodiment, before the main control board goes offline, a command to save the configuration file must be executed.
[0094] Step 201: Before the main control board goes offline, in order to ensure the smooth use of the present invention, it is necessary to execute the save configuration instruction and add a startup configuration file change flag to the keep-alive message. The service board knows from the content of the keep-alive message that it needs to re-obtain the startup configuration file and starts the task of obtaining the startup configuration file. In this way, the service board can sense that the startup configuration file of the main control board has changed and needs to re-download the startup configuration file of the main control.
[0095] It should be noted that the reason for executing the instruction to save the configuration first here is that before the master control goes offline, the user may have made a lot of configurations. Firstly, it is to prevent the loss of configurations. Secondly, because the service board has executed the instructions issued by the master control board, if the master control board does not have these instructions after coming online again, it will cause the instructions actually executed by the service board to not match the instructions in the startup configuration file, resulting in inconsistent configurations and not meeting the original intention of the design of the present invention.
[0096] When the user executes the instruction to save the configuration, the configuration currently executed on the master control board is saved. The service board can obtain the latest startup configuration file within a very short time after these operations are completed, and then the user can pull out the master control board.
[0097] Step 202: After the master control board is pulled out, if the service board does not receive the keep-alive message from the master control board for a continuous period of time, at this time, the service board can determine that the master control board has gone offline and record the offline time of the master control board as the basis for judgment when the master control comes online again.
[0098] In a preferred embodiment, the type of the master control board is a single-master control board device or a dual-master control board device. In a preferred embodiment, for a dual-master control board device, when the primary master control board goes offline, the time for the standby master control board to become the new primary master control board is shorter than the time for the device to determine that the master control board has gone offline. In the case of a single master control, after the master control board is pulled out, it is impossible for the service board to receive the keep-alive message from the master control board again. However, in the case of a dual master control, when the primary master control board is pulled out, before the standby master control board becomes the new primary master control board, the service board also cannot receive the keep-alive message from the master control board because the service board only interacts with the primary master control board. Therefore, the time to determine that the master control board has gone offline should be longer than the time for the standby master control board to determine that it has become the new primary master control board. From this, it can be seen that the design of the present invention supports both single-master control board type devices and dual-master control board type devices.
[0099] Step 203: When the service board discovers that the master control board comes online again, obtain the startup configuration file of the master control board and compare the content of the startup configuration file before the master control board goes offline with the current startup configuration file.
[0100] Whether the master control board exists or not, the service board continuously sends keep-alive messages outward. When the master control board is inserted again, the master control board will receive the keep-alive messages from the service board, and then the master control board will reply with keep-alive messages to the service board. At this time, the service board checks the flag it records and knows that the master control board has been online before, but then the master control board went offline and is now online again.
[0101] When the service board finds that the master control board is online again after going offline, it also creates a task to download the startup configuration file from the master control board. However, different from the scenario where the service board and the master control board negotiate normally, in this scenario, the service board not only needs to obtain the startup configuration file of the master control board, but also needs to compare the startup configuration file before the master control board went offline with the latest obtained startup configuration file. The result of the comparison of the startup configuration files here is directly related to what actions the master control board needs to take to ensure the consistency of the configurations of the master control board and the service board without restarting the service board, which is the most critical part of the present invention.
[0102] Step 204: After the service board downloads the startup configuration file of the master control board and completes the comparison of the startup configuration files, the service board will record the result of the comparison of the startup configuration files before the master control board went offline and after it came online again in the keep-alive message, and transfer the result to the master control board. The master control board will take corresponding actions according to the comparison result of the configuration files to ensure that the service board is not restarted and the configurations of the service board and the master control board are consistent. In a preferred embodiment, the comparison result of the startup configuration files can be transferred to the master control board for the master control board to decide whether to restart the service board, or the service board itself can control whether to restart.
[0103] The above are only the preferred embodiments of the present invention and are not intended to limit the present invention. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principle of the present invention shall be included within the protection scope of the present invention.
Claims
1. A method for realizing uninterrupted service during the online and offline of a master device, characterized in that, Including: Before the main control board card goes offline, it sends the current first startup configuration file to the service board card; After the main control board card is back online, it sends the latest second startup configuration file to the service board card; The service board card compares the obtained first startup configuration file with the second startup configuration file. When the second startup configuration file overwrites each instruction of the first startup configuration file, the service board card does not restart. Otherwise, it clears the current configuration of the service board card and executes the second startup configuration file. Specifically including: If the instructions in the second startup configuration file are exactly the same as those in the first startup configuration file, the service board card does not restart and the main control board card does not need to execute the configuration file; If the second startup configuration file completely includes all the instructions in the first startup configuration file and there are more instructions, the service board card does not restart, and the main control board card distributes the more instructions to the service board card; If some instructions in the first startup configuration file do not exist in the second startup configuration file, the main control board card distributes instructions to clear the current configuration on the service board card, and then executes the second startup configuration file.
2. The method for realizing uninterrupted service during the online and offline of the master control device according to claim 1, wherein The service board card and the main control board card are connected through a local network protocol, and the local network protocol is a layer 2 network protocol or a layer 3 network protocol.
3. The method for realizing uninterrupted service during the online and offline of the master control device according to claim 2, wherein, When the service board card receives the information of the main control board card for the first time or the startup configuration file of the main control board card changes, the service board card downloads the startup configuration file of the main control board card locally through the local network protocol.
4. A method for realizing uninterrupted service during the online and offline of a master control device according to claim 1, characterized in that The service board card and the main control board card confirm their online and offline status by sending keep-alive messages. When the keep-alive message from the peer is not received within the specified time, it is determined that the peer has gone offline; when the main control board card goes offline and the service board card does not receive the information of the service board card within the specified time, it will trigger the timeout processing task of the service board card and record the time when the main control board card goes offline.
5. The method for realizing uninterrupted service during the online and offline of the master control device according to claim 4, wherein, When the service board card successfully or fails to obtain the startup configuration file from the main control board card reaches a certain number of times respectively, the service board card adds a mark indicating that the acquisition of the startup configuration file is completed to the keep-alive message, and then sends the message to the main control board card. When the main control board card receives the keep-alive message from the service board card, it sets the online mark of the service board card.
6. The method for realizing uninterrupted service during the online and offline of the master control device according to claim 1, characterized in that, When the service board card obtains the second startup configuration file from the main control board card, it determines whether the main control board card has ever been online through the existing information. If the main control board card is back online after going offline, it compares the first startup configuration file with the second startup configuration file and sends the comparison result to the main control board card, and the main control board card decides whether to restart the service board card.
7. A method for realizing uninterrupted service during the online and offline of a master control device according to claim 1, characterized in that, Before the main control board card goes offline, it must execute a command to save the configuration file once.
8. A method for realizing uninterrupted service during the online and offline of the master control device according to claim 1, characterized in that The type of the main control board card is a single main control board card device or a dual main control board card device.
9. A method for realizing uninterrupted service during the online and offline of the master control device according to claim 8, characterized in that, For a dual main control board card device, when the primary main control board card goes offline, the time for the standby main control board card to become the new primary main control board card is shorter than the time for the device to determine that the main control board card has gone offline.
10. A system for realizing uninterrupted service when the master control device goes online and offline, characterized in that, Including: The main control board card. Before the main control board card goes offline, it sends the current first startup configuration file to the service board card; after the main control board card is back online, it sends the latest second startup configuration file to the service board card; Service board card, the service board card compares a first startup configuration file with a second startup configuration file. When the second startup configuration file overwrites each instruction of the first startup configuration file, the service board card is not restarted; otherwise, the current configuration of the service board card is cleared and the second startup configuration file is executed; specifically including: If the instructions in the second startup configuration file are completely identical to those in the first startup configuration file, the service board card is not restarted and the main control board card does not need to execute the configuration file; If the second startup configuration file completely includes all the instructions in the first startup configuration file and there are more instructions, the service board card is not restarted, and the main control board card distributes the more instructions to the service board card; If some instructions in the first startup configuration file do not exist in the second startup configuration file, the main control board card distributes an instruction to clear the current configuration on the service board card, and then executes the second startup configuration file.
Citation Information
Patent Citations
Power-on and power-off control system, method and device for service board of frame type equipment and main control board
CN109710046A
Synchronous configuration method and system, electronic equipment and storage medium
CN113900728A