Detection method and device
Through the detection packet interaction between the motherboard and the backup board, the problem that the system in the box cannot detect the dual-main and dual-standby status of the board card is solved, and the role conflict between the main and backup board card is promptly discovered and resolved to ensure the normal operation of the system.
Patent Information
- Application Number
- CN202110670056.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-06-17
- Publication Date
- 2024-12-31
- Estimated Expiration
- 2041-06-17
AI Technical Summary
The system in the box cannot detect the dual-main and dual-standby status of the board card through software and hardware, resulting in serious impact on the business functions and the situation of conflicts in the main and backup board card roles cannot be discovered and resolved in a timely manner.
Through the detection message interaction between the motherboard and the backup board, the first detection message and the second detection message exchange role information, through the software-level interaction detection, determine whether there is a role conflict between the main and backup board cards in the box, and perform corresponding operations deal with.
It realizes the timely discovery and resolution of role conflicts between the main and backup boards, ensures the normal operation of the system, reduces hidden dangers, and avoids interruptions in business functions.
Smart Images

Figure CN113485877B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of communication technology, and in particular to a detection method and device. Background Art
[0002] In the networking of frame-type devices, the roles of the master and standby boards in the frame are unique and are one of the important parameters that determine the stability of the system. If the hardware of the motherboard in the frame fails, the motherboard will indicate the wrong status, resulting in a conflict between the master and standby board roles. For example, a dual-master and dual-standby state may occur.
[0003] At present, the main control board mainly determines the master and backup roles of the boards in the frame through hardware detection. The main control board determines whether the main board is in place and whether to upgrade the backup board to the main board based on the main board in-place indication status displayed by the hardware detection.
[0004] In the existing hardware detection method, when the hardware fails, the original mainboard software is normal, and the standby board receives the interrupt notification of the upgraded mainboard, the system will have two main role boards. At this time, the hardware cannot detect the above problems, and the system cannot directly discover them from the software level. Instead, the control plane hangs. For example, the console cannot be logged in, and the routing protocol cannot work properly, which will eventually lead to business traffic interruption and other situations, causing serious impact on business functions. Summary of the invention
[0005] In view of this, the present application provides a detection method and device to solve the problem that the system in the frame cannot detect the dual-active and dual-standby status of the board through software and hardware, which seriously affects the business functions.
[0006] In a first aspect, the present application provides a detection method, which is applied to a mainboard, the mainboard is in a first frame, the first frame also includes a spare board, and the method includes:
[0007] Sending a first detection message to the standby board, where the first detection message includes first role information of the main board;
[0008] receiving a first response message sent by the standby board according to the first role information, wherein the first response message includes the second role information of the standby board;
[0009] When it is determined according to the first role information and the second role information that a suspected conflict occurs between the roles of the master and standby boards in the first frame, a second detection message is sent to the standby board, where the second detection message includes the first role information;
[0010] receiving a second response message sent by the standby board according to the first role information, where the second response message includes the second role information;
[0011] When the second role information included in the second response message is the same as the second role information included in the first response message, it is determined that a master and slave board role conflict has occurred in the first frame, and corresponding processing is performed on the master and slave boards.
[0012] In a second aspect, the present application provides a detection method, which is applied to a spare board, the spare board is in a first frame, the first frame also includes a main board, and the method includes:
[0013] receiving a first detection message sent by the mainboard, wherein the first detection message includes first role information of the mainboard;
[0014] According to the first role information, obtaining the second role information of the standby board;
[0015] Sending a first response message to the main board, where the first response message includes the second role information of the standby board;
[0016] receiving a second detection message sent by the mainboard, wherein the second detection message includes the first role information of the mainboard;
[0017] A second response message is sent to the main board, where the second response message includes the second role information of the standby board.
[0018] In a third aspect, the present application provides a detection device, which is applied to a mainboard, the mainboard is in a first frame, the first frame also includes a spare board, and the device includes:
[0019] A sending unit, configured to send a first detection message to the standby board, wherein the first detection message includes first role information of the main board;
[0020] A receiving unit, configured to receive a first response message sent by the standby board according to the first role information, wherein the first response message includes the second role information of the standby board;
[0021] The sending unit is further configured to, when it is determined according to the first role information and the second role information that a suspected conflict of roles of a master and a standby board occurs in the first frame, send a second detection message to the standby board, wherein the second detection message includes the first role information;
[0022] The receiving unit is further used to receive a second response message sent by the standby board according to the first role information, where the second response message includes the second role information;
[0023] A processing unit is used to determine that a master and slave board role conflict has occurred in the first frame when the second role information included in the second response message is the same as the second role information included in the first response message, and perform corresponding processing on the master and slave boards.
[0024] In a fourth aspect, the present application provides a detection device, which is applied to a spare board, the spare board is in a first frame, the first frame also includes a main board, and the device includes:
[0025] A receiving unit, configured to receive a first detection message sent by the mainboard, wherein the first detection message includes first role information of the mainboard;
[0026] an acquiring unit, configured to acquire second role information of the standby board according to the first role information;
[0027] A sending unit, configured to send a first response message to the main board, wherein the first response message includes the second role information of the standby board;
[0028] The receiving unit is further used to receive a second detection message sent by the mainboard, where the second detection message includes the first role information of the mainboard;
[0029] The sending unit is further used to send a second response message to the main board, where the second response message includes the second role information of the standby board.
[0030] In a fifth aspect, the present application provides a network device, including a processor and a machine-readable storage medium, the machine-readable storage medium storing machine-executable instructions that can be executed by the processor, and the processor is prompted by the machine-executable instructions to execute the method provided in the first aspect of the present application.
[0031] In a sixth aspect, the present application provides a network device, including a processor and a machine-readable storage medium, the machine-readable storage medium storing machine-executable instructions that can be executed by the processor, and the processor is prompted by the machine-executable instructions to execute the method provided in the first aspect of the present application.
[0032] Therefore, by applying the detection method and device provided in the present application, the main board sends a first detection message to the standby board, and the first detection message includes the first role information of the main board; the main board receives a first response message sent by the standby board according to the first role information, and the first response message includes the second role information of the standby board; when it is determined that a suspected conflict in the roles of the master and standby boards occurs in the first frame according to the first role information and the second role information, the main board sends a second detection message to the standby board, and the second detection message includes the first role information; the main board receives a second response message sent by the standby board according to the first role information, and the second response message includes the second role information; when the second role information included in the second response message is the same as the second role information included in the first response message, the main board determines that a conflict in the roles of the master and standby boards has occurred in the first frame, and performs corresponding processing on the master and standby boards.
[0033] In this way, the master and slave boards can interactively detect and respond to messages at the software level to determine whether there is a role conflict between the master and slave boards in the frame. This solves the problem that the system in the frame cannot detect the dual-master and dual-standby status of the boards through software and hardware, which seriously affects the business functions. It realizes the timely detection and resolution of the role conflict between the master and slave boards, ensuring the normal operation of the system and reducing hidden dangers. BRIEF DESCRIPTION OF THE DRAWINGS
[0034] Figure 1 A flow chart of a detection method provided in an embodiment of the present application;
[0035] Figure 2 A flow chart of another detection method provided in an embodiment of the present application;
[0036] Figure 3 A structural diagram of a detection device provided in an embodiment of the present application;
[0037] Figure 4 Another structural diagram of a detection device provided in an embodiment of the present application;
[0038] Figure 5 The network device hardware structure provided in the embodiment of the present application. DETAILED DESCRIPTION
[0039] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present application. Instead, they are merely examples of devices and methods consistent with some aspects of the present application as detailed in the appended claims.
[0040] The terms used in this application are only for the purpose of describing specific embodiments and are not intended to limit this application. The singular forms of "a", "said" and "the" used in this application and the appended claims are also intended to include plural forms unless the context clearly indicates other meanings. It should also be understood that the term "and / or" used in this article refers to and includes any or all possible combinations of one or more corresponding listed items.
[0041] It should be understood that although the terms first, second, third, etc. may be used in the present application to describe various information, these information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, without departing from the scope of the present application, the first information may also be referred to as the second information, and similarly, the second information may also be referred to as the first information. Depending on the context, the word "if" as used herein may be interpreted as "at the time of" or "when" or "in response to determining".
[0042] The detection method provided in the examples of the present application is described in detail below. Figure 1 , Figure 1 A flow chart of a detection method provided in an embodiment of the present application. The method is applied to a motherboard, and the detection method provided in an embodiment of the present application may include the following steps.
[0043] Step 110: Send a first detection message to the standby board, where the first detection message includes first role information of the main board.
[0044] Specifically, the mainboard is in a first frame, and the first frame also includes a standby board. The mainboard generates a first detection message, and the first detection message includes first role information of the mainboard. The first role information can specifically be a master device.
[0045] The main board sends a first detection message to the standby board.
[0046] Furthermore, in the embodiment of the present application, sending of the first detection message by the main board to the standby board may be triggered at different times.
[0047] In one implementation, the main board periodically sends a first detection message to the standby board. The main board sends the first detection message to the standby board according to the configured first cycle. A timer is set in the main board, and the time can be customized according to the current situation in the frame. For example, the time is 1 minute, that is, every 1 minute, the main board sends the first detection message to the standby board, and the first cycle is 1 minute.
[0048] In another implementation, when it is detected that the main board is downgraded to the standby board, the main board sends a first detection message to the standby board, or when it is detected that the health status of the main board is changed, the main board sends a first detection message to the standby board.
[0049] Furthermore, in an embodiment of the present application, the mainboard includes a detection module and a driver module. After the mainboard is powered on, the detection module is initialized. The detection module records the role information of the board and the slot number of the mainboard to which the board belongs, for example, the main device, slot01. At the same time, the detection module obtains the hardware-related information of the board from the driver module. The hardware-related information includes the slot number of the mainboard to which the board belongs, the in-place indication of the board, etc. The driver module can be specifically the hardware system of the mainboard.
[0050] In one implementation, the detection module sets a timer with a time of 1 minute. According to the first cycle, the detection module generates and sends a first detection message to the standby board.
[0051] In another implementation, the detection module obtains the slot number of the mainboard to which the board belongs from the driver module every 1 second. If the slot number has not changed, the role of the board remains as the mainboard and has not been downgraded. In this case, the detection module does not need to generate a first detection message and send a standby board. If the slot number has changed, the role of the board has changed. In this case, the detection module generates a first detection message and sends a standby board.
[0052] Furthermore, in an embodiment of the present application, the detection module also obtains the health data of the board where it is located from the driver module. The health data is a value calculated according to the weight based on the memory, CPU operating status, process and business operating status. The detection module obtains health data from the driver module every 1 second, or the driver module actively reports to the detection module after sensing the change in health data. The detection module can compare the health data with a preset health threshold to determine whether the health status of the board where it is located has changed. For example, if the health data exceeds the health threshold, the board is currently in a healthy state. At this time, the detection module does not need to generate a first detection message and send it to the spare board. If the health data does not exceed the health threshold, at this time, the detection module generates a first detection message and sends it to the spare board.
[0053] Furthermore, the first detection message also includes the health data of the board, the slot number of the board, the slot number of the mainboard to which the board belongs, and the running time of the board as the mainboard. The mainboard sends the above information to the standby board, and then obtains the information corresponding to the standby board, so that the mainboard can understand the running status of the standby board.
[0054] The above information can be obtained by the detection module from the driving module.
[0055] Step 120: Receive a first response message sent by the standby board according to the first role information, where the first response message includes the second role information of the standby board.
[0056] Specifically, according to the description of step 120, after receiving the first detection message, the standby board obtains the first role information from it. According to the first role information, the standby board obtains its own second role information and generates a first response message. The first response message includes the second role information of the standby board.
[0057] The standby board sends a first response message to the main board.
[0058] In the embodiment of the present application, the second role information obtained by the standby board is specifically the master device.
[0059] Furthermore, in the embodiment of the present application, the standby board also includes a detection module and a driving module. The functions of the above two modules are the same as those of the detection module and the driving module included in the main board, and are not described in detail here.
[0060] For example, after the standby board is powered on, the detection module is initialized. The detection module records the role information of the board and the slot number of the mainboard to which the board belongs, for example, master device, slot02. At the same time, the detection module obtains the hardware-related information of the board from the driver module. The hardware-related information includes the slot number of the mainboard to which the board belongs and the in-place indication of the board.
[0061] After receiving the first detection message, the detection module in the standby board obtains the first role information therefrom. According to the first role information, the detection module obtains the role information of the board from the local or driver module. For example, the second role information, which can be specifically the main device. The detection module generates a first response message and sends it to the main board.
[0062] The detection module in the mainboard receives the first response message.
[0063] Furthermore, the first response message also includes the health data of the board, the slot number of the board, the slot number of the mainboard to which the board belongs, and the running time of the board as the mainboard. The standby board sends the above information to the mainboard, so that the mainboard can obtain the above information to facilitate the mainboard to understand the running status of the standby board.
[0064] The above information can be obtained by the detection module from the driving module.
[0065] Step 130: When it is determined according to the first role information and the second role information that a suspected conflict between the roles of the master and standby boards occurs in the first frame, a second detection message is sent to the standby board, where the second detection message includes the first role information.
[0066] Specifically, according to the description of step 120, after receiving the first response message, the mainboard obtains the second role information therefrom. Since the first role information is the master device, the second role information is also the master device, therefore, the mainboard determines that there is a suspected conflict between the master and standby board roles in the first frame based on the first role information and the second role information.
[0067] The main board sends a second detection message to the standby board again, where the second detection message includes the first role information. The second detection message and the first detection message may be the same message.
[0068] It is understandable that since the main board sends the detection message for the first time and receives the response message sent by the standby board, in this step, the main board does not first determine whether a master-slave board role conflict has occurred in the first frame. After multiple verifications, the main board then determines whether a master-slave board role conflict has occurred in the first frame to avoid false alarms.
[0069] Furthermore, since the mainboard determines that a suspected conflict in the roles of the primary and standby boards occurs in the first frame, the mainboard will shorten the period for sending the second detection message to determine as soon as possible whether a conflict in the roles of the primary and standby boards has occurred in the first frame.
[0070] A timer is set in the main board, and the time of the timer is different from the timing time set by the main board in step 110. For example, the time is 1 second, that is, the main board sends the second detection message to the standby board every 1 second, and the second period is 1 second.
[0071] Furthermore, in this step, the detection module in the mainboard determines that a suspected conflict between the roles of the primary and standby boards occurs in the first frame according to the first role information and the second role information. The detection module generates and sends a second detection message to the standby board again.
[0072] Step 140: Receive a second response message sent by the standby board according to the first role information, where the second response message includes the second role information.
[0073] Specifically, according to the description of step 130, after receiving the second detection message, the standby board obtains the first role information from it. According to the first role information, the standby board obtains its own second role information again and generates a second response message. The second response message includes the second role information of the standby board.
[0074] The standby board sends a second response message to the main board.
[0075] In the embodiment of the present application, the second role information obtained by the standby board is specifically the master device.
[0076] Further, after receiving the second detection message, the detection module in the standby board obtains the first role information therefrom. Based on the first role information, the detection module again obtains the role information of the board from the local or driver module. For example, the second role information, which may be specifically the main device. The detection module generates a second response message and sends it to the main board.
[0077] The detection module in the mainboard receives the second response message.
[0078] Step 150: When the second role information included in the second response message is the same as the second role information included in the first response message, it is determined that a master and slave board role conflict has occurred in the first frame, and corresponding processing is performed on the master and slave boards.
[0079] Specifically, according to the description of step 140, after receiving the second response message, the mainboard obtains the second role information therefrom. Since the first role information is the master device, the second role information is also the master device, and the second role information included in the second response message is the same as the second role information included in the first response message, the mainboard determines that a master-slave board role conflict has occurred in the first frame.
[0080] Since a role conflict between the master and standby boards has occurred in the first frame, the main board performs corresponding processing on itself and the standby board.
[0081] It can be understood that after the main board sends detection messages multiple times and receives response messages sent by the standby board, and the role information included in the multiple response messages sent by the standby board is the same as the role information of the main board itself, the main board determines that a role conflict between the main and standby boards has occurred in the frame.
[0082] Furthermore, in this step, the detection module in the mainboard determines that a role conflict between the master and standby boards has occurred in the first frame according to the second role information included in the second response message and the second role information included in the first response message.
[0083] Furthermore, in this step, the detection module can also determine whether a role conflict between the master and standby boards occurs in the first frame according to the multiple information.
[0084] The detection module determines whether the health data of the standby board exceeds the health data of the main board; if it exceeds, the detection module determines whether the running time after identifying the standby board as the main board is not 0; if it is not 0, the detection module determines whether there is already a main board in the slot indicated by the slot number based on the slot number of the main board to which the board sent by the standby board belongs; if the main board is in the slot indicated by the slot number, it is determined that the standby board has been upgraded to the main board, and a master-standby board role conflict occurs in the first frame.
[0085] In the above steps, the mainboard sends detection messages twice to determine that the active and standby board roles have been restarted in the first frame. In actual applications, the number of times the mainboard sends detection messages is not limited to twice and can be determined according to the current network environment.
[0086] In the above steps, the main board and the standby board can exchange detection and response messages with each other through the mbus channel.
[0087] Therefore, by applying the detection method provided in the present application, the main board sends a first detection message to the standby board, and the first detection message includes the first role information of the main board; the main board receives a first response message sent by the standby board based on the first role information, and the first response message includes the second role information of the standby board; when it is determined that a suspected conflict in the roles of the master and standby boards occurs in the first frame based on the first role information and the second role information, the main board sends a second detection message to the standby board, and the second detection message includes the first role information; the main board receives a second response message sent by the standby board based on the first role information, and the second response message includes the second role information; when the second role information included in the second response message is the same as the second role information included in the first response message, the main board determines that a conflict in the roles of the master and standby boards has occurred in the first frame, and performs corresponding processing on the master and standby boards.
[0088] In this way, the master and slave boards can interactively detect and respond to messages at the software level to determine whether there is a role conflict between the master and slave boards in the frame. This solves the problem that the system in the frame cannot detect the dual-master and dual-standby status of the boards through software and hardware, which seriously affects the business functions. It realizes the timely detection and resolution of the role conflict between the master and slave boards, ensuring the normal operation of the system and reducing hidden dangers.
[0089] Optionally, in step 150 of the embodiment of the present application, the main board performs corresponding processing on the main and standby boards as follows:
[0090] Specifically, the main board generates a first notification message and sends the first notification message to the standby board through the mbus channel. After receiving the first notification message, the standby board upgrades itself to a new main board. At the same time, the standby board generates a first isolation message, and sends the first isolation message to other boards in the first frame except the original main board. After receiving the first isolation message, other boards shield subsequent messages sent by the original main board, so that the original main board forms an island to avoid interfering with other parts of the system.
[0091] The motherboard reboots itself.
[0092] Furthermore, the detection module in the main board generates a first notification message and sends the first notification message to the standby board through the mbus channel. After receiving the first notification message, the detection module in the standby board upgrades its own board to the main board and notifies the driver module in the standby board to perform an isolation operation. The driver module generates a first isolation message and sends the first isolation message to other boards in the first frame.
[0093] The detection method provided in the examples of the present application is described in detail below. Figure 2 , Figure 2 A flow chart of another detection method provided in an embodiment of the present application. The method is applied to a spare board, and the detection method provided in an embodiment of the present application may include the following steps.
[0094] Step 210: Receive a first detection message sent by the mainboard, where the first detection message includes first role information of the mainboard.
[0095] Specifically, the mainboard is in a first frame, and the first frame also includes a standby board. The mainboard generates a first detection message, and the first detection message includes first role information of the mainboard. The first role information can specifically be a master device.
[0096] The main board sends a first detection message to the standby board.
[0097] After receiving the first detection message, the standby board obtains the first role information therefrom.
[0098] Further, in the embodiment of the present application, the sending of the first detection message by the main board to the standby board may be triggered at different times, which has been described in detail in the above embodiment and will not be repeated here.
[0099] Furthermore, in the embodiment of the present application, the standby board includes a detection module and a driving module. The functions of the above two modules are the same as those of the detection module and the driving module included in the main board, and are not described in detail here.
[0100] For example, after the standby board is powered on, the detection module is initialized. The detection module records the role information of the board and the slot number of the mainboard to which the board belongs, for example, master device, slot02. At the same time, the detection module obtains the hardware-related information of the board from the driver module. The hardware-related information includes the slot number of the mainboard to which the board belongs and the in-place indication of the board.
[0101] After receiving the first detection message, the detection module in the standby board obtains the first role information therefrom.
[0102] Furthermore, the first detection message also includes the health data of the board, the slot number of the board, the slot number of the mainboard to which the board belongs, and the running time of the board as the mainboard. The mainboard sends the above information to the standby board, and then obtains the information corresponding to the standby board, so that the mainboard can understand the running status of the standby board.
[0103] The above information can be obtained by the detection module in the mainboard from the driver module in the mainboard.
[0104] Step 220: Acquire the second role information of the standby board according to the first role information.
[0105] Specifically, according to the description of step 210, after the standby board obtains the first role information, it obtains its own second role information according to the first role information.
[0106] Further, after receiving the first detection message, the detection module in the standby board obtains the first role information from it. According to the first role information, the detection module obtains the role information of the board from the local or driver module. For example, the second role information, the second role information can be specifically the master device.
[0107] Step 230: Send a first response message to the main board, where the first response message includes the second role information of the standby board.
[0108] Specifically, according to the description of step 220, after the standby board obtains its own second role information, it generates a first response message, and the first response message includes the second role information of the standby board.
[0109] The standby board sends a first response message to the main board.
[0110] Furthermore, the detection module generates a first response message and sends it to the main board.
[0111] In the embodiment of the present application, the first response message also includes the health data of the board, the slot number of the board, the slot number of the mainboard to which the board belongs, and the running time of the board as the mainboard. The standby board sends the above information to the mainboard, so that the mainboard obtains the above information, so that the mainboard can understand the running status of the standby board.
[0112] The above information can be obtained by the detection module from the driving module.
[0113] Step 240: Receive a second detection message sent by the mainboard, where the second detection message includes the first role information of the mainboard.
[0114] Specifically, according to the description of step 230, after receiving the first response message, the mainboard obtains the second role information therefrom. Since the first role information is the master device, the second role information is also the master device, therefore, the mainboard determines that there is a suspected conflict between the master and standby board roles in the first frame based on the first role information and the second role information.
[0115] The main board sends a second detection message to the standby board again, where the second detection message includes the first role information. The second detection message and the first detection message may be the same message.
[0116] After receiving the second detection message, the standby board obtains the first role information therefrom.
[0117] It is understandable that since the main board sends the detection message for the first time and receives the response message sent by the standby board, in this step, the main board does not first determine whether a master-slave board role conflict has occurred in the first frame. After multiple verifications, the main board then determines whether a master-slave board role conflict has occurred in the first frame to avoid false alarms.
[0118] Furthermore, since the mainboard determines that a suspected conflict of the roles of the master and standby boards has occurred in the first frame, at this time, the period of the mainboard sending the second detection message will be shortened to determine as soon as possible whether a conflict of the roles of the master and standby boards has occurred in the first frame. For example, the period of the mainboard sending the first detection message is 1 minute, and the period of the mainboard sending the second detection message is 1 second.
[0119] Furthermore, in this step, the detection module in the mainboard determines that a suspected conflict between the roles of the primary and standby boards occurs in the first frame according to the first role information and the second role information. The detection module generates and sends a second detection message to the standby board again.
[0120] After receiving the second detection message, the detection module in the standby board obtains the first role information therefrom.
[0121] Step 250: Send a second response message to the main board, where the second response message includes the second role information of the standby board.
[0122] Specifically, according to the description of step 240, after the standby board obtains the first role information, it obtains its second role information again according to the first role information and generates a second response message. The second response message includes the second role information of the standby board.
[0123] The standby board sends a second response message to the main board.
[0124] In the embodiment of the present application, the second role information obtained by the standby board is specifically the master device.
[0125] Further, after receiving the second detection message, the detection module in the standby board obtains the first role information therefrom. Based on the first role information, the detection module again obtains the role information of the board from the local or driver module. For example, the second role information, which may be specifically the main device. The detection module generates a second response message and sends it to the main board.
[0126] The detection module in the mainboard receives the second response message.
[0127] It is understandable that after the mainboard receives the second response message, the processing of the second response message can refer to the description of step 150 in the above embodiment, which will not be repeated here.
[0128] In an embodiment of the present application, the mainboard determines that a master-slave board role conflict has occurred in the first frame by sending detection messages twice. In actual applications, the number of times the mainboard sends detection messages is not limited to twice and can be determined according to the current network environment.
[0129] The main board and the standby board can interact with each other through the mbus channel to detect and respond to messages.
[0130] Therefore, by applying the detection method provided in the present application, the main board sends a first detection message to the standby board, and the first detection message includes the first role information of the main board; the main board receives a first response message sent by the standby board based on the first role information, and the first response message includes the second role information of the standby board; when it is determined that a suspected conflict in the roles of the master and standby boards occurs in the first frame based on the first role information and the second role information, the main board sends a second detection message to the standby board, and the second detection message includes the first role information; the main board receives a second response message sent by the standby board based on the first role information, and the second response message includes the second role information; when the second role information included in the second response message is the same as the second role information included in the first response message, the main board determines that a conflict in the roles of the master and standby boards has occurred in the first frame, and performs corresponding processing on the master and standby boards.
[0131] In this way, the master and slave boards can interactively detect and respond to messages at the software level to determine whether there is a role conflict between the master and slave boards in the frame. This solves the problem that the system in the frame cannot detect the dual-master and dual-standby status of the boards through software and hardware, which seriously affects the business functions. It realizes the timely detection and resolution of the role conflict between the master and slave boards, ensuring the normal operation of the system and reducing hidden dangers.
[0132] Optionally, the embodiment of the present application also includes a process in which after the mainboard determines that a role conflict between a primary and a standby board has occurred in the first frame, the mainboard restarts itself and sends a notification message to the standby board.
[0133] Specifically, the main board generates a first notification message and sends it to the spare board through the mbus channel. The main board restarts itself and downgrades to a new spare board. After receiving the first notification message, the spare board upgrades itself to a new main board. The new main board generates a first isolation message and sends the first isolation message to other boards in the first frame except the new spare board. After receiving the first isolation message, other boards shield subsequent messages sent by the original main board so that the original main board forms an island to avoid interfering with other parts of the system.
[0134] Furthermore, the detection module in the main board generates a first notification message and sends the first notification message to the standby board through the mbus channel. After receiving the first notification message, the detection module in the standby board upgrades its own board to the main board and notifies the driver module in the standby board to perform an isolation operation. The driver module generates a first isolation message and sends the first isolation message to other boards in the first frame.
[0135] Optionally, in the embodiment of the present application, the process further includes sending a notification to the standby board after the first frame senses that the main board is separated from the first frame.
[0136] Specifically, when the hardware system in the first frame senses that the mainboard is separated from the first frame, the hardware system in the first frame reports the mainboard separation event to the software platform in the first frame. The software platform closes the communication channel of the mainboard, and at the same time, the software platform generates a first notification message and sends a second notification message to the standby board. After receiving the first notification message, the standby board determines that the mainboard has separated from the first frame according to the first notification message. The standby board upgrades itself to a new mainboard.
[0137] The new mainboard generates a second isolation message and sends the second isolation message to other boards except the original mainboard in the first frame. After receiving the second isolation message, other boards shield subsequent messages sent by the original mainboard, so that the original mainboard forms an island to avoid interfering with other parts of the system.
[0138] Furthermore, the hardware system in the first frame can detect the plug-in status of each board, and the hardware system updates the in-place indication of each board according to the plug-in status of each board.
[0139] After receiving the second notification message, the detection module in the standby board determines that the mainboard has been separated from the first frame according to the second notification message. The detection module upgrades itself to a new mainboard and generates a second isolation message. The detection module sends the second isolation message to other boards except the original mainboard in the first frame. After receiving the second isolation message, other boards shield subsequent messages sent by the original mainboard, so that the original mainboard forms an island to avoid interfering with other parts of the system.
[0140] Optionally, after the main board is restarted, the new main board also performs a process of releasing the isolation operation.
[0141] Specifically, when the main board is restarted, the main board is downgraded to the new standby board, and the standby board is upgraded to the new main board. The new main board detects whether its current version is the same as the current version of the new standby board. The new main board and the new standby board can exchange query messages through the mbus channel to clarify whether their current versions are the same as the current version of the other end.
[0142] If they are the same, the new main board sends a release isolation message to other boards in the first frame except the new standby board.
[0143] Furthermore, the new mainboard also includes a version checking module. The version checking module in the new mainboard obtains the configured version information from the local. The new standby board also includes a version checking module. After the new standby board is restarted, the version checking module in the new standby board obtains the configured version information from the local.
[0144] The version check module in the new main board sends a query message to the new standby board through the mbus channel. The query message may include the version information of the new main board configuration, so that the new standby board can feedback its current version. After the version check module in the new standby board obtains the version information of its own configuration, it sends a response message to the new main board. The response message includes the version information of the new standby board configuration.
[0145] After the version check module in the new main board obtains the current version of the new standby board configuration, it compares it with its own current version. If they are the same, the version check module generates a release isolation message and sends it to other boards in the first frame through the mbus channel.
[0146] Optionally, after the mainboard is restarted, the new mainboard also performs a process of comparing the current health data of the new main and standby boards.
[0147] Specifically, when the main board is restarted, the main board is downgraded to a new standby board, and the standby board is upgraded to a new main board. The new main board checks its own current health status and the current health status of the new standby board.
[0148] If the current health data of the new standby board exceeds the current health data of the new main board, the new main board generates a second notification message and sends the second notification message to the new standby board. After receiving the second notification message, the new standby board upgrades itself to the main board.
[0149] The new main board is downgraded to a spare board.
[0150] If the current health data of the new standby board does not exceed the current health data of the new main board, the new main board maintains the role of the current main board.
[0151] It should be noted that, depending on the characteristics of different products, the active / standby role switch may not be triggered by comparing health data. For example, the user may be prompted to switch between active and standby roles by printing a log, or a customized switching method may be used to switch between active and standby roles (for example, the active / standby role switch is performed after the new standby board is restarted).
[0152] Furthermore, after the new standby board is restarted, the detection module in the new standby board is initialized. The detection module records the role information of the board and the slot number of the motherboard to which the board belongs, for example, standby device, slot02. At the same time, the detection module obtains the hardware related information of the board from the driver module.
[0153] Furthermore, the detection module also obtains the health data of the board from the driver module. After the new main board senses that the new standby board is restarted and inserted into the first frame, the new main board can interact with the new standby board through the mbus channel to detect and respond to messages, thereby obtaining the current health data of the new standby board. The process of interactive detection and response messages between the new main and standby boards is similar to steps 210 to 250 in the embodiment, and will not be repeated here.
[0154] After the detection module obtains the current health data of the new standby board, it compares its own current health data with the current health data of the new standby board. If its own current health data exceeds the current health data of the new standby board, the detection module maintains the current main board role.
[0155] If the current health data of the detection module itself does not exceed the current health data of the new standby board, the detection module generates a second notification message and sends the second notification message to the new standby board. At the same time, the detection module downgrades itself to a standby board.
[0156] After receiving the second notification message, the new standby board upgrades itself to the main board according to the second notification message.
[0157] Based on the same inventive concept, the present application also provides a detection device corresponding to the detection method. Figure 3 , Figure 3 A structural diagram of a detection device provided in an embodiment of the present application. The device is applied to a main board, the main board is in a first frame, the first frame also includes a spare board, and the device includes:
[0158] A sending unit 310 is configured to send a first detection message to the standby board, where the first detection message includes first role information of the main board;
[0159] The receiving unit 320 is configured to receive a first response message sent by the standby board according to the first role information, wherein the first response message includes the second role information of the standby board;
[0160] The sending unit 310 is further configured to, when it is determined according to the first role information and the second role information that a suspected conflict between the roles of the master and standby boards occurs in the first frame, send a second detection message to the standby board, wherein the second detection message includes the first role information;
[0161] The receiving unit 320 is further configured to receive a second response message sent by the standby board according to the first role information, where the second response message includes the second role information;
[0162] The processing unit 330 is used to determine that a master and slave board role conflict has occurred in the first frame when the second role information included in the second response message is the same as the second role information included in the first response message, and perform corresponding processing on the master and slave boards.
[0163] Optionally, the sending unit 310 is specifically configured to send the first detection message to the standby board according to a configured first period;
[0164] The sending unit 310 is specifically configured to send the second detection message to the standby board according to the configured second cycle;
[0165] The first period is greater than the second period.
[0166] Optionally, the sending unit 310 is specifically configured to send the first detection message to the standby board when it is detected that the main board is downgraded to a standby board;
[0167] or,
[0168] When a change in the health status of the main board is detected, the first detection message is sent to the standby board.
[0169] Optionally, the sending unit 310 is further used to send a first notification message to the standby board, so that the standby board is upgraded to a new main board according to the first notification message and sends a first isolation message to other boards except the main board in the first frame.
[0170] The processing unit 330 is specifically used to restart the mainboard;
[0171] Based on the same inventive concept, the present application also provides a detection device corresponding to the detection method. Figure 4 , Figure 4 Another structural diagram of a detection device provided in an embodiment of the present application. The device is applied to a spare board, the spare board is in a first frame, the first frame also includes a main board, and the device includes:
[0172] The receiving unit 410 is configured to receive a first detection message sent by the mainboard, where the first detection message includes first role information of the mainboard;
[0173] An acquiring unit 420, configured to acquire second role information of the standby board according to the first role information;
[0174] A sending unit 430, configured to send a first response message to the main board, wherein the first response message includes the second role information of the standby board;
[0175] The receiving unit 410 is further configured to receive a second detection message sent by the mainboard, where the second detection message includes the first role information of the mainboard;
[0176] The sending unit 430 is further configured to send a second response message to the main board, where the second response message includes the second role information of the standby board.
[0177] Optionally, the receiving unit 410 is further configured to receive a first notification message sent by the first in-frame software platform;
[0178] The device further includes: an upgrading unit (not shown in the figure), configured to upgrade to a new mainboard according to the first notification message;
[0179] The sending unit 430 is further configured to send an isolation message to other boards except the main board in the first frame.
[0180] Optionally, when the main board is restarted, the main board is downgraded to a new standby board;
[0181] The device further includes: a first detection unit (not shown in the figure), configured to detect whether the current version of the new spare board is the same as the current version of the new main board;
[0182] The sending unit 430 is further configured to, if the two boards are the same, send a release isolation message to other boards in the first frame except the new standby board.
[0183] Optionally, when the main board is restarted, the main board is downgraded to a new standby board; the device further includes:
[0184] A second detection unit (not shown in the figure), used to check the current health status of the new standby board;
[0185] The sending unit 430 is further configured to send a second notification message to the new standby board if the current health data of the new standby board exceeds the current health data of the new main board, so that the new standby board is upgraded to the main board;
[0186] A downgrading unit (not shown in the figure), used to downgrade the new main board to a spare board;
[0187] The sending unit 430 is further configured to maintain the current main board role if the current health data of the new standby board does not exceed the current health data of the new main board.
[0188] Therefore, by applying the detection device provided in the present application, the main board sends a first detection message to the standby board, and the first detection message includes the first role information of the main board; the main board receives a first response message sent by the standby board according to the first role information, and the first response message includes the second role information of the standby board; when it is determined that a suspected conflict between the roles of the master and standby boards occurs in the first frame according to the first role information and the second role information, the main board sends a second detection message to the standby board, and the second detection message includes the first role information; the main board receives a second response message sent by the standby board according to the first role information, and the second response message includes the second role information; when the second role information included in the second response message is the same as the second role information included in the first response message, the main board determines that a conflict between the roles of the master and standby boards has occurred in the first frame, and performs corresponding processing on the master and standby boards.
[0189] In this way, the master and slave boards can interactively detect and respond to messages at the software level to determine whether there is a role conflict between the master and slave boards in the frame. This solves the problem that the system in the frame cannot detect the dual-master and dual-standby status of the boards through software and hardware, which seriously affects the business functions. It realizes the timely detection and resolution of the role conflict between the master and slave boards, ensuring the normal operation of the system and reducing hidden dangers.
[0190] Based on the same inventive concept, the embodiment of the present application also provides a network device, such as Figure 5 As shown, it includes a processor 510, a transceiver 520 and a machine-readable storage medium 530, the machine-readable storage medium 530 stores machine-executable instructions that can be executed by the processor 510, and the processor 510 is prompted by the machine-executable instructions to execute the detection method provided in the embodiment of the present application. Figure 3 , Figure 4 The detection device shown can be used as follows Figure 5 The network device hardware structure shown is implemented.
[0191] The computer-readable storage medium 530 may include a random access memory (RAM) or a non-volatile memory (NVM), such as at least one disk storage. Optionally, the computer-readable storage medium 530 may also be at least one storage device located away from the processor 510.
[0192] The processor 510 may be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it may also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components.
[0193] In the embodiment of the present application, the processor 510 reads the machine executable instructions stored in the machine readable storage medium 530, and the machine executable instructions enable the processor 510 itself and the transceiver 520 to execute the detection method described in the aforementioned embodiment of the present application.
[0194] In addition, an embodiment of the present application provides a machine-readable storage medium 530, which stores machine-executable instructions. When called and executed by the processor 510, the machine-executable instructions prompt the processor 510 itself and the calling transceiver 520 to execute the detection method described in the aforementioned embodiment of the present application.
[0195] The implementation process of the functions and effects of each unit in the above-mentioned device is specifically described in the implementation process of the corresponding steps in the above-mentioned method, and will not be repeated here.
[0196] For the device embodiment, since it basically corresponds to the method embodiment, the relevant parts can refer to the partial description of the method embodiment. The device embodiment described above is only schematic, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the present application scheme. A person of ordinary skill in the art can understand and implement it without paying any creative work.
[0197] As for the detection device and machine-readable storage medium embodiments, since the method contents involved are basically similar to the aforementioned method embodiments, the description is relatively simple, and the relevant parts may refer to the partial description of the method embodiments.
[0198] The above description is only a preferred embodiment of the present application and is not intended to limit the present application. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application shall be included in the scope of protection of the present application.
Claims
1. A detection method, characterized in that: The method is applied to a mainboard, the mainboard is in a first frame, the first frame also includes a spare board, and the method includes: Sending a first detection message to the standby board, where the first detection message includes first role information of the main board; receiving a first response message sent by the standby board according to the first role information, wherein the first response message includes the second role information of the standby board; When it is determined according to the first role information and the second role information that a suspected conflict occurs between the roles of the master and standby boards in the first frame, a second detection message is sent to the standby board, where the second detection message includes the first role information; receiving a second response message sent by the standby board according to the first role information, where the second response message includes the second role information; When the second role information included in the second response message is the same as the second role information included in the first response message, it is determined that a master and standby board role conflict has occurred in the first frame, and the master and standby boards are processed accordingly; The main board includes a first detection module and a first driver module, the first detection module records the first role information of the main board, and the first driver module is the hardware system of the main board; the spare board includes a second detection module and a second driver module, the second detection module records the second role information of the spare board, and the second driver module is the hardware system of the spare board.
2. The method according to claim 1, characterized in that The sending a first detection message to the standby board specifically includes: Sending the first detection message to the standby board according to the configured first cycle; The second detection message is sent to the standby board, specifically: Sending the second detection message to the standby board according to the configured second period; The first period is greater than the second period.
3. The method according to claim 1, characterized in that: The sending a first detection message to the standby board specifically includes: When it is detected that the main board is downgraded to a standby board, sending the first detection message to the standby board; or, When a change in the health status of the main board is detected, the first detection message is sent to the standby board.
4. The method according to claim 1, characterized in that: The corresponding processing of the main and standby boards specifically includes: Sending a first notification message to the standby board, so that the standby board is upgraded to a new main board according to the first notification message and sending a first isolation message to other boards except the main board in the first frame; Restart the mainboard.
5. A detection method, characterized in that: The method is applied to a spare board, the spare board is in a first frame, the first frame also includes a main board, and the method includes: receiving a first detection message sent by the mainboard, wherein the first detection message includes first role information of the mainboard; According to the first role information, obtaining the second role information of the standby board; Sending a first response message to the main board, where the first response message includes the second role information of the standby board; receiving a second detection message sent by the mainboard, wherein the second detection message includes the first role information of the mainboard; Sending a second response message to the main board, where the second response message includes the second role information of the standby board; The main board includes a first detection module and a first driver module, the first detection module records the first role information of the main board, and the first driver module is the hardware system of the main board; the spare board includes a second detection module and a second driver module, the second detection module records the second role information of the spare board, and the second driver module is the hardware system of the spare board.
6. The method according to claim 5, characterized in that The method further comprises: Receiving a first notification message sent by the first in-frame software platform; According to the first notification message, upgrade to a new motherboard; An isolation message is sent to other boards except the main board in the first frame.
7. The method according to claim 6, characterized in that When the main board is restarted, the main board is downgraded to a new spare board; The method further comprises: Detecting whether the current version of the new standby board is the same as the current version of the new main board; If they are the same, a message for releasing isolation is sent to other boards in the first frame except the new standby board.
8. The method according to claim 6, characterized in that When the main board is restarted, the main board is downgraded to a new standby board; the method further includes: Checking the current health status of the new standby board; If the current health data of the new standby board exceeds the current health data of the new main board, sending a second notification message to the new standby board so that the new standby board is upgraded to the main board; Downgrading the new main board to a spare board; If the current health data of the new standby board does not exceed the current health data of the new main board, the current main board role is maintained.
9. A detection device, characterized in that: The device is applied to a main board, the main board is in a first frame, the first frame also includes a spare board, and the device includes: A sending unit, configured to send a first detection message to the standby board, wherein the first detection message includes first role information of the main board; A receiving unit, configured to receive a first response message sent by the standby board according to the first role information, wherein the first response message includes the second role information of the standby board; The sending unit is further configured to, when it is determined according to the first role information and the second role information that a suspected conflict of roles of a master and a standby board occurs in the first frame, send a second detection message to the standby board, wherein the second detection message includes the first role information; The receiving unit is further used to receive a second response message sent by the standby board according to the first role information, where the second response message includes the second role information; a processing unit, configured to determine that a master and standby board role conflict has occurred in the first frame when the second role information included in the second response message is the same as the second role information included in the first response message, and perform corresponding processing on the master and standby boards; The main board includes a first detection module and a first driver module, the first detection module records the first role information of the main board, and the first driver module is the hardware system of the main board; the spare board includes a second detection module and a second driver module, the second detection module records the second role information of the spare board, and the second driver module is the hardware system of the spare board.
10. A detection device, characterized in that: The device is applied to a spare board, the spare board is in a first frame, the first frame also includes a main board, and the device includes: A receiving unit, configured to receive a first detection message sent by the mainboard, wherein the first detection message includes first role information of the mainboard; an acquiring unit, configured to acquire second role information of the standby board according to the first role information; A sending unit, configured to send a first response message to the main board, wherein the first response message includes the second role information of the standby board; The receiving unit is further used to receive a second detection message sent by the mainboard, where the second detection message includes the first role information of the mainboard; The sending unit is further used to send a second response message to the main board, where the second response message includes the second role information of the standby board; The main board includes a first detection module and a first driver module, the first detection module records the first role information of the main board, and the first driver module is the hardware system of the main board; the spare board includes a second detection module and a second driver module, the second detection module records the second role information of the spare board, and the second driver module is the hardware system of the spare board.
Citation Information
Patent Citations
Method, system and device for data detection of main and spare plate
CN101110608A
Apparatus and method for realizing main and spare plate card rearrange
CN101232357A
Master and slave test groove collision detection method and circuit
CN101552709A
Method for realizing configuration of main and auxiliary board cards as well as board cards
CN101938417A
Method for detecting multiple active equipment conflict and apparatus thereof
CN102457402A