Master and slave data transmission method, master and slave interface circuit

By optimizing the command frame and data frame structure of the master-slave communication system, reducing address information transmission, improving data transmission efficiency and accuracy, and solving the data transmission problem in AI cluster control scenarios.

CN123178336APending Publication Date: 2026-11-27CORE TREND (ZHUHAI) TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611658404.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-10-26
Publication Date
2026-11-27

AI Technical Summary

Technical Problem

Existing serial bus communication methods are inefficient in AI cluster control scenarios during continuous read and write operations, resulting in data transmission failure to meet requirements. Furthermore, the lengthy frame structure leads to bandwidth waste and high data parsing overhead.

Method used

A new structure of command frames and data frames is adopted. The command frame contains the target address and the number of data frames. Data frames are sent continuously. The data frames do not contain flag bits or address information. Verification is used to ensure the accuracy of data transmission, thereby optimizing link quality and data transmission efficiency.

Benefits of technology

It improves data transmission efficiency, reduces the amount of address information transmitted, ensures the accuracy and speed of data transmission, and meets the needs of AI cluster control scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123178336A_ABST
    Figure CN123178336A_ABST
Patent Text Reader

Abstract

The application provides a master device and slave device data transmission method, a master device and slave device interface circuit, the master device data transmission method comprises the following steps: sending a command frame to the slave device, the command frame containing target address information and the target number of continuous transmission data frames; if the command frame represents that the current read-write operation is continuous data writing to the slave device, continuously sending the target number of data frames to the slave device; if the command frame represents that the current read-write operation is continuous data reading from the slave device, obtaining the target number of data frames continuously sent by the slave device; wherein the data frame is composed of data to be transmitted, and the data frame does not include the identification and target address information of the slave device. The application also provides a master device interface circuit for implementing the above method, and a slave device data transmission method and a slave device interface circuit for implementing the method. The application can improve the data transmission efficiency of the master-slave communication system and meet the demand for high-speed data transmission in the AI cluster scenario.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the technical field of data transmission in a master-slave communication system. Specifically, it relates to a master device data transmission method and a slave device data transmission method in a master-slave communication system, as well as a master device interface circuit and a slave device interface circuit that apply this method. Background Technology

[0002] In server systems and various electronic devices, communication between different chips within a circuit board is typically achieved using a serial bus protocol. Among these, UART, I... 2 C and SPI are the three most widely used serial communication protocols. SPI (Serial Peripheral Interface) is a high-speed, full-duplex bus protocol introduced by Motorola. With its simple structure, high transmission rate, and support for multiple device connections, it occupies an important position in short-distance inter-chip communication. In server systems containing data exchange switches, the aforementioned serial bus protocols are also widely used for low-speed communication and configuration management between chips within the board.

[0003] Low-speed communication buses are widely used in server systems. Taking a server's network interface card as an example, the control chip (MAC chip) and the physical layer chip (PHY chip) are typically connected via a communication bus. The control chip can flexibly configure the operating mode of the physical layer chip using this communication interface bus, including Ethernet communication speed and full-duplex mode. Simultaneously, the control chip can also obtain real-time link status information of the physical layer chip through this bus, such as whether a network connection has been established and link stability. In the application scenario of data program-controlled exchanges, the above configuration and status acquisition processes place higher demands on the reliability and real-time performance of the communication bus.

[0004] For server motherboards with multiple network ports, a single control chip often needs to manage multiple physical layer chips. In this case, the multi-device connectivity capabilities of a low-speed communication bus are fully utilized, allowing simultaneous connection of multiple physical layer chips to meet the management needs of multiple ports in complex server network architectures. This multi-device management requirement is particularly prominent in data exchange switches, where efficient addressing and configuration of multiple physical layer chips must be achieved with limited bus resources. In large-scale server clusters in data centers, the low-speed communication bus ensures the accurate configuration and stable operation of each server's network interface, laying the foundation for high-speed and reliable data transmission.

[0005] However, as server network architectures become increasingly complex, especially with the continuous development of data program-controlled switches towards high density and multiple ports, higher requirements are placed on the reliability, real-time performance, and multi-device management capabilities of inter-chip communication within the board.

[0006] For scenarios involving the management of multiple physical layer chips, a novel master-slave communication system employs a new communication method. The control chip connects to multiple physical layer chips via the same clock and data transmission lines. The control chip outputs a clock signal, and the target device address, target operation address, and response result are sequentially exchanged according to a preset timing frame format before data operations are performed on the target physical layer chip. This communication method simplifies the communication line to two signal lines and uses a unified timing frame format for addressing, acknowledgment, and data operations, thus balancing transmission speed and communication reliability.

[0007] The existing data transmission scheme still communicates in a complete data frame format. For example, when the physical layer chip receives data and parses the data, it first parses out the frame structure and then identifies the received data based on the parsed data structure to identify which data is the specific data content. This results in a single data packet containing a large amount of data used to represent various flags or addresses, causing a significant waste of bandwidth.

[0008] This existing communication method is mainly used in traditional Ethernet communication systems. Because traditional Ethernet systems have lower data transmission rates, they place greater emphasis on data transmission accuracy. Therefore, this existing method primarily considers data transmission accuracy. Since each data frame contains a complete frame structure, the physical layer chip, after receiving the data, parses the frame format to obtain accurate address information and writes the data to the corresponding address, thus minimizing the risk of data being written to the wrong address.

