USB data packet transmission method and USB transmission system

By defining multiple interrupt upload endpoints on the USB device side and performing time-sharing and orderly reorganization of data packets on the host side, the problem of insufficient real-time and refresh rate of USB packet transmission is solved, and higher response speed and reliability are achieved.

CN120123280BActive Publication Date: 2025-08-22NANJING QINHENG MICROELECTRONICS CO LTD

Patent Information

Application Number
CN202510598193.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-05-09
Publication Date
2025-08-22
Estimated Expiration
2045-05-09

AI Technical Summary

Technical Problem

Existing USB packet transmissions have shortcomings in real-time and refresh rates, especially in the fields of industrial control and consumer electronics, which are difficult to meet the needs of fast response and high data refresh rates.

Method used

Define multiple interrupt upload endpoints on the USB device side, configure them as notification interrupt upload endpoints, and establish corresponding pipelines on the host side. Through asynchronous event detection and ERDY transaction packet interaction, time-sharing transmission and orderly reorganization of data packets are realized, breaking the traditional one-to-one transmission mode.

Benefits of technology

It improves the response time of USB interrupt transmission, increases the data refresh rate by N times, achieving higher real-time and reliability, and does not occupy too much bus bandwidth. It is suitable for devices with the characteristics of periodic query.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120123280B_ABST
    Figure CN120123280B_ABST
Patent Text Reader

Abstract

The present invention discloses a USB data packet transmission method and a USB transmission system. The method defines N interrupt upload endpoints for transmitting a target data stream, where N is a positive integer ≥ 2, and at least N-1 of the interrupt upload endpoints are configured as notification-type interrupt upload endpoints. Each notification-type interrupt upload endpoint waits for a valid event to be activated, wherein the valid event includes the endpoint data of the notification-type interrupt upload endpoint being ready, and the endpoint data comes from the target data stream. When the valid event corresponding to a notification-type interrupt upload endpoint is activated, the notification-type interrupt upload endpoint sequentially executes the following: sending an ERDY transaction packet to a host, receiving an ACK transaction packet for an upload request initiated by the host, returning a data packet to the host, and receiving an ACK transaction packet for the data packet from the host. The host-side module sequentially reorganizes the data packets received by all pipelines into the target data stream. The present invention can improve the real-time performance of USB data packet transmission and increase the refresh rate.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of USB communication technology, and in particular relates to a USB data packet transmission method and a USB transmission system. Background Art

[0002] USB communication is widely used, but the real-time performance of USB data packet transmission is relatively weak. According to the USB specification, USB bulk transfers cannot guarantee bus bandwidth and real-time performance. USB isochronous transfers are relatively real-time, but lack acknowledgment and retransmission mechanisms, so reliability cannot be guaranteed. USB interrupt transfers can achieve a balance between real-time performance and reliability.

[0003] In existing technology, USB interrupt transmissions have a higher bandwidth priority. After the start of each microframe (125μs) of High-Speed ​​USB and SuperSpeed ​​USB, high-priority transmissions such as USB interrupt transmissions are prioritized, and USB bulk transmissions and other transmissions are scheduled for the remaining time within the microframe. However, USB interrupt transmissions can only transmit a maximum of one data packet per microframe. Even for high-bandwidth transmissions, a maximum of three data packets can be uploaded in a microframe. However, these three data packets must be transmitted consecutively and are usually concentrated at the beginning of the microframe interval. Therefore, the response time of USB interrupt transmissions is limited by the length of the microframe. That is, the real-time performance of USB interrupt transmission is limited by the granularity of a frame. Specifically, the interval between each frame of full-speed USB is 1ms, so the guaranteed response time of interrupt transmission is 1ms; the interval between each microframe of high-speed USB is 125μs, and the bus interval (Bus interval, equivalent to the micro-frame of high-speed USB, collectively referred to as micro-frame in this article) of SuperSpeed ​​USB (USB3.x and above) is also 125μs. Therefore, the guaranteed response time of high-speed and super-speed USB interrupt transmission is 125μs. In other words, if an interrupt data packet cannot be transmitted within the current microframe, it can only wait for the next microframe.

