Two-bus device addressing and fault isolation method based on output cutoff
By using a controlled switch module to cut off power supply and communication paths in bus devices, and automatically binding node serial numbers with unique device identifiers and construction wiring diagrams, the bus communication problems caused by manual pre-coding and device failures are solved, achieving automated location and fault isolation, reducing costs and improving system stability.
Patent Information
- Application Number
- CN202611372899.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2026-09-07
- Publication Date
- 2026-11-17
- Estimated Expiration
- 2046-09-07
AI Technical Summary
In existing technologies, the allocation of bus device node numbers relies on manual precoding, which leads to high labor costs and is prone to errors. Furthermore, the failure of a single device can cause the entire bus communication to be paralyzed, and there is a lack of effective fault isolation mechanisms.
By controlling the controlled switch module through the host computer to cut off the power supply and communication output path of the equipment at the physical layer, the node sequence number is automatically bound by the unique identifier of the equipment and the on-site construction wiring diagram, and the equipment can autonomously isolate itself when it detects faults, thus achieving equipment-level fault isolation.
It enables automatic acquisition of correct node serial numbers and binding of physical locations after equipment installation without the need for manual pre-coding, reducing installation and maintenance costs, and autonomously isolating in case of equipment failure to prevent the entire bus from paralyzing.
Smart Images

