Hid data upload system and method
By combining HID devices with dongle devices and utilizing a combination of USB 2.0 and USB 3.0 transmission methods, multiple data transmission transactions are performed within a microframe cycle. This solves the problem of insufficient real-time data upload performance of HID devices, enables high refresh rate data transmission, reduces costs, and improves signal quality.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- NANJING QINHENG MICROELECTRONICS CO LTD
- Filing Date
- 2026-06-03
- Publication Date
- 2026-07-03
AI Technical Summary
In existing USB communication, the real-time data upload performance of HID devices is weak, and the data packet refresh rate is difficult to meet the refresh requirements of 16kHz or higher.
The solution employs a combination of HID devices and dongle devices. The HID devices and dongle devices are connected via a first-speed USB 2.0 high-speed or USB 2.0 full-speed connection, while the dongle devices and computers are connected via a second-speed USB 3.0 ultra-high-speed connection. By performing multiple data transfer transactions within a microframe cycle, the data refresh rate is improved.
It improves the real-time performance of HID data upload and the data packet refresh rate, reduces costs, enhances signal quality and transmission distance, is compatible with ordinary USB2 chips, and simplifies circuit design.
Smart Images

Figure CN122340145A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of USB communication technology, and in particular relates to an HID data upload system and method. Background Technology
[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 transmission cannot guarantee bus bandwidth and real-time performance, and has a low priority; USB Isochronous transmission is more real-time but lacks acknowledgment and retransmission mechanisms, so it cannot guarantee reliability; USB Interrupt transmission can balance real-time performance and reliability.
[0003] In existing technologies, USB interrupt transfers have high bandwidth priority. High-speed USB and Ultra-high-speed USB prioritize high-priority transfers such as USB interrupt transfers after each microframe (125μs) begins, with the remaining time within the microframe used for USB bulk transfers. However, the standard USB specification stipulates that USB interrupt transfers can only transmit a maximum of one data packet per microframe. Even with high-bandwidth transfers, a maximum of three data packets can be uploaded within a microframe, but these three packets must be consecutive. Therefore, the response time of USB interrupt transfers is limited by the duration of the microframe; that is, the real-time performance of USB interrupt transfers is limited by the granularity of a single frame. Specifically, USB 2.0 full speed (abbreviated as USB2) has a frame interval of 1ms, so the response time guaranteed by interrupt transmission is 1ms; USB 2.0 high speed (abbreviated as USB2) has a microframe interval of 125μs, and the bus interval (equivalent to the micro-frame of high speed USB, collectively referred to as microframe) of USB 3.x (abbreviated as USB3, including USB 3.0 to USB 3.2 and other equivalent USB) is also 125μs. Therefore, the response time guaranteed by interrupt transmission of high speed and high speed USB is 125μs. In other words, if an interrupt data packet cannot be transmitted in time within the current microframe, it can only wait for the next microframe.
[0004] To ensure bandwidth, devices that periodically transmit data, such as USB HID, typically utilize USB interrupt transmission to reliably and promptly upload HID data packets to the computer (USB host). In HID applications, a response time of 125μs is equivalent to a data refresh rate of 8kHz, also known as the data reporting rate, which means a maximum of 8K data reports per second. This is insufficient 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 of USB data upload and low refresh rate of data packets uploaded by HID devices in the prior art, the present invention provides an HID data upload system and method.
[0006] Technical solution: An HID data upload system, comprising:
[0007] HID device, including a first USB module with a first speed and a first USB interface;
[0008] The dongle device includes a first USB module with a first speed, a second USB device module with a second speed, and a second USB interface with a second speed. The second USB device module is electrically connected to the computer through the second USB interface.
[0009] A first-speed USB transmission cable, with its first end electrically connected to the first USB interface of the HID device and its second end electrically connected to the first USB module of the dongle device.
[0010] The HID device and the dongle device transmit data at a first rate, and the dongle device and the computer transmit data at a second rate, which is greater than the first rate and can perform N transmission transactions within one microframe period, where N≥2.
[0011] Furthermore, the first USB module of the dongle device is a first USB host module, and the first USB module of the HID device is a first USB device module; the first USB host module is used to initiate a transmission transaction every T / N time intervals, where T is the microframe period duration.
[0012] Furthermore, the first USB module of the dongle device is a first USB device module; the first USB module of the HID device is a first USB host module; the first USB host module is used to initiate a transmission transaction every T / N time interval when there is HID data to be transmitted, where T is the microframe period duration.
[0013] Furthermore, the second end of the USB transmission line is embedded in the dongle device and electrically connected to the first USB module inside the dongle device. The USB transmission line and the dongle device are combined into an integrated dongle device with a cable.
[0014] Furthermore, the first speed shall not exceed 480Mbps, and the second speed shall not be less than 5Gbps.
[0015] A method for uploading HID data includes a dedicated connection transmission step, wherein the dedicated connection transmission step includes:
[0016] The microframe period is divided into N time periods, where N≥2, and a transmission transaction can be performed in each time period.
[0017] The transmission transaction includes: the HID device transmitting HID data to the dongle device via a USB cable at a transmission rate not exceeding a first rate; the dongle device receiving the HID data and uploading the HID data to the computer at a second rate; the second rate being greater than the first rate.
[0018] Furthermore, the HID device and the dongle device can perform a USB bulk transfer or USB interrupt transfer every T / N time interval, where T is the microframe period. The dongle device and the computer use USB interrupt transfer. Whenever the dongle device receives HID data, it sends an ERDY signal to the computer, receives a signal from the computer requesting HID data, and uploads the HID data to the computer.
[0019] Furthermore, the HID device operates in USB device mode. During each time period, the dongle device will initiate a USB transmission to the HID device. If the HID device has HID data to be transmitted, it will transmit the HID data to the dongle device.
[0020] Furthermore, the HID device operates in USB host mode. In each time period, if the HID device has HID data to be transmitted, it initiates a USB transmission to the dongle device to transmit the HID data to the dongle device.
[0021] Furthermore, prior to the dedicated connection transmission step, a connection determination step is included, which includes:
[0022] The HID device detects whether it receives the agreed USB control transmission with the dongle device. If the agreed USB control transmission is received, it is determined to be a dedicated connection and the dedicated connection transmission steps are executed. If the agreed USB control transmission is not received, it is determined to be a standard USB connection and the transmission is performed via USB interrupt according to the standard USB specification.
[0023] Furthermore, in the connection determination step, after the HID device is reset, it defaults to a standard USB connection. Based on the detection results, it selects to execute a dedicated connection transmission step or to transmit via USB interrupt according to the standard USB specification.
[0024] Furthermore, each time period is further divided into a first part and a second part. The first part is used to transmit HID data, and the second part is used for occasional transmission.
[0025] Compared with existing technologies, the HID data upload system and method provided by this invention have the following advantages:
[0026] (1) The HID data upload system includes two physical devices: an HID device and a dongle device. The signal is transmitted in two segments. The HID device and the dongle device use a dedicated connection with a first-rate interface, employing a first rate of no more than 480Mbps, such as USB 2.0 high-speed or USB 2.0 full speed, and perform point-to-point transmission according to the agreed-upon method of this invention to ensure bandwidth and real-time performance. The dongle device and the computer use a second-rate connection, which typically does not require a transmission cable. The second rate is no less than 5Gbps. The specific data upload method at this stage can adopt methods such as CN120123280B. Compared with the traditional solution where the HID device uploads data via USB2, this invention improves the real-time performance of USB data upload and the refresh rate of the uploaded data packets, and can upload data at a refresh rate much higher than 8KHz. Compared with the traditional solution where the HID device connects to the computer with a USB3 transmission cable and uses USB3 rates such as 5Gbps or even 10Gbps, this invention only requires a USB2 transmission cable, resulting in lower cost, better signal quality, and longer transmission distance.
[0027] (2) HID typically uses a Type-C female port to reduce size and facilitate use. If a traditional HID device is connected to a computer via a USB3 cable, the HID's C female port needs to be equipped with a USB3 channel Type-C automatic switching chip or a USB3 chip that natively supports two channels of the C port. However, in the solution of this invention, the HID's C female port does not require channel switching, is compatible with ordinary USB2 chips, has low cost, and has a simple circuit.
[0028] (3) Preferably, the HID device can default to a standard high-speed USB connection. If the HID device receives a USB control transmission agreed upon with the dongle device on the other end, it determines that it is a dedicated connection, thus enabling the same HID device to adapt to two external connections. If a regular USB2 cable is used to connect to the computer, data is uploaded at a refresh rate of 8kHz; if the connection to the computer is made through the dongle device in this invention, data can be uploaded at a refresh rate much higher than 8kHz. In this case, the HID device, as a common component, reduces R&D costs; the dongle device can be considered an optional accessory, providing added value. Attached Figure Description
[0029] Figure 1 This is a structural diagram of the HID data upload system in Example 1;
[0030] Figure 2 This is a structural diagram of the HID data upload system in Example 2;
[0031] Figure 3 This is a structural diagram of the HID data upload system in Example 3;
[0032] Figure 4 This is a schematic diagram of the HID data upload process in Example 1;
[0033] Figure 5 This is a schematic diagram of the HID data upload process in Example 2. Detailed Implementation
[0034] The present invention will be further explained and described below with reference to the accompanying drawings and specific embodiments.
[0035] Example 1:
[0036] An HID data upload system, such as Figure 1 As shown, it includes a HID device, a dongle device, and a USB cable:
[0037] HID device, including a first USB module with a first speed and a first USB interface;
[0038] The dongle device includes a first USB module with a first speed, a second USB device module with a second speed, and a second USB interface with a second speed. The second USB device module is electrically connected to the computer through the second USB interface. As a dongle design, no transmission cable is required between the second USB interface and the computer's USB port, saving cable costs and improving signal quality.
[0039] A USB cable with a first-speed transmission line has its first end electrically connected to the first USB interface of the HID device, and its second end electrically connected to the first USB module of the dongle device. In this embodiment, the USB cable is two meters long.
[0040] The HID device and the dongle device transmit data at a first rate, and the dongle device and the computer transmit data at a second rate, which is greater than the first rate and can perform N transmission transactions within one microframe period, where N≥2.
[0041] The first speed does not exceed 480Mbps, such as USB2 full speed or USB2 high speed. Data transmission latency is too high at 12Mbps, therefore this embodiment preferably uses 480Mbps to fully utilize existing hardware resources. The second speed is not less than 5Gbps, such as USB3 Ultra in this embodiment. In this embodiment, the first USB interface is a USB 2.0 interface, the first USB module is a USB 2.0 high-speed module, the second USB device module is a USB 3.2 Gen1 Ultra-high-speed device module, and the second USB interface is a USB 3.0 interface. The USB cable is a USB 2.0 cable, which has lower cost, better signal quality, and longer transmission distance compared to a USB 3.0 cable.
[0042] In the first USB module of the HID device and the first USB module of the dongle device, one of the USB modules should be a USB host module, and the other should be a USB device module. The USB host module is capable of initiating N USB interrupt transmissions within one microframe period. That is, the interval between initiating USB interrupt transmissions is 1 / N of the interval between initiating USB interrupt transmissions in a standard USB connection, thus enabling N transmission transactions within one microframe period.
[0043] In this embodiment, the HID device operates in USB device mode, and the first USB module in the HID device is a first USB device module (USB2 device module). The first USB module of the Dongle device is a first USB host module (USB2 host module); the first USB host module is used to initiate a transmission transaction every T / N time interval, where T is the microframe period duration, and therefore should also include a timer (not shown in the figure). The USB2 host module of the Dongle device is an improvement based on the conventional USB2 host, and is no longer limited by the minimum interval of high-speed USB interrupt transmission defined by the USB specification. Its interval for initiating USB interrupt transmission is 1 / N of the interval for initiating USB interrupt transmission when the computer initiates USB interrupt transmission in a standard USB connection, thereby increasing the data refresh rate by N times.
[0044] This HID data upload system comprises two physical devices: an HID device and a dongle device. Signal transmission is divided into two segments: 1. A dedicated connection with a first-rate interface is used between the HID device and the dongle device, employing a USB 2.0 high-speed or full-speed connection at a rate not exceeding 480Mbps, following the agreed-upon point-to-point transmission method described in this embodiment to ensure bandwidth and real-time performance. 2. A USB 3.0 connection is used between the dongle device and the computer, typically requiring no cable, with a speed of at least 5Gbps. Specific data upload methods for this stage can employ methods such as CN120123280B. Compared to traditional solutions where the HID device connects to the computer via a USB 3.0 cable and uses USB 3.0 speeds of 5Gbps or even 10Gbps, this HID data upload system only requires a USB 2.0 cable, resulting in lower cost, better signal quality, and longer transmission distance.
[0045] Optionally, the HID data transmitted at the second rate can be generated based on the HID data transmitted at the first rate, rather than being copied exactly. For example, the HID data transmitted at the first rate may only contain the necessary data or the changed parts, thereby improving transmission efficiency. The HID data transmitted at the second rate may then use this data, with the addition of preambles and other information, to generate complete HID data that conforms to the HID report format.
[0046] To achieve the above functions, the Dongle device will also include a processor and a memory, both of which are connected to the first USB host module and the second USB device module.
[0047] A method for uploading HID data includes a dedicated connection transmission step, wherein the dedicated connection transmission step includes:
[0048] Dividing the microframe period T into N time periods, where N>=2, allows for evenly spaced division to achieve better real-time performance, similar to the interval between bus departures. For example, dividing T evenly into 5 parts ensures a response time of 125 / 5=25µs, increasing the data reporting rate by 5 times. In this embodiment, the HID device operates in USB device mode. Within each time period, regardless of whether the HID device has HID data to be transmitted, the USB2 host module of the dongle device attempts to obtain HID data from the HID device. If the HID device has HID data to be transmitted, the USB2 host module can obtain the HID data, using either USB interrupt transmission or USB bulk transmission, with a signal rate not exceeding 480Mbps. The dongle device receives the HID data and then uploads it to the computer via the USB3 device module using USB3 Ultra High Speed USB Interrupt transmission, with a signal rate of 5Gbps or 10Gbps, or other rates conforming to the USB 3.x specification.
[0049] Specifically, such as Figure 4 As shown, the transmission transaction includes:
[0050] If the Dongle device initiates a HID data request, and the HID device has HID data to transfer, it will transmit the HID data to the Dongle device via the USB cable. The transmission rate at this stage will not exceed 480Mbps, and can utilize USB high-speed bulk transfer or USB high-speed interrupt transfer. Upon receiving the HID data, the Dongle device sends an ERDY signal to the computer. The computer then sends a signal requesting HID data, and the Dongle device uploads the HID data to the computer. The transmission rate at this stage will be no less than 5Gbps. If the HID device does not have HID data to transfer at this time, it will respond to the Dongle device with a NAK signal via the USB cable. Upon receiving the NAK, the Dongle device will not send an ERDY signal to the computer.
[0051] Each time period can be further divided into a first part and a second part. The first part is used to transmit HID data, which requires real-time processing and is periodic, so it is processed first. The second part is used for occasional transmissions such as USB control transmission and HID type transmission, which can be postponed to the second part of the next time period if necessary.
[0052] Since a point-to-point connection is established between the dongle device and the HID device via a USB2 transmission line, regardless of whether bulk or interrupt transmission is used, as long as HID data is transmitted in a timely manner according to the agreed schedule within each time period, the transmission bandwidth and real-time performance of the HID data from the perspective of the entire system can be fully guaranteed. Interrupt transmission is preferred to facilitate automatic adaptation to standard high-speed USB connections. Alternatively, other transmission methods besides bulk and interrupt transmission, or even non-USB transmission, can be used. In this embodiment, the HID device only uses USB2-level signal transmission, without directly handling RF-level signals such as USB3 or switching the USB3 signal channel of the Type-C female port. This results in a simple circuit, easy PCB design, and low cost.
[0053] Furthermore, prior to the aforementioned dedicated connection transmission step, a connection determination step may be included to determine whether the USB connection is a standard high-speed USB connection or a dedicated connection, thereby achieving functional adaptability. The connection determination step includes:
[0054] The HID device detects whether it receives a USB control transmission agreed upon with the dongle device, such as a vendor control transmission. If the agreed USB control transmission is received, it is determined to be a dedicated connection, and the dedicated connection transmission steps described above are executed. If the agreed USB control transmission is not received, it is determined to be a standard high-speed USB connection, and data packets are uploaded to the computer via high-speed USB interrupt transmission at a period of 125us, as specified in the USB specification for high-speed USB microframes.
[0055] In the connection determination step, preferably, after the HID device is reset, it defaults to a standard high-speed USB connection. Based on the detection result, it selects to execute a dedicated connection transmission step or transmit data via USB interrupt according to the standard USB specification. This allows the same HID device to adapt to two types of external connections: if connected to a computer via a standard USB 2.0 cable, data is uploaded at an 8kHz refresh rate; if connected to a computer via the dongle device in this embodiment, data can be uploaded at a refresh rate much higher than 8kHz. In this case, the HID device, as a common, universal component, reduces development costs, while the dongle device can be considered an optional accessory, providing added value.
[0056] Example 2:
[0057] The difference between Example 2 and Example 1 is that, as shown in Example 2... Figure 2As shown in Embodiment 2, the HID device operates in USB host mode. The first USB module of the HID device is a first USB host module (USB2 host module), and the first USB module of the dongle device is a first USB device module (USB2 device module). The first USB host module is used to initiate a transmission transaction every T / N time interval when there is HID data to be transmitted, where T is the microframe period length, and N≥2, therefore a timer (not shown in the figure) should also be included.
[0058] The USB2 host module of the HID device is an improvement on the conventional USB2 host. It is no longer limited by the minimum interval of high-speed USB interrupt transmission defined by the USB specification. Its interval for initiating USB interrupt transmission is 1 / N of the interval for initiating USB interrupt transmission when the computer initiates USB interrupt transmission in a standard USB connection, thereby increasing the data refresh rate by N times.
[0059] In this embodiment, the first USB interface is a USB 2.0 interface, the first USB module is a USB 2.0 device module, the second USB device module is a USB 3.0 Ultra High Speed device module, and the second USB interface is a USB 3.0 interface. The USB transmission cable is a USB 2.0 cable. Compared with USB 3.0 cables, USB 2.0 cables have lower costs, better signal quality, and longer transmission distances.
[0060] Optionally, the dongle device also has a second USB 2.0 device module, which, together with the USB 3.0 Ultra High Speed device module, connects to the computer via a USB 3.0 interface.
[0061] A method for uploading HID data includes a dedicated connection transmission step, wherein the dedicated connection transmission step includes:
[0062] Dividing the microframe period T into N time periods, where N≥2, allows for even distribution to achieve better real-time performance, analogous to the interval between bus departures. For example, dividing it evenly into 5 parts ensures a response time of 125 / 5 = 25µs, increasing the data reporting rate by 5 times. Within each time period, i.e., every T / N time interval, if the HID device has HID data to be transmitted, a transmission transaction can be initiated. For instance, in this embodiment, the HID device operates in USB host mode. Within each time period, if the HID device has HID data to be transmitted, it initiates a USB transmission to the dongle device via the USB2 host module, transferring the HID data to the dongle device. This can be done using USB interrupt transmission or USB bulk transmission, with a signal rate not exceeding 480Mbps. The dongle device receives the HID data and then uploads it to the computer via the USB3 device module using USB3 Ultra High Speed USB Interrupt transmission, with a signal rate of 5Gbps or 10Gbps, or other rates conforming to the USB 3.x standard. If the HID device does not have HID data to be transmitted at that time, the HID device's USB2 host module will not initiate a USB transmission.
[0063] Specifically, such as Figure 5 As shown, the transmission transaction includes:
[0064] If the HID device has HID data to be transmitted, it transmits the HID data to the dongle device via the USB cable. The transmission rate at this stage does not exceed a first rate, and can employ USB high-speed bulk transfer or USB high-speed interrupt transfer. Upon receiving the HID data, the dongle device sends an ERDY request to the computer. The computer then sends an HID data request, and the dongle device uploads the HID data to the computer. The transmission rate at this stage is no less than a second rate, which is greater than the first rate. If the HID device does not have HID data to be transmitted at this time, it will not send HID data to the dongle device, and the dongle device will not send an ERDY request to the computer.
[0065] This embodiment may also include a connection determination step before the dedicated connection transmission step described above, determining whether the USB connection is a standard high-speed USB connection or a dedicated connection. See Embodiment 1 for details.
[0066] Example 3:
[0067] The difference between Embodiment 3 and Embodiment 1 is that in Embodiment 3, the second end of the USB transmission line is embedded in the dongle device and electrically connected to the first USB module within the dongle device. The USB transmission line and the dongle device are combined into an integrated dongle device with a cable, as shown below. Figure 3As shown, this can save the first USB port (USB 2.0 port) in the dongle device.
Claims
1. A HID data upload system, characterized by, include: HID device, including a first USB module with a first speed and a first USB interface; The dongle device includes a first USB module with a first speed, a second USB device module with a second speed, and a second USB interface with a second speed. The second USB device module is electrically connected to the computer through the second USB interface. A first-speed USB transmission cable, with its first end electrically connected to the first USB interface of the HID device and its second end electrically connected to the first USB module of the dongle device. The HID device and the dongle device transmit data at a first rate, and the dongle device and the computer transmit data at a second rate, which is greater than the first rate and can perform N transmission transactions within one microframe period, where N≥2.
2. The HID data upload system according to claim 1, characterized in that, The first USB module of the dongle device is the first USB host module, and the first USB module of the HID device is the first USB device module; the first USB host module is used to initiate a transmission transaction every T / N time intervals, where T is the microframe period duration.
3. The HID data upload system according to claim 1, characterized in that, The first USB module of the dongle device is a first USB device module; the first USB module of the HID device is a first USB host module; the first USB host module is used to initiate a transmission transaction every T / N time interval when there is HID data to be transmitted, where T is the microframe period duration.
4. The HID data upload system according to any one of claims 1 to 3, characterized in that, The second end of the USB transmission line is embedded in the dongle device and electrically connected to the first USB module inside the dongle device. The USB transmission line and the dongle device are combined into an integrated dongle device with a cable.
5. The HID data upload system according to any one of claims 1 to 3, characterized in that, The first speed shall not exceed 480Mbps, and the second speed shall not be less than 5Gbps.
6. A method for uploading HID data, characterized in that, This includes a dedicated connection transmission step, which includes: The microframe period is divided into N time periods, where N≥2, and a transmission transaction can be performed in each time period. The transmission transaction includes: the HID device transmitting HID data to the dongle device via a USB cable at a first transmission rate; the dongle device receiving the HID data and uploading the HID data to the computer at a second transmission rate; the second transmission rate is greater than the first transmission rate.
7. The HID data upload method according to claim 6, characterized in that, Between the HID device and the dongle device, a USB bulk transfer or USB interrupt transfer can be performed every T / N time interval, where T is the microframe period. The dongle device and the computer use USB interrupt transfer. Whenever the dongle device receives HID data, it sends an ERDY signal to the computer, receives a signal from the computer requesting HID data, and uploads the HID data to the computer.
8. The HID data upload method according to claim 6 or 7, characterized in that, The HID device operates in USB device mode. During each time period, the dongle device will initiate a USB transfer to the HID device. If the HID device has HID data to be transferred, it will transfer the HID data to the dongle device.
9. The HID data upload method according to claim 6 or 7, characterized in that, The HID device operates in USB host mode. In each time period, if the HID device has HID data to be transmitted, it initiates a USB transmission to the dongle device to transmit the HID data to the dongle device.
10. The HID data upload method according to claim 6 or 7, characterized in that, Before the dedicated connection transmission step, a connection determination step is also included, which includes: The HID device detects whether it receives the agreed USB control transmission with the dongle device. If the agreed USB control transmission is received, it is determined to be a dedicated connection and the dedicated connection transmission steps are executed. If the agreed USB control transmission is not received, it is determined to be a standard USB connection and the transmission is performed via USB interrupt according to the standard USB specification.
11. The HID data upload method according to claim 10, characterized in that, During the connection determination process, after the HID device is reset, it defaults to a standard USB connection. Based on the detection results, it selects to perform a dedicated connection transmission step or to transmit via USB interrupt according to the standard USB specification.
12. The HID data upload method according to claim 6 or 7, characterized in that, Each time period is further divided into a first part and a second part. The first part is used to transmit HID data, and the second part is used for occasional transmission.