[0004] In the field of industrial control, a response time of 125μs is not conducive to quickly responding to external events in real time and making corresponding processing in a timely manner; in the field of consumer electronics, a response time of 125μs is equivalent to an 8KHz data refresh rate, which is difficult to meet the data refresh requirements of 16kHz or higher. Summary of the Invention

[0005] Purpose of the invention: In order to solve the problems of weak real-time performance and low refresh rate of USB data packet transmission in the prior art, the present invention provides a USB data packet transmission method and a USB transmission system.

[0006] Technical solution: A USB data packet transmission method, comprising the following steps:

[0007] The USB device chip defines N interrupt upload endpoints for transmitting target data streams, where N is a positive integer ≥ 2, and at least N-1 interrupt upload endpoints are configured as notification-type interrupt upload endpoints.

[0008] The host-side module establishes N pipelines;

[0009] Each notification-type interrupt upload endpoint of the USB device chip waits for a valid event to be activated, wherein the valid event includes that the endpoint data of the notification-type interrupt upload endpoint is ready, and the endpoint data comes from the target data stream;

[0010] When a valid event corresponding to a notification-type interrupt upload endpoint is activated, the notification-type interrupt upload endpoint executes in sequence through the pipeline: sends an ERDY transaction packet to the host, receives an ACK transaction packet for the host to initiate an upload, returns a data packet to the host, and receives an ACK transaction packet for the host's response to the data packet;

[0011] The host module reassembles the data packets received through all pipelines into the target data stream in sequence.

[0012] Furthermore, the valid event is detecting that endpoint data is ready at a specified time point within a microframe.

[0013] Furthermore, one microframe is equally divided into N time periods, and the starting point of each time period starting from at least the second time period is the designated time point.

[0014] Furthermore, each time period uniquely corresponds to an interrupt upload endpoint, and each designated time point starting from the second time period uniquely corresponds to a notification-type interrupt upload endpoint.

[0015] Furthermore, the valid event is real-time detection of a request for a device to upload data and endpoint data being ready.

[0016] Furthermore, the host-side module reassembles the data packets received from all interrupt upload endpoints into a target data stream according to the actual arrival order of each data packet.

[0017] Furthermore, the host-side module reorganizes the data packets received from all interrupt upload endpoints into a target data stream according to the sequence of each time period in the microframe.

[0018] Furthermore, the N interrupt upload endpoints include a non-notification interrupt upload endpoint. At the beginning of a microframe, the non-notification interrupt upload endpoint receives an upload request ACK transaction packet initiated by the host. If the data of the non-notification interrupt upload endpoint is ready, it returns a data packet to the host and then receives an ACK transaction packet from the host in response to the data packet.

[0019] Furthermore, after the pipeline is established, the host module presets at least two USB upload requests for each interrupt upload endpoint to the host transaction queue, waiting for the USB device to upload data;

[0020] After each interrupt upload endpoint completes processing an upload transaction, the host module rebuilds a USB upload request to the host transaction queue.

[0021] A USB transmission system includes a USB device-side chip and a USB host-side module. The USB device-side chip includes N interrupt upload endpoints for transmitting a target data stream, where N is a positive integer ≥ 2, and at least N-1 of the interrupt upload endpoints are configured as notification-type interrupt upload endpoints. The notification-type interrupt upload endpoints are configured to sequentially execute the following upon activation of a valid event: send an ERDY transaction packet to a host, receive an ACK transaction packet requesting an upload initiated by the host, return a data packet to the host, and receive an ACK transaction packet acknowledging the data packet from the host. The valid event includes endpoint data being ready for the notification-type interrupt upload endpoint, and the endpoint data is from the target data stream.