[0009] However, with the rapid development of artificial intelligence technology, AI cluster control technology has placed very high demands on data transmission efficiency. In particular, in online upgrade scenarios, the requirements for data transmission time are very stringent. Under existing communication methods, each frame of data adopts a lengthy frame structure, which requires traversal one by one during addressing. Furthermore, frame-by-frame transmission is still required during continuous read and write operations, resulting in large auxiliary frame overhead and making it difficult to meet the needs of AI cluster control scenarios in terms of communication efficiency.

[0010] In AI cluster control scenarios, most communication between the control chip and the physical layer chip involves continuous read and write operations. Because existing communication methods still require each frame of data to contain a frame structure for continuous read and write operations, each frame of data needs to be parsed to obtain the specific data written to memory or read from memory. This results in the need to transmit a large number of flags or addresses. Therefore, existing data transmission methods cannot meet the requirements for continuous data read and write in AI cluster control scenarios. Summary of the Invention

[0011] The first objective of this invention is to provide a master device data transmission method in a master-slave communication system that can improve data transmission efficiency during continuous read and write operations.

[0012] The second objective of this invention is to provide a slave device data transmission method in a master-slave communication system that can improve data transmission efficiency during continuous read and write operations.

[0013] A third objective of this invention is to provide a master device interface circuit for implementing the master device data transmission method in the master-slave communication system described above.

[0014] A fourth objective of this invention is to provide a slave device interface circuit for implementing the slave device data transmission method in the master-slave communication system described above.

[0015] To achieve the first objective of this invention, the master device data transmission method provided by this invention includes sending a command frame to a slave device, the command frame containing target address information and a target number of consecutively transmitted data frames; if the command frame indicates that the current read / write operation is to continuously write data to the slave device, then the target number of data frames are continuously sent to the slave device; if the command frame indicates that the current read / write operation is to continuously read data from the slave device, then the target number of data frames continuously sent by the slave device are obtained; after multiple consecutive data frames have been transmitted, the transmitted data is verified, and if the verification fails, the data frames are retransmitted; wherein, the data frame consists of the data to be transmitted, and the data frame does not include the slave device's identifier and target address information.

[0016] As can be seen from the above scheme, when continuously transmitting multiple data frames, the master device only needs to send one command frame first, and then the master or slave device continuously sends multiple data frames. Each data frame contains only the data to be transmitted and does not include flag bits, slave device identifiers, address information, etc., thus avoiding the transmission of a large amount of address information through the bus and improving the data transmission efficiency when continuously reading and writing multiple data frames. Since the command frame contains the target address information and the target number of data frames to be continuously transmitted, the position of the first data frame can be determined based on the target address information during continuous reading and writing, and the target number of data frames to be continuously read and written in the current read and write operation can also be determined, thereby ensuring the accuracy of data reading and writing.

[0017] Furthermore, this invention verifies the data after multiple consecutive data frames have been transmitted to determine the accuracy of the data transmission. This improves data transmission efficiency while ensuring data transmission accuracy, achieving a balance between data transmission rate and accuracy.

[0018] A preferred approach is that after the master device sends a command frame to the slave device, it determines whether the actual number of continuously transmitted data frames received is not less than the target number recorded in the command frame. If the actual number is not less than the target number, then the number of data frames is confirmed to be normal.

[0019] Therefore, by monitoring the number of actual received data frames, when the number of actual received data frames is insufficient, it can be confirmed that there is data loss, thereby issuing a message that the number of data frames is abnormal, thus prompting the data sending device to perform a data retransmission operation.

[0020] A preferred approach is to receive only the data frames that are transmitted earlier and equal to the target number, if the actual number is greater than the target number.

[0021] Therefore, when the actual number of received data frames exceeds the target number, by only receiving the first data frames that equal the target number and discarding the other data frames that arrive later, we can avoid receiving too much erroneous data. The accuracy of data transmission can also be ensured by verifying the received data through subsequent verification operations.

[0022] A further approach is to continuously send a preset number of detection frames to the slave device before sending the command frame, and determine whether the slave device responds correctly to the detection frames. If the slave device responds correctly to the detection frames, it is confirmed that the link between the master device and the slave device has been established.

[0023] Therefore, before sending a command frame, it is necessary to ensure that the communication link between the master device and the slave device has been established, so as to ensure that the slave device can correctly receive the command frame sent by the master device.

[0024] A further approach is to continuously send registration request frames to the slave device before sending the command frame, and to receive the maximum number of data frames for continuous read / write operations returned by the slave device.

[0025] Therefore, before the master device sends a command frame, each slave device sends a maximum number of consecutive read / write data frames to the master device. This ensures that the target number of data frames for a single consecutive read / write operation by the master device when sending a command frame must not exceed this maximum number, thereby ensuring that all data can be read and written correctly.

[0026] A further approach involves having two or more slave devices; before sending a command frame, sending test frames to multiple slave devices and receiving response frames from multiple slave devices; determining the link quality of each slave device based on the response frames; and marking low-quality slave devices whose link quality is below the link quality threshold.

[0027] A further approach is to send data frames to multiple slave devices, and then resend the data frames to the low-quality slave device.

