Fault detection method and fault detection device for serial bus system
By detecting the slave power supply voltage in the RS-485 bus system, it solves the problem of poor detection accuracy of communication voltage in the prior art, and achieves higher detection accuracy and lower hardware cost.
Patent Information
- Application Number
- CN202411578272.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-06
- Publication Date
- 2025-02-14
AI Technical Summary
In the prior art, it is determined whether the RS-485 bus system has a fault by detecting the communication voltage on the communication bus, which has poor accuracy and requires additional fault detection devices to be set up, which increases hardware cost and system complexity.
By detecting the power supply voltage of the slave device, we can determine whether there is a fault in the serial bus system, and use the stability of the power supply voltage and the small volatility to improve the detection accuracy. Each slave device can act as a detection point, reducing hardware cost and system complexity.
Improves the accuracy and reliability of fault detection, reduces hardware costs and system complexity, enhances fault detection coverage, and enables fault detection to be detected and processed faster.
Smart Images

Figure CN119440928A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of communication technology, and in particular to a fault detection method and a fault detection device for a serial bus system. Background Art
[0002] RS-485 bus has been widely used in intelligent buildings, automobile manufacturing, industrial control systems, telecommunications equipment and other fields due to its excellent anti-interference ability, long-distance transmission, multi-node support and low-cost characteristics. RS-485 bus system is usually equipped with fault detection device. When a fault is detected in the system, the fault detection device can send early warning information to the user in time to avoid further damage to the bus system.
[0003] In the related art, the fault detection device detects the communication voltage on the communication bus to determine whether there is a fault in the bus system. However, the communication voltage has a large fluctuation, and the accuracy of determining whether there is a fault in the system by the communication voltage is poor. Summary of the invention
[0004] The present application provides a fault detection method and a fault detection device for a serial bus system, which can determine whether a serial bus system has a fault by detecting a power supply voltage of a slave device, thereby achieving higher detection accuracy.
[0005] In a first aspect, a fault detection method for a serial bus system is provided, wherein the serial bus system includes a master device, multiple slave devices, and a power supply bus, wherein the multiple slave devices are sequentially connected in series to the power supply bus, and wherein the multiple slave devices include a first slave device, and the fault detection method includes: the first slave device detects the power supply voltage of the power supply bus to itself to obtain a first voltage value; and the first slave device determines whether there is a fault in the serial bus system based on the first voltage value.
[0006] According to the fault detection method provided in the embodiment of the present application, the power supply voltage of the power supply bus to it can be directly detected by the first slave device, so as to determine whether the serial bus system has a fault according to the detected first voltage value. Compared with the communication voltage on the communication bus, the power supply voltage is relatively stable, less affected by other factors, and can more accurately reflect the system status. Therefore, the present application determines whether the serial bus system has a fault by the power supply voltage, which has higher accuracy and reliability.
[0007] In addition, the detection method provided by the present application does not require additional fault detection devices to be set up in the system, thereby reducing hardware costs and system complexity. At the same time, since each slave device can be used as a detection point, that is, each slave device can be used as a first slave device for fault detection, the fault detection coverage of the system is improved, so that faults can be discovered and handled more quickly.
[0008] In a possible implementation, the first slave device determines whether the serial bus system has a fault according to the first voltage value, including: the first slave device determines whether the serial bus system has a fault according to a difference between the first voltage value and a first theoretical voltage value.
[0009] The present application determines whether there is a system fault by comparing the difference between the first voltage value detected by the first slave device and the first theoretical voltage value. This method takes into account the normal fluctuation range of the power supply voltage. Only when the difference between the actual voltage and the theoretical voltage exceeds a certain range, it is determined that there is a system fault, thereby reducing the possibility of misjudgment and improving the accuracy and reliability of detection.
[0010] In actual applications, the supply voltage may fluctuate to a certain extent due to various factors (such as switching of device working modes, power supply voltage fluctuations, etc.). By setting a reasonable theoretical voltage value and difference range, it can be ensured that there will be no misjudgment when the voltage fluctuation is normal, and at the same time, the fault can be discovered and measures can be taken in time when the voltage is abnormal. This helps to reduce system downtime or unnecessary maintenance costs caused by misjudgment.
[0011] In a possible implementation, before determining whether the serial bus system has a fault, the fault detection method also includes: the first slave device determines the first theoretical voltage value based on a first mapping relationship, the first mapping relationship is used to indicate a one-to-one correspondence between the multiple slave devices and the multiple theoretical voltage values, and the first mapping relationship is issued in advance by the master device.
[0012] The present application introduces the first mapping relationship so that each slave device can obtain the theoretical voltage value corresponding to it, so that a more accurate judgment basis can be provided when performing fault detection, thereby improving the accuracy and reliability of detection.
[0013] In addition, since the first mapping relationship is issued in advance by the master device, the master device can dynamically adjust the first mapping relationship according to the actual system conditions to adapt to different working environments and conditions (such as different numbers of slave devices), thereby improving the flexibility and scalability of the system.
[0014] In one possible implementation, the first slave device determines whether the serial bus system has a fault based on the first voltage value, including: if the first voltage value is less than a first voltage threshold or greater than a second voltage threshold, determining that the serial bus system has a fault, wherein the first voltage threshold is less than the second voltage threshold.
[0015] Taking into account the normal fluctuation range of the power supply voltage, the present application provides a clear judgment standard for the abnormality of the power supply voltage by setting a first voltage threshold and a second voltage threshold. When the first voltage value is between the first voltage threshold and the second voltage threshold, it can be determined that there is no fault in the serial bus system (that is, the power supply voltage is within a reasonable range). When the first voltage value is less than the first voltage threshold or greater than the second voltage threshold, it is determined that there is a fault in the serial bus system (that is, the power supply voltage is outside the reasonable range and the power supply is abnormal). Through the above settings, the possibility of misjudgment can be reduced, the accuracy and reliability of detection can be improved, and it also has the advantages of being simple and clear, easy to implement, etc.
[0016] In a possible implementation, the first slave device detects the power supply voltage of the power supply bus to itself, including: the first slave device detects the power supply voltage of the power supply bus to itself in a self-test mode, wherein the first slave device has a fixed power consumption value in the self-test mode.
[0017] When the first slave device is in normal working state, the power consumption may vary due to different tasks (such as working modes). The present application sets the first slave device to detect the power supply voltage in the self-test mode, and in the self-test mode, the power consumption of the slave device is fixed, which eliminates the influence of power consumption change on the power supply voltage, so that the detected power supply voltage (i.e., the first voltage value) can accurately reflect the real state of the system, which is conducive to reducing the possibility of misjudgment, thereby improving the accuracy and reliability of detection.
[0018] In a possible implementation, if it is determined that a fault exists in the serial bus system, the fault detection method further includes: the first slave device sending first indication information for indicating that a fault exists in the system to the master device.
[0019] When a fault is detected, the first slave device can promptly send a first indication message to the master device, so that the master device can promptly understand that the system has entered an abnormal state. The master device can promptly take corresponding countermeasures to avoid more serious damage to the bus system.
[0020] In a possible implementation, the fault detection method also includes: the first slave device receives second indication information from the master device, the second indication information is used to instruct each of the multiple slave devices to detect whether there is a fault in itself; the first slave device detects whether there is a fault in itself according to the second indication information.
[0021] After the master device determines that there is a faulty device in the system based on the first indication information, it can send a second indication information to each of the multiple slave devices so that the multiple slave devices can simultaneously detect whether they have faults. In this way, all abnormal devices can be detected at one time, which can improve troubleshooting efficiency and ensure that the system can run stably for a long time.
[0022] In a possible implementation, the first slave device detects whether it has a fault according to the second indication information, including: the first slave device detects the power supply voltage of the power supply bus to itself in a self-test mode to obtain a second voltage value V i , wherein the first slave device has a fixed power consumption value P in the self-test mode; the first slave device determines whether it has a fault according to the difference between its actual power supply current I and the theoretical power supply current I', wherein I'=P / V i .
[0023] When the first slave device works in the self-test mode, if there is no fault in itself, then the power consumption of the first slave device is P, and its own theoretical power supply current I' is the fixed power consumption value P and the second voltage value V i At this time, the difference between the actual power supply current I and the theoretical power supply current I' detected can be used to determine whether the first slave device itself has a fault. For example, if the difference is within a certain range close to 0, it means that the first slave device itself has no fault. If it exceeds this range, it means that the first slave device has a fault, and the self-test result can be reported to the master device. The present application can accurately determine whether the first slave device itself has a fault through the above settings.
[0024] In a possible implementation, the actual supply current I is based on the second voltage value V i , the third voltage value V i-1 , the fourth voltage value V i+1 , and Ohm's law determines that; wherein the third voltage value V i-1 is the power supply voltage of the previous node of the first slave device detected in the self-test mode, and the fourth voltage value V i+1 It is the supply voltage of the next node of the first slave device detected by itself in the self-test mode.
[0025] This application introduces the voltage values of the adjacent nodes on the upper and lower sides and the line resistance of the power supply bus and other parameters, based on Ohm's law, and can accurately calculate the actual power supply current I. The slave device can calculate the actual power supply current I based on the detected power supply voltage, without the need to set up an additional current detection module, which is conducive to saving hardware costs. It also has the advantages of being simple and clear, easy to implement, etc.
[0026] In a possible implementation, the first slave device determines the actual supply current I according to the following formula: I=(V i-1 -V i ) / R i -I i+1 ; Among them, V i-1 From the previous node, R i is the line resistance of the power supply bus segment between the previous node and the first slave device, I i+1 =(V i -V i+1 ) / R i+1 , I i+1 From the next node, R i+1 is the line resistance of the line segment of the power supply bus between the first slave device and the next node.
[0027] Among them, (V i-1 -V i ) / R i That is, the current on the line segment between the previous node and the first slave device (denoted as I i ), I i+1 That is, the current on the line segment between the first slave device and the next node. According to the current shunting principle of Ohm's law, the difference between the two is the actual power supply current I of the first slave device. The present application can accurately calculate the actual power supply current I of the first slave device through the above method. It also has the advantages of being simple and clear, easy to implement, etc.
[0028] In a second aspect, a fault detection device for a serial bus system is provided, wherein the serial bus system includes a master device, multiple slave devices and a power supply bus, wherein the multiple slave devices are connected in series on the power supply bus in sequence, and the first slave device includes: a detection unit, configured to detect the power supply voltage of the power supply bus to itself to obtain a first voltage value; and a processing unit, configured to determine whether the serial bus system has a fault according to the first voltage value.
[0029] In a possible implementation manner, the fault detection device may be any slave device among the multiple slave devices (eg, the aforementioned first slave device).
[0030] In a possible implementation manner, the processing unit is specifically configured to determine whether the serial bus system has a fault according to a difference between the first voltage value and a first theoretical voltage value.
[0031] In a possible implementation, the processing unit is specifically used to: determine the first theoretical voltage value according to a first mapping relationship, the first mapping relationship is used to indicate a one-to-one correspondence between the multiple slave devices and the multiple theoretical voltage values, and the first mapping relationship is issued in advance by the master device.
[0032] In a possible implementation, the processing unit is specifically used to: determine that a fault exists in the serial bus system if the first voltage value is less than a first voltage threshold or greater than a second voltage threshold, wherein the first voltage threshold is less than the second voltage threshold.
[0033] In a possible implementation manner, the detection unit is specifically configured to: detect a power supply voltage of the power supply bus to itself in a self-test mode, wherein the first slave device has a fixed power consumption value in the self-test mode.
[0034] In a possible implementation, the first slave device further includes: a transceiver unit, configured to send first indication information indicating that a system fault exists to the master device when it is determined that a fault exists in the serial bus system.
[0035] In a possible implementation, the transceiver unit is also used to: receive second indication information from the master device, the second indication information is used to instruct each of the multiple slave devices to detect whether there is a fault in itself; the detection unit is specifically used to: detect whether there is a fault in itself according to the second indication information.
[0036] In a possible implementation, the detection unit is specifically configured to: detect the power supply voltage of the power supply bus to itself in a self-test mode to obtain a second voltage value V i , wherein the first slave device has a fixed power consumption value P in the self-test mode; the processing unit is specifically used to: determine whether it has a fault according to the difference between its actual power supply current I and the theoretical power supply current I', wherein I'=P / V i .
[0037] In a possible implementation, the actual supply current I is based on the second voltage value V i , the third voltage value V i-1 , the fourth voltage value V i+1 , and Ohm's law determines; wherein the third voltage value V i-1is the power supply voltage of the previous node of the first slave device detected in the self-test mode, and the fourth voltage value V i+1 It is the supply voltage of the next node of the first slave device detected by itself in the self-test mode.
[0038] In a possible implementation, the processing unit is specifically configured to: determine the actual power supply current I according to the following formula: I = (V i-1 -V i ) / R i -I i+1 ; Among them, V i-1 From the previous node, R i is the line resistance of the power supply bus segment between the previous node and the first slave device, I i+1 =(V i -V i+1 ) / R i+1 , I i+1 From the next node, R i+1 is the line resistance of the line segment of the power supply bus between the first slave device and the next node.
[0039] In a third aspect, a fault detection device of a serial bus system is provided, wherein the serial bus system comprises a master device, multiple slave devices and a power supply bus, wherein the multiple slave devices are sequentially connected in series to the power supply bus, and the fault detection device comprises: a processor; a memory; and a computer program, wherein the computer program is stored in the memory, and when the computer program is executed by the processor, the fault detection device executes the fault detection method provided by any possible implementation of the first aspect.
[0040] In a possible implementation, the fault detection device may be any slave device among the multiple slave devices (eg, the aforementioned first slave device).
[0041] In a fourth aspect, a serial bus system is provided, which includes a master device, multiple slave devices and a power supply bus, the multiple slave devices are connected in series on the power supply bus in sequence, and the multiple slave devices include a fault detection device or a fault detection device provided by any possible implementation method of the second aspect or the third aspect.
[0042] In a fifth aspect, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program runs on a detection device, the detection device executes the fault detection method provided by any possible implementation method in the first aspect.
[0043] In a sixth aspect, a computer program product is provided, comprising: a computer program code, which, when executed on a computer, enables the computer to execute a fault detection method provided by any possible implementation of the first aspect.
[0044] In a seventh aspect, a chip is provided, comprising: a processor for calling and running a computer program from a memory, so that a detection device equipped with the chip executes a fault detection method provided by any possible implementation of the first aspect.
[0045] It can be understood that the fault detection device provided by the second aspect, the fault detection equipment provided by the third aspect, the serial bus system provided by the fourth aspect, the computer-readable storage medium provided by the fifth aspect, the computer program product provided by the sixth aspect, and the chip provided by the seventh aspect are all used to execute the fault detection method provided by the first aspect. Therefore, the beneficial effects that can be achieved can refer to the beneficial effects in the corresponding methods provided above, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS
[0046] Figure 1 The structure diagram of the RS-485 bus system in the prior art is shown.
[0047] Figure 2 It is a schematic diagram of the structure of the serial bus system provided in the embodiment of the present application.
[0048] Figure 3 This is a flowchart of an example of a fault detection method for a serial bus system provided by the present application.
[0049] Figure 4 This is a flowchart of another example of the fault detection method of the series bus system provided by the present application.
[0050] Figure 5 It is a schematic diagram of the modular structure of the first slave device.
[0051] Figure 6 This is a flowchart of another example of the fault detection method for the series bus system provided by the present application.
[0052] Figure 7 It is a schematic block diagram of a fault detection device provided in an embodiment of the present application.
[0053] Figure 8 It is a structural block diagram of the fault detection device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0054] The technical solution in the present application will be described below in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all the embodiments.
[0055] In the following description, specific details such as specific system structures, technologies, etc. are provided for the purpose of illustration rather than limitation, so as to provide a thorough understanding of the embodiments of the present application. However, it should be clear to those skilled in the art that the present application may also be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to prevent unnecessary details from obstructing the description of the present application.
[0056] The term "include" herein indicates the presence of the described features, integral bodies, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, integral bodies, steps, operations, elements, components and / or their collections. The terms "include", "comprising", "having" and their variations all mean "including but not limited to", unless otherwise specifically emphasized.
[0057] In the following, the terms "first" and "second" are used for descriptive purposes only and are not to be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of the features. In the description of the embodiments of the present application, unless otherwise specified, "plurality" means two or more.
[0058] The term "and / or" in this article is only a description of the association relationship of the associated objects, indicating that there can be three relationships. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in this article generally indicates that the associated objects before and after are in an "or" relationship.
[0059] The serial bus system transmits data by sending data bits one by one in sequence through a single or multiple physical lines, rather than sending multiple data bits at the same time. With its simplicity in hardware design, convenience in wiring process, and significant advantages in cost-effectiveness, the serial bus system has been widely used in many fields such as industrial control, building automation, environmental monitoring, and electronic equipment.
[0060] Common serial buses include RS-232, RS-422, RS-485, I2C, SPI, SMBus, etc. Among them, RS-485 has shown significant advantages in a variety of industrial and communication applications due to its excellent anti-interference ability, long-distance transmission, multi-node support and low-cost characteristics.
[0061] For example, in the field of automobile manufacturing, the RS-485 bus is widely used for communication between various control components inside the car, ensuring data synchronization and command transmission between various vehicle systems. In the construction of intelligent buildings, the RS-485 bus has become a key link for information exchange between subsystems in the building automation system, helping to achieve intelligent management and efficient operation of buildings. At the same time, in industrial control systems, the RS-485 bus also plays an irreplaceable role. It connects various control subsystems to ensure real-time transmission and accurate communication of information. In addition, in telecommunications equipment networks, the RS-485 bus is also widely used for inter-board communication and information exchange between various control boards, providing a strong guarantee for the stable operation and efficient maintenance of telecommunications equipment.
[0062] Figure 1 FIG. 2 shows a schematic diagram of the structure of the RS-485 bus system in the prior art. Figure 1 As shown, the 485 bus system includes a master device, multiple (eg, N, N ≥ 3) slave devices, and A line, B line, VCC line and GND line.
[0063] The master device can also be called a host. As the core of the system, the master device is responsible for sending and receiving data. For example, the master device can be responsible for initializing communication, sending commands, and receiving responses from slave devices. The slave device can also be called a slave. Multiple slave devices are connected to the master device and are responsible for responding to the master device's commands, sending data, or performing specific tasks.
[0064] The A line and the B line constitute the differential signal line (differential pair) of the system, which is used to transmit data. The A line and the B line are the communication bus of the system, and multiple slave devices are connected in series on the A line and the B line. For example, the A+ or Tx+ interface of the slave device can be connected to the A line, and the B- or Tx- interface of the slave device can be connected to the B line.
[0065] The VCC line is used as a power supply bus to provide the DC voltage required for the operation of multiple slave devices. For example, multiple slave devices are connected in series on the VCC line, one end of the VCC line is connected to the power output port of the master device, and the master device supplies power to the multiple slave devices.
[0066] The GND line is used to provide electrical grounding and signal reference. It is an important part to ensure stable operation of the circuit and prevent electrical interference. The ground interfaces of the master device and multiple slave devices are connected to the GND line respectively.
[0067] For Figure 1In the RS-485 bus system shown in the figure, a master device is connected to multiple slave devices, and the multiple slave devices are powered by the master device through the VCC line. Although this topology shows its convenience and practicality in many applications, it also has a more obvious problem: when there are a large number of slave devices connected to the bus, once a short circuit occurs in a slave device or the power consumption becomes abnormally large, it may cause the bus voltage to drop significantly (be pulled down), thereby affecting the normal operation of other slave devices and affecting the safety and reliability of the entire system.
[0068] In view of the above problems, in the related technologies, such as Figure 1 As shown, an additional fault detection device can be added to the RS-485 bus system. The fault detection device is electrically connected to line A and line B, and can detect the voltage on line A and line B, thereby determining whether there is a fault in the RS-485 bus system, and when it is determined that there is a fault, a warning message is promptly sent to the user.
[0069] However, the fault detection device detects the communication voltage on the communication bus, and the magnitude of the communication voltage is related to the number of slave devices sending signals at the same time, that is, the communication voltage has a large volatility, and determining whether the system has a fault by detecting the communication voltage may cause misjudgment, resulting in poor accuracy of the detection result. In addition, since an additional fault detection device needs to be set up in the system, this will also increase the hardware cost and complexity of the entire system.
[0070] In view of the above problems, an embodiment of the present application provides a fault detection method for a serial bus system, according to which a slave device in the serial bus system (e.g., any one, multiple or all of all slave devices) can detect the power supply voltage of the power supply bus to itself, and then determine whether the serial bus system has a fault based on the detected voltage value. Compared with the communication voltage on the communication bus, the power supply voltage is relatively stable and can more accurately reflect the system status, so the fault detection method has higher detection accuracy. In addition, since there is no need to set up an additional fault detection device in the system, the hardware cost and system complexity are reduced.
[0071] The fault detection method provided in the embodiment of the present application is applied to a serial bus system. The serial bus system is first introduced below, that is, the application scenario of the fault detection method is first introduced. Figure 1 Schematic diagram of the structure of the serial bus system provided by the embodiment of the present application. Figure 1 As shown, the serial bus system provided in the embodiment of the present application includes a master device, multiple slave devices, a communication bus, a power supply bus, a GND line, etc.
[0072] In some examples, the serial bus system can be, for example, an RS-232 bus, an RS-422 bus, an RS-485 bus, an I2C bus, an SPI bus, an SMBus bus system, etc., but is not limited thereto. This application takes the serial bus system as an RS-485 bus as an example for explanation.
[0073] In some examples, the serial bus system can be applied to, but not limited to, the fields of smart buildings, smart homes, industrial control, automobile manufacturing, environmental monitoring, electronic equipment, etc. For example, the serial bus system can be applied to the fields of video surveillance, access control intercom, automatic monitoring, building alarm, etc. in smart buildings.
[0074] In some examples, the main device may be, for example, a gateway device, a central controller, a host computer, a slave computer, an industrial computer, an industrial computer, a distributed processing unit, or other devices, but is not limited thereto.
[0075] In some devices, the slave device may be, for example, a key panel, a sensor, a display, a memory, or a terminal device, but is not limited thereto. The number of slave devices may be N, where N may be an integer greater than or equal to 2, such as 3, 5, 10, 20, or 32.
[0076] like Figure 1 As shown, multiple slave devices are serially connected to the communication bus in sequence to achieve communication connection with the master device. Depending on the type of system, the communication bus can also have multiple types. For example, when the serial bus system is an RS485 bus system, the communication bus may include line A and line B, or include a positive bus and a negative bus; when the serial bus system is an RS422 bus system, the communication bus may include two pairs of buses, each pair of buses may include a positive bus and a negative bus; when the serial bus system is an RS232 bus system, the communication bus may include a receiving (RX) bus and a transmitting (TX) bus; when the serial bus system is an I2C bus system, the communication bus may include a serial clock line (SCL) and a serial data line (SDA).
[0077] like Figure 1 As shown, the power supply bus is used to power multiple slave devices, and multiple slave devices are connected in series on the power supply bus in sequence. The power supply bus can be, for example, a VCC line. Exemplarily, one end of the power supply bus is connected to the power output port of the master device, and the master device powers the multiple slave devices. In other examples, other devices or circuits other than the master device can also power the multiple slave devices, which is not limited in this application.
[0078] based on Figure 2The serial bus system shown, combined with the fault detection method provided in the embodiment of the present application, will continue to specifically analyze and solve the technical problems raised in the present application.
[0079] See attached Figure 3 , Figure 3 1 is a flow chart of a fault detection method 100 for a serial bus system provided in an embodiment of the present application. The execution subject of the fault detection method 100 may be Figure 2 Any one of the multiple slave devices shown (referred to as the first slave device), such as the first slave device in the series line (i.e., slave device 1), a middle slave device, or the last slave device (i.e., slave device N). In addition, one, more, or all of the multiple slave devices may be configured to execute the fault detection method 100. Figure 3 As shown, the fault detection method 100 includes step 110 and step 120 .
[0080] Step 110: The first slave device detects the power supply voltage of the power supply bus to itself to obtain a first voltage value.
[0081] Step 120: The first slave device determines whether a fault occurs in the serial bus system according to the first voltage value.
[0082] According to the fault detection method 100 provided in the embodiment of the present application, the power supply voltage of the power supply bus to the first slave device can be directly detected, so as to determine whether the serial bus system has a fault according to the detected first voltage value. Compared with the communication voltage on the communication bus, the power supply voltage is relatively stable, less affected by other factors, and can more accurately reflect the system status. Therefore, the present application determines whether the serial bus system has a fault by the power supply voltage, which has higher accuracy and reliability.
[0083] In addition, the fault detection method 100 provided by the present application does not need to set up an additional fault detection device in the system, thereby reducing hardware costs and system complexity. At the same time, since each slave device can be used as a detection point, that is, each slave device can be used as a first slave device for fault detection, the fault detection coverage of the system is improved, so that faults can be discovered and handled more quickly.
[0084] In some examples, the first voltage value may be a detection value detected by the first slave device, or the first voltage value may also be determined by one or more detection values detected by the first slave device. For example, the first voltage value may be multiple detection values detected by the first slave device calculated by an algorithm such as averaging.
[0085] In some examples, the first slave device may periodically execute the fault detection method 100, that is, periodically detect the power supply voltage of the power supply bus to itself to obtain a first voltage value, and determine whether the serial bus system has a fault according to the first voltage value. Alternatively, the first slave device may start to execute the fault detection method 100 when a preset condition is met (for example, receiving a detection instruction from the master device).
[0086] In some examples, the first slave device can determine whether the serial bus system has a fault or not according to the first voltage value, and when it is determined that there is a fault, it can issue a warning message in time, for example, it can send a fault indication message to the master device through the communication bus. When it is determined that there is no fault, it can return to step 110 to start the next cycle of fault detection.
[0087] In some examples, the first slave device determines whether the serial bus system has a fault according to the first voltage value, which may be by inputting the first voltage value into a pre-set algorithm or AI model, and the output result of the algorithm or AI model is whether the system has a fault or not. Figure 4 , Figure 4 2 is a flow chart of a fault detection method 200 for a serial bus system provided in an embodiment of the present application. The fault detection method 200 can be regarded as a specific implementation of the aforementioned fault detection method 100. The fault detection method 200 includes the following steps 210 to 250.
[0088] Step 210: The first slave device detects the power supply voltage of the power supply bus to itself to obtain a first voltage value.
[0089] Step 220: The first slave device determines whether there is a fault in the serial bus system according to the difference between the first voltage value and the first theoretical voltage value.
[0090] The embodiment of the present application determines whether the system has a fault by comparing the difference between the first voltage value detected by the first slave device and the first theoretical voltage value. This method takes into account the normal fluctuation range of the power supply voltage. Only when the difference between the actual voltage and the theoretical voltage exceeds a certain range, it is determined that the system has a fault, thereby reducing the possibility of misjudgment and improving the accuracy and reliability of detection.
[0091] In actual applications, the supply voltage may fluctuate to a certain extent due to various factors (such as switching of device working modes, power supply voltage fluctuations, etc.). By setting a reasonable theoretical voltage value and difference range, it can be ensured that there will be no misjudgment when the voltage fluctuation is normal, and at the same time, the fault can be discovered and measures can be taken in time when the voltage is abnormal. This helps to reduce system downtime or unnecessary maintenance costs caused by misjudgment.
[0092] In some examples, whether the system has a fault can be determined based on whether the difference is within a preset range. For example, when the difference is within the preset range (e.g., the difference is close to 0), it is considered that the system has no fault, and when the absolute value of the difference is large and outside the preset range, it is considered that the system has a fault.
[0093] In some examples, the first slave device determines whether there is a fault in the serial bus system based on the difference, and the difference may be input into a pre-set algorithm (formula) or AI model, and the output result of the algorithm or AI model is whether there is a fault in the system or not.
[0094] like Figure 4 As shown, the fault detection method 200 provided in the embodiment of the present application also includes step 230. If it is determined in step 220 that a fault exists in the serial bus system, step 230 is entered. If it is determined that there is no fault in the system, step 210 is returned to continue the voltage detection step.
[0095] Step 230: The first slave device sends first indication information to the master device for indicating that a system fault exists. For example, the first slave device sends the first indication information to the master device via a communication bus.
[0096] When a fault is detected, the first slave device can promptly send a first indication message to the master device, so that the master device can promptly understand that the system has entered an abnormal state. The master device can promptly take corresponding countermeasures to avoid more serious damage to the bus system.
[0097] In some examples, such as Figure 4 As shown, in step 220, before the first slave device determines whether the serial bus system has a fault according to the difference between the first voltage value and the first theoretical voltage value, the fault detection method 200 provided in the embodiment of the present application further includes:
[0098] Step 240: The master device sends a first mapping relationship to all slave devices in the system including the first slave device (eg, by broadcasting), where the first mapping relationship is used to indicate a one-to-one correspondence between multiple slave devices and multiple theoretical voltage values.
[0099] Step 250: The first slave device determines the aforementioned first theoretical voltage value according to the first mapping relationship. For example, the first slave device may determine the first theoretical voltage value corresponding to itself from multiple theoretical voltage values in the first mapping relationship according to its own identification (eg, address).
[0100] The present application introduces the first mapping relationship so that each slave device can obtain the theoretical voltage value corresponding to it, so that a more accurate judgment basis can be provided when performing fault detection, thereby improving the accuracy and reliability of detection.
[0101] In addition, since the first mapping relationship is issued in advance by the master device, the master device can dynamically adjust the first mapping relationship according to the actual system conditions to adapt to different working environments and conditions (such as different numbers of slave devices), thereby improving the flexibility and scalability of the system.
[0102] In some examples, the aforementioned step 210, in which the first slave device detects the power supply voltage of the power supply bus to itself, may specifically include:
[0103] The first slave device detects the power supply voltage of the power supply bus to itself in the self-test mode, wherein the first slave device has a fixed power consumption value P in the self-test mode.
[0104] When the first slave device is in normal working state, the power consumption may vary due to different tasks (such as working modes). The present application sets the first slave device to detect the power supply voltage in the self-test mode, and in the self-test mode, the power consumption of the slave device is fixed, which eliminates the influence of power consumption change on the power supply voltage, so that the detected power supply voltage (i.e., the first voltage value) can accurately reflect the real state of the system, which is conducive to reducing the possibility of misjudgment, thereby improving the accuracy and reliability of detection.
[0105] Further, on this basis, as an example, based on Ohm's law, the theoretical voltage values corresponding to different slave devices can be calculated in the following manner to determine the first mapping relationship:
[0106]
[0107] …
[0108]
[0109] Wherein, L1 is the length of the power supply bus line segment between the access end and slave device 1, L2 is the length of the power supply bus line segment between slave device 1 and slave device 2, L3 is the length of the power supply bus line segment between slave device 2 and slave device 3, Ln is the length of the power supply bus line segment between slave device (n-1) and slave device n, ρ is the bus resistivity, and the product of the length of each line segment and the bus resistivity is the resistance of the line segment. P is the fixed power consumption value of each slave device, and VCC is the initial power supply voltage (i.e., the voltage at the output end of the master device power supply). When the series bus system is installed, the above values are all known quantities, so the theoretical voltage value of each slave device can be calculated (wherein V1, V2, V3, V(n-1) and Vn are the theoretical voltage values corresponding to slave device 1, slave device 2, slave device 3, slave device (n-1) and slave device n respectively).
[0110] In some examples, the master device may calculate the theoretical voltage values of each slave device and generate the first mapping relationship. Alternatively, the slave device may calculate its corresponding theoretical voltage value and report it to the master device, which then aggregates and generates the first mapping relationship.
[0111] In some examples, the theoretical voltage value of each slave device may be determined by other calculation methods, or by actual measurement while ensuring that the system is fault-free. That is, the embodiment of the present application does not specifically limit the method for determining the first mapping relationship.
[0112] In some examples, each slave device including the first slave device may have a normal operating mode and a self-test mode. When voltage detection is required, the slave device may switch from the current normal operating mode to the self-test mode. For example, the first slave device may also operate in the self-test mode, but the power consumption is fixed at a fixed power consumption value P, so that the normal operation of the slave device will not be affected while realizing the detection function.
[0113] In some examples, the first slave device has a fixed power consumption value P when operating in the self-test mode, and the power consumption may be maintained or approximately maintained at the fixed power consumption value P. Exemplarily, the power consumption of the first slave device may be maintained at a fixed power consumption value P by connecting a rated load, and the fixed power consumption value P is much greater than the power consumption P0 of the first slave device in the normal working mode, for example, P≥3P0, P≥5P0, P≥10P0, P≥15P0, P≥20P0, P≥30P0, P≥50P0, P≥100P0, etc.
[0114] Figure 5 This is a schematic diagram of the modular structure of the first slave device. Figure 5As shown, when the first slave device is working in the normal working mode, the rated load is not connected. At this time, the first slave device performs normal work based on the 485 module, MCU and other modules, and the power consumption at this time is P0. When it is determined that the power supply voltage needs to be detected, the switch is closed at this time, and the rated load is connected to the circuit, so that the power consumption of the first slave device reaches and remains at a fixed power consumption value P. P is much larger than P0, that is, the working current at this time is much larger than the working current of the 485 module, other modules and MCU, which helps to improve the signal-to-noise ratio, and thus helps to improve the accuracy of fault detection.
[0115] See attached Figure 6 , Figure 6 3 is a flow chart of a fault detection method 300 for a serial bus system provided in an embodiment of the present application. The fault detection method 300 can be regarded as a specific implementation of the aforementioned fault detection method 100, and the fault detection method 300 includes the following steps 310 to 350.
[0116] Step 310: The first slave device detects the power supply voltage of the power supply bus to itself to obtain a first voltage value.
[0117] Step 320: The first slave device determines whether a fault occurs in the serial bus system according to the first voltage value and the preset first voltage threshold and second voltage threshold.
[0118] This step specifically includes: if the first voltage value is less than the first voltage threshold or greater than the second voltage threshold, it is determined that there is a fault in the serial bus system; if the first voltage value is greater than or equal to the first voltage threshold and less than or equal to the second voltage threshold, it is determined that there is no fault in the serial bus system, wherein the first voltage threshold is less than the second voltage threshold.
[0119] Taking into account the normal fluctuation range of the power supply voltage, this embodiment provides a clear judgment standard for the abnormality of the power supply voltage by setting the first voltage threshold and the second voltage threshold. When the first voltage value is between the first voltage threshold and the second voltage threshold, it can be determined that there is no fault in the serial bus system (that is, the power supply voltage is within a reasonable range). When the first voltage value is less than the first voltage threshold or greater than the second voltage threshold, it is determined that there is a fault in the serial bus system (that is, the power supply voltage is outside the reasonable range and the power supply is abnormal). Through the above settings, the possibility of misjudgment can be reduced, the accuracy and reliability of detection can be improved, and the method is simple and clear, easy to implement, etc.
[0120] In some examples, the first voltage threshold (ie, the lowest voltage threshold) and the second voltage threshold (ie, the highest voltage threshold) here can be determined by measuring the range of the power supply voltage supplied to the first slave device when the system is operating normally.
[0121] Specifically, under the premise of ensuring the normal operation (no fault) of the system, the power supply voltage of the power supply bus to the first slave device within a certain period of time (for example, one hour, one day or one week, etc.) can be collected, or all working scenes can be traversed in a relatively short time to collect the power supply voltage of the power supply bus to the first slave device within the period. The lowest voltage value collected is used as the first voltage threshold, and the highest voltage collected is used as the second voltage threshold. Any slave device can determine the first voltage threshold and the second voltage threshold corresponding to itself according to the above method.
[0122] like Figure 6 As shown, the fault detection method 300 provided in the embodiment of the present application also includes step 330. If it is determined in step 320 that a fault exists in the serial bus system, step 330 is entered. If it is determined that there is no fault in the system, step 310 is returned to continue the voltage detection step.
[0123] Step 330: The first slave device sends first indication information to the master device, which is used to indicate that a system fault exists.
[0124] Step 340: The master device sends second indication information to any slave device including the first slave device, where the second indication information is used to instruct each of the multiple slave devices to detect whether it has a fault.
[0125] Step 350: The first slave device detects whether it has a fault according to the second indication information.
[0126] After the master device determines that there is a faulty device in the system based on the first indication information, it can send a second indication information to each of the multiple slave devices so that the multiple slave devices can simultaneously detect whether they have faults. In this way, all abnormal devices can be detected at one time, which can improve troubleshooting efficiency and ensure that the system can run stably for a long time.
[0127] In some examples, taking the first slave device as an example, each slave device in the serial bus system detects whether it has a fault (abnormality) according to the following steps:
[0128] The first slave device detects the power supply voltage of the power supply bus to itself in the self-test mode to obtain a second voltage value V i , wherein the first slave device has a fixed power consumption value P in the self-test mode.
[0129] The first slave device determines whether it has a fault based on the difference between its actual power supply current I and the theoretical power supply current I', where I'=P / V i .
[0130] When the first slave device works in the self-test mode, if there is no fault in itself, then the power consumption of the first slave device is P, and its own theoretical power supply current I' is the fixed power consumption value P and the second voltage value V i At this time, the difference between the actual power supply current I and the theoretical power supply current I' detected can be used to determine whether the first slave device itself has a fault. For example, if the difference is within a certain range close to 0, it means that the first slave device itself has no fault. If it exceeds this range, it means that the first slave device has a fault, and the self-test result can be reported to the master device. The present application can accurately determine whether the first slave device itself has a fault through the above settings.
[0131] In some examples, the actual supply current I may be based on the second voltage value V i , the third voltage value V i-1 , the fourth voltage value V i+1 , and Ohm's law determines that;
[0132] Among them, the third voltage value V i-1 is the power supply voltage detected by the previous node of the first slave device in the self-test mode, and the fourth voltage value V i+1 It is the supply voltage detected by the next node of the first slave device in the self-test mode.
[0133] This application introduces the voltage values of the adjacent nodes on the upper and lower sides and the line resistance of the power supply bus and other parameters, based on Ohm's law, and can accurately calculate the actual power supply current I. The slave device can calculate the actual power supply current I based on the detected power supply voltage, without the need to set up an additional current detection module, which is conducive to saving hardware costs. It also has the advantages of being simple and clear, easy to implement, etc.
[0134] In some examples, the first slave device determines the actual supply current I according to the following formula:
[0135] I=(V i-1 -V i ) / R i -I i+1
[0136] Among them, V i-1 From the previous node, R i is the line resistance of the power supply bus segment between the previous node and the first slave device, I i+1 =(V i -V i+1 ) / R i+1 , I i+1 From the next node, R i+1 is the line resistance of the power supply bus segment between the first slave device and the next node.
[0137] (V i-1 -V i ) / R i That is, the current on the line segment between the previous node and the first slave device (denoted as I i ), I i+1 That is, the current on the line segment between the first slave device and the next node. According to the current shunting principle of Ohm's law, the difference between the two is the actual power supply current I of the first slave device. The present application can accurately calculate the actual power supply current I of the first slave device through the above method. It also has the advantages of being simple and clear, easy to implement, etc.
[0138] In some examples, R i With R i+1 The line resistance of different line segments can be obtained by multiplying the line length by the total line resistivity, or it can also be obtained by measurement.
[0139] In some examples, i in the above formula can represent the level of the first slave device in N slave devices, and 2≤i≤N-1. That is, for the slave devices from the second level to the second to last level (i.e., the N-1th level) in the system, their actual power supply current I can be calculated according to the above public indication, and then the actual power supply current I can be calculated by the formula P / V i The theoretical supply current I' can be calculated, and then the difference between the two can be used to determine whether there is a fault.
[0140] Furthermore, the above formula is also applicable to the first-level slave device (i.e., slave device 1) and the last-level slave device. In this case, only relevant definitions are required. Specifically, when i is 1, V i-1 It can be defined as the initial supply voltage VCC. When i is N, I i+1 Defined as 0.
[0141] Combination of the above Figures 1 to 6 The fault detection method of the serial bus system provided by the embodiment of the present application is described in detail. Figure 7 , Figure 8 Describe the fault detection device or apparatus of the serial bus system provided by the embodiment of the present application. It should be understood that Figure 7 , Figure 8 The fault detection device or fault detection apparatus shown can realize Figure 3 , Figure 4 or Figure 6 One or more steps in the method flow shown are not described in detail here to avoid repetition.
[0142] Figure 74 is a schematic block diagram of a fault detection device 400 provided in an embodiment of the present application. The fault detection device 400 is applied to a serial bus system, wherein the serial bus system includes a master device, multiple slave devices, and a power supply bus. The multiple slave devices are sequentially connected in series to the power supply bus. The fault detection device 400 can be any one of the multiple slave devices, such as the aforementioned first slave device, or can be a separate additional detection device. Figure 7 As shown, the fault detection device 400 includes a detection unit 410 , a processing unit 420 and a transceiver unit 430 .
[0143] The detection unit 410 is used to detect the power supply voltage of the power supply bus to itself to obtain a first voltage value.
[0144] The processing unit 420 is configured to determine whether a fault occurs in the serial bus system according to the first voltage value.
[0145] In some examples, the processing unit 420 is specifically used to determine whether there is a fault in the serial bus system according to a difference between the first voltage value and a first theoretical voltage value.
[0146] In some examples, the processing unit 420 is specifically used to: determine the first theoretical voltage value according to a first mapping relationship, the first mapping relationship is used to indicate a one-to-one correspondence between the multiple slave devices and the multiple theoretical voltage values, and the first mapping relationship is issued in advance by the master device.
[0147] In some examples, the processing unit 420 is specifically used to: determine that a fault exists in the serial bus system if the first voltage value is less than a first voltage threshold or greater than a second voltage threshold, wherein the first voltage threshold is less than the second voltage threshold.
[0148] In some examples, the detection unit 410 is specifically used to detect the power supply voltage of the power supply bus to itself in the self-test mode, wherein the first slave device 400 has a fixed power consumption value in the self-test mode.
[0149] In some examples, the first slave device 400 further includes: a transceiver unit 430, which is used to send first indication information indicating that a system fault exists to the master device when it is determined that a fault exists in the serial bus system.
[0150] In some examples, the transceiver unit 430 is also used to: receive second indication information from the master device, the second indication information is used to instruct each of the multiple slave devices to detect whether there is a fault in itself; the detection unit 410 is specifically used to: detect whether there is a fault in itself according to the second indication information.
[0151] In some examples, the detection unit 410 is specifically used to: detect the power supply voltage of the power supply bus to itself in the self-test mode to obtain the second voltage value V i , wherein the first slave device has a fixed power consumption value P in the self-test mode; the processing unit 420 is specifically used to: determine whether it has a fault according to the difference between its actual power supply current I and the theoretical power supply current I', wherein I'=P / V i .
[0152] In some examples, the actual supply current I is based on the second voltage value V i , the third voltage value V i-1 , the fourth voltage value V i+1 , and Ohm's law determines that; wherein the third voltage value V i-1 is the power supply voltage of the previous node of the first slave device detected in the self-test mode, and the fourth voltage value V i+1 It is the supply voltage of the next node of the first slave device detected by itself in the self-test mode.
[0153] In some examples, the processing unit 420 is specifically configured to: determine the actual power supply current I according to the following formula: I = (V i-1 -V i ) / R i -I i+1 ; Among them, V i-1 From the previous node, R i is the line resistance of the power supply bus segment between the previous node and the first slave device, I i+1 =(V i -V i+1 ) / R i+1 , I i+1 From the next node, R i+1 is the line resistance of the line segment of the power supply bus between the first slave device and the next node.
[0154] Specifically, the fault detection device 400 may correspond to the first slave device in the fault detection method 100, the fault detection method 200, and the fault detection method 300 according to the embodiment of the present application. The fault detection device 400 may include a method for executing Figure 3 , Figure 4 or Figure 6In addition, each unit in the fault detection device 400 and the above-mentioned other operations and / or functions are respectively for implementing the corresponding processes of method 100, method 200 or method 300. The specific process of each unit performing the above-mentioned corresponding steps has been described in detail in method 100, method 200 and method 300, and will not be repeated here for the sake of brevity.
[0155] The embodiment of the present application further provides a fault detection device 500 of a serial bus system. The fault detection device 500 may be, for example, the first slave device in the aforementioned embodiment. Figure 8 is a structural block diagram of a fault detection device 500 provided in an embodiment of the present application. Figure 8 As shown, the fault detection 500 includes a processor 510 and a memory 520 , and the above-mentioned components may be connected via one or more buses 530 .
[0156] The fault detection device 500 further includes a computer program 521, which is stored in the memory 520. When the computer program 521 is executed by the processor 510, the fault detection device 500 performs the above Figure 3 The method 100 shown, Figure 4 The method 200 shown or Figure 6 The method 300 shown in FIG. 300 , wherein all relevant contents of each step involved in the above method embodiment can be referred to the functional description of the corresponding physical device, and will not be repeated here.
[0157] An embodiment of the present application also provides a computer-readable storage medium, which includes a computer program. When the computer-readable storage medium is run on a computer, the computer executes the method provided by the above method embodiment.
[0158] An embodiment of the present application also provides a computer program product, including: a computer program code, when the computer program code is executed on an electronic device, the electronic device executes the method provided by the above method embodiment.
[0159] An embodiment of the present application also provides a chip system, including a memory and a processor, wherein the memory is used to store a computer program, and the processor is used to call and run the computer program from the memory, so that an electronic device equipped with the chip system executes the method provided in the above method embodiment.
[0160] Among them, the chip system may include an input circuit or interface for sending information or data, and an output circuit or interface for receiving information or data.
[0161] It should be understood that in the embodiments of the present application, the processor may be a central processing unit (CPU), and the processor may also be other general-purpose processors, digital signal processors (DSP), application specific integrated circuits (ASIC), field programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.
[0162] It should also be understood that the memory in the embodiments of the present application may be a volatile memory or a non-volatile memory, or may include both volatile and non-volatile memories. Among them, the non-volatile memory may be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory may be a random access memory (RAM), which is used as an external cache. By way of example and not limitation, many forms of random access memory (RAM) are available, such as static RAM (SRAM), dynamic random access memory (DRAM), synchronous DRAM (SDRAM), double data rate synchronous dynamic random access memory (DDR SDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link DRAM (SLDRAM), and direct rambus RAM (DR RAM).
[0163] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0164] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0165] In the several embodiments provided in the present application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0166] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0167] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
[0168] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application can be essentially or partly embodied in the form of a software product that contributes to the prior art. The computer software product is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0169] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
Claims
1. A fault detection method for a serial bus system, characterized in that: The serial bus system includes a master device, a plurality of slave devices and a power supply bus, the plurality of slave devices are serially connected to the power supply bus in sequence, the plurality of slave devices include a first slave device, and the fault detection method includes: The first slave device detects the power supply voltage of the power supply bus to itself to obtain a first voltage value; The first slave device determines whether there is a fault in the serial bus system according to the first voltage value.
2. The fault detection method according to claim 1, characterized in that: The first slave device determines whether the serial bus system has a fault according to the first voltage value, including: The first slave device determines whether there is a fault in the serial bus system according to a difference between the first voltage value and a first theoretical voltage value.
3. The fault detection method according to claim 2, characterized in that: Before determining whether the serial bus system has a fault, the fault detection method further includes: The first slave device determines the first theoretical voltage value according to a first mapping relationship, where the first mapping relationship is used to indicate a one-to-one correspondence between the multiple slave devices and multiple theoretical voltage values, and the first mapping relationship is issued in advance by the master device.
4. The fault detection method according to claim 1, characterized in that: The first slave device determines whether the serial bus system has a fault according to the first voltage value, including: If the first voltage value is less than a first voltage threshold or greater than a second voltage threshold, it is determined that a fault exists in the serial bus system, wherein the first voltage threshold is less than the second voltage threshold.
5. The fault detection method according to any one of claims 1 to 4, characterized in that: The first slave device detects the power supply voltage of the power supply bus to itself, including: The first slave device detects a power supply voltage of the power supply bus to itself in a self-test mode, wherein the first slave device has a fixed power consumption value in the self-test mode.
6. The fault detection method according to any one of claims 1 to 4, characterized in that: If it is determined that the serial bus system has a fault, the fault detection method further includes: The first slave device sends first indication information to the master device for indicating that a system failure exists.
7. The fault detection method according to claim 6, characterized in that: The fault detection method further comprises: The first slave device receives second indication information from the master device, where the second indication information is used to instruct each of the multiple slave devices to detect whether it has a fault; The first slave device detects whether it has a fault according to the second indication information.
8. The fault detection method according to claim 7, characterized in that: The first slave device detecting whether the first slave device has a fault according to the second indication information includes: The first slave device detects the power supply voltage of the power supply bus to itself in the self-test mode to obtain a second voltage value V i , wherein the first slave device has a fixed power consumption value P in the self-test mode; The first slave device compares its actual power supply current I with the theoretical power supply current I ’ The difference between the values of I ’ =P / V i .
9. The fault detection method according to claim 8, characterized in that: The actual supply current I is based on the second voltage value V i , the third voltage value V i-1 , the fourth voltage value V i+1 , and Ohm's law determines that; Wherein, the third voltage value V i-1 is the power supply voltage of the previous node of the first slave device detected in the self-test mode, and the fourth voltage value V i+1 It is the supply voltage of the next node of the first slave device detected by itself in the self-test mode.
10. The fault detection method according to claim 9, characterized in that: The first slave device determines the actual supply current I according to the following formula: I=(V i-1 -V i ) / R i -I i+1 Among them, V i-1 From the previous node, R i is the line resistance of the power supply bus segment between the previous node and the first slave device, I i+1 =(V i -V i+1 ) / R i+1 , I i+1 From the next node, R i+1 is the line resistance of the line segment of the power supply bus between the first slave device and the next node.
11. A fault detection device for a serial bus system, characterized in that: The serial bus system includes a master device, a plurality of slave devices and a power supply bus, the plurality of slave devices are serially connected to the power supply bus in sequence, and the fault detection device includes: A detection unit, used for detecting a power supply voltage of the power supply bus to itself to obtain a first voltage value; A processing unit is used to determine whether there is a fault in the serial bus system according to the first voltage value.
12. A fault detection device for a serial bus system, characterized in that: The serial bus system includes a master device, a plurality of slave devices and a power supply bus, wherein the plurality of slave devices are serially connected to the power supply bus in sequence, and the fault detection device includes: processor; Memory; and a computer program, the computer program being stored in the memory, and when the computer program is executed by the processor, causing the fault detection device to perform the fault detection method according to any one of claims 1 to 10.
13. A serial bus system, characterized in that: The serial bus system includes a master device, multiple slave devices and a power supply bus, and the multiple slave devices are serially connected to the power supply bus in sequence. The serial bus system also includes the fault detection device as described in claim 11, or the fault detection device as described in claim 12.