Fault detection system and fault detection method for energy management equipment

CN120151244AInactive Publication Date: 2025-06-13ROYPOW TECH CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202510601308.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-05-12
Publication Date
2025-06-13
Estimated Expiration
Not applicable · inactive patent

Smart Images

  • Figure CN120151244A_ABST
    Figure CN120151244A_ABST
Patent Text Reader

Abstract

The invention is applicable to the technical field of equipment detection, and provides a fault detection system and a fault detection method for energy management equipment, and the system is characterized in that terminal equipment is connected with a first interface of a USB concentrator, a second interface of the USB concentrator is connected with a CAN analyzer, a third interface of the USB concentrator is connected with a first RS485 bus, and a fourth interface of the USB concentrator is connected with a second RS485 bus; a fourth interface of the USB concentrator is connected with the second RS485 bus; the USB concentrator connects the CAN analyzer, the first RS485 bus and the second RS485 bus with the energy management device through the connector. According to the technical scheme, the terminal equipment starts the detection threads for fault detection of the energy management equipment by driving the CAN analyzer, the first RS485 bus and the second RS485 bus respectively, so that the global detection result of fault detection of the energy management equipment is obtained and displayed, and the detection process can be more convenient and efficient and higher in accuracy.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application belongs to the technical field of equipment detection, and particularly relates to a fault detection system and method for energy management equipment. Background Art

[0002] An Energy Management System (EMS) is a software and hardware device used to collect, monitor, control, analyze, and optimize energy systems, and is widely used in fields such as factories and energy systems. Through real-time data collection and intelligent analysis, EMS can achieve efficient use of energy, power balance, peak shaving and valley filling, and strategy management, while supporting the integration of renewable energy and auxiliary services, contributing to energy conservation, emission reduction, and sustainable development.

[0003] However, due to the numerous functions of the EMS hardware device and system, there are also a very large number of technical items that need to be detected. Usually, multiple software and tools are required to achieve the detection of some technical items. Currently, there is no device and software that can both perform data analysis of multiple Controller Area Networks (CAN) and perform data analysis and detection of multiple RS485 serial communication standards, and can also achieve Bluetooth connection and function detection, etc. This poses a great challenge to the fault detection of EMS and the efficiency is very low. Summary of the Invention

[0004] The embodiments of this application provide a fault detection system and method for energy management equipment, which can solve the problem that in the process of fault detection of energy management equipment, multiple software and tools are usually required for detection, resulting in a complex detection process and low efficiency.

[0005] In a first aspect, the embodiments of this application provide a fault detection system for energy management equipment, and the system includes: A terminal device, a Universal Serial Bus (USB) hub, a Controller Area Network (CAN) analyzer, a first RS485 serial communication standard bus, a second RS485 serial communication standard bus, and an energy management equipment; wherein, The terminal device is connected to the first interface of the USB hub, the second interface of the USB hub is connected to the CAN analyzer, the third interface of the USB hub is connected to the first RS485 bus, and the fourth interface of the USB hub is connected to the second RS485 bus; The USB hub is used to connect the CAN analyzer, the first RS485 bus, the second RS485 bus, and the energy management equipment through a connector; The terminal device is used to start a detection thread for fault detection of the energy management device by driving the CAN analyzer, the first RS485 bus, and the second RS485 bus respectively, obtain a global detection result for fault detection of the energy management device, and display the global detection result.

[0006] In a possible implementation manner of the first aspect, the terminal device is further used to start a first detection thread for fault detection of the CAN bus of the energy management device by driving the CAN analyzer, a second detection thread for fault detection of the third RS485 bus of the energy management device by driving the first RS485 bus, and a third detection thread for fault detection of the fourth RS485 bus of the energy management device by driving the second RS485 bus.

[0007] In a possible implementation manner of the first aspect, the terminal device is further used to start a global result detection timer to perform timeout detection on the global detection result at a preset time interval, obtain a global timeout detection result; and when the global detection result is passed, turn off the global result detection timer.

[0008] In a second aspect, an embodiment of the present application provides a method for fault detection of an energy management device, which is applied to a fault detection system of the energy management device as described in any item of the first aspect. The method includes: In response to a user's fault detection instruction, detect the configuration status of a plurality of preset detection items, where the preset detection items at least include one of the following: Controller Area Network (CAN) bus, RS485 bus of the serial communication standard, Bluetooth; the configuration status is configured or not configured; When it is detected that the configuration status of a plurality of the preset detection items is configured, obtain the input data information of the energy management device, where the input data information includes the device identification code of the energy management device; Start a detection thread for fault detection of the energy management device, and obtain a global detection result for fault detection of the energy management device.

[0009] In a possible implementation manner of the second aspect, the detection thread includes a first detection thread for fault detection of the CAN bus of the energy management device, a second detection thread for fault detection of the third RS485 bus of the energy management device, and a third detection thread for fault detection of the fourth RS485 bus of the energy management device; where The step of starting a detection thread for fault detection of the energy management device and obtaining a global detection result for fault detection of the energy management device includes: Initialize the initial global detection result; Start the first CAN detection thread in the first detection thread for fault detection of the first CAN bus to obtain a first CAN detection result; When it is determined that the input data information contains the device identification code, start the second detection thread to obtain a first RS485 detection result; Update the initial global detection result according to the first CAN detection result and the first RS485 detection result to obtain the global detection result.

[0010] In a possible implementation manner of the second aspect, after updating the initial global detection result according to the first CAN detection result and the first RS485 detection result to obtain the global detection result, the method includes: When it is determined that the first CAN detection result is passed, start the second CAN detection thread in the first detection thread for fault detection of the second CAN bus to obtain a second CAN detection result; When it is determined that the first RS485 detection result is passed, start the third detection thread to obtain a second RS485 detection result; Update the global detection result according to the second CAN detection result and the second RS485 detection result to obtain an updated global detection result.

[0011] In a possible implementation manner of the second aspect, starting the first CAN detection thread in the first detection thread for fault detection of the first CAN bus to obtain a first CAN detection result includes: When the first CAN detection thread cannot be started, determine that the first CAN detection result is not passed; When the first CAN detection thread can be started, generate a first CAN detection instruction, where the first CAN detection instruction includes a CAN instruction type; Send the first CAN detection instruction to the first CAN bus and start a timer to perform timeout detection on the first CAN detection thread through the timer to obtain a CAN timeout detection result; Obtain first response data on the first CAN bus according to the CAN instruction type; Analyze the first response data on the first CAN bus to obtain the first CAN detection result.

[0012] In a possible implementation of the second aspect, analyzing the first response data on the first CAN bus to obtain the first CAN detection result includes: If the first response data is lead-acid temperature sampling data, perform data processing and judgment on the lead-acid temperature sampling data according to a preset data range to obtain a sampling data detection result; If the first response data is version information data, perform version detection on the version information data according to a preset version to obtain a version information detection result; If the first response data is instruction result data, judge the instruction result data according to the CAN instruction type to obtain an instruction data detection result; Determine the first CAN detection result according to the sampling data detection result, the version information detection result, and the instruction data detection result.

[0013] In a possible implementation of the second aspect, in the case of determining that the input data information contains the device identification code, starting the second detection thread to obtain a first RS485 detection result includes: If the second detection thread cannot be started, determine that the first RS485 detection result fails; If the second detection thread can be started, generate a first RS485 detection instruction, where the first RS485 detection instruction includes a Bluetooth modification instruction and a communication instruction type; Send the Bluetooth modification instruction and the communication instruction type to the first RS485 bus, and start a timer to perform timeout detection on the second detection thread through the timer to obtain an RS485 timeout detection result; Obtain second response data on the first RS485 bus according to the Bluetooth modification instruction and the communication instruction type; where the second response data includes Bluetooth response data and communication response data; Determine the first RS485 detection result according to the Bluetooth response data and the communication response data on the first RS485 bus.

