Usb bandwidth extension method, device and readable storage medium

By constructing a USB virtual bus and a data transmission method for the extended end, the problem of USB bandwidth expansion for computing hosts was solved, enabling flexible and convenient USB bandwidth expansion, reducing hardware costs and latency risks, and ensuring business stability.

CN116909966BActive Publication Date: 2025-12-05FUJIAN CENTM INFORMATION
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310803288.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-07-03
Publication Date
2025-12-05
Estimated Expiration
2043-07-03

AI Technical Summary

Technical Problem

In existing technologies used in scenarios such as bank counters and industrial control, the computing host cannot effectively expand USB bandwidth, resulting in multiple USB peripherals being unable to be connected and driven simultaneously, affecting business operations. Furthermore, existing solutions suffer from poor flexibility, high costs, or insufficient stability.

Method used

By constructing a USB virtual bus, data transmission is performed using the first and second USB buses on the extended end, generating device nodes, and enabling information transmission and control between the host and peripherals. This avoids direct data transmission and reduces hardware costs and space occupation.

Benefits of technology

It enables flexible expansion of USB bandwidth without modifying the host system and business software, improves the host's USB bus connectivity, reduces latency risks, and ensures business stability and flexibility.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116909966B_ABST
    Figure CN116909966B_ABST
Patent Text Reader

Abstract

The application provides a USB bandwidth expansion method, device and readable storage medium, by adding an expansion end, data transmission is not directly performed between a host and peripherals, but data transmission is performed between the host and the expansion end through a first USB bus and a second USB bus, when the host needs to be connected with multiple peripherals, the number of USB buses of the expansion end is only needed to be increased, USB bandwidth expansion of the host can be realized, thus avoiding modification of a mainboard or internal space of the host, and flexibility of USB bandwidth use of the host is improved. Meanwhile, corresponding device nodes are generated on a USB virtual bus according to device information of the peripherals in the host, the peripherals can convert operation requests of the host and response information of the expansion end through the USB virtual bus although the peripherals are connected to the expansion end, information transmission between the host and the peripherals can be realized, and thus control on the peripherals is realized. The bandwidth expansion method does not need multiple hosts to be cooperatively connected with the peripherals, and hardware cost and space occupation are reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of universal serial bus communication technology, and in particular to a USB bandwidth extension method, apparatus, and readable storage medium. Background Technology

[0002] With the increasing level of informatization, computer mainframes are widely used in various industries. Most computer mainframes are equipped with USB (Universal Serial Bus), supporting USB peripheral access and providing multiple USB ports. Although computer mainframes provide multiple USB ports, they are actually derived from one internal USB 3.0 or higher standard bus and one or two USB 2.0 buses extended through a hub. In other words, multiple ports share the same bus bandwidth. However, bandwidth sharing between ports has certain limitations: bandwidth resources of different buses cannot be shared. That is, all peripherals connected to USB bus A can only share the bandwidth resources of USB bus A, regardless of whether the bandwidth resources of USB bus B are available. Furthermore, peripherals with different communication protocol standards can only use the bandwidth resources of their corresponding standard; they cannot use resources from higher standards. For example, a USB 2.0 device connected to a USB 3.0 or higher standard bus can only use its USB 2.0 bandwidth and cannot use the bandwidth resources of the USB 3.0 or higher standard bus.

[0003] Furthermore, theoretically, USB 2.0 provides a bus bandwidth of 480 Mbps, USB 3.2 Gen 1 provides 5 Gbps, USB 3.2 Gen 2 provides 10 Gbps, and USB 3.2 Gen 2 x 2 provides 20 Gbps. Considering protocol losses, USB 2.0 provides 426 Mbps, USB 3.2 Gen 1 provides 4 Gbps, USB 3.2 Gen 2 provides 9.70 Gbps, and USB 3.2 Gen 2 x 2 provides 19.39 Gbps. These bus bandwidths (USB 2.0, USB 3.2 Gen 1, USB 3.2 Gen 2, and USB 3.2 Gen 2 x 2) represent usable data bandwidth, meaning the actual bandwidth capable of transmitting useful information after deducting protocol and verification losses. In actual use, the system will reserve 20% of the USB 2.0 bandwidth. Therefore, the actual usable bandwidth of USB 2.0 is relatively limited, and there is still a 12-fold bandwidth gap compared to the minimum speed of the standard higher than USB 2.0. However, based on the communication data volume requirements of USB peripherals themselves and cost considerations, peripherals with existing functions still mainly use the USB 2.0 communication protocol.

[0004] In current scenarios such as bank teller services and industrial control, the host computer usually needs to connect multiple peripherals based on USB 2.0 to work together to complete a task. These peripherals, such as cameras, require fixed bandwidth if synchronous or interrupted communication is used. High-definition cameras and other peripherals often require a lot of bandwidth. Therefore, the total bandwidth demand of the business peripherals may exceed the USB bandwidth capacity limit of the host computer, making it impossible for the business peripherals to be connected and driven at the same time, thus affecting the operation of the business.

