CN111382018A - Fault detection method and device for serial communication and readable storage medium - Google Patents

Fault detection method and device for serial communication and readable storage medium Download PDF

Info

Publication number
CN111382018A
CN111382018A CN201811636437.9A CN201811636437A CN111382018A CN 111382018 A CN111382018 A CN 111382018A CN 201811636437 A CN201811636437 A CN 201811636437A CN 111382018 A CN111382018 A CN 111382018A
Authority
CN
China
Prior art keywords
slave device
level slave
communication
ith
level
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Withdrawn
Application number
CN201811636437.9A
Other languages
Chinese (zh)
Inventor
曾梦琪
方咏梅
朱皖蓉
陈文权
杨松绍
董亮
盛秀梅
方红菱
吕福友
肖远平
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shanghai Fukong Hualong Microsystem Technology Co ltd
Original Assignee
Shanghai Fukong Hualong Microsystem Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shanghai Fukong Hualong Microsystem Technology Co ltd filed Critical Shanghai Fukong Hualong Microsystem Technology Co ltd
Priority to CN201811636437.9A priority Critical patent/CN111382018A/en
Publication of CN111382018A publication Critical patent/CN111382018A/en
Withdrawn legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/22Detection or location of defective computer hardware by testing during standby operation or during idle time, e.g. start-up testing
    • G06F11/2205Detection or location of defective computer hardware by testing during standby operation or during idle time, e.g. start-up testing using arrangements specific to the hardware being tested
    • G06F11/221Detection or location of defective computer hardware by testing during standby operation or during idle time, e.g. start-up testing using arrangements specific to the hardware being tested to test buses, lines or interfaces, e.g. stuck-at or open line faults
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/0703Error or fault processing not based on redundancy, i.e. by taking additional measures to deal with the error or fault not making use of redundancy in operation, in hardware, or in data representation
    • G06F11/0793Remedial or corrective actions
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/22Detection or location of defective computer hardware by testing during standby operation or during idle time, e.g. start-up testing
    • G06F11/2273Test methods

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Hardware Design (AREA)
  • Debugging And Monitoring (AREA)

Abstract

A fault detection method and device for serial communication and a readable storage medium are provided, wherein the fault detection method for serial communication comprises the following steps: disconnecting the ith-level slave equipment to be detected currently from the next-level slave equipment; detecting whether communication between the ith level slave device and a higher level slave device has a fault; when the communication between the ith-level slave device and the upper-level slave device is detected to have a fault, the communication between the ith-level slave device and all slave devices with communication timing sequence later than that of the ith-level slave device and a master device is disconnected. By adopting the scheme, the serial communication fault can be effectively detected and the normal work of the serial communication can be ensured.

Description

