Power failure detection method and device and switch

By monitoring the disconnection between the switch and the power supply in real time and detecting the output status of the previous cascaded device, generating and sending power-down information messages, the problem of inability to monitor the power-off of the switch in real time in the prior art is solved, and rapid response and recording are achieved The power-down alarm improves system stability and cost-effectiveness.

CN118945508APending Publication Date: 2024-11-12深圳市三旺通信股份有限公司
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410954582.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-17
Publication Date
2024-11-12

AI Technical Summary

Technical Problem

The prior art cannot monitor whether the switch is powered off in real time, resulting in the inability to remotely diagnose whether the system abnormality caused by the switch powered off.

Method used

Provide a power-down detection method and device, which monitors whether the switch and the power supply are disconnected in real time through the power-down monitoring circuit, and issues an alarm signal when the power is off, and detects the output status of the previous cascaded device through the relay detection circuit to generate power-down The message is sent to the monitoring center.

Benefits of technology

Real-time power-down status detection of the switch and rapid transmission of alarm information, ensuring that the monitoring center can capture power-down information in a timely manner, reducing on-site alarm signal lines, reducing costs and increasing system stability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118945508A_ABST
    Figure CN118945508A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of switches, and discloses a power failure detection method and device and a switch, and the power failure detection method comprises the steps: monitoring whether the switch is disconnected with a power supply or not in real time through a power failure monitoring circuit, and transmitting a first alarm signal during power failure; detecting the output state of a relay in a previous cascade device connected with the switch through a relay detection circuit, and sending a second alarm signal when the output state is a normally closed state; and when the first alarm signal or the second alarm signal is received, a power-down information message is generated based on a buffer power supply provided by the power-down buffer circuit, and the power-down information message is sent to a monitoring center. According to the invention, the power-down state of the switch is monitored in real time, the power-down information message is sent to the monitoring center, and the plurality of switches are connected with each other in a cascading manner, so that the cost is greatly reduced, and the stability of the whole system is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of switches, and in particular to a power failure detection method, device and switch. Background Art

[0002] The working conditions of industrial switches are generally bad. For example, sudden power outages such as overload of power supply, loose power cables, aging power cables, and power cords being broken due to accidents may cause abnormal operation of the overall system. Generally speaking, when switches are used in industrial sites, multiple switches are usually cascaded together and a ring network protocol is used to ensure that communication remains normal at all times. In existing technologies, if a single switch suddenly disconnects its port, a ring network protocol is usually used to implement it. However, the ring network protocol only exchanges port disconnection information between switches, and there is no way to remotely diagnose whether it is caused by a power outage on the switch. Summary of the invention

[0003] In view of this, the embodiments of the present application provide a power failure detection method, device and switch, which can monitor the power failure status of the switch in real time and ensure that the power failure status is stably transmitted to the monitoring center.

[0004] In a first aspect, an embodiment of the present application provides a power failure detection method, which is applied to a switch, and the method includes:

[0005] The power failure monitoring circuit monitors in real time whether the switch is disconnected from the power supply and sends a first alarm signal when the power fails;

[0006] Detecting the output state of a relay in an upper cascade device connected to the switch through a relay detection circuit, and sending a second alarm signal when the output state is a normally closed state;

[0007] When the host circuit receives the first alarm signal or the second alarm signal, it generates a power-off information message based on the buffer power provided by the power-off buffer circuit, and sends the power-off information message to the monitoring center.

[0008] In a first possible embodiment of the first aspect, when the host circuit receives the first alarm signal or the second alarm signal, generating a power-off information message based on a buffer power provided by a power-off buffer circuit includes:

[0009] receiving the first alarm signal or the second alarm signal by interruption, and generating the power-off information message based on a network management protocol when the power-off buffer circuit provides a buffer power supply;

[0010] When generating the power-off information message, it also includes:

[0011] The power-off log information of the switch is recorded in a log file.

[0012] In a second possible embodiment of the first aspect, the output state of the relay includes a normally open state and a normally closed state, and the method further includes:

[0013] When the host circuit receives the first alarm signal or the second alarm signal, the output state of the relay used to connect the next cascade device is operated to be a normally closed state;

[0014] When the first alarm signal or the second alarm signal is not received, the output state of the relay for connecting the next cascade device is kept in a normally open state.

