A USB interface expansion method, system, device and readable storage medium
By acquiring and flexibly allocating transmission nodes in the USB hub, the problem of insufficient endpoint resources in USB hub devices is solved, thereby improving the stability and scalability of the USB interface.
Patent Information
- Application Number
- CN202211114271.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-09-14
- Publication Date
- 2026-02-10
- Estimated Expiration
- 2042-09-14
AI Technical Summary
Existing USB hub devices are prone to insufficient endpoint resources when expanding USB interfaces, leading to device malfunctions or data transmission interruptions.
By obtaining the number of available transmission nodes and the need for expansion equipment, transmission nodes can be flexibly allocated, including prioritizing the allocation of transmission nodes based on device type and access order, and creating virtual transmission nodes to meet the demand.
It enables the rational use of USB transmission resources, improves the stability and scalability of the USB interface, and avoids device malfunctions and data loss.
Smart Images

Figure CN115454895B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application belongs to the field of computer, and particularly relates to a USB interface expansion method, system, device and readable storage medium. BACKGROUND
[0002] USB is a kind of serial bus standard and a kind of input and output interface technical specification, which is widely used in personal computer and mobile device and other information communication products.In actual application scene, whether it is a server or a common personal computer, the USB interface provided on the mainboard is limited by the interface panel space of the mainboard interface panel or the interface panel of the case, and generally does not provide more UBS interface.Taking a personal computer as an example, the IO panel behind the common host case generally provides more USB interface, and the USB interface on the commonly used front IO panel is generally about 2 or so.However, due to the development of computer industry, a large number of peripherals and host connection modes are connected through USB interface, such as keyboard and mouse which no longer use the original P / S interface but use USB interface.This trend leads to more and more devices needing to be expanded through USB interface.Therefore, users have to use USB hub tool to expand the original USB interface, and use the same host USB interface to expand more USB interfaces for peripherals.However, since the USB interfaces expanded by the USB hub share a host USB interface, multiple USB devices share an endpoint of the host USB interface, which may cause endpoint resource shortage, resulting in abnormal use of some devices, especially U disk and other storage hardware, which may cause U disk connection with the host to be interrupted, and may cause data loss during data transmission between the host and the U disk, and may even cause U disk failure.That is, the current USB hub device seems to have multiple USB interfaces to support multiple USB devices, but is actually still a USB interface due to the limitation of the number of endpoints of the host.
[0003] Therefore, for the above problems, an effective solution is needed. SUMMARY
[0004] To solve the above problems, the present application provides a USB interface expansion method, which comprises:
[0005] obtaining the number of available transmission nodes and the number of transmission nodes required by corresponding expansion devices;
[0006] allocating the available transmission nodes to corresponding expansion devices based on the number of transmission nodes required by corresponding expansion devices;
[0007] The data of the extended device is transmitted based on the corresponding transmission node after the allocation.
[0008] In some embodiments of the present invention, the method further includes:
[0009] In response to the fact that the number of available transmission nodes is greater than the number of transmission nodes required by the corresponding expansion device, the corresponding available transmission nodes are allocated according to the access order of the expansion devices and the demand for available transmission nodes when the expansion devices are accessed.
[0010] In some embodiments of the present invention, the method further includes:
[0011] In response to the fact that the number of available transmission nodes is less than the number of transmission nodes required by the corresponding extended device, the device type of the accessed extended device is obtained and the available transmission nodes are allocated according to the device type in a predetermined manner;
[0012] In response to the fact that the accessed extended device is of type 1, a predetermined proportion of available transmission nodes are preferentially allocated to the extended device of type 1.
[0013] In some embodiments of the present invention, allocating the available transmission nodes according to the device type in a predetermined manner further includes:
[0014] In response to the accessing extended device being of the second type, the available transmission nodes outside the predetermined proportion are allocated to the accessing extended device.
[0015] In some embodiments of the present invention, in response to the accessed extended device being of the second type, allocating the available transmission nodes outside the predetermined proportion to the accessed extended device includes:
[0016] Create a corresponding number of virtual transmission nodes based on the number of transmission nodes required by the second type of expansion device, and allocate the virtual transmission nodes to the second type of expansion device.
[0017] In some embodiments of the present invention, the method further includes:
[0018] The virtual transmission node communicates with the second type of extended device, and transmits the data content of the second type of extended device through the predetermined proportion of available transmission nodes.
[0019] In some embodiments of the present invention, the method further includes:
[0020] In response to the presence of multiple second-type extended devices and the number of available transmission nodes being less than the number of second-type extended devices, the virtual transmission nodes corresponding to the multiple second-type extended devices are aggregated onto one or more of the available transmission nodes for data communication.
[0021] Another aspect of the present invention provides a USB interface expansion system, characterized in that it comprises:
[0022] An acquisition module is configured to acquire the number of available transmission nodes and the number of transmission nodes required by the corresponding extended devices.
[0023] An allocation module, configured to allocate available transmission nodes to corresponding expansion devices based on the number of transmission nodes required by the corresponding expansion devices;
[0024] A transmission module configured to transmit data from the extended device based on the allocated corresponding transmission nodes.
[0025] Another aspect of the present invention provides a computer device comprising:
[0026] At least one processor; and
[0027] A memory storing computer instructions executable on the processor, which, when executed by the processor, implement the steps of any of the methods described in the above embodiments.
[0028] Another aspect of the present invention provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps of any of the methods described in the above embodiments.
[0029] This invention proposes a USB interface expansion method that allocates available transmission nodes established with the host to multiple expansion devices according to a predetermined scheduling strategy. It flexibly classifies the available transmission nodes based on the actual needs of the expansion devices, thereby achieving rational utilization of USB transmission resources and effectively improving the stability and scalability of the USB interface. Attached Figure Description
[0030] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0031] Figure 1This is a flowchart illustrating a USB interface expansion method provided in an embodiment of the present invention.
[0032] Figure 2 This is a schematic diagram of the structure of a USB interface expansion system provided in an embodiment of the present invention;
[0033] Figure 3 A schematic diagram of the structure of a computer device provided in an embodiment of the present invention;
[0034] Figure 4 This is a schematic diagram of the structure of a computer-readable storage medium provided in an embodiment of the present invention;
[0035] Figure 5 A schematic diagram of an existing USB interface expansion structure provided in an embodiment of the present invention;
[0036] Figure 6 This is a schematic diagram of the structure of a preferred embodiment of the USB interface expansion interface provided in this invention. Detailed Implementation
[0037] To make the objectives, technical solutions, and advantages of the present invention clearer, the embodiments of the present invention will be further described in detail below with reference to specific examples and the accompanying drawings.
[0038] It should be noted that all uses of "first" and "second" in the embodiments of the present invention are for the purpose of distinguishing two entities or parameters with the same name but different names. It is clear that "first" and "second" are only for the convenience of expression and should not be construed as limiting the embodiments of the present invention. Subsequent embodiments will not explain this in detail.
[0039] This invention aims to solve the problem of resource utilization of USB interfaces in existing USB hub solutions, such as... Figure 5As shown, a traditional USB hub contains a USB UP port for establishing a connection with the host, an internal bus, and multiple USB Down ports. The USB Down ports are extended USB interfaces that can connect to corresponding USB devices. The internal bus is a USB bus module that expands a single USB UP port into multiple USB ports. Traditionally, the USB hub's endpoints are evenly distributed across multiple USB Down ports to achieve the expansion of the USB UP port. In some cases, certain devices may require multiple endpoints for data transmission. For example, a standard keyboard has three status indicator lights: a Caps Lock indicator, a Num Lock indicator, and a function key indicator. Typically, USB keyboards use three endpoints for the three indicator lights, while the keys share a single endpoint. When a key is pressed (taking a regular letter key as an example), if the Caps Lock indicator is on and the letter 'a' key is pressed, the USB keyboard sends the code corresponding to the letter 'a' to the host via one of the USB endpoints, and simultaneously sends the Caps Lock status code to the host via the other endpoint. The host interprets the code for the letter 'a' and the Caps Lock code as an uppercase 'A'. However, when the keyboard is connected to a USB hub with multiple external devices, the limited number of endpoints established between the USB hub's USB UP interface and the host can result in insufficient endpoints for the keyboard. This can lead to a situation where the Caps Lock indicator light is on, but the text entered into the computer is in lowercase, causing the USB hub extension to malfunction.
[0040] like Figure 1 As shown, to solve the above problems, this invention proposes a USB interface extension method, comprising:
[0041] Step S1: Obtain the number of available transmission nodes and the number of transmission nodes required by the corresponding expansion device;
[0042] Step S2: Allocate the available transmission nodes to the corresponding expansion devices based on the number of transmission nodes required by the corresponding expansion devices;
[0043] Step S3: Transmit the data of the extended device based on the corresponding transmission node after allocation.
[0044] In an embodiment of the present invention, in step S1, the available transmission node refers to the endpoint established between the uplink port of the USB hub and the host. An endpoint is the initiator and receiver of data transmission on the bus by a USB interface device under the USB bus protocol. That is, the same USB device can have multiple endpoints connected to the USB bus, transmitting data through these multiple endpoints. The number of endpoints established between the USB device and the host is determined by the hardware configuration of the host's USB interface and the hardware configuration of the USB device. Therefore, taking a USB hub as an example, to achieve reasonable endpoint allocation, it is first necessary to obtain the number of endpoints established between the USB hub and the host. The number of available transmission nodes refers to the number of endpoints that can be utilized under different circumstances. When no USB device is occupied, it is equivalent to all endpoints established with the USB hub. In some cases, it refers to the number of idle and available endpoints.
[0045] In step S2, the number of endpoints required by the USB expansion device connected to the USB hub is obtained, and available endpoints are allocated according to the number of endpoints required by the expansion device. For example, if there are currently 10 available endpoints, and a certain USB expansion device requires 5 endpoints, then 5 available endpoints are allocated to that USB expansion device. The endpoint allocation is not evenly distributed according to the number of USB expansion interfaces, but rather according to the needs of the USB expansion device.
[0046] In step S3, the allocated endpoint is used for data transmission between the corresponding USB extension device and the host.
[0047] In some embodiments of the present invention, the method further includes:
[0048] In response to the fact that the number of available transmission nodes is greater than the number of transmission nodes required by the corresponding expansion device, the corresponding available transmission nodes are allocated according to the access order of the expansion devices and the demand for available transmission nodes when the expansion devices are accessed.
[0049] In this embodiment, as mentioned above, if the number of endpoints established between the USB hub and the host can meet the needs of the current USB expansion devices, then the corresponding endpoints are allocated to the USB expansion devices according to the order in which the USB expansion devices are connected to the USB hub.
[0050] In some embodiments of the present invention, when allocating endpoints to USB expansion devices according to the order in which they are connected to the USB hub, a certain number of endpoints need to be reserved. That is, not all endpoints will be allocated to the currently connected USB expansion devices, unless all USB downstream interfaces (i.e., Figure 5 If all USB Down devices are connected to the USB expansion device, and the number of endpoints required by the connected USB expansion device needs to use reserved endpoints, then the reserved endpoints can be directly allocated to the USB expansion device.
[0051] In some embodiments of the present invention, the method further includes:
[0052] In response to the fact that the number of available transmission nodes is less than the number of transmission nodes required by the corresponding extended device, the device type of the accessed extended device is obtained and the available transmission nodes are allocated according to the device type in a predetermined manner;
[0053] In response to the fact that the accessed extended device is of type 1, a predetermined proportion of available transmission nodes are preferentially allocated to the extended device of type 1.
[0054] In this embodiment, there may be cases where some USB devices require a large number of endpoints. Therefore, when the number of available endpoints is less than the number of endpoints required by the extended USB extension device, endpoints are allocated according to the device type of the access device.
[0055] Specifically, in this embodiment, USB expansion devices are categorized according to the amount of content transmitted, such as storage USB devices like USB flash drives and external hard drives. For this type of USB expansion device, endpoints are allocated according to their needs as much as possible, but the number of allocated endpoints must have a certain limit. For example, in some embodiments, 80% is used as the allocation ratio, dividing 80% of the available endpoints according to the needs of storage USB devices. 20% of the endpoints are reserved for the endpoint needs of non-storage devices. For example, if a USB hub has four USB expansion ports and two USB devices are already connected, the USB hub has 16 available endpoints. If one of the connected USB devices requires 6 endpoints and the other requires 7 endpoints, then a maximum of 6 endpoints are allocated to each storage USB device according to a predetermined ratio. Furthermore, when a third USB expansion port connects to a third storage device, and it is detected that the third storage device may require 6 endpoints, then the three connected storage USB devices are evenly divided into 12 endpoints.
[0056] Additionally, when a fourth USB expansion port is connected to another type of USB device and requires two endpoints, if there is a surplus of available endpoints established by the USB hub, the remaining two endpoints will be allocated to the first three storage USB expansion devices.
[0057] In some embodiments of the present invention, allocating the available transmission nodes according to the device type in a predetermined manner further includes:
[0058] In response to the accessing extended device being of the second type, the available transmission nodes outside the predetermined proportion are allocated to the accessing extended device.
[0059] In this embodiment, the second type of USB device refers to a non-storage USB device. As mentioned earlier, when the access device is a non-storage device and the predetermined proportion is 80%, if the number of endpoints established between the USB hub and the host is 16, then 4 endpoints can be used for data transfer for non-storage USB extension devices.
[0060] In some embodiments of the present invention, in response to the accessed extended device being of the second type, allocating the available transmission nodes outside the predetermined proportion to the accessed extended device includes:
[0061] Create a corresponding number of virtual transmission nodes based on the number of transmission nodes required by the second type of expansion device, and allocate the virtual transmission nodes to the second type of expansion device.
[0062] In some embodiments of the present invention, the method further includes:
[0063] The virtual transmission node communicates with the second type of extended device, and transmits the data content of the second type of extended device through the predetermined proportion of available transmission nodes.
[0064] In some embodiments of the present invention, the method further includes:
[0065] In response to the presence of multiple second-type extended devices and the number of available transmission nodes being less than the number of second-type extended devices, the virtual transmission nodes corresponding to the multiple second-type extended devices are aggregated onto one or more of the available transmission nodes for data communication.
[0066] In this embodiment, when the number of endpoints required by a non-storage type USB expansion device exceeds a predetermined ratio, virtual endpoints are created in the downstream port of the USB hub to transmit the data of the corresponding USB expansion device. That is, the transmission capacity of the downstream USB port endpoints is fully utilized. Multiple endpoints are established on the USB hub's downstream link. When these endpoints communicate with multiple USB expansion devices, they completely simulate the corresponding USB function on the host side. Data sent by the USB expansion devices is transmitted to the host through endpoints established on the USB hub's upstream link (USB UP). In other words, the virtual endpoints act as data relay stations. As in the aforementioned embodiment, if there are only four available endpoints beyond the predetermined ratio, the multiple virtual endpoints communicate with the host through these four available endpoints.
[0067] Specifically, such as Figure 6 As shown, Figure 6 The diagram illustrates the internal structure of a USB hub implemented according to an embodiment of the present invention. In this embodiment, the method of the present invention is implemented by a logic module that embeds a SOC core within the USB hub. The SOC logic module detects the number of endpoints established for the uplink of the USB hub and the number of endpoints required by the corresponding USB expansion devices on the USB interfaces extended for the downlink of the USB hub. Furthermore, the SOC core handles data interaction between the virtual endpoints in the downlink and multiple non-storage type storage devices.
[0068] The SOC core implements a master-slave USB protocol (USB is a unidirectional data transfer protocol, meaning only the master, i.e., the host, can poll the corresponding port) to scan for the corresponding USB expansion interface and mimics the host (the host to which the USB UP is connected) to establish master-slave USB communication with the corresponding USB expansion interface. It fulfills the endpoint requirements of the USB expansion device and sends the corresponding USB expansion device's data to the host or to the USB expansion device through the corresponding reserved available endpoint.
[0069] Specifically, such as Figure 6 The diagram shows the endpoints established based on the uplink USB UP endpoints, such as the four available endpoints reserved for non-storage USB expansion devices mentioned above, and multiple virtual endpoints established for corresponding USB expansion devices on the downlink USB Down endpoints, for example, 20 endpoints. A corresponding mapping relationship is established; for instance, every five virtual endpoints can be assigned to one available endpoint. If data is received from the host, the corresponding virtual endpoint is found based on the available endpoints and the data address. If data is received from a USB expansion device, the data is sent to the host based on the corresponding available endpoint of the corresponding virtual endpoint.
[0070] It should be noted that the SOC module in this invention can be implemented using a corresponding embedded chip, such as an ARM chip or a microcontroller, which has data parsing and logic processing functions, and is connected to the corresponding internal bus to control the data transmission of the internal bus.
[0071] Preferably, the steps in the above method can also be implemented by a logic chip designed and manufactured in conjunction with the internal bus.
[0072] This invention proposes a USB interface expansion method that allocates available transmission nodes established with the host to multiple expansion devices according to a predetermined scheduling strategy. It flexibly classifies the available transmission nodes based on the actual needs of the expansion devices, thereby achieving rational utilization of USB transmission resources and effectively improving the stability and scalability of the USB interface.
[0073] like Figure 2 As shown, another aspect of the present invention provides a USB interface expansion system, characterized in that it includes:
[0074] Acquisition module 1 is configured to acquire the number of available transmission nodes and the number of transmission nodes required by the corresponding expansion device;
[0075] Allocation module 2, configured to allocate the available transmission nodes to the corresponding expansion devices based on the number of transmission nodes required by the corresponding expansion devices;
[0076] Transmission module 3 is configured to transmit data of the extended device based on the corresponding transmission node after allocation.
[0077] In some embodiments of the present invention, the allocation module 2 is further configured to:
[0078] In response to the fact that the number of available transmission nodes is greater than the number of transmission nodes required by the corresponding expansion device, the corresponding available transmission nodes are allocated according to the access order of the expansion devices and the demand for available transmission nodes when the expansion devices are accessed.
[0079] In some embodiments of the present invention, the allocation module 2 is further configured to:
[0080] In response to the fact that the number of available transmission nodes is less than the number of transmission nodes required by the corresponding extended device, the device type of the accessed extended device is obtained and the available transmission nodes are allocated according to the device type in a predetermined manner;
[0081] In response to the fact that the accessed extended device is of type 1, a predetermined proportion of available transmission nodes are preferentially allocated to the extended device of type 1.
[0082] In some embodiments of the present invention, the allocation module 2 is further configured to: allocate available transmission nodes outside the predetermined proportion to the accessed extended device in response to the device type of the accessed extended device being a second type.
[0083] In some embodiments of the present invention, the allocation module 2 is further configured to: create a corresponding number of virtual transmission nodes according to the number of transmission nodes required by the second type of extended device, and allocate the virtual transmission nodes to the second type of extended device.
[0084] In some embodiments of the present invention, the transmission module 3 is further configured to:
[0085] The virtual transmission node communicates with the second type of extended device, and transmits the data content of the second type of extended device through the predetermined proportion of available transmission nodes.
[0086] In some embodiments of the present invention, the transmission module 3 is further configured to: in response to the presence of multiple second-type extended devices accessing the network and the number of available transmission nodes being less than the number of second-type extended devices, aggregate the virtual transmission nodes corresponding to the multiple second-type extended devices to one or more of the available transmission nodes for data communication.
[0087] like Figure 3 As shown, another aspect of the present invention also provides a computer device comprising:
[0088] At least one processor 21; and
[0089] Memory 22, storing computer instructions 23 executable on processor 21, wherein the instructions 23, when executed by processor 21, implement a USB interface expansion method, including:
[0090] Obtain the number of available transmission nodes and the corresponding number of transmission nodes required by the expansion equipment;
[0091] The available transmission nodes are allocated to the corresponding expansion devices based on the number of transmission nodes required by the corresponding expansion devices;
[0092] The data of the extended device is transmitted based on the corresponding transmission node after the allocation.
[0093] In some embodiments of the present invention, the method further includes:
[0094] In response to the fact that the number of available transmission nodes is greater than the number of transmission nodes required by the corresponding expansion device, the corresponding available transmission nodes are allocated according to the access order of the expansion devices and the demand for available transmission nodes when the expansion devices are accessed.
[0095] In some embodiments of the present invention, the method further includes:
[0096] In response to the fact that the number of available transmission nodes is less than the number of transmission nodes required by the corresponding extended device, the device type of the accessed extended device is obtained and the available transmission nodes are allocated according to the device type in a predetermined manner;
[0097] In response to the fact that the accessed extended device is of type 1, a predetermined proportion of available transmission nodes are preferentially allocated to the extended device of type 1.
[0098] In some embodiments of the present invention, allocating the available transmission nodes according to the device type in a predetermined manner further includes:
[0099] In response to the accessing extended device being of the second type, the available transmission nodes outside the predetermined proportion are allocated to the accessing extended device.
[0100] In some embodiments of the present invention, in response to the accessed extended device being of the second type, allocating the available transmission nodes outside the predetermined proportion to the accessed extended device includes:
[0101] Create a corresponding number of virtual transmission nodes based on the number of transmission nodes required by the second type of expansion device, and allocate the virtual transmission nodes to the second type of expansion device.
[0102] In some embodiments of the present invention, the method further includes:
[0103] The virtual transmission node communicates with the second type of extended device, and transmits the data content of the second type of extended device through the predetermined proportion of available transmission nodes.
[0104] In some embodiments of the present invention, the method further includes:
[0105] In response to the presence of multiple second-type extended devices and the number of available transmission nodes being less than the number of second-type extended devices, the virtual transmission nodes corresponding to the multiple second-type extended devices are aggregated onto one or more of the available transmission nodes for data communication.
[0106] like Figure 4 As shown, another aspect of the present invention provides a computer-readable storage medium 401 storing a computer program 402, which, when executed by a processor, implements a USB interface expansion method, comprising:
[0107] Obtain the number of available transmission nodes and the corresponding number of transmission nodes required by the expansion equipment;
[0108] The available transmission nodes are allocated to the corresponding expansion devices based on the number of transmission nodes required by the corresponding expansion devices;
[0109] The data of the extended device is transmitted based on the corresponding transmission node after the allocation.
[0110] In some embodiments of the present invention, the method further includes:
[0111] In response to the fact that the number of available transmission nodes is greater than the number of transmission nodes required by the corresponding expansion device, the corresponding available transmission nodes are allocated according to the access order of the expansion devices and the demand for available transmission nodes when the expansion devices are accessed.
[0112] In some embodiments of the present invention, the method further includes:
[0113] In response to the fact that the number of available transmission nodes is less than the number of transmission nodes required by the corresponding extended device, the device type of the accessed extended device is obtained and the available transmission nodes are allocated according to the device type in a predetermined manner;
[0114] In response to the fact that the accessed extended device is of type 1, a predetermined proportion of available transmission nodes are preferentially allocated to the extended device of type 1.
[0115] In some embodiments of the present invention, allocating the available transmission nodes according to the device type in a predetermined manner further includes:
[0116] In response to the accessing extended device being of the second type, the available transmission nodes outside the predetermined proportion are allocated to the accessing extended device.
[0117] In some embodiments of the present invention, in response to the accessed extended device being of the second type, allocating the available transmission nodes outside the predetermined proportion to the accessed extended device includes:
[0118] Create a corresponding number of virtual transmission nodes based on the number of transmission nodes required by the second type of expansion device, and allocate the virtual transmission nodes to the second type of expansion device.
[0119] In some embodiments of the present invention, the method further includes:
[0120] The virtual transmission node communicates with the second type of extended device, and transmits the data content of the second type of extended device through the predetermined proportion of available transmission nodes.
[0121] In some embodiments of the present invention, the method further includes:
[0122] In response to the presence of multiple second-type extended devices and the number of available transmission nodes being less than the number of second-type extended devices, the virtual transmission nodes corresponding to the multiple second-type extended devices are aggregated onto one or more of the available transmission nodes for data communication.
[0123] The above are exemplary embodiments disclosed in this invention. However, it should be noted that various changes and modifications can be made without departing from the scope of the embodiments of this invention as defined by the claims. The functions, steps, and / or actions of the methods according to the disclosed embodiments described herein do not need to be performed in any particular order. Furthermore, although the elements disclosed in the embodiments of this invention may be described or claimed individually, they may be understood as multiple unless explicitly limited to a singular number.
[0124] It should be understood that, as used herein, the singular form “a” is intended to include the plural form as well, unless the context clearly supports an exception. It should also be understood that, as used herein, “and / or” refers to any and all possible combinations of one or more of the associated listed items.
[0125] The embodiment numbers disclosed in the above embodiments of the present invention are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.
[0126] Those skilled in the art will understand that all or part of the steps of the above embodiments can be implemented by hardware or by a program instructing related hardware. The program can be stored in a computer-readable storage medium, such as a read-only memory, a disk, or an optical disk.
[0127] Those skilled in the art should understand that the discussion of any of the above embodiments is merely exemplary and is not intended to imply that the scope of the invention (including the claims) is limited to these examples. Within the framework of the invention, technical features of the above embodiments or different embodiments can be combined, and many other variations of the different aspects of the invention as described above exist, which are not provided in the details for the sake of brevity. Therefore, any omissions, modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the invention should be included within the protection scope of the invention.
Claims
1. A USB interface expansion method, characterized in that, include: Obtain the number of available transmission nodes and the corresponding number of transmission nodes required by the expansion equipment; In response to the fact that the number of available transmission nodes is less than the number of transmission nodes required by the corresponding extended device, the device type of the extended device to be accessed is obtained; In response to the fact that the accessed extended device is of type 1, a predetermined proportion of available transmission nodes are preferentially allocated to the extended device of type 1. The data of the extended device is transmitted based on the corresponding transmission node after the allocation.
2. The method according to claim 1, characterized in that, Also includes: In response to the fact that the number of available transmission nodes is greater than the number of transmission nodes required by the corresponding expansion device, the corresponding available transmission nodes are allocated according to the access order of the expansion devices and the demand for available transmission nodes when the expansion devices are accessed.
3. The method according to claim 1, characterized in that, Also includes: In response to the accessing extended device being of the second type, the available transmission nodes outside the predetermined proportion are allocated to the accessing extended device.
4. The method according to claim 3, characterized in that, The response that the accessed extended device is of the second type, allocating the available transmission nodes outside the predetermined proportion to the accessed extended device includes: Create a corresponding number of virtual transmission nodes based on the number of transmission nodes required by the second type of expansion device, and allocate the virtual transmission nodes to the second type of expansion device.
5. The method according to claim 4, characterized in that, Also includes: The virtual transmission node communicates with the second type of extended device, and transmits the data content of the second type of extended device through available transmission nodes outside the predetermined ratio.
6. The method according to claim 4, characterized in that, Also includes: In response to the presence of multiple second-type extended devices and the number of available transmission nodes being less than the number of second-type extended devices, the virtual transmission nodes corresponding to the multiple second-type extended devices are aggregated onto one or more of the available transmission nodes for data communication.
7. A USB interface expansion system, characterized in that, include: An acquisition module is configured to acquire the number of available transmission nodes and the number of transmission nodes required by the corresponding extended devices. The allocation module is configured to, in response to the number of available transmission nodes being less than the number of transmission nodes required by the corresponding expansion device, obtain the device type of the access expansion device; and, in response to the device type of the access expansion device being a first type, preferentially allocate a predetermined proportion of available transmission nodes to the expansion device of the first type. A transmission module configured to transmit data from the extended device based on the allocated corresponding transmission nodes.
8. A computer device, characterized in that, include: At least one processor; as well as A memory storing computer instructions executable on the processor, which, when executed by the processor, implement the steps of the method according to any one of claims 1-6.
9. A computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps of the method according to any one of claims 1-6.
Citation Information
Patent Citations
Techniques for resolving conflicts of USB traffic in extended environment
CN114253886A
Scheduling techniques for isochronous IN traffic in USB extension environments
CN114443534A