[0028] Therefore, the master device monitors the link quality of each slave device. For low-quality slave devices, point-to-point data retransmission is required to ensure that low-quality slave devices can also accurately receive data frames, thereby improving the accuracy of data transmission.

[0029] A further approach is to send data frames to multiple slave devices, then send an end frame to multiple slave devices, and receive the verification results returned by the slave devices.

[0030] Therefore, after communication with all slave devices ends, the master device notifies the multiple slave devices of the end of the communication by sending an end frame. Each slave device then performs a data verification operation, sends the verification result, and enters idle mode, waiting for the next data read / write operation to avoid being in a read / write state for an extended period. While in idle mode, slave devices can also perform other tasks and listen for the next command frame.

[0031] To achieve the second objective mentioned above, the slave device data transmission method provided by the present invention includes: receiving a command frame sent by a master device, the command frame containing target address information and a target number of consecutively transmitted data frames; if the command frame indicates that the current read / write operation is continuous data writing, then receiving multiple consecutively transmitted data frames from the master device, and sequentially writing the data of the multiple data frames into the storage space corresponding to the target address information; if the command frame indicates that the current read / write operation is continuous data reading, then obtaining multiple consecutive data frames from the corresponding storage space according to the target address information and forming a data frame to be sent to the master device; wherein, the data frame consists of data to be transmitted, and the data frame does not include slave device identifier and target address information.

[0032] As can be seen from the above scheme, after the master device sends a command frame, it can send multiple consecutive data frames to the slave device, or the slave device can send multiple consecutive data frames. Since each data frame only includes the data to be transmitted and does not include slave device identification and target address information, the data transmission efficiency can be greatly improved, the receiving device does not need to parse the received data frames, and the bandwidth occupied by the data frames is reduced.

[0033] To achieve the third objective mentioned above, the master device interface circuit provided by the present invention includes a bus interface circuit, a command frame generation unit, and a data frame processing unit. The bus interface circuit is used to transmit data with the slave device via a communication bus, which includes a clock signal line and a data signal line, the data signal line being a bidirectional communication data signal line. The command frame generation unit generates and sends command frames to the slave device, the command frames containing target address information and a target number of continuously transmitted data frames. The data frame processing unit continuously sends the target number of data frames to the slave device when the command frame indicates that the current read / write operation is continuously writing data to the slave device; and when the command frame indicates that the current read / write operation is continuously reading data from the slave device, it obtains the target number of data frames continuously sent by the slave device. Each data frame consists of data to be transmitted, and the data frame does not include the slave device's identifier or target address information.

[0034] To achieve the fourth objective mentioned above, the slave device interface circuit provided by this invention includes a bus interface circuit, a command frame parsing unit, and a data frame processing unit. The bus interface circuit is used for data transmission with the master device via a communication bus, which includes a clock signal line and a data signal line, the data signal line being a bidirectional communication data signal line. The command frame parsing unit receives and parses command frames sent by the master device. The command frame contains target address information and the target number of consecutively transmitted data frames. The data frame processing unit, when the command frame indicates that the current read / write operation is continuous data writing, receives multiple consecutive data frames sent by the master device and sequentially writes the data of the multiple data frames into the storage space corresponding to the target address information. When the command frame indicates that the current read / write operation is continuous data reading, it retrieves multiple consecutive data frames from the corresponding storage space according to the target address information and forms a data frame to send to the master device. The data frame consists of the data to be transmitted, and the data frame does not include the slave device identifier or target address information. Attached Figure Description

[0035] Figure 1 This is a block diagram of the first layout method of a master-slave communication system.

[0036] Figure 2 This is a structural block diagram of the main equipment.

[0037] Figure 3 This is a structural block diagram of the equipment.

[0038] Figure 4 This is a block diagram of the second layout method of the master-slave communication system.

[0039] Figure 5 This is a block diagram of the third layout method of master-slave communication system.

[0040] Figure 6This is a block diagram of the fourth layout method of master-slave communication system.

[0041] Figure 7 This is a data structure diagram of continuously sending data frames in an embodiment of the main device data transmission method of the present invention.

[0042] Figure 8 This is a data structure diagram of discontinuous data frame transmission in an embodiment of the main device data transmission method of the present invention.

[0043] Figure 9 This is a flowchart of data transmission between the master and slave devices.

[0044] The present invention will be further described below with reference to the accompanying drawings and embodiments. Detailed Implementation

[0045] This invention is applied to a master-slave communication system. Preferably, this master-slave communication system is a high-speed master-slave communication system for AI clusters. The master-slave communication system includes one or more master devices and one or more slave devices. The master device can be a control chip, and the slave device can be a physical layer chip. This invention improves the data transmission method between the master and slave devices, especially the frame structure under continuous read / write operations, to enhance the data transmission efficiency between the master and slave devices.

[0046] Examples of master device interface circuits and slave device interface circuits: A master-slave communication system includes one or more master devices and one or more slave devices. See [link to documentation]. Figure 1 The first application method involves setting up only one master device 11 and one slave device 12, which communicate with each other via a communication bus. Preferably, the communication bus includes a clock signal line and a data signal line. The clock signal line is used to transmit a clock signal, which is generated by the master device 11. The data signal line is a bidirectional data line. The typical frequency of the clock signal is 25MHz, and the slave device only samples data on the rising edge of the clock signal. The data signal line is a bidirectional communication line, and the master device 11 and slave device 12 achieve bidirectional data transmission through this single data signal line. When either the master device 11 or the slave device 12 sends data, it needs to generate data on the falling edge of the first clock signal, and the slave device samples the data on the rising edge of the second clock signal. Then, it generates new data on the falling edge of the second clock signal, and so on.