[0014] In a possible implementation of the second aspect, determining the first RS485 detection result according to the Bluetooth response data and the communication response data on the first RS485 bus includes: Analyze the Bluetooth name in the Bluetooth response data and the communication response data respectively to obtain a Bluetooth name detection result and a communication detection result; If both the Bluetooth name detection result and the communication detection result pass, then determine that the first RS485 detection result passes, turn off the timeout detection of the timer for the second detection thread and turn off the second detection thread, and start the third detection thread; If at least one of the Bluetooth name detection result and the communication detection result fails, then determine that the first RS485 detection result fails, and turn off the second detection thread; If the Bluetooth name detection result and the communication detection result are not obtained, and the RS485 timeout detection result is that the detection has timed out, then determine that the first RS485 detection result times out, and turn off the second detection thread.

[0015] In a third aspect, an embodiment of the present application provides a fault detection device for an energy management device, and the device includes: A response module, configured to respond to a user's fault detection instruction and detect the configuration status of a plurality of preset detection items, where the preset detection items at least include one of the following: a controller area network CAN bus, a serial communication standard RS485 bus, and Bluetooth; the configuration status is configured or not configured; An acquisition module, configured to acquire input data information of the energy management device when it is detected that the configuration status of a plurality of the preset detection items is configured, where the input data information includes the device identification code of the energy management device; A detection module, configured to start a detection thread for performing a fault detection on the energy management device to obtain a global detection result of performing a fault detection on the energy management device.

[0016] In a fourth aspect, an embodiment of the present application provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, where when the processor executes the computer program, the fault detection method of the energy management device described in any one of the above is implemented.

[0017] In a fifth aspect, an embodiment of the present application provides a computer-readable storage medium, where the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the fault detection method of the energy management device described in any one of the above is implemented.

[0018] In a sixth aspect, an embodiment of the present application provides a computer program product, when the computer program product runs on a terminal device, enabling the terminal device to execute the fault detection method of the energy management device described in any one of the first aspects above.

[0019] The beneficial effects of the embodiments of the present application compared with the prior art are: An embodiment of the present application provides a fault detection system for an energy management device, including a terminal device, a Universal Serial Bus (USB) hub, a Controller Area Network (CAN) analyzer, a first RS485 bus of a serial communication standard, a second RS485 bus of a serial communication standard, and an energy management device. Among them, the terminal device is connected to the first interface of the USB hub, the second interface of the USB hub is connected to the CAN analyzer, the third interface of the USB hub is connected to the first RS485 bus, and the fourth interface of the USB hub is connected to the second RS485 bus. The USB hub connects the CAN analyzer, the first RS485 bus, and the second RS485 bus to the energy management device through a connector. The terminal device starts a detection thread for fault detection of the energy management device by respectively driving the CAN analyzer, the first RS485 bus, and the second RS485 bus, so as to obtain a global detection result for fault detection of the energy management device and display the global detection result. Through this system, communication detection of the CAN bus and RS485 bus of the energy management device can be realized, making the detection process more convenient, efficient, and with higher accuracy. Description of the Drawings

[0020] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following will briefly introduce the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings in the following description are only some embodiments of the present application. For those of ordinary skill in the art, without creative efforts, other drawings can also be obtained based on these drawings.

[0021] Figure 1 It is a schematic structural diagram of a fault detection system for an energy management device provided by an embodiment of the present application; Figure 2 It is a schematic flowchart of a fault detection method for an energy management device provided by an embodiment of the present application; Figure 3 It is a schematic flowchart of detecting the configuration status of a preset detection item provided by an embodiment of the present application; Figure 4 It is a schematic flowchart of fault detection for a CAN1 bus provided by an embodiment of the present application; Figure 5 It is a schematic flowchart of fault detection for a CAN2 bus provided by an embodiment of the present application; Figure 6 It is a schematic flowchart of fault detection for an RS485-1 bus provided by an embodiment of the present application; Figure 7 It is a schematic flowchart of fault detection for a Bluetooth function provided by an embodiment of the present application; Figure 8 It is a schematic flowchart of a process for fault detection of the RS485-2 bus provided by an embodiment of the present application; Figure 9 It is a schematic flowchart of a process for timeout detection of a global result detection timer provided by an embodiment of the present application; Figure 10 It is a schematic structural diagram of a fault detection device for an energy management device provided by an embodiment of the present application; Figure 11 It is a schematic structural diagram of an electronic device provided by an embodiment of the present application. Detailed implementation manners

[0022] In the following description, specific details such as specific system architectures and technologies are presented for the purpose of illustration rather than limitation, so as to thoroughly understand the embodiments of the present application. However, those skilled in the art should clearly understand that the present application can also be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to avoid unnecessary details from interfering with the description of the present application.

[0023] It should be understood that when used in the specification and appended claims of the present application, the term "comprising" indicates the presence of the described features, wholes, steps, operations, elements, and / or components, but does not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, components, and / or their combinations.

[0024] It should also be understood that the term "and / or" used in the specification and appended claims of the present application refers to any combination and all possible combinations of one or more of the associated listed items, and includes these combinations.

[0025] As used in the specification and appended claims of the present application, the term "if" can be interpreted as "when", "once", "in response to determining", or "in response to detecting" according to the context. Similarly, the phrase "if determined" or "if detecting [the described condition or event]" can be interpreted as meaning "once determined", "in response to determining", "once detecting [the described condition or event]", or "in response to detecting [the described condition or event]" according to the context.

[0026] In addition, in the description of the specification and appended claims of the present application, the terms "first", "second", "third", etc. are only used for distinguishing descriptions and cannot be understood as indicating or implying relative importance.

[0027] References to "one embodiment" or "some embodiments" etc. described in the specification of this application mean that a particular feature, structure, or characteristic described in connection with that embodiment is included in one or more embodiments of this application. Thus, statements such as "in one embodiment", "in some embodiments", "in other some embodiments", "in still other embodiments", etc. that appear in different places in this specification do not necessarily all refer to the same embodiment, but rather mean "one or more but not all embodiments", unless otherwise specifically emphasized. The terms "comprising", "including", "having" and their variants all mean "including but not limited to", unless otherwise specifically emphasized.

[0028] Please refer to Figure 1 , Figure 1 which is a schematic structural diagram of a fault detection system for an energy management device provided by an embodiment of this application. The fault detection system 1 of the energy management device includes: a terminal device 10, a universal serial bus (USB) hub 20, a controller area network (CAN) analyzer 30, a first RS485 bus 40 of the first serial communication standard, a second RS485 bus 50 of the second serial communication standard, and an energy management device 60.

[0029] The terminal device 10 is connected to the first interface of the USB hub 20, the second interface of the USB hub 20 is connected to the CAN analyzer 30, the third interface of the USB hub 20 is connected to the first RS485 bus 40, and the fourth interface of the USB hub 20 is connected to the second RS485 bus 50.

[0030] The USB hub 20 is used to connect the CAN analyzer 30, the first RS485 bus 40, the second RS485 bus 50 and the energy management device 60 through a connector 70.

[0031] The terminal device 10 is used to start a detection thread for fault detection of the energy management device 60 by respectively driving the CAN analyzer 30, the first RS485 bus 40 and the second RS485 bus 50, obtain a global detection result for fault detection of the energy management device 60, and display the global detection result.

[0032] In this embodiment, the energy management device 60 is a software and hardware device for collecting, monitoring, controlling, analyzing, and optimizing energy systems, which is widely used in fields such as factories and energy systems. Through real-time data collection and intelligent analysis, the energy management device 60 can achieve efficient utilization of energy, power balance, peak shaving and valley filling, and strategy management. At the same time, it supports the integration of renewable energy and auxiliary services, contributing to energy conservation, emission reduction, and sustainable development. In this embodiment, the energy management device 60 is the object to be detected. The energy management device 60 can include communication via the CAN bus protocol and communication via the RS485 bus, and can mainly detect whether there are faults in the communication of the CAN bus, RS485 bus, etc. of the energy management device 60.