Figure CN122909067B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the technical field of two-bus communication technology, and in particular to a two-bus device addressing and fault isolation method based on output cutoff. Background Technology
[0002] In bus communication systems, bus devices (such as sensors, actuators, and detectors) are typically connected to the bus in series. Each device needs to be assigned a unique node number to enable communication and positioning with the host computer. Currently, the allocation of device node numbers usually relies on manual pre-coding, meaning each device is manually coded before installation and its location information is manually entered into the control terminal after installation. This method suffers from high labor costs, is prone to errors, and is difficult to maintain. Furthermore, a failure in a single device in the bus system often paralyzes the entire bus communication, lacking an effective fault isolation mechanism.
[0003] Patent application CN121125689A discloses an automatic addressing method, apparatus, device, and medium based on an RS-485 bus. The method involves a slave station accumulating the number of broadcast addressing commands received, and after reaching a preset threshold, controlling the RS-485 bus communication output interface to disconnect. The slave station then sets its local communication address and returns an addressing command data frame with an incrementing address. While this solution achieves slave station output interface disconnection and automatic address incrementing, the purpose of disconnecting the output interface is to prevent subsequent slave station receiving addressing commands. The address is assigned incrementally based on the host address, not based on the number of online devices to determine the physical node sequence number. Furthermore, it does not involve the automatic binding of the device's unique identifier to its physical installation location, and the actual installation location of the device cannot be automatically confirmed after installation.
[0004] Patent application CN113271244A discloses an RS-485 bus self-organizing network full-duplex communication system and an automatic addressing method. The terminal has two interfaces using a bypass design, with a relay controlling the path between interface A and interface B. The slave device increments its address by 1 based on the master device's address. When a slave device fails, the relay activates interfaces A and B, making the faulty terminal a path to maintain link connectivity. While this scheme involves fault handling, its fault handling method is to bypass the faulty terminal to make it a path, rather than isolating it by cutting off the output path to downstream devices. Furthermore, it lacks a mechanism for devices to autonomously detect and disconnect downstream faults; fault isolation relies on external relay action, failing to achieve device-level fault self-isolation and reporting.
[0005] In summary, the existing technology has the following shortcomings: First, equipment installation requires manual pre-coding to accurately display the installation location on the control terminal, resulting in high labor costs; second, the address allocation in the existing automatic addressing scheme is incremental, which cannot automatically bind the unique identifier of the equipment to the actual physical installation location; third, the failure of a single device on the two-bus line will cause the entire two-bus line to be paralyzed, lacking the self-isolation capability of the equipment to autonomously detect faults and cut off downstream outputs. Summary of the Invention
[0006] The purpose of this invention is to provide a two-bus device addressing and fault isolation method based on output cutoff, so as to solve the problems mentioned in the background art.
[0007] To achieve the above objectives, this invention provides a method for addressing, locating, and isolating faults in two-bus devices based on output disconnection, employing the following technical solution:
[0008] A two-bus device addressing and positioning method based on output disconnection is applied to a system including a host computer and multiple serially connected two-bus devices. The system uses a two-bus that shares power supply and communication to connect the devices. The cables of the two-bus simultaneously transmit DC power and communication signals. This method is suitable for the initial debugging stage when all devices in the two-bus link have normal hardware and smooth communication. It includes the following steps:
[0009] The host computer sequentially executes the following addressing and positioning steps for each target device connected in series on the bus, from upstream to downstream, until the node sequence number allocation and physical installation location binding of all devices are completed:
[0010] Step 1: The host computer sends a disconnection command to the current target device to control the disconnection of the controlled switch module. The current target device controls the disconnection of its internal controlled switch module according to the disconnection command, thereby physically cutting off its power supply and communication output path to all downstream devices.
[0011] Step 2: After the output path is cut off by the physical layer, the host computer initiates an online device registration command to obtain the total number of all online devices that are still online and a list of unique device identifiers for each online device. After the output path is cut off by the physical layer, all downstream devices of the current target device are offline due to the interruption of power supply and communication by the physical layer, while the current target device and all its upstream devices remain online. Since the link disconnection command only cuts off the downstream output path of the current target device, the uplink communication link between the current target device and the host computer remains intact and can still receive subsequent commands issued by the host computer normally.
[0012] Step 3: The host computer determines the total number as the node number of the current target device. The node number also serves as the physical location number and communication addressing identifier of the current target device in the serial link.
[0013] Step 4: The host computer extracts the unique device identifier of the current target device from the online device information obtained in Step 2. The unique device identifier is an unchangeable identification code that is fixed at the factory when the two-bus device leaves the factory, and establishes a mapping relationship between the node sequence number and the unique device identifier.
[0014] Step 5: The host computer acquires the pre-stored on-site construction wiring diagram data. The on-site construction wiring diagram data is an electronic construction record pre-entered based on the serial physical connection sequence of the two-bus devices. It contains the mapping relationship between the node number and the physical installation position arranged sequentially along the two-bus direction. The host computer automatically binds the unique device identifier to the corresponding actual physical installation position in the on-site construction wiring diagram data according to the node number.
[0015] Step Six: The host computer sends a link control command to the current target device to control the closing of the controlled switch module. The current target device controls the closed controlled switch module according to the link control command, restoring its power supply and communication output path to all downstream devices.
[0016] By adopting the above technical solution, the host computer controls the target device to cut off the power supply and communication output path to downstream devices at the physical layer through the chain disconnection command, so that the downstream devices are temporarily offline. Then, the number of online devices is scanned and the number is directly determined as the physical node number of the target device. Addressing is performed on all devices in order from upstream to downstream to ensure that each device can obtain the correct physical node number. At the same time, combined with the pre-stored on-site construction wiring diagram data, the unique device identifier is automatically bound to the actual physical installation location. This enables the accurate location of the physical installation location of the device without manual intervention after installation, which greatly reduces the installation and maintenance costs.
[0017] Preferably, the physical layer communication protocol of the two buses is RS-485 or CAN, and the serial connection is a chain topology in which each two bus device is connected in series through its input port and output port.
[0018] Preferably, the controlled switch module is a relay switch or a MOSFET switch, which is located on the power supply line and communication line between the upstream communication interface and the downstream output interface of the dual-bus device.
[0019] By adopting the above technical solution, the controlled switch module can simultaneously control the physical layer connection and disconnection of the power supply path and the communication path, ensuring that downstream equipment is completely offline after disconnection.
[0020] Preferably, the unique device identifier is a MAC address or a unique serial number that is fixed at the time of manufacture.
[0021] By adopting the above technical solution, the equipment is fixed with a unique identification code when it leaves the factory. There is no need for manual pre-coding before installation. After installation, the node sequence number is automatically obtained through the addressing method and bound to the physical installation location, eliminating the manual pre-coding process and reducing labor costs and the probability of errors.
[0022] This invention also provides a method for fault isolation of two-bus devices, applied to the above-mentioned two-bus system, and adopts the following technical solution:
[0023] A method for fault isolation of a two-bus device, wherein the two-bus device includes a controller module and a fault detection circuit electrically connected to the controller module, and further includes: when a device on the two-bus detects a short circuit fault or overcurrent fault in the power supply path of its downstream output interface through its internal detection circuit, the device autonomously controls its internal controlled switch module to disconnect, thereby physically cutting off the power supply and communication output path to the downstream device, and reports fault isolation status information containing the node number of the target device to the host computer through the two-bus, wherein the node number also identifies the physical location of the target device in the serial link;
[0024] After receiving the fault isolation status information, the host computer marks the fault isolation status of the device and marks the online status of all downstream devices as offline, so as to realize the downgrade detection of the fault area and keep the upstream devices of the fault area working normally.
[0025] After troubleshooting, the host computer sends a link control command to the device to close the controlled switch module to restore the downstream power supply and communication path, and re-triggers the addressing process to restore the online status and node number of the downstream device.
[0026] By adopting the above technical solution, the equipment can autonomously detect short circuit or overcurrent faults in the power supply path of the downstream output interface through its internal detection circuit. It can also autonomously control the controlled switch module to disconnect and physically cut off the downstream power supply and communication path, thereby achieving autonomous isolation of the fault area without the need for an external isolator. At the same time, it reports the fault isolation status information to the host computer, which marks the downstream device as offline to achieve degradation detection, ensuring that the upstream device in the fault area continues to work normally. This solves the problem of a single device failure causing the entire two-bus line to be paralyzed.
[0027] Preferably, the fault detection circuit includes a sampling resistor connected in series in the power supply path of the downstream output interface and a voltage comparator electrically connected to the sampling resistor. The circuit determines whether there is a short circuit or overcurrent fault in the power supply path of the downstream output interface by detecting the voltage change across the sampling resistor.
[0028] By adopting the above technical solution, a specific implementation method for fault detection circuit is provided, which has a simple circuit structure, low cost, and reliable detection.
[0029] Preferably, the controlled switch module also supports receiving a disconnection command issued by the host computer, and cutting off the output path to downstream devices according to the disconnection command, so as to realize remote control of device shielding and maintenance operations.
[0030] By adopting the above technical solution, the controlled switch module not only supports autonomous device disconnection, but also supports remote control disconnection by the host computer, realizing remote device shielding and maintenance operations.
[0031] The present invention also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the above-described method. Attached Figure Description
[0032] Figure 1 This is a schematic diagram of the serial topology of the two-bus system of the present invention;
[0033] Figure 2 This is a flowchart of the automatic addressing and positioning method of the present invention;
[0034] Figure 3 This is a schematic diagram of online device registration after the output of the device is cut off according to the present invention;
[0035] Figure 4 This is a flowchart of the fault isolation method of the present invention;
[0036] Figure 5 This is a block diagram of the internal hardware structure of the two-bus device of the present invention.
[0037] Explanation of reference numerals in the attached diagram: 100, host computer; 110, upstream communication interface; 120, downstream output interface; 210, controlled switch module; 220, unique device identifier storage module; 230, controller module; 240, fault detection circuit. Detailed Implementation
[0038] The following is in conjunction with the appendix Figure 1-5 The present invention will be described in further detail below.
[0039] Example 1
[0040] For ease of description, this application defines the direction extending outward from the host computer along the two buses as "downstream" and the opposite direction as "upstream"; that is, the device closer to the host computer is the upstream device, and the device farther away from the host computer is the downstream device.
[0041] like Figure 1As shown, this embodiment provides a two-bus system, including a host computer 100 and multiple series-connected two-bus devices. The two-bus connection adopts a series wiring method. The host computer 100 sequentially connects device 1, device 2... device n through the two-bus. The two-bus is introduced into each device through its input port and led out from its output port to the next device via its internal controlled switch module, forming a series chain structure. Specifically, the host computer 100 sequentially connects device 1, device 2, device 3 to device n. The input port of device 1 is connected to the host computer 100, the output port of device 1 is connected to the input port of device 2, the output port of device 2 is connected to the input port of device 3, and so on. The physical layer communication protocol of the two-bus is RS-485 or CAN protocol, and each two-bus device is sequentially connected in series through its input and output ports to form a chain topology.
[0042] like Figure 5 As shown, each dual-bus device internally includes a controlled switch module 210, a unique device identifier storage module 220, a controller module 230, and a fault detection circuit 240. The controlled switch module 210 is electrically connected between the upstream communication interface 110 and the downstream output interface 120 of the device, and is used to control the on / off state of the power supply and communication paths at the physical layer. The controlled switch module 210 is a relay switch or a MOSFET switch, and is located on the power supply and communication lines between the upstream communication interface 110 and the downstream output interface 120 of the dual-bus device. The unique device identifier storage module 220 stores a unique identification code fixed at the factory, which is a MAC address or a unique serial number. The controller module 230 is electrically connected to the controlled switch module 210, the unique device identifier storage module 220, and the upstream communication interface 110. The detection terminal of the fault detection circuit 240 is electrically connected to the downstream output interface 120, and the output terminal is electrically connected to the controller module 230, used to detect short-circuit and overcurrent fault states in the power supply path of the downstream output interface. The fault detection circuit 240 includes a sampling resistor connected in series in the power supply path of the downstream output interface and a voltage comparator electrically connected to the sampling resistor. It determines whether there is a short circuit or overcurrent fault in the power supply path of the downstream output interface by detecting the voltage change across the sampling resistor.
[0043] For example, when the voltage across the sampling resistor rises sharply and exceeds a first preset threshold, a short circuit fault is identified in the power supply path of the downstream output interface; when the voltage across the sampling resistor remains above a second preset threshold (below the first preset threshold) for a duration exceeding a preset time, an overcurrent fault is identified. Both faults trigger the controlled switch module to disconnect.
[0044] like Figure 2 As shown, the automatic addressing and location method in this embodiment includes the following steps:
[0045] Step 1: The host computer 100 sends a disconnect command to the target device. Taking device 1 as an example, the host computer 100 sends a disconnect command to device 1. Device 1 controls its internal controlled switch module 210 to disconnect according to the disconnect command, thereby physically cutting off the power supply and communication output path from device 1 to devices 2 to n. At this time, devices 2 to n are temporarily offline because the power supply and communication path is cut off.
[0046] Step Two: The host computer 100 initiates an online device registration command to obtain the total number of currently online devices and a list of unique device identifiers for each online device. After the output path of device 1 is cut off, only device 1 remains online. The host computer 100 obtains the total number of online devices (1) and the unique device identifier of device 1 through the online device registration function. Since the link break only cuts off the downstream output path of device 1, the uplink communication link between device 1 and the host computer 100 remains intact and can still receive subsequent commands normally.
[0047] Step 3: The host computer 100 determines the total number as the node sequence number of the target device. The total number of online devices is 1, so the node sequence number of device 1 is determined to be 1. This sequence number serves as both the target address used by the host computer when communicating with device 1 and a unique identifier that device 1 is in the first installation position in the physical link.
[0048] Step 4: The host computer 100 extracts the unique device identifier of the current target device from the list of unique device identifiers of online devices obtained in Step 2. The unique device identifier is an unchangeable identification code that is fixed when the device leaves the factory, and establishes a mapping relationship between the node sequence number and the unique device identifier.
[0049] Step 5: The host computer 100 acquires the pre-stored on-site construction wiring diagram data and automatically binds the unique device identifier to the actual physical installation location based on the node sequence number. The on-site construction wiring diagram data contains the correspondence between each node sequence number and the actual physical installation location. Node sequence number 1 corresponds to the first installation location, therefore the host computer 100 automatically binds the unique device identifier of device 1 to the first installation location.
[0050] Step Six: The host computer 100 sends a connection command to the target device. The target device controls the controlled switch module 210 to close, restoring the power supply and communication output path to downstream devices. Device 1 controls the controlled switch module 210 to close according to the connection command, restoring the power supply and communication output path to devices 2 through n.
[0051] After completing the addressing of device 1, the host computer 100 performs the same addressing steps for device 2 according to the serial sequence of the two buses. For example... Figure 3As shown, the output of device 2 is turned off, and the downstream node device 3 is disconnected from device n. At this time, the host computer 100 obtains the total number of online devices through the device registration function, which is 2 (both device 1 and device 2 are online). Therefore, the node number of device 2 is determined to be 2. According to the on-site construction wiring diagram, the host computer 100 binds the unique device identifier of device 2 to the second installation position. Similarly, when addressing device 3, the output of device 3 is turned off, the total number of online devices is 3, and the node number of device 3 is 3; when addressing device n, the output of device n is turned off, the total number of online devices is n, and the node number of device n is n. The host computer 100 executes the above steps one to six sequentially for all devices connected in series on the bus from upstream to downstream, until the node number assignment and physical installation position binding of all devices are completed.
[0052] It should be noted that the on-site construction wiring diagram data is electronic construction record data generated by the construction personnel on site according to the physical order of the bus series connection, installing the first device in the first position, the second device in the second position, and so on. This data is pre-stored in the storage module of the host computer 100 before system debugging.
[0053] In this embodiment, the device does not require manual pre-coding before installation. After installation, the node sequence number is automatically obtained through the above addressing method and bound to the actual physical installation location.
[0054] Example 2
[0055] like Figure 4 As shown, this embodiment provides a two-bus device fault isolation method, which is applied to the two-bus system described in Embodiment 1.
[0056] When a device on the two-wire bus (taking device 2 as an example) detects a short circuit or overcurrent fault in the power supply path of its downstream output interface through its internal fault detection circuit 240, device 2 autonomously controls its internal controlled switch module 210 to disconnect, thereby physically cutting off the power supply and communication output path to devices 3 through n. At the same time, device 2 reports fault isolation status information, including its own node number, to the host computer 100 via the two-wire bus.
[0057] After receiving the fault isolation status information, the host computer 100 marks device 2 as being in a fault isolation state and marks the online status of devices 3 to n as offline, thereby achieving downgrade detection of the fault area. At this time, device 1 continues to operate normally and is not affected by the downstream fault of device 2.
[0058] Furthermore, the controlled switch module 210 also supports receiving disconnection commands from the host computer 100. When maintenance is required on a device, the host computer 100 can remotely issue a disconnection command to control the controlled switch module 210 of that device to disconnect, cutting off the power supply path to its downstream output interface, thus enabling remote control of device shielding and maintenance operations. After maintenance is completed, the host computer 100 issues a reconnection command to control the controlled switch module 210 to close, restoring the output path.
[0059] After troubleshooting, the host computer 100 sends a link control command to device 2 to control the controlled switch module 210 to close in order to restore the downstream power supply and communication path, and re-triggers the addressing process to restore the online status and node sequence number of devices 3 to n.
[0060] Example 3
[0061] This embodiment provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, it implements the steps of the methods described in Embodiments 1 and 2 above. The computer-readable storage medium includes, but is not limited to, various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0062] The above are all preferred embodiments of the present invention and are not intended to limit the scope of protection of the present invention. Therefore, all equivalent changes made in accordance with the structure, shape and principle of the present invention should be covered within the scope of protection of the present invention.
Claims
1. A two-bus device addressing and positioning method based on output cutoff, characterized in that, This method is applicable to systems including a host computer and multiple serially connected two-bus devices. The system uses a shared two-bus for both power supply and communication to connect the devices. The cables of the two-bus simultaneously transmit DC power and communication signals. This method is suitable for the initial debugging phase when all devices in the two-bus link have normal hardware and smooth communication. It includes the following steps: The host computer sequentially executes the following addressing and positioning steps for each target device connected in series on the bus, from upstream to downstream, until the node sequence number allocation and physical installation location binding of all devices are completed: Step 1: The host computer sends a disconnection command to the current target device to control the disconnection of the controlled switch module. The current target device controls the disconnection of its internal controlled switch module according to the disconnection command, thereby physically cutting off its power supply and communication output path to all downstream devices. Step 2: After the output path is cut off by the physical layer, the host computer initiates an online device registration command to obtain the total number of all online devices that are still online and a list of unique device identifiers for each online device. After the output path is cut off by the physical layer, all downstream devices of the current target device are offline due to the interruption of power supply and communication by the physical layer, while the current target device and all its upstream devices remain online. Since the link disconnection command only cuts off the downstream output path of the current target device, the uplink communication link between the current target device and the host computer remains intact and can still receive subsequent commands issued by the host computer normally. Step 3: The host computer determines the total number as the node number of the current target device. The node number also serves as the physical location number and communication addressing identifier of the current target device in the serial link. Step 4: The host computer extracts the unique device identifier of the current target device from the online device information obtained in Step 2. The unique device identifier is an unchangeable identification code that is fixed at the factory when the two-bus device leaves the factory, and establishes a mapping relationship between the node sequence number and the unique device identifier. Step 5: The host computer acquires the pre-stored on-site construction wiring diagram data. The on-site construction wiring diagram data is an electronic construction record pre-entered based on the serial physical connection sequence of the two-bus devices. It contains the mapping relationship between the node number and the physical installation position arranged sequentially along the two-bus direction. The host computer automatically binds the unique device identifier to the corresponding actual physical installation position in the on-site construction wiring diagram data according to the node number. Step Six: The host computer sends a link control command to the current target device to control the closing of the controlled switch module. The current target device controls the closed controlled switch module according to the link control command, restoring its power supply and communication output path to all downstream devices.
2. The two-bus device addressing and positioning method based on output cutoff according to claim 1, characterized in that: The physical layer communication protocol of the two buses is RS-485 or CAN protocol, and the serial connection is a chain topology in which each two bus device is connected in series through its input port and output port.
3. The two-bus device addressing and positioning method based on output cutoff according to claim 1, characterized in that: The controlled switch module is a relay switch or a MOSFET switch, which is located on the power supply line and communication line between the upstream communication interface and the downstream output interface of the dual-bus device.
4. The two-bus device addressing and positioning method based on output cutoff according to claim 1, characterized in that: The unique device identifier is the MAC address or unique serial number that is fixed at the factory when the device leaves the factory.
5. A method for fault isolation of a two-bus device, applied to a two-bus system employing the method of claim 1, wherein the two-bus device includes a controller module and a fault detection circuit electrically connected to the controller module, characterized in that, Also includes: When a device on the two-wire bus detects a short circuit or overcurrent fault in the power supply path of its downstream output interface through its internal detection circuit, the device autonomously controls its internal controlled switch module to disconnect, thereby physically cutting off the power supply and communication output path to the downstream device. The device then reports the fault isolation status information, which includes the node number of the target device itself, to the host computer via the two-wire bus. The node number also identifies the physical location of the target device in the serial link. After receiving the fault isolation status information, the host computer marks the fault isolation status of the device and marks the online status of all downstream devices as offline, so as to realize the downgrade detection of the fault area and keep the upstream devices of the fault area working normally. After the fault is cleared, the host computer sends a link control command to the device to close the controlled switch module to restore the downstream power supply and communication path, and re-triggers the addressing process to restore the online status and node number of the downstream device.
6. The fault isolation method for two-bus devices according to claim 5, characterized in that: The fault detection circuit includes a sampling resistor connected in series in the power supply path of the downstream output interface and a voltage comparator electrically connected to the sampling resistor. It determines whether there is a short circuit or overcurrent fault in the power supply path of the downstream output interface by detecting the voltage change across the sampling resistor.
7. The two-bus device fault isolation method according to claim 5, characterized in that: The controlled switch module also supports receiving a disconnection command issued by the host computer, and cutting off the output path to downstream devices according to the disconnection command, so as to realize remote control of device shielding and maintenance operations.
8. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the program is executed by the processor, it implements the steps of the method as described in any one of claims 1 to 7.
Citation Information
Patent Citations
RS485 bus ad hoc network full duplex communication system and automatic addressing method thereof
CN113271244A
Automatic addressing method, device and equipment based on RS-485 bus and medium
CN121125689A
Two-bus communication method and system
CN105049311A
Two-bus equipment for fire fighting and automatic coding method
CN116760657A