[0015] In a third possible embodiment of the first aspect, detecting, by a relay detection circuit, an output state of a relay in an upper-level cascade device connected to the switch, and sending a second alarm signal when the output state is a normally closed state, includes:

[0016] When the relay detection circuit detects that the output state of the relay of the upper cascade device is a normally closed state, sending the second alarm signal;

[0017] When the relay detection circuit detects that the output state of the relay of the upper cascade device is a normally open state, the second alarm signal is not sent.

[0018] In a second aspect, an embodiment of the present application provides a power failure detection method, which is applied to a switch system, wherein the switch system includes a plurality of switches, and the plurality of switches are interconnected in a cascade manner to form a ring network, and the method includes:

[0019] Any one of the switches adopts the power failure detection method of the first embodiment to perform power failure detection, and after detecting the power failure, disconnects the relays of all cascaded devices in sequence.

[0020] In a first possible embodiment of the second aspect, when any one of the switches detects that an output state of a relay in an upper-level cascade device connected to the switch is a normally closed state, the method further includes:

[0021] Process the routing protocol and ring network protocol of the upper cascade device to determine the routing of the data packet and realize the data transmission of the ring network.

[0022] In a third aspect, an embodiment of the present application provides a power failure detection device, including:

[0023] A power failure monitoring circuit is used to monitor in real time whether the switch is disconnected from the power supply and to send out a first alarm signal when power is lost;

[0024] A relay detection circuit, used for detecting the output state of a relay in an upper cascade device connected to the switch, and sending a second alarm signal when the output state is a normally closed state;

[0025] A power-off buffer circuit, connected to the power supply, for providing a buffer power supply for a preset time after the switch loses power;

[0026] The host circuit is connected to the power-off monitoring circuit and the relay detection circuit, and is used to generate a power-off information message when receiving the first alarm signal or the second alarm signal, and send the power-off information message to a monitoring center.

[0027] In a first possible embodiment of the third aspect, the power-off monitoring circuit includes a first current limiting resistor, a second current limiting resistor, a third current limiting resistor, a fourth current limiting resistor, a first diode, a first capacitor, a first transistor, and a second transistor;

[0028] A first end of the first current limiting resistor is connected to a power supply, a second end of the first current limiting resistor is respectively connected to a first end of a second current limiting resistor and an anode of the first diode, a cathode of the first diode is connected to a first end of the first capacitor, a second end of the first capacitor is connected to a second end of the second current limiting resistor, and a second end of the second current limiting resistor is grounded;

[0029] The emitter of the first transistor is connected to the series node of the first diode and the first capacitor, the base of the first transistor is connected to the first end of the third current limiting resistor, the second end of the third current limiting resistor is connected to a power supply, and the collector of the first transistor is connected to the first end of the fourth current limiting resistor;

[0030] The second end of the fourth current limiting resistor is connected to the base of the second triode, the collector of the second triode is used to connect to the switch, and the emitter of the second triode is grounded.

[0031] In a second possible embodiment of the third aspect, the power-off buffer circuit includes a third capacitor, a fourth capacitor, a fifth capacitor, and a sixth capacitor;

[0032] The first end of the power-off buffer circuit is used to connect to a power supply, and the power-off buffer circuit includes a second capacitor, a third capacitor, a fourth capacitor and a fifth capacitor;

[0033] The first end of the power-off buffer circuit is used to connect to a power supply, and the second end of the power-off buffer circuit is used to connect to the switch;

[0034] The second capacitor, the third capacitor, the fourth capacitor and the fifth capacitor are connected in parallel, and a parallel node of the second capacitor, the third capacitor, the fourth capacitor and the fifth capacitor is grounded.

[0035] In a fourth aspect, an embodiment of the present application provides a switch, wherein the switch includes a power failure detection device, and the power failure detection device is used to execute a power failure detection method.

[0036] The embodiments of the present application have the following beneficial effects:

[0037] A power failure detection method in an embodiment of the present application is applied to a switch, and the power failure detection method includes: monitoring in real time whether the switch is disconnected from the power supply through a power failure monitoring circuit, and sending a first alarm signal when the power fails; detecting the output state of the relay in the upper cascade device connected to the switch through a relay detection circuit, and sending a second alarm signal when the output state is in a normally closed state; when the first alarm signal or the second alarm signal is received, a power failure information message is generated based on the buffer power provided by the power failure buffer circuit, and the power failure information message is sent to a monitoring center. Based on the above scheme, the power failure detection method realizes that each switch adds two interrupt power failure alarm detections, quickly detects the power failure state of the switch and the power failure state of the upper cascade device connected to the switch, and sends a power failure information message to the monitoring center so as to make a real-time response or record the power failure alarm record, and multiple switches are connected to each other in a cascade manner, which reduces the on-site alarm signal lines, reduces costs and increases the stability of the entire system. BRIEF DESCRIPTION OF THE DRAWINGS

