Equipment system, main / standby switching method thereof and electronic equipment
By using programmable logic devices on the control board of the dual-node server, we can judge whether the main and standby switching conditions are met based on the target signal of the device node, and realize fast main and standby switching through hard interrupt signals, solving the problem of long main and standby switching in the existing technology, ensuring the real-time service and the stability of the system.
Patent Information
- Application Number
- CN202411748941.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-30
- Publication Date
- 2025-03-11
AI Technical Summary
The existing two-node servers need to go through complex detection and judgment processes during the main and backup switching, resulting in a long switching time and cannot meet some business scenarios with high requirements for real-time performance.
By using programmable logic devices on the control board, the target signals (such as heartbeat signals or soft interrupt signals) transmitted by device nodes on the device system are obtained and based on these signals, determine whether the preset master-subsidiary switching conditions are met. If the condition is met, a hard interrupt signal is generated and transmitted to another device node to notify the main and standby switching operation to be triggered soon, and the main and standby switching operation is performed after the hard interrupt signal is transmitted.
Through fast hard interrupt signal processing, the rapid efficiency of master-stop switching is achieved, ensuring business continuity and stable system operation.
Smart Images

Figure CN119597708A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to a device system and a master-standby switching method thereof, and electronic equipment. Background Art
[0002] With the rapid development of information technology, servers are increasingly used in various fields. In some key business scenarios, the reliability and availability of servers are extremely high. Once a single-node server fails, it may cause business interruption and bring huge losses to users. In order to improve the reliability and availability of servers, dual-node servers came into being. Dual-node servers are usually composed of two independent device nodes, which work together through certain technical means. Under normal circumstances, the two nodes can share the business load and improve the performance of the server; when one node fails, the other node can automatically take over the business of the failed node to ensure business continuity.
[0003] Existing dual-node servers usually need to go through a series of complex detection and judgment processes when performing active-standby switching, which will result in a long switching time. In some business scenarios with high real-time requirements, the long switching time may cause business interruption and cause losses to users.
[0004] It can be seen that how to improve the efficiency of active / standby switching is a problem that needs to be solved by those skilled in the art. Summary of the invention
[0005] The purpose of the embodiment of the present invention is to provide a device system and a method for active / standby switching thereof, and an electronic device, so as to improve the efficiency of active / standby switching. The specific scheme is as follows:
[0006] In a first aspect, the present invention discloses a primary-standby switching method, which is applied to a programmable logic device on a control board, comprising:
[0007] Acquire a target signal transmitted by a first device node on the device system; the first device node is a master device node or a slave device node, and the target signal is a heartbeat signal of the device node or a soft interrupt signal triggered by the device node;
[0008] Determining whether a preset active / standby switching condition is currently met based on the target signal;
[0009] If the preset active-standby switching condition is currently met, a first hard interrupt signal is generated, and the first hard interrupt signal is transmitted to a second device node to notify the second device node that an active-standby switching operation is about to be triggered; the second device node is a device node in an active-standby relationship with the first device node;
[0010] After the hard interrupt signal is transmitted to the second device node, a master-slave switching operation is performed between the first device node and the second device node.
[0011] Optionally, the active / standby switching method further includes:
[0012] During the initial startup of the device system, a low-level signal is transmitted to any device node in the device system through the pull-down resistor of the control board, so that the device node receiving the low-level signal determines its own role as the initial master device node; and a high-level signal is transmitted to any device node in the device system through the pull-up resistor of the control board, so that the device node receiving the high-level signal determines its own role as the initial slave device node.
[0013] Optionally, after transmitting the low-level signal to any device node in the device system through the pull-down resistor of the control board, the method further includes:
[0014] Recording the startup time of the device node that receives the low level signal transmitted by the pull-down resistor;
[0015] If the time interval between the current time and the start time is not equal to the preset delayed start interval, then starting other device nodes is prohibited, and if the first single board state position of the device node receiving the low level signal is a normal position and the second single board state position of other device nodes is an abnormal position, then the device node receiving the low level signal is determined to be the initial master device node;
[0016] If the time interval between the current time and the start time is equal to the preset delayed start interval, other device nodes are started. If the first single board status position and the second single board status position of other device nodes are both normal positions, other device nodes are determined to be initial slave device nodes.
[0017] Optionally, obtaining a heartbeat signal transmitted by a first device node on the device system includes:
[0018] Acquire a heartbeat signal transmitted by the first device node, obtained by superimposing a type-encoded signal and an operation status-encoded signal according to different frequencies;
[0019] The type-encoded signal and the running status-encoded signal are signals obtained by respectively encoding the local hardware type signal and the hardware running status signal by the first device node according to different frequencies;
[0020] Accordingly, determining whether a preset active / standby switching condition is currently met based on the target signal includes:
[0021] parsing the heartbeat signal using different parsing clocks to obtain a status notification signal including the hardware operating status corresponding to each hardware type in the first device node;
[0022] Sending the status notification signal to the second device node, and determining whether a first preset active-standby switching condition is currently met based on the status notification signal;
[0023] The first preset active-standby switching condition is that the status notification signal indicates that the hardware operating status of the first device node meets a preset fault condition.
[0024] Optionally, the active / standby switching method further includes:
[0025] If a second hard interrupt signal transmitted by the first device node is received, detecting whether the status notification signal corresponding to the first device node meets a preset control right acquisition condition; wherein the second hard interrupt signal represents a request for acquiring control right of a common component triggered by the first device node;
[0026] If the state notification signal corresponding to the first device node satisfies the preset control right acquisition condition, disconnecting the path between the second device node and the common component, and establishing the path between the first device node and the common component;
[0027] A third hard interrupt signal is sent to the first device node and the second device node, wherein the third hard interrupt signal indicates that the control right of the common component belongs to the first device node.
[0028] Optionally, if the target signal is a soft interrupt signal, determining whether a preset active / standby switching condition is currently met based on the target signal includes:
[0029] Based on the soft interrupt signal, determine whether a second preset active-standby switching condition is currently met; wherein the second preset active-standby switching condition is that the soft interrupt signal indicates that the first device node triggers an active-standby switching request.
[0030] Optionally, the active / standby switching method further includes:
[0031] Monitor whether the number of current business processing requests from the client is greater than a preset threshold;
[0032] If the number of the current service processing requests is greater than the preset threshold, a fourth hard interrupt signal is generated, and the fourth hard interrupt signal is sent to the first device node and the second device node to notify the first device node and the second device node that a dual-master switching operation is about to be triggered;
[0033] After transmitting the fourth hard interrupt signal to the first device node and the second device node, an operation of switching both the first device node and the second device node to master device nodes is performed so that each of the master device nodes processes the current service processing request.
[0034] Optionally, before performing the master-slave switchover operation between the first device node and the second device node, the method further includes:
[0035] Determine a current master device node and a current slave device node from the first device node and the second device node, and transmit the service data of the current master device node to the current slave device node through a preset target path; the preset target path is a path between a first network card externally mounted on a processor of the first device node and a second network card externally mounted on a processor of the second device node;
[0036] Correspondingly, after performing the master-slave switchover operation between the first device node and the second device node, the method further includes:
[0037] The new master device node is obtained after the master-slave switch operation, and uses the service data to process the current service processing request of the client.
[0038] In a second aspect, the present invention discloses a master-slave switching device, which is applied to a programmable logic device on a control board, comprising:
[0039] A signal acquisition module, used for acquiring a target signal transmitted by a first device node on the device system; the first device node is a master device node or a slave device node, and the target signal is a heartbeat signal of the device node or a soft interrupt signal triggered by the device node;
[0040] A judgment module, used to determine whether a preset active / standby switching condition is currently met based on the target signal;
[0041] a signal sending module, configured to generate a first hard interrupt signal if the preset master-slave switching condition is currently met, and transmit the first hard interrupt signal to a second device node, so as to notify the second device node that the master-slave switching operation is about to be triggered; the second device node is a device node in a master-slave relationship with the first device node;
[0042] The active / standby switching module is used to perform an active / standby switching operation between the first device node and the second device node after transmitting the hard interrupt signal to the second device node.
[0043] In a third aspect, the present invention discloses an equipment system, comprising a control board and equipment nodes respectively connected to the control board; wherein, a programmable logic device is provided on the control board, and the programmable logic device implements the steps of the aforementioned disclosed master-slave switching method by executing a computer program.
[0044] In a fourth aspect, the present invention discloses an electronic device, comprising:
[0045] Memory, used to store computer programs;
[0046] The processor is used to execute the computer program to implement the steps of the active-standby switching method disclosed above.
[0047] In a fifth aspect, the present invention discloses a computer-readable storage medium for storing a computer program; wherein, when the computer program is executed by a processor, the steps of the primary-standby switching method disclosed above are implemented.
[0048] It can be seen that the present invention is applied to a programmable logic device on a control board, including: obtaining a target signal transmitted by a first device node on a device system; the first device node is a master device node or a slave device node, and the target signal is a heartbeat signal of the device node or a soft interrupt signal triggered by the device node; determining whether a preset master-slave switching condition is currently met based on the target signal; if the preset master-slave switching condition is currently met, generating a first hard interrupt signal, and transmitting the first hard interrupt signal to a second device node to notify the second device node that a master-slave switching operation is about to be triggered; the second device node is a device node that has a master-slave relationship with the first device node; after transmitting the hard interrupt signal to the second device node, performing a master-slave switching operation between the first device node and the second device node.
[0049] The beneficial effect is as follows: the present invention adds a control board to the equipment system, and the programmable logic device on the control board obtains the target signal of the first equipment node. When it is determined according to the target signal that the preset master-standby switching condition is currently met, a first hard interrupt signal is sent to the second equipment node to notify the second equipment node that the master-standby switching operation is about to be triggered. After the hard interrupt signal is transmitted to the second equipment node, the master-standby switching operation between the first equipment node and the second equipment node is executed, that is, the master-slave relationship between the first equipment node and the second equipment node is switched. Because the hard interrupt signal has the advantages of fast response and high priority, fast master-standby switching can be achieved, that is, the current standby equipment node can quickly switch to the next master equipment node and take over subsequent business processing work, thereby ensuring business continuity and stable operation of the system. BRIEF DESCRIPTION OF THE DRAWINGS
[0050] In order to more clearly illustrate the embodiments of the present invention, the following briefly introduces the drawings required for use in the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0051] Figure 1 A flow chart of a primary-standby switching method provided by an embodiment of the present invention;
[0052] Figure 2 A schematic diagram of a specific device node and control board connection provided in an embodiment of the present invention;
[0053] Figure 3 A specific coding superposition schematic diagram provided by an embodiment of the present invention;
[0054] Figure 4 A schematic diagram of a specific heartbeat signal analysis waveform provided by an embodiment of the present invention;
[0055] Figure 5 A specific device system connection diagram provided for an embodiment of the present invention;
[0056] Figure 6 A schematic diagram of the structure of a master-slave switching device provided in an embodiment of the present invention;
[0057] Figure 7 A schematic diagram of a device system provided by an embodiment of the present invention;
[0058] Figure 8 A structural diagram of an electronic device provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0059] 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.
[0060] With the rapid development of information technology, servers are increasingly used in various fields. In some key business scenarios, the reliability and availability of servers are extremely high. Once a single-node server fails, it may cause business interruption and bring huge losses to users. In order to improve the reliability and availability of servers, dual-node servers came into being. Dual-node servers are usually composed of two independent device nodes, which work together through certain technical means. Under normal circumstances, the two nodes can share the business load and improve the performance of the server; when one node fails, the other node can automatically take over the business of the failed node to ensure business continuity.
[0061] Existing dual-node servers usually need to go through a series of complex detection and judgment processes when performing active-standby switching, which will result in a long switching time. In some business scenarios with high real-time requirements, the long switching time may cause business interruption and cause losses to users.
[0062] The terms "including" and "having" in the specification of the present invention and the above-mentioned drawings, as well as any variations thereof, are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device including a series of steps or units is not limited to the listed steps or units, but may include steps or units that are not listed.
[0063] In order to enable those skilled in the art to better understand the solution of the present invention, the present invention is further described in detail below in conjunction with the accompanying drawings and specific implementation methods.
[0064] Next, a master-slave switching solution provided by an embodiment of the present invention is described in detail. Figure 1 A method for active / standby switching provided in an embodiment of the present invention is applied to a programmable logic device on a control board, comprising:
[0065] Step S11: acquiring a target signal transmitted by a first device node on a device system; the first device node is a master device node or a slave device node, and the target signal is a heartbeat signal of the device node or a soft interrupt signal triggered by the device node.
[0066] The control board includes a programmable logic device, which may be a field programmable gate array (Field-Programmable Gate Array, FPGA) or a complex programmable logic device (Complex Programmable Logic Device, CPLD).
[0067] In this embodiment, it also includes: during the initial startup process of the device system, a low-level signal is transmitted to any device node in the device system through the pull-down resistor of the control board, so that the device node receiving the low-level signal determines its own role as the initial master device node; and a high-level signal is transmitted to any device node in the device system through the pull-up resistor of the control board, so that the device node receiving the high-level signal determines its own role as the initial slave device node.
[0068] For example Figure 2 A specific schematic diagram of connecting a device node and a control board is shown, the device system includes a device node 0, a device node 1 and a control board, the control board includes a pull-down resistor R1 and a pull-up resistor R2, the control board and the two device nodes are connected by a cable, and the interactive signal between the two device nodes and the control signal between the device node and the control board can be transmitted. During the initial startup of the device system, whether the device node is a master device node or a slave device node is determined by hardware, that is, when the device system is initially started, a low-level signal is transmitted to any device node in the device system through the pull-down resistor of the control board, so that the device node receiving the low-level signal will itself The role of the device node is determined as the initial master device node; and, a high-level signal is transmitted to any device node in the device system through the pull-up resistor of the control board, so that the device node receiving the high-level signal determines its own role as the initial slave device node. Specifically, the device node 0 with a small slot number is connected to the pull-down resistor R1 through a cable, and the device node 1 with a large slot number is connected to the pull-up resistor R2 through a cable. In this way, when the device system is initially started, when the device node 0 receives a low-level signal, it determines its own role as the initial master device node, and when the device node 1 receives a high-level signal, it determines its own role as the initial slave device node. The pull-up resistor and the pull-down resistor can be connected to the complex programmable logic device or baseboard management controller (Baseboard Management Controller, i.e., BMC) of the device node through the FM_NODE_0 / 1 signal.
[0069] In this embodiment, after transmitting a low-level signal to any device node in the device system through the pull-down resistor of the control board, it also includes: recording the startup time of the device node that receives the low-level signal transmitted by the pull-down resistor; if the time interval between the current time and the startup time is not equal to the preset delayed startup interval, then starting other device nodes is prohibited, if the first single-board status position of the device node that receives the low-level signal is a normal position and the second single-board status position of other device nodes is an abnormal position, then the device node that receives the low-level signal is determined to be the initial master device node; if the time interval between the current time and the startup time is equal to the preset delayed startup interval, then starting other device nodes, if the first single-board status position and the second single-board status position of other device nodes are both normal positions, then the other device nodes are determined to be the initial slave device nodes.
[0070] Furthermore, in order to allow the device node that receives the low-level signal transmitted by the pull-down resistor to determine that it is the master device node, a delayed startup interval can also be set, that is, when the device node that receives the low-level signal transmitted by the pull-down resistor is started, other device nodes cannot be started, that is, the control board first transmits a low level to the device node connected to the pull-down resistor through the pull-down resistor, and determines the startup time of the device node. Because the startup time has not yet arrived for other device nodes, the first single board state position of the device node that receives the low-level signal is a normal position and the second single board state position of other device nodes is an abnormal position. At this time, the device node that receives the low-level signal will determine its role as the initial master device node. If the time interval between the current time and the startup time is equal to the preset delayed startup interval, it means that other device nodes can be started. Other device nodes can detect that the first single board state position and the second single board state position of other device nodes are both normal positions, so other device nodes determine their own role as the initial slave device node. Among them, a single board generally refers to an independent printed circuit board in an electronic device (such as a communication device, a server, etc.), and the single board state refers to the working state of this circuit board, including normal operation, failure, standby, and other situations.
[0071] In a specific embodiment, obtaining a heartbeat signal transmitted by a first device node on a device system includes: obtaining a heartbeat signal transmitted by the first device node obtained by superimposing a type-encoded signal and an operating status-encoded signal at different frequencies; wherein the type-encoded signal and the operating status-encoded signal are signals obtained by the first device node respectively encoding a local hardware type signal and a hardware operating status signal at different frequencies. Obtain a heartbeat signal (HEART) transmitted by the first device node, which heartbeat signal can reflect the hardware operating status of the first device node; wherein the first device node encodes the local hardware type signal and the hardware operating status signal at different frequencies to obtain a type-encoded signal and an operating status-encoded signal, and then the first device node superimposes the type-encoded signal and the operating status-encoded signal at different frequencies to obtain a heartbeat signal. Furthermore, other status signals can also be encoded at different frequencies, for example Figure 3 A specific coding superposition schematic diagram is shown, in which a 1Hz square wave signal represents whether the baseboard management controller of the first device node has problems such as hanging. A 1 / 8Hz status handshake signal is superimposed on the 1Hz square wave to transmit the hardware operation status signal and hardware type signal of the first device node to the control board. The hardware operation status signal and the hardware type signal are, for example, the operation status signal of the memory type signal, the operation status signal of the hard disk type signal, and the operation status signal of the fan type signal. A 1 / 8Hz square wave is superimposed on the low level position of the 1Hz square wave signal. Each 1 / 8Hz signal has 4 bits in total, of which the first 3 bits can represent the hardware type. For specific definition examples, please refer to the table below. Then the 0th bit represents the hardware status, 1 (high level) represents normal, and 0 (low level) represents abnormal. For example: 0001 represents normal memory status, and 0010 represents abnormal hard disk status, as shown in Table 1:
[0072] Table 1 Signal Definition Bit[3:1] Memory Status 000 Hard disk status 001 Fan Status 010 Temperature status 011 …… ……
[0073] In another specific embodiment, a soft interrupt signal transmitted by the first device node on the device system is obtained, specifically an INT (Interrupt) signal, which is actively triggered by the first device node, that is, the programmable logic device on the control board can also receive the INT signal sent by the first device node. It can be understood that a soft interrupt is an interrupt mechanism at the software level, which is actively initiated by the software and is used to handle some asynchronous events or tasks that require timely response but have a relatively lower priority than a hard interrupt.
[0074] Step S12: determining whether a preset active / standby switching condition is currently satisfied based on the target signal.
[0075] In a specific embodiment, the determination of whether the preset active-standby switching condition is currently met based on the target signal includes: parsing the heartbeat signal using different parsing clocks to obtain a status notification signal containing the hardware operating status corresponding to each hardware type in the first device node; sending the status notification signal to the second device node, and determining whether the first preset active-standby switching condition is currently met based on the status notification signal; wherein the first preset active-standby switching condition is that the status notification signal indicates that the hardware operating status of the first device node meets a preset fault condition. It can be understood that, since the heartbeat signal is obtained by encoding and superimposing different signals at different frequencies, it is necessary to use different parsing clocks to parse the heartbeat signal. Specifically, two frequencies of xHz and x / 8Hz can be used. Two parsing clocks with different frequencies are set inside the control board to parse the data of the above two frequencies respectively, such as Figure 4 A specific heartbeat signal analysis waveform diagram is shown in FIG. 1 , taking xHz as an example: It can be seen from the figure above that the signal frequency is xHz, the analysis clock frequency is X / 2Hz, and the 10101 level of waveform 1 can be sampled by the rising edge of the signal of waveform 2, such as Figure 4 As shown by the dotted line. When the heartbeat signal is parsed using the parsing clock to obtain a status notification signal containing the hardware operating status corresponding to each hardware type in the first device node, the status notification signal is sent to the second device node so that the second device node can determine the operating status of the first device node, and also determine whether the first preset active-standby switching condition is currently met based on the status notification signal. The first preset active-standby switching condition is that the status notification signal indicates that the hardware operating status of the first device node meets the preset fault condition, that is, when the first device node has an operating fault, it can be determined that the first preset active-standby switching condition is met, that is, active-standby switching is required; if there is an operating fault, one situation is that the first device node is hard reset or manually unplugged, and another situation is that the first device node has a software abnormal restart, thereby triggering the switch. For example, the module abnormally occupies the central processor for too long, causing the hardware watchdog to restart the system, data access abnormality, instruction access abnormality and other system abnormalities to trigger a restart.
[0076] In another specific embodiment, if the target signal is a soft interrupt signal, then determining whether the preset active / standby switching condition is currently satisfied based on the target signal includes: determining whether the second preset active / standby switching condition is currently satisfied based on the soft interrupt signal; wherein the second preset active / standby switching condition is that the soft interrupt signal indicates that the first device node triggers an active / standby switching request. When the target signal is an INT signal, determining whether the second preset active / standby switching condition is currently satisfied based on the soft interrupt signal, that is, whether the soft interrupt signal indicates that the first device node triggers an active / standby switching request, in which case active / standby switching is forced.
[0077] Step S13: If the preset master-slave switching condition is currently met, a first hard interrupt signal is generated and transmitted to a second device node to notify the second device node that the master-slave switching operation is about to be triggered; the second device node is a device node in a master-slave relationship with the first device node.
[0078] If the first preset master-slave switching condition or the second preset master-slave switching condition is currently met, a first hard interrupt signal (Interrupt Request, i.e., IRQ) is generated, and the first hard interrupt signal is transmitted to the second device node to notify the second device node that the master-slave switching operation is about to be triggered. The second device node is a device node in a master-slave relationship with the first device node, that is, if the first device node is the master device node, the second device node is the slave device node of the first device node, and if the first device node is the slave device node, the second device node is the master device node of the first device node. Therefore, the cause of the master-slave switching may be initiated by the master device node or by the slave device node.
[0079] Furthermore, a hard interrupt is an interrupt request signal actively sent to the processor by a hardware device, such as an external device or a hardware module inside a chip. It is used to notify the processor that there is an urgent event that needs to be handled. The processor will suspend the currently executing task and execute the handler related to the interrupt instead. The first hard interrupt signal mentioned above is specifically an IRQ (Interrupt Request) signal. The IRQ signal can be in the form of a GPIO (General-purpose input / output) or a bus such as I2C (Inter-Integrated Circuit). By customizing a certain communication protocol, the communication between the baseboard management controller of the two nodes and the programmable logic device on the control board is realized. The first hard interrupt signal can be used as a path for the control board to notify the standby main board when the active-standby switching request interrupt occurs.
[0080] Step S14: after transmitting the hard interrupt signal to the second device node, performing a master-slave switching operation between the first device node and the second device node.
[0081] In this embodiment, it also includes: if a second hard interrupt signal transmitted by the first device node is received, detecting whether the status notification signal corresponding to the first device node meets a preset control right acquisition condition; wherein the second hard interrupt signal represents that the first device node triggers a request to obtain control of a common component; if the status notification signal corresponding to the first device node meets the preset control right acquisition condition, disconnecting the path between the second device node and the common component, and establishing a path between the first device node and the common component; sending a third hard interrupt signal to the first device node and the second device node; wherein the third hard interrupt signal represents that the control of the common component belongs to the first device node. The baseboard management controllers of the active and standby device nodes each output an I2C bus connected to the programmable logic device of the control board. The bus is used to receive a second hard interrupt signal transmitted by the first device node, and the second hard interrupt signal represents a request by the first device node to trigger the acquisition of control rights of the common component. Therefore, it is detected whether the status notification signal corresponding to the first device node meets the preset control right acquisition conditions, such as whether the operating status of the first device node is good, or whether the common component should be controlled by the first device node at present. If the status notification signal corresponding to the first device node meets the preset control right acquisition conditions, the path between the second device node and the common component is disconnected, and the path between the first device node and the common component is established, so that the first device node can control the common component. Among them, the common components can specifically be fans and power supplies, so the control of the common components can specifically be the control of the fan speed and the control of the power supply unit (PSU) status. When controlling the common components, it is necessary to send control instructions, which are generally transmitted through I2C. The baseboard management controllers of the master and standby device nodes each output an I2C bus connected to the programmable logic device of the control board. The programmable logic device implements a two-to-one switch function (data selector, i.e., MUX) through logic control, and switches the path between the second device node and the common component to the first device node, so that the first device node can control the common component.
[0082] In this embodiment, it also includes: monitoring whether the number of current business processing requests of the client is greater than a preset threshold; if the number of current business processing requests is greater than the preset threshold, generating a fourth hard interrupt signal, and sending the fourth hard interrupt signal to the first device node and the second device node to notify the first device node and the second device node that a dual-master switching operation is about to be triggered; after transmitting the fourth hard interrupt signal to the first device node and the second device node, executing an operation of switching both the first device node and the second device node to master device nodes so that each of the master device nodes can process the current business processing request.
[0083] The two main boards of a dual-device node can not only be designed as a master-slave relationship, but also can be designed as a dual-master working mode. Using the master-slave working mode can ensure business reliability. When the device system processing resources are tight, the two main boards can be adjusted to the dual-master mode, both participating in actual data and business processing, thereby improving server resource utilization. The main implementation method is as follows: monitoring whether the number of current business processing requests of the client is greater than a preset threshold; if the number of current business processing requests is greater than the preset threshold, generating a fourth hard interrupt signal, sending the fourth hard interrupt signal to the first device node and the second device node, so as to notify the first device node and the second device node that the dual-master switching operation is about to be triggered, and after transmitting the fourth hard interrupt signal to the first device node and the second device node, executing the operation of switching both the first device node and the second device node to the master device node, so that each master device node processes the current business processing request; wherein, the fourth hard interrupt signal is also an IRQ signal, and the IRQ signal transmits the instruction of the dual-master working mode respectively, telling the two device nodes that the master-slave mode is about to enter the dual-master mode, at this time, the health status of the other party will be detected through the handshake message signal and the heartbeat signal between the two device nodes, when it is determined to be normal, the dual-master mode switching is performed normally, and the handshake message signal can reflect the communication status of the device node; when the health status of any device node is abnormal, the return information that the switch cannot be made will be transmitted again through the IRQ signal, telling the control board that the switch fails, and the result will be returned to the user client through the network or other means, so that the speed of business request processing can be improved.
[0084] In this embodiment, before executing the master-slave switchover operation between the first device node and the second device node, the method further includes: determining the current master device node and the current slave device node from the first device node and the second device node, and transmitting the service data of the current master device node to the current slave device node through a preset target path; the preset target path is the path between the first network card of the processor of the first device node and the second network card of the processor of the second device node. Figure 5A specific device system connection diagram is shown, a first network card is externally mounted on the processor of the first device node, and a second network card is externally mounted on the processor of the second device node, wherein the first network card and the second network card can specifically be OCP (Open Compute Project) network cards, and data transmission between the processor of the device node and the network card can adopt PCIe (Peripheral Component Interconnect Express is a high-speed serial computer expansion bus standard) bus; before executing the master-slave switching operation between the first device node and the second device node, it is also necessary to determine the current master device node and the current slave device node from the first device node and the second device node, and transmit the business data of the current master device node to the current slave device node through a preset target path, that is, perform data smoothing processing, so that the current slave device node also has the same business data as the current master device node, and the preset target path is the path between the first network card and the second network card.
[0085] In this embodiment, after the master-slave switching operation between the first device node and the second device node is performed, it also includes: obtaining a new master device node after the master-slave switching operation, and using the service data to process the current service processing request of the client. When the master-slave switching operation is completed, a new master device node is obtained. It can be understood that the new master device node is the slave device node before the switching, that is, the new master device node already has the service data, so the new master device node can directly use the service data to process the current service processing request of the client, ensuring that the service will not be interrupted and the service data is normal.
[0086] Furthermore, the present embodiment may also be provided with a fault switching module, which is a key point to ensure normal service data when a dual device node fails. When a master device node fails, the fault switching module will immediately switch the service to the slave device node to ensure service continuity. The fault switching module will first stop sending service requests to the master device node and forward the service requests to the slave master device node. At the same time, the fault switching module will notify the client to update the connection information so that the client can connect to the standby node to continue service processing. After the original master device node fails, the fault switching module will automatically switch the service back to the original master device node and notify the client to update the connection information. Common ways of fault switching, such as in a dual device node architecture, can use a load balancer to distribute service requests, wherein the load balancer is, for example, Nginx, HAProxy; the load balancer can forward requests to the master device node or the slave device node according to a preset strategy, such as polling, least connection, and other strategies. When the master device node fails, the load balancer will automatically switch the request to the slave device node to achieve fault switching.
[0087] For example Figure 5 As shown, the baseboard management controller of each device node is connected to the physical layer integrated circuit (PHY) through the Reduced Gigabit Media Independent Interface (RGMII), the serial gigabit media independent interface (Serial Gigabit Media Independent Interface, SGMII) or the media dependent interface (Media Dependent Interface, MDI) of the physical layer integrated circuit is connected to the local area network switch board (LAN Switch board), and the single-port network interaction interface of the LAN switch board is connected to each network device. In other words, its main implementation method is to design a LAN Switch board in the system. The LAN Switch board is essentially a LAN switch card that can expand the network connection capability so that it can connect more network devices at the same time. The baseboard management controllers of the two device nodes in the hardware design each output a RGMII signal to the PHY chip, and then the PHY chip can be connected to the LAN Switch board through the SGMII / MDI interface and the cable, and then the network data exchange is realized through the LANSwitch chip on the LAN Switch board, and the external network connection is realized through an RJ45 network port. In this way, the dual device nodes can share one network port to simplify the number of external interfaces.
[0088] When it is determined based on the target signal that the preset master-standby switching condition is currently met, a master-standby switching log is generated according to the target signal. When the first device node and the second device node in the device system need to be maintained, the reason for performing the master-standby switching operation between the first device node and the second device node can be determined according to the target signal in the master-standby switching log, and the operation of maintaining the device system can be determined according to the reason. For example, if the reason indicates that the execution of the master-standby switching operation is in response to the master-standby switching request triggered by the first device node, then the device system does not need to be maintained. If the reason indicates that the hardware operating status of the first device node meets the preset fault condition, then the first device node needs to be maintained. In this way, the health status of the device system can be monitored according to the master-standby switching log, which is convenient for maintenance of the device system.
[0089] It can be seen that the present invention is applied to a programmable logic device on a control board, including: obtaining a target signal transmitted by a first device node on a device system; the first device node is a master device node or a slave device node, and the target signal is a heartbeat signal of the device node or a soft interrupt signal triggered by the device node; determining whether a preset master-slave switching condition is currently met based on the target signal; if the preset master-slave switching condition is currently met, generating a first hard interrupt signal, and transmitting the first hard interrupt signal to a second device node to notify the second device node that a master-slave switching operation is about to be triggered; the second device node is a device node that has a master-slave relationship with the first device node; after transmitting the hard interrupt signal to the second device node, performing a master-slave switching operation between the first device node and the second device node.
[0090] The beneficial effect is as follows: the present invention adds a control board to the equipment system, and the programmable logic device on the control board obtains the target signal of the first equipment node. When it is determined according to the target signal that the preset master-standby switching condition is currently met, a first hard interrupt signal is sent to the second equipment node to notify the second equipment node that the master-standby switching operation is about to be triggered. After the hard interrupt signal is transmitted to the second equipment node, the master-standby switching operation between the first equipment node and the second equipment node is executed, that is, the master-slave relationship between the first equipment node and the second equipment node is switched. Because the hard interrupt signal has the advantages of fast response and high priority, fast master-standby switching can be achieved, that is, the current standby equipment node can quickly switch to the next master equipment node and take over subsequent business processing work, thereby ensuring business continuity and stable operation of the system.
[0091] Figure 6 A schematic diagram of the structure of a master-slave switching device provided in an embodiment of the present invention, which is applied to a programmable logic device on a control board, includes:
[0092] The signal acquisition module 11 is used to acquire a target signal transmitted by a first device node on the device system; the first device node is a master device node or a slave device node, and the target signal is a heartbeat signal of the device node or a soft interrupt signal triggered by the device node;
[0093] A judgment module 12, used to determine whether a preset active / standby switching condition is currently met based on the target signal;
[0094] The signal sending module 13 is used to generate a first hard interrupt signal if the preset master-slave switching condition is currently met, and transmit the first hard interrupt signal to the second device node to notify the second device node that the master-slave switching operation is about to be triggered; the second device node is a device node in a master-slave relationship with the first device node;
[0095] The active / standby switching module 14 is configured to perform an active / standby switching operation between the first device node and the second device node after transmitting the hard interrupt signal to the second device node.
[0096] It can be seen that the present invention is applied to a programmable logic device on a control board, including: obtaining a target signal transmitted by a first device node on a device system; the first device node is a master device node or a slave device node, and the target signal is a heartbeat signal of the device node or a soft interrupt signal triggered by the device node; determining whether a preset master-slave switching condition is currently met based on the target signal; if the preset master-slave switching condition is currently met, generating a first hard interrupt signal, and transmitting the first hard interrupt signal to a second device node to notify the second device node that a master-slave switching operation is about to be triggered; the second device node is a device node that has a master-slave relationship with the first device node; after transmitting the hard interrupt signal to the second device node, performing a master-slave switching operation between the first device node and the second device node.
[0097] The beneficial effect is as follows: the present invention adds a control board to the equipment system, and the programmable logic device on the control board obtains the target signal of the first equipment node. When it is determined according to the target signal that the preset master-standby switching condition is currently met, a first hard interrupt signal is sent to the second equipment node to notify the second equipment node that the master-standby switching operation is about to be triggered. After the hard interrupt signal is transmitted to the second equipment node, the master-standby switching operation between the first equipment node and the second equipment node is executed, that is, the master-slave relationship between the first equipment node and the second equipment node is switched. Because the hard interrupt signal has the advantages of fast response and high priority, fast master-standby switching can be achieved, that is, the current standby equipment node can quickly switch to the next master equipment node and take over subsequent business processing work, thereby ensuring business continuity and stable operation of the system.
[0098] The embodiment of the present application also discloses a device system, Figure 7 It is a schematic diagram of a device system according to an exemplary embodiment, wherein the device system includes a control board and device nodes respectively connected to the control board; wherein a programmable logic device is provided on the control board, and the programmable logic device implements the relevant steps in the master-slave switching method disclosed in any of the aforementioned embodiments by executing a computer program. Specifically, the device node can control the common components, which are specifically fans and PUS power supplies. The device node and the programmable logic device on the control board can send interactive signals, hard interrupt signals, target signals, etc. to each other. The device node can also be connected to external devices, such as hard disks, network cards, graphics processing units (GPUs), etc.
[0099] Furthermore, the present application also discloses an electronic device. Figure 8 This is a structural diagram of an electronic device according to an exemplary embodiment, and the content in the diagram cannot be regarded as any limitation on the scope of use of this application. The electronic device may specifically include: at least one processor 21, at least one memory 22, a power supply 23, a communication interface 24, an input / output interface 25, and a communication bus 26. The memory 22 is used to store a computer program, and the computer program is loaded and executed by the processor 21 to implement the relevant steps in the active / standby switching method disclosed in any of the aforementioned embodiments. In addition, the electronic device in this embodiment may specifically be an electronic computer.
[0100] In this embodiment, the power supply 23 is used to provide working voltage for each hardware device on the electronic device; the communication interface 24 can create a data transmission channel between the electronic device and the external device, and the communication protocol it follows is any communication protocol that can be applied to the technical solution of the present application, and is not specifically limited here; the input and output interface 25 is used to obtain external input data or output data to the outside world, and its specific interface type can be selected according to specific application needs and is not specifically limited here.
[0101] In addition, the memory 22, as a carrier for storing resources, can be a read-only memory, a random access memory, a disk or an optical disk, etc. The resources stored thereon can include an operating system 221, a computer program 222, etc., and the storage method can be temporary storage or permanent storage.
[0102] The operating system 221 is used to manage and control various hardware devices on the electronic device and the computer program 222, which can be Windows Server, Netware, Unix, Linux, etc. In addition to including a computer program that can be used to complete the active / standby switching method performed by the electronic device disclosed in any of the aforementioned embodiments, the computer program 222 can further include a computer program that can be used to complete other specific tasks.
[0103] Furthermore, the present application also discloses a computer-readable storage medium for storing a computer program; wherein the computer program, when executed by a processor, implements the active / standby switching method disclosed above. The specific steps of the method can be referred to the corresponding contents disclosed in the above embodiments, and will not be described in detail here.
[0104] In this specification, each embodiment is described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the embodiments can be referred to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part.
[0105] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in the above description according to function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0106] The steps of the method or algorithm described in conjunction with the embodiments disclosed herein may be implemented directly using hardware, a software module executed by a processor, or a combination of the two. The software module may be placed in a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.
[0107] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.
[0108] The technical solution provided by the present application is introduced in detail above. Specific examples are used in this article to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea. At the same time, for general technicians in this field, according to the idea of the present application, there will be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.
Claims
1. A method for active / standby switching, characterized in that: Programmable logic devices used on control boards include: Acquire a target signal transmitted by a first device node on the device system; the first device node is a master device node or a slave device node, and the target signal is a heartbeat signal of the device node or a soft interrupt signal triggered by the device node; Determining whether a preset active / standby switching condition is currently met based on the target signal; If the preset active-standby switching condition is currently met, a first hard interrupt signal is generated, and the first hard interrupt signal is transmitted to a second device node to notify the second device node that an active-standby switching operation is about to be triggered; the second device node is a device node in an active-standby relationship with the first device node; After the hard interrupt signal is transmitted to the second device node, a master-slave switching operation is performed between the first device node and the second device node.
2. The active / standby switching method according to claim 1, characterized in that: Also includes: During the initial startup of the device system, a low-level signal is transmitted to any device node in the device system through the pull-down resistor of the control board, so that the device node receiving the low-level signal determines its own role as the initial master device node; and a high-level signal is transmitted to any device node in the device system through the pull-up resistor of the control board, so that the device node receiving the high-level signal determines its own role as the initial slave device node.
3. The active / standby switching method according to claim 2, characterized in that: After transmitting the low level signal to any device node in the device system through the pull-down resistor of the control board, the method further includes: Recording the startup time of the device node that receives the low level signal transmitted by the pull-down resistor; If the time interval between the current time and the start time is not equal to the preset delayed start interval, then starting other device nodes is prohibited, and if the first single board state position of the device node receiving the low level signal is a normal position and the second single board state position of other device nodes is an abnormal position, then the device node receiving the low level signal is determined to be the initial master device node; If the time interval between the current time and the start time is equal to the preset delayed start interval, other device nodes are started. If the first single board status position and the second single board status position of other device nodes are both normal positions, other device nodes are determined to be initial slave device nodes.
4. The active / standby switching method according to claim 1, characterized in that: Obtaining the heartbeat signal transmitted by the first device node on the device system, including: Acquire a heartbeat signal transmitted by the first device node, obtained by superimposing a type-encoded signal and an operation status-encoded signal according to different frequencies; The type-encoded signal and the running status-encoded signal are signals obtained by respectively encoding the local hardware type signal and the hardware running status signal by the first device node according to different frequencies; Accordingly, determining whether a preset active / standby switching condition is currently met based on the target signal includes: parsing the heartbeat signal using different parsing clocks to obtain a status notification signal including the hardware operating status corresponding to each hardware type in the first device node; Sending the status notification signal to the second device node, and determining whether a first preset active-standby switching condition is currently met based on the status notification signal; The first preset active-standby switching condition is that the status notification signal indicates that the hardware operating status of the first device node meets a preset fault condition.
5. The active / standby switching method according to claim 4, characterized in that: Also includes: If a second hard interrupt signal transmitted by the first device node is received, detecting whether the status notification signal corresponding to the first device node meets a preset control right acquisition condition; wherein the second hard interrupt signal represents a request for acquiring the control right of a common component triggered by the first device node; If the state notification signal corresponding to the first device node satisfies the preset control right acquisition condition, disconnecting the path between the second device node and the common component, and establishing the path between the first device node and the common component; A third hard interrupt signal is sent to the first device node and the second device node, wherein the third hard interrupt signal indicates that the control right of the common component belongs to the first device node.
6. The active / standby switching method according to claim 1, characterized in that: If the target signal is a soft interrupt signal, determining whether a preset active / standby switching condition is currently met based on the target signal includes: Based on the soft interrupt signal, determine whether a second preset active-standby switching condition is currently met; wherein the second preset active-standby switching condition is that the soft interrupt signal indicates that the first device node triggers an active-standby switching request.
7. The active / standby switching method according to claim 1, characterized in that: Also includes: Monitor whether the number of current business processing requests from the client is greater than a preset threshold; If the number of the current service processing requests is greater than the preset threshold, a fourth hard interrupt signal is generated, and the fourth hard interrupt signal is sent to the first device node and the second device node to notify the first device node and the second device node that a dual-master switching operation is about to be triggered; After transmitting the fourth hard interrupt signal to the first device node and the second device node, an operation of switching both the first device node and the second device node to master device nodes is performed so that each of the master device nodes processes the current service processing request.
8. The active / standby switching method according to claim 1, characterized in that: Before performing the master-slave switching operation between the first device node and the second device node, the method further includes: Determine a current master device node and a current slave device node from the first device node and the second device node, and transmit the service data of the current master device node to the current slave device node through a preset target path; the preset target path is a path between a first network card externally mounted on a processor of the first device node and a second network card externally mounted on a processor of the second device node; Correspondingly, after performing the master-slave switchover operation between the first device node and the second device node, the method further includes: The new master device node is obtained after the master-slave switch operation, and uses the service data to process the current service processing request of the client.
9. A device system, characterized in that: It comprises a control board and device nodes respectively connected to the control board; wherein a programmable logic device is arranged on the control board, and the programmable logic device implements the master-slave switching method as described in any one of claims 1 to 8 by executing a computer program.
10. An electronic device, characterized in that: include: Memory for storing computer programs; A processor is used to execute the computer program to implement the steps of the active-standby switching method according to any one of claims 1 to 8.