Wiring detection method, communication system, device and computer program product

By configuring and traversing the voltage parameters on the communication bus, detecting the wiring methods and branch nodes of the long-distance serial bus, the problem of difficulty in detecting traditional wiring methods is solved, and the wiring detection efficiency and communication quality are improved.

CN119544401APending Publication Date: 2025-02-28TP-LINK
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411657560.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-18
Publication Date
2025-02-28

AI Technical Summary

Technical Problem

Traditional long-distance serial buses are prone to branches when actually wiring, resulting in the wiring method becoming a tree-like wiring, affecting signal quality, and it is difficult to check and locate branch nodes of tree-like wiring in communication systems with large equipment.

Method used

By configuring the communication addresses of the host and slave, and configuring the voltages of the host and slave respectively according to the first voltage and the second voltage configuration parameters, the voltages of each slave are traversed to determine the wiring method and branch node of the communication bus.

Benefits of technology

This method can quickly detect the wiring method of the communication bus and the branch nodes of the tree-shaped wiring, improve detection efficiency, reduce labor costs, and ensure communication quality.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119544401A_ABST
    Figure CN119544401A_ABST
Patent Text Reader

Abstract

The invention discloses a wiring detection method, a communication system, a device and a computer program product. The wiring detection method comprises the following steps: configuring communication addresses of a host and each slave; according to the first voltage configuration parameter, the voltage of the first communication node is configured, and according to the second voltage configuration parameter, the voltage of each second communication node is configured in sequence; traversing the voltage of each second communication node once when the voltage of the second communication node is configured once; determining a wiring mode of the communication bus based on the voltage of each second communication node; and determining branch nodes of the communication bus based on the voltages of the second communication nodes. Under the condition that a certain second communication node configures the voltage according to the second voltage configuration parameter, due to different wiring modes, the obtained voltages of all the communication nodes are different, and therefore the wiring mode of the communication bus can be determined according to the voltages of all the communication nodes.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application belongs to the field of communication technology, and in particular, relates to a wiring detection method, a communication system, a device, and a computer program product. Background Art

[0002] At present, according to the communication standard, long-distance serial buses generally have two buses, namely A bus and B bus. Bus devices send 1 and 0 by changing the voltage of the two lines to achieve digital communication.

[0003] In traditional technical solutions, long-distance serial buses usually use hand-in-hand wiring, which has excellent transmission signal quality. However, branches are very likely to appear during actual wiring, causing the wiring method of the long-distance serial bus to become a tree-like wiring, which in turn affects the signal quality. In a communication system with a large number of devices, it is very difficult to check the wiring method of the devices and locate the branch nodes of the tree-like wiring. Summary of the invention

[0004] The purpose of the present application is to provide a wiring detection method, a communication system, a device and a computer program product, aiming to solve the problems existing in the traditional long-distance serial bus.

[0005] A first aspect of an embodiment of the present application provides a wiring detection method, which is applied to a communication system, wherein the communication system includes a communication bus, a host and multiple slaves, the host is a first communication node on the communication bus, and the multiple slaves are multiple second communication nodes on the communication bus, including: configuring the communication address of the host and each of the slaves; configuring the voltage of the first communication node according to a first voltage configuration parameter, and configuring the voltage of each of the second communication nodes in turn according to a second voltage configuration parameter; traversing the voltage of each second communication node each time the voltage of the second communication node is configured; determining the wiring mode of the communication bus based on the voltage of each of the second communication nodes; and determining the branch nodes of the communication bus based on the voltage of each of the second communication nodes.

[0006] In one embodiment, in configuring the voltage of the first communication node according to the first voltage configuration parameter and configuring the voltage of each of the second communication nodes in sequence according to the second voltage configuration parameter, only the voltage of the first communication node and the voltage of one of the second communication nodes are configured at the same time.

[0007] In one embodiment, the wiring method of the communication bus determined based on the voltage of each second communication node includes: marking the second communication nodes corresponding to the voltage parameters with the same numerical value as abnormal nodes in each traversal according to the voltage of each second communication node; if there is an abnormal node whose voltage parameter is between the first voltage configuration parameter and the second voltage configuration parameter, the wiring method is tree wiring, otherwise, the wiring method is hand-in-hand wiring.