[0022] The USB host module is a program product or hardware module installed on the host, and is used to sequentially reassemble the data packets received from all interrupt upload endpoints into a target data stream.

[0023] Furthermore, the USB device chip also includes a USB microframe interval timer, which is used to determine a specified time point in each microframe and judge whether a valid event is activated at the specified time point.

[0024] Compared with the prior art, the USB data packet transmission method and USB transmission system provided by the present invention have at least the following beneficial effects:

[0025] (1) Multiple event detection specified time points are set within a microframe of super-speed USB, and data packets are uploaded regularly; breaking the one-to-one convention, N USB interrupt upload endpoints are used on the USB device side to upload real-time data of the same target data stream in time-sharing, and the data of multiple USB pipes are sequentially aggregated into the same data stream on the USB host side, so that the response time guaranteed by USB interrupt transmission from a global perspective is shortened to 1 / N of the original response time (125μs), thereby increasing the data refresh rate by N times.

[0026] (2) Detect the device's request to upload data in real time, and asynchronously notify the USB host to transmit it using the ERDY transaction packet; the response time of the USB interrupt transmission is determined by the interaction process and duration of the ultra-high-speed USB transaction packet and the data packet, thereby generally improving the real-time performance of the USB interrupt upload data packet to the level of several μs.

[0027] (3) It inherits the reliability of conventional USB interrupt transmission and shortens the response time without occupying too much USB bus bandwidth.

[0028] (4) By relatively evenly distributing the specified time points within the microframe, the effect of uniform transmission can be further achieved, which is particularly suitable for devices with periodic query characteristics, such as high-speed HID devices.

[0029] (5) The entire implementation process is simple. The target data stream does not need to be parsed during transmission, and the transmitted data packets do not need to have sequence numbers, which can achieve the effect of data transparent transmission. BRIEF DESCRIPTION OF THE DRAWINGS

[0030] Figure 1 This is a schematic diagram of the USB data packet transmission process in Example 1;

[0031] Figure 2 This is a schematic diagram of the USB data packet transmission process in Example 2;

[0032] Figure 3 This is a schematic diagram of the USB data packet transmission process in Example 3. DETAILED DESCRIPTION

[0033] The present invention will be further explained below with reference to the accompanying drawings and specific embodiments.

[0034] Example 1:

[0035] A USB data packet transmission method, such as Figure 1 As shown, the following steps are included:

[0036] The USB device chip defines N interrupt upload (IN) endpoints for transmitting target data streams, where N is a positive integer ≥ 2, and at least N-1 interrupt upload endpoints are configured as notification-type interrupt upload endpoints. For example, in this embodiment, there are three interrupt upload endpoints, and all of them are notification-type interrupt upload endpoints.

[0037] The host module establishes N pipes. After the pipes are established, the host module presets at least two USB upload requests for each interrupt upload endpoint to the host transaction queue, waiting for the USB device chip to upload the ERDY transaction packet.

[0038] Each notification interrupt upload endpoint of the USB device chip waits for a valid event to be activated, wherein the valid event is the detection of endpoint data ready at a specified time point within a microframe, and the endpoint data comes from a target data stream;

[0039] When a valid event corresponding to a notification-type interrupt upload endpoint is activated, the notification-type interrupt upload endpoint executes the following in sequence through the pipeline: sends an ERDY transaction packet to the host, receives an ACK transaction packet (ACKTP) from the host for the upload request, returns a data packet (DP) to the host, and receives an ACK transaction packet from the host for the data packet.

[0040] After each interrupt upload endpoint processes an upload transaction, the host module rebuilds a USB upload request to the host transaction queue to maintain at least two USB upload requests for each interrupt upload endpoint stored in the host transaction queue.

[0041] The host reassembles the data packets received through all pipelines into the target data stream in sequence.