[0033] The terminal device 10 is an electronic device with functions such as input, output, and data processing, which is used to start a detection thread for fault detection of the energy management device 60 by respectively driving the CAN analyzer 30, the first RS485 bus 40, and the second RS485 bus 50, so as to obtain a global detection result for fault detection of the energy management device 60 and display the global detection result. The terminal device 10 can be an electronic device such as a server, a computer, a laptop, a tablet, etc. with data processing and display functions, and no specific limitation is made in this embodiment.

[0034] The CAN analyzer 30 is a device for monitoring, analyzing, and debugging the functions of the CAN bus network. It can capture data frames on the CAN bus, decode, display, and analyze the data, thereby helping users understand the working status and communication conditions of the CAN bus network. In this embodiment, the CAN analyzer 30 can perform fault detection on the CAN bus network in the energy management device 60 to obtain relevant detection results.

[0035] RS485 is a commonly used serial communication standard that uses a differential signal transmission method. In this embodiment, both the first RS485 bus 40 and the second RS485 bus 50 are RS485 communication lines for transmitting data between the terminal device 10 and the energy management device 60, and can achieve fault detection of the RS485 bus communication in the energy management device 60. The RS485 bus in the energy management device 60 can include an RS485-1 line and an RS485-2 line, and the two have different communication functions, such as being used to connect different device modules or transmit different types of communication data. Correspondingly, fault detection can be performed on the RS485-1 bus and the RS485-2 bus in the energy management device 60 through the first RS485 bus 40 and the second RS485 bus 50 respectively.

[0036] The USB hub 20 is a device for expanding USB interfaces. It can expand one USB interface into multiple USB interfaces, enabling multiple USB devices to be connected to a computer or other USB host. In this embodiment, the USB hub 20 serves as an intermediate connection device, connecting the terminal device 10 to the CAN analyzer 30, the first RS485 bus 40, and the second RS485 bus 50, and connecting to the energy management device 60 through the connector 70 to achieve data transmission and communication, thereby realizing the fault detection of the energy management device 60.

[0037] The connector 70 is a device used to connect two or more devices or systems. In this embodiment, the connector 70 can connect the USB hub 20 to the energy management device 60 to achieve data transmission and communication.

[0038] Specifically, the fault detection system 1 of the energy management device is connected to the first interface (i.e., a USB port) of the terminal device 10 through a USB hub 20. Then, the second interface of the USB hub 20 is connected to the CAN analyzer 30, the third interface of the USB hub 20 is connected to the first RS485 bus 40, and the fourth interface of the USB hub 20 is connected to the second RS485 bus 50. Then, the CAN analyzer 30, the first RS485 bus 40, and the second RS485 bus 50 are connected to the energy management device 60 through the connector 70. That is, two HL lines of the CAN analyzer 30 (where the H line is the high - level data line of the CAN analyzer 30 and the L line is the low - level data line of the CAN analyzer 30), one AB line of the first RS485 bus 40 (the A line is the positive signal line of the RS485 bus and the B is the negative signal line of the RS485 bus), and one AB line of the second RS485 bus 50, a total of eight communication lines are uniformly gathered at the single - row female plug end of the connector 70. Correspondingly, the energy management device 60 also leads out eight corresponding communication lines and gathers them at the single - row male plug end of the connector 70. The single - row female plug end and the single - row male plug end of the connector 70 are connected. Through the simplified connection method, the detection connection of the communication lines of the energy management device 60 is realized, which can make the fault detection of the energy management device 60 more convenient and efficient, and improve the detection accuracy.

[0039] Among them, the detection thread is a thread used to execute the fault detection task. The terminal device 10 starts the corresponding detection threads by driving the CAN analyzer 30, the first RS485 bus 40, and the second RS485 bus 50 respectively. These detection threads can run in parallel to improve the efficiency of fault detection. Each detection thread is responsible for communicating with the corresponding device or bus, obtaining detection data, and returning the data to the terminal device 10. The global detection result is the final detection result formed by comprehensively considering the results obtained by each detection thread after performing fault detection on the energy management device 60 in multiple aspects (such as through the CAN analyzer 30, the first RS485 bus 40, and the second RS485 bus 50). The global detection result may include fault information of the energy management device 60 in different aspects, such as passing the detection, failing the detection, detection timeout, etc. The terminal device 10 also displays the global detection result for the user to view and analyze.

[0040] It can be understood that the embodiment of the present application provides a fault detection system for an energy management device, including a terminal device, a universal serial bus (USB) hub, a controller area network (CAN) analyzer, a first RS485 bus complying with the first serial communication standard, a second RS485 bus complying with the second serial communication standard, and an energy management device; among them, the terminal device is connected to the first interface of the USB hub, the second interface of the USB hub is connected to the CAN analyzer, the third interface of the USB hub is connected to the first RS485 bus, and the fourth interface of the USB hub is connected to the second RS485 bus; the USB hub connects the CAN analyzer, the first RS485 bus, and the second RS485 bus to the energy management device through a connector; the terminal device starts the detection threads for performing fault detection on the energy management device by driving the CAN analyzer, the first RS485 bus, and the second RS485 bus respectively, so as to obtain the global detection result of the fault detection on the energy management device, and display the global detection result. Through this system, the communication detection of the CAN bus and the RS485 bus of the energy management device can be realized, and the detection process is more convenient and efficient, and the accuracy is higher.

[0041] In a possible implementation manner, the terminal device 10 is further configured to start a first detection thread for performing fault detection on the CAN bus of the energy management device 60 by driving the CAN analyzer 30, a second detection thread for performing fault detection on the third RS485 bus of the energy management device 60 by driving the first RS485 bus 40, and a third detection thread for performing fault detection on the fourth RS485 bus of the energy management device 60 by driving the second RS485 bus 50.

[0042] In this embodiment, when performing fault detection on the energy management device 60, there may be three detection threads, namely the first detection thread, the second detection thread, and the third detection thread. The first detection thread is to start the fault detection of the CAN bus in the energy management device 60 by calling the hardware interface of the CAN analyzer 30 through the terminal device 10; the second detection thread is to drive the first RS485 bus 40 through the terminal device 10 to perform fault detection on the third RS485 bus (i.e., the above-mentioned RS485-1 bus) in the energy management device 60; the third detection thread is to drive the second RS485 bus 50 through the terminal device 10 to perform fault detection on the fourth RS485 bus (i.e., the above-mentioned RS485-2 bus) in the energy management device 60. Usually, the first detection thread and the second detection thread can run in parallel; the second detection thread and the third detection thread can run serially, that is, when the second detection thread shows passing, the third detection thread will be started to run.

[0043] It should be understood that through the detection of multi-thread parallel operation, comprehensive fault detection of the CAN bus and RS485 bus of the energy management device can be realized, which is applicable to scenarios with high real-time performance and high reliability, and can improve the detection efficiency.

[0044] In a possible implementation manner, the terminal device 10 is further configured to start the first CAN detection thread for detecting the first CAN bus in the first detection thread to obtain the first CAN detection result; and when it is determined that the obtained input data information contains the device identification code of the energy management device 60, start the second detection thread to obtain the first RS485 detection result.

[0045] The terminal device 10 is further configured to start the second CAN detection thread for detecting the second CAN bus in the first detection thread to obtain the second CAN detection result when it is determined that the first CAN detection result is passed; and start the third detection thread to obtain the second RS485 detection result when it is determined that the first RS485 detection result is passed.

[0046] Further, since the CAN bus in the energy management device 60 includes a first CAN bus (CAN1 bus) and a second CAN bus (CAN2 bus), the communication protocols of the CAN1 bus and the CAN2 bus are the same, but they are physically separated and the contents they detect are different. Therefore, the first detection thread for the CAN bus includes the function detection of the CAN1 bus and the function detection of the CAN2 bus. That is, when the terminal device 10 starts the first detection thread for fault detection of the CAN bus of the energy management device 60 by driving the CAN analyzer 30, it first starts the first CAN detection thread for detecting the first CAN bus in the first detection thread to obtain the first CAN detection result; then, when it is determined that the first CAN detection result passes, that is, when the detection result of the CAN1 bus in the energy management device 60 passes, it starts the second CAN detection thread for detecting the second CAN bus in the first detection thread (that is, the thread for detecting the CAN2 bus in the energy management device 60) to obtain the second CAN detection result. Among them, the first CAN detection thread is the thread for fault detection of the CAN1 bus in the energy management device 60, and the corresponding detection result is the first CAN detection result; the second CAN detection thread is the thread for fault detection of the CAN2 bus in the energy management device 60, and the corresponding detection result is the second CAN detection result.