[0008] In one embodiment, determining the branch node of the communication bus based on the voltage of each second communication node includes: marking the abnormal node in each traversal according to the voltage of each second communication node; the second communication node marked as the abnormal node in each traversal is a branch node.

[0009] In one embodiment, the communication bus includes a first bus and a second bus, and the host and the slave are both connected to the first bus and the second bus.

[0010] In one embodiment, configuring the voltage of the first communication node according to the first voltage configuration parameter, and configuring the voltage of each of the second communication nodes in sequence according to the second voltage configuration parameter includes: configuring the voltage of the first bus corresponding to the first communication node to the first voltage; configuring the voltage of the first bus corresponding to each of the second communication nodes to the second voltage in sequence; wherein the first voltage is not equal to the second voltage.

[0011] In one embodiment, configuring the voltage of the first communication node corresponding to the host according to the first voltage configuration parameter, and configuring the voltage of the second communication node corresponding to each of the slaves in sequence according to the second voltage configuration parameter includes: configuring the voltages of the first bus and the second bus corresponding to the first communication node to the first voltage and the second voltage, respectively; configuring the voltages of the first bus and the second bus corresponding to each of the second communication nodes to the third voltage and the fourth voltage, respectively; wherein the first voltage is not equal to the third voltage, and the second voltage is not equal to the fourth voltage.

[0012] A second aspect of an embodiment of the present application provides a communication system, including a communication bus, a host and multiple slaves, wherein the host and each of the slaves are connected to the communication bus, and the communication system is used to implement the wiring detection method as described above.

[0013] A third aspect of an embodiment of the present application provides a communication device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the above-mentioned wiring detection method when executing the computer program.

[0014] A fourth aspect of the embodiments of the present application provides a computer program product. When the computer program product runs on a terminal device, the terminal device implements the wiring detection method as described above.

[0015] Compared with the prior art, the embodiments of the present application have the following beneficial effects: when a second communication node configures the voltage according to the second voltage configuration parameter, due to the different wiring methods and the large line resistance between the communication nodes, the voltages obtained at the various communication nodes will be different, so that the wiring method of the communication bus can be determined according to the voltages of the various second communication nodes and the branch nodes of the tree wiring can be determined, thereby improving the detection efficiency of the wiring method and reducing labor costs. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] Figure 1 is a schematic diagram of a traditional communication system;

[0017] Figure 2 A flowchart of a wiring detection method provided in an embodiment of the present application;

[0018] Figure 3 A schematic diagram of a communication system provided in one embodiment of the present application;

[0019] Figure 4 Another schematic diagram of a communication system provided by an embodiment of the present application;

[0020] Figure 5 A schematic diagram of a host provided in an embodiment of the present application;

[0021] Figure 6 A schematic diagram of a communication device provided in one embodiment of the present application. DETAILED DESCRIPTION

[0022] In order to make the technical problems, technical solutions and beneficial effects to be solved by the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0023] It should be noted that when an element is referred to as being "fixed to" or "disposed on" another element, it can be directly on the other element or indirectly on the other element. When an element is referred to as being "connected to" another element, it can be directly connected to the other element or indirectly connected to the other element.

[0024] It should be understood that the orientation or position relationship indicated by terms such as "length", "width", "up", "down", "front", "back", "left", "right", "vertical", "horizontal", "top", "bottom", "inside" and "outside" are based on the orientation or position relationship shown in the drawings, and are only for the convenience of describing the present application and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore should not be understood as a limitation on the present application.

[0025] In addition, the terms "first" and "second" are used for descriptive purposes only and should not 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 this application, the meaning of "plurality" is two or more, unless otherwise clearly and specifically defined.

[0026] Traditional serial communication buses that use hand-in-hand wiring, such as Figure 1 As shown, the communication bus includes a first bus A and a second bus B, and the main device, sub-device 1, sub-device 2, sub-device 3, sub-device 4, sub-device 5 and sub-device 6 are connected in sequence through the first bus A and the second bus B.