[0042] Preferably, the interrupt polling time interval of the USB interrupt upload endpoint is configured to a minimum value of 1. Preferably, the BELT is set to the minimum value allowed by the USB specification through the LTM packet to improve the response speed.

[0043] Preferably, the maximum packet length of each USB interrupt endpoint is set to a minimum value that meets application requirements to improve the efficiency of the USB bus bandwidth.

[0044] like Figure 1 As shown, from T0 to T0+t represents a microframe, and a microframe is divided into three time periods. The starting point of each time period is the specified time point, as shown in FIG. Figure 1 The thick arrow on the left side indicates the designated time point, that is, T0, T0+1 / 3*t, T0+2 / 3*t are the designated time points in the microframe, and T0+t is the first designated time point in the next microframe. The actual designated time point can also be fine-tuned or arbitrarily designated according to the characteristics of the bus bandwidth in the microframe that the front is busy and the back is idle, and it does not have to be evenly distributed. At each designated time point, check whether the endpoint data is ready. If the endpoint data is ready, activate the interrupt. Figure 1 It indicates that at the second specified time point within the microframe, the interrupt data is detected to be ready, and the USB device-side chip and the host-side module perform subsequent interaction steps through the pipeline.

[0045] In theory, there doesn't need to be a one-to-one correspondence between designated time points and interrupt upload endpoints. In Figure 1, N USB interrupt upload endpoints each wait for a valid event to activate. Preferably, a time period uniquely corresponds to a USB interrupt upload endpoint. At a designated time point, if data is ready, the USB interrupt upload endpoint corresponding to that time point issues an ERDY transaction packet and transmits the data packet.

[0046] On the USB host side, through software or specialized hardware, data packets received from all interrupt upload endpoints are reassembled into a target data stream in a fixed order within each time period within a microframe. For example, data packets from an interrupt upload endpoint corresponding to the first time period within a microframe are ranked first on the host side; data packets from an interrupt upload endpoint corresponding to the second time period within a microframe are ranked second on the host side. However, if the endpoint corresponding to the first time period has no data, then data packets are ranked first on the host side. This reassembly scheme is more suitable for situations where a specific time point corresponds to a specific interrupt upload endpoint. Alternatively, data packets received from all interrupt upload endpoints can be reassembled into a target data stream directly according to the order in which each packet arrives. In other words, the device side can dynamically allocate available endpoints, rather than matching each specified time point to a fixed interrupt upload endpoint. The host side does not need to worry about which endpoint is used for transmission; what matters is timely upload.

[0047] For more precise timing, the USB device chip can locate multiple time periods based on the synchronous time stamp packet ITP and correction parameters or even PTM.

[0048] A USB transmission system includes a USB device-side chip and a host-side module. The USB device-side chip includes N interrupt upload endpoints for transmitting a target data stream, where N is a positive integer ≥ 2, and at least N-1 of the interrupt upload endpoints are configured as notification-type interrupt upload endpoints. For example, the USB device-side chip in this embodiment has three interrupt upload endpoints, all of which are notification-type interrupt upload endpoints. The notification-type interrupt upload endpoints are configured to sequentially execute the following upon activation of a valid event: send an ERDY transaction packet to a host, receive an ACK transaction packet requesting an upload initiated by the host, return a data packet to the host, and receive an ACK transaction packet acknowledging the data packet from the host. The valid event includes endpoint data being ready for the notification-type interrupt upload endpoint, and the endpoint data is from the target data stream.

[0049] The USB host module is a program product or hardware module installed on the host, which is used to sequentially reassemble the data packets received from all interrupt upload endpoints into the target data stream. The program product includes a computer program that can achieve the above functions when executed by the host processor.

[0050] In order to accurately determine each specified time point and detect whether the endpoint data is ready at the specified time point, the USB device chip also needs to include a USB microframe interval timer to determine the specified time point within each microframe and determine whether a valid event is activated at the specified time point.

