Method for discovering slave communication device
By sending discovery frames through the master communication device and having slave communication devices selectively forward and replace device IDs or generate response frames, the problem of low discovery efficiency of slave communication devices in chain topologies is solved, and efficient and simplified device discovery is achieved.
Patent Information
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Filing Date
- 2025-06-12
- Publication Date
- 2026-03-26
AI Technical Summary
In vehicle audio transmission systems with a chain topology, existing methods are inefficient and logically complex, making it difficult to efficiently detect communication devices.
The master communication device sends a discovery frame, which is selectively forwarded and replaced with the device ID by the slave communication device in the downlink. The end slave communication device generates a response frame, and the non-end slave communication devices adjust the forwarding method according to the preparation status of the downstream devices to realize device address configuration.
The process of discovering communication devices has been simplified, efficiency has been improved, and logical complexity has been reduced, enabling efficient discovery of slave communication devices by the master communication device.
Smart Images

Figure CN2025100563_26032026_PF_FP_ABST
Abstract
Description
A method for discovering slave communication devices TECHNICAL FIELD
[0001] The present application relates to the field of communication technology, in particular to a method for discovering slave communication devices. BACKGROUND
[0002] In a vehicle audio transmission system, a chain topology is often used to connect each communication device (node) for simplifying the design of wiring harness. The transmission link can include multiple communication devices, which usually contain a master communication device and other slave communication devices.
[0003] In a communication system with such a structure, the master communication device needs to discover which slave communication devices exist in the communication system and can communicate with them after power-on. The commonly used method is that the master communication device sends a discovery frame, which contains a device ID. When a slave communication device is in an undiscovered state, the slave communication device receives the discovery frame, sets the device address of the slave communication device as the device ID in the discovery frame, returns a discovery response frame to the master communication device, and converts the state of the slave communication device to a discovered state. When a slave communication device is in a discovered state, the slave communication device receives the discovery frame, does not change the device address and discovered state of the slave communication device, does not change the device ID in the discovery frame, and forwards the discovery frame to the slave communication device in the downstream direction to discover the next slave communication device.
[0004] With this method, the master communication device needs to send the discovery frame at least n times to discover n slave communication devices, which is low in efficiency. Moreover, the slave communication device needs to distinguish between the undiscovered state and the discovered state, which is complex in logic implementation.
[0005] There is currently a lack of a simple and efficient method for discovering slave communication devices in a chain topology. SUMMARY
[0006] The technical problem to be solved by the present application is how to simply and efficiently discover slave communication devices in a chain topology.
[0007] To solve the above technical problems, the technical solution adopted by the present application is:
[0008] As a discovery slave method of the present invention, for discovering a slave communication device in a communication system, the communication system comprising a master communication device, one or more slave communication devices, and a communication link, the master communication device transmitting a discovery frame in its downlink, the discovery frame comprising a device ID, the slave communication device receiving the discovery frame in its uplink, and setting the device address of the slave communication device as the device ID in the received discovery frame, the slave communication device selectively forwarding the received discovery frame in its downlink, and replacing the device ID in the forwarded discovery frame with a device ID different from the device ID in the received discovery frame when forwarding.
[0009] Preferably, the slave communication device selectively forwarding the received discovery frame in its downlink, and replacing the device ID in the forwarded discovery frame with a device ID different from the device ID in the received discovery frame when forwarding, comprises: if the slave communication device is not a terminal slave communication device, the slave communication device forwarding the received discovery frame in its downlink, and replacing the device ID in the forwarded discovery frame with a device ID different from the device ID in the received discovery frame when forwarding; if the slave communication device is a terminal slave communication device, the slave communication device generating a discovery response frame and transmitting the discovery response frame in its uplink.
[0010] Preferably, the slave communication device selectively forwarding the received discovery frame in its downlink, and replacing the device ID in the forwarded discovery frame with a device ID different from the device ID in the received discovery frame when forwarding, comprises: if the slave communication device is not a terminal slave communication device, the slave communication device forwarding the received discovery frame in its downlink, and replacing the device ID in the forwarded discovery frame with a device ID different from the device ID in the received discovery frame when forwarding; if the slave communication device is a terminal slave communication device, the slave communication device generating a discovery response frame and transmitting the discovery response frame in its uplink.
[0011] Preferably, the slave communication device selectively forwarding the received discovery frame in its downlink, and replacing the device ID in the forwarded discovery frame with a device ID different from the device ID in the received discovery frame when forwarding, comprises: if the slave communication device is not a terminal slave communication device, the slave communication device forwarding the received discovery frame in its downlink, and replacing the device ID in the forwarded discovery frame with a device ID different from the device ID in the received discovery frame when forwarding; if the slave communication device is a terminal slave communication device, the slave communication device generating a discovery response frame and transmitting the discovery response frame in its uplink.
[0012] Preferably, the slave communication device selectively forwards the received discovery frame on its downlink and replaces the device ID in the forwarded discovery frame with a device ID different from the device ID in the received discovery frame, including: if the slave communication device is not a terminal slave communication device and a downstream device of the slave communication device is ready, the slave communication device forwards the received discovery frame on its downlink and replaces the device ID in the forwarded discovery frame with a device ID different from the device ID in the received discovery frame; if the slave communication device is not a terminal slave communication device and a downstream device of the slave communication device is not ready, the slave communication device initiates link training on its downlink to the downstream device; and if the slave communication device is a terminal slave communication device, the slave communication device generates a discovery response frame and sends the discovery response frame on its uplink.
[0013] Preferably, the slave communication device selectively forwards the received discovery frame on its downlink and replaces the device ID in the forwarded discovery frame with a device ID different from the device ID in the received discovery frame, including: if the slave communication device is not a terminal slave communication device and a downstream device of the slave communication device is ready, the slave communication device forwards the received discovery frame on its downlink and replaces the device ID in the forwarded discovery frame with a device ID different from the device ID in the received discovery frame; if the slave communication device is not a terminal slave communication device and a downstream device of the slave communication device is not ready, the slave communication device initiates link training on its downlink to the downstream device; and if the slave communication device is a terminal slave communication device, the slave communication device generates a discovery response frame and sends the discovery response frame on its uplink.
[0014] Preferably, the discovery frame further comprises a maximum to-be-discovered device ID, and if the device ID in the discovery frame received by the slave communication device is greater than or equal to the maximum to-be-discovered device ID in the discovery frame, the slave communication device generates a discovery response frame and sends the discovery response frame on its uplink.
[0015] Further, the discovery response frame comprises a device ID, which is the device address of the slave communication device that generates the discovery response frame.
[0016] Further, the slave communication device receives the discovery response frame on its downlink and forwards the received discovery response frame on its uplink.
[0017] Further, the master communication device receives the discovery response frame on its downlink, and if the master communication device does not receive the discovery response frame within a preset time after sending the discovery frame, the master communication device records a timeout.
[0018] Further, after the slave communication device initiates link training with a downstream device on its downlink, if the link training is successful, the slave communication device forwards the received discovery frame on its downlink and replaces the device ID in the forwarded discovery frame with a device ID different from that in the received discovery frame; if the link training is not successful, the slave communication device generates a discovery response frame and sends the discovery response frame on its uplink.
[0019] Preferably, the slave communication device selectively forwards the received discovery frame on its downlink and replaces the device ID in the forwarded discovery frame with a device ID different from that in the received discovery frame, including: the slave communication device selectively forwards the received discovery frame on its downlink and replaces the device ID in the forwarded discovery frame with the device ID in the received discovery frame plus 1.
[0020] Preferably, after the device address of the slave communication device is set to the device ID in the received discovery frame, the device address of the slave communication device is different from the device addresses of all other slave communication devices in the uplink direction thereof.
[0021] The present application provides a method for discovering slave communication devices, so that master communication devices can simply and efficiently discover slave communication devices in a chain topology. BRIEF DESCRIPTION OF DRAWINGS
[0022] In order to more clearly illustrate the specific embodiments of the present application or the technical solutions in the prior art, the following will briefly introduce the drawings needed to be used in the specific embodiments or prior art description. Obviously, the drawings in the following description are some embodiments of the present application, and those skilled in the art can obtain other drawings according to these drawings without creative labor.
[0023] Fig. 1 is a schematic diagram of a communication system in a method for discovering slave communication devices according to the present application;
[0024] Fig. 2 is a data structure diagram of a discovery frame in the method for discovering slave communication devices according to the present application;
[0025] Fig. 3 is a data structure diagram of another discovery frame in the method for discovering slave communication devices according to the present application;
[0026] Fig. 4 is a schematic diagram of an embodiment of forwarding a discovery frame in a communication system in the method for discovering slave communication devices according to the present application;
[0027] Fig. 5 is a schematic diagram of an embodiment of selectively forwarding a discovery frame by a slave communication device in the method for discovering slave communication devices according to the present application;
[0028] Figure 6 is a schematic diagram of another embodiment of the method of the present application for a slave communication device to selectively forward a discovery frame;
[0029] Figure 7 is a schematic diagram of an embodiment of the method of the present application for link training;
[0030] Figure 8 is a schematic diagram of another embodiment of the method of the present application for link training;
[0031] Figure 9 is a schematic diagram of another embodiment of the method of the present application for a slave communication device to selectively forward a discovery frame;
[0032] Figure 10 is a schematic diagram of another embodiment of the method of the present application for a slave communication device to selectively forward a discovery frame;
[0033] Figure 11 is a schematic diagram of an embodiment of the method of the present application for a slave communication device to have different device addresses for which the device address has been set to the device ID in a received discovery frame;
[0034] Figure 12 is a schematic diagram of a data structure of a discovery response frame in the method of the present application for a slave communication device; DETAILED DESCRIPTION
[0035] In order to make the above and other features and advantages of the present application more comprehensible, the present application will be further described below with reference to the drawings. It should be understood that the specific embodiments given herein are intended for explanatory purposes only and are not intended to limit the scope of the present application.
[0036] As shown in Figure 1, as one embodiment of the method of the present application for a slave communication device to discover, the method is used for a slave communication device to discover in a communication system, the communication system comprising one master communication device, one or more slave communication devices, and a communication link, wherein the master communication device can be selectively connected to a host computer, and the rest of the communication devices are slave communication devices, and the slave communication devices can be selectively connected to external devices. The communication devices are connected in a chain topology, the master communication device is connected to a first slave communication device (slave communication device 1) through the communication link, the first slave communication device (slave communication device 1) is connected to a second slave communication device (slave communication device 2) through the communication link, the second slave communication device (slave communication device 2) is connected to a third slave communication device (slave communication device 3) through the communication link, and so on, until the last slave communication device (slave communication device n) is connected to the last but one slave communication device (slave communication device n-1) through the communication link.
[0037] In the present application, the slave communication devices are divided into end slave communication devices and non-end slave communication devices, the last slave communication device is called an end slave communication device, and the slave communication devices other than the end slave communication device are called non-end slave communication devices.
[0038] The direction from the master communication device to the slave communication device is called downstream direction, and the direction from the slave communication device to the master communication device is called upstream direction. For a specified communication device, the communication device connected through a communication link in the downstream direction is called the downstream device of the specified communication device, and the communication link is called the downstream link of the specified communication device. For a specified communication device, the communication device connected through a communication link in the upstream direction is called the upstream device of the specified communication device, and the communication link is called the upstream link of the specified communication device.
[0039] The master communication device has no upstream device and upstream link, but has downstream device and downstream link, and the downstream device is a slave communication device. The slave communication device has no downstream device and downstream link, but has upstream device and upstream link, and the upstream device can be a master communication device or a slave communication device. If there is no non-end slave communication device, the upstream device is a master communication device. If there is a non-end slave communication device, the upstream device is a slave communication device. The non-end slave communication device has both upstream device and upstream link, and downstream device and downstream link, and the upstream device can be a master communication device or a slave communication device, and the downstream device is a slave communication device.
[0040] A communication link is the downstream link of a communication device connected in the upstream direction, and a communication link is the upstream link of a communication device connected in the downstream direction.
[0041] In the present application, the slave communication device includes a device address, and the slave communication device has a default device address after power-on. The master communication device discovers the slave communication device by sending a discovery frame, and configures the device address of the slave communication device.
[0042] Fig. 2 is a structure of a discovery frame in the present application, which includes a discovery frame header and a device ID. The slave communication device receiving the discovery frame uses the discovery frame header to identify the discovery frame. The use of the device ID will be described in detail below.
[0043] Fig. 3 is another structure of a discovery frame in the present application, which includes a discovery frame header, a device ID and a maximum device ID to be discovered. The slave communication device receiving the discovery frame uses the discovery frame header to identify the discovery frame. The use of the device ID and the maximum device ID to be discovered will be described in detail below.
[0044] The present application does not limit whether the default device address of the slave communication device is the same as the device ID in the discovery frame, but in the preferred embodiment of the present application, the default device address of the slave communication device is different from the device ID in the discovery frame, for example, the default device address of the slave communication device is 0, and the device ID in the discovery frame is an integer greater than 0.
[0045] In the present application, the master communication device sends a discovery frame in its downlink, the discovery frame contains a device ID, the slave communication device receives the discovery frame from its uplink, and sets the device address of the slave communication device as the device ID in the received discovery frame. The slave communication device selectively forwards the received discovery frame in its downlink, and replaces the device ID in the forwarded discovery frame with a different device ID from the device ID in the received discovery frame. When the slave communication device replaces the device ID in the forwarded discovery frame with a different device ID from the device ID in the received discovery frame, the replacement rule or method can be based on certain rules or methods, and the present application does not limit the replacement rule or method. Any replacement rule or method is within the protection scope of the present application. For the convenience of description, in the following description of the present application, when the slave communication device forwards the received discovery frame, the device ID in the forwarded discovery frame is replaced with the device ID in the received discovery frame plus 1 。
[0046] As shown in FIG. 4, in one application embodiment of the present application, the master communication device sends a discovery frame in its downlink, the discovery frame contains a device ID, the device ID is 1, the slave communication device 1 receives the discovery frame from its uplink, and sets the device address of the slave communication device 1 as the device ID (the device ID is 1) in the received discovery frame. The slave communication device 1 selectively forwards the received discovery frame in its downlink, and replaces the device ID in the forwarded discovery frame with the device ID in the received discovery frame plus 1, i.e., the device ID in the forwarded discovery frame is replaced with 2.
[0047] If the slave communication device 1 forwards the discovery frame (the device ID is replaced with 2) in its downlink, the slave communication device 2 receives the discovery frame from its uplink, and sets the device address of the slave communication device 2 as the device ID (the device ID is 2) in the received discovery frame. The slave communication device 2 selectively forwards the received discovery frame in its downlink, and replaces the device ID in the forwarded discovery frame with the device ID in the received discovery frame plus 1, i.e., the device ID in the forwarded discovery frame is replaced with 3.
[0048] In other application embodiments of the present application, the device ID in the discovery frame sent by the master communication device in its downlink can also not be 1, and the present application does not limit the device ID in the discovery frame sent by the master communication device in its downlink.
[0049] In one application embodiment of the present application, the slave communication device selectively forwards the received discovery frame in its downlink and replaces the device ID in the forwarded discovery frame with a device ID different from the device ID in the received discovery frame using the discovery frame structure shown in Fig. 2 or Fig. 3, including: if the slave communication device is not a terminal slave communication device, the slave communication device forwards the received discovery frame in its downlink and replaces the device ID in the forwarded discovery frame with a device ID different from the device ID in the received discovery frame; and if the slave communication device is a terminal slave communication device, the slave communication device generates a discovery response frame and sends the discovery response frame in its uplink.
[0050] As a communication system of the present embodiment, as shown in Fig. 5, if the slave communication device 1 is not a terminal slave communication device, the slave communication device 1 receives a discovery frame (device ID is 1) from its uplink, sets its device address to the device ID in the received discovery frame (device ID is 1), forwards the received discovery frame in its downlink, and replaces the device ID in the forwarded discovery frame with the device ID in the received discovery frame plus 1, i.e., the device ID in the forwarded discovery frame is replaced with 2; and if the slave communication device 2 is a terminal slave communication device, the slave communication device 2 receives a discovery frame (device ID is 2) from its uplink, sets its device address to the device ID in the received discovery frame (device ID is 2), generates a discovery response frame, and sends the discovery response frame in its uplink to the slave communication device 1.
[0051] The present application does not limit how the slave communication device judges whether it is a terminal slave communication device, in one embodiment, the slave communication device is an integrated circuit chip, and the slave communication device can judge whether it is a terminal slave communication device according to the state of the level of the pin of the integrated circuit chip.
[0052] In another application embodiment of the present application, the slave communication device selectively forwards the received discovery frame in its downlink and replaces the device ID in the forwarded discovery frame with a device ID different from the device ID in the received discovery frame using the discovery frame structure shown in Fig. 2 or Fig. 3, including: if the downstream device of the slave communication device is ready, the slave communication device forwards the received discovery frame in its downlink and replaces the device ID in the forwarded discovery frame with a device ID different from the device ID in the received discovery frame; and if the downstream device of the slave communication device is not ready, the slave communication device generates a discovery response frame and sends the discovery response frame in its uplink.
[0053] As a communication system of the embodiment, as shown in Fig. 6, if the slave device of the slave device 1 is ready from the slave device 2, after the slave device 1 receives a discovery frame (device ID is 1) from its uplink, it sets its device address as the device ID (device ID is 1) in the received discovery frame, forwards the received discovery frame in its downlink, and replaces the device ID in the forwarded discovery frame with the device ID in the received discovery frame plus 1, i.e. the device ID in the forwarded discovery frame is replaced with 2; if the slave device of the slave device 2 is not ready from the slave device 3, after the slave device 2 receives a discovery frame (device ID is 2) from its uplink, it sets its device address as the device ID (device ID is 2) in the received discovery frame, generates a discovery response frame and sends the discovery response frame to the slave device 1 in its uplink.
[0054] The application does not limit how the slave device judges whether its downstream device is ready or not, in one embodiment, the slave device can judge whether its downstream device is ready or not according to whether it can send and receive data in its downlink, in another embodiment (as described below), the slave device can also judge whether its downstream device is ready or not according to whether it successfully performs link training in its downlink.
[0055] In another application embodiment of the application, the discovery frame structure shown in Fig. 2 or Fig. 3 is adopted, and the slave device selectively forwards the received discovery frame in its downlink and replaces the device ID in the forwarded discovery frame with a device ID different from that in the received discovery frame, including: if the slave device's downstream device is ready, the slave device forwards the received discovery frame in its downlink and replaces the device ID in the forwarded discovery frame with a device ID different from that in the received discovery frame; if the slave device's downstream device is not ready, the slave device initiates link training in its downlink to the downstream device. Through link training, the communication device can adjust circuit parameters, so as to perform data transmission with better performance.
[0056] The application does not limit how to perform link training. As one embodiment of the application, link training is performed between the master communication device and the slave communication device 1 as shown in FIG. 8. The master communication device is connected to the slave communication device 1 through a communication link. The communication link between the master communication device and the slave communication device 1 is the downlink of the master communication device and the uplink of the slave communication device 1. The link training can include that the master communication device sends a downlink training sequence in its downlink, the slave communication device 1 receives the downlink training sequence, and after receiving the downlink training sequence, the master communication device sends an uplink training sequence in its uplink. The slave communication device 1 adjusts its receiving circuit parameters when receiving the downlink training sequence, so as to receive data sent by the master communication device with better performance. The master communication device adjusts its receiving circuit parameters when receiving the uplink training sequence, so as to receive data sent by the slave communication device 1 with better performance. If the slave communication device 1 does not successfully receive the downlink training sequence, the slave communication device 1 does not send the uplink training sequence. After successfully receiving the uplink training sequence, the master communication device can consider that the link training is successful and its downstream device (the slave communication device 1) is ready. If the slave communication device 1 does not send the uplink training sequence, or the slave communication device 1 sends the uplink training sequence but the master communication device does not successfully receive, the master communication device can consider that the link training is not successful and its downstream device (the slave communication device 1) is not ready.
[0057] In the application, link training can also be performed between the master communication device and the slave communication device 1. As another embodiment of the application, link training is performed between the master communication device and the slave communication device 1 as shown in FIG. 8. The master communication device is connected to the slave communication device 1 through a communication link. The communication link between the master communication device and the slave communication device 1 is the downlink of the master communication device and the uplink of the slave communication device 1. The link training can include that the master communication device sends a downlink training sequence in its downlink, the slave communication device 1 receives the downlink training sequence, and after receiving the downlink training sequence, the master communication device sends an uplink training sequence in its uplink. The slave communication device 1 adjusts its receiving circuit parameters when receiving the downlink training sequence, so as to receive data sent by the master communication device with better performance. The master communication device adjusts its receiving circuit parameters when receiving the uplink training sequence, so as to receive data sent by the slave communication device 1 with better performance. If the slave communication device 1 does not successfully receive the downlink training sequence, the slave communication device 1 does not send the uplink training sequence. After successfully receiving the uplink training sequence, the master communication device can consider that the link training is successful and its downstream device (the slave communication device 1) is ready. If the slave communication device 1 does not send the uplink training sequence, or the slave communication device 1 sends the uplink training sequence but the master communication device does not successfully receive, the master communication device can consider that the link training is not successful and its downstream device (the slave communication device 1) is not ready.
[0058] The downlink training sequence or the uplink training sequence is generally composed of a random sequence and can also be line coded. The present application does not limit how to generate the downlink training sequence or the uplink training sequence, how to determine whether the downlink training sequence is successfully received by the communication device, how to determine whether the uplink training sequence is successfully received by the master communication device or the slave communication device.
[0059] As a communication system of the present embodiment, as shown in FIG. 9, if the slave device of the communication device 1 is ready from the communication device 2, after the communication device 1 receives the discovery frame (device ID is 1) from its uplink, it sets its device address as the device ID in the received discovery frame (device ID is 1), forwards the received discovery frame in its downlink, and replaces the device ID in the forwarded discovery frame with the device ID in the received discovery frame plus 1, i.e. the device ID in the forwarded discovery frame is replaced with 2; if the slave device of the communication device 2 is not ready from the communication device 3, after the communication device 2 receives the discovery frame (device ID is 2) from its uplink, it sets its device address as the device ID in the received discovery frame (device ID is 2), and initiates the link training to the slave device 3 in its downlink.
[0060] In the present application, after the slave communication device initiates the link training to the downstream device in its downlink, it can further determine whether to forward the received discovery frame in its downlink according to the link training result. If the link training is successful, the slave communication device forwards the received discovery frame in its downlink, and replaces the device ID in the forwarded discovery frame with a device ID different from that in the received discovery frame; if the link training is not successful, the slave communication device generates a discovery response frame and sends the discovery response frame in its uplink.
[0061] In the present embodiment, after the slave communication device 2 receives the discovery frame (device ID is 2) from its uplink in FIG. 9, it sets its device address as the device ID in the received discovery frame (device ID is 2), initiates the link training to the slave device 3 in its downlink, if the link training is successful, the slave communication device 2 forwards the received discovery frame in its downlink, and replaces the device ID in the forwarded discovery frame with the device ID in the received discovery frame plus 1, i.e. the device ID in the forwarded discovery frame is replaced with 3; if the link training is not successful, the slave communication device 2 generates a discovery response frame and sends the discovery response frame in its uplink to the slave device 1.
[0062] In another application embodiment of the present application, the slave communication device selectively forwards the received discovery frame in its downlink and replaces the device ID in the forwarded discovery frame with a device ID different from the device ID in the received discovery frame, using the discovery frame structure shown in FIG. 2 or FIG. 3, including: if the slave communication device is not a terminal slave communication device and the downstream device of the slave communication device is ready, the slave communication device forwards the received discovery frame in its downlink and replaces the device ID in the forwarded discovery frame with a device ID different from the device ID in the received discovery frame; if the slave communication device is a terminal slave communication device or the downstream device of the slave communication device is not ready, the slave communication device generates a discovery response frame and sends the discovery response frame in its uplink.
[0063] As the communication system of the present embodiment, as shown in FIG. 5 and FIG. 6, if the slave communication device 1 is not a terminal slave communication device and the downstream device of the slave communication device 1, the slave communication device 2, is ready, the slave communication device 1, after receiving the discovery frame (device ID is 1) in its uplink, sets its device address to the device ID in the received discovery frame (device ID is 1), forwards the received discovery frame in its downlink and replaces the device ID in the forwarded discovery frame with the device ID in the received discovery frame plus 1, i.e. the device ID in the forwarded discovery frame is replaced with 2; if the slave communication device 2 is a terminal slave communication device as in FIG. 5 or the downstream device of the slave communication device 2, the slave communication device 3, is not ready as in FIG. 6, the slave communication device 2, after receiving the discovery frame (device ID is 2) in its uplink, sets its device address to the device ID in the received discovery frame (device ID is 2), generates a discovery response frame and sends the discovery response frame in its uplink to the slave communication device 1.
[0064] In another application embodiment of the present application, the slave communication device selectively forwards the received discovery frame in its downlink and replaces the device ID in the forwarded discovery frame with a device ID different from the device ID in the received discovery frame, using the discovery frame structure shown in FIG. 2 or FIG. 3, including: if the slave communication device is not a terminal slave communication device and the downstream device of the slave communication device is ready, the slave communication device forwards the received discovery frame in its downlink and replaces the device ID in the forwarded discovery frame with a device ID different from the device ID in the received discovery frame; if the slave communication device is not a terminal slave communication device and the downstream device of the slave communication device is not ready, the slave communication device initiates link training in its downlink to the downstream device; if the slave communication device is a terminal slave communication device, the slave communication device generates a discovery response frame and sends the discovery response frame in its uplink.
[0065] As the communication system of the embodiment, as shown in FIG. 5 and FIG. 9, if the slave communication device 1 is not the terminal slave communication device, and the downstream device of the slave communication device 1 is the slave communication device 2, after the slave communication device 1 receives the discovery frame (the device ID is 1) from its uplink, it sets its device address as the device ID (the device ID is 1) in the received discovery frame, forwards the received discovery frame in its downlink, and replaces the device ID in the forwarded discovery frame with the device ID in the received discovery frame plus 1, i.e. the device ID in the forwarded discovery frame is replaced with 2; as shown in FIG. 9, if the slave communication device 2 is not the terminal slave communication device, and the downstream device of the slave communication device 2 is the slave communication device 3, after the slave communication device 2 receives the discovery frame (the device ID is 2) from its uplink, it sets its device address as the device ID (the device ID is 2) in the received discovery frame, initiates the link training in its downlink to the slave communication device 3 (the method of initiating the link training from the slave communication device to the downstream device is described above); as shown in FIG. 5, if the slave communication device 2 is the terminal slave communication device, after the slave communication device 2 receives the discovery frame (the device ID is 2) from its uplink, it sets its device address as the device ID (the device ID is 2) in the received discovery frame, generates the discovery response frame and sends the discovery response frame in its uplink to the slave communication device 1.
[0066] In another application embodiment of the present application, if the device ID in the discovery frame received by the slave communication device is greater than or equal to the maximum device ID to be discovered in the discovery frame, the slave communication device generates the discovery response frame and sends the discovery response frame in its uplink; if the device ID in the discovery frame received by the slave communication device is less than the maximum device ID to be discovered in the discovery frame, the slave communication device can further determine whether to forward the received discovery frame in its downlink according to the above method.
[0067] As a communication system of the embodiment, as shown in Fig. 10, the device ID in the discovery frame sent by the master communication device is 1, and the maximum device ID to be discovered is 2. After the slave communication device 1 receives the discovery frame (the device ID is 1, and the maximum device ID to be discovered is 2) from its uplink, it sets its device address to the device ID in the received discovery frame (the device ID is 1). Since the device ID in the discovery frame is less than the maximum device ID to be discovered, and the slave communication device 1 is not the terminal slave communication device, and the slave communication device 2 downstream of the slave communication device 1 is ready, the slave communication device 1 forwards the received discovery frame in its downlink, and replaces the device ID in the forwarded discovery frame with the device ID in the received discovery frame plus 1, i.e. the device ID in the forwarded discovery frame is replaced with 2. The slave communication device 2 receives the discovery frame (the device ID is 2, and the maximum device ID to be discovered is 2) from its uplink, and sets its device address to the device ID in the received discovery frame (the device ID is 2). Since the device ID in the discovery frame is equal to the maximum device ID to be discovered (both are 2), the slave communication device 2 generates a discovery response frame and sends the discovery response frame to the slave communication device 1 in its uplink.
[0068] In an application embodiment of the application, the slave communication device n is connected to the slave communication device n+1 through a communication link. The communication link connecting the slave communication device n and the slave communication device n+1 is the downlink of the slave communication device n and is also the uplink of the slave communication device n+1. After the slave communication device n receives a discovery frame from its uplink, it sets its device address to the device ID in the received discovery frame (referred to as the original device ID). When the slave communication device n forwards the received discovery frame in its downlink, it replaces the device ID in the forwarded discovery frame with a device ID different from the device ID in the received discovery frame (the replaced device ID is referred to as the new device ID). After the slave communication device n+1 receives a discovery frame from its uplink, it sets its device address to the device ID in the received discovery frame (the new device ID). At this time, the device address of the slave communication device n (the original device ID) is different from the device address of the slave communication device n+1 (the new device ID). Therefore, if an upstream device of a specified slave communication device is the slave communication device, when the device address of the specified slave communication device is set to the device ID in the received discovery frame, the device address of the specified slave communication device is different from the device address of its upstream device.
[0069] However, the present application is not limited to the case where the slave device address of the slave communication device is different from all other slave device addresses in the upstream direction thereof after the slave device address of the slave communication device is set as the device ID in the received discovery frame. Although the present application is not limited to this case, in a preferred embodiment of the present application, the slave device address of the slave communication device is different from all other slave device addresses in the upstream direction thereof after the slave device address of the slave communication device is set as the device ID in the received discovery frame. In this embodiment, the slave device addresses of the slave communication devices are different from each other for the slave communication devices whose device addresses have been set as the device ID in the received discovery frame.
[0070] As a communication system of this embodiment, as shown in FIG. 11, the master communication device transmits a discovery frame (device ID: k) in the downstream link thereof, the slave communication device 1 receives the discovery frame (device ID: k) in the upstream link thereof, sets the device address of the slave communication device 1 as the device ID (device ID: k) in the received discovery frame, and forwards the received discovery frame (device ID: k+1) in the downstream link thereof. The remaining slave communication devices are similarly processed, and the slave communication device n receives the discovery frame (device ID: k+n-1) in the upstream link thereof, sets the device address of the slave communication device n as the device ID (device ID: k+n-1) in the received discovery frame, at which time the device address of the slave communication device n is different from all other slave device addresses in the upstream direction thereof, and the device addresses of the slave communication devices 1, 2,..., n are different from each other.
[0071] FIG. 12 is a structure of a discovery response frame according to the present application. The discovery response frame includes a discovery response frame header and a device ID. The discovery response frame header is used by a communication device receiving the discovery response frame to identify the discovery response frame, and the device ID includes the device address of the slave communication device that generated the discovery response frame. The slave communication device receives the discovery response frame in the downstream link thereof and forwards the received discovery response frame in the upstream link thereof. The master communication device receives the discovery response frame in the downstream link thereof, and if the master communication device does not receive the discovery response frame within a predetermined time after transmitting the discovery frame, the master communication device records a timeout.
[0072] As the communication system of the embodiment, as shown in FIG. 5, FIG. 6 and FIG. 10, since the device address of the slave communication device generating the discovery response frame is 2, the device ID contained in the discovery response frame is 2. After the slave communication device 1 receives the discovery response frame (device ID is 2) from its downlink, it forwards the received discovery response frame to the master communication device through its uplink, and the master communication device receives the discovery response frame (device ID is 2) from its downlink. If the master communication device receives the discovery response frame within the preset time after sending the discovery frame, the master communication device records the device ID (device ID is 2) contained in the discovery response frame; if the master communication device does not receive the discovery response frame within the preset time after sending the discovery frame, the master communication device records a timeout.
[0073] The above merely describes the preferred embodiments of the present application, but the protection scope of the present application is not limited thereto, and any person skilled in the art should understand that the changes, modifications, replacements and variations of the above embodiments within the technical scope disclosed by the present application should be covered within the protection scope of the present application.
Claims
1. A method for discovering slave communication devices in a communication system, the communication system comprising a master communication device, one or more slave communication devices, and communication links, wherein: the master communication device transmits a discovery frame in its downlink, the discovery frame comprising a device ID; the slave communication device receives the discovery frame in its uplink, and sets a device address of the slave communication device as the device ID in the received discovery frame; and the slave communication device selectively forwards the received discovery frame in its downlink, and replaces the device ID in the forwarded discovery frame with a device ID different from the device ID in the received discovery frame.
2. The method of claim 1, wherein: the slave communication device selectively forwards the received discovery frame in its downlink, and replaces the device ID in the forwarded discovery frame with a device ID different from the device ID in the received discovery frame, comprises: if the slave communication device is not a terminal slave communication device, the slave communication device forwards the received discovery frame in its downlink, and replaces the device ID in the forwarded discovery frame with a device ID different from the device ID in the received discovery frame; and if the slave communication device is a terminal slave communication device, the slave communication device generates a discovery response frame and transmits the discovery response frame in its uplink.
3. The method of claim 1, wherein: the slave communication device selectively forwards the received discovery frame in its downlink, and replaces the device ID in the forwarded discovery frame with a device ID different from the device ID in the received discovery frame, comprises: if a downstream device of the slave communication device is ready, the slave communication device forwards the received discovery frame in its downlink, and replaces the device ID in the forwarded discovery frame with a device ID different from the device ID in the received discovery frame; and if the downstream device of the slave communication device is not ready, the slave communication device generates a discovery response frame and transmits the discovery response frame in its uplink.
4. The method of claim 1, wherein: the slave communication device selectively forwards the received discovery frame in its downlink, and replaces the device ID in the forwarded discovery frame with a device ID different from the device ID in the received discovery frame, comprises: if a downstream device of the slave communication device is ready, the slave communication device forwards the received discovery frame in its downlink, and replaces the device ID in the forwarded discovery frame with a device ID different from the device ID in the received discovery frame; and if the downstream device of the slave communication device is not ready, the slave communication device initiates a link training to the downstream device in its downlink.
5. The method of claim 1, wherein: The slave communication device selectively forwards the received discovery frame on its downlink and replaces the device ID in the forwarded discovery frame with a device ID different from the device ID in the received discovery frame, including: if the slave communication device is not a terminal slave communication device and a downstream device of the slave communication device is ready, the slave communication device forwards the received discovery frame on its downlink and replaces the device ID in the forwarded discovery frame with a device ID different from the device ID in the received discovery frame; if the slave communication device is not a terminal slave communication device and a downstream device of the slave communication device is not ready, the slave communication device initiates link training on its downlink to the downstream device; and if the slave communication device is a terminal slave communication device, the slave communication device generates a discovery response frame and sends the discovery response frame on its uplink.
6. The method of claim 1, wherein: The slave communication device selectively forwards the received discovery frame on its downlink and replaces the device ID in the forwarded discovery frame with a device ID different from the device ID in the received discovery frame, including: if the slave communication device is not a terminal slave communication device and a downstream device of the slave communication device is ready, the slave communication device forwards the received discovery frame on its downlink and replaces the device ID in the forwarded discovery frame with a device ID different from the device ID in the received discovery frame; if the slave communication device is not a terminal slave communication device and a downstream device of the slave communication device is not ready, the slave communication device initiates link training on its downlink to the downstream device; and if the slave communication device is a terminal slave communication device, the slave communication device generates a discovery response frame and sends the discovery response frame on its uplink.
7. The method of claim 1, wherein: The discovery frame further comprises a maximum device ID to be discovered, If the device ID in the discovery frame received by the slave communication device is greater than or equal to the maximum device ID to be discovered in the discovery frame, the slave communication device generates a discovery response frame and sends the discovery response frame on its uplink.
8. The method of claim 2, 3, 5, 6 or 7, wherein: The discovery response frame comprises a device ID, which is the device address of the slave communication device that generates the discovery response frame.
9. The method of claim 2, 3, 5, 6 or 7, wherein: The slave communication device receives the discovery response frame on its downlink and forwards the received discovery response frame on its uplink.
10. The method of claim 2, 3, 5, 6 or 7, wherein: The master communication device receives the discovery response frame on its downlink, If the master communication device does not receive the discovery response frame within a preset time after sending the discovery frame, the master communication device records a timeout.
11. The method of claim 4 or 6, wherein: The slave communication device initiates link training with a downstream device on its downlink. If the link training is successful, the slave communication device forwards the received discovery frame on its downlink and replaces the device ID in the forwarded discovery frame with a device ID different from that in the received discovery frame. If the link training is not successful, the slave communication device generates a discovery response frame and sends the discovery response frame on its uplink.
12. The method of claim 1, wherein: The slave communication device selectively forwards the received discovery frame on its downlink and replaces the device ID in the forwarded discovery frame with a device ID different from that in the received discovery frame, including: the slave communication device selectively forwards the received discovery frame on its downlink and replaces the device ID in the forwarded discovery frame with the device ID in the received discovery frame plus 1.
13. The method of claim 1, wherein: After the device address of the slave communication device is set to the device ID in the received discovery frame, the device address of the slave communication device is different from the device addresses of all other slave communication devices in the uplink direction of the slave communication device.
Citation Information
Patent Citations
Method for automatically allocating RS485 slave device addresses
CN111371659A
Method for discovering slave communication equipment
CN119402538A
Apparatus for master-slave communicating and methodthereof
KR1020020033290A
Methods for Discovery, Configuration, and Coordinating Data Communications Between Master and Slave Devices in a Communication System
US20130124763A1
Communication device capable of multi-path data transmission, data communication network system and data communication method
WO2019201189A1