[0047] Meanwhile, when the terminal device 10 determines that the input data information obtained contains the device identification code of the energy management device 60, it will start the second detection thread for fault detection of the RS485-1 bus of the energy management device 60 by driving the first RS485 bus 40, so as to obtain the first RS485 detection result; then, when it is determined that the first RS485 detection result passes, it will start the third detection thread for fault detection of the RS485-2 bus of the energy management device 60 by driving the second RS485 bus 50 to obtain the second RS485 detection result.

[0048] It should be understood that through the further hierarchical fault detection of the CAN bus and the RS485 bus of the energy management device by multi-thread parallel operation, the detection efficiency and accuracy can be improved.

[0049] In a possible implementation manner, the terminal device 10 is further configured to start a global result detection timer to perform timeout detection on the global detection result at a preset time interval to obtain a global timeout detection result; and when the global detection result passes, turn off the global result detection timer.

[0050] In this embodiment, during the process of fault detection of the energy management device 60 by the fault detection system 1 of the energy management device, after the terminal device 10 starts the detection thread, it will automatically start the global result detection timer. The timer will be triggered at a preset time interval (such as 5 seconds, 10 seconds) to perform timeout detection on the current global detection result, so as to determine whether the detection results of all detection threads (such as CAN bus, RS485 bus) are completed within the allowed time, thereby obtaining the global timeout detection result. Specifically, when the results of all detection threads have been generated and are passed, the global timeout detection result is passed; when the result of any one detection thread is not passed or has timed out without completion, the global timeout detection result is not passed. And, when the global timeout detection result is passed, the timer is turned off to save resources. Among them, the preset time interval is a preset value, which can be dynamically adjusted according to the complexity of the detection process.

[0051] It should be understood that this fault detection system realizes the timeout monitoring and resource management of the multi-threaded detection process through the global result detection timer, and further improves the detection efficiency and reliability.

[0052] Please refer to Figure 2 , Figure 2 is a schematic flowchart of a fault detection method for an energy management device provided in an embodiment of the present application. Applied to the fault detection system of the energy management device in any of the above, the method includes: S11. In response to the user's fault detection instruction, detect the configuration status of multiple preset detection items, where the preset detection items at least include one of the following: Controller Area Network CAN bus, serial communication standard RS485 bus, Bluetooth; the configuration status is configured or not configured.

[0053] S12. When it is detected that the configuration status of the multiple preset detection items is configured, obtain the input data information of the energy management device, where the input data information includes the device identification code of the energy management device.

[0054] S13. Start the detection thread for fault detection of the energy management device to obtain the global detection result of the fault detection of the energy management device.

[0055] It should be noted that this method can be applied to the fault detection system of the energy management device to perform fault detection on the energy management device, and can include function detection of the CAN bus, RS485 bus, Bluetooth, etc. of the energy management device. In this embodiment, the execution subject can be a terminal device, and the terminal device can be an electronic device with data processing and display functions such as a server, a computer, a computer, a tablet, etc., and no specific limitation is made in this embodiment.

[0056] In step S11, the fault detection instruction is information sent by the user for fault detection of the energy management device. Usually, the fault detection instruction may include device information of the energy management device to be detected, such as device identification code, device configuration, etc.

[0057] As Figure 3 shown, Figure 3 FIG. is a schematic flowchart of a process for detecting the configuration status of preset detection items provided by an embodiment of the present application. When receiving a fault detection instruction triggered by the user, the terminal device starts the detection software. First, it checks the configuration status (configured or not configured) of the preset detection items, that is, including the parameter configuration of the CAN bus, the serial port interface parameter configuration of the RS485 bus, and the Bluetooth parameter configuration, and checks whether these preset detection items have been configured. If not configured, it will remind to configure these preset detection items. Among them, it mainly includes the configuration of local parameters such as baud rate, address, etc.

[0058] Then, when it is detected that the configuration status of these preset detection items is all configured, it obtains the input data information of the energy management device, that is, the device identification code of the energy management device. The device identification code is a code used to uniquely identify the energy management device, usually a string or a digital sequence (such as a physical address, a two-dimensional code serial number, etc.). Generally, the input data information of the energy management device is obtained by listening to the barcode scanner connected to the USB interface, that is, by scanning the two-dimensional code or barcode on the energy management device with the barcode scanner, and the detection software can monitor the input data information (device identification code) input by the barcode scanner.

[0059] Finally, it starts a detection thread for fault detection of the energy management device, so as to obtain the final global detection result. The detection thread is a thread used to execute the fault detection task. In this embodiment, the terminal device can start the corresponding detection threads by driving the CAN analyzer, the first RS485 bus, and the second RS485 bus respectively. These detection threads can run in parallel, which can improve the efficiency of fault detection. Each detection thread is responsible for communicating with the corresponding device or bus, obtaining detection data and returning the data to the terminal device. The global detection result is the final detection result formed by comprehensively the results obtained by each detection thread after performing multi-faceted (such as CAN bus, RS485 bus) fault detection on the energy management device. The global detection result may include fault information of the energy management device on different communication buses, such as detection passed, not passed, detection timeout, etc. The global detection result can also be displayed on the terminal device for the user to view and analyze.

[0060] It can be understood that this embodiment provides a method for fault detection of an energy management device, including detecting the configuration status of multiple preset detection items in response to a user's fault detection instruction, where the preset detection items at least include one of the following: Controller Area Network (CAN) bus, RS485 bus of the serial communication standard, and Bluetooth; the configuration status is either configured or not configured; in the case where the configuration status of multiple preset detection items is detected as configured, obtain the input data information of the energy management device, where the input data information includes the device identification code of the energy management device; start a detection thread for fault detection of the energy management device to obtain a global detection result for fault detection of the energy management device. Through this method, communication detection of the CAN bus and RS485 bus of the energy management device can be achieved, making the detection process more convenient, efficient, and with a higher accuracy rate.

[0061] In a possible implementation manner, the detection thread includes a first detection thread for fault detection of the CAN bus of the energy management device, a second detection thread for fault detection of the first RS485 bus of the energy management device, and a third detection thread for fault detection of the second RS485 bus of the energy management device.

[0062] In this embodiment, when performing fault detection on the energy management device, there can be three detection threads, namely the first detection thread, the second detection thread, and the third detection thread. The first detection thread is to start the fault detection of the CAN bus in the energy management device by calling the hardware interface of the CAN analyzer through the terminal device; the second detection thread is to drive the first RS485 bus through the terminal device to perform fault detection on the third RS485 bus (i.e., the above-mentioned RS485-1 bus) in the energy management device; the third detection thread is to drive the second RS485 bus through the terminal device to perform fault detection on the fourth RS485 bus (i.e., the above-mentioned RS485-2 bus) in the energy management device. Usually, the first detection thread and the second detection thread can run in parallel; the second detection thread and the third detection thread can run serially, that is, in the case where the second detection thread shows passing, the third detection thread will be started to run.

[0063] It should be understood that through the detection with multi-thread parallel operation, comprehensive fault detection of the CAN bus and RS485 bus of the energy management device can be achieved, which is applicable to scenarios with high real-time performance and high reliability, and can improve the detection efficiency.

[0064] In a possible implementation manner, starting a detection thread for fault detection of the energy management device to obtain a global detection result for fault detection of the energy management device includes: Initialize the initial global detection result.

[0065] Start the first CAN detection thread for fault detection of the first CAN bus in the first detection thread to obtain the first CAN detection result.