[0005] Existing technologies generally employ two solutions to expand USB bandwidth: Solution 1: Increase the number of USB 2.0 buses on the host by adding bridge chips or expansion cards. However, adding bridge chips to expand the USB 2.0 bus is a board-level solution, requiring implementation during the host's motherboard design phase. This results in poor flexibility, a long development cycle, high costs, and after the finished product is shipped, it cannot be easily modified to implement other functions. Adding expansion cards to expand the USB 2.0 bus requires the host to have pre-reserved expansion interfaces such as PCIe, and also requires corresponding internal space. In other words, Solution 1 requires different modifications to the host, making the functionality tied to the host and lacking flexibility. Solution 2: Multiple hosts connect to different peripherals and then connect and forward data via network protocols to collaboratively complete tasks. However, multiple hosts collaborating increases hardware costs and space usage; the network connection latency between hosts is unstable, easily affecting the stability of services with high real-time requirements; furthermore, existing business software cannot be used directly and requires modification and adaptation. Summary of the Invention

[0006] The technical problem to be solved by the present invention is to provide a USB bandwidth extension method, device and readable storage medium, which can flexibly and conveniently extend the USB bandwidth of the computing host without modifying or adapting existing business applications, improve the USB bus connectivity of the host, and ensure the normal access of multiple USB peripherals.

[0007] To solve the above-mentioned technical problems, the technical solution adopted by the present invention is as follows:

[0008] A USB bandwidth extension method includes the following steps:

[0009] Construct a USB virtual bus that corresponds to the standard of the first USB bus;

[0010] Device information of peripherals connected to the expansion terminal is obtained through the first USB bus and the second USB bus.

[0011] Based on the device information, device nodes corresponding one-to-one with the peripherals are generated on the USB virtual bus;

[0012] Receive the host system's operation request for the peripheral device, and send the operation request to the peripheral device according to the configuration information;

[0013] The peripheral device's response information is obtained through the first USB bus and the second USB bus, and the response information is returned to the host system through the USB virtual bus.

[0014] To solve the above-mentioned technical problems, another technical solution adopted by the present invention is as follows:

[0015] A USB bandwidth extension device includes a host end and an extension end;

[0016] The extension terminal includes an information processor, which includes a first USB bus and a second USB slave bus;

[0017] The host terminal includes a second USB host bus; the host terminal is used to construct a USB virtual bus that corresponds to the standard of the first USB bus.

[0018] One end of the second USB slave bus is connected to the second USB master bus, and the other end of the second USB slave bus is connected to one end of the first USB bus. The other end of the first USB bus is used to connect peripherals.

[0019] To solve the above-mentioned technical problems, another technical solution adopted by the present invention is as follows:

[0020] A computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the aforementioned USB bandwidth extension method.

[0021] The beneficial effects of this invention are as follows: By adding an expansion port, data transmission between the host and peripherals is no longer direct. Instead, data is transmitted between the host and the expansion port via a first USB bus and a second USB bus. Therefore, when the host needs to connect multiple peripherals, the USB bandwidth of the host can be expanded simply by increasing the number of USB buses on the expansion port, thus avoiding modifications to the host's motherboard or internal space and improving the flexibility of USB bandwidth usage. Simultaneously, a corresponding device node is generated on the USB virtual bus within the host based on the peripheral's device information. This allows the host to translate operation requests and the expansion port's response information through the USB virtual bus, enabling information transmission between the host and the peripheral, thereby achieving control of the peripheral. This bandwidth expansion method eliminates the need for multiple hosts to collaboratively connect peripherals, reducing hardware costs and space requirements. Attached Figure Description

[0022] Figure 1A flowchart illustrating the steps of a USB bandwidth extension method provided in an embodiment of the present invention;

[0023] Figure 2 This is a schematic diagram of the structure of a USB bandwidth expansion device provided in an embodiment of the present invention;

[0024] Figure 3 A software configuration diagram of a USB bandwidth expansion device provided in an embodiment of the present invention;

[0025] Label Explanation:

[0026] 1. Host side; 2. Expansion side; 3. Peripheral; 21. Information processor; 22. Bus expansion chip; 101. First USB bus; 201. Second USB slave bus; 301. Second USB master bus; 1001. Slave device driver; 1002. USB 2.0 virtual bus driver; 1003. Host system / business software; 1004. USB native bus driver; 2001. Information processing software; 2002. USB 2.0 standard bus driver; 2003. Bulk channel. Detailed Implementation

[0027] To explain in detail the technical content, objectives, and effects of the present invention, the following description is provided in conjunction with the embodiments and accompanying drawings.

[0028] Please refer to Figure 1 This invention provides a USB bandwidth extension method, comprising the following steps:

[0029] Construct a USB virtual bus that corresponds to the standard of the first USB bus;

[0030] Device information of peripherals connected to the expansion terminal is obtained through the first USB bus and the second USB bus.

[0031] Based on the device information, device nodes corresponding one-to-one with the peripherals are generated on the USB virtual bus;

[0032] Receive the host system's operation request for the peripheral device, and send the operation request to the peripheral device according to the configuration information;

[0033] The peripheral device's response information is obtained through the first USB bus and the second USB bus, and the response information is returned to the host system through the USB virtual bus.

[0034] As described above, the beneficial effects of this invention are as follows: By adding an expansion port, data transmission between the host and peripherals is not direct, but rather occurs via the first and second USB buses. Therefore, when the host needs to connect multiple peripherals, the USB bandwidth of the host can be expanded simply by increasing the number of USB buses on the expansion port, thus avoiding modifications to the host's motherboard or internal space and improving the flexibility of USB bandwidth usage. Simultaneously, a corresponding device node is generated on the USB virtual bus within the host based on the peripheral's device information. This allows the host's operation requests and the expansion port's response information to be converted via the USB virtual bus, enabling information transmission between the host and peripherals and thus achieving control over the peripherals. This bandwidth expansion method eliminates the need for multiple hosts to collaboratively connect peripherals, reducing hardware costs and space requirements.

[0035] Furthermore, the step of obtaining device information of the peripheral connected to the expansion terminal through the first USB bus and the second USB bus includes:

[0036] The device information of the peripheral connected to the expansion terminal is received through the first USB bus, and the device information is transmitted through the second USB bus.

[0037] The step of generating a device node on the USB virtual bus that corresponds one-to-one with the peripheral device based on the device information includes:

[0038] The bandwidth requirements of the peripheral device are obtained based on the device information.

[0039] Based on the bandwidth requirements and the bandwidth capacity of the first USB bus, device nodes corresponding one-to-one with the peripherals are generated on the USB virtual bus.

[0040] The total bandwidth capacity of the USB virtual bus after deducting the system reserved bandwidth is greater than or equal to the bandwidth requirement of the peripheral device.

[0041] As described above, the first USB bus on the expansion end is used to receive device information from peripherals, while the second USB bus on the expansion end is used to transmit device information from peripherals to the host. This allows data transmission between the host and the expansion end via the USB bus, avoiding communication latency issues caused by network protocols or other communication connection methods, and ensuring the stability of high real-time services. Simultaneously, the communication channel on the second USB bus, built using a batch transfer method, allows the host and the expansion end to automatically adapt to bandwidth, utilizing only the available bus bandwidth, thereby improving the host's USB bandwidth utilization.

[0042] Furthermore, after obtaining the device information of the peripheral device through the extended terminal, the process includes:

[0043] The device information is parsed through the extended terminal to obtain the communication mode and basic information of the peripheral device;

[0044] Configure the communication priority of the peripheral device according to the communication mode, and record the communication priority and basic information of the peripheral device in the configuration information.

[0045] As described above, in order to avoid the problem of large communication delays caused by some peripherals with high real-time requirements or other communication needs, the extension end receives the device information of the peripherals, parses the communication mode of the peripherals, and adjusts the communication priority of peripherals with high communication requirements, thereby realizing batch transmission and reducing communication delays.

[0046] Furthermore, the smallest data unit of the operation request is a URB packet;

[0047] The step of receiving the host system's operation request for the peripheral device and sending the operation request to the peripheral device according to the configuration information includes:

[0048] Receive the host system's operation request for the peripheral device, and generate a URB packet corresponding to the operation request on the USB virtual bus;

[0049] The URB packet is transmitted to the extended terminal through a communication channel built on the second USB bus based on the batch transmission method, and the communication priority of the peripheral corresponding to the URB packet is obtained according to the configuration information.

[0050] According to the order of the communication priority, the URB packets are sent to the peripheral device sequentially through the first USB bus.

[0051] As described above, URB packets with higher communication priority in the configuration information are transmitted to peripherals first. The communication order of peripherals can be configured through the extension terminal's configuration information, effectively avoiding communication latency issues and ensuring the stability of high real-time services.

[0052] Furthermore, the step of obtaining the response information of the peripheral device through the first USB bus and the second USB bus, and returning the response information to the host system through the USB virtual bus includes:

[0053] The system receives the response information from the peripheral device through the first USB bus and transmits the response information to the USB virtual bus through the communication channel built on the second USB bus based on the bulk transfer method.

[0054] The response information is restored to the device response corresponding to the peripheral on the USB virtual bus, and the device response is returned to the host system.

[0055] As described above, in order to achieve data transmission between the expansion device and the host, the device information received by the expansion device is converted into corresponding virtual device information and sent to the system through the USB virtual bus, thereby avoiding the host being unable to call the peripherals normally after the expansion device is added.

[0056] Furthermore, the communication mode includes synchronous communication;