Fault detection method and device for serial communication and readable storage medium
Technical Field
The invention belongs to the technical field of serial communication, and particularly relates to a fault detection method and device for serial communication and a readable storage medium.
Background
With the application and development of automatic control technology, control systems become more and more complex, which makes many single-machine control systems gradually develop towards multipoint networking. Therefore, various serial communication standards, which are mainstream in RS-485 standards, are widely used in the fields of industrial control, power communication, smart meters, and the like. However, the field environment such as industrial control is often complicated, and electric noise often interferes with the transmission line. In addition, there are other various dangerous situations, for example, when multiple points are interconnected, there will be potential differences between the grounds of different devices, forming a ground loop, which will interfere with the whole system, and in severe cases, cause catastrophic damage to the system; when high voltage or high current such as current surge exists, equipment is possibly damaged or the safety of personnel is possibly damaged; when a device on the bus fails, the transmitter will occupy the bus for a long time, resulting in deadlock.
In the prior art, a general serial communication bus system does not have a fault detection function, and when a bus or equipment fails, all the equipment cannot work, so that normal communication is greatly influenced.
Disclosure of Invention
The embodiment of the invention solves the problem of how to effectively detect the serial communication fault and ensure the normal work of the serial communication.
To solve the foregoing technical problem, an embodiment of the present invention provides a fault detection method for serial communication, including: disconnecting the ith-level slave equipment to be detected currently from the next-level slave equipment; detecting whether communication between the ith level slave device and a higher level slave device has a fault; when the communication between the ith-level slave device and the upper-level slave device is detected to have a fault, the communication between the ith-level slave device and all slave devices with communication timing sequence later than that of the ith-level slave device and a master device is disconnected.
Optionally, the detecting whether there is a failure in communication between the ith-level slave device and the upper-level slave device includes: whether the parameter of the communication signal between the ith level slave device and the upper level slave device meets a preset threshold range or not is detected.
Optionally, the parameter of the communication signal includes at least one of the following parameters: level, timing, and differential mode voltage.
Optionally, after detecting that there is no failure in communication between the ith level slave device and the upper level slave device, the method further includes: establishing connection between the ith level slave device to be detected and the next level slave device; detecting whether communication between the ith level slave device and the next level slave device has a fault; when the communication between the ith level slave device and the next level slave device is detected to have a fault, the next level slave device and all the slave devices with communication timing sequence later than that of the next level slave device are disconnected from the master device.
Optionally, the detecting whether there is a failure in communication between the ith level slave device and the next level slave device includes: and detecting whether preset data sent by a detection device corresponding to the next-level slave equipment is received.
Optionally, when it is detected that there is no fault in the communication between the ith-level slave device and the upper-level slave device, establishing a connection between the current ith-level slave device to be detected and the lower-level slave device.
Optionally, when it is detected that there is a failure in communication between the ith-level slave device and the upper-level slave device, the method further includes: establishing connection between the ith level slave device to be detected and the next level slave device; disconnecting the ith-level slave equipment to be detected currently from the previous-level slave equipment; detecting whether communication between the ith level slave device and the next level slave device has a fault; when the communication between the ith-level slave device and the next-level slave device and the communication between the ith-level slave device and the previous-level slave device are detected to be failed, the communication between the ith-level slave device and all the slave devices with communication timing sequence later than that of the ith-level slave device and the master device is disconnected.
Optionally, when it is detected that no fault exists in communication between the ith-level slave device and the next-level slave device or between the ith-level slave device and the previous-level slave device, establishing a connection between the current to-be-detected ith-level slave device and the previous-level slave device.
In order to solve the above technical problem, an embodiment of the present invention further discloses a serial communication fault detection apparatus, where the serial communication fault detection apparatus is coupled to an i-th slave device to be currently detected, and the serial communication fault detection apparatus includes: the device comprises a detection unit, a first interface and a second interface; the first interface is connected with the upper-level slave equipment and the corresponding detection unit; the second interface is connected with the next-level slave equipment and the corresponding detection unit; the detection unit is used for controlling the second interface to be disconnected with the next-level slave device and detecting whether the communication between the ith-level slave device and the previous-level slave device has a fault; when the communication between the ith-level slave device and the upper-level slave device is detected to have a fault, the communication between the ith-level slave device and all slave devices with communication timing sequence later than that of the ith-level slave device and a master device is disconnected.
Optionally, the detecting unit is configured to detect whether there is a failure in communication between the i-th level slave device and the upper level slave device, and includes: and detecting whether the parameter of the communication signal between the ith-level slave device and the upper-level slave device meets a preset threshold range.
Optionally, the parameter of the communication signal includes at least one of the following parameters: level, timing, and differential mode voltage.
Optionally, the detection unit is further configured to: after detecting that the communication between the ith level slave device and the upper level slave device has no fault, controlling the second interface to establish connection with the lower level slave device; detecting whether communication between the ith level slave device and the next level slave device has a fault; when the communication between the ith level slave device and the next level slave device is detected to have a fault, the next level slave device and all the slave devices with communication timing sequence later than that of the next level slave device are disconnected from the master device.
Optionally, the detecting unit is configured to detect whether there is a failure in communication between the i-th level slave device and the upper level slave device, and includes: and detecting whether preset data sent by a detection device corresponding to the next-level slave equipment is received.
Optionally, the detection unit is further configured to: and when detecting that the communication between the ith level slave device and the upper level slave device is not failed, controlling the second interface to establish connection with the lower level slave device.
Optionally, the detection unit is further configured to: when detecting that the communication between the ith level slave device and the upper level slave device has a fault, controlling the second interface to establish connection with the lower level slave device; controlling the first interface to be disconnected with the upper-level slave equipment; detecting whether communication between the ith level slave device and the next level slave device has a fault; when the communication between the ith-level slave device and the next-level slave device and the communication between the ith-level slave device and the previous-level slave device are detected to be failed, the communication between the ith-level slave device and all slave devices with communication timing sequence later than that of the ith-level slave device and a master device is disconnected.
Optionally, the detection unit is further configured to: and when detecting that no fault exists in the communication between the ith level slave device and the next level slave device or between the ith level slave device and the previous level slave device, controlling the first interface to establish connection with the previous level slave device.
The embodiment of the invention also discloses a readable storage medium, wherein a computer instruction is stored on the readable storage medium, and the computer instruction executes the steps of any one of the serial communication fault detection methods when running.
The embodiment of the invention also provides a serial communication fault detection device, which comprises a memory and a processor, wherein the memory stores computer instructions capable of running on the processor, and the processor executes any one of the steps of the serial communication fault detection method when running the computer instructions.
Compared with the prior art, the technical scheme of the embodiment of the invention has the following beneficial effects:
the method comprises the steps that the connection between the ith level slave device to be detected and the next level slave device is disconnected; whether the communication between the ith level slave device and the upper level slave device has a fault or not is detected, and a certain part of the communication can be effectively detected to have a fault under the condition that the power is supplied to the master device. The communication between the ith level slave equipment and all slave equipment with the communication time sequence later than that of the ith level slave equipment and the master equipment is disconnected, and the connection of a fault part is cut off, so that a communication fault area is isolated, and the normal work of other areas is guaranteed.
Further, the connection between the ith level slave device to be detected and the next level slave device is established; disconnecting the ith-level slave equipment to be detected currently from the previous-level slave equipment; detecting whether communication between the ith level slave device and the next level slave device has a fault; when the communication between the ith-level slave device and the next-level slave device and the communication between the ith-level slave device and the previous-level slave device are detected to be faulty, the communication between the ith-level slave device and all the slave devices with communication timing later than that of the ith-level slave device and the master device is disconnected, so that a fault of a certain part or parts of the communication can be effectively detected under the condition that the slave devices supply power by themselves, and the connection of the faulty part is cut off, thereby isolating the area with communication fault and ensuring that the rest areas can work normally.
Drawings
FIG. 1 is a flow chart of a method for fault detection for serial communication according to an embodiment of the present invention;
fig. 2 is a schematic structural diagram of a serial communication fault detection apparatus according to an embodiment of the present invention;
FIG. 3 is a topology diagram of a serial communication fault detection apparatus applied to master-slave serial communication according to an embodiment of the present invention;
fig. 4 is a topology diagram of the application of the fault detection device for serial communication and multipoint serial communication according to the embodiment of the present invention.
Detailed Description
In the prior art, a general serial communication bus system does not have a fault detection function, and when a bus or equipment fails, all the equipment cannot work, so that normal communication is greatly influenced.
In the embodiment of the invention, the connection between the ith level slave equipment to be detected and the next level slave equipment is disconnected; whether the communication between the ith level slave device and the upper level slave device has a fault or not is detected, and a certain part of the communication can be effectively detected to have a fault under the condition that the power is supplied to the master device. The communication between the ith level slave equipment and all slave equipment with the communication time sequence later than that of the ith level slave equipment and the master equipment is disconnected, and the connection of a fault part is cut off, so that a communication fault area is isolated, and the normal work of other areas is guaranteed.
In order to make the aforementioned objects, features and advantages of the present invention comprehensible, embodiments accompanied with figures are described in detail below.
An embodiment of the present invention provides a fault detection method for serial communication, which is described in detail below with reference to fig. 1 through specific steps.
The fault detection method for serial communication provided by the embodiment of the invention can be applied to various types of serial communication based on the RS-485 standard.
And S101, disconnecting the ith level slave device to be detected currently from the next level slave device.
In specific implementation, under the condition that the slave device is powered by the master device, the communication connection and the power supply connection between the ith-level slave device to be detected and the next-level slave device are disconnected, so that the influence of the next-level slave device on the fault detection of the ith-level slave device to be detected can be eliminated, and whether the communication between the ith-level slave device to be detected and the previous-level slave device has a fault or not can be accurately detected.
In a specific implementation, when the slave device is powered by the master device, before starting the fault detection, if the communication connection and the power connection between the ith-level slave device to be detected and the previous-level slave device are already disconnected, after the communication connection and the power connection between the ith-level slave device and the previous-level slave device are established, step S102 is performed.
Step S102, detecting whether the communication between the ith level slave device and the upper level slave device has a fault.
In a specific implementation, the detecting whether there is a failure in communication between the ith slave device and the upper slave device may include: whether the parameter of the communication signal between the ith level slave device and the upper level slave device meets a preset threshold range or not is detected.
In a specific implementation, the communication signal may be sampled, the level, the timing sequence, and the differential mode voltage of the communication signal may be measured, and when any one of the parameters does not meet a preset threshold range, it is further determined whether there is an abnormality such as interference, distortion, disconnection, short circuit, or deadlock in the communication between the i-th level slave device and the previous level slave device.
In particular implementations, the parameter of the communication signal may include at least one of: level, timing, and differential mode voltage. It can be understood that different users may select one or more communication signal parameters to determine whether there is a failure in the communication between the i-th-level slave device and the upper-level slave device according to their own different requirements, that is, as long as the signal parameters that indicate the failure in the communication can be determined, all the parameters can be used in the detection process of step S102, which is not described herein again.
In a specific implementation, when the slave device is powered by the master device, the fault detection device corresponding to the i-th slave device may further send preset data to the fault detection device corresponding to the upper-level slave device, and when the fault detection device corresponding to the upper-level slave device does not receive the preset data or receives data that does not meet the condition, the fault detection device corresponding to the upper-level slave device determines that there is a fault in the communication between the i-th slave device and the upper-level slave device, and the fault detection device corresponding to the upper-level slave device may disconnect the communication between the i-th slave device and all slave devices whose communication timings are later than those of the i-th slave device and the master device.
Step S103, when detecting that the communication between the ith level slave device and the upper level slave device has a fault, disconnecting the communication between the ith level slave device and all slave devices with communication time sequence later than that of the ith level slave device and the master device.
In a specific implementation, when it is detected that there is no failure in communication between the ith-level slave device and the upper-level slave device, a connection between the ith-level slave device to be currently detected and the lower-level slave device may be established.
In a specific implementation, after detecting that there is no failure in communication between the ith-level slave device and the upper-level slave device, the method may further include: establishing connection between the ith level slave device to be detected and the next level slave device; detecting whether communication between the ith level slave device and the next level slave device has a fault; when the communication between the ith level slave device and the next level slave device is detected to have a fault, the next level slave device and all the slave devices with communication timing sequence later than that of the next level slave device are disconnected from the master device.
In a specific implementation, in a case that the slave device is powered by the master device, the detecting whether there is a failure in communication between the ith-level slave device and the next-level slave device may include: and detecting whether preset data sent by a detection device corresponding to the next-level slave equipment is received.
In one embodiment of the invention, in the case where the slave device is powered by the master device, the failure detection means corresponding to the level 2 slave device disconnects the power connection and the communication connection with the level 3 slave device and transmits the RS-485 specific protocol 300 data to the failure detection means corresponding to the level 1 slave device. Subsequently, the level 2 slave device establishes a power connection and a communication connection with the level 3 slave device, and waits for the specific protocol 300 data transmitted by the failure detection apparatus corresponding to the level 3 slave device. And in a preset time, the fault detection device corresponding to the 1 st-level slave equipment does not receive the data of the specific protocol 300 or receives the data which does not meet the conditions, and the fault detection device corresponding to the 1 st-level slave equipment judges that the communication between the 2 nd-level slave equipment and the 1 st-level slave equipment has faults. Therefore, the failure detection means corresponding to the level 1 slave device disconnects the communication with the level 2 slave device and all the slave devices whose communication timing is later than that of the level 2 slave device from the master device.
Therefore, the connection between the ith level slave device to be detected and the next level slave device is disconnected; whether the communication between the ith level slave device and the upper level slave device has a fault or not is detected, and a certain part of the communication can be effectively detected to have a fault under the condition that the power is supplied to the master device. The communication between the ith level slave equipment and all slave equipment with the communication time sequence later than that of the ith level slave equipment and the master equipment is disconnected, and the connection of a fault part is cut off, so that a communication fault area is isolated, and the normal work of other areas is guaranteed.
In specific implementation, whether the serial communication has a fault can be detected under the condition that the slave device is powered by itself. Firstly, disconnecting the communication connection between the ith level slave equipment to be detected and the next level slave equipment; detecting whether communication between the ith level slave device and a higher level slave device has a fault; and when detecting that the communication between the ith level slave device and the upper level slave device has no fault, establishing a communication connection between the ith level slave device and the lower level slave device.
When detecting that the communication between the ith-level slave device and the upper-level slave device has a fault, establishing the communication connection between the current ith-level slave device to be detected and the lower-level slave device; disconnecting the communication connection between the ith level slave equipment to be detected and the upper level slave equipment; detecting whether communication between the ith level slave device and the next level slave device has a fault; and when detecting that the communication between the ith level slave device and the next level slave device is not failed, establishing the communication connection between the ith level slave device and the previous level slave device.
When the communication between the ith-level slave device and the next-level slave device and the communication between the ith-level slave device and the previous-level slave device are detected to be failed, the communication between the ith-level slave device and all the slave devices with communication timing sequence later than that of the ith-level slave device and the master device is disconnected.
In a specific implementation, in the case that the slave device is powered by itself, the detecting whether there is a failure in communication between the ith-level slave device and the last-level slave device may include: whether the parameter of the communication signal between the ith level slave device and the upper level slave device meets a preset threshold range or not is detected.
In a specific implementation, the communication signal may be sampled, the level, timing, and differential mode voltage of the communication signal may be measured, and when any one of the parameters does not meet a preset threshold range, it is further determined whether there is an abnormality such as interference, distortion, disconnection, short circuit, or deadlock in communication between the i-th slave device and the previous slave device or between the i-th slave device and the next slave device.
In particular implementations, the parameter of the communication signal may include at least one of: level, timing, and differential mode voltage. It can be understood that different users may select one or more communication signal parameters to determine whether there is a failure in communication between the ith slave device and the previous slave device or between the ith slave device and the next slave device according to their own different requirements, that is, as long as the signal parameters that indicate the failure in communication can be determined, the signal parameters can be used in the process of failure detection in serial communication, which is not described herein again.
In specific implementation, when it is detected that no fault exists in communication between the ith-level slave device and the next-level slave device or between the ith-level slave device and the previous-level slave device, connection between the current to-be-detected ith-level slave device and the previous-level slave device is established.
Therefore, under the condition that the slave device is self-powered, the connection between the ith level slave device to be detected and the next level slave device is established; disconnecting the ith-level slave equipment to be detected currently from the previous-level slave equipment; detecting whether communication between the ith level slave device and the next level slave device has a fault; when the communication between the ith-level slave device and the next-level slave device and the communication between the ith-level slave device and the previous-level slave device are detected to be faulty, the communication between the ith-level slave device and all the slave devices with communication timing later than that of the ith-level slave device and the master device is disconnected, so that a fault of a certain part or parts of the communication can be effectively detected under the condition that the slave devices supply power by themselves, and the connection of the faulty part is cut off, thereby isolating the area with communication fault and ensuring that the rest areas can work normally.
In practical application, whether the bus communication of the multi-point RS-485 standard has faults can be detected. The bus equipment of the multi-point RS-485 standard is connected in parallel to the RS-485 standard bus through a bus interface, wherein each bus equipment of the multi-point RS-485 standard can initiate communication to the receiving equipment, and the receiving equipment can respond to the communication. In communication, when the multi-point RS-485 standard bus equipment fails, the fault detection device can detect the abnormality such as interference, distortion, open circuit, short circuit or deadlock, and then the fault detection device disconnects the bus equipment with the multi-point RS-485 standard, so that the fault equipment is isolated, and the normal work of other areas is guaranteed.
Referring to fig. 2, an embodiment of the present invention further provides a serial communication fault detection apparatus 20, coupled to an i-th-level slave device to be currently detected, including: a first interface 201, a detection unit 202, a second interface 203;
the first interface 201 is connected with a higher-level slave device and the corresponding detection unit;
the detection unit 202 is configured to control the second interface 203 to disconnect from the next-level slave device, and detect whether there is a failure in communication between the ith-level slave device and the previous-level slave device; when detecting that the communication between the ith-level slave device and the upper-level slave device has a fault, disconnecting the communication between the ith-level slave device and all slave devices with communication timing sequence later than that of the ith-level slave device and a master device;
the second interface 203 is connected to a next-stage slave device and the corresponding detection unit.
In practical applications, the fault detection means 20 of the serial communication are in one-to-one correspondence with the slave devices, i.e. each slave device is coupled to one fault detection means 20.
In a specific implementation, the serial communication fault detection apparatus 20 may further include a device interface, which may be used to connect with a serial communication device.
In a specific implementation, the detecting unit 202 corresponding to the ith-level slave device to be currently detected may be configured to detect whether there is a failure in communication between the ith-level slave device and the previous-level slave device, including: and detecting whether the parameter of the communication signal between the ith-level slave device and the upper-level slave device meets a preset threshold range.
In particular implementations, the parameter of the communication signal may include at least one of: level, timing, and differential mode voltage.
In a specific implementation, the detecting unit 202 may further be configured to: when detecting that there is no fault in the communication between the ith level slave device and the upper level slave device, controlling the second interface 203 to establish connection with the lower level slave device, so that all devices on the serial communication bus can continue to work normally.
Referring to fig. 3, a topology diagram of a serial communication fault detection apparatus applied to master-slave serial communication according to an embodiment of the present invention is shown. As can be seen from fig. 3, a plurality of slave devices may be connected in series on the bus, and each slave device may be provided with a one-to-one serial communication failure detection apparatus. With reference to fig. 2 and 3, the following describes an application of the communication failure detection device 20 to master-slave serial communication.
Under the condition that the slave device is powered by the master device, the detection unit 202 corresponding to the ith-level slave device to be currently detected can be used for controlling the second interface 203 to be disconnected from the communication connection and the power connection with the next-level slave device, so that the influence of the next-level slave device on the fault detection of the ith-level slave device to be currently detected can be eliminated, and whether the communication between the ith-level slave device and the previous-level slave device has a fault or not can be accurately detected.
In a specific implementation, the level i slave device to be currently detected, and the detection unit 202 corresponding to the level i slave device to be currently detected, may further be configured to: after detecting that the communication between the ith slave device and the upper slave device has no fault, controlling the second interface 203 to establish connection with the lower slave device; detecting whether communication between the ith-level slave device and the next-level slave device has a fault, namely detecting whether preset data sent by a detection device corresponding to the next-level slave device is received; when a fault is detected in the communication between the ith level slave device and the next level slave device, the next level slave device and all slave devices with communication time sequence later than that of the next level slave device are disconnected from the master device, and the connection of the fault part is cut off, so that the communication fault area is isolated, and the normal work of the rest areas is ensured.
In an embodiment of the present invention, the slave devices are powered by the master device, all the fault detection apparatuses 20 connected in series on the serial communication bus control the second interface 203 to disconnect the communication connection between the i-th level slave device and the next level slave device, and determine whether there is a fault in the communication between the i-th level slave device and the previous level slave device by detecting whether the level, timing sequence and differential mode voltage of the communication signal all conform to the preset threshold range; when the failure detection device 20 detects that there is no failure in the communication between the ith-level slave device and the upper-level slave device, the second interface 203 is controlled to establish a communication connection between the ith-level slave device and the lower-level slave device.
When the fault detection device 20 detects that the communication between the ith-level slave device and the upper-level slave device has a fault, controlling the second interface 203 to establish the communication connection between the ith-level slave device and the lower-level slave device; controlling the first interface 201 to disconnect the communication connection between the ith level slave device and the upper level slave device, and detecting whether the communication between the ith level slave device and the lower level slave device has a fault; when the failure detection device 20 detects that there is no failure in the communication between the ith slave device and the next slave device, the first interface 201 is controlled to establish a communication connection between the ith slave device and the previous slave device.
When the failure detection device 20 detects that the communication between the ith slave device and the next slave device and the communication between the ith slave device and the previous slave device are all failed, the first interface 201 is controlled to disconnect the communication between the ith slave device and all the slave devices with communication timing sequence later than that of the ith slave device and the master device.
In practical application, the fault detection device 20 for serial communication can also detect whether the serial communication has faults or not under the condition that the slave device is powered by itself,
in a specific implementation, the detecting unit 202, when the slave device is powered by itself, may further be configured to: when detecting that the communication between the ith level slave device and the upper level slave device has a fault, controlling the second interface 203 to establish a connection with the lower level slave device; controlling the first interface 201 to disconnect from the upper-level slave device; detecting whether communication between the ith level slave device and the next level slave device has a fault; when the communication between the ith level slave device and the next level slave device and the communication between the ith level slave device and the last level slave device are detected to have faults, the communication between the ith level slave device and all slave devices and the master device, the communication timing of which is later than that of the ith level slave device, is disconnected, and the connection of the fault part is cut off, so that the communication fault area is isolated, and the normal work of the rest areas is ensured.
In a specific implementation, the detecting unit 202, when the slave device is powered by itself, may further be configured to: when it is detected that there is no fault in the communication between the ith slave device and the next slave device, or between the ith slave device and the previous slave device, the first interface 201 is controlled to establish a connection with the previous slave device.
The specific working process of the serial communication fault detection apparatus may refer to the description of step S101 to step S103, which is not described herein again.
In practical applications, the serial communication fault detection device 20 can also detect whether the bus communication of the multi-point RS-485 standard has a fault.
Referring to fig. 4, a topology diagram of the serial communication fault detection apparatus 20 applied to multipoint serial communication according to an embodiment of the present invention is shown. As can be seen from fig. 4, a plurality of communication devices may be connected in parallel on the bus, and each communication device may be provided with a one-to-one fault detection apparatus.
Referring to fig. 2 and 4, the bus device of the multipoint RS-485 standard is connected in parallel to the RS-485 standard bus through the first interface 201 or the second interface 202, and meanwhile, the fault detection apparatus 20 for serial communication may further include a device interface for connecting with a communication device for serial communication. Each communication device of the multipoint RS-485 standard can initiate communication to a receiving device, and the receiving device can respond to the communication. In communication, when a communication device of the multi-point RS-485 standard fails, the fault detection device 20 may detect whether one or more parameters of the communication signal, such as level, timing sequence, differential mode voltage, etc., meet a preset threshold range, and further detect abnormalities, such as interference, distortion, open circuit, short circuit, or deadlock, and then the fault detection device 20 controls the device interface to disconnect from the communication device of the multi-point RS-485 standard that has failed, thereby isolating the faulty device and ensuring that the rest of the regions can work normally.
The embodiment of the present invention further provides a readable storage medium, where the computer readable storage medium is a non-volatile storage medium or a non-transitory storage medium, and has computer instructions stored thereon, and when the computer instructions are executed, the steps of the serial communication fault detection method provided in the above embodiments of the present invention are executed.
The embodiment of the present invention further provides a fault detection apparatus for serial communication, which includes a memory and a processor, where the memory stores a computer instruction capable of running on the processor, and when the processor runs the computer instruction, the steps of the fault detection method for serial communication provided in the above embodiment of the present invention are executed.
Those skilled in the art will appreciate that all or part of the steps in the methods of the above embodiments may be implemented by hardware related to instructions of a program, which may be stored in any computer readable storage medium, and the storage medium may include: ROM, RAM, magnetic or optical disks, and the like.
Although the present invention is disclosed above, the present invention is not limited thereto. Various changes and modifications may be effected therein by one skilled in the art without departing from the spirit and scope of the invention as defined in the appended claims.