[0047] See Figure 2The master device includes a first interface circuit 110, a first address processor 131, and a first memory 132. The first interface circuit 110 includes a first bus interface circuit 111, a command frame generation circuit 112, and a first data frame processing circuit 113. The first bus interface circuit 111 is connected to a communication bus and is used to output a clock signal to a clock signal line and to send data to or receive data from the slave device 12 via a data signal line. The command frame generation circuit 112 is used to generate command frames, the format of which will be described in detail below. The first data frame processing circuit 113 is used to receive data frames sent by the slave device 12 or to send data frames to the slave device 12. If the master device 11 sends a data frame to the slave device 12, the first address processor 131 manages the address for each data transmission. For example, for each data frame sent, the address pointer is moved by one bit, and the data to be sent is retrieved from the first memory 132 according to the address pointer. If data is read from slave device 12, after each data frame is received, the address to which the current data is written is determined according to the first address processor 131, and the data is written to the first memory 132, after which the address pointer moves one bit.

[0048] See Figure 3 The slave device includes a second interface circuit 120, a second address processor 141, and a second memory 142. The second interface circuit 120 includes a second bus interface circuit 121, a command frame parsing circuit 122, and a second data frame processing circuit 123. The second bus interface circuit 121 is connected to a communication bus, and data signal lines enable data transmission with the master device 11. The command frame parsing circuit 122 receives and parses command frames sent by the master device 11. The second data frame processing circuit 123 receives or sends data frames to the master device 11. If the slave device 12 sends data to the master device 11, the second address processor 141 manages the address for each data transmission. For example, after each data frame is sent, the address pointer is moved one position, and the data to be sent is retrieved from the second memory 142 based on the address pointer. If the slave device 12 sends a data frame to the master device 11, after receiving each data frame, the second address processor 141 determines the address where the current data is written, writes the data to the second memory 142, and then moves the address pointer one position.

[0049] In this way, the number of signal lines in the master-slave communication system is very small, and both the master device 11 and the slave device 12 can send data to the data signal lines. When writing data to the register of the slave device 12, the data signal lines are driven by the master device 11; when reading data from the register of the slave device 12, the data signal lines are driven by the slave device 12. Data is transmitted by transmitting the high-order bits first, followed by the low-order bits. Furthermore, the data signal lines are designed using tri-state gates, meaning they have three states: high level, low level, and high impedance. The clock signal lines have two states: high level and low level.

[0050] Apart from Figure 1 The one-to-one communication method shown can also include one-to-many or many-to-many communication methods. See [link / reference]. Figure 4 The master-slave communication system consists of one master device 21 and three slave devices 22, 23, and 24. The master device 21 is connected to the slave devices 22, 23, and 24 via a communication bus. The communication center uses only two lines: a clock signal line and a data signal line. (See also...) Figure 5 In a many-to-many mode, two master devices are configured, designated as master devices 31 and 32, and three slave devices are configured, designated as slave devices 33, 34, and 35. Furthermore, the number of master devices can be more than two, while the number of slave devices can be only one, such as... Figure 6 As shown, two master devices 41 and 42 communicate with a slave device 43 via a communication bus.

[0051] When a master device needs to transmit data with a slave device, it first sends a command frame. The command frame contains the target address information and the target number of consecutive data frames to be transmitted. After receiving the command frame, the slave device parses it to determine whether the current read / write operation is a consecutive read / write operation. If it is a consecutive read / write operation, it can also confirm the number of consecutive read / write data frames. The structure of the command frame is shown in Table 1.

[0052] Table 1 Command Frame Structure

[0053] The command frame consists of several fields: SOF (Start of Command) is a 16-bit field, and Slave-ID (8 bits) is an 8-bit field identifying the slave device that needs to respond to the current command frame. If the master device needs to broadcast data to multiple slave devices, Slave-ID is FF, indicating the broadcast address. ACK (Acknowledgment) is a 1-bit field for slave device response. When a slave device receives a command frame from the master device and determines that the Slave-ID matches its own ID, it outputs a low-level signal in the ACK field to indicate that it has received the command frame. If the master device reads or writes data of 8 or 16 bits each time, any missing bits can be padded with preset data. ADDR (32 bits) is the address field, used to identify the target address of the current read / write operation, preferably the starting address. WR / RD (1 bit) is the read / write flag. A WR / RD value of 1 indicates a write operation, and a WR / RD value of 0 indicates a read operation. Similarly, when the length of data read or written by the master device is 8 bits or 16 bits each time, preset data is used to pad the insufficient bits. The field Length is the target number of consecutive read / write data frames, used to indicate how many consecutive address read / write operations are performed. The value range is 1 to 255, and the length is 8 bits. If the value of the field Length is 1, it means that the current read / write operation only transmits one data frame, not a consecutive multi-frame read / write operation. If the value of the field Length is greater than or equal to 2, it means that the current read / write operation only transmits multiple data frames, and is a consecutive multi-frame read / write operation.