[0038] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments will be briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.

[0039] Figure 1 A schematic diagram of the structure of a power failure detection device according to an embodiment of the present application is shown;

[0040] Figure 2 A circuit diagram of a power failure monitoring circuit according to an embodiment of the present application is shown;

[0041] Figure 3 A circuit diagram of a relay detection circuit according to an embodiment of the present application is shown;

[0042] Figure 4 A circuit diagram of a power-off buffer circuit according to an embodiment of the present application is shown;

[0043] Figure 5 A schematic diagram showing a flow chart of a power failure detection method according to an embodiment of the present application is shown;

[0044] Figure 6 A schematic diagram of the structure of a ring network in an embodiment of the present application is shown.

[0045] Description of main component symbols:

[0046] 200 - power failure detection device; 210 - power failure monitoring circuit; 220 - relay detection circuit; 230 - power failure buffer circuit; 240 - host circuit. DETAILED DESCRIPTION

[0047] The technical solutions in the embodiments of the present application will be described clearly and completely below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all of the embodiments.

[0048] The components of the embodiments of the present application generally described and shown in the drawings herein may be arranged and designed in various configurations. Therefore, the following detailed description of the embodiments of the present application provided in the drawings is not intended to limit the scope of the application claimed for protection, but merely represents the selected embodiments of the present application. Based on the embodiments of the present application, all other embodiments obtained by those skilled in the art without making creative work belong to the scope of protection of the present application.

[0049] Hereinafter, the terms "including", "having" and their cognates that can be used in various embodiments of the present application are intended only to indicate specific features, numbers, steps, operations, elements, components or a combination of the foregoing items, and should not be understood as first excluding the existence of one or more other features, numbers, steps, operations, elements, components or a combination of the foregoing items or increasing the possibility of one or more features, numbers, steps, operations, elements, components or a combination of the foregoing items. In addition, the terms "first", "second", "third" and the like are only used to distinguish descriptions and cannot be understood as indicating or implying relative importance.

[0050] Unless otherwise defined, all terms (including technical terms and scientific terms) used herein have the same meanings as those generally understood by those skilled in the art to which the various embodiments of the present application belong. The terms (such as those defined in generally used dictionaries) will be interpreted as having the same meanings as the contextual meanings in the relevant technical field and will not be interpreted as having idealized meanings or overly formal meanings unless clearly defined in the various embodiments of the present application.

[0051] In conjunction with the accompanying drawings, some embodiments of the present application are described in detail below. In the absence of conflict, the following embodiments and features in the embodiments can be combined with each other.

[0052] The existing technology cannot monitor whether the switch is powered off in real time. In order to remedy this situation, the present application provides a real-time monitoring switch power off and alarm mechanism. Once a switch loses power, in addition to the interconnected switches being able to sense the power off of the switch and form a record, the external monitoring center can also capture the power off information in time, which is convenient for subsequent tracing of the root cause of the problem.

[0053] Example 1

[0054] Figure 1 A schematic diagram of the structure of a power failure detection device 200 according to an embodiment of the present application is shown. Exemplarily, the power failure detection device 200 includes a power failure monitoring circuit 210, a relay detection circuit 220, a power failure buffer circuit 230 and a host circuit 240.

[0055] In this embodiment, the power-off monitoring circuit 210 is used to monitor in real time whether the switch is disconnected from the power supply, and to send a first alarm signal when the power is off; the relay detection circuit 220 is used to detect the output state of the relay in the upper cascade device connected to the switch, and to send a second alarm signal when the output state is in a normally closed state; the power-off buffer circuit 230 is connected to the power supply, and is used to provide a buffer power supply for a preset time after the switch loses power; the host circuit 240 is connected to the power-off monitoring circuit 210 and the relay detection circuit 220, and is used to generate a power-off information message when the first alarm signal or the second alarm signal is received, and send the power-off information message to the monitoring center.