[0057] The configuration of the communication priority of the peripheral device according to the communication mode includes:

[0058] If the communication mode is synchronous communication, then configure the communication priority of the peripheral device to the highest level;

[0059] Sending the operation request to the peripheral device according to the configuration information includes:

[0060] Obtain the communication priority of the peripheral device corresponding to all operation requests within a preset time period, and calculate the number of priority operation requests with the highest communication priority.

[0061] If the number of priority operation requests in the operation requests reaches a preset threshold, the priority operation requests exceeding the preset threshold will wait for the next transmission.

[0062] As described above, the communication priority of synchronous communication operation requests is higher than that of operation requests in other communication modes. However, the number of priority operation requests can only occupy a preset threshold of operation requests forwarded per unit time, thereby avoiding excessive communication delay of peripherals in synchronous communication.

[0063] Please refer to Figure 2 Another embodiment of the present invention provides a USB bandwidth extension device, including a host end and an extension end;

[0064] The extension terminal includes an information processor, which includes a first USB bus and a second USB slave bus;

[0065] The host terminal includes a second USB host bus; the host terminal is used to construct a USB virtual bus that corresponds to the standard of the first USB bus.

[0066] One end of the second USB slave bus is connected to the second USB master bus, and the other end of the second USB slave bus is connected to one end of the first USB bus. The other end of the first USB bus is used to connect peripherals.

[0067] Furthermore, the first USB bus is a USB 2.0 standard bus; the second USB master bus and the second USB slave bus are USB 3.0 or higher standard buses.

[0068] As described above, since existing peripherals primarily use the USB 2.0 communication protocol, the first USB bus between the expansion device and the peripheral still uses the USB 2.0 standard bus to avoid increasing costs. Meanwhile, the second USB bus between the expansion device and the host uses a USB 3.0 or higher standard bus, thereby increasing the available bandwidth between the expansion device and the host and improving data transmission efficiency.

[0069] Furthermore, it also includes a bus expansion chip; one end of the bus expansion chip is connected to the second USB slave bus, and the other end of the bus expansion chip is used to connect to peripherals.

[0070] As can be seen from the above description, when the number of the first USB bus on the expansion end itself is insufficient to match the number of peripherals, a corresponding number of bus expansion chips can be added to connect the peripherals, thereby avoiding the need to modify the entire device and reducing costs.

[0071] Another embodiment of the present invention provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the various steps of the USB bandwidth extension method described above.

[0072] As described above, the beneficial effects of this invention are as follows: By adding an expansion port, data transmission between the host and peripherals is not direct, but rather occurs via a first USB bus and a second USB bus between the host and the expansion port. Therefore, when the host needs to connect multiple peripherals, the USB bandwidth of the host can be expanded simply by increasing the number of USB buses on the expansion port, thus avoiding modifications to the host's motherboard or internal space and improving the flexibility of USB bandwidth usage. Simultaneously, a corresponding USB virtual bus is generated within the host based on the peripheral's device information. This allows the peripheral, although connected to the expansion port, to convert the host's operation requests and the expansion port's response information via the USB virtual bus, enabling information transmission between the host and the peripheral, thereby achieving control of the peripheral. This bandwidth expansion method eliminates the need for multiple hosts to collaboratively connect peripherals, reducing hardware costs and space requirements.

[0073] This invention provides a USB bandwidth extension method, apparatus, and readable storage medium, applicable to scenarios such as bank teller services and industrial control. A host computer can simultaneously connect to multiple USB 2.0-based peripherals to collaboratively complete a task. Without requiring modifications to existing business applications, this invention flexibly and conveniently extends the USB bandwidth of the computing host, improves the host's USB bus connectivity, and ensures the normal operation of multiple USB peripherals. Specific embodiments are described below:

[0074] Please refer to Figure 1 Embodiment 1 of the present invention is as follows:

[0075] A USB bandwidth extension method includes:

[0076] S1. Construct a USB virtual bus that corresponds to the standard of the first USB bus;

[0077] It should be noted that the communication standard of the USB virtual bus is the same as that of the first USB bus.

[0078] S2. Obtain device information of peripherals connected to the expansion terminal through the first USB bus and the second USB bus.

[0079] Specifically, S1 includes:

[0080] S21. Receive device information of the peripheral connected to the expansion terminal through the first USB bus, and transmit the device information through the second USB bus.

[0081] In one optional implementation, the second USB bus has a communication channel built on a bulk transfer method, through which device information is transmitted. The communication channel built on the bulk transfer method is a bulk transfer. The standard bandwidth of the first USB bus is 480 Mbps; the standard bandwidth of the second USB bus is 5 Gbps, 10 Gbps, or 20 Gbps.

[0082] It should be noted that the host has a device driver installed that corresponds to the second USB bus, which enables the host and the extension device to transmit device information via the second USB bus.

[0083] Specifically, after S21, the following is included:

[0084] S201. The device information is parsed through the extended terminal to obtain the communication mode and basic information of the peripheral device.

[0085] S202. Configure the communication priority of the peripheral device according to the communication mode, and record the communication priority and basic information of the peripheral device in the configuration information.

[0086] In one optional implementation, the configuration information may be stored in the host or an extension device. In some embodiments, taking the configuration information stored in the extension device as an example, the configuration information further includes authorization information, which includes a vendor ID (VID), a product identifier (PID), a device serial number, and a host serial number. After obtaining the communication mode and basic information of the peripheral device, the following is included:

[0087] The system obtains basic information about the host connected to the extended terminal, and determines whether the basic information of the peripheral device and the basic information of the host exist in the authorization information. If they do, the host and the peripheral device are allowed to connect and communicate through the extended terminal; otherwise, the connection and communication between the host and the peripheral device is prohibited. This method ensures the security of the information system within the host when peripheral devices are accessed in business scenarios.

[0088] In some embodiments, if the communication priority of a peripheral device with a high real-time communication mode is configured as high priority, then step S201 specifically involves: when a new peripheral device is connected to the extension terminal, obtaining the device descriptor and configuration descriptor of the peripheral device through device enumeration, parsing the device descriptor and configuration descriptor to obtain the communication mode of each communication endpoint of the peripheral device. Specifically, the configuration information of the extension terminal defaults to configuring communication endpoints in ISO (Isochronous) communication mode and Interrupt communication mode as high-priority endpoints.

[0089] Step S202 specifically involves: checking whether the configuration information of the extended terminal already exists and is defaulted to a high-priority endpoint. If not, the peripheral communication endpoint is added to the end of the priority configuration record in the extended terminal's configuration information. Users can manually specify the communication priority of the peripheral communication endpoint; in this manual specification method, the peripheral's communication priority is not constrained by the endpoint's communication method, and any type of communication endpoint can be added to the corresponding priority configuration record. Depending on the implementation scheme in the application scenario, the aforementioned priority configuration record can exist in the form of a file, database, or memory cache.

[0090] In some embodiments, the priority configuration records may be entirely stored in the extension terminal, or they may be dynamically configured while the extension terminal is running; or some priority configuration records may be stored in the extension terminal, while others may be dynamically configured. Specifically, when the priority configuration records are dynamically configured, the configuration initiator sends the priority configuration records to be set and the same-priority arbitration policy to the extension terminal through the external communication interface provided by the extension terminal, according to the communication protocol agreed upon by the extension terminal. The extension terminal merges the received priority configuration records into the preset priority configuration records within the extension terminal according to their priority order. When there is a record with the same priority as the priority configuration record sent by the configuration initiator in the preset priority configuration records within the extension terminal, the same-priority arbitration policy sent along with the priority configuration record determines whether the sent priority configuration record is placed at the beginning or end of the preset priority configuration records.

[0091] S3. Generate device nodes on the USB virtual bus that correspond one-to-one with the peripherals based on the device information.

[0092] Specifically, S3 includes:

[0093] S31. Obtain the bandwidth requirement of the peripheral device based on the device information.

[0094] S32. Based on the bandwidth requirements and the bandwidth capacity of the first USB bus, generate device nodes on the USB virtual bus that correspond one-to-one with the peripherals.

[0095] The total bandwidth capacity of the USB virtual bus after deducting the system reserved bandwidth is greater than or equal to the bandwidth requirement of the peripheral device.

[0096] It should be noted that the number of USB virtual buses can be greater than the number of the first USB buses; wherein, the total bandwidth capacity = the total number of USB virtual buses × the bandwidth value of a single USB virtual bus, and the total bandwidth capacity of the USB virtual buses is specifically the available bandwidth capacity remaining after deducting non-usable bandwidth such as system reserved bandwidth from the USB virtual buses.

[0097] It should be noted that the device information includes connection requests. After the connection requests are sent to the host system through the virtual bus, the corresponding device nodes are generated.

[0098] S4. Receive the host system's operation request for the peripheral device, and send the operation request to the peripheral device according to the configuration information.

[0099] It should be noted that the host system includes business software or applications on the host that send operation requests to corresponding peripherals.

[0100] The smallest data unit of the operation request is a URB (USB Request Block) packet.

[0101] Specifically, S4 includes:

[0102] S41. Receive the host system's operation request for the peripheral device, and generate a URB packet corresponding to the operation request on the USB virtual bus.

[0103] S42. The URB packet is transmitted to the extended terminal through the communication channel built on the second USB bus based on the batch transmission method, and the communication priority of the peripheral corresponding to the URB packet is obtained according to the configuration information.

[0104] S43. According to the order of the communication priority, the URB packets are sent to the peripheral device sequentially through the first USB bus.