[0054] After the master device sends a command frame, if it is writing data to the slave device, it immediately sends a data frame. In this embodiment, each data frame is 32 bits long, or 4 bytes, and the data frame follows immediately after the command frame. If the master device needs to read data from the slave device, the slave device needs to send a data frame immediately after the master device sends the command frame. Regardless of whether the master device or the slave device sends data frames, the number of data frames sent must be consistent with the number of data frames in the Length field of the command frame.

[0055] See Figure 7 For continuous write operations, after the master device sends command frame 51, it immediately sends multiple data frames 52, 53...54. For continuous read operations, after the master device sends command frame 51, the slave device immediately sends multiple data frames 52, 53...54. If continuous read / write operations are not required, see [link to documentation]. Figure 8After the master device sends a command frame 61, it immediately sends a data frame 62, then another command frame 63, and then another data frame 64. If more data needs to be transmitted subsequently, it sends another command frame 65, and then another data frame 66. Discontinuous transmission is mainly used when the write addresses of multiple data frames are not contiguous.

[0056] In this embodiment, each data frame no longer contains fields such as slave device ID, target address information, and target quantity; it only contains the data to be transmitted. Thus, when multiple data frames need to be sent consecutively, the master device does not need to send the target address of each data frame before sending each data frame. Instead, it only needs to send the starting address of the current batch of consecutive data frames and the target quantity of consecutive data frames in the command frame. This can significantly reduce the amount of address information, slave device ID, and other fields sent, thereby reducing the amount of data sent to the data signal line. This allows the data signal line to concentrate on transmitting the data that actually needs to be read and written, thereby improving data transmission efficiency.

[0057] Before sending a command frame, the master device needs to establish communication with the slave device. Initially, the slave device is in an idle state. To reduce power consumption, the slave device will usually enter a sleep state if it is idle. Therefore, the master device needs to send a detection frame to establish communication with the slave device.

[0058] The frame structure of the detection frame in this embodiment is the same as that of the command frame. However, after the master device sends the detection frame, it does not send a data frame, nor does the slave device need to send a data frame. To improve the accuracy of link establishment, the master device needs to continuously send multiple detection frames and needs to determine whether the slave devices have responded correctly to the detection frames.

[0059] Specifically, the master device continuously sends three detection frames. The Slave-ID field of each detection frame contains the ID of the slave device to be communicated with. Assuming the slave device to be communicated with is the target slave device, after receiving the detection frame sent by the master device, the target slave device needs to pull the data signal line low in the ACK field of that detection frame, that is, send a low-level signal under the ACK field to indicate a response to the detection frame. The master device needs to determine whether the target slave device can correctly respond to all detection frames. If no response is received from the slave device in any of the three consecutive detection frames, it is considered that the slave device has not responded correctly, and three more detection frames need to be resent to re-establish the link connection. In addition, the address field of the detection frame, i.e., the ADDR field, can use a special address, that is, the address during the link establishment phase can use special values ​​such as 0x0123-4567, 0x89ab-cdef, or 0x0123-cdef.

[0060] For the slave device, after receiving the detection frame, it needs to determine whether the Slave-ID field in the detection frame is the same as its own ID. If they are the same, it needs to send a low-level signal under the ACK field. If they are different from its own ID, it does not need to respond to the detection frame, stops parsing the detection frame, and returns to the idle state.

[0061] In addition, since the clock signal is generated by the master device, the master device can stop sending the clock signal when idle to reduce the power consumption of the master-slave communication system. The master and slave devices generate the data to be transmitted on the falling edge of the clock signal and sample the data on the rising edge of the clock signal.

[0062] The master device sends a command frame to the slave device containing key information such as the slave device ID, target address information, and the target number of consecutive data frames to be read. After parsing the command frame, the slave device can obtain information such as the starting address corresponding to multiple consecutive data read / write frames and the number of consecutive data frames to be read / written, and begin preparing for data read / write. If the master device is continuously writing data to the slave device, the slave device needs to determine the starting address of the continuously written data based on the ADDR field in the command frame and obtain the target number. After receiving the first data frame sent by the master device, the slave device writes the data of the first data frame to the register corresponding to the target address, then increments the address of the register by 1, receives the second data frame, writes the data of the second data frame to the second register, and so on, until all data frames have been written. If the master device is reading data from the slave device, after the master device sends a command frame, the slave device determines the data storage address of the first data frame based on the target address information in the command frame, reads the data at that address to form the first data frame, and sends it to the master device. Then, the address is incremented by 1, and the slave device reads the data at the new address to form the second data frame, and so on, until the target number in the command frame is reached.

[0063] Examples of master device data transmission method and slave device data transmission method: The following is combined Figure 9 This section introduces the data transmission methods for the master and slave devices. Assume a master-slave communication system includes one master device and multiple slave devices, for example, 100 slave devices. The master device uses instantaneous concurrency to transmit data with multiple slave devices, meaning it sends data to or receives data sets from multiple slave devices simultaneously. Therefore, the master-slave communication system needs to ensure no packet loss or out-of-order delivery during data transmission between the master and slave devices. It also needs to implement a fault isolation mechanism to ensure that a communication failure in a single slave device does not affect the overall data transmission process, and that the faulty slave device can be repaired individually afterward.