[0056] In order to better understand the power failure detection device 200 , each component of the power failure detection device 200 is described in detail below.

[0057] like Figure 2As shown, in one embodiment, the power-off monitoring circuit 210 includes a first current limiting resistor R1, a second current limiting resistor R2, a third current limiting resistor R3, a fourth current limiting resistor R4, a first diode D1, a first capacitor C1, a first transistor Q1 and a second transistor Q2; the first end of the first current limiting resistor R1 is connected to the power supply VCC, the second end of the first current limiting resistor R1 is respectively connected to the first end of the second current limiting resistor R2 and the anode of the first diode D1, the cathode of the first diode D1 is connected to the first end of the first capacitor C1, and the second end of the first capacitor C1 is connected to the second The second end of the current limiting resistor R2 and the second end of the first current limiting resistor R1 are grounded; the emitter of the first transistor Q1 is connected to the series node of the first diode D1 and the first capacitor C1, the base of the first transistor Q1 is connected to the first end of the third current limiting resistor R3, the second end of the third current limiting resistor R3 is connected to the power supply VCC, and the collector of the first transistor Q1 is connected to the first end of the fourth current limiting resistor R4; the second end of the fourth current limiting resistor R4 is connected to the base of the second transistor Q2, the collector of the second transistor Q1 is used to connect the switch, and the emitter of the second transistor Q1 is grounded.

[0058] In this embodiment, the first end of the power-off monitoring circuit 210 is used to connect to the power supply, and the second end of the power-off monitoring circuit 210 is used to connect to the host circuit 240. When the host circuit 240 is disconnected from the power supply, the power-off monitoring circuit 210 is used to output a first alarm signal to inform the switch that the power supply is disconnected.

[0059] like Figure 3 As shown, in one implementation, the relay detection circuit 220 includes a fifth current limiting resistor R5, a sixth current limiting resistor R6, a seventh current limiting resistor R7, an eighth current limiting resistor R8, a third transistor Q3, a second diode D2, a relay, and a sixth capacitor C6. Among them, the first end of the fifth current limiting resistor R5 is used to connect to the switch, the second end of the fifth current limiting resistor R5 is connected to the first end of the sixth current limiting resistor R5, the second end of the sixth current limiting resistor R6 is connected to the power supply VCC, the base of the third triode Q3 is connected to the series node of the fifth current limiting resistor R5 and the sixth current limiting resistor R6, the collector of the third triode Q3 is grounded, the emitter of the third triode Q3 is connected to the anode of the second diode D2, the cathode of the second diode D2 is connected to the series node of the seventh current limiting resistor R7 and the eighth current limiting resistor R8, the seventh current limiting resistor R7 is connected to the power supply VCC, the eighth current limiting resistor R8 is connected to the first end of the relay, the second end of the relay is connected to the series node of the third triode Q3 and the second diode D2, the first end of the sixth capacitor C6 is connected to the series node of the seventh current limiting resistor R7 and the eighth current limiting resistor R8, and the second end of the sixth capacitor C6 is grounded.

[0060] In this embodiment, the relay detection circuit 220 is used to detect the power-off state of the upper cascade device connected to the switch. When it is detected that the upper cascade device connected to the switch is in a power-off state, the switch receives a second alarm signal to inform the switch that the upper cascade device is in a power-off state.

[0061] like Figure 4 As shown, in one embodiment, the power-off buffer circuit 230 includes a second capacitor C2, a third capacitor C3, a fourth capacitor C4 and a fifth capacitor C5; a first end of the power-off buffer circuit 230 is used to connect to a power supply VCC, and a second end of the power-off buffer circuit 230 is used to connect to a switch; the second capacitor C2, the third capacitor C3, the fourth capacitor C4 and the fifth capacitor C5 are connected in parallel, and a parallel node of the second capacitor C2, the third capacitor C3, the fourth capacitor C4 and the fifth capacitor C5 is grounded.

[0062] In this embodiment, the power-off buffer circuit 230 is used to provide short-term power supply to the switch when the power input is suddenly disconnected, so that the switch host is still in working state. The power-off buffer circuit 230 needs to provide buffer power for a preset time. For example, the power-off buffer circuit 230 can provide power supply maintenance for at least 2 seconds to ensure that the switch can complete the capture of the first alarm signal and the second alarm signal and the sending of the power-off information message.