[0105] In some embodiments, the priority configuration record (priority and basic information) of each communication endpoint (peripheral) is stored in the configuration information of the extension terminal in the form of a linear set; wherein, the priority configuration record of each communication endpoint includes at least the device VID, PID, endpoint number, and priority number, and the priority number is an integer. When there are priority numbers with the same value in the configuration information, the priority of the priority configuration record that appears first in the linear set is given higher priority.

[0106] S5. Obtain the response information of the peripheral device through the first USB bus and the second USB bus, and return the response information to the host system through the USB virtual bus.

[0107] Specifically, S5 includes:

[0108] S51. Receive the response information from the peripheral device through the first USB bus, and transmit the response information to the USB virtual bus through the communication channel built on the second USB bus based on the bulk transfer method.

[0109] In some embodiments, a communication channel is constructed on the second USB bus based on bulk transfer mode to transmit the response information to the USB virtual bus.

[0110] S52. On the USB virtual bus, restore the response information to the device response corresponding to the peripheral device, and return the device response to the host system.

[0111] It should be noted that the device response is a URB response.

[0112] Wherein, the communication mode includes synchronous communication, then step S202 includes: if the communication mode is synchronous communication, then configuring the communication priority of the peripheral device to the highest level. This is to avoid excessive communication delays in synchronous communication peripheral devices.

[0113] Then S4 includes:

[0114] S401. Obtain the communication priority of all operation requests corresponding to peripherals within a preset time period, and calculate the number of priority operation requests with the highest communication priority.

[0115] S402. If the number of priority operation requests in the operation requests reaches a preset threshold, the priority operation requests exceeding the preset threshold will wait for the next transmission.

[0116] In some embodiments, S4 specifically refers to:

[0117] Obtain all URB packets to be transmitted on the second USB bus within a preset time period, and mark the URB packets as the current transmission batch;

[0118] The theoretical maximum capacity of a single transmission batch of URB packets is calculated based on the theoretical bandwidth of the second USB bus and the USB transmission protocol specifications.

[0119] When the second USB bus transmits a URB packet, it synchronously calculates the first number of URB packets that have been transmitted and have the highest communication priority in the current transmission batch, and calculates the proportion of the first number to the theoretical capacity limit of the URB packet.

[0120] If the percentage reaches or exceeds a preset threshold, the URB packets exceeding the preset threshold will be delayed for transmission in the next transmission batch.

[0121] In some embodiments, the preset threshold is 80%, meaning that the priority URB packets sent occupy at most 80% of all URB packets sent per unit time.

[0122] In some embodiments, the communication priority of a certain type of communication mode can be adjusted according to the characteristics of the application scenario and business needs, thereby improving the performance of the host system. For example, the communication priority of the screen recording peripheral in synchronous communication mode can be reduced to ensure the resources of other asynchronous communication peripherals.

[0123] It should be noted that the execution subject of steps S1-S5 is the host that needs to extend USB bandwidth.

[0124] Please refer to Figures 2 to 3 Embodiment two of the present invention is as follows:

[0125] A USB bandwidth extension device includes a host end 1 and an extension end 2;

[0126] The extension terminal 2 includes an information processor 21, which includes a first USB bus 101 and a second USB slave bus 201.

[0127] The host terminal 1 includes a second USB host bus 301; the host terminal 1 is used to construct a USB virtual bus that corresponds to the standard of the first USB bus 101.

[0128] One end of the second USB slave bus 201 is connected to the second USB master bus 301, and the other end of the second USB slave bus 201 is connected to one end of the first USB bus 101. The other end of the first USB bus 101 is used to connect to the peripheral device 3.

[0129] In one optional implementation, the expansion terminal 2 further includes a bus expansion chip 22, one end of which is connected to the second USB slave bus 201, and the other end of which is used to connect to the peripheral device 3.

[0130] It should be noted that the number of the first USB bus 101 is at least one. The number of bus expansion chips 22 increases according to the number of peripherals 3. That is, when the number of the first USB bus 101 in the information processor 21 cannot meet the requirements of the number of peripherals, the first USB bus 101 can be expanded by connecting the bus expansion chip 22, so that the expansion end 2 can be flexibly combined or configured, and has strong expandability.

[0131] It should be noted that the expansion terminal 2 is an integrated chip system. The connection relationship between the first USB bus 101, the second USB slave bus 201, the third USB master bus 301 and the bus expansion chip 21 is not specifically described. The connection relationship here only indicates that the two can communicate with each other.

[0132] Specifically, the first USB bus 101 is a USB 2.0 standard bus; the second USB master bus 301 and the second USB slave bus 201 are USB 3.0 or higher standard buses.

[0133] In some embodiments, refer to Figure 2 As shown, the second USB master bus 301 is the USB 3.0 or higher standard master bus in the figure; the second USB slave bus 201 is the USB 3.0 or higher standard slave bus in the figure; and the first USB bus 101 is the USB 2.0 standard master bus in the figure. The information processor 21 is connected to the host 1's USB 3.0 or higher standard master bus 301 based on the USB 3.0 or higher standard slave bus 201, realizing the communication connection between the expansion terminal 2 and the host 1; the information processor 21 is connected to the service peripheral 3 based on the USB 2.0 standard master bus 101.