[0066] When it is determined that the input data information contains the device identification code, start the second detection thread to obtain the first RS485 detection result.

[0067] Update the initial global detection result according to the first CAN detection result and the first RS485 detection result to obtain the global detection result.

[0068] It should be noted that after receiving the input data information of the barcode scanner, the terminal device will start two detection threads. One detection thread is used to detect the function of the CAN1 bus in the energy management device, and one detection thread is used to detect the function of the RS485-1 bus in the energy management device, that is, the first CAN detection thread and the second detection thread.

[0069] Before starting the detection thread, it is necessary to initialize the initial global detection result in the system so that the global detection result is in a default and initial state for subsequent update according to the actual detection result.

[0070] The first CAN detection result is the detection result obtained after fault detection of the CAN1 bus (the first CAN bus) in the energy management device; the first RS485 detection result is the detection result obtained after fault detection of the RS485-1 bus (the first RS485 bus) in the energy management device. Update the first CAN detection result and the first RS485 detection result to the initial global detection result to obtain the final global detection result.

[0071] It should be noted that while starting the first detection thread and the second detection thread, a global result detection timer will also be started to judge whether the detection result times out.

[0072] It should be understood that through the detection of multi-thread parallel operation, a comprehensive fault detection of the CAN bus and the RS485 bus of the energy management device can be realized, and the detection efficiency and accuracy can be improved.

[0073] In a possible implementation manner, after updating the initial global detection result according to the first CAN detection result and the first RS485 detection result to obtain the global detection result, the method includes: When it is determined that the first CAN detection result is passed, start the second CAN detection thread for fault detection of the second CAN bus in the first detection thread to obtain the second CAN detection result.

[0074] When it is determined that the first RS485 detection result is passed, start the third detection thread to obtain the second RS485 detection result.

[0075] Update the global detection result according to the second CAN detection result and the second RS485 detection result to obtain the updated global detection result.

[0076] Furthermore, since the CAN bus in the energy management device includes the first CAN bus (CAN1 bus) and the second CAN bus (CAN2 bus), the communication protocols of the CAN1 bus and the CAN2 bus are the same, but they are physically separated and the contents they detect are different. Therefore, the first detection thread for the CAN bus includes the function detection of the CAN1 bus and the function detection of the CAN2 bus. That is, when the terminal device starts the first detection thread for fault detection of the CAN bus of the energy management device by driving the CAN analyzer, first start the first CAN detection thread in the first detection thread for detecting the first CAN bus to obtain the first CAN detection result; then, when it is determined that the first CAN detection result is passed, that is, when the detection result of the CAN1 bus in the energy management device is passed, start the second CAN detection thread in the first detection thread for detecting the second CAN bus (that is, the thread for detecting the CAN2 bus in the energy management device) to obtain the second CAN detection result. Among them, the first CAN detection thread is the thread for fault detection of the CAN1 bus in the energy management device, and the corresponding detection result is the first CAN detection result; the second CAN detection thread is the thread for fault detection of the CAN2 bus in the energy management device, and the corresponding detection result is the second CAN detection result.

[0077] At the same time, first, the terminal device starts the second detection thread for fault detection of the RS485-1 bus of the energy management device by driving the first RS485 bus to obtain the first RS485 detection result; then, when it is determined that the first RS485 detection result is passed, the third detection thread for fault detection of the RS485-2 bus of the energy management device will be started by driving the second RS485 bus to obtain the second RS485 detection result. The third detection thread is the thread for fault detection of the RS485-2 bus in the energy management device, and the corresponding detection result is the second RS485 detection result.

[0078] Finally, obtain the second CAN detection result and the second RS485 detection result, and update the global detection result to obtain the updated global detection result.

[0079] It should be understood that through further multi-threaded parallel operation detection, hierarchical fault detection of the CAN bus and RS485 bus of the energy management device can be achieved, which can improve the detection efficiency and accuracy.

[0080] In a possible implementation, start the first CAN detection thread for fault detection of the first CAN bus in the first detection thread, and obtain the first CAN detection result, including: In the case where the first CAN detection thread cannot be started, determine that the first CAN detection result is not passed.

[0081] In the case where the first CAN detection thread can be started, generate a first CAN detection instruction, where the first CAN detection instruction includes a CAN instruction type.

[0082] Send the first CAN detection instruction to the first CAN bus, and start a timer to perform timeout detection on the first CAN detection thread through the timer to obtain a CAN timeout detection result; According to the CAN instruction type, obtain the first response data on the first CAN bus.

[0083] Analyze the first response data on the first CAN bus to obtain the first CAN detection result.

[0084] Specifically, as Figure 4 shown, Figure 4 is a schematic flowchart of a method for fault detection of the CAN1 bus provided by an embodiment of the present application. Figure 4 In it, the terminal device first tries to open the CAN1 bus interface on the CAN analyzer. If the returned data is abnormal data, indicating that the CAN1 bus interface cannot be opened, directly record that the detection result of the CAN1 bus is not passed, that is, the first CAN detection result is not passed.

[0085] If the returned data is normal data, indicating that the CAN1 bus interface can be opened, then start listening to the data on the CAN1 bus, generate a first CAN detection instruction including the CAN instruction type, and send the first CAN detection instruction to the CAN1 bus. After sending the first CAN detection instruction, start a timer at the same time to detect whether the whole process times out and has not been detected yet; then, analyze the data received by listening to the CAN1 bus (i.e., the first response data) according to the CAN instruction type to obtain the first CAN detection result.

[0086] In a possible implementation, analyzing the first response data on the first CAN bus to obtain the first CAN detection result includes: If the first response data is lead-acid temperature sampling data, data processing and judgment are performed on the lead-acid temperature sampling data according to a preset data range to obtain a sampling data detection result.

[0087] If the first response data is version information data, version detection is performed on the version information data according to a preset version to obtain a version information detection result.

[0088] If the first response data is instruction result data, judgment is performed on the instruction result data according to the CAN instruction type to obtain an instruction data detection result.

[0089] According to the sampling data detection result, version information detection result, and instruction data detection result, a first CAN detection result is determined.

[0090] Specifically, as Figure 4 In, if the monitored first response data is lead-acid temperature sampling data, data processing and judgment are performed on it to obtain a sampling data detection result. That is, within the preset data range (such as within 10%), the sampling data detection result shows pass, otherwise fail, and the sampling data detection result is stored in the global result list in the global detection result.

[0091] If the monitored first response data is version information data, version data detection is performed according to the preset version information to obtain a version information detection result. That is, if the version information data is consistent with the preset version information, the version information detection result shows pass, otherwise fail, and the version information detection result is stored in the global result list in the global detection result. Among them, the preset version information can be in a specific format, and the specified version information for detection can be input in the detection software on the terminal device.

[0092] If the monitored first response data is instruction result data, judgment is performed on the instruction result data according to the CAN instruction type to obtain an instruction data detection result. That is, for the data sent according to the CAN instruction type, if the returned data is the data calculated according to the sent specific algorithm, the instruction data detection result shows pass, otherwise fail, and the instruction data detection result is stored in the global result list in the global detection result.

[0093] After obtaining the sampling data detection result, version information detection result, and instruction data detection result, judgment of the final result is performed to determine the first CAN detection result.

[0094] Such as Figure 4As shown in the figure, the judgment of the final result is specifically as follows: when the sampling data detection result, the version information detection result, and the instruction data detection result all pass, it is determined that the first CAN detection result passes. At this time, the timer is turned off for the timeout detection of the first CAN detection thread and the first CAN detection thread is turned off, and the second CAN detection thread is started, that is, the fault detection of the CAN2 bus is continued.

[0095] When at least one of the sampling data detection result, the version information detection result, and the instruction data detection result fails, it is determined that the first CAN detection result fails, and the first CAN detection thread is turned off.

[0096] When the sampling data detection result, the version information detection result, and the instruction data detection result are not obtained, and the CAN timeout detection result is that the detection has timed out, it is determined that the first CAN detection result has timed out, and then the first CAN detection thread is turned off.