[0051] In existing technology, USB interrupt transmissions have a higher bandwidth priority. After the start of each microframe (125μs) for High-Speed ​​USB and SuperSpeed ​​USB, high-priority transmissions such as USB interrupt transmissions are prioritized. USB bulk transmissions and other processes are then scheduled for the remaining time within the microframe. However, USB interrupt transmissions can only transmit a maximum of one data packet per microframe, usually at the beginning of the microframe interval. Therefore, the response time of USB interrupt transmissions is limited by the length of the microframe.

[0052] In this embodiment, three interrupt upload (IN) endpoints are configured on the USB device chip, all configured as notification interrupt upload endpoints. Each notification interrupt upload endpoint waits for a valid event to activate. Upon activation, the notification endpoint issues an ERDY transaction packet, the host issues a request ACK transaction packet, the notification endpoint returns a data packet, and the host issues an ACK transaction packet in response to the data packet. The USB host aggregates the data packets from each interrupt upload endpoint sequentially into a single target data stream. In contrast, conventional designs assign each USB endpoint to a single USB pipe, corresponding to a functional data stream. This embodiment breaks this convention by including multiple USB interrupt upload endpoints in hardware and logically establishing multiple USB pipes. Software on the USB host aggregates the data from these multiple USB pipes into a single target data stream. When real-time data is ready but misses a specific time, asynchronous transmission is triggered by a USB interrupt upload endpoint at the next specified time. This means the response time is the interval between the two specified time points. If the specified time points are evenly distributed within a microframe, the response time is equivalent to one-Nth of the microframe duration.

[0053] Example 2:

[0054] The difference between the second embodiment and the first embodiment is that the three interrupt upload endpoints of the USB device chip in the second embodiment include one non-notification interrupt upload endpoint and two notification interrupt upload endpoints. Figure 2As shown, the beginning of the first time period of a microframe corresponds to a non-notification interrupt upload endpoint, while the beginnings of the second and third time periods each correspond to a notification interrupt upload endpoint. At the beginning of a microframe, the non-notification interrupt upload endpoint receives an upload request ACK transaction packet from the host. If the non-notification interrupt upload endpoint's data is ready, it returns a data packet to the host and then receives an ACK transaction packet from the host in response to the data packet. If the non-notification interrupt upload endpoint's data is not ready, it can return a transaction packet containing information indicating no data, as agreed with the host (such as a zero-length packet), or send an NRDY transaction packet to the host, but must subsequently send an ERDY transaction packet to recover. In other words, the endpoint corresponding to the beginning of the first of the N time periods within a microframe can be either a notification interrupt upload endpoint, with notification initiated asynchronously by the device, or a traditional non-notification interrupt upload endpoint, with the host actively initiating transmission at the start of a new microframe. This is because non-notification interrupt upload endpoints default to transmitting at the beginning of a microframe interval.

[0055] At the beginning of the third time period T0+2 / 3*t, the endpoint data is detected to be ready, and the notification interrupt upload endpoint sends an ERDY transaction packet to the host. The host initiates the upload by requesting an ACK transaction packet. The endpoint returns a data packet, and the host sends an ACK transaction packet in response to the data packet.

[0056] from Figure 2 As can be seen, the second and third time periods occupy one more ERDY than the first time period, so the actual specified time points can also be fine-tuned to offset such differences.

[0057] Example 3:

[0058] The difference between the third embodiment and the first or second embodiment is that the third embodiment does not specify a fixed time point for detection, but activates the interrupt when a request for the device to upload data is detected in real time and the endpoint data is ready. Figure 3 As shown, at T1 and T2, a request for the device to upload data is detected and the endpoint data is ready. At this time, the notification interrupt upload endpoint sends an ERDY transaction packet to the host, and the host sends a request ACK transaction packet. The endpoint returns a data packet, and the host sends an ACK transaction packet in response to the data packet.