[0064] First, in step S71, the master device broadcasts a synchronization frame to achieve global synchronization and priority elevation. Specifically, the frame format of the synchronization frame is the same as that of the command frame, except that the Slave-ID field is FF, indicating that the frame is a synchronization frame. Additionally, the ADDR field also uses a special format, such as 5a5a5a5a. When the master device performs global synchronization, it needs to send three consecutive synchronization frames, but it does not need a response from the slave device. Therefore, the master device does not need to check the ACK field when sending the synchronization frame; that is, it does not check whether the slave device has pulled the data signal line low in the ACK field.

[0065] After receiving a synchronization frame from the device, it will pause processing non-critical background tasks, raise the priority of the response communication interface to the highest level, and wait to receive data sent by the master device.

[0066] After the master device sends a synchronization frame, since the slave devices do not need to respond to the synchronization frame, the master device cannot obtain the status of the slave devices through the synchronization frame, and therefore cannot determine whether the slave devices are ready. Therefore, step S72 needs to be executed to perform time-sharing registration of the slave devices. After sending the synchronization frame, the master device will send a registration request frame via broadcast, meaning it needs to send a registration request frame to each slave device. In this embodiment, the frame format of the registration request frame is the same as that of the command frame, where the Slave-ID field is the ID of each slave device, and the ADDR field uses special data, such as a5a5a5a5. Only one registration request frame needs to be sent.

[0067] After receiving a registration request frame, the slave device needs to respond to it. Specifically, upon receiving the registration request frame, the slave device retrieves the Slave-ID field from the frame and checks if it matches its own ID. If they match, the slave device sends a registration data frame to the master device. This data frame contains the maximum number of data frames for continuous read / write operations. Since the maximum number of data frames for continuous read operations may differ from the maximum number for continuous write operations, the slave device can send these numbers separately to the master device. Additionally, the registration data frame sent by the slave device must also include its ID. After receiving the registration data frames from each slave device, the master device constructs a slave device list. After executing step S72, the slave device list is shown in Table 2.

[0068] Table 2 Initial List of Slave Devices

[0069] In Table 2, Slave-ID is the slave device ID, and alive is the online status of the slave device. For example, "1" indicates that the slave device is online, and "0" indicates that the slave device is offline, i.e., the maximum number of consecutive read operation data frames and the maximum number of consecutive write operation data frames that could not be received from the slave device. wr-length is the maximum number of consecutive write operation data frames for the slave device, and rd-length is the maximum number of consecutive read operation data frames for the slave device.

[0070] If the master device fails to receive registration data frames from all slave devices after sending a registration request frame, it can resend the registration request frame after a period of time, or enter a partial slave device online mode. In this mode, the master device only transmits data to the online slave devices. According to Table 2, the master device can determine the current online status of each slave device and its maximum receiving capacity. When the master device performs concurrent data transmission to multiple slave devices, it uses the minimum wr-length of all slave devices as the maximum number of data frames sent during continuous write operations, and the minimum rd-length of all slave devices as the maximum number of data frames sent during continuous read operations.

[0071] Then, step S73 is executed, where the master device checks the quality of the communication link. Specifically, the master device sequentially sends a test frame to each online slave device in Table 2. The test frame contains the slave device's ID. After receiving the test frame, the slave device needs to determine whether the Slave-ID in the test frame matches its own ID. If they match, it returns a response frame. Preferably, the test frame sent by the master device also contains a piece of test data, and the response frame returned by the slave device also needs to contain this test data. After receiving the response frames returned by each slave device, the master device needs to determine the link quality of each slave device based on the response frames, including round-trip delay and bit error rate. For example, after the master device continuously sends multiple test frames, it counts the proportion of incorrectly returned response frames and uses this as the basis for calculating the bit error rate. If the bit error rate exceeds the set bit error rate threshold, the bit error rate of the communication link is determined to be too high. In addition, the average round-trip clock cycles of multiple response frames are also counted as the round-trip delay. If the round-trip delay is greater than a preset round-trip delay threshold, such as exceeding 5 clock cycles, the round-trip delay of the communication link is determined to be too long. If a slave device has a long latency or a high bit error rate, its link quality is considered to be below the link quality threshold. The master device marks it as a low-quality slave device, requiring error correction and retransmission strategies, such as retransmitting data in subsequent step S76. Additionally, the master device adds a "Link-level" field to the table in Table 2, indicating good link quality with "1" and poor link quality with "0". The updated table is shown in Table 3.

[0072] Table 3. Slave Device Status Table with Added Link-level Field

[0073] Then, step S74 is executed, and the master device performs link pre-transmission. Specifically, the master device broadcasts a ready frame. The master device can send ready frames to multiple slave devices concurrently. The ready frame includes a Slave_ID field and an address field. The Slave_ID field uses a special value, such as 0xFF, and the address field also uses a special value, such as 0xCACACACA. Two frames are sent consecutively. The ready frame does not have an ACK field. After receiving the ready frame, the slave device immediately enters concurrent listening mode, ready to receive data.

[0074] Next, step S75 is executed, and the master device officially sends the data. In this embodiment, the master device uses a block-based concurrent data transmission method. Specifically, the master device divides the data to be transmitted into multiple data blocks of a fixed size, for example, each data block is 32 bits of data, one data block constitutes one data frame, and the number of data blocks does not exceed the maximum number of data frames sent during continuous read and write operations determined in step S72.