[0027] Any device can realize data transmission by configuring the voltage on the first bus A and the second bus B based on the voltage difference between the first bus A and the second bus B. For example, for the RS485 bus, when the voltage on the first bus A is greater than the voltage on the first bus B, it indicates 1; when the voltage on the bus A is less than the voltage on the second bus B, it indicates 0. In the actual wiring process, branches are very likely to appear, making the wiring mode of the communication bus become a tree-like wiring. At this time, it is usually necessary to manually screen each node to ensure the normal operation of the communication bus.

[0028] Figure 2 A flowchart of a wiring detection method provided by an embodiment of the present application is shown. For ease of description, only the part related to the present embodiment is shown, which is described in detail as follows:

[0029] The wiring detection method can be applied to Figure 3 The hand-in-hand wiring communication system 10 shown can also be applied to Figure 4 The communication system 10 shown adopts a tree-like wiring, and the communication system 10 includes a communication bus, a host 100 and multiple slaves 200. When the host 100 and the multiple slaves 200 are connected to the communication bus, the host 100 is the first communication node on the communication bus, and the multiple slaves 200 are multiple second communication nodes on the communication bus.

[0030] The wiring detection method includes steps S100 to S500.

[0031] Step S100: configure the communication addresses of the host and each slave.

[0032] It should be noted that the host 100 can perform "device discovery" on the subsequent device (i.e., the slave 200) through relevant programs and assign communication addresses. Specifically, the communication address of the host 100 can be set to a fixed communication address, and communication addresses can be randomly assigned to each slave 200. Figure 3 , Figure 4 In the communication system 10 shown with six slaves 200, the communication address of the host 100 can be configured as 0, and the communication addresses of the six slaves 200 can be configured as 1, 2, 3, 4, 5 and 6 in sequence, that is, the communication address of the first communication node is configured as 0, and the communication addresses of the six second communication nodes are configured as 1, 2, 3, 4, 5 and 6 in sequence.

[0033] Step S200: configuring the voltage of the first communication node according to the first voltage configuration parameter, and configuring the voltage of each second communication node in turn according to the second voltage configuration parameter.

[0034] Specifically, the host 100 may adopt a broadcasting mode, starting from the slave 200 with the smallest communication address, to control each slave 200 to sequentially configure the voltage of the corresponding second communication node according to the second voltage configuration parameter.

[0035] Exemplarily, after the broadcast ends, all slave machines 200 can start timing, and each slave machine 200 configures the voltage with each second communication node in turn according to the time and in the order of the communication address from small to large according to the second voltage configuration parameters. At the same time, the host 100 always maintains the voltage of the corresponding first communication node according to the first voltage configuration parameters.

[0036] Step S300: Each time the voltage of a second communication node is configured, the voltage of each second communication node is traversed once.

[0037] It is understandable that when any slave 200 configures the voltage of the corresponding second communication node according to the second voltage configuration parameter, each slave 200 can respectively collect the voltage of the corresponding second communication node, and the number of slaves 200 that configure the voltage according to the second voltage configuration parameter determines the number of groups of voltage parameters that can be finally obtained. The host 100 can traverse each slave 200 and upload the obtained voltage parameters to the host 100, and the host 100 can summarize the obtained groups of voltage parameters.

[0038] Step S400: determining the connection mode of the communication bus based on the voltage of each second communication node.

[0039] Step S500: determining a branch node of the communication bus based on the voltage of each second communication node.

[0040] Based on the voltages of the second communication nodes obtained through traversal, the wiring mode and branch nodes of the communication bus can be quickly determined, so that the communication bus can be adjusted in time according to needs to ensure the communication quality.

[0041] To sum up, when each second communication node configures the voltage according to the second voltage configuration parameter in turn, due to different wiring methods, the voltage of each second communication node obtained in each traversal will be different, so that the wiring method of the communication bus can be determined according to the voltage of each second communication node and the branch nodes of the tree wiring can be determined.

[0042] In one embodiment, in step S200, only the voltage of the first communication node and the voltage of one of the second communication nodes are configured at the same time.

[0043] It can be understood that, since only the voltage of the first communication node and the voltage of one of the second communication nodes are configured at the same time, the obtained groups of voltage parameters can more clearly reflect the wiring mode of the communication bus.

[0044] For example, in Figure 3 , Figure 4 In the communication system 10 shown with six slaves 200, after the broadcast is completed, all slaves 200 start timing, and the slave 200 with the communication address 1 configures the voltage of the second communication node with the communication address 1 according to the second voltage configuration parameters within the timing of 0-t, and then stops configuring the voltage within the timing of t-2t.