Claims (18)

1. A method for fault detection in serial communication, comprising:
disconnecting the ith-level slave equipment to be detected currently from the next-level slave equipment;
detecting whether communication between the ith level slave device and a higher level slave device has a fault;
when the communication between the ith-level slave device and the upper-level slave device is detected to have a fault, the communication between the ith-level slave device and all slave devices with communication timing sequence later than that of the ith-level slave device and a master device is disconnected.
2. The method for detecting a fault in serial communication according to claim 1, wherein the detecting whether there is a fault in communication between the i-th slave device and the upper slave device includes: whether the parameter of the communication signal between the ith level slave device and the upper level slave device meets a preset threshold range or not is detected.
3. The fault detection method for serial communication according to claim 2, wherein the parameter of the communication signal includes at least one of: level, timing, and differential mode voltage.
4. The method for detecting a failure in serial communication according to claim 1, further comprising, after detecting that there is no failure in communication between the i-th level slave device and the upper level slave device: establishing connection between the ith level slave device to be detected and the next level slave device;
detecting whether communication between the ith level slave device and the next level slave device has a fault;
when the communication between the ith level slave device and the next level slave device is detected to have a fault, the next level slave device and all the slave devices with communication timing sequence later than that of the next level slave device are disconnected from the master device.
5. The method for detecting a fault in serial communication according to claim 4, wherein the detecting whether there is a fault in communication between the i-th level slave device and the next level slave device includes: and detecting whether preset data sent by a detection device corresponding to the next-level slave equipment is received.
6. The method for fault detection of serial communication according to claim 1, further comprising: and when detecting that no fault exists in the communication between the ith-level slave device and the upper-level slave device, establishing the connection between the current ith-level slave device to be detected and the lower-level slave device.
7. The method for detecting a failure in serial communication according to claim 1, wherein when it is detected that there is a failure in communication between the i-th slave device and the upper slave device, the method further comprises: establishing connection between the ith level slave device to be detected and the next level slave device;
disconnecting the ith-level slave equipment to be detected currently from the previous-level slave equipment;
detecting whether communication between the ith level slave device and the next level slave device has a fault;
when the communication between the ith-level slave device and the next-level slave device and the communication between the ith-level slave device and the previous-level slave device are detected to be failed, the communication between the ith-level slave device and all the slave devices with communication timing sequence later than that of the ith-level slave device and the master device is disconnected.
8. The method for fault detection of serial communication according to claim 7, further comprising: and when detecting that no fault exists in the communication between the ith-level slave device and the next-level slave device and the communication between the ith-level slave device and the previous-level slave device, establishing the connection between the current to-be-detected ith-level slave device and the previous-level slave device.
9. A serial communication fault detection device, coupled to an i-th slave device currently to be detected, comprising: the device comprises a detection unit, a first interface and a second interface;
the first interface is connected with the upper-level slave equipment and the corresponding detection unit;
the second interface is connected with the next-level slave equipment and the corresponding detection unit;
the detection unit is used for controlling the second interface to be disconnected with the next-level slave device and detecting whether the communication between the ith-level slave device and the previous-level slave device has a fault; when the communication between the ith-level slave device and the upper-level slave device is detected to have a fault, the communication between the ith-level slave device and all slave devices with communication timing sequence later than that of the ith-level slave device and a master device is disconnected.
10. The apparatus for detecting a failure in serial communication according to claim 9, wherein the detecting unit is configured to detect whether there is a failure in communication between the i-th slave device and the upper slave device, and includes: and detecting whether the parameter of the communication signal between the ith-level slave device and the upper-level slave device meets a preset threshold range.
11. The apparatus for detecting a fault in serial communication according to claim 10, wherein the parameter of the communication signal includes at least one of: level, timing, and differential mode voltage.
12. The apparatus for detecting a failure in serial communication according to claim 9, wherein the detecting unit is further configured to:
after detecting that the communication between the ith level slave device and the upper level slave device has no fault, controlling the second interface to establish connection with the lower level slave device;
detecting whether communication between the ith level slave device and the next level slave device has a fault;
when the communication between the ith level slave device and the next level slave device is detected to have a fault, the next level slave device and all the slave devices with communication timing sequence later than that of the next level slave device are disconnected from the master device.
13. The apparatus for detecting a failure in serial communication according to claim 12, wherein the detecting unit is configured to detect whether there is a failure in communication between the i-th slave device and the upper slave device, and includes: and detecting whether preset data sent by a detection device corresponding to the next-level slave equipment is received.
14. The apparatus for detecting a failure in serial communication according to claim 9, wherein the detecting unit is further configured to: and when detecting that the communication between the ith level slave device and the upper level slave device is not failed, controlling the second interface to establish connection with the lower level slave device.
15. The apparatus for detecting a failure in serial communication according to claim 9, wherein the detecting unit is further configured to:
when detecting that the communication between the ith level slave device and the upper level slave device has a fault, controlling the second interface to establish connection with the lower level slave device;
controlling the first interface to be disconnected with the upper-level slave equipment;
detecting whether communication between the ith level slave device and the next level slave device has a fault;
when the communication between the ith-level slave device and the next-level slave device and the communication between the ith-level slave device and the previous-level slave device are detected to be failed, the communication between the ith-level slave device and all slave devices with communication timing sequence later than that of the ith-level slave device and a master device is disconnected.
16. The serial communication fault detection device of claim 15, wherein the detection unit is further configured to: and when detecting that no fault exists in the communication between the ith level slave device and the next level slave device or between the ith level slave device and the previous level slave device, controlling the first interface to establish connection with the previous level slave device.
17. A readable storage medium, which is a non-volatile storage medium or a non-transitory storage medium, having stored thereon computer instructions, wherein the computer instructions are executed to perform the steps of the serial communication fault detection method according to any one of claims 1 to 8.
18. A fault detection device for serial communication, comprising a memory and a processor, the memory having stored thereon computer instructions executable on the processor, wherein the processor executes the computer instructions to perform the steps of the fault detection method for serial communication according to any one of claims 1 to 8.
CN201811636437.9A 2018-12-29 2018-12-29 Fault detection method and device for serial communication and readable storage medium Withdrawn CN111382018A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811636437.9A CN111382018A (en) 2018-12-29 2018-12-29 Fault detection method and device for serial communication and readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811636437.9A CN111382018A (en) 2018-12-29 2018-12-29 Fault detection method and device for serial communication and readable storage medium