[0097] Further, as Figure 5 shown, Figure 5 is a schematic flowchart of a method for fault detection of the CAN2 bus provided by an embodiment of the present application. Figure 5 In the figure, if the detection of the CAN1 bus passes, that is, when the first CAN detection result passes, the detection of the CAN2 bus will be entered. Specifically, the CAN2 bus interface is opened. If it cannot be opened normally, the second CAN detection result is determined to fail, and the second CAN detection result is stored in the global result list of the global detection result, and the detection of the CAN2 bus is turned off; if it can be opened correctly, first listen to the data on the CAN2 bus, generate the corresponding second CAN detection instruction data, and send it to the CAN2 bus, and at the same time start a timer to detect whether the whole process times out before the detection is completed; after the return data of the CAN2 is listened to, the result detection of the return data is performed (at this time, the same as the judgment of the detection data of the CAN1 bus), so as to obtain the second CAN detection result, and the second CAN detection result is stored in the global result list of the global detection result; if the timeout detection result of the timer shows that it has timed out and the final detection result has not been obtained, it is determined that the second CAN detection result has timed out, and then the detection of the CAN2 bus is turned off.

[0098] It should be understood that through the hierarchical fault detection of the CAN1 bus and the CAN2 bus, the comprehensive fault detection of the CAN bus of the energy management device is realized, and the detection efficiency and accuracy can be improved.

[0099] In a possible implementation manner, when it is determined that the input data information contains the device identification code, the second detection thread is started to obtain the first RS485 detection result, including: If the second detection thread cannot be started, it is determined that the first RS485 detection result fails.

[0100] If the second detection thread can be started, a first RS485 detection instruction is generated, where the first RS485 detection instruction includes a Bluetooth modification instruction and a communication instruction type.

[0101] The Bluetooth modification instruction and the communication instruction type are sent to the first RS485 bus, and a timer is started to perform timeout detection on the second detection thread through the timer to obtain an RS485 timeout detection result.

[0102] According to the Bluetooth modification instruction and the communication instruction type, second response data on the first RS485 bus is obtained; where the second response data includes Bluetooth response data and communication response data.

[0103] According to the Bluetooth response data and the communication response data on the first RS485 bus, the first RS485 detection result is determined.

[0104] As Figure 6 shown, Figure 6 is a schematic flowchart of a process for fault detection of an RS485-1 bus provided by an embodiment of the present application. Figure 6 In it, after the input data information scanned by the barcode scanner is detected, when it is analyzed that the input data information contains the device identification code of the energy management device, it is necessary to start a second detection thread for fault detection of the RS485-1 bus of the energy management device through the first RS485 bus, and attempt to open the serial port interface of the RS485-1 bus. If the serial port interface of the RS485-1 bus is not opened, that is, the second detection thread cannot be started, it is determined that the first RS485 detection result fails, and the first RS485 detection result is stored in the global result list in the global detection result.

[0105] If the serial port interface of the RS485-1 bus can be opened, that is, the second detection thread can be started, then start listening to the serial port data of the RS485-1 bus, generate the first RS485 detection instruction including the Bluetooth modification instruction and the communication instruction type; and send the first RS485 detection instruction to the serial port interface of the RS485-1 bus in sequence, and at the same time start a timer to detect whether the return result (i.e., the second response data) of the corresponding first RS485 detection instruction times out, so as to obtain the RS485 timeout detection result (detection timed out or detection not timed out). Then, according to the Bluetooth modification instruction and the communication instruction type, obtain the second response data on the first RS485 bus. Finally, by judging the Bluetooth response data and the communication response data in the second response data, obtain the first RS485 detection result, and store the first RS485 detection result in the global result list in the global detection result.

[0106] Among them, the Bluetooth modification instruction is used to indicate whether the Bluetooth name of the device has been successfully modified. The communication instruction type is used to indicate the type of communication data on the RS485-1 bus, such as reading data, writing data, etc. The second response data is a set of data returned by the first RS485 bus after receiving the first RS485 detection instruction, including Bluetooth response data and communication response data. The Bluetooth response data is the response information related to the Bluetooth function on the RS485-1 bus, and the communication response data is the response information related to the communication function on the RS485-1 bus.

[0107] Specifically, analyze the Bluetooth name in the Bluetooth response data and the communication response data respectively to obtain the Bluetooth name detection result and the communication detection result. Among them, the Bluetooth name detection result is the result of detecting whether the Bluetooth name in the Bluetooth response data has been modified. The communication detection result is the result of judging the communication response data. If the Bluetooth name modification in the Bluetooth response data is successful, it is determined that the Bluetooth name detection result passes, and the Bluetooth name detection result is stored in the global result list in the global detection result. At this time, start the fourth detection thread to detect the Bluetooth function of the energy management device through the fourth detection thread to obtain the Bluetooth function detection result. If the Bluetooth name modification in the Bluetooth response data is not successful, it is determined that the Bluetooth name detection result fails, and the Bluetooth name detection result is stored in the global result list in the global detection result. By sending communication data in a characteristic format and the returned communication response data is calculated by a specific algorithm, it is determined that the communication detection result passes, otherwise it fails, and the communication detection result is stored in the global result list in the global detection result.

[0108] If both the Bluetooth name detection result and the communication detection result pass, then it is determined that the first RS485 detection result passes. At this time, the timer is turned off for the timeout detection of the second detection thread and the second detection thread is closed. The first RS485 detection result is stored in the global result list in the global detection result, and the third detection thread is started, that is, the fault detection of the RS485-2 bus of the energy management device is started.

[0109] If at least one of the Bluetooth name detection result and the communication detection result fails, then it is determined that the first RS485 detection result fails. At this time, the second detection thread is closed, and the first RS485 detection result is stored in the global result list in the global detection result.

[0110] If the Bluetooth name detection result and the communication detection result are not obtained, and the RS485 timeout detection result is that the detection has timed out, then it is determined that the first RS485 detection result times out. At this time, the second detection thread is closed, and the first RS485 detection result is stored in the global result list in the global detection result.

[0111] Furthermore, if the Bluetooth response data indicates that the Bluetooth name modification has been successful, then it is determined that the Bluetooth name detection result passes. At this time, the fourth detection thread can be started to perform fault detection on the Bluetooth function of the energy management device through the fourth detection thread to obtain the Bluetooth function detection result, including: Search for the modified Bluetooth name.

[0112] If the search times out and the modified Bluetooth name is not found, then it is determined that the Bluetooth function detection result fails, and the fourth detection thread is closed.

[0113] If the modified Bluetooth name is found, then Bluetooth pairing is performed to query and subscribe to the configured service characteristics.

[0114] If the subscription to the configured service characteristics is successful, a Bluetooth detection instruction is generated.

[0115] The Bluetooth detection instruction is sent to the energy management device to obtain Bluetooth service return data; and a timer is started to perform timeout detection on the fourth detection thread through the timer to obtain the Bluetooth timeout detection result.

[0116] If the Bluetooth timeout detection result is not timed out and Bluetooth service return data is received, then it is determined that the Bluetooth function detection result passes, and the fourth detection thread is closed.

[0117] If the Bluetooth timeout detection result is timed out and Bluetooth service return data is not received, then it is determined that the Bluetooth function detection result fails, and the fourth detection thread is closed.

[0118] AsFigure 7 As shown Figure 7 This is a schematic flowchart of a process for fault detection of the Bluetooth function provided by an embodiment of the present application. Figure 7 In this process, during the startup of the fourth detection thread, if it is detected that the Bluetooth response data indicates that the Bluetooth name modification has been successful, it means that the Bluetooth name has been modified to the preset format (such as the configured prefix plus an underscore plus the QR code serial number). At this time, the detection software only needs to search for this specific modified Bluetooth name. If the modified Bluetooth name cannot be searched for all the time, at this time, the timeout detection of the timer is triggered, and it is determined that the Bluetooth function detection result fails. The fourth detection thread is ended, and the Bluetooth function detection result is stored in the global result list in the global detection result.