[0063] Specifically, the power-off monitoring circuit 210 cannot be located at the post-stage of the power-off buffer circuit 230, otherwise the power-off monitoring circuit 210 cannot detect whether the power input has been powered off in time, and cannot output the first alarm signal and the second alarm signal in time. Therefore, in the embodiment of the present application, the power-off monitoring circuit 210 and the power-off buffer circuit 230 are connected in parallel to ensure that the power-off monitoring circuit 210 and the power-off buffer circuit 230 do not interfere with each other.

[0064] Example 2

[0065] Figure 5 A flow chart of a power failure detection method according to an embodiment of the present application is shown. Exemplarily, the power failure detection method includes the following steps:

[0066] S110, monitor in real time whether the switch is disconnected from the power supply through the power failure monitoring circuit 210, and send a first alarm signal when the power fails.

[0067] S120, detecting the output state of the relay in the upper cascade device connected to the switch through the relay detection circuit 220, and sending a second alarm signal when the output state is a normally closed state.

[0068] Exemplarily, the relay detection circuit 220 is used to detect the power-off state of the upper cascade device connected to the switch. When it is detected that the upper cascade device connected to the switch is in the power-off state, the switch receives a second alarm signal to inform the switch that the upper cascade device is in the power-off state.

[0069] For example, in one embodiment, the switch host detects the output state of the relay in the upper cascade device connected to the switch through the relay detection circuit 220, and sends a second alarm signal when the output state is in a normally closed state. The power-off detection method includes: when the relay detection circuit 220 detects that the output state of the relay of the upper cascade device is in a normally closed state, sending the second alarm signal; when the relay detection circuit 220 detects that the output state of the relay of the upper cascade device is in a normally open state, not sending the second alarm signal.

[0070] Specifically, the first alarm signal and the second alarm signal are GPIO alarm signals. The GPIO input and output port is used as an alarm input. When the power failure monitoring circuit 210 and the relay detection circuit 220 detect a power failure, the GPIO input and output port outputs an electrical signal to send the first alarm signal and the second alarm signal to the switch.

[0071] S130, when the host circuit 240 receives the first alarm signal or the second alarm signal, it generates a power failure information message based on the buffer power provided by the power failure buffer circuit 230, and sends the power failure information message to the monitoring center.

[0072] Exemplarily, the host circuit 240 of the switch triggers an alarm interrupt through an interrupt mode, starts an interrupt service program to process the alarm information, generates a power-off information message of the switch or the upper-level cascade device connected to the switch, and reports the status information message to the monitoring center in a timely manner.

[0073] For example, in one embodiment, when the switch host receives the first alarm signal or the second alarm signal, a power-off information message is generated based on the buffer power provided by the power-off buffer circuit 230. The power-off detection method includes: receiving the first alarm signal or the second alarm signal by interruption, and when the power-off buffer circuit 230 provides the buffer power, generating the power-off information message based on the network management protocol. When generating the power-off information message, it also includes: recording the power-off log information of the switch in a log file.

[0074] Specifically, the power-off detection method connects the power-off monitoring circuit 210 and the relay detection circuit 220 through the GPIO input and output port, and the GPIO input and output port is connected to the switch host in an interrupt mode. If the GPIO input and output port triggers an interrupt at a low level, when the input end of the power supply is powered off, a first alarm signal and a second alarm signal in a low level state are generated; if the GPIO input and output port triggers an interrupt at a high level, when the input end of the power supply is powered off, a first alarm signal and a second alarm signal in a high level state are generated. The first alarm signal and the second alarm signal notify the switch host to handle the interrupt service process, and the interrupt service process includes: the switch host generates a switch power-off information message according to the network management protocol (SNMP) specification and sends it to the designated monitoring center, and records the log information of the switch when the power is off in the log file; and operates its own relay to disconnect the relay. Among them, the power-off information message of the switch includes recording the precise time when the switch is powered off, identifying the unique identifier of the switch, and informing the recipient of the power-off status of the switch. The log information of the switch when the power is off includes recording the precise time when the switch is powered off, identifying the power-off type of the log information, the switch model, the port status, the power status and other information.

[0075] Exemplarily, the output state of the dual-mode relay of the switch is a normally open state and a normally closed state. When the switch is in normal working state, the output state of the dual-mode relay of the switch is a normally open state. When the switch is in a power-off state, the output state of the dual-mode relay of the switch is a normally closed state.

