Universal serial bus control device, system, method, equipment, medium and product
By configuring a universal serial bus device controller and drive unit inside the BMC to share device addresses and control ports, unified control of multiple USB devices is achieved, which solves the problem of high hardware resource costs caused by independent UDC modules and achieves flexibility and efficiency. USB device management.
Patent Information
- Application Number
- CN202410853004.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-28
- Publication Date
- 2024-10-01
- Estimated Expiration
- 2044-06-28
AI Technical Summary
In the existing technology, each USB device is configured with an independent UDC module to realize USB device control, which results in a significant increase in the cost of hardware resources managed by the BMC and makes it difficult to flexibly expand.
A universal serial bus device controller, a universal serial bus device hub driver unit and multiple universal serial bus device driver units are configured inside the BMC. By sharing device address registers and control ports, unified control of multiple USB devices is achieved, avoiding the need for The need to allocate independent hardware resources to each USB device.
It realizes low-cost and convenient unified control of multiple USB devices, reduces hardware resource consumption and operation and maintenance costs, and improves the flexibility of resource utilization.
Smart Images

Figure CN118394695B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to a universal serial bus control device, system, method, equipment, medium and product. Background Art
[0002] The Baseboard Management Controller (BMC) can virtualize the mouse, keyboard, network card, and virtual media devices through the Keyboard, Video, Mouse (KVM) function, thereby realizing remote control of the server host. This function greatly enhances the remote management experience of the server and improves the operation and maintenance efficiency.
[0003] The monitoring function is closely related to the Universal Serial Bus Device Controller (UDC) module of the BMC. In traditional designs, it is usually necessary to configure independent UDC modules for different types of USB devices inside the BMC to control the USB devices, so as to ensure that the communication between the USB devices and the server host does not interfere with each other.
[0004] However, as the demand for USB device functions in data centers increases, if the control of USB devices continues to be achieved by configuring an independent UDC module for each USB device, additional UDC hardware resources will be required to support each additional type of USB device function, which will significantly increase the hardware resource cost of BMC management. Summary of the invention
[0005] The present invention provides a universal serial bus control device, system, method, equipment, medium and product, which are used to solve the defect that the control of USB devices is realized in the prior art by configuring an independent UDC module for each USB device, resulting in a significant increase in the hardware resource cost of BMC management, and realize low-cost and convenient unified control of multiple USB devices.
[0006] The present invention provides a universal serial bus control device, the device is connected to a server host for communication, the device comprises a universal serial bus device controller, a universal serial bus device hub driver unit, and a plurality of universal serial bus device driver units;
[0007] The USB device controller includes the USB device hub driver unit and a device address register and a control port shared between a plurality of the USB device driver units;
[0008] The universal serial bus device controller is used to switch the device address in the device address register according to the address switching time slice corresponding to the universal serial bus device hub driver unit and the address switching time slice corresponding to each of the universal serial bus device driver units, and control the universal serial bus device hub driver unit and each of the universal serial bus device driver units according to the switched device address and the control port to interact with the server host.
[0009] According to a universal serial bus control device provided by the present invention, the universal serial bus device controller further includes a timer;
[0010] The universal serial bus device controller is specifically used for:
[0011] For the current interaction, judging, according to the current running state of the timer, whether the address switching time slice corresponding to the universal serial bus device hub driver unit and the address switching time slice corresponding to each of the universal serial bus device driver units are triggered;
[0012] Determine, among the universal serial bus device hub driver unit and the plurality of universal serial bus device driver units, a current driver unit to be controlled whose address switching time slice is triggered;
[0013] Switching the device address in the device address register to the device address of the current drive unit to be controlled to obtain a target device address;
[0014] According to the target device address and the control port, controlling the current drive unit to be controlled to interact with the server host;
[0015] Continue to iteratively control the next drive unit to be controlled to interact with the server host according to the next operating state of the timer.
[0016] According to a universal serial bus control device provided by the present invention, the universal serial bus device controller is further used for:
[0017] According to the current running state of the timer, determining whether the timer is in a timeout state;
[0018] When it is determined that the timer is in a timeout state, the cycle period to which the timer belongs is matched with the address switching time slice corresponding to the universal serial bus device hub driver unit and the address switching time slice corresponding to each of the universal serial bus device driver units;
[0019] According to the matching result, it is determined whether the address switching time slice corresponding to the universal serial bus device hub driver unit and the address switching time slice corresponding to each of the universal serial bus device driver units are triggered.
[0020] According to a universal serial bus control device provided by the present invention, the universal serial bus device controller is further used for:
[0021] Determining current access permission information of the current drive unit to be controlled according to the current access status of the device address register;
[0022] When it is determined, based on the current access permission information of the current drive unit to be controlled, that the current drive unit to be controlled has the permission to access the device address register, the device address in the device address register is switched to the device address of the current drive unit to be controlled, and a locking operation is performed on the device address register.
[0023] According to a universal serial bus control device provided by the present invention, the universal serial bus device controller is further used for:
[0024] When it is determined that the locking operation of the device address register is completed, receiving a current task processing request initiated by the server host;
[0025] According to the target device address, transmitting the current task processing request to the current drive unit to be controlled;
[0026] Transmitting first response information returned by the current drive unit to be controlled according to the current task processing request to the server host;
[0027] When it is determined that the server host has received the first response information, the locking operation on the device address register is released.
[0028] According to a universal serial bus control device provided by the present invention, the universal serial bus device controller is further used for:
[0029] According to the current task processing request, obtain the current request device address;
[0030] Matching the current request device address with the target device address;
[0031] When it is found through matching that the current request device address is consistent with the target device address, the current task processing request is transmitted to the current drive unit to be controlled according to the target device address.
[0032] According to a universal serial bus control device provided by the present invention, the universal serial bus device controller is further used for:
[0033] When it is learned through matching that the current request device address is inconsistent with the target device address, storing the current task processing request in a cache queue;
[0034] In the case of determining that the device address in the device address register is switched to the device address of the next drive unit to be controlled, continue to match the current request device address with the device address of the next drive unit to be controlled obtained by switching in the device address register;
[0035] When it is found through matching that the current request device address matches the device address of the next drive unit to be controlled, the current task processing request is taken out from the cache queue and then transmitted to the next drive unit to be controlled.
[0036] According to a universal serial bus control device provided by the present invention, the universal serial bus device hub driver unit is used to:
[0037] receiving a first enumeration request sent by the server host; the first enumeration request is used to enumerate the universal serial bus device hub driver unit;
[0038] Returning second response information to the server host according to the first enumeration request;
[0039] receiving a device address assigned by the server host to the universal serial bus device hub driver unit according to the second response information;
[0040] Modify the device address register to the device address of the universal serial bus device hub driver unit;
[0041] Receiving a status acquisition command of a universal serial bus device driver unit sent by the server host;
[0042] In response to the status acquisition command, reporting the device status of each of the universal serial bus device driver units to the server host according to the device address of the universal serial bus device hub driver unit;
[0043] The server host receives the device address assigned to each of the universal serial bus device driver units according to the device status of each of the universal serial bus device driver units, and transmits the device address of each of the universal serial bus device driver units to each of the universal serial bus device driver units.
[0044] According to a universal serial bus control device provided by the present invention, the universal serial bus device hub driver unit is further used for:
[0045] For the current secondary port device enumeration, modifying the device address register to the device address of the universal serial bus device hub driver unit;
[0046] Receiving a current status acquisition command of a current universal serial bus device driver unit sent by the server host;
[0047] In response to the current status acquisition command, sending the target device status of the current universal serial bus device driver unit to the server host according to the device address of the universal serial bus device hub driver unit;
[0048] clearing the device address register, and receiving, according to the target device state, a second enumeration request of the current universal serial bus device driver unit sent by the server host according to the target device state;
[0049] Sending the third response information returned by the current universal serial bus device driver unit according to the second enumeration request to the server host;
[0050] transmitting the device address allocated by the server host to the current universal serial bus device driver unit according to the third response information to the current universal serial bus device driver unit;
[0051] Return to modifying the device address register to the device address of the universal serial bus device hub driver unit, and iterate to perform the next port device enumeration until all the universal serial bus device driver units are enumerated.
[0052] According to a universal serial bus control device provided by the present invention, the second response information includes the device type and port number of the universal serial bus device hub driver unit;
[0053] The device address of the universal serial bus device hub driver unit is allocated by the server host according to the device type and port number of the universal serial bus device hub driver unit.
[0054] According to a universal serial bus control device provided by the present invention, the second response information also includes a query time interval of each of the universal serial bus device driver units;
[0055] The state acquisition command of the universal serial bus device driver unit is sent periodically according to the query time interval.
[0056] According to a universal serial bus control device provided by the present invention, for the universal serial bus device hub driver unit and each of the plurality of universal serial bus device driver units, the driver unit is configured with at least one port number;
[0057] The drive unit is used for:
[0058] When receiving a task processing request initiated by the server host, obtaining a target port number from at least one of the port numbers according to a task type and a data transmission mode corresponding to the task processing request;
[0059] The task processing request is processed according to the task operation mode corresponding to the target port number, and the task processing result is returned to the server host.
[0060] According to a universal serial bus control device provided by the present invention, the port number of the driving unit is configured according to the device type of the driving unit.
[0061] According to a universal serial bus control device provided by the present invention, the port number of the input end of any driving unit is the same as the port number of the output port of any other driving unit except the any driving unit.
[0062] According to a universal serial bus control device provided by the present invention, the plurality of universal serial bus device driver units include a human-machine interface driver unit, a network controller driver unit and a memory driver unit;
[0063] The human-machine interface driving unit is used to drive a virtual human-machine interface device;
[0064] The network controller driving unit is used to drive the virtual network device;
[0065] The memory driving unit is used for driving the virtual memory.
[0066] The present invention also provides a universal serial bus control system, comprising the universal serial bus control device as described in any one of the above items and a server host;
[0067] The universal serial bus control device is communicatively connected with the server host.
[0068] The present invention also provides a universal serial bus control method, the method comprising:
[0069] Switching the device address in the device address register according to the address switching time slice corresponding to the universal serial bus device hub driver unit and the address switching time slice corresponding to each universal serial bus device driver unit;
[0070] According to the switched device address and control port, control the universal serial bus device hub driver unit and each of the universal serial bus device driver units to interact with the server host;
[0071] The device address register is a register shared by the universal serial bus device hub driver unit and multiple universal serial bus device driver units in the universal serial bus device controller, and the control port is a port shared by the universal serial bus device hub driver unit and multiple universal serial bus device driver units in the universal serial bus device controller.
[0072] According to a universal serial bus control method provided by the present invention, the device address in the device address register is switched according to the address switching time slice corresponding to the universal serial bus device hub driver unit and the address switching time slice corresponding to each universal serial bus device driver unit, including:
[0073] For the current interaction, judging whether the address switching time slice corresponding to the universal serial bus device hub driver unit and the address switching time slice corresponding to each of the universal serial bus device driver units are triggered according to the current running state of the timer;
[0074] Determine, among the universal serial bus device hub driver unit and the plurality of universal serial bus device driver units, a current driver unit to be controlled whose address switching time slice is triggered;
[0075] The device address in the device address register is switched to the device address of the current drive unit to be controlled.
[0076] The present invention also provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, any one of the universal serial bus control methods described above is implemented.
[0077] The present invention also provides a non-transitory computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the universal serial bus control method as described above is implemented.
[0078] The present invention also provides a computer program product, comprising a computer program, wherein when the computer program is executed by a processor, the computer program implements any one of the above-mentioned universal serial bus control methods.
[0079] The universal serial bus control device, system, method, equipment, medium and product provided by the present invention configure a universal serial bus device controller, a universal serial bus device hub driver unit and a plurality of universal serial bus device driver units realizing different types of virtual USB device functions inside a BMC, and the universal serial bus device controller switches the device address register configured inside the universal serial bus device controller in real time according to the address switching time slice corresponding to the universal serial bus device hub driver unit and the address switching time slice corresponding to each universal serial bus device driver unit, so as to control different universal serial bus device driver units to interact with a server host in different time slices according to the switched device address and the control port multiplexed by the plurality of driver units configured inside the universal serial bus device controller, so as to effectively avoid allocating independent hardware resources to each USB device, and realize unified control of multiple USB devices even when there is only one UDC module, thereby reducing the hardware resource cost consumed by one-to-one configuration of the UDC module and improving the flexibility of resource utilization, thereby realizing low-cost and convenient unified control of multiple USB devices. BRIEF DESCRIPTION OF THE DRAWINGS
[0080] In order to more clearly illustrate the technical solutions in the present invention or the prior art, a brief introduction will be given below to the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0081] Figure 1 It is a structural diagram of the USB software architecture provided by the prior art.
[0082] Figure 2 This is one of the structural schematic diagrams of the universal serial bus control device provided by the present invention.
[0083] Figure 3 A schematic diagram of the structure of the USB software architecture provided by the present invention.
[0084] Figure 4 This is the second structural schematic diagram of the universal serial bus control device provided by the present invention.
[0085] Figure 5 This is one of the flowcharts of address switching provided by the present invention.
[0086] Figure 6 This is the second flowchart of the address switching provided by the present invention.
[0087] Figure 7 It is a schematic diagram of the flow of device enumeration provided by the present invention.
[0088] Figure 8 It is a flow chart of the universal serial bus control method provided by the present invention.
[0089] Fig. 9 It is a structural schematic diagram of the electronic device provided by the present invention.
[0090] Reference numerals:
[0091] 210: baseboard management controller; 211: universal serial bus device controller; 212: universal serial bus device hub driver unit; 213: universal serial bus device driver unit; 220: server host. DETAILED DESCRIPTION
[0092] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the drawings of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0093] With the rapid development of cloud computing and big data technologies, data centers, as key infrastructure supporting these technologies, are increasing in size and complexity. Data centers are not only the hubs for information processing and storage, but also the powerful engines driving the development of modern information society. However, with the surge in data center business volume, ensuring the high reliability, stability and availability of data centers has become particularly critical. In this context, the core out-of-band management unit (BMC) of each server node in the data center plays a vital role. BMC is responsible for functions such as temperature monitoring, firmware upgrades, fault diagnosis, and remote monitoring through KVM. It plays an irreplaceable role in ensuring the stable operation of the server, and has therefore received widespread attention in the server industry.
[0094] In particular, BMC can virtualize the mouse, keyboard, network card, and virtual media devices through the KVM function, thereby realizing remote control of the server host. This function greatly enhances the remote management experience of the server and improves operation and maintenance efficiency.
[0095] The realization of the monitoring function is closely related to the UDC module of BMC. Figure 1 A schematic diagram of the structure of the USB software architecture provided by the prior art; Figure 1As shown, in traditional designs, it is usually necessary to configure independent UDC modules for different types of USB devices inside the BMC to control the USB devices, and configure independent USB software architectures for different types of USB devices to ensure that the communication between each USB device and the server host does not interfere with each other. For example, for a USB software architecture configured for a single USB device, the USB software architecture is composed of a multi-USB (Multi-USB, MUSB) driver unit, a gadget driver unit, that is, the driver unit of the USB device, and an upper application three-layer structure.
[0096] The above design is functionally feasible, but as the data center's demand for USB device functions increases, this design will lead to a significant increase in the hardware resource cost of BMC management, which is specifically reflected in the following aspects: On the one hand, as the data center's demand for USB device functions increases, continuing to use the method of configuring an independent UDC module for each USB device to achieve USB device control, each additional type of USB device function requires additional UDC hardware resources to support, which leads to a significant increase in the hardware resource cost of BMC management; On the other hand, when the number of required USB devices exceeds the number of existing UDC modules, the BMC management unit will face greater challenges in implementing more USB device expansion. The traditional solution is to redesign a higher-specification BMC management chip, but this not only requires a lot of manpower and material costs, but also bears the risk of chip tape-out failure and the resulting time cost. Therefore, this method also uses additional hardware resources to support the BMC management unit to manage more USB devices, which will also lead to a significant increase in the hardware resource cost of BMC management.
[0097] In summary, the industry urgently needs to explore more effective USB device expansion solutions from the perspective of server software architecture design. Such solutions should be able to improve the flexibility of device expansion while minimizing the investment in manpower, material resources and time costs caused by hardware design changes.
[0098] In this regard, the present embodiment proposes a universal serial bus control device, which configures a universal serial bus device controller, a universal serial bus device hub driver unit, and multiple universal serial bus device driver units for realizing different types of virtual USB device functions inside a BMC management unit, constructs a multi-universal serial bus control architecture, and under this architecture, interconnects with a server host through a UDC module, and various USB device driver units realize communication with the Host by sharing a UDC device address register and a control endpoint, thereby realizing the use of a single UDC module, according to the device address register and control port shared between the universal serial bus device hub driver unit and multiple universal serial bus device driver units, can uniformly realize the interaction between different USB device driver units and the server host, no longer relying on multiple independent UDC modules, but even if there is only one UDC module, can realize unified control of multiple USB devices, which can not only reduce the hardware resource cost of BMC management, but also reduce the frequent iterative upgrade of chip specifications due to hardware design changes, effectively reduce the overall operation and maintenance cost and time cost of BMC, thereby improving the hardware cost and operation and maintenance efficiency of the data center, and providing strong technical support for the sustainable development of the data center.
[0099] In order to more clearly explain the contents of the universal serial bus control device proposed in this embodiment, the universal serial bus control device provided by this embodiment is explained in detail from aspects of device structure, software architecture, enumeration process and device address switching process.
[0100] It should be noted that the universal serial bus control device can be applied to scenarios such as data centers and computer clusters. The following takes the application of the device in a data center as an example to describe the universal serial bus control device provided in this embodiment. For other scenarios, this scenario can be used as a reference for adaptive replacement.
[0101] Figure 2 One of the structural schematic diagrams of the universal serial bus control device provided by the present invention; Figure 2 As shown, the device may be a baseboard management controller 210 configured in a data center and connected to a server host. The device includes a universal serial bus device controller 211, a universal serial bus device hub driver unit 212, and multiple universal serial bus device driver units 213, so as to ensure efficient and stable communication between multiple USB devices and a server host 220 (also called Host) through the coordinated work between these units.
[0102] Among them, the Host plays the role of USB host, is the user of USB devices, and is also the initiator of USB communication. The Host is usually responsible for USB device enumeration, configuration, power management, data transmission control, error detection and recovery, device addition and removal management, etc. Figure 2 As shown in the figure, the Host can complete the above functions by interacting with the UDC in the BMC.
[0103] For BMC, it is mainly responsible for the realization of functional devices such as the universal serial bus device hub driver unit 212 (also called USB Hub driver unit), multiple universal serial bus device driver units 213 (also called USB device driver units), etc., specifically involving the loading and unloading of each driver unit.
[0104] In the traditional technology, based on the hardware design rules of BMC, each USB device driver unit needs to be bound to the UDC module in the BMC. For multiple UDC scenarios, each USB device driver unit needs to be bound to an independent UDC module for processing. Based on the scenario of one UDC module in this embodiment, all USB device driver units use the same UDC module, and the sharing of the UDC module is realized through a software design method. Therefore, for the UDC module, this embodiment is designed to include a device address register and a control port, the device address register is shared by the USB Hub driver unit and multiple USB device driver units, and the control port is reused by the USB Hub driver unit and multiple USB device driver units; the UDC module can be connected to the Host for communication, and is connected between the USB Hub driver unit and multiple USB device driver units, and it controls the USB Hub driver unit and each USB device driver unit through the device address register and the control port, so that each USB Hub driver unit, each USB device driver unit and the Host can interact effectively and stably.
[0105] Figure 3 This is a schematic diagram of the structure of the USB software architecture provided by the present invention. Figure 3As shown, for the USB Hub driver unit and multiple USB device driver units, since this embodiment focuses on the application scenario where the hardware cost of the UDC module in the BMC management chip is relatively high, the traditional design method of configuring a single USB software architecture for each UDC module is no longer applicable. In this regard, in order to cope with the challenge of increased hardware costs brought about by the increased demand for USB device functions in the data center, this embodiment modifies and adds a USB Hub driver unit and multiple USB device driver units on the traditional USB software architecture for the inside of the BMC. Specifically, a driver layer of a USB Hub driver unit is added on the basis of the MUSB driver unit, and multiple USB device driver units configured for multiple different types of USB devices are expanded on the basis of the single USB device driver unit, that is, the USB Hub driver unit is located at a level between the level where the MUSB driver unit is located and the level where the multiple USB device driver units are located, and the multiple USB device driver units are located at a level between the level where the USB Hub driver unit is located and the level where the application layer is located.
[0106] Through the above software architecture design, a single UDC module can effectively control multiple USB devices, effectively solving the technical difficulties encountered in traditional hardware implementation methods, so that the implementation of multiple USB devices no longer depends on independent UDC hardware resources, significantly reducing the design investment in hardware UDC modules, effectively saving manpower and time costs in the hardware development process, and improving development efficiency.
[0107] Among them, the MUSB driver unit, as a part of the Linux system kernel, is responsible for processing various requests and transactions defined in the USB specification, including device enumeration, data transmission, power management, etc. The USB Hub driver unit is mainly responsible for managing the interaction process between each USB device driver unit and the Host, such as device enumeration and data transmission, etc. Each USB device driver unit is usually implemented on the basis of the MUSB driver unit. An application program for using the USB device is stored on each USB device driver unit to drive the corresponding simulated USB device to realize the function of the corresponding USB device. It allows the Linux device to play the role of a USB device, such as a mouse and keyboard, when connected to the Host to respond to the Host's request, perform data transmission and communication, so that the administrator can remotely control the server host 220 through the simulated USB device.
[0108] The multiple USB device driver units here may be USB device driver units including multiple device types of different devices, and may be specifically configured according to the functions required for Host monitoring, such as including multiple items of a human-machine interface driver unit, a network controller driver unit, and a memory driver unit, and may also include other types of USB device driver units, which are not specifically limited in this embodiment.
[0109] Figure 4 The second structural diagram of the universal serial bus control device provided by the present invention; Figure 3 and Figure 4 As shown, in some embodiments, the plurality of universal serial bus device driver units 213 include a human-machine interface driver unit, a network controller driver unit, and a memory driver unit;
[0110] The human-machine interface driving unit is used to drive a virtual human-machine interface device;
[0111] The network controller driving unit is used to drive the virtual network device;
[0112] The memory driving unit is used for driving the virtual memory.
[0113] Among them, the Human Interface Device (HID) driver unit is used to support human interface devices, such as mouse, keyboard, handle, etc. The HID driver unit is responsible for processing USB requests related to human interface devices, such as key events, mouse movement, etc., and passing these events to upper-level applications.
[0114] The storage driver unit (also called Mass Storage driver unit) is used to support large storage devices, such as USB flash drives, hard disks, etc. This driver unit is responsible for processing USB requests related to storage devices, such as reading, writing, formatting, etc., and provides a standard file system interface to upper-layer applications, so that applications can access storage devices like operating local file systems.
[0115] The Ethernet Control Model (ECM) driver unit is used to support USB network devices. This driver unit is responsible for processing network-related USB requests, such as IP address configuration, data packet sending and receiving, etc., and provides a standard network interface to upper-layer applications so that applications can connect to the network through the USB interface.
[0116] In summary, the device provided in this embodiment can realize the virtual USB hub function under one UDC module by configuring a single UDC module to uniformly control the HID driver unit, the Mass Storage driver unit, and the ECM driver unit, support virtual human-machine interface devices, such as mouse and keyboard, virtual storage, such as USB flash drive, and virtual network devices, such as network cards and other types of USB device functions, and realize parallel access of multiple USB functional devices on the Host side under one UDC module, thereby uniformly controlling multiple USB devices at low cost and conveniently, reducing the hardware resource cost and maintenance cost required for Host monitoring.
[0117] To simplify the description, the following takes the example that the multiple USB device driver units 213 include a HID driver unit, a Mass Storage driver unit, and an ECM driver unit to describe the USB control device provided in this embodiment.
[0118] like Figure 2 As shown, the USB device controller 211 includes a device address register and a control port shared by the USB device hub driver unit 212 and a plurality of USB device driver units 213 .
[0119] Optionally, the universal serial bus device controller 211 includes a device address register and a control port. The device address register is a device address register that can be shared by the USB Hub driver unit and multiple USB device driver units, and the device address register is used to store the device address of the driver device currently interacting with the Host, wherein the device address can be cyclically switched according to the device address of the driver unit required to interact with the Host, so as to ensure that when multiple driver devices share a host resource, each driver device can obtain the corresponding communication time and bandwidth, thereby realizing effective communication management between the USB Hub driver unit and multiple USB device driver units and the Host. The control port is reused by the USB Hub driver unit and multiple USB device driver units, so that the universal serial bus device controller 211 can realize unified control of the USB Hub driver unit and multiple USB device driver units through the control port.
[0120] The universal serial bus device controller 211 is communicatively connected to the server host 220, and is used to switch the device address in the device address register according to the address switching time slice corresponding to the universal serial bus device hub driver unit 212 and the address switching time slice corresponding to each of the universal serial bus device driver units 213, and control the universal serial bus device hub driver unit 212 and each of the universal serial bus device driver units 213 according to the switched device address and the control port to interact with the server host 220.
[0121] Optionally, since the BMC management unit has only one UDC module, the hardware only supports one device address register (Function Address Register, FADDR), and when the Host accesses the USB Hub driver unit and the downstream port devices of the USB Hub driver unit (that is, each USB device driver unit), it is necessary to ensure that the device address of FADDR is consistent with the corresponding address of the device requested by the Host. Therefore, in order to ensure that the Host communicates normally with each driver unit, it is necessary to solve the problem of insufficient address registers when the same FADDR realizes communication between different driver units. In this regard, this embodiment divides the USB Hub working time of the BMC into address switching time slices corresponding to the USB Hub driver unit and address switching time slices corresponding to each USB device driver unit, so as to perform time-sharing multiplexing address switching based on each time slice to realize normal communication between each driver unit and the Host.
[0122] Optionally, for each interaction, the UDC module can determine whether the address switching time slice corresponding to the USB Hub driver unit and the address switching time slice corresponding to each USB device driver unit are triggered, and determine the target driver unit that needs to interact with the Host this time among the USB Hub driver unit and multiple USB device driver units according to the trigger judgment result, and switch the device address in FADDR in real time according to the device address of the target driver unit, so as to establish a communication connection between the target driver unit and the Host through the switched device address, and within the address switching time slice corresponding to the target driver unit, through the communication connection, pass the interaction request sent by the Host to the target driver unit, and pass the response information returned by the target driver unit according to the interaction request to the Host, thereby realizing the interaction between the target driver unit and the Host. After the current interaction ends, the UDC module continues to determine whether the address switching time slices corresponding to the USB Hub driver unit and the address switching time slices corresponding to each USB device driver unit are triggered based on the above interaction steps, and determines the target driver unit that needs to interact with the Host next time among the USB Hub driver unit and multiple USB device driver units according to the trigger judgment result. Based on the target driver unit that needs to interact with the Host next time, it iteratively executes the next interaction step until the BMC is closed or the BMC configuration is updated.
[0123] The address switching time slices corresponding to the USB Hub driver unit and the address switching time slices corresponding to each USB device driver unit may be divided periodically at certain time intervals, or may be divided periodically according to the processing performance of each driver unit, data packet transmission mode, etc., so that each driver unit can communicate with the Host in an orderly and efficient manner. This embodiment does not specifically limit the division method.
[0124] The address switching time slices corresponding to the driving units here may be periodically triggered, or may be adaptively triggered according to a request sent by the Host in each interaction process, which is not specifically limited in this embodiment.
[0125] The apparatus provided in this embodiment configures a universal serial bus device controller, a universal serial bus device hub driver unit, and multiple universal serial bus device driver units that realize different types of virtual USB device functions inside the BMC, and the universal serial bus device controller switches the device address register configured inside the universal serial bus device controller in real time according to the address switching time slice corresponding to the universal serial bus device hub driver unit and the address switching time slice corresponding to each universal serial bus device driver unit, so as to control different universal serial bus device driver units to interact with the server host in different time slices according to the switched device address and the control port multiplexed by multiple driver units configured inside the universal serial bus device controller, which can effectively avoid allocating independent hardware resources for each USB device, and even if there is only one UDC module, unified control of multiple USB devices can be realized, reducing the hardware resource cost consumed by one-to-one configuration of UDC modules and improving the flexibility of resource utilization, thereby realizing low-cost and convenient unified control of multiple USB devices.
[0126] In some embodiments, the universal serial bus device controller 211 further includes a timer;
[0127] The universal serial bus device controller 211 is specifically used for:
[0128] For the current interaction, judging whether the address switching time slice corresponding to the universal serial bus device hub driver unit 212 and the address switching time slice corresponding to each of the universal serial bus device driver units 213 are triggered according to the current running state of the timer;
[0129] Determine, among the USB device hub driver unit 212 and the plurality of USB device driver units 213, a current driver unit to be controlled whose address switching time slice is triggered;
[0130] Switching the device address in the device address register to the device address of the current drive unit to be controlled to obtain a target device address;
[0131] According to the target device address and the control port, controlling the current drive unit to be controlled to interact with the server host 220;
[0132] Continue to iteratively control the next drive unit to be controlled to interact with the server host 220 according to the next running state of the timer.
[0133] Optionally, the UDC module can perform the following steps to implement interactive control of each drive unit:
[0134] When the BMC starts, the UDC module will be initialized, including the configuration of the device address register, control port, timer, and in the MUSB driver unit, the USB hardware initialization and the registration of each driver unit. The timer can be set to trigger an interrupt at a predetermined time interval to control different USB device driver units in sequence.
[0135] During the initialization process, the UDC module allocates address switching time slices for the USB Hub driver unit and each USB device driver unit. These time slices define the time period during which each driver unit can occupy the device address register and control port.
[0136] During the current interaction, the UDC module determines whether the timer has reached the address switching time slice that triggers any drive unit according to the current running state of the timer.
[0137] When it is determined that the timer currently triggers the address switching time slice of any driving unit, the UDC module marks the driving unit as the driving unit currently required to be controlled, that is, the driving unit currently to be controlled.
[0138] Subsequently, the UDC module switches the device address in the device address register to the device address of the current drive unit to be controlled, so that in the current interaction process, only the current drive unit to be controlled and the Host are interacted with.
[0139] Subsequently, the UDC module uses the switched target device address and control port to start controlling the current drive unit to be controlled to interact with the Host, where the so-called interaction includes operations such as data transmission and command execution.
[0140] After learning that the Host has completed the interaction with the current drive unit to be controlled, the UDC module will iteratively control the next drive unit to be controlled to interact with the Host according to the next running state of the timer until all drive units have completed the interaction within their respective address switching time slices.
[0141] It should be noted that in order to cope with dynamic changes in the USB device connection status, such as device plugging and unplugging, device type changes, etc., the UDC module will periodically update the address switching time slice settings to ensure that all connected USB device driver units can be accurately controlled.
[0142] The device provided in this embodiment uses a timer to trigger the interruption of the address switching time slice. The UDC module can efficiently control multiple USB device driver units to interact with the Host, thereby meeting the increasing demand for different USB device functions in the data center and reducing the cost of hardware resources.
[0143] In some embodiments, the universal serial bus device controller 211 is further configured to:
[0144] According to the current running state of the timer, determining whether the timer is in a timeout state;
[0145] When it is determined that the timer is in a timeout state, the cycle period of the timer is matched with the address switching time slice corresponding to the universal serial bus device hub driver unit 212 and the address switching time slice corresponding to each of the universal serial bus device driver units 213;
[0146] According to the matching result, it is determined whether the address switching time slice corresponding to the universal serial bus device hub driver unit 212 and the address switching time slice corresponding to each of the universal serial bus device driver units 213 are triggered.
[0147] Figure 5 One of the flowcharts of address switching provided by the present invention; Figure 5 As shown, the UDC module can also perform the following steps to implement device address switching:
[0148] Step 510, judging whether the timer is in a timeout state according to the current running state of the timer, if it is in a timeout state, executing step 520;
[0149] Step 520, determine whether the device address is allowed to be modified, if it is allowed, execute step 530, otherwise execute step 510;
[0150] Step 530: Match the cycle period to which the timer belongs with the address switching time slice corresponding to the universal serial bus device hub driver unit 212 and the address switching time slice corresponding to each of the universal serial bus device driver units 213, so as to use the matched address switching time slice as the triggered address switching time slice, thereby obtaining the device address of the current driver unit to be controlled in the device address list according to the triggered address switching time slice;
[0151] Step 540 : Switch the device address in the device address register according to the acquired device address of the current drive unit to be controlled, and control the current drive unit to be controlled to interact with the server host 220 , and then jump to step 510 .
[0152] The device provided in this embodiment triggers the corresponding address switching time slice according to the timeout status of the timer, thereby ensuring that multiple drive units can interact with the server host in a time-sharing manner according to a predetermined time sequence, and realizes that a single UDC module supports multiple USB devices to communicate with the server host at the same time, which greatly reduces the hardware resource cost of USB device control and improves the management efficiency of multiple USB devices.
[0153] In some embodiments, the universal serial bus device controller 211 is further configured to:
[0154] Determining current access permission information of the current drive unit to be controlled according to the current access status of the device address register;
[0155] When it is determined, based on the current access permission information of the current drive unit to be controlled, that the current drive unit to be controlled has the permission to access the device address register, the device address in the device address register is switched to the device address of the current drive unit to be controlled, and a locking operation is performed on the device address register.
[0156] Optionally, in order to avoid FADDR access conflicts, the UDC module can also perform the following steps to implement device address switching:
[0157] First, the current access status of FADDR is detected, such as whether FADDR is being accessed by other drive units, whether there are unfinished read and write operations, etc., to determine whether FADDR is in an unoccupied state.
[0158] When it is known that FADDR is in an unoccupied state, it is determined that the current drive unit to be controlled has the authority to access the device address register. When it is known that FADDR is in an occupied state, it is determined that the current drive unit to be controlled does not have the authority to access the device address register.
[0159] If it is determined that the current drive unit to be controlled has the authority to access the device address register, the device address in the device address register is switched to the device address of the current drive unit to be controlled, and to ensure that the device address register is not accessed or modified by other unauthorized drive units after the switch, the device address register needs to be locked. The so-called locking can be achieved by setting a specific register flag bit, using a mutex lock or other synchronization mechanism.
[0160] The device provided in this embodiment can ensure that only the driver unit with corresponding permissions can access the device address register through access permission control, which helps to prevent unauthorized access and potential security risks. By performing a locking operation after the device address register is switched, it can ensure that only one driver unit can access and modify the register at the same time, which helps to reduce resource conflicts and potential data inconsistency problems, thereby ensuring that each driver unit can effectively use the device address register to interact with the Host, thereby improving the effectiveness of controlling multiple USB devices.
[0161] In some embodiments, the universal serial bus device controller 211 is further configured to:
[0162] When it is determined that the locking operation of the device address register is completed, receiving a current task processing request initiated by the server host 220;
[0163] According to the target device address, transmitting the current task processing request to the current drive unit to be controlled;
[0164] Transmitting the first response information returned by the current drive unit to be controlled according to the current task processing request to the server host 220;
[0165] When it is determined that the server host 220 has received the first response information, the locking operation on the device address register is released.
[0166] Optionally, in order to improve resource utilization, the UDC module may also perform the following steps to implement device address switching:
[0167] After the device address register completes the locking operation, the UDC module will detect and confirm that the locking operation has been completed to ensure that the device address register is in a safe and exclusive state before the task processing request is transmitted. Once the locking operation is confirmed to be completed, the UDC module will start to monitor and receive the current task processing request initiated by the server host 220; the so-called request includes data transmission, device control, etc.
[0168] After receiving the current task processing request, the UDC module will parse the task processing request and accurately transmit the request to the current drive unit to be controlled according to the target device address.
[0169] After the current drive unit to be controlled completes the task and generates response information, the UDC module receives the first response information and transmits it back to the server host 220; after knowing that the server host 220 has received the first response information, the UDC module will release the lock operation on the device address register, so that it can be restored to an accessible state for use by other drive units, thereby improving resource utilization.
[0170] In some embodiments, the universal serial bus device controller 211 is further configured to:
[0171] According to the current task processing request, obtain the current request device address;
[0172] Matching the current request device address with the target device address;
[0173] When it is found through matching that the current request device address is consistent with the target device address, the current task processing request is transmitted to the current drive unit to be controlled according to the target device address.
[0174] Optionally, in order to ensure the correctness of the request transmission, the UDC module may perform the following steps to implement the request transmission:
[0175] When the UDC module receives the current task processing request from the server host 220, it first parses the current task processing request and extracts the device address pointed to by the request, that is, the current request device address. The current request device address is matched with the target device address to ensure that the task processing request is sent to the correct target device to prevent data transmission errors or device control abnormalities caused by device address errors.
[0176] If during the matching process, it is determined that the current request device address is consistent with the target device address, then the current task processing request is determined to be valid. At this time, the current task processing request can be accurately transmitted to the corresponding current drive unit to be controlled according to the matched target device address, so that the current drive unit to be controlled can respond to the current task processing request, thereby realizing effective interaction between the current drive unit to be controlled and the Host.
[0177] The apparatus provided in this embodiment can ensure that the request is sent to the correct drive unit by matching the device address before task processing, thereby avoiding task processing failure or data transmission error due to device address error, improving the task processing accuracy of the entire system, and preventing illegal requests or erroneous requests from being sent to the drive unit, thereby enhancing the security of the drive unit and reducing potential security risks and vulnerabilities.
[0178] Optionally, in order to ensure the correctness of the request transmission, the UDC module may also perform the following steps to implement the request transmission:
[0179] When the UDC module finds that the current request device address is inconsistent with the target device address during the matching process, it can store the current task processing request in a cache queue. The cache queue is used to temporarily store requests waiting to be processed so that they can be matched and transmitted again at an appropriate time.
[0180] The UDC module continuously monitors changes in the device address register. When the device address in the device address register switches to the device address of the next drive unit to be controlled, the current request device address of the current task processing request stored in the cache queue is matched again with the device address of the next drive unit to be controlled obtained by switching in the device address register.
[0181] If during the rematching process, it is learned that the current request device address is consistent with the device address of the next drive unit to be controlled, the current task processing request is taken out of the cache queue and transmitted to the corresponding next drive unit to be controlled so that the next drive unit to be controlled can process the current task processing request.
[0182] The device provided in this embodiment can ensure that each request can be processed in a timely manner and will not be discarded or delayed due to address mismatch, by storing unmatched requests in a cache queue and re-matching and transmitting after the device address is switched, thereby greatly improving the efficiency and performance of task processing.
[0183] The following describes the address switching process provided by this embodiment in detail with a specific example.
[0184] Figure 6 The second flowchart of the address switching provided by the present invention; Figure 6 As shown, the address switching process can be implemented by the UDC module executing the following steps:
[0185] Step 610: If it is determined according to the running state of the timer that the address switching time slice corresponding to the USB Hub driver unit has been entered, the FADDR operation is locked within the time slice to prevent other processes from accessing FADDR and causing access conflicts, and FADDR is set as the device address of the USB Hub driver unit;
[0186] Step 620, waiting for the task processing request initiated by the Host to the USB Hub driver unit, that is, the Hub class request, such as the request to obtain the port status; after the USB Hub driver unit receives the request and responds to the Host's request, it releases the lock operation on FADDR and waits to enter the next address switching state at a fixed time;
[0187] Step 630: If it is determined according to the timer running state that the address switching time slice corresponding to the Mass Storage driver unit has been entered, the FADDR register operation is locked within the time slice to prevent other processes from accessing FADDR and causing access conflicts, and FADDR is set as the device address of the Mass Storage driver unit;
[0188] Step 640, waiting for the host to initiate a request to the Mass Storage driver unit, when the Mass Storage driver unit receives the request and responds to the request of the host, it releases the lock operation on the FADDR and waits to enter the next address switching state at a fixed time;
[0189] Step 650: if it is determined according to the timer running state that the address switching time slice corresponding to the HID driver unit has been entered, the FADDR register operation is locked within the time slice to prevent other processes from accessing FADDR and causing access conflicts, and FADDR is set as the device address of the HID driver unit;
[0190] Step 660, waiting for the host to initiate a request to the HID driver unit, when the HID driver unit responds to the request of the host after receiving the request, releasing the lock operation on FADDR, and waiting to enter the next address switching state at a certain time;
[0191] Step 670: If it is determined according to the timer running state that the address switching time slice corresponding to the ECM driver unit has been entered, the FADDR register operation is locked within the time slice to prevent other processes from accessing FADDR and causing access conflicts, and FADDR is set as the device address of the ECM driver unit;
[0192] Step 680, waiting for the host to initiate a request to the ECM driver unit, when the ECM driver unit responds to the request of the host after receiving the request, the lock operation on the FADDR is released, and the next address switching state is entered in a timely manner;
[0193] Step 690, jump to step 610 according to the timer running status.
[0194] It should be noted that the timer operation in the above steps is mainly used to set the address switching time of different devices. Figure 5 The process is consistent.
[0195] In summary, the timer-based multi-USB device address switching solution proposed in this embodiment can better realize the interaction between multiple USB devices and the Host, provide greater flexibility and scalability for the system, and can be easily expanded to access more USB devices to meet the different demand scenarios of BMC when multiple USB devices are accessed, thereby enhancing the adaptability and versatility of the system; secondly, it avoids the need for frequent hardware upgrades or replacements due to insufficient hardware UDC modules, thereby reducing related hardware costs. At the same time, since the software implementation method has higher flexibility, it can quickly adapt to market changes and customer needs, reduce the additional costs caused by technology iterations, and improve the overall economic benefits.
[0196] In some embodiments, the universal serial bus device hub driver unit 212 is used to:
[0197] receiving a first enumeration request sent by the server host 220; the first enumeration request is used to enumerate the universal serial bus device hub driver unit 212;
[0198] Returning second response information to the server host 220 according to the first enumeration request;
[0199] receiving a device address assigned by the server host 220 to the universal serial bus device hub driver unit 212 according to the second response information;
[0200] Modify the device address register to the device address of the universal serial bus device hub driver unit 212;
[0201] Receiving a status acquisition command of the universal serial bus device driver unit 213 sent by the server host 220;
[0202] In response to the status acquisition command, reporting the device status of each of the universal serial bus device driver units 213 to the server host 220 according to the device address of the universal serial bus device hub driver unit 212;
[0203] The receiving server host 220 enumerates the allocated device addresses for each of the USB device driver units 213 according to the device status of each of the USB device driver units 213 , and transmits the device addresses of each of the USB device driver units 213 to each of the USB device driver units 213 .
[0204] It should be noted that the host enumeration of the BMC's USB devices is the basis of USB communication, which involves the process of the host identifying and configuring the USB devices. Only successful enumeration can realize the data communication between the host and the USB devices. Since this embodiment only configures one UDC module, that is, there is only one FADDR, when the host enumerates the USB devices, the USB Hub driver unit and multiple USB device driver units need to share this FADDR, and a set of register sharing solutions must be designed in software to realize the enumeration of all USB devices. In view of this, this embodiment realizes the enumeration of each USB device driver unit by controlling the USB Hub driver unit to report the status of each USB device driver unit one by one.
[0205] Optionally, the USB Hub driver unit can interact with the Host to perform the following steps to achieve enumeration:
[0206] After the USB Hub driver unit is connected to the Host, it first receives a first enumeration request sent from the Host. The so-called first enumeration request is used to enumerate the USB Hub driver unit to obtain its device information and configuration.
[0207] After receiving the first enumeration request, the USB Hub driver unit returns a second response message to the Host according to the request content. The second response message includes but is not limited to the device type, port number, and query time interval of each connected downstream port.
[0208] The Host assigns a device address to the USB Hub driver unit according to the returned second response information.
[0209] The USB Hub driver unit receives the device address and stores it in the device address register.
[0210] Subsequently, the Host may send a USB device driver unit status acquisition command to query the status of each USB device driver unit connected to the USB Hub driver unit.
[0211] The USB Hub driver unit responds to the status acquisition command and reports the device status of each connected USB device driver unit to the Host according to its own device address. The so-called device status includes but is not limited to the connection status, device type, and operation status of the device.
[0212] The host enumerates and allocates device addresses to each USB device driver unit according to the received device status information. The USB Hub driver unit receives the device addresses enumerated by the host and transmits them to the corresponding USB device driver units, thereby implementing the enumeration of each driver unit so that each driver unit can interact with the host based on the device addresses generated by the enumeration.
[0213] The device provided in this embodiment can ensure the correct connection and communication between the Host and each USB device driver unit through enumeration and address allocation, which helps to reduce problems such as system crash or data loss caused by device connection errors or communication failures, thereby enhancing the stability and reliability of the system.
[0214] In some embodiments, the second response information includes the device type and port number of the universal serial bus device hub driver unit 212;
[0215] The device address of the USB device hub driver unit 212 is allocated by the server host 220 according to the device type and port number of the USB device hub driver unit 212 .
[0216] Optionally, when receiving the enumeration request from the local end, the USB Hub driver unit can report its own device type and port number to the Host so that the Host can more accurately identify the characteristics and functions of the USB Hub driver unit, and then reasonably and efficiently assign a corresponding unique device address to the USB Hub driver unit based on the device type and port number to ensure the stability and compatibility of the BMC.
[0217] In some embodiments, the second response information further includes the query time interval of each of the universal serial bus device driver units 213;
[0218] The status acquisition command of the universal serial bus device driver unit 213 is sent periodically according to the query time interval.
[0219] Optionally, when receiving the enumeration request from the local end, the USB Hub driver unit may also report the query time interval of each USB device driver unit to the Host, so that the Host can periodically send the USB device driver unit status acquisition command to the USB Hub driver unit according to the query time interval of each USB device driver unit, so as to ensure that the USB Hub driver unit can smoothly send each USB device driver unit to the Host, thereby improving the response efficiency to the Host.
[0220] In some embodiments, the universal serial bus device hub driver unit 212 is further used for:
[0221] For the current secondary port device enumeration, the device address register is modified to the device address of the universal serial bus device hub driver unit 212;
[0222] Receiving a current status acquisition command of the current universal serial bus device driver unit 213 sent by the server host 220;
[0223] In response to the current status acquisition command, the target device status of the current universal serial bus device driver unit 213 is sent to the server host 220 according to the device address of the universal serial bus device hub driver unit 212;
[0224] clearing the device address register, and receiving, according to the target device state, a second enumeration request of the current universal serial bus device driver unit 213 sent by the server host 220 according to the target device state;
[0225] Sending the third response information returned by the current universal serial bus device driver unit 213 according to the second enumeration request to the server host 220;
[0226] Transmitting the device address allocated by the server host 220 to the current universal serial bus device driver unit 213 according to the third response information to the current universal serial bus device driver unit 213;
[0227] The device address register is modified to the device address of the universal serial bus device hub driver unit 212, and the next port device enumeration is iteratively performed until all the universal serial bus device driver units 213 are enumerated.
[0228] Optionally, the USB Hub driver unit may also interact with the Host to perform the following steps to implement enumeration:
[0229] For the current secondary port device enumeration, the USB Hub driver unit modifies the device address register to the device address of the USB Hub driver unit, and receives the current status acquisition command, such as the GetPortStatus command, periodically sent by the Host according to the port query time interval reported in the second response information returned by the USB Hub driver unit, to report the device status of the downstream port of the USB Hub driver unit to the Host.
[0230] The USB Hub driver unit checks all its downstream ports and sends the target device status of the current USB device driver unit to the Host.
[0231] After the status report of the device of the current USB device driver unit, the USB Hub driver unit clears the FADDR address, sets it to 0, and waits for the Host to start enumerating the downstream port devices.
[0232] The host sends a second enumeration request to the current USB device driver unit downstream of the USB Hub driver unit according to the target device state, so as to enumerate the current USB device driver unit downstream of the USB Hub driver unit.
[0233] The current USB device driver unit returns the third response information to the Host in response to the enumeration request of the Host, and obtains the device address allocated by the Host according to the third response information for recording.
[0234] After the current USB device driver unit is enumerated, the USB Hub driver unit returns to the step of modifying the device address register to the device address of the USB Hub driver unit, and continues to wait for the Host to initiate a status acquisition request for the next USB device driver unit to iteratively perform the next port device enumeration until all USB device driver units are enumerated.
[0235] The device provided in this embodiment iteratively performs port device enumeration so as to identify and manage all downstream port devices connected to the USB Hub driver unit one by one. This orderly enumeration process ensures that each downstream port device can be correctly enumerated, avoiding performance problems caused by device conflicts or identification errors, thereby improving the correctness of multi-USB device management.
[0236] The following describes the device enumeration process provided in this embodiment in detail with a specific example.
[0237] Figure 7 A schematic diagram of a flow chart of device enumeration provided by the present invention; Figure 7 As shown, the device enumeration process can be implemented by the USB Hub driver unit and the Host performing the following interactive steps:
[0238] Step 710, after the USB Hub driver unit is connected to the Host, the Host sends an enumeration request to the USB Hub driver unit, and the Hub responds to the enumeration request and reports response information including its own device type and port number, as well as the query time interval of each downstream port;
[0239] Step 720, after receiving the response information from the USB Hub driver unit, the Host allocates a device address to the USB Hub driver unit, and the USB Hub driver unit records the address and writes it into FADDR;
[0240] Step 730, the Host periodically sends a GetPortStatus command according to the query time interval of each port reported by the USB Hub driver unit to request to obtain the device status of the downstream port of the USB Hub driver unit;
[0241] Step 740, the USB Hub driver unit determines whether the device status reports of all downstream ports are completed, if yes, then the process ends, otherwise, the process goes to step 750;
[0242] Step 750, the USB Hub driver unit reports the device status of the current downstream port device (current USB device driver unit), reporting the device status of one device at a time;
[0243] Step 760, the USB Hub driver unit clears the FADDR address, sets it to 0, and waits for the Host to enumerate the current downstream port device of the USB Hub driver unit;
[0244] Step 770, the Host initiates an enumeration request to the current downstream port device of the USB Hub driver unit;
[0245] Step 780, the current downstream port device responds to the host's enumeration request, obtains the device address assigned by the host and records it;
[0246] In step 790 , the USB Hub driver unit modifies FADDR to its own device address, waits for the Host to continue to initiate a GetPortStatus request, and jumps to step 730 .
[0247] After the above steps, each USB device driver unit under the USB Hub obtains its own device address, and subsequently accurate and effective interaction between different USB device driver units and the Host can be achieved based on this device address.
[0248] In some embodiments, for each of the USB device hub driver unit 212 and the plurality of USB device driver units 213, the driver unit is configured with at least one port number;
[0249] The drive unit is used for:
[0250] When receiving a task processing request initiated by the server host 220, obtaining a target port number from at least one of the port numbers according to a task type and a data transmission mode corresponding to the task processing request;
[0251] The task processing request is processed according to the task operation mode corresponding to the target port number, and the task processing result is returned to the server host 220.
[0252] like Figure 4 As shown, the UDC module supports 1 device address and 1 control port, which can be encoded as 0. In order to support multiple USB devices, for each driver unit endpoint configuration of the USB Hub driver unit and multiple USB device driver units, one or more port numbers can be configured for it.
[0253] The endpoint configuration of each driving unit may be numbered sequentially according to the port position of each driving unit, or may be numbered adaptively according to the device type of different driving units, which is not specifically limited in this embodiment.
[0254] In some embodiments, the port numbering of a drive unit is configured according to the device type of the drive unit.
[0255] Optionally, since the data operation modes of driver units of different device types are different, the corresponding port numbers and port types are also different. Therefore, in order to effectively realize the functions of driver units of different device types, the corresponding port numbers and port types can be determined according to the device type of the driver unit, and different port numbers can be configured according to the corresponding port numbers and port types. The so-called port types include input ports and output ports, or include more types of ports that are further refined for input ports and output ports.
[0256]
[0257] As shown in Table 1 and Figure 4 , is an exemplary endpoint configuration method, in which the USB Hub driver unit, the HID driver unit, the Mass Storage driver unit and the ECM driver unit share the control endpoint 0. The USB Hub driver unit can be configured with an input (also called IN) endpoint, which is numbered as endpoint 1, and the transmission type is set to interrupt transmission; the HID driver unit is configured with an IN endpoint, which is numbered as endpoint 2, and the transmission type is set to interrupt transmission; the Mass Storage driver unit is configured with two endpoints, one is an IN endpoint, which is numbered as endpoint 3, and the transmission type is set to bulk transmission; the other is an output (OUT) endpoint, which is numbered as endpoint 1, and the transmission type is set to bulk transmission; the ECM driver unit is configured with three endpoints, two are IN endpoints, which are numbered as endpoints 4 and 5, and the transmission type is set to bulk transmission, and one is an OUT endpoint, which is numbered as endpoint 2, and the transmission type is set to bulk transmission.
[0258] It should be noted that the numbers of different types of ports of different drive units may be the same or different.
[0259] In some embodiments, the port number of the input end of any driving unit is the same as the port number of the output port of any other driving unit except the any driving unit.
[0260] Optionally, the numbering of different types of ports of different driver units can be the same, which optimizes the allocation and use of system resources, eliminates the need to design and manage numbers for each port separately, and reduces development costs and complexity. For example, the numbering of the input port of the HID driver unit is the same as the numbering of the output port of the ECM driver unit, and for another example, the numbering of the output port of the Mass Storage driver unit is the same as the numbering of the input port of the USB Hub driver unit.
[0261] Optionally, after the port number configuration of each drive unit is completed, each drive unit can complete different task processing initiated by the host according to different port numbers. For each drive unit, the following steps can be performed to implement task processing:
[0262] When a task processing request initiated by the Host is received, the task processing request may be parsed to obtain the task type and data transmission mode corresponding to the task processing request; the so-called task types include but are not limited to reading and writing, and the data transmission modes include but are not limited to interrupt transmission and batch transmission.
[0263] Then, according to the corresponding task type and data transmission mode, the target port number corresponding to the task type and data transmission mode is searched in the port number managed by it, so as to call the task operation mode corresponding to the target port number to process the task, and return the processing result to the Host. For example, if the task request is to send data to the HID device, the driver unit will use the interrupt transmission mode configured on endpoint 2 to send the data; if the task request is to read data from the Mass Storage device, the driver unit will use the bulk transmission mode configured on endpoint 3 to read the data, and send the data back to the server host 220 through endpoint 1.
[0264] In the apparatus provided in this embodiment, the USB Hub driver unit and multiple USB device driver units work together to ensure that the Host can communicate with various USB devices efficiently and reliably, manage different USB devices through port numbers, and select appropriate processing methods according to task types and data transmission modes, thereby realizing the function of supporting multiple USB devices and further realizing efficient and reliable management of multiple USB devices.
[0265] In some embodiments, this embodiment further provides a universal serial bus control system, which may be a computer system, a cloud computing system, etc., and this embodiment does not specifically limit this.
[0266] like Figure 2 As shown, the universal serial bus control device in the system can be connected to the server host 220 for communication, so as to control the USB device driver unit under it to interact with the server host 220, thereby realizing remote monitoring of the server host 220.
[0267] The system provided by the present embodiment configures a universal serial bus device controller, a universal serial bus device hub driver unit, and multiple universal serial bus device driver units that realize different types of virtual USB device functions inside the BMC, and the universal serial bus device controller switches the device address register configured inside the universal serial bus device controller in real time according to the address switching time slice corresponding to the universal serial bus device hub driver unit and the address switching time slice corresponding to each universal serial bus device driver unit, so as to control different universal serial bus device driver units to interact with the server host in different time slices according to the switched device address and the control port multiplexed by multiple driver units configured inside the universal serial bus device controller, which can effectively avoid allocating independent hardware resources for each USB device, and even if there is only one UDC module, unified control of multiple USB devices can be realized, reducing the hardware resource cost consumed by one-to-one configuration of UDC modules and improving the flexibility of resource utilization, thereby realizing low-cost and convenient unified control of multiple USB devices.
[0268] In some embodiments, this embodiment further provides a universal serial bus control method, which is implemented based on the universal serial bus control devices provided in the above embodiments. Figure 8 A schematic flow chart of a universal serial bus control method provided by the present invention; Figure 8 As shown, the method includes step 810 and step 820.
[0269] Step 810: Switch the device address in the device address register according to the address switching time slice corresponding to the universal serial bus device hub driver unit and the address switching time slice corresponding to each universal serial bus device driver unit.
[0270] Step 820, according to the switched device address and control port, control the Universal Serial Bus device hub driver unit and each of the Universal Serial Bus device driver units to interact with the server host; wherein the device address register is a register shared by the Universal Serial Bus device hub driver unit and multiple Universal Serial Bus device driver units in the Universal Serial Bus device controller, and the control port is a port shared by the Universal Serial Bus device hub driver unit and multiple Universal Serial Bus device driver units in the Universal Serial Bus device controller.
[0271] Optionally, for each interaction, the UDC module can determine whether the address switching time slice corresponding to the universal serial bus device hub driver unit and the address switching time slice corresponding to each universal serial bus device driver unit are triggered, and determine the target driver unit that needs to interact with the Host this time among the USB Hub driver unit and multiple USB device driver units, and switch the device address in FADDR in real time according to the device address of the target driver unit, so as to establish a communication connection between the target driver unit and the Host through the switched device address, and in the address switching time slice corresponding to the target driver unit, pass the interaction request sent by the Host to the target driver unit through the communication connection, and pass the response information returned by the target driver unit according to the interaction request to the Host, thereby realizing the interaction between the target driver unit and the Host.
[0272] After the current interaction ends, the UDC module continues to determine the target driver unit that needs to interact with the Host next time among the USB Hub driver unit and multiple USB device driver units according to the address switching time slices corresponding to the Universal Serial Bus device hub driver unit and the address switching time slices corresponding to each Universal Serial Bus device driver unit, so as to iteratively execute the interaction steps until the BMC system is shut down or the BMC configuration is updated.
[0273] The method provided in this embodiment switches the device address register configured inside the universal serial bus device controller in real time according to the address switching time slice corresponding to the universal serial bus device hub driver unit and the address switching time slice corresponding to each universal serial bus device driver unit through the universal serial bus device controller, so as to control different universal serial bus device driver units to interact with the server host in different time slices according to the switched device address and the control port multiplexed by multiple driver units configured inside the universal serial bus device controller, which can effectively avoid allocating independent hardware resources for each USB device, and even if there is only one UDC module, it can realize unified control of multiple USB devices, reduce the hardware resource cost consumed by one-to-one configuration of UDC modules and improve the flexibility of resource utilization, thereby realizing low-cost and convenient unified control of multiple USB devices.
[0274] In some embodiments, according to the address switching time slice corresponding to the universal serial bus device hub driver unit and the address switching time slice corresponding to each universal serial bus device driver unit, the device address in the device address register is switched, including:
[0275] For the current interaction, judging whether the address switching time slice corresponding to the universal serial bus device hub driver unit and the address switching time slice corresponding to each of the universal serial bus device driver units are triggered according to the current running state of the timer;
[0276] Determine, among the universal serial bus device hub driver unit and the plurality of universal serial bus device driver units, a current driver unit to be controlled whose address switching time slice is triggered;
[0277] The device address in the device address register is switched to the device address of the current drive unit to be controlled.
[0278] Optionally, when the BMC starts, the UDC module will be initialized, including the configuration of the device address register, control port, timer, and in the MUSB driver unit, the USB hardware initialization and the registration of each driver unit are implemented. The timer is set to trigger an interrupt at a predetermined time interval so as to control different USB device driver units in sequence.
[0279] During the initialization process, the UDC module allocates address switching time slices for the USB Hub driver unit and each USB device driver unit. These time slices define the time period during which each driver unit can occupy the device address register and control port.
[0280] During the current interaction, according to the current running state of the timer, the UDC module will determine whether the timer has reached the address switching time slice that triggers any drive unit.
[0281] When it is determined that the timer currently triggers the address switching time slice of any driving unit, the UDC module marks the driving unit as the driving unit currently required to be controlled, that is, the driving unit currently to be controlled.
[0282] The UDC module switches the device address in the device address register to the device address of the current drive unit to be controlled, so that in the current interaction process, only the current drive unit to be controlled and the Host are interacted.
[0283] The UDC module uses the switched target device address and control port to start controlling the current drive unit to interact with the Host. The so-called interaction includes operations such as data transmission and command execution.
[0284] After learning that the Host has completed the interaction with the current drive unit to be controlled, the UDC module will iteratively control the next drive unit to be controlled to interact with the server host according to the next running state of the timer until all drive units have completed the interaction within their respective address switching time slices.
[0285] The method provided in this embodiment uses a timer to trigger the interruption of the address switching time slice. The USB device controller can efficiently control multiple USB device driver units to interact with the server host, thereby meeting the increasing demand for different USB device functions in the data center and reducing the cost of hardware resources.
[0286] The method provided by the present invention is executed based on the above-mentioned device embodiments. Please refer to the above-mentioned embodiments for the specific execution process and detailed contents, which will not be repeated here.
[0287] Fig. 9 An example of a physical structure diagram of an electronic device is shown in FIG. Fig. 9 As shown, the electronic device may include: a processor (processor) 910, a communication interface (Communications Interface) 920, a memory (memory) 930 and a communication bus 940, wherein the processor 910, the communication interface 920, and the memory 930 communicate with each other through the communication bus 940. The processor 910 can call the logic instructions in the memory 930 to execute the universal serial bus control method, which includes: switching the device address in the device address register according to the address switching time slice corresponding to the universal serial bus device hub driver unit and the address switching time slice corresponding to each universal serial bus device driver unit; controlling the universal serial bus device hub driver unit and each of the universal serial bus device driver units to interact with the server host according to the switched device address and control port; wherein the device address register is a register shared by the universal serial bus device hub driver unit and multiple universal serial bus device driver units in the universal serial bus device controller, and the control port is a port shared by the universal serial bus device hub driver unit and multiple universal serial bus device driver units in the universal serial bus device controller.
[0288] In addition, the logic instructions in the above-mentioned memory 930 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program codes.
[0289] On the other hand, the present invention also provides a computer program product, which includes a computer program, which can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can execute the universal serial bus control method provided by the above-mentioned methods, the method comprising: switching the device address in the device address register according to the address switching time slice corresponding to the universal serial bus device hub driver unit and the address switching time slice corresponding to each universal serial bus device driver unit; controlling the universal serial bus device hub driver unit and each universal serial bus device driver unit to interact with the server host according to the switched device address and control port; wherein the device address register is a register shared by the universal serial bus device hub driver unit and multiple universal serial bus device driver units in the universal serial bus device controller, and the control port is a port shared by the universal serial bus device hub driver unit and multiple universal serial bus device driver units in the universal serial bus device controller.
[0290] On the other hand, the present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, is implemented to execute the universal serial bus control method provided by the above-mentioned methods, the method comprising: switching the device address in the device address register according to the address switching time slice corresponding to the universal serial bus device hub driver unit and the address switching time slice corresponding to each universal serial bus device driver unit; controlling the universal serial bus device hub driver unit and each of the universal serial bus device driver units to interact with the server host according to the switched device address and control port; wherein the device address register is a register shared by the universal serial bus device hub driver unit and multiple universal serial bus device driver units in the universal serial bus device controller, and the control port is a port shared by the universal serial bus device hub driver unit and multiple universal serial bus device driver units in the universal serial bus device controller.
[0291] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.
[0292] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.
[0293] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A universal serial bus control device, characterized in that: The device is communicatively connected to a server host, and comprises a universal serial bus device controller, a universal serial bus device hub driver unit, and a plurality of universal serial bus device driver units; The USB device controller includes the USB device hub driver unit and a device address register and a control port shared between a plurality of the USB device driver units; The universal serial bus device controller is used to switch the device address in the device address register according to the address switching time slice corresponding to the universal serial bus device hub driver unit and the address switching time slice corresponding to each of the universal serial bus device driver units, and control the universal serial bus device hub driver unit and each of the universal serial bus device driver units according to the switched device address and the control port to interact with the server host; The universal serial bus device controller also includes a timer; The universal serial bus device controller is specifically used for: For the current interaction, judging, according to the current running state of the timer, whether the address switching time slice corresponding to the universal serial bus device hub driver unit and the address switching time slice corresponding to each of the universal serial bus device driver units are triggered; Determine, among the universal serial bus device hub driver unit and the plurality of universal serial bus device driver units, a current driver unit to be controlled whose address switching time slice is triggered; Switching the device address in the device address register to the device address of the current drive unit to be controlled to obtain a target device address; According to the target device address and the control port, controlling the current drive unit to be controlled to interact with the server host; Continue to iteratively control the next drive unit to be controlled to interact with the server host according to the next operating state of the timer.
2. The universal serial bus control device according to claim 1, characterized in that: The universal serial bus device controller is further used for: According to the current running state of the timer, determining whether the timer is in a timeout state; When it is determined that the timer is in a timeout state, the cycle period to which the timer belongs is matched with the address switching time slice corresponding to the universal serial bus device hub driver unit and the address switching time slice corresponding to each of the universal serial bus device driver units; According to the matching result, it is determined whether the address switching time slice corresponding to the universal serial bus device hub driver unit and the address switching time slice corresponding to each of the universal serial bus device driver units are triggered.
3. The universal serial bus control device according to claim 1, characterized in that: The universal serial bus device controller is further used for: Determining current access permission information of the current drive unit to be controlled according to the current access status of the device address register; When it is determined, based on the current access permission information of the current drive unit to be controlled, that the current drive unit to be controlled has the permission to access the device address register, the device address in the device address register is switched to the device address of the current drive unit to be controlled, and a locking operation is performed on the device address register.
4. The universal serial bus control device according to claim 3, characterized in that: The universal serial bus device controller is further used for: When it is determined that the locking operation of the device address register is completed, receiving a current task processing request initiated by the server host; According to the target device address, transmitting the current task processing request to the current drive unit to be controlled; Transmitting first response information returned by the current drive unit to be controlled according to the current task processing request to the server host; When it is determined that the server host has received the first response information, the locking operation on the device address register is released.
5. The universal serial bus control device according to claim 4, characterized in that: The universal serial bus device controller is further used for: According to the current task processing request, obtain the current request device address; Matching the current request device address with the target device address; When it is found through matching that the current request device address is consistent with the target device address, the current task processing request is transmitted to the current drive unit to be controlled according to the target device address.
6. The universal serial bus control device according to claim 5, characterized in that: The universal serial bus device controller is further used for: When it is learned through matching that the current request device address is inconsistent with the target device address, storing the current task processing request in a cache queue; In the case of determining that the device address in the device address register is switched to the device address of the next drive unit to be controlled, continue to match the current request device address with the device address of the next drive unit to be controlled obtained by switching in the device address register; When it is found through matching that the current request device address matches the device address of the next drive unit to be controlled, the current task processing request is taken out from the cache queue and then transmitted to the next drive unit to be controlled.
7. The universal serial bus control device according to any one of claims 1 to 6, characterized in that: The universal serial bus device hub driver unit is used for: receiving a first enumeration request sent by the server host; the first enumeration request is used to enumerate the universal serial bus device hub driver unit; Returning second response information to the server host according to the first enumeration request; receiving a device address assigned by the server host to the universal serial bus device hub driver unit according to the second response information; Modify the device address register to the device address of the universal serial bus device hub driver unit; Receiving a status acquisition command of a universal serial bus device driver unit sent by the server host; In response to the status acquisition command, reporting the device status of each of the universal serial bus device driver units to the server host according to the device address of the universal serial bus device hub driver unit; The server host receives the device address assigned to each of the universal serial bus device driver units according to the device status of each of the universal serial bus device driver units, and transmits the device address of each of the universal serial bus device driver units to each of the universal serial bus device driver units.
8. The universal serial bus control device according to claim 7, characterized in that: The universal serial bus device hub driver unit is further used for: For the current secondary port device enumeration, modifying the device address register to the device address of the universal serial bus device hub driver unit; Receiving a current status acquisition command of a current universal serial bus device driver unit sent by the server host; In response to the current status acquisition command, sending the target device status of the current universal serial bus device driver unit to the server host according to the device address of the universal serial bus device hub driver unit; clearing the device address register, and receiving, according to the target device state, a second enumeration request of the current universal serial bus device driver unit sent by the server host according to the target device state; Sending the third response information returned by the current universal serial bus device driver unit according to the second enumeration request to the server host; transmitting the device address allocated by the server host to the current universal serial bus device driver unit according to the third response information to the current universal serial bus device driver unit; Return to modifying the device address register to the device address of the universal serial bus device hub driver unit, and iterate to perform the next port device enumeration until all the universal serial bus device driver units are enumerated.
9. The universal serial bus control device according to claim 7, characterized in that: The second response information includes the device type and port number of the universal serial bus device hub driver unit; The device address of the universal serial bus device hub driver unit is allocated by the server host according to the device type and port number of the universal serial bus device hub driver unit.
10. The universal serial bus control device according to claim 9, characterized in that: The second response information also includes a query time interval of each of the universal serial bus device driver units; The state acquisition command of the universal serial bus device driver unit is sent periodically according to the query time interval.
11. The universal serial bus control device according to any one of claims 1 to 6, characterized in that: For the universal serial bus device hub driver unit and each of the plurality of universal serial bus device driver units, the driver unit is configured with at least one port number; The drive unit is used for: When receiving a task processing request initiated by the server host, obtaining a target port number from at least one of the port numbers according to a task type and a data transmission mode corresponding to the task processing request; The task processing request is processed according to the task operation mode corresponding to the target port number, and the task processing result is returned to the server host.
12. The universal serial bus control device according to claim 11, characterized in that: The port number of the drive unit is configured according to the device type of the drive unit.
13. The universal serial bus control device according to claim 11, characterized in that: The port number of the input end of any driving unit is the same as the port number of the output port of any other driving unit except the any driving unit.
14. The universal serial bus control device according to any one of claims 1 to 6, characterized in that: The plurality of universal serial bus device driver units include a human-machine interface driver unit, a network controller driver unit and a memory driver unit; The human-machine interface driving unit is used to drive a virtual human-machine interface device; The network controller driving unit is used to drive the virtual network device; The memory driving unit is used for driving the virtual memory.
15. A universal serial bus control system, characterized in that: Comprising the universal serial bus control device and the server host as claimed in any one of claims 1 to 14; The universal serial bus control device is communicatively connected with the server host.
16. A universal serial bus control method, characterized in that: The method comprises: Switching the device address in the device address register according to the address switching time slice corresponding to the universal serial bus device hub driver unit and the address switching time slice corresponding to each universal serial bus device driver unit; According to the switched device address and control port, control the universal serial bus device hub driver unit and each of the universal serial bus device driver units to interact with the server host; The device address register is a register shared by the universal serial bus device hub driver unit and a plurality of the universal serial bus device driver units in the universal serial bus device controller, and the control port is a port shared by the universal serial bus device hub driver unit and a plurality of the universal serial bus device driver units in the universal serial bus device controller; The universal serial bus device controller also includes a timer; The universal serial bus device controller is specifically used for: For the current interaction, judging, according to the current running state of the timer, whether the address switching time slice corresponding to the universal serial bus device hub driver unit and the address switching time slice corresponding to each of the universal serial bus device driver units are triggered; Determine, among the universal serial bus device hub driver unit and the plurality of universal serial bus device driver units, a current driver unit to be controlled whose address switching time slice is triggered; Switching the device address in the device address register to the device address of the current drive unit to be controlled to obtain a target device address; According to the target device address and the control port, controlling the current drive unit to be controlled to interact with the server host; Continue to iteratively control the next drive unit to be controlled to interact with the server host according to the next operating state of the timer.
17. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the program, the universal serial bus control method as claimed in claim 16 is implemented.
18. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the universal serial bus control method as claimed in claim 16 is implemented.
19. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the universal serial bus control method as claimed in claim 16 is implemented.