[0059] The advantage of this embodiment is that data is sent as it arrives, which is more real-time. However, the disadvantage is that a sufficient number of endpoints are required to ensure the real-time nature of the next adjacent data, otherwise there will be no endpoints available for the next data. If the data is sporadic and does not occur adjacently, the method of this embodiment is more suitable.

Claims

1. A USB data packet transmission method, characterized in that: The following steps are involved: The USB device chip defines N interrupt upload endpoints for transmitting target data streams, where N is a positive integer ≥ 2, and at least N-1 interrupt upload endpoints are configured as notification-type interrupt upload endpoints. The host-side module establishes N pipelines; Each notification interrupt upload endpoint of the USB device chip waits for a valid event to be activated, wherein the valid event is the detection of endpoint data ready at a specified time point within a microframe, and the endpoint data comes from a target data stream; When a valid event corresponding to a notification-type interrupt upload endpoint is activated, the notification-type interrupt upload endpoint executes in sequence through the pipeline: sends an ERDY transaction packet to the host, receives an ACK transaction packet for the host to initiate an upload, returns a data packet to the host, and receives an ACK transaction packet for the host's response to the data packet; The host module reassembles the data packets received through all pipelines into the target data stream in sequence.

2. The USB data packet transmission method according to claim 1, wherein: A microframe is equally divided into N time periods, and the starting point of each time period starting from the second time period is the designated time point.

3. The USB data packet transmission method according to claim 2, wherein: Each time period uniquely corresponds to an interrupt upload endpoint, and each designated time point starting from the second time period uniquely corresponds to a notification-type interrupt upload endpoint.

4. The USB data packet transmission method according to any one of claims 1 to 3, characterized in that: The host module reassembles the data packets received from all interrupt upload endpoints into the target data stream according to the actual arrival order of each data packet.

5. The USB data packet transmission method according to claim 3, wherein: The host module reassembles the data packets received from all interrupt upload endpoints into the target data stream according to the sequence of each time period in the microframe.

6. The USB data packet transmission method according to any one of claims 1 to 3, characterized in that: The N interrupt upload endpoints include a non-notification interrupt upload endpoint. At the beginning of a microframe, the non-notification interrupt upload endpoint receives the upload request ACK transaction packet initiated by the host. If the data of the non-notification interrupt upload endpoint is ready, it returns a data packet to the host and then receives the host's response ACK transaction packet to the data packet.

7. The USB data packet transmission method according to any one of claims 1 to 3, characterized in that: After the pipeline is established, the host module presets at least two USB upload requests for each interrupt upload endpoint to the host transaction queue, waiting for the USB device to upload data; After each interrupt upload endpoint processes an upload transaction, the host module rebuilds a USB upload request to the host transaction queue.

8. A USB transmission system, characterized in that: The USB device chip comprises a USB host module, wherein the USB device chip comprises N interrupt upload endpoints for transmitting a target data stream, where N is a positive integer ≥ 2, and at least N-1 interrupt upload endpoints are configured as notification-type interrupt upload endpoints. The notification-type interrupt upload endpoint is used to sequentially execute the following after a valid event is activated: sending an ERDY transaction packet to the host, receiving an ACK transaction packet for a request to upload initiated by the host, returning a data packet to the host, and receiving an ACK transaction packet for the host's response to the data packet; the valid event is detecting that the endpoint data is ready at a specified time point within a microframe, and the endpoint data comes from a target data stream; The USB host module is a program product or hardware module installed on the host, and is used to sequentially reassemble the data packets received from all interrupt upload endpoints into a target data stream.

9. The USB transmission system according to claim 8, wherein: The USB device chip also includes a USB microframe interval timer, which is used to determine a specified time point within each microframe and determine whether a valid event is activated at the specified time point.

Citation Information

Patent Citations

  • Device and method for carrying out transmission via universal serial bus channel

    CN1885747A

Cited By

  • HID data uploading system and method thereof

    CN122340145A

  • Hid data upload system and method

    CN122340145B