[0076] For example, in one embodiment, the output state of the relay includes a normally open state and a normally closed state, and the power-off detection method also includes: when a first alarm signal or a second alarm signal is received, operating the output state of the relay for connecting the next cascade device to a normally closed state; when the first alarm signal or the second alarm signal is not received, maintaining the output state of the relay for connecting the next cascade device to a normally open state.

[0077] The present application also provides a switch. Exemplarily, the switch includes the power failure detection device 200 of embodiment 1. The power failure detection device 200 is used to execute the power failure detection method of embodiment 2.

[0078] Example 3

[0079] In this embodiment, the power failure detection method is applied to a switch system, which includes multiple switches, and the multiple switches are connected in a cascade manner to form a ring network, such as Figure 6 As shown, switch A, switch B, switch C, switch D and switch E are connected to each other through a ring Ethernet channel.

[0080] Exemplarily, the power failure detection method includes: any one switch performs power failure detection using the power failure detection method of embodiment 1, and after detecting the power failure, disconnects the relays of all cascaded devices in sequence.

[0081] In this embodiment, Figure 6 As shown, for each switch, the next cascade device connected to the switch can detect whether it is powered off. For example, the power-off detection of switch B can be completed autonomously, and the normally closed state of the relay of switch B can also be captured by switch C; the power-off detection of switch C can be completed autonomously, and the normally closed state of the relay of switch C can also be captured by switch D; the power-off detection of switch D can be completed autonomously, and the normally closed state of the relay of switch D can also be captured by switch E; the power-off detection of switch E can be completed autonomously, and the normally closed state of the relay of switch E can also be captured by switch A; the power-off detection of switch A can be completed autonomously, and the normally closed state of the relay of switch A can also be captured by the monitoring center. Among them, when the next cascade switch connected to the switch detects that the relay of the switch is in the normally closed state, the next cascade switch is used to generate a power-off information message of the switch, send the power-off information message to the monitoring center, and record the power-off information of the switch in the log file.

[0082] Exemplarily, when the upper cascade device connected to any of the switches is disconnected, the switch is also used to ensure normal data transmission in the ring network according to the ring network protocol and routing protocol of the upper cascade device. The ring network protocol is used to ensure that each switch in the ring network can pass data packets in sequence, thereby achieving smooth management of the ring network. Data packets need to be forwarded by multiple switches before they can reach the destination. The routing protocol is used to determine the switches through which the data packets need to be forwarded so that they can finally reach the destination.

[0083] In one embodiment, when any switch detects that the output state of the relay in the upper cascade device connected to itself is in a normally closed state, the power failure detection method also includes: processing the routing protocol and ring network protocol of the upper cascade device to determine the routing of the data packet and realize data transmission in the ring network.

[0084] In several embodiments provided in the present application, it should be understood that the disclosed devices and methods can also be implemented in other ways. The device embodiments described above are merely schematic. For example, the flowcharts and structure diagrams in the accompanying drawings show the possible architecture, functions and operations of the devices, methods and computer program products according to multiple embodiments of the present application. In this regard, each box in the flowchart or block diagram can represent a module, a program segment or a part of the code, and a part of the module, program segment or code contains one or more executable instructions for implementing the specified logical functions. It should also be noted that in an alternative implementation, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the structure diagram and / or the flow diagram, and the combination of boxes in the structure diagram and / or the flow diagram, can be implemented with a dedicated hardware-based system that performs a specified function or action, or can be implemented with a combination of dedicated hardware and computer instructions.

[0085] In addition, the functional modules or units in the various embodiments of the present application may be integrated together to form an independent part, or each module may exist separately, or two or more modules may be integrated to form an independent part.