[0075] Then, the master device broadcasts data blocks, first sending three consecutive detection frames. After all slave devices respond to the detection frames, a command frame is sent. The command frame contains information such as the slave device ID, target address, and the target number of consecutive data frames to be sent. If the master device is writing data to a slave device, after sending the command frame, it will sequentially send multiple data frames. Preferably, after sending each data frame, a short interval, such as 1ms, is waited to allow the slave devices to process the data frame. By continuously sending multiple detection frames, it is possible to determine whether each slave device has entered the listening concurrent mode, thereby ensuring that the slave devices are ready to receive the command frames sent by the master device.

[0076] After receiving a data frame from the slave device, it is necessary to check whether the actual number of received data frames is the same as the target number in the command frame. If the actual number is the same as the target number, it means that the slave device has completely received all the data frames sent by the master device, and the received data frames need to be verified subsequently.

[0077] If the actual number of data frames received by the device is less than the target number, it indicates that data frames are missing, requiring an alarm and the master device to retransmit the data. If the actual number of data frames received by the device exceeds the target number, the device only receives the first arriving data frames equal to the target number, discarding the rest. In actual communication, various reasons may lead to redundant data frames on the link. These redundant frames are often not actively sent by the master or slave device and are therefore unreliable. Thus, by using only the first arriving target number of data frames in conjunction with subsequent CRC checks, this abnormal situation can be handled, eliminating the need for data retransmission.

[0078] Then, step S76 is executed. For the low-quality slave devices marked in step S73, and slave devices whose actual number of received data frames is less than the target number, they are all identified as slave devices with abnormal data reception. For slave devices with abnormal data reception, the master device initiates a point-to-point data retransmission operation.

[0079] Specifically, after the master device sends multiple data frames equal to the target number, it sends a retransmission request frame to each slave device. This retransmission request frame contains the slave device's ID. Upon receiving the retransmission request frame, the slave device determines whether the actual number of data frames received is less than the target number. If it is not less than the target number, it returns a response signal to the retransmission request frame, indicating that the number of data frames sent is normal. If the actual number is less than the target number, it does not return a response signal to the retransmission request frame.

[0080] In this way, the master device determines whether each slave device has experienced a data reception anomaly based on whether each slave device returns a response signal. A new "Re_trans" field is added to Table 3 to mark the data reception anomaly status of the slave devices, where "0" indicates data reception and "1" indicates a data reception anomaly. The updated table is shown in Table 4. Slave devices with data reception anomalies will be subsequently repaired, and the "Re_trans" field will be updated after the repair.

[0081] Table 4. Slave device status table with added Re_trans field

[0082] For slave devices experiencing data transmission anomalies, the master device retransmits command frames and data frames. This means that data retransmission is only performed on slave devices with data transmission anomalies. After retransmission, the master device retransmits a retransmission request frame and listens for the response signals from each slave device, updating Table 4 to determine whether all retransmitted data frames have been successfully received. Preferably, the master device retransmits data frames only once or twice to avoid prolonged occupation of the data bus.

[0083] Then, step S77 is executed. After all data frames have been transmitted, the master device broadcasts an end frame to multiple slave devices to achieve global termination and acknowledgment. The Slave_ID field of the end frame uses a special value, such as 0xFF, and the address field also uses a special value, such as 0xACACACAC. Three frames are sent consecutively, and the end frame does not set the response field of the slave devices.

[0084] After receiving the end frame, the slave device verifies the received data, such as checking data integrity and performing CRC checks. Preferably, the last data frame in the data frames sent by the master device is a CRC check frame. When performing data verification, the slave device uses this CRC check frame to verify the received data frames and returns the verification result to the master device. If the slave device's data verification is successful, it means that the slave device has received all the data sent by the master device completely and accurately, indicating successful data reception. The slave device then returns a verification success signal to the master device and exits the data receiving state, entering idle mode. If the verification fails, the slave device returns a verification failure message to the master device, or does not return a verification success signal. The slave device continues to remain in data receiving mode and listens for data sent by the master device. In addition, the time interval between two consecutive communications between the master device and the slave device is usually no more than 20 microseconds. Therefore, if the slave device does not receive a new command frame or data frame within a set time (e.g., 20 microseconds), it automatically exits the data receiving mode and returns to the idle state, avoiding the slave device remaining in listening mode for a long time.

[0085] Finally, in step S78, the master device performs a single-point repair operation on the slave device that failed the verification. Specifically, the master device retransmits the data to the slave device that failed the verification, i.e., resends the command frame and data frame. After the master device resends the command frame and data frame, the slave device performs integrity and CRC verification on the received data frame again and returns the verification result to the master device. The master device updates the status of Table 4. For example, the Re_trans field of the slave device with Slave-ID 5 in Table 4 is updated to "0". The updated table is shown in Table 5.

[0086] Table 5 shows the slave device status table for updating the Re_trans field.

[0087] The above example illustrates the process of a master device writing data to a slave device. If the master device reads data from the slave device, the slave device sends a data frame after the master device sends a command frame. The data integrity check and CRC check are performed by the data receiving device, i.e., the master device, and the check result is fed back to the data sending device, i.e., the slave device. However, the master device also needs to record the check result of this read operation.