[0045] The slave 200 with the communication address of 2 configures the voltage of the second communication node with the communication address of 2 according to the second voltage configuration parameter within the time period of 2t-3t, and then stops configuring the voltage within the time period of 3t-4t.

[0046] And so on, until the slave 200 with the communication address of 6 configures the voltage of the second communication node with the communication address of 6 according to the second voltage configuration parameter within the time of 10t-11t, and then stops configuring the voltage within the time of 11t-12t.

[0047] In one embodiment, step S400 specifically includes steps S410 to S420.

[0048] Step S410: According to the voltages of the second communication nodes, the second communication nodes corresponding to the voltage parameters with the same values ​​are marked as abnormal nodes in each traversal.

[0049] It is understandable that the number of slaves 200 included in the communication system 10 is equal to the number of voltage parameters included in a set of voltage parameters obtained by one traversal. Figure 3 , Figure 4 In the communication system 10 with six slaves 200 shown, a set of voltage parameters includes six voltage parameters. If two of the voltage parameters are equal, the two second communication nodes corresponding to the two voltage parameters are marked as abnormal nodes in this traversal.

[0050] Step S420: If there is an abnormal node whose voltage parameter is between the first voltage configuration parameter and the second voltage configuration parameter, the wiring mode is tree wiring; otherwise, the wiring mode is hand-in-hand wiring.

[0051] It should be noted that when using Figure 3 In the case of hand-in-hand connection shown in the figure, the slave 200 that configures the second communication node voltage according to the second voltage configuration parameter is used as the dividing line, and the voltage parameters collected by each slave 200 on the side of the dividing line away from the host 100 are all equal to the second voltage configuration parameter (that is, the voltage parameters of the abnormal nodes are all equal to the second voltage configuration parameter), so it can be determined whether the hand-in-hand connection is adopted based on the obtained groups of voltage parameters. For example, in the case of Figure 3 In the communication system 10 shown, the six slaves 200 with communication addresses of 1, 2, 3, 4, 5, and 6 are arranged in sequence in the direction away from the host 100. If the slave 200 with communication address 4 configures the voltage of the corresponding second communication node to 3.3V, and the host 100 configures the voltage of the corresponding first communication node to 0V, the voltage parameters collected by the two slaves 200 with communication addresses 4, 5, and 6 are both 3.3V. Due to long-distance communication, the communication lines between slaves and between slaves and the host will produce a certain impedance (specifically, every 100 meters of communication line will have a resistance of about 2.2 ohms), so the voltage parameters collected by the three slaves 200 with communication addresses 1, 2, and 3 will be between 0V and 3.3V, and the voltage parameters collected by the three slaves 200 with communication addresses 1, 2, and 3 will increase in sequence. In this traversal, the three slaves 200 with communication addresses 4, 5, and 6 are all abnormal nodes, and the voltage of the abnormal node is equal to the second voltage configuration parameter.

[0052] For example, a communication bus using tree wiring is Figure 4As shown, the slave 200 with a communication address of 1 and the slave 200 with a communication address of 2 are sequentially arranged on the second communication node on the main line in a direction away from the host 100. In this embodiment, the slave 200 with a communication address of 2 is a branch node. The second communication nodes corresponding to the slave 200 with a communication address of 2 are respectively connected to the two slave lines. The slave 200 with a communication address of 3 and the slave 200 with a communication address of 4 are sequentially arranged on one of the slave lines in a direction away from the host 100. The slave 200 with a communication address of 5 and the slave 200 with a communication address of 6 are sequentially arranged on the other slave line in a direction away from the host 100.

[0053] When the slave 200 with the communication address of 5 or 6 configures the voltage of the corresponding second communication node according to the second voltage configuration parameter and the line group between the communication nodes is large, the voltage parameters of the three slaves 200 with the communication addresses of 2, 3 and 4 obtained through two traversals are equal. In these two traversals, the second communication nodes corresponding to the three slaves 200 with the communication addresses of 2, 3 and 4 are all abnormal nodes, and the specific size of the voltage parameter of the abnormal node is between the first voltage configuration parameter and the second voltage configuration parameter. Therefore, it can be determined that the wiring method of the communication bus is a tree-like wiring based on the voltage parameters obtained through two traversals.