Publications (1)

Publication Number Publication Date
CN111382018A true CN111382018A (en) 2020-07-07

Family

ID=71222422

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811636437.9A Withdrawn CN111382018A (en) 2018-12-29 2018-12-29 Fault detection method and device for serial communication and readable storage medium

Country Status (1)

Country Link
CN (1) CN111382018A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111817751A (en) * 2020-07-31 2020-10-23 优动能科技(深圳)有限公司 Communication parallel test technology

Citations (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7017072B1 (en) * 1999-09-30 2006-03-21 Infineon Technologies Ag Protection circuit for an access-arbitrated bus system network
CN102073613A (en) * 2010-12-15 2011-05-25 创新科存储技术有限公司 Device and method for removing deadlock of I<2>C (Inter-Integrated Circuit) bus
CN102081131A (en) * 2010-12-02 2011-06-01 河南省电力公司南阳供电公司 Grounding point finding method for low-current grounding system of urban power grid
CN102521187A (en) * 2011-11-29 2012-06-27 广东东研网络科技有限公司 Method for solving communication deadlock of I2C (Inter-Integrated Circuit) bus
CN104135398A (en) * 2014-07-08 2014-11-05 常州凯锐能源科技有限公司 Intelligent RS485 concentrator and bus deadlock detection method
CN104778104A (en) * 2015-04-20 2015-07-15 北京全路通信信号研究设计院有限公司 Error check method of serial data communication bus and serial data communication bus
CN104881382A (en) * 2015-06-15 2015-09-02 刘晓辉 Master and slave equipment connection device and address recognition method thereof
CN105577447A (en) * 2016-01-07 2016-05-11 烽火通信科技股份有限公司 Fault node positioning and isolating method of electromechanical management buses of communication device
CN108073540A (en) * 2018-02-11 2018-05-25 云丁网络技术(北京)有限公司 I2C bus systems, warping apparatus investigation method
CN108153688A (en) * 2017-12-29 2018-06-12 中科芯时代科技有限公司 Serial isolation communication means and system
CN108563598A (en) * 2018-03-02 2018-09-21 上海芯导电子科技有限公司 A kind of I from wake-up2C communication architecture systems
CN208126373U (en) * 2018-05-07 2018-11-20 广州视源电子科技股份有限公司 A kind of the detection response circuit and iic bus system of IIC failure

Patent Citations (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7017072B1 (en) * 1999-09-30 2006-03-21 Infineon Technologies Ag Protection circuit for an access-arbitrated bus system network
CN102081131A (en) * 2010-12-02 2011-06-01 河南省电力公司南阳供电公司 Grounding point finding method for low-current grounding system of urban power grid
CN102073613A (en) * 2010-12-15 2011-05-25 创新科存储技术有限公司 Device and method for removing deadlock of I<2>C (Inter-Integrated Circuit) bus
CN102521187A (en) * 2011-11-29 2012-06-27 广东东研网络科技有限公司 Method for solving communication deadlock of I2C (Inter-Integrated Circuit) bus
CN104135398A (en) * 2014-07-08 2014-11-05 常州凯锐能源科技有限公司 Intelligent RS485 concentrator and bus deadlock detection method
CN104778104A (en) * 2015-04-20 2015-07-15 北京全路通信信号研究设计院有限公司 Error check method of serial data communication bus and serial data communication bus
CN104881382A (en) * 2015-06-15 2015-09-02 刘晓辉 Master and slave equipment connection device and address recognition method thereof
CN105577447A (en) * 2016-01-07 2016-05-11 烽火通信科技股份有限公司 Fault node positioning and isolating method of electromechanical management buses of communication device
CN108153688A (en) * 2017-12-29 2018-06-12 中科芯时代科技有限公司 Serial isolation communication means and system
CN108073540A (en) * 2018-02-11 2018-05-25 云丁网络技术(北京)有限公司 I2C bus systems, warping apparatus investigation method
CN108563598A (en) * 2018-03-02 2018-09-21 上海芯导电子科技有限公司 A kind of I from wake-up2C communication architecture systems
CN208126373U (en) * 2018-05-07 2018-11-20 广州视源电子科技股份有限公司 A kind of the detection response circuit and iic bus system of IIC failure

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
薛晨;黎灿兵;黄小庆;唐升卫;刘;: "智能变电站信息一体化应用" *
齐宝平,李友海: "基于网形的配电网故障判断、隔离与恢复" *

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111817751A (en) * 2020-07-31 2020-10-23 优动能科技(深圳)有限公司 Communication parallel test technology

Similar Documents

Publication Publication Date Title
CN107078499B (en) Detect the ground connection isolated fault in Ethernet PoDL system
JP6391700B2 (en) Method for processing impedance abnormality of power adapter, terminal and charging circuit
KR101575547B1 (en) The error variance detection method of can communication system and the can communication system
EP2760165B1 (en) Systems and methods to detect bus network fault and topology
CN107957692B (en) Controller redundancy method, device and system
US8843788B2 (en) Systems and methods to detect bus network fault and topology
CN104135398A (en) Intelligent RS485 concentrator and bus deadlock detection method
CN113740633B (en) System and method for detecting electrical system faults in a data center
CN110865231B (en) Power supply voltage detection circuit for bus isolation
CN111382018A (en) Fault detection method and device for serial communication and readable storage medium
CN103777617A (en) Upper-and-lower computer communication monitoring method
US11232055B2 (en) Addressing of slave devices using interative power activation
CN103095509A (en) Method for quickly testing recommended standard 485 (RS485) bus breakdown
CN109557453B (en) Multi-master-control-chip identification processing method and system
CN106154071A (en) A kind of device and method detecting intelligent electric energy meter RS485 bus failure
JP2021139820A (en) Cable abnormality determination system, sleeve device, and method for determining cable abnormality
CN111258227A (en) Electric appliance control method and computer readable medium for sending electronic equipment
CN107367659B (en) High-voltage power distribution system with information perception of Internet of things and information perception implementation method
JP6556801B2 (en) Fault tolerant power network
CN110221229A (en) Power-supply management system, power supply system and method for controlling power supply
CN103869142A (en) Method and Device for Monitoring Signal Levels
CN110247833B (en) Communication control method, device, sub-equipment and communication system
CN101263682A (en) A system for monitoring cable interface connections in a network
CN107608294B (en) Safety electricity utilization control device and method
CN108337135B (en) Communication control system, method and device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
WW01 Invention patent application withdrawn after publication
WW01 Invention patent application withdrawn after publication

Application publication date: 20200707