[0134] It should be noted that, based on the USB 2.0 standard requirement that USB 2.0 be backward compatible with the USB 1.1 and USB 1.0 standards, the USB communication version of the peripheral 3 connected to the expansion terminal 2 can support the USB 2.0, USB 1.1 and USB 1.0 standards.

[0135] It should be noted that the communication rates provided by the USB standard are shown in Table 1.

[0136] Table 1. Communication rates provided by various USB standards

[0137]

[0138] The USB 4.0 standard provides communication speeds of 10Gbps, 20Gbps, and 40Gbps, which are not covered in this invention.

[0139] In some embodiments, the extension terminal 2 further includes an OTG controller or DRD controller based on USB 3.0 or higher standards, and the second USB slave bus 201 is connected to the OTG controller or DRD controller. In this way, the second USB slave bus is configured for use in Device mode via the OTG controller or DRD controller.

[0140] The various steps of the USB bandwidth extension method described in Embodiment 1 are implemented using the apparatus described in this embodiment. (Refer to...) Figure 3 As shown, the host terminal 1 is equipped with a Slaver device driver 1001, a USB 2.0 virtual bus driver 1002, a host system / business software 1003, and a USB native bus driver 1004; the expansion terminal 2 is equipped with information processing software 2001 and a USB 2.0 standard bus driver 2002. The working principle of the device is as follows:

[0141] The information processing software 2001 of the extension end 2 constructs a channel 2003 using Bulk communication mode on the USB 3.0 or higher standard Slaver bus 201 (i.e., the second USB bus in the method), and establishes communication by connecting to the USB 3.0 or higher standard Master bus 301 of the host end 1 through the Bulk channel 2003.

[0142] The information processing software 2001 of the extension end 2 forwards the device information of the peripheral 3 connected to the USB 2.0 standard Master bus 101 (i.e. the first USB bus in the method) to the host end 1 through the USB 3.0 or higher standard Slaver bus 201.

[0143] The slave device driver 1001 of host 1 obtains the device information reported by the information processing software 2001 of extension 2, and simulates the corresponding peripheral 3 to send a connection request to the host system / business software 1003 based on the relationship between the bandwidth requirements of peripheral 3 and the theoretical bandwidth carrying capacity of USB 2.0 standard, and generates a device node on the USB virtual bus of host 1 that corresponds one-to-one with peripheral 3.

[0144] When the USB virtual bus driver 1002 of host 1 receives the URB packet from the host system / business software 1003 to the peripheral 3, it forwards the URB packet to the information processing software 2001 of extension 2 through the Bulk channel 2003 on the USB 3.0 or higher standard Slaver bus 201.

[0145] After receiving the URB packet, the information processing software 2001 of the extension terminal 2 forwards the URB packet to its corresponding real peripheral 3. After the real peripheral 3 responds, it forwards the response information to the Slaver device driver 1001 of the host terminal 1 through the Bulk channel 2003 on the USB 3.0 or higher standard Slaver bus 201. The Slaver device driver 1001 of the host terminal 1 converts the received response information into a URB response for the corresponding USB 2.0 virtual bus and sends the URB response to the host system / business software 1003.

[0146] Embodiment 3 of the present invention is as follows:

[0147] A computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the USB bandwidth extension method described in Embodiment 1.

[0148] In summary, the USB bandwidth extension method, apparatus, and readable storage medium provided by this invention, by adding an extension terminal, allows data transmission between the host and peripherals to occur via a first USB bus and a second USB bus, rather than directly between the host and the extension terminal. When the host needs to connect multiple peripherals, the USB bandwidth of the host can be extended simply by increasing the number of USB buses on the extension terminal, offering strong scalability and avoiding modifications to the host's motherboard or internal space, resulting in low hardware costs and increased flexibility in using the host's USB bandwidth. Furthermore, it reduces latency between the host and peripherals, ensuring the continuity of business operations in application scenarios. Simultaneously, a corresponding USB virtual bus is generated within the host based on the peripheral's device information. Although the peripheral is connected to the extension terminal, the USB virtual bus can convert the host's operation requests and the extension terminal's response information, enabling information transmission between the host and peripherals and thus achieving control over the peripherals. This requires no modification to the host or host system / business software, making it easy to integrate and deploy applications with strong compatibility. This bandwidth extension method does not require multiple hosts to collaboratively connect peripherals, reducing space occupation. In addition, the configuration information of the extension terminal enables the connection between the extension terminal and the host to have device authorization function, thus ensuring the security of the information system.

[0149] The above description is merely an embodiment of the present invention and does not limit the patent scope of the present invention. Any equivalent modifications made based on the content of the present invention specification and drawings, or direct or indirect applications in related technical fields, are similarly included within the patent protection scope of the present invention.

Claims

1. A USB bandwidth extension method, characterized by, The method comprises the steps of: constructing a USB virtual bus corresponding to a standard of the first USB bus on the host side; the communication standard of the USB virtual bus is the same as that of the first USB bus; obtaining device information of peripherals connected to the expansion side through the first USB bus and the second USB bus; wherein the expansion side comprises the first USB bus, and the host side comprises the second USB bus; the first USB bus is a USB 2.0 standard bus; and the second USB bus is a USB 3.0 or above standard bus; generating a device node corresponding to the peripheral on the USB virtual bus according to the device information; receiving an operation request of the host system to the peripheral on the USB virtual bus, and sending the operation request to the peripheral according to configuration information; obtaining response information of the peripheral through the first USB bus and the second USB bus, and returning the response information to the host system through the USB virtual bus; the step of obtaining the device information of the peripheral connected to the expansion side through the first USB bus and the second USB bus comprises: receiving the device information of the peripheral connected to the expansion side through the first USB bus, and transmitting the device information through the second USB bus; the step of generating the device node corresponding to the peripheral on the USB virtual bus according to the device information comprises: obtaining bandwidth demand of the peripheral according to the device information; generating the device node corresponding to the peripheral on the USB virtual bus according to the bandwidth demand and the bandwidth carrying capacity of the first USB bus; the total bandwidth carrying capacity of the USB virtual bus after deducting the system reserved bandwidth is greater than or equal to the bandwidth demand of the peripheral.

2. The USB bandwidth extension method of claim 1, wherein, after the step of obtaining the device information of the peripheral connected to the expansion side, the method further comprises: analyzing the device information through the expansion side to obtain the communication mode and basic information of the peripheral; configuring the communication priority of the peripheral according to the communication mode, and recording the communication priority and basic information of the peripheral in the configuration information.

3. The USB bandwidth extension method of claim 2, wherein, the minimum data unit of the operation request is a URB package; the step of receiving the operation request of the host system to the peripheral, and sending the operation request to the peripheral according to the configuration information comprises: receiving the operation request of the host system to the peripheral, and generating a URB package corresponding to the operation request on the USB virtual bus; transmitting the URB package to the expansion side through a communication channel constructed based on a batch transmission mode on the second USB bus, and obtaining the communication priority of the peripheral corresponding to the URB package according to the configuration information; according to the order of the communication priority, sequentially sending the URB package to the peripheral through the first USB bus.

4. The USB bandwidth extension method of claim 2, wherein, the step of obtaining the response information of the peripheral through the first USB bus and the second USB bus, and returning the response information to the host system through the USB virtual bus comprises: receiving the response information of the peripheral device through the first USB bus, and transmitting the response information to the USB virtual bus through a communication channel based on the bulk transmission mode constructed on the second USB bus; restoring the response information to the device response corresponding to the peripheral device on the USB virtual bus, and returning the device response to the host system.

5. The USB bandwidth extension method of claim 2, wherein, The communication mode includes synchronous communication. The configuration of the communication priority of the peripheral device according to the communication mode includes: If the communication mode is synchronous communication, the communication priority of the peripheral device is configured as the highest level. The sending of the operation request to the peripheral device according to the configuration information includes: acquiring the communication priority of the peripheral device corresponding to all operation requests within a preset time, and calculating the number of priority operation requests with the highest communication priority; If the number of priority operation requests in the operation request reaches a preset threshold, the priority operation requests exceeding the preset threshold wait for the next sending.

6. A USB bandwidth extension device for performing the method of any one of claims 1 to 5, characterized in that The host end and the expansion end are included. The expansion end includes an information processor, and the information processor includes a first USB bus and a second USB slave bus. The host end includes a second USB master bus. The host end is configured to construct a USB virtual bus corresponding to a standard of the first USB bus. One end of the second USB slave bus is connected to the second USB master bus, the other end of the second USB slave bus is connected to one end of the first USB bus, and the other end of the first USB bus is configured to connect a peripheral device.

7. The USB bandwidth extension device of claim 6, wherein, The first USB bus is a USB2.0 standard bus; the second USB master bus and the second USB slave bus are USB3.0 or above standard buses.

8. The USB bandwidth extension device of claim 6, wherein, A bus expansion chip is further included, one end of the bus expansion chip is connected to the second USB slave bus, and the other end of the bus expansion chip is configured to connect a peripheral device.

9. A computer readable storage medium having stored thereon a computer program, characterized in that, The computer program is executed by a processor to realize each step in the USB bandwidth expansion method according to any one of claims 1-5.

Citation Information

Patent Citations

  • Wireless peripheral system

    CN108804367A

  • Method for dynamically provisioning virtualized functions in USB equipment by means of virtual USB hub

    CN111581128A