Abnormality detection and processing method, device, equipment and medium for powered equipment
By combining passive and active detection modules in PoE technology, abnormalities in PD equipment can be accurately identified, which solves the problems of misjudgment and missed judgment in the existing technology, improves the efficiency of abnormality detection and recovery, and reduces costs.
Patent Information
- Application Number
- CN202410822165.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-24
- Publication Date
- 2024-09-06
- Estimated Expiration
- 2044-06-24
AI Technical Summary
Existing PoE technology has misjudgments and missed judgments in PD device anomaly detection, resulting in low efficiency and high cost of abnormality handling.
By detecting the port of the power supply equipment, the abnormal detection information of the powered equipment is determined, and detection messages are sent according to the service port type to proactively detect equipment abnormalities. Combining passive detection and active detection modules reduces misjudgments and missed determinations, and achieves accurate anomaly detection. and timely processing.
It improves the accuracy and efficiency of abnormal detection of PD equipment, reduces costs and ensures timely recovery of abnormal equipment.
Smart Images

Figure CN118381746B
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of Ethernet power supply, and in particular to a method, device, equipment and medium for detecting and processing abnormalities of a powered device. Background Art
[0002] PoE (Power over Ethernet) system, including power supply equipment (PSE, PowerSourcing Equipment) and powered device (PD, Power Device). PSE equipment can also provide power to PD equipment while transmitting data signals to PD equipment. Since PoE technology uses the same network cable to achieve data transmission and power supply for the same flashlight device, there is no need for additional power adapters and sockets, making full use of existing structured wiring, without the need for rewiring, and does not use traditional 220V AC power supply. Therefore, PoE technology has the characteristics of cost saving, good safety, and easy installation. Summary of the invention
[0003] The embodiments of the present application provide a method, apparatus, device and medium for detecting and processing abnormalities of powered devices, so as to realize accurate abnormality detection of PD devices, and further realize timely processing of abnormal devices, thereby improving the accuracy and efficiency of abnormality detection of PD devices, as well as the efficiency of abnormal recovery of PD devices, and saving costs.
[0004] An embodiment of the present application provides a method for detecting and processing abnormalities of a powered device, including:
[0005] Determine abnormal detection information of the powered device connected to the power supply device by detecting a port of the power supply device used to connect to the powered device;
[0006] When the abnormality detection information meets a preset condition, determining the type information of the service port of the powered device, and sending a detection message to the powered device according to the type information of the service port of the powered device and using a service protocol corresponding to the type of the service port of the powered device;
[0007] When it is determined that the powered device does not respond to the detection message, it is determined that the powered device is abnormal.
[0008] By using the method provided in the embodiment of the present application, the port of the power supply device used to access the powered device is detected, so that the abnormal detection information of the powered device connected to the power supply device can be determined; when the abnormal detection information meets the preset conditions, the type information of the service port of the powered device is further determined, and according to the type information of the service port of the powered device, a service protocol corresponding to the type of the service port of the powered device is adopted to send a detection message to the powered device; therefore, when it is determined that the powered device has no response to the detection message, it is finally determined that the powered device is abnormal, thereby achieving accurate and comprehensive abnormal detection of the PD device, reducing or avoiding misjudgment and missed judgment, and further achieving timely processing of abnormal devices, improving the accuracy and efficiency of PD device abnormal detection, and further improving the efficiency of subsequent PD device abnormal recovery, saving a lot of costs.
[0009] In some embodiments, according to the type information of the service port of the powered device, using a service protocol corresponding to the type of the service port of the powered device, sending a detection message to the powered device includes:
[0010] For a transmission control protocol TCP service port or a stream control transmission protocol SCTP service port of the powered device, a synchronization sequence number SYN message is sent to the powered device;
[0011] A UDP request message is sent to the powered device with respect to a User Datagram Protocol (UDP) service port of the powered device.
[0012] In some embodiments, the method further comprises:
[0013] If the powered device has no service port, a detection message is sent to the powered device via the Internet Control Message Protocol (ICMP).
[0014] In some embodiments, the abnormality detection information includes:
[0015] The power consumption information of the powered device and / or the flow information of the powered device.
[0016] In some embodiments, when the abnormality detection information includes power consumption information of the powered device within a preset time period, the preset condition includes:
[0017] The power consumption of the powered device within the preset time period exceeds a preset threshold corresponding to the preset time period.
[0018] In some embodiments, the method further comprises:
[0019] For a powered device newly connected to the power supply device, when it is determined that a preset direct power-on condition is met, a power-on process is performed on the powered device newly connected to the power supply device.
[0020] In some embodiments, after determining that the powered device is abnormal, the method further includes:
[0021] An abnormal recovery process is performed on the powered device.
[0022] An embodiment of the present application provides an abnormality detection and processing device for a powered device, comprising:
[0023] A passive detection module, used to determine abnormal detection information of a powered device connected to the power supply device by detecting a port of a power supply device used to connect to the powered device;
[0024] An active detection module is used to determine the type information of the service port of the powered device when the abnormal detection information meets a preset condition, and according to the type information of the service port of the powered device, adopt a service protocol corresponding to the type of the service port of the powered device to send a detection message to the powered device; when it is determined that the powered device has no response to the detection message, determine that the powered device is abnormal.
[0025] Another embodiment of the present application provides an electronic device, which includes a memory and a processor, wherein the memory is used to store program instructions, and the processor is used to call the program instructions stored in the memory and execute any of the above methods according to the obtained program.
[0026] Another embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer-executable instructions, and the computer-executable instructions are used to enable the computer to execute any of the above methods. BRIEF DESCRIPTION OF THE DRAWINGS
[0027] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0028] Figure 1 A schematic diagram of the overall process of an abnormality detection and processing method for a powered device provided in an embodiment of the present application;
[0029] Figure 2 A schematic diagram of the structure of an abnormality detection and processing device for a powered device provided in an embodiment of the present application;
[0030] Figure 3 A schematic diagram of a specific processing flow of a power supply module provided in an embodiment of the present application;
[0031] Figure 4 A schematic diagram of a specific processing flow of a passive detection module provided in an embodiment of the present application;
[0032] Figure 5 A schematic diagram of a specific processing flow of an active detection module provided in an embodiment of the present application;
[0033] Figure 6 A schematic diagram of a specific processing flow of a management module provided in an embodiment of the present application;
[0034] Figure 7 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0035] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0036] The embodiments of the present application provide a method, apparatus, device and medium for detecting and processing abnormalities of powered devices, so as to realize accurate abnormality detection of PD devices, and further realize timely processing of abnormal devices, thereby improving the accuracy and efficiency of abnormality detection of PD devices, as well as the efficiency of abnormal recovery of PD devices, and saving costs.
[0037] Among them, the method and the device, equipment, and medium are based on the same application concept. Since the principles of solving problems by the method and the device, equipment, and medium are similar, the implementation of the device, equipment, medium, and method can refer to each other, and the repeated parts will not be repeated.
[0038] The terms "first", "second", etc. (if any) in the specification and claims of the embodiments of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments described herein can be implemented in a sequence other than the content illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0039] The following examples and embodiments are to be understood as illustrative examples only. Although this specification may refer to "one", "an" or "some" examples or embodiments in several places, this does not mean that each such reference relates to the same example or embodiment, nor does it mean that the feature applies only to a single example or embodiment. Individual features of different embodiments may also be combined to provide other embodiments. In addition, terms such as "including" and "comprising" should be understood as not limiting the described embodiments to only those features that have been mentioned; such examples and embodiments may also include features, structures, units, modules, etc. that are not specifically mentioned.
[0040] The following is a detailed description of each embodiment of the present application in conjunction with the accompanying drawings. It should be noted that the display order of the embodiments of the present application only represents the order of the embodiments, and does not represent the advantages and disadvantages of the technical solutions provided by the embodiments.
[0041] In the embodiment of the present application, the PSE device transmits data to the PD device while supplying power to the PD device, and the PD device obtains the required power consumption from the PSE device. In addition, the PSE device manages the PD device connected thereto, thereby reducing the cost of manual intervention and saving the processing time of abnormal detection of the PD device, and the abnormal detection of the PD device is more accurate and timely.
[0042] The PSE device may be, for example, a PoE switch, or other devices.
[0043] For abnormal detection of PD devices, for example, whether the PD device is abnormal can be determined by counting whether the number of sent and received messages of the PD device connected to the PSE device port within a certain period of time is 0.
[0044] It can be seen that this abnormality detection method for PD devices is a passive method. This passive method relies on the active message interaction between the PD device and the outside world. It can detect abnormal conditions of PD devices to a certain extent. However, if the PD device itself has no message interaction behavior within this time period, the PSE device is prone to misjudgment and incorrectly performs abnormal recovery operations on the PD device.
[0045] Therefore, an active method for detecting abnormalities of PD devices is further proposed in the embodiment of the present application, that is, the PSE device side will actively interact with the connected PD device through messages. For example, the PSE device side will actively sense which upper layer services are provided by the connected PD device, such as User Datagram Protocol (UDP) and Transmission Control Protocol (TCP) services. The perception method is, for example, to analyze the network messages of the connected PD device to determine the services provided by the PD device, such as web services, Domain Name System (DNS) or Dynamic Host Configuration Protocol (DHCP) services. These services are characterized by providing service ports to the outside, such as port 80 or port 443 of the web service. The PSE device side simulates user behavior and requests the PD device for the services it provides. If the PD device can respond to the request, it means that the PD device is currently in a normal state. Otherwise, it is determined that the PD device is abnormal. In addition, there may be other active methods, such as the PSE device sending a keep-alive packet to the PD device, etc., and it may also actively detect and sense whether the PD device is abnormal.
[0046] In summary, in the embodiments of the present application, active and passive methods for abnormal detection of PD devices can be used to more comprehensively, accurately and timely sense whether the PD device is abnormal, thereby reducing misjudgments and missed judgments. Example
[0047] See also Figure 1 The embodiment of the present application provides an abnormality detection and processing method for a powered device, which can be applied to a power supply device, for example. The method includes:
[0048] S101, determining abnormal detection information of a powered device connected to the power supply device by detecting a port of a power supply device used to connect to the powered device;
[0049] This step can be understood as the above-mentioned passive abnormality detection.
[0050] In some embodiments, the abnormality detection information includes:
[0051] The power consumption information of the powered device and / or the flow information of the powered device.
[0052] In some embodiments, the power consumption information of the powered device includes peak power consumption and / or average power consumption of the powered device in at least one preset time period.
[0053] In some embodiments, the traffic information of the powered device includes traffic in a data receiving (RX) and / or data sending (TX) direction of the powered device.
[0054] S102, when the abnormality detection information meets a preset condition, determining the type information of the service port of the powered device, and sending a detection message to the powered device according to the type information of the service port of the powered device and using a service protocol corresponding to the type of the service port of the powered device;
[0055] This step can be understood as the above-mentioned active abnormality detection.
[0056] The preset conditions can be determined according to actual needs and are not limited in the embodiments of the present application. In addition, different preset conditions can be set for different abnormal detection information. Then, in some embodiments, when any one or more of the conditions are met, the type information of the service port of the powered device is determined, and according to the type information of the service port of the powered device, a service protocol corresponding to the type of the service port of the powered device is used to send a detection message to the powered device.
[0057] For example, in some embodiments, in order to more accurately perceive the abnormal power consumption of the powered device, the power consumption information of the powered device within a preset time period may be detected, so the preset conditions may include, for example:
[0058] The power consumption of the powered device within the preset time period exceeds the preset threshold corresponding to the preset time period. That is, different thresholds can be set according to different time periods, so that the abnormal power consumption of the powered device can be further and more accurately perceived.
[0059] In some embodiments, according to the type information of the service port of the powered device, using a service protocol corresponding to the type of the service port of the powered device, sending a detection message to the powered device includes:
[0060] For a transmission control protocol TCP service port or a stream control transmission protocol SCTP service port of the powered device, a synchronization sequence number SYN message is sent to the powered device;
[0061] A UDP request message is sent to the powered device with respect to a User Datagram Protocol (UDP) service port of the powered device.
[0062] In some embodiments, the method further comprises:
[0063] If the powered device has no service port, a detection message is sent to the powered device via the Internet Control Message Protocol (ICMP).
[0064] S103: When it is determined that the powered device has no response to the detection message, determine that the powered device is abnormal.
[0065] In some embodiments, after determining that the powered device is abnormal, the method further includes:
[0066] Perform abnormal recovery processing on the powered device, for example, re-powering the abnormal powered device, so that the powered device returns to normal.
[0067] In some embodiments, the method further comprises:
[0068] For a powered device newly connected to the power supply device, when it is determined that a preset direct power-on condition is met, a power-on process is performed on the powered device newly connected to the power supply device.
[0069] The preset direct power-on condition is, for example, a condition set by the user, or the port of the PSE device is a preset marked port. This allows the powered device that needs to be powered on to be directly forced to be powered on, skipping the power supply detection process, and avoiding the situation where some non-standard PD devices or PD devices with abnormal detection circuits cannot be powered on when connected to the PSE device. Example
[0070] An abnormality detection and processing device for a PD device provided in an embodiment of the present application may be, for example, a power supply device (i.e., a PSE device) or an internal device of a power supply device, and the device includes:
[0071] A passive detection module, used to determine abnormal detection information of a powered device connected to the power supply device by detecting a port of a power supply device used to connect to the powered device;
[0072] An active detection module is used to determine the type information of the service port of the powered device when the abnormal detection information meets a preset condition, and according to the type information of the service port of the powered device, adopt a service protocol corresponding to the type of the service port of the powered device to send a detection message to the powered device; when it is determined that the powered device has no response to the detection message, determine that the powered device is abnormal.
[0073] Of course, in addition to this, the abnormality detection and processing device for the powered device provided in the embodiment of the present application may also include other functional modules.
[0074] For example, see Figure 2 The abnormality detection and processing device for the powered device provided in the embodiment of the present application includes the following four modules:
[0075] Power supply module 01: directly powers on the PD device connected to the PSE device, or performs insertion detection and classification on the PD device according to the IEEE802.3AF / AT / BT standard. That is, the power supply module 01 is used to execute the power-on, power-off, and restart instructions for the PD device issued by the management module 02.
[0076] Management module 02: Manage the status of PD devices, determine whether to power on, power off or restart the PD device, and provide users with switches to directly power on non-standard devices. For example, a PoE switch performs power on and off operations on connected PD devices. The non-standard device refers to a PD device that does not conform to the IEEE802.3AF / AT / BT standard design. For example, a PoE switch cannot identify it through normal detection and classification methods. The PoE switch can use the forced power supply function to skip the normal detection and classification.
[0077] Passive detection module 03: Count the message receiving and sending traffic of the port to which the PD device is connected, detect the power consumption of the PD device connected to the port, such as the peak power consumption and average power consumption of the connected PD device; and record the message interaction information of the port to which the PD device is connected (information such as the IP address and port number of the message), so as to perceive the service port provided by the connected PD device. The specific perception method, for example, can be to parse the message exchanged between the PSE device and the PD device, perceive the service port provided by the connected PD device, and specifically parse the layer 3 and layer 4 headers in the TCP / IP message to obtain the service port provided by the PD device, such as port 80 for WEB service, port 53 for DNS service, port 443 for HTTPS service, etc.
[0078] That is to say, the passive detection module 03 can count the message information of the port to which the PD device is connected, mainly identify the IP and port number of the message, and identify the services provided by the PD device to the outside world, so that it can subsequently simulate the interaction between the client and the PD device to determine whether the PD device is abnormal.
[0079] Active detection module 04: actively initiates port scanning to scan the service port of the connected PD device to see if it is still alive, so as to determine whether the PD device is in an abnormal state. Port scanning technology can be used to assist in determining whether the service port provided by the PD device is normal, for example:
[0080] Transmission Control Protocol (TCP) port scan;
[0081] User Datagram Protocol (UDP) port scan;
[0082] Stream Control Transmission Protocol (SCTP) port scan;
[0083] Internet Control Message Protocol (ICMP) port scan.
[0084] Among them, the service ports commonly provided by PD devices are as follows:
[0085] TCP: port 80, TCP: port 443, UDP: port 53, UDP: port 67, etc.;
[0086] For example, for the TCP service port of the PD device (such as TCP: port 80, TCP: port 443, etc.), a Synchronize Sequence Numbers (SYN) message can be sent to the TCP service port of the PD device to initiate a handshake, and whether an acknowledgment (ACK) message fed back by the PD device is received to determine whether the TCP service port of the PD device is normal.
[0087] Specifically, for example, for the web service corresponding to TCP:80 port, you can send a TCP three-way handshake message to the PD device and try to do a three-way handshake with the PD device. If the TCP:80 port of the PD device responds, it means that the PD device is normal. Of course, in order to reduce message interaction, you can also do only one handshake, that is, the PSE device simulates the client to send a SYN packet to the server, that is, the PD device, and wait for the server to reply with an ACK packet within a preset time. If the ACK packet is received, it means that the server is normal, otherwise, it means that the server is abnormal.
[0088] For another example, for the UDP service port of the PD device (such as UDP: port 53, UDP: port 67, etc.), a UDP request message can be directly sent to the UDP port of the PD device, and whether the UDP service port of the PD device is normal can be determined by whether an ICMP destination unreachable message is received in reply from the PD device.
[0089] It can be seen that the above four modules are interdependent. Specifically, the power supply module 01 receives the power-on, power-off and restart instructions issued by the management module 02, and performs related operations; the management module 02 obtains the detection results provided by the passive detection module 03 and the active detection module 04, and based on this, determines whether the connected PD device is in an abnormal state; the passive detection module 03 obtains the power-on status of the connected PD device from the management module 02, and starts to monitor the connected PD device after the connected PD device is powered on normally; the active detection module 04 obtains the service port of the connected PD device provided by the passive detection module 03, thereby sensing the abnormal situation of the service port of the connected PD device.
[0090] It should be noted that the division of modules in the embodiments of the present application is schematic and is only a logical function division. There may be other division methods in actual implementation. In addition, each functional module in each embodiment of the present application may be integrated into a processing module, or each module may exist physically separately, or two or more modules may be integrated into one module. The above-mentioned integrated modules may be implemented in the form of hardware or in the form of software functional modules.
[0091] If the integrated module 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 is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions to enable a computer device (which can be a personal computer, server, or network device, etc.) or a processor (processor) to execute all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), disk or optical disk and other media that can store program code.
[0092] For each of the above modules, the specific processing flow is introduced as follows: Example
[0093] like Figure 3 As shown, the specific processing flow of the power supply module includes, for example:
[0094] S201 , determining whether the powered device is powered on directly, if so, executing step S204 , otherwise, executing step S202 .
[0095] For example, it is determined whether the power supply device is set to force power supply. If so, the detection level can be skipped, and as long as a powered device is plugged into the power supply device, the plugged powered device will be powered.
[0096] That is to say, in some embodiments, for PD devices that need to be powered on but cannot be powered on normally, a configuration interface or configuration interface can also be provided to the user, so that the user can directly power on the connected PD device by configuring the forced power supply function of the PSE device port.
[0097] S202: Detect whether the port is plugged into a powered device.
[0098] The port is the network port of the PSE device, such as the RJ45 network port of a PoE switch.
[0099] S203: Perform a graded detection on the inserted powered device.
[0100] Regarding how to detect whether a PD device is inserted and how to classify it, for example, a characteristic resistor is set inside the PD device to mark its corresponding level (class). These levels correspond to their own rated power consumption information, that is, the different levels of the powered device can be distinguished by using the different sizes of the characteristic resistors of the powered device.
[0101] The PoE switch applies a preset voltage difference to the external port of the PoE switch (i.e., the port used to connect the powered device) to detect the current value of the port loop, and calculates the characteristic resistance in the port loop based on this, that is, determines the characteristic resistance of the powered device. In this way, it can not only determine whether there is a powered device plugged in to the port, but also determine the level of the plugged powered device.
[0102] S204. Power on the powered devices that meet the preset conditions.
[0103] The preset conditions can be set according to actual needs, for example:
[0104] In some embodiments, a PD device with a level higher than a preset value may be powered on, and if the level does not meet the preset condition, it may not be powered on. That is, the preset condition at this time includes that the level is higher than the preset value.
[0105] In some embodiments, the PSE device may also be provided with a port such as a VIP, that is, one or more specific ports are preset (for example, they may be marked by a port identifier) to force power on a PD device that has failed the classification test for multiple consecutive times (the specific number may be determined according to actual needs and is not limited in the embodiments of the present application) (that is, the level is not higher than the preset value) and is connected through the preset port. That is, the preset conditions at this time include: the PD device is connected to the PSE device through a preset specific port, and the PD device level determined by multiple consecutive classification tests is not higher than the preset value.
[0106] Due to PD device abnormalities, including situations where PD devices cannot be powered (i.e., hardware abnormalities), the characteristics are: abnormal detection circuits and non-standard designs of PD devices. Therefore, in response to this situation, for PD devices that need to be powered on but cannot be powered on normally, forced power is provided, that is, the connected PD devices are powered on directly. Thus, by skipping the power supply detection process, the PD devices that need to be powered on can be powered on directly, avoiding situations where some non-standard PD devices or PD devices with abnormal detection circuits cannot be powered on when connected to the PoE switch.
[0107] S205, determining whether a power-off instruction issued by the power supply device to the powered device is received, if so, executing step S206, otherwise, executing step S205, i.e. continuing to monitor whether a power-off instruction issued by the power supply device to the powered device is received.
[0108] S206 . Based on the power-off instruction, power off the powered device corresponding to the power-off instruction. Example
[0109] like Figure 4 As shown, the specific processing flow of the passive detection module includes, for example:
[0110] S301, determine whether the port is powered on, if yes, execute step S302, otherwise, execute step S301, that is, continue to monitor whether the port is powered on.
[0111] The port refers to a port provided by the PSE device to the outside, such as an RJ45 network port of a PoE switch.
[0112] S302: monitor the power consumption of the port in real time and collect statistics on the power consumption information of the PD device.
[0113] In some embodiments, the power consumption information includes, for example: peak power consumption and / or average power consumption.
[0114] Due to the abnormal situation of the PD device, including the short circuit of the PD device (i.e., hardware abnormality), its characteristics are reflected in: abnormal power consumption, i.e., overcurrent or exceeding a certain threshold. Therefore, in view of this situation, in the embodiment of the present application, the power consumption of the port can be monitored in real time, for example, the peak power consumption and average power consumption of the PD device during normal operation can be counted.
[0115] In some embodiments, the power consumption information includes, for example, power consumption information of a PD device within a preset time period.
[0116] The normal working period may be a setting interface provided to the user according to the user's needs, and the user may set the specific time by himself, for example, 9 am to 5 pm. It is mainly aimed at the peak period of PD device operation. For example, a common PD device is a camera. The camera is in the normal working period of the device during the day, and some cameras may be in a low power consumption state at night. Therefore, the peak power consumption and average power consumption of the camera during the normal working period can be counted.
[0117] The preset time period may also be a plurality of different time periods. By learning the power consumption of the connected PD device and recording the power consumption of the PD device in different time periods, the abnormal power consumption of the PD device can be more accurately perceived.
[0118] S303: Collect statistics on PD device message interaction information, and obtain service port information provided by the PD device through the layer 3 header of the message.
[0119] The message layer 3 header is the network layer and protocol layer in the TCP / IP seven-layer model. Through the message layer 3 header, the IP and port number of the message can be obtained.
[0120] S304: Monitor the traffic in the data receiving (RX) and data sending (TX) directions of the PD device.
[0121] Due to the abnormal situation of the PD device, including the PD device running dead (i.e., software abnormality), its characteristics are reflected in: abnormal traffic, and no service on the external service port of the PD device. Therefore, in view of this situation, the data receiving (RX) and / or data sending (TX) direction traffic of the PD device can be monitored in the embodiment of the present application.
[0122] S305: Determine whether the power consumption of the PD device is overcurrent or reaches the current limit. If yes, execute step S307; otherwise, execute step S306.
[0123] The power consumption of the PD device includes the peak power consumption and / or average power consumption of the PD device during normal working period counted in step S302.
[0124] This step can determine whether the peak power consumption and / or average power consumption of the PD device during normal operation exceeds a preset threshold. If so, execute step S307; otherwise, execute step S306.
[0125] In some embodiments, the passive detection module can learn the power consumption of the port where the PD device is connected to the PSE device, so as to better grasp the power consumption of the PD device in different time periods, and thus more accurately determine the abnormality of the PD device. For example, through learning, it is recorded that the PD device consumes 1W of power at 0:00 every day and 5W at 8:00. The power consumption of the PD device is the same for 30 consecutive days, and the error does not exceed the preset value. However, suddenly at 0:00 one day, the PD device consumes 20W, then it can be determined that the power consumption of the PD device is abnormal. In the courseware, this power consumption abnormality judgment is mainly through learning the power consumption of the PD device in different time periods, establishing a database, and marking the changes in power consumption of the PD device in different time periods.
[0126] S306: Determine whether the traffic is abnormal. If so, execute step S307; otherwise, execute step S301.
[0127] For example, the PoE switch message statistics function can be used to obtain the total number of messages flowing into the PoE switch from the PD device access port within a preset time length, such as one minute or more minutes. Specifically, the traffic statistics for the PD device include traffic statistics in the receiving direction and / or traffic statistics in the sending direction.
[0128] For example, in the RX (receive) direction, if the total number of messages counted by the PD device is 0, it means that the PD device has not sent out a message within the preset time length. It is very likely that the PD device has crashed internally. Therefore, it can be determined that the traffic of the PD device is abnormal and the PD device needs to be restarted.
[0129] S307: Notify the management module to issue a power-off instruction to the PD device. Example
[0130] like Figure 5 As shown, the specific processing flow of the active detection module includes, for example:
[0131] S401: Determine that port traffic is abnormal.
[0132] There are many ways to determine whether port traffic is abnormal, such as:
[0133] Method 1: For any port of the PSE device, if the total number of messages in one direction (sending and / or receiving) of the port is found to be 0, the port will be marked as abnormal. Then the active detection module can determine whether the port traffic is abnormal by monitoring whether the port has an abnormal mark. If there is an abnormal mark, it is determined that the port traffic is abnormal. Then the active detection mode can be turned on, that is, the subsequent steps are executed. Otherwise, the port of the PSE device continues to be monitored for abnormal marks.
[0134] Mode 2: When the passive detection module determines that the port traffic is abnormal, it can also send a notification to the active detection module. Then, the active detection module can also determine that the port traffic is abnormal when receiving the notification of the port traffic abnormality sent by the passive detection module.
[0135] Method three: receiving notification from the management module, for example, when the management module receives a power-off instruction from the passive detection module for the PD device, it will further notify the active detection module to trigger the active detection module to further confirm whether the PD device is abnormal, such as the specific trigger operation described in the subsequent step S502.
[0136] S402: Check the service port type of the PD device obtained by the passive detection module.
[0137] Among them, the service port type, that is, the service port number, different TCP and UDP port numbers correspond to different services, for example, UDP: port number 53 corresponds to DNS service, TCP: port number 80 corresponds to web service, etc.
[0138] S403: Initiate a three-way handshake to the PD device through the TCP / SCTP service to confirm whether the service port of the PD device is normal.
[0139] S404: directly initiate a data request to the PD device through the UDP service, and wait for the PD device to return an ICMP port unreachable message.
[0140] S405: If the PD device has no external service port, use ICMP to detect whether the PD device is reachable.
[0141] For example, if the PD device has no external service port, use the ping command + IP method to try to detect whether the PD device can be pinged. If the external service IP of the PD device is 8.8.8.8, use ping 8.8.8.8 (actually sending ICMP packets) to determine whether the PD device (server) with the external service IP of 8.8.8.8 is reachable.
[0142] The above steps S403, S404 and S405 may be executed in parallel or sequentially, and the order is not limited.
[0143] S406, determine whether the service port of the PD device is unresponsive, if so, execute step S407, otherwise, end the processing for the PD device, and the processing for other connected PD devices is similar.
[0144] S407: Notify the management module to issue a power-off instruction to the PD device. Example
[0145] like Figure 6 As shown, the specific processing flow of the management module includes, for example:
[0146] S501, receiving a power-off instruction for a PD device sent by a passive detection module;
[0147] That is, when the passive detection module determines that the connected PD device is abnormal, it sends a power-off instruction to the management module. When the management module receives the instruction, it needs to perform the following steps.
[0148] S502, notifying the active detection module of the abnormal flow event of the PD device;
[0149] That is to say, this step is used to trigger the active detection module to further confirm whether there is any abnormality with the PD device. When the passive detection module determines that the connected PD device is abnormal, it records the abnormal traffic event of the PD device. When the management module receives the power-off instruction for the PD device sent by the passive detection module, it can obtain the abnormal traffic event of the PD device and notify the active detection module to further confirm whether the PD device is abnormal.
[0150] S503, determine whether a power-off instruction for the PD device sent by the active detection module is received. If yes, execute step S504; otherwise, end the judgment process of whether to power off the PD device, that is, there is no need to power off the PD device.
[0151] S504: Send a power-off instruction to the PD device.
[0152] That is to say, in the embodiment of the present application, after the PD device is found to be abnormal in the passive mode, the active mode can be further used to detect and confirm whether the PD device is abnormal. If the abnormality is confirmed again, the connected PD device is finally confirmed to be abnormal, and the PSE device side powers off the PD device. Through the active and passive methods, the misjudgment of abnormal PD devices is reduced, thereby reducing the situation of erroneous power-off of PD devices that are working normally, and better improving the user experience.
[0153] In some embodiments, the method provided by the embodiment of the present application also includes: recovery for abnormal powered equipment.
[0154] In some embodiments, a recovery method for an abnormal powered device is provided, for example: after the power supply device detects that the powered device is abnormal, it issues a power-off instruction to power off the abnormal powered device, and after waiting for a preset period of time (for example, n seconds, where n is a number greater than 0), the power supply module in the power supply device re-powers on the powered device to achieve the purpose of restarting the abnormal device.
[0155] For example, the PoE switch sends a power-off control instruction to an abnormal PD device through the port through which the PD device is connected to the PoE switch, thereby controlling the PD device to be powered off, and then sends a power-on control instruction through the port through which the PD device is connected to the PoE switch, thereby controlling the PD device to restart and power on.
[0156] The electronic device provided in an embodiment of the present application is introduced below, wherein explanations or examples of technical features that are the same as or corresponding to those described in the above method will not be repeated later. Example
[0157] An electronic device provided in an embodiment of the present application, for example, may be a power supply device PoE switch, etc., or may be any other device with a power supply function, see Figure 7 , the electronic device includes, for example:
[0158] The processor 600 is used to read the program in the memory 620 and execute the following process:
[0159] Determine abnormal detection information of the powered device connected to the power supply device by detecting a port of the power supply device used to connect to the powered device;
[0160] When the abnormality detection information meets a preset condition, determining the type information of the service port of the powered device, and sending a detection message to the powered device according to the type information of the service port of the powered device and using a service protocol corresponding to the type of the service port of the powered device;
[0161] When it is determined that the powered device does not respond to the detection message, it is determined that the powered device is abnormal.
[0162] In some embodiments, according to the type information of the service port of the powered device, using a service protocol corresponding to the type of the service port of the powered device, sending a detection message to the powered device includes:
[0163] For a transmission control protocol TCP service port or a stream control transmission protocol SCTP service port of the powered device, a synchronization sequence number SYN message is sent to the powered device;
[0164] A UDP request message is sent to the powered device with respect to a User Datagram Protocol (UDP) service port of the powered device.
[0165] In some embodiments, the processor 600 is further configured to read a program in the memory 620 and execute the following process:
[0166] If the powered device has no service port, a detection message is sent to the powered device via the Internet Control Message Protocol (ICMP).
[0167] In some embodiments, the abnormality detection information includes:
[0168] The power consumption information of the powered device and / or the flow information of the powered device.
[0169] In some embodiments, when the abnormality detection information includes power consumption information of the powered device within a preset time period, the preset condition includes:
[0170] The power consumption of the powered device within the preset time period exceeds a preset threshold corresponding to the preset time period.
[0171] In some embodiments, the processor 600 is further configured to read a program in the memory 620 and execute the following process:
[0172] For a powered device newly connected to the power supply device, when it is determined that a preset direct power-on condition is met, a power-on process is performed on the powered device newly connected to the power supply device.
[0173] In some embodiments, after determining that the powered device is abnormal, the processor 600 is further configured to read a program in the memory 620 and execute the following process:
[0174] An abnormal recovery process is performed on the powered device.
[0175] The transceiver 610 is configured to receive and send data under the control of the processor 600 .
[0176] Among them, Figure 7In the embodiment, the bus architecture may include any number of interconnected buses and bridges, specifically one or more processors represented by processor 600 and various circuits of memory represented by memory 620 are linked together. The bus architecture may also link together various other circuits such as peripherals, voltage regulators, and power management circuits, which are well known in the art and are therefore not further described herein. The bus interface provides an interface. The transceiver 610 may be a plurality of components, namely, a transmitter and a receiver, providing a unit for communicating with various other devices on a transmission medium, including wireless channels, wired channels, optical cables, and other transmission media. For different user devices, the user interface 630 may also be an interface capable of externally and internally connecting required devices, and the connected devices include but are not limited to a keypad, a display, a speaker, a microphone, a joystick, and the like.
[0177] The processor 600 is responsible for managing the bus architecture and general processing, and the memory 620 can store data used by the processor 600 when performing operations.
[0178] In some embodiments, the processor 600 may be a CPU (central processing unit), an ASIC (Application Specific Integrated Circuit), an FPGA (Field-Programmable Gate Array) or a CPLD (Complex Programmable Logic Device), and the processor may also adopt a multi-core architecture.
[0179] The processor calls the computer program stored in the memory to execute any of the methods provided in the embodiments of the present application according to the obtained executable instructions. The processor and the memory can also be arranged physically separately.
[0180] It should be noted here that the above-mentioned device provided in the embodiment of the present application can implement all the method steps implemented in the above-mentioned method embodiment, and can achieve the same technical effect. The parts and beneficial effects of this embodiment that are the same as those in the method embodiment will not be described in detail here.
[0181] Any of the devices or apparatuses provided in the embodiments of the present application may specifically be a desktop computer, a portable computer, a smart phone, a tablet computer, a personal digital assistant (PDA), etc. It may include a central processing unit (CPU), a memory, an input / output device, etc. The input device may include a keyboard, a mouse, a touch screen, etc. The output device may include a display device, such as a liquid crystal display (LCD), a cathode ray tube (CRT), etc.
[0182] The memory may include a read-only memory (ROM) and a random access memory (RAM), and provides the processor with program instructions and data stored in the memory. In the embodiment of the present application, the memory may be used to store the program of any of the methods provided in the embodiment of the present application.
[0183] The processor calls the program instructions stored in the memory, and the processor is used to execute any of the methods provided in the embodiments of the present application according to the obtained program instructions.
[0184] The present application embodiment also provides a computer program product or computer program, which includes a computer instruction, which is stored in a computer-readable storage medium. The processor of the computer device reads the computer instruction from the computer-readable storage medium, and the processor executes the computer instruction so that the computer device performs any of the methods described in the above embodiments. The program product can use any combination of one or more readable media. The readable medium can be a readable signal medium or a readable storage medium. The readable storage medium can be, for example, - but not limited to - an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of readable storage media (non-exhaustive list) include: an electrical connection with one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above.
[0185] The embodiment of the present application provides a computer-readable storage medium for storing computer program instructions used by the apparatus provided in the embodiment of the present application, which includes a program for executing any of the methods provided in the embodiment of the present application. The computer-readable storage medium may be a non-transitory computer-readable medium.
[0186] The computer-readable storage medium can be any available medium or data storage device that can be accessed by a computer, including but not limited to magnetic storage (such as floppy disks, hard disks, magnetic tapes, magneto-optical disks (MO), etc.), optical storage (such as CD, DVD, BD, HVD, etc.), and semiconductor storage (such as ROM, EPROM, EEPROM, non-volatile memory (NANDFLASH), solid-state drive (SSD)), etc.
[0187] It should be understood that:
[0188] The access technology through which entities in the communication network transmit traffic can be any suitable current or future technology, such as WLAN (Wireless Local Access Network), WiMAX (Worldwide Interoperability for Microwave Access), LTE, LTE-A, 5G, Bluetooth, infrared, etc.; in addition, the embodiments can also apply wired technology, for example, IP-based access technology, such as a wired network or a fixed line.
[0189] Embodiments suitable for being implemented as software code or a portion thereof and running using a processor or processing functionality are independent of the software code and may be specified using any known or future developed programming language, such as a high-level programming language such as objective-C, C, C++, C#, Java, Python, Javascript, other scripting languages, etc., or a low-level programming language such as machine language or assembler.
[0190] The implementation of the embodiments is hardware independent and may be implemented using any known or future developed hardware technology or any mixture thereof, such as a microprocessor or CPU (central processing unit), MOS (metal oxide semiconductor), CMOS (complementary MOS), BiMOS (bipolar MOS), BiCMOS (bipolar CMOS), ECL (emitter coupled logic) and / or TTL (transistor-transistor logic).
[0191] Embodiments may be implemented as separate devices, apparatuses, units, components, or functions, or in a distributed manner, for example, one or more processors or processing functions may be used or shared in a process, or one or more processing segments or processing portions may be used and shared in a process, wherein one physical processor or more than one physical processor may be used to implement one or more processing portions dedicated to a specific process as described.
[0192] The device may be implemented by a semiconductor chip, a chipset, or a (hardware) module including such a chip or chipset.
[0193] The embodiments may also be implemented as any combination of hardware and software, such as ASIC (Application Specific IC (Integrated Circuit)) components, FPGA (Field Programmable Gate Array) or CPLD (Complex Programmable Logic Device) components or DSP (Digital Signal Processor) components.
[0194] The embodiments may also be implemented as a computer program product including a computer usable medium having computer readable program code embodied therein, the computer readable program code being adapted to perform the processes as described in the embodiments, wherein the computer usable medium may be a non-transitory medium.
[0195] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present application may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage and optical storage, etc.) containing computer-usable program codes.
[0196] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0197] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0198] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0199] Obviously, those skilled in the art can make various changes and modifications to the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is also intended to include these modifications and variations.
Claims
1. A method for detecting and processing abnormalities of a powered device, characterized in that: The method comprises: Detecting the port of the power supply device used to access the powered device through a passive detection module, determining abnormal detection information of the powered device connected to the power supply device; and recording message interaction information of the port of the power supply device used to access the powered device, the message interaction information including the port number of the message exchanged between the powered device and the power supply device, the port number being type information of the service port of the powered device; When the abnormal detection information meets the preset conditions, the type information of the service port of the powered device is obtained from the passive detection module through the active detection module, and according to the type information of the service port of the powered device, a service protocol corresponding to the type of the service port of the powered device is adopted to send a detection message to the powered device; when it is determined that the powered device has no response to the detection message, the powered device is determined to be abnormal, and a power-off instruction for the powered device is sent to the management module; When the management module receives the power-off instruction for the powered device sent by the active detection module, the management module sends the power-off instruction to the powered device.
2. The method according to claim 1, characterized in that The method of sending a detection message to the powered device according to the type information of the service port of the powered device and using a service protocol corresponding to the type of the service port of the powered device includes: For a transmission control protocol TCP service port or a stream control transmission protocol SCTP service port of the powered device, a synchronization sequence number SYN message is sent to the powered device; A UDP request message is sent to the powered device with respect to a User Datagram Protocol (UDP) service port of the powered device.
3. The method according to claim 1, characterized in that The method further comprises: If the powered device has no service port, the active detection module sends a detection message to the powered device via Internet Control Message Protocol (ICMP).
4. The method according to claim 1, characterized in that: The abnormality detection information includes: The power consumption information of the powered device and / or the flow information of the powered device.
5. The method according to claim 4, characterized in that When the abnormality detection information includes power consumption information of the powered device within a preset time period, the preset condition includes: The power consumption of the powered device within the preset time period exceeds a preset threshold corresponding to the preset time period.
6. The method according to claim 1, characterized in that The method further comprises: Through the power supply module, for a powered device newly connected to the power supply device, when it is determined that a preset direct power-on condition is met, a power-on process is performed on the powered device newly connected to the power supply device.
7. The method according to claim 1, characterized in that After determining that the powered device is abnormal, the method further includes: The management module performs abnormal recovery processing on the powered device.
8. An abnormality detection and processing device for a power receiving device, characterized in that: The device comprises: A passive detection module, configured to determine abnormal detection information of a powered device connected to the power supply device by detecting a port of a power supply device used to connect to the powered device; and record message interaction information of a port of a power supply device used to connect to the powered device, wherein the message interaction information includes a port number of a message exchanged between the powered device and the power supply device; An active detection module, configured to determine the type information of the service port of the powered device based on the port number of the message when the abnormal detection information meets a preset condition, and send a detection message to the powered device using a service protocol corresponding to the type of the service port of the powered device according to the type information of the service port of the powered device; when it is determined that the powered device has no response to the detection message, determine that the powered device is abnormal, and send a power-off instruction for the powered device to the management module; The management module is used for issuing a power-off instruction to the powered device when receiving the power-off instruction sent by the active detection module.
9. An electronic device, characterized in that: include: A memory for storing program instructions; A processor, configured to call the program instructions stored in the memory, and execute the method according to any one of claims 1 to 7 according to the obtained program.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions, and the computer-executable instructions are used to enable the computer to execute the method according to any one of claims 1 to 7.