[0119] If the modified Bluetooth name can be searched for, direct Bluetooth pairing is performed. After the pairing is completed, the service characteristics configured in the profile are queried and subscribed to. When the subscription is successful, a Bluetooth detection instruction is generated and sent to the energy management device, and at the same time, listening for the Bluetooth service return data is started, and a timer is started to perform timeout detection on the fourth detection thread to obtain the corresponding Bluetooth timeout detection result (timeout or not timeout). If the Bluetooth timeout detection result shows timeout and no Bluetooth service return data is received, it is determined that the Bluetooth function detection result fails. At this time, the fourth detection thread is closed, and the Bluetooth function detection result is stored in the global result list in the global detection result. If the Bluetooth timeout detection result shows not timeout and Bluetooth service return data is received, it is determined that the Bluetooth function detection result passes. The Bluetooth service return data can be analyzed and the Bluetooth function detection result is stored in the global result list in the global detection result. Finally, the fourth detection thread is closed.

[0120] It should also be noted that as Figure 8 shown Figure 8 This is a schematic flowchart of a process for fault detection of the RS485-2 bus provided by an embodiment of the present application. Figure 8 In this process, after the second detection thread is completed, that is, after the first RS485 detection result is passed and the second detection thread is closed, the third detection thread is started through the second RS485 bus to start the detection of the RS485-2 bus. At this time, the serial port interface of the RS485-1 bus is closed, and an attempt is made to open the serial port interface of the RS485-2 bus. If the serial port interface of the RS485-2 bus cannot be opened, that is, the third detection thread cannot be started, it is determined that the second RS485 detection result fails, and the second RS485 detection result is stored in the global result list in the global detection result.

[0121] If the serial port interface of the RS485-2 bus can be opened, that is, the third detection thread can be started, then start listening to the serial port data of the RS485-2 bus, generate a second RS485 detection instruction, and send the second RS485 detection instruction to the serial port interface of the RS485-2 bus. At the same time, start a timer to detect whether the return result (i.e., the third response data) of the corresponding second RS485 detection instruction times out, so as to obtain the RS485-2 timeout detection result (detection timed out or detection not timed out). Then, obtain the third response data on the second RS485 bus and perform data analysis and processing on it to obtain the second RS485 detection result. If the RS485-2 timeout detection result is that the detection has timed out and the third response data has not been obtained yet, then determine that the second RS485 detection result is timed out. At this time, close the second detection thread and store the second RS485 detection result in the global result list in the global detection result. If the third response data is received without timing out, and the third response data is communication data sent in a specific feature format and the returned communication data is calculated by a specific algorithm, then determine that the second RS485 detection result is passed, otherwise it is not passed. At this time, cancel the timeout detection of the timer and store the second RS485 detection result in the global result list in the global detection result.

[0122] It should be understood that through the hierarchical fault detection of the RS485-1 bus and the RS485-2 bus, the comprehensive fault detection of the RS485 bus of the energy management device is realized, which can improve the detection efficiency and accuracy.

[0123] In a possible implementation manner, in the process of starting a detection thread for fault detection of the energy management device to obtain the global detection result of the fault detection of the energy management device, the method includes: Start a global result detection timer to perform timeout detection on the global detection result through the global result detection timer at a preset time interval to obtain the global timeout detection result.

[0124] When the global detection result is passed, close the global result detection timer.

[0125] As Figure 9 shown, Figure 9 is a schematic flowchart of timeout detection performed by a global result detection timer provided by an embodiment of the present application. Figure 9In the process of detecting faults in an energy management device through the fault detection system of the energy management device, after the input data information of the barcode scanner is monitored, the terminal device starts a detection thread. At this time, a global result detection timer will be automatically started. The timer will be triggered at a preset time interval (such as 5 seconds, 10 seconds) to perform timeout detection on the current global detection result, so as to judge whether the detection results of all detection threads (such as CAN bus, RS485 bus) are completed within the allowed time, thereby obtaining the global timeout detection result. Specifically, when the results of all detection threads have been generated and are passed, the global timeout detection result is passed; when the result of any one detection thread is not passed or has timed out without completion, the global timeout detection result is timed out and not passed. And when the global timeout detection result is passed, the global result detection timer is turned off, thereby saving resources. Among them, the preset time interval is a preset value, which can be dynamically adjusted according to the complexity of the detection process.

[0126] It should be understood that this fault detection system realizes the timeout monitoring and resource management of the multi-threaded detection process through the global result detection timer, and further improves the detection efficiency and reliability.

[0127] It should be understood that the magnitudes of the sequence numbers of the steps in the above embodiments do not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation to the implementation process of the embodiments of the present application.

[0128] Corresponding to the fault detection method of an energy management device in the above embodiment, Figure 10 The structural schematic diagram of a fault detection device for an energy management device provided by an embodiment of the present application is shown. For the convenience of description, only the parts related to the embodiment of the present application are shown.

[0129] Refer to Figure 10 The fault detection device 3 of the energy management device in this embodiment includes: A response module 31, configured to respond to a user's fault detection instruction and detect the configuration status of multiple preset detection items, where the preset detection items include at least one of the following: Controller Area Network CAN bus, RS485 bus of serial communication standard, Bluetooth; the configuration status is configured or not configured.

[0130] An acquisition module 32, configured to acquire the input data information of the energy management device when it is detected that the configuration status of multiple preset detection items is configured, where the input data information includes the device identification code of the energy management device.

[0131] A detection module 33, configured to start a detection thread for detecting faults in the energy management device and obtain a global detection result for detecting faults in the energy management device.

[0132] It is understandable that this embodiment provides a fault detection device 3 for an energy management device, including: a response module 31 responds to a user's fault detection instruction to detect the configuration status of a plurality of preset detection items, where the preset detection items include at least one of the following: Controller Area Network (CAN) bus, RS-485 bus, Bluetooth; the configuration status is either configured or not configured; an acquisition module 32 acquires input data information of the energy management device when it is detected that the configuration status of the plurality of preset detection items is configured, where the input data information includes the device identification code of the energy management device; a detection module 33 starts a detection thread for performing a fault detection on the energy management device to obtain a global detection result of the fault detection on the energy management device. Through this device, communication detection of the CAN bus and RS-485 bus of the energy management device can be achieved, making the detection process more convenient, efficient, and with a higher accuracy rate.

[0133] It should be noted that for the information interaction, execution process, etc. among the modules in the above-mentioned fault detection device 3 of the energy management device, since they are based on the same concept as the method embodiment of this application, for their specific functions and the technical effects brought, reference can be specifically made to the method embodiment part, and details will not be elaborated here.

[0134] This application embodiment also provides an electronic device, as Figure 11 shown, Figure 11 is a schematic structural diagram of an electronic device provided by an embodiment of this application. Referring to Figure 11 , the electronic device 4 of this embodiment includes: a memory 41, a processor 42, and a computer program stored in the memory 41 and executable on the processor 42. When the processor 42 executes the computer program, the steps in the method embodiment of the fault detection of the energy management device in any one of the above are implemented.

[0135] This application embodiment also provides a computer-readable storage medium. The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps in each of the above method embodiments can be implemented.

[0136] This application embodiment provides a computer program product. When the computer program product runs on a mobile terminal, the mobile terminal is enabled to implement the steps in each of the above method embodiments when executed.

[0137] When an integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on such an understanding, to implement all or part of the processes in the above method embodiments of this application, a computer program can be used to instruct relevant hardware to complete. The computer program can be stored in a computer-readable storage medium. When the computer program is executed by a processor, the steps of the above method embodiments can be implemented. Among them, the computer program includes computer program code, and the computer program code can be in the form of source code, object code, executable file or some intermediate form, etc. The computer-readable medium can at least include: any entity or device that can carry the computer program code to the photographing device / terminal device, recording medium, computer memory, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), electrical carrier signal, telecommunication signal, and software distribution medium. For example, a USB flash drive, a mobile hard disk, a magnetic disk or an optical disc, etc. In some jurisdictions, according to legislation and patent practice, the computer-readable medium cannot be an electrical carrier signal and a telecommunication signal.