[0086] If the function is implemented in the form of a software function module and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or the part of the technical solution, can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for a computer device (which can be a smart phone, a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods of each embodiment of the present application.

[0087] The above are only specific implementation methods of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be covered by the protection scope of the present application.

Claims

1. A power failure detection method, characterized in that: Applied to a switch, the method comprises: The power failure monitoring circuit monitors in real time whether the switch is disconnected from the power supply and sends a first alarm signal when the power fails; Detecting the output state of a relay in an upper cascade device connected to the switch through a relay detection circuit, and sending a second alarm signal when the output state is a normally closed state; When the host circuit receives the first alarm signal or the second alarm signal, it generates a power-off information message based on the buffer power provided by the power-off buffer circuit, and sends the power-off information message to the monitoring center.

2. The power failure detection method according to claim 1, characterized in that: When the host circuit receives the first alarm signal or the second alarm signal, generating a power-off information message based on the buffer power provided by the power-off buffer circuit includes: receiving the first alarm signal or the second alarm signal by interruption, and generating the power-off information message based on a network management protocol when the power-off buffer circuit provides a buffer power supply; When generating the power-off information message, it also includes: The power-off log information of the switch is recorded in a log file.

3. The power failure detection method according to claim 1, characterized in that: The output state of the relay includes a normally open state and a normally closed state, and the method further includes: When the host circuit receives the first alarm signal or the second alarm signal, the output state of the relay used to connect the next cascade device is operated to be a normally closed state; When the first alarm signal or the second alarm signal is not received, the output state of the relay for connecting the next cascade device is kept in a normally open state.

4. The power failure detection method according to claim 1, characterized in that: The method of detecting the output state of a relay in an upper cascade device connected to the switch through a relay detection circuit and sending a second alarm signal when the output state is a normally closed state includes: When the relay detection circuit detects that the output state of the relay of the upper cascade device is a normally closed state, sending the second alarm signal; When the relay detection circuit detects that the output state of the relay of the upper cascade device is in a normally open state, the second alarm signal is not sent.

5. A power failure detection method, characterized in that: Applied to a switch system, the switch system includes a plurality of switches, the plurality of switches are interconnected in a cascaded manner to form a ring network, the method includes: Any of the switches adopts the method of claims 1-4 to perform power failure detection, and after detecting the power failure, disconnects the relays of all cascaded devices in sequence.

6. The power failure detection method according to claim 5, characterized in that: When any of the switches detects that the output state of the relay in the upper cascade device connected to the switch is in a normally closed state, the method further includes: Process the routing protocol and ring network protocol of the upper cascade device to determine the routing of the data packet and realize the data transmission of the ring network.

7. A power failure detection device, characterized in that: include: A power failure monitoring circuit is used to monitor in real time whether the switch is disconnected from the power supply and to send out a first alarm signal when power is lost; A relay detection circuit, used for detecting the output state of a relay in an upper cascade device connected to the switch, and sending a second alarm signal when the output state is a normally closed state; A power-off buffer circuit, connected to the power supply, for providing a buffer power supply for a preset time after the switch loses power; The host circuit is connected to the power-off monitoring circuit and the relay detection circuit, and is used to generate a power-off information message when receiving the first alarm signal or the second alarm signal, and send the power-off information message to a monitoring center.

8. The power failure detection device according to claim 7, characterized in that: The power-off monitoring circuit comprises a first current limiting resistor, a second current limiting resistor, a third current limiting resistor, a fourth current limiting resistor, a first diode, a first capacitor, a first transistor and a second transistor; A first end of the first current limiting resistor is connected to a power supply, a second end of the first current limiting resistor is respectively connected to a first end of a second current limiting resistor and an anode of the first diode, a cathode of the first diode is connected to a first end of the first capacitor, a second end of the first capacitor is connected to a second end of the second current limiting resistor, and a second end of the second current limiting resistor is grounded; The emitter of the first transistor is connected to the series node of the first diode and the first capacitor, the base of the first transistor is connected to the first end of the third current limiting resistor, the second end of the third current limiting resistor is connected to a power supply, and the collector of the first transistor is connected to the first end of the fourth current limiting resistor; The second end of the fourth current limiting resistor is connected to the base of the second triode, the collector of the second triode is used to connect to the switch, and the emitter of the second triode is grounded.

9. The power failure detection device according to claim 7, characterized in that: The power-off buffer circuit includes a second capacitor, a third capacitor, a fourth capacitor and a fifth capacitor; The first end of the power-off buffer circuit is used to connect to a power supply, and the second end of the power-off buffer circuit is used to connect to the switch; The second capacitor, the third capacitor, the fourth capacitor and the fifth capacitor are connected in parallel, and a parallel node of the second capacitor, the third capacitor, the fourth capacitor and the fifth capacitor is grounded.

10. A switch, characterized in that: The switch comprises the power failure detection device of claims 7-9, and the power failure detection device is used to execute the power failure detection method of any one of claims 1-6.