[0088] By applying the method of this invention, the master device can achieve continuous transmission of multiple data frames after sending a command frame. Since each data frame only contains the data to be transmitted and does not contain information such as slave device ID or target address information, in the application scenario of AI clusters, more than 90% of the data is continuously read and written. The method of this invention can significantly reduce the transmission of flag bits or slave device identifiers, address information, etc., thereby avoiding the transmission of a large amount of address information through the bus and improving the data transmission efficiency when continuously reading and writing multiple data frames.

[0089] In addition, after multiple frames of data transmission are completed, the accuracy of data transmission can be improved by verifying the data frames and performing point-to-point data retransmission for slave devices with abnormal data transmission or verification failures. This balances data transmission efficiency and accuracy, meets the data transmission rate requirements in AI cluster scenarios, and avoids quality problems caused by decreased data transmission accuracy.

[0090] Finally, it should be emphasized that the above are merely preferred embodiments of the present invention and are not intended to limit the present invention. For those skilled in the art, the present invention can have various changes and modifications. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.

Claims

1. A method for data transmission in a master device, characterized in that, include: Send a command frame to the slave device, the command frame containing target address information and the target number of consecutively transmitted data frames; If the command frame indicates that the current read / write operation is to continuously write data to the slave device, then the target number of data frames are continuously sent to the slave device. If the command frame indicates that the current read / write operation is to continuously read data from the slave device, then obtain the target number of data frames continuously sent by the slave device; After multiple consecutive data frames have been transmitted, the transmitted data is verified. If the verification fails, the data frames are retransmitted. The data frame consists of data to be transmitted, and does not include the identifier of the slave device or the target address information.

2. The master device data transmission method according to claim 1, characterized in that: After sending a command frame to the slave device, it is determined whether the actual number of continuously transmitted data frames received is not less than the target number recorded in the command frame. If the actual number is not less than the target number, the number of data frames is confirmed to be normal.

3. The master device data transmission method according to claim 2, characterized in that: If the actual quantity is greater than the target quantity, then only the data frames transmitted earlier that are equal to the target quantity will be received.

4. The master device data transmission method according to any one of claims 1 to 3, characterized in that: Before sending the command frame, a preset number of detection frames are continuously sent to the slave device, and it is determined whether the slave device responds correctly to the detection frames. If the slave device responds correctly to the detection frames, it is confirmed that the link with the slave device has been established.

5. The master device data transmission method according to any one of claims 1 to 3, characterized in that: Before sending the command frame, continuously send registration request frames to the slave device and receive the maximum number of data frames for continuous read / write operations returned by the slave device.

6. The master device data transmission method according to any one of claims 1 to 3, characterized in that: The number of slave devices is two or more; Before sending the command frame, test frames are sent to multiple slave devices, and response frames returned by multiple slave devices are received. The link quality of each slave device is determined based on the response frames, and low-quality slave devices with link quality lower than the link quality threshold are marked. The data frame is retransmitted to the low-quality slave device.

7. The master device data transmission method according to any one of claims 1 to 3, characterized in that: After sending the data frame to the multiple slave devices, an end frame is sent to the multiple slave devices, and the verification result returned by the slave devices is received.

8. A method for transmitting data from a device, characterized in that, include: Receive a command frame sent by the master device, the command frame containing target address information and the target number of consecutively transmitted data frames; If the command frame indicates that the current read / write operation is continuous data writing, then multiple data frames continuously sent by the master device are received, and the data of the multiple data frames are sequentially written into the storage space corresponding to the target address information. If the command frame indicates that the current read / write operation is continuous data reading, then multiple consecutive frames of data are obtained from the corresponding storage space according to the target address information and the data frame is formed and sent to the master device. The data frame consists of data to be transmitted, and the data frame does not include the slave device identifier and the target address information.

9. A master device interface circuit, comprising: A bus interface circuit is used to transmit data with a slave device via a communication bus. The communication bus includes a clock signal line and a data signal line, and the data signal line is a bidirectional communication data signal line. Its features are: A command frame generation unit is used to generate and send command frames to the slave device. The command frame contains target address information and a target number of data frames to be transmitted continuously. The data frame processing unit continuously sends the target number of data frames to the slave device when the command frame indicates that the current read / write operation is to continuously write data to the slave device; and acquires the target number of data frames continuously sent by the slave device when the command frame indicates that the current read / write operation is to continuously read data from the slave device. The data frame consists of data to be transmitted, and does not include the identifier of the slave device or the target address information.

10. A slave device interface circuit, comprising: A bus interface circuit is used to transmit data with a host device via a communication bus. The communication bus includes a clock signal line and a data signal line, and the data signal line is a bidirectional communication data signal line. Its features are: The command frame parsing unit is used to receive the command frame sent by the master device and parse the command frame. The command frame contains target address information and the target number of continuously transmitted data frames. The data frame processing unit, when the command frame indicates that the current read / write operation is continuous data writing, receives multiple data frames continuously sent by the master device and sequentially writes the data of the multiple data frames into the storage space corresponding to the target address information; when the command frame indicates that the current read / write operation is continuous data reading, it obtains multiple consecutive data frames from the corresponding storage space according to the target address information and forms the data frame to send to the master device. The data frame consists of data to be transmitted, and the data frame does not include the slave device identifier and the target address information.