[0138] In the above embodiments, the descriptions of each embodiment have their own focuses. For the parts not detailed or recorded in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0139] Those of ordinary skill in the art can realize that the units and algorithm steps of each example described in combination with the embodiments disclosed herein can be implemented by electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are executed in a hardware or software manner depends on the specific application and design constraints of the technical solution. Professional technicians can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of this application.

[0140] In the embodiments provided in this application, it should be understood that the disclosed device / network device and method can be implemented in other ways. For example, the device / network device embodiments described above are only illustrative. For example, the division of modules or units is only a logical function division. In actual implementation, there can be other division methods. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the displayed or discussed coupling or direct coupling or communication connection to each other can be through some interfaces. The indirect coupling or communication connection of the device or unit can be in an electrical, mechanical or other form.

[0141] The unit described as a separation component may or may not be physically separated. The component displayed as a unit may or may not be a physical unit, that is, it may be located in one place or distributed across multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0142] The above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them; although the present application has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that: they can still modify the technical solutions described in the foregoing embodiments, or perform equivalent replacements on some of the technical features; and these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the various embodiments of the present application, and should all be included in the protection scope of the present application.

Claims

1. A fault detection system for energy management equipment, characterized in that: include: Terminal equipment, universal serial bus USB hub, controller area network CAN analyzer, first serial communication standard RS485 bus, second serial communication standard RS485 bus and energy management equipment; wherein, The terminal device is connected to a first interface of a USB hub, a second interface of the USB hub is connected to the CAN analyzer, a third interface of the USB hub is connected to a first RS485 bus, and a fourth interface of the USB hub is connected to a second RS485 bus; The USB hub is used to connect the CAN analyzer, the first RS485 bus, the second RS485 bus and the energy management device through a connector; The terminal device is used to start a detection thread for fault detection of the energy management device by respectively driving the CAN analyzer, the first RS485 bus and the second RS485 bus, obtain a global detection result of fault detection of the energy management device, and display the global detection result.

2. The fault detection system for energy management equipment according to claim 1, characterized in that: The terminal device is also used to start a first detection thread for fault detection on the CAN bus of the energy management device by driving the CAN analyzer, and to start a second detection thread for fault detection on the third RS485 bus of the energy management device by driving the first RS485 bus, and to start a third detection thread for fault detection on the fourth RS485 bus of the energy management device by driving the second RS485 bus.

3. The fault detection system for energy management equipment according to claim 1, characterized in that: The terminal device is further configured to start a global result detection timer to perform a timeout detection on the global detection result at a preset time interval to obtain a global timeout detection result; and to close the global result detection timer when the global detection result is a pass.

4. A method for detecting a fault in an energy management device, characterized in that: A fault detection system for an energy management device according to any one of claims 1 to 3, the method comprising: In response to a fault detection instruction from a user, the configuration status of a plurality of preset detection items is detected, wherein the preset detection items include at least one of the following: a controller area network CAN bus, a serial communication standard RS485 bus, and Bluetooth; the configuration status is configuration completed or configuration incomplete; When it is detected that the configuration status of the plurality of preset detection items is configuration completed, obtaining input data information of the energy management device, wherein the input data information includes a device identification code of the energy management device; A detection thread for performing fault detection on the energy management device is started to obtain a global detection result of the fault detection on the energy management device.

5. The method for detecting a fault in an energy management device according to claim 4, wherein: The detection thread includes a first detection thread for performing fault detection on the CAN bus of the energy management device, a second detection thread for performing fault detection on the third RS485 bus of the energy management device, and a third detection thread for performing fault detection on the fourth RS485 bus of the energy management device; wherein, The starting of a detection thread for performing fault detection on the energy management device to obtain a global detection result of the fault detection on the energy management device includes: Initialize the initial global detection results; Starting a first CAN detection thread in the first detection thread to perform fault detection on the first CAN bus, and obtaining a first CAN detection result; When it is determined that the input data information includes the device identification code, starting the second detection thread to obtain a first RS485 detection result; The initial global detection result is updated according to the first CAN detection result and the first RS485 detection result to obtain the global detection result.

6. The method for detecting a fault in an energy management device according to claim 5, wherein: After the initial global detection result is updated according to the first CAN detection result and the first RS485 detection result to obtain the global detection result, the method includes: When it is determined that the first CAN detection result is passed, starting a second CAN detection thread in the first detection thread to perform fault detection on the second CAN bus to obtain a second CAN detection result; When it is determined that the first RS485 detection result is passed, starting the third detection thread to obtain a second RS485 detection result; The global detection result is updated according to the second CAN detection result and the second RS485 detection result to obtain an updated global detection result.

7. The method for detecting a fault in an energy management device according to claim 6, wherein: The starting of the first CAN detection thread in the first detection thread to perform fault detection on the first CAN bus to obtain a first CAN detection result includes: In the case that the first CAN detection thread cannot be started, determining that the first CAN detection result is failed; In a case where the first CAN detection thread can be started, generating a first CAN detection instruction, wherein the first CAN detection instruction includes a CAN instruction type; Sending the first CAN detection instruction to the first CAN bus, and starting a timer to perform a timeout detection on the first CAN detection thread through the timer to obtain a CAN timeout detection result; Acquire first response data on the first CAN bus according to the CAN command type; The first response data on the first CAN bus is analyzed to obtain the first CAN detection result.

8. The method for detecting a fault in an energy management device according to claim 7, wherein: The analyzing the first response data on the first CAN bus to obtain the first CAN detection result includes: If the first response data is lead-acid-temperature sampling data, data processing and judgment are performed on the lead-acid-temperature sampling data according to a preset data range to obtain a sampling data detection result; If the first response data is version information data, performing version detection on the version information data according to a preset version to obtain a version information detection result; If the first response data is instruction result data, the instruction result data is judged according to the CAN instruction type to obtain an instruction data detection result; The first CAN detection result is determined according to the sampling data detection result, the version information detection result and the instruction data detection result.

9. The method for detecting a fault in an energy management device according to claim 5, wherein: When it is determined that the input data information includes the device identification code, starting the second detection thread to obtain the first RS485 detection result includes: When the second detection thread cannot be started, determining that the first RS485 detection result is failed; When the second detection thread can be started, generate a first RS485 detection instruction, wherein the first RS485 detection instruction includes a Bluetooth modification instruction and a communication instruction type; The Bluetooth modification instruction and the communication instruction type are sent to the first RS485 bus, and a timer is started to perform a timeout detection on the second detection thread through the timer to obtain an RS485 timeout detection result; According to the Bluetooth modification instruction and the communication instruction type, obtaining second response data on the first RS485 bus; wherein the second response data includes Bluetooth response data and communication response data; The first RS485 detection result is determined according to the Bluetooth response data and the communication response data on the first RS485 bus.

10. The method for detecting a fault in an energy management device according to claim 9, wherein: The step of determining the first RS485 detection result according to the Bluetooth response data and the communication response data on the first RS485 bus includes: Respectively analyzing the Bluetooth name in the Bluetooth response data and the communication response data to obtain a Bluetooth name detection result and a communication detection result; When both the Bluetooth name detection result and the communication detection result are passed, it is determined that the first RS485 detection result is passed, the timer is turned off to detect the timeout of the second detection thread and the second detection thread is turned off, and the third detection thread is started; If at least one of the Bluetooth name detection result and the communication detection result fails, determining that the first RS485 detection result fails, and closing the second detection thread; When the Bluetooth name detection result and the communication detection result are not obtained, and the RS485 timeout detection result is that the detection has timed out, it is determined that the first RS485 detection result is timed out, and the second detection thread is closed.

Citation Information

Patent Citations

  • Industrial network test system

    CN106817274A

  • Automatic test method, device and equipment for communication terminal and storage medium

    CN117749678A

  • Bus adapter, CAN bus analyzer and EMC test system

    DE202024106203U1