[0054] In one embodiment, step S500 specifically includes steps S510 to S520.

[0055] Step S510: According to each set of voltage parameters obtained in each traversal, abnormal nodes in each traversal are marked.

[0056] Step S520: The second communication node marked as an abnormal node in each traversal is a branch node.

[0057] For example, in Figure 4 In the communication bus shown, when the slave 200 with the communication address of 5 or 6 configures the voltage of the corresponding second communication node, the voltage parameters collected by the three slaves 200 with the communication addresses of 2, 3 and 4 are all equal. When the slave 200 with the communication address of 3 or 4 configures the voltage of the corresponding second communication node, the voltage parameters collected by the three slaves 200 with the communication addresses of 2, 5 and 6 are all equal. When the slave 200 with the communication address of 1 configures the voltage of the corresponding second communication node, the voltage parameters collected by all slaves 200 are all equal. When the slave 200 with the communication address of 2 configures the voltage of the corresponding second communication node, the voltage parameters collected by the five slaves 200 with the communication addresses of 2, 3, 4, 5 and 6 are all equal.

[0058] Therefore, according to each set of voltage parameters obtained in each traversal, since the slave 200 with the communication address 2 is marked as an abnormal node in each traversal, it can be further determined that the slave 200 with the communication address 2 is a branch node.

[0059] In one embodiment, the communication bus includes a first bus A and a second bus B, and the host 100 or each slave 200 is connected to the first bus A and the second bus B.

[0060] The host 100 or each slave 200 can transmit data by configuring the voltage on the first bus A and the second bus B. The communication bus can specifically be an RS485 bus.

[0061] In one embodiment, step S200 specifically includes steps S210 to S220.

[0062] Step S210: configuring the voltages of the first bus and the second bus corresponding to the first communication node to be the first voltage and the second voltage respectively.

[0063] Step S220: sequentially configuring the voltages of the first bus and the second bus corresponding to each second communication node to be a third voltage and a fourth voltage, respectively, wherein the first voltage is greater than or less than the third voltage, and the second voltage is greater than or less than the fourth voltage.

[0064] It is understandable that the first voltage, the second voltage, the third voltage and the fourth voltage can be either high voltage or low voltage. After two communication nodes on the same bus apply different voltages to form a potential difference, the wiring mode can be detected through steps S300 to S500. Exemplarily, the first voltage and the second voltage can be equal high voltages, and the third voltage and the fourth voltage can be equal low voltages.

[0065] In some embodiments, step S200 also includes steps S230 to S240.

[0066] Step S230: configuring the voltage of the first bus corresponding to the first communication node to be the first voltage.

[0067] Step S240: sequentially configuring the voltage of the first bus corresponding to each second communication node to be a second voltage, wherein the first voltage is greater than or less than the second voltage.

[0068] It should be noted that steps S230 to S240 can be used to replace steps S210 to S220. The wiring mode of the communication bus can also be obtained by detecting a single bus.

[0069] For example, in Figure 4In the communication system 10 shown, when the length of the communication line between two adjacent devices is 100 meters, the voltage parameters obtained by step S200 are shown in Table 1 and Table 2:

[0070]

[0071] Table 1

[0072]

[0073] Table 2

[0074] It should be noted that each slave 200 can obtain a digital signal corresponding to the voltage parameter of each second communication node through analog-to-digital conversion, and each parameter in Table 1 and Table 2 is a digital signal corresponding to the voltage parameter of each second communication node. When the number of traversals is 1, the slave 200 with the smallest communication address configures the voltage of the corresponding second communication node according to the second voltage configuration parameter, and so on. When the number of traversals is 6, the slave 200 with the largest communication address configures the voltage of the corresponding second communication node according to the second voltage configuration parameter. Each time the traversal is performed, a set of voltage parameters can be obtained.

[0075] In some embodiments, the first voltage is 0V, the second voltage is 3.3V, the third voltage is 3.3V, and the fourth voltage is 0V. When the voltage parameter collected by the slave 200 is 0V, the corresponding parameter in Table 1 and Table 2 is 0, and when the voltage parameter collected by the slave 200 is 3.3V, the corresponding parameter in Table 1 and Table 2 is 4096. The correspondence between the collected voltage parameters and the parameters in the table can be set according to actual conditions, for example, according to the data bits of the corresponding device and program. In this embodiment, a 12-bit register is used, so the maximum value corresponding to the maximum voltage parameter is 4096. At the same time, for the convenience of explanation, only the voltage parameters of the first bus A will be described later.

[0076] In the 3rd, 4th, 5th and 6th traversals, in the same set of voltage parameters, there are multiple equal voltage parameters that are not equal to 0 or 4096, and the voltage parameter of the abnormal node is greater than 0 and less than 4096, that is, there is an abnormal node whose voltage parameter is between the first voltage configuration parameter and the second voltage configuration parameter. Therefore, it can be determined that the wiring method is tree wiring according to the parameters in Table 1 and Table 2.

[0077] At the same time, it can be determined according to the parameters in Table 1 and Table 2 that only the slave 200 with the communication address of 2 will be marked as an abnormal node in each traversal, so it can be determined that the slave 200 with the communication address of 2 is a branch node.

[0078] In one embodiment, the host 100 includes a main control chip 110, a communication chip 120, a power supply 130, a pull-up unit 140 and / or a pull-down unit 150. It is understood that whether the host 100 uses the pull-up unit 140 or the pull-down unit 150 can be determined based on the first voltage configuration parameter.

[0079] In such Figure 5 In the host 100 shown, the power supply 130 can supply power to the main control chip 110, the communication chip 120, and the pull-up unit 140. The communication chip 120 is connected to the first bus A and the second bus B respectively, one pull-up unit 140 is connected to the first bus A, and the other pull-up unit 140 is connected to the second bus B. The main control chip 110 can realize data transmission between the first bus A and the second bus B by controlling the communication chip 120, and the main control chip 110 can also control the pull-up unit 140 to pull up the voltage of the first bus A and the second bus B according to the first voltage configuration parameter.

[0080] The pull-down unit 150 and the pull-up unit 140 may specifically adopt switch devices such as MOS tubes and triodes, and the main control chip 110 may realize pull-up or pull-down by controlling the conduction and shutdown of the switch devices. Pull-up in this embodiment refers to pulling the voltage up to 3.3V, and pull-down refers to pulling the voltage down to 0V. The specific first voltage configuration parameter and the second voltage configuration parameter may be set according to actual needs, and this embodiment does not limit them.

[0081] The main control chip 110 may also perform voltage sampling on the first bus A and the second bus B through analog-to-digital conversion to obtain voltage parameters of the corresponding first communication node.

[0082] The difference between the slave 200 and the host 100 is that, when the host 100 adopts the pull-up unit 140, the slave 200 may include two pull-down units 150 respectively connected to the first bus A and the second bus B, so as to pull down the voltage of the first bus A and the second bus B according to the second voltage configuration parameter. Correspondingly, when the host 100 adopts the pull-down unit 150, the slave 200 may include two pull-up units 140 respectively connected to the first bus A and the second bus B. The specific structure of the slave 200 may be configured according to actual needs, and will not be described in detail in this embodiment.

[0083] like Figure 3 , Figure 4 As shown, an embodiment of the present application provides a communication system 10, including a communication bus, a host 100 and multiple slaves 200, the host 100 and each slave 200 are connected to the communication bus, and the communication system 10 is used to implement the wiring detection method as described in any of the above embodiments. The above embodiments have described the structure of the communication system 10, and this embodiment will not be repeated.

[0084] In some embodiments, switch devices are provided on the communication bus between the host 100 and the slave 200 or between the slaves 200 and the slaves 200. When it is detected that the communication system 10 adopts a tree-like wiring, part of the communication bus can be disconnected by each switch device as needed, thereby changing part of the slaves 200 and the host 100 to hand-in-hand wiring.

[0085] Figure 6 A flowchart of a wiring detection method provided by an embodiment of the present application is shown. For ease of description, only the part related to the present embodiment is shown, which is described in detail as follows:

[0086] The communication device 20 includes a memory 21, a processor 22, and a computer program 23 stored in the memory 21 and executable on the processor 22. When the processor 22 executes the computer program 23, the steps of the wiring detection method in any of the above embodiments are implemented.

[0087] An embodiment of the present application provides a computer program product. When the computer program product runs on a terminal device, the terminal device implements the wiring detection method as described in any one of the above embodiments.

[0088] It should be understood that the size of the serial numbers of the steps in the above embodiments does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.

[0089] The technicians in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example for illustration. In practical applications, the above-mentioned function allocation can be completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiment can be integrated in a processing unit, or each unit can exist physically separately, or two or more units can be integrated in one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units. In addition, the specific names of the functional units and modules are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of this application. The specific working process of the units and modules in the above-mentioned system can refer to the corresponding process in the aforementioned method embodiment, which will not be repeated here.

[0090] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0091] The embodiments described above are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, a person skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. Such modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application, and should all be included in the protection scope of the present application.

Claims

1. A wiring detection method, applied to a communication system, the communication system comprising a communication bus, a host and a plurality of slaves, the host being a first communication node on the communication bus, and the plurality of slaves being a plurality of second communication nodes on the communication bus, characterized in that: include: Configuring the communication addresses of the host and each of the slaves; According to the first voltage configuration parameter, configure the voltage of the first communication node, and according to the second voltage configuration parameter, sequentially configure the voltage of each of the second communication nodes; Each time the voltage of the second communication node is configured, the voltage of each second communication node is traversed once; Determining a wiring mode of the communication bus based on the voltage of each of the second communication nodes; A branch node of the communication bus is determined based on the voltage of each of the second communication nodes.

2. The wiring detection method according to claim 1, characterized in that: In configuring the voltage of the first communication node according to the first voltage configuration parameter and configuring the voltage of each of the second communication nodes in sequence according to the second voltage configuration parameter, only the voltage of the first communication node and the voltage of one of the second communication nodes are configured at the same time.

3. The wiring detection method according to claim 1, characterized in that: The determining the connection mode of the communication bus based on the voltage of each of the second communication nodes includes: According to the voltage of each of the second communication nodes, in each traversal, the second communication nodes corresponding to the voltage parameters with the same value are marked as abnormal nodes; If there is an abnormal node whose voltage parameter is between the first voltage configuration parameter and the second voltage configuration parameter, the wiring mode is tree wiring; otherwise, the wiring mode is hand-in-hand wiring.

4. The wiring detection method according to claim 3, characterized in that: The determining of the branch nodes of the communication bus based on the voltages of the respective second communication nodes comprises: According to the voltage of each of the second communication nodes, marking the abnormal nodes in each traversal; The second communication node marked as the abnormal node in each traversal is a branch node.

5. The wiring detection method according to any one of claims 1 to 4, characterized in that: The communication bus includes a first bus and a second bus, and the host and the slave are both connected to the first bus and the second bus.

6. The wiring detection method according to claim 5, characterized in that: The configuring the voltage of the first communication node according to the first voltage configuration parameter, and sequentially configuring the voltage of each of the second communication nodes according to the second voltage configuration parameter includes: configuring a voltage of a first bus corresponding to the first communication node to be a first voltage; The voltage of the first bus corresponding to each of the second communication nodes is configured as a second voltage in sequence; wherein the first voltage is not equal to the second voltage.

7. The wiring detection method according to claim 5, characterized in that: The step of configuring the voltage of the first communication node corresponding to the host according to the first voltage configuration parameter, and sequentially configuring the voltage of the second communication node corresponding to each of the slaves according to the second voltage configuration parameter includes: configuring the voltages of the first bus and the second bus corresponding to the first communication node to be the first voltage and the second voltage respectively; The voltages of the first bus and the second bus corresponding to each of the second communication nodes are configured as a third voltage and a fourth voltage respectively in sequence; wherein the first voltage is not equal to the third voltage, and the second voltage is not equal to the fourth voltage.

8. A communication system, comprising a communication bus, a host and a plurality of slaves, wherein the host and each of the slaves are connected to the communication bus, characterized in that: The communication system is used to implement the wiring detection method according to any one of claims 1 to 7.

9. A communication device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of the wiring detection method according to any one of claims 1 to 7 are implemented.

10. A computer program product, characterized in that When the computer program product runs on a terminal device, the terminal device implements the wiring detection method according to any one of claims 1 to 7.