WO2026001088A1 - 通用串行总线控制装置、系统、方法、设备、非暂态计算机可读存储介质及产品 - Google Patents

通用串行总线控制装置、系统、方法、设备、非暂态计算机可读存储介质及产品

Info

Publication number
WO2026001088A1
WO2026001088A1 PCT/CN2025/082441 CN2025082441W WO2026001088A1 WO 2026001088 A1 WO2026001088 A1 WO 2026001088A1 CN 2025082441 W CN2025082441 W CN 2025082441W WO 2026001088 A1 WO2026001088 A1 WO 2026001088A1
Authority
WO
WIPO (PCT)
Prior art keywords
driver unit
serial bus
universal serial
usb
address
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
PCT/CN2025/082441
Other languages
English (en)
French (fr)
Inventor
陈超凡
刘宝阳
李金锋
王兴隆
张昭
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Suzhou Metabrain Intelligent Technology Co Ltd
Original Assignee
Suzhou Metabrain Intelligent Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Suzhou Metabrain Intelligent Technology Co Ltd filed Critical Suzhou Metabrain Intelligent Technology Co Ltd
Publication of WO2026001088A1 publication Critical patent/WO2026001088A1/zh
Pending legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F13/00Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F13/38Information transfer, e.g. on bus
    • G06F13/40Bus structure
    • G06F13/4063Device-to-bus coupling
    • G06F13/4068Electrical coupling
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F13/00Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F13/38Information transfer, e.g. on bus
    • G06F13/42Bus transfer protocol, e.g. handshake; Synchronisation
    • G06F13/4282Bus transfer protocol, e.g. handshake; Synchronisation on a serial bus, e.g. I2C bus, SPI bus
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2213/00Indexing scheme relating to interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F2213/0042Universal serial bus [USB]

Definitions

  • This application relates to the field of computer technology, and in particular to a universal serial bus control device, system, method, apparatus, non-transitory computer-readable storage medium and product.
  • the Baseboard Management Controller can virtualize a mouse, keyboard, network card, and virtual media devices through keyboard, video, mouse, and KVM functions, thereby enabling remote control of the server host. This function greatly enhances the remote management experience of the server and improves operation and maintenance efficiency.
  • the monitoring function is closely related to the Universal Serial Bus Device Controller (UDC) module of the BMC.
  • UDC Universal Serial Bus Device Controller
  • it is usually necessary to configure independent UDC modules within the BMC for different types of USB devices to control the USB (Universal Serial Bus) devices, so as to ensure that the communication between each USB device and the server host does not interfere with each other.
  • This application provides a universal serial bus control device, system, method, apparatus, non-transitory computer-readable storage medium, and product to solve the shortcomings of related technologies that use a separate UDC module for each USB device to control USB devices, which leads to a significant increase in the hardware resource cost of BMC management, and to achieve low-cost and convenient unified control of multiple USB devices.
  • the first aspect of this application provides a Universal Serial Bus (USB) control device, which is communicatively connected to a server host.
  • the device includes a USB device controller, a USB device hub driver unit, and multiple USB device driver units.
  • USB device controllers include USB device hub driver units and device address registers and control ports shared among multiple USB device driver units;
  • the Universal Serial Bus (USB) device controller is configured to switch the device address in the device address register according to 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. Based on the switched device address and control port, the controller controls the USB hub driver unit and each USB device driver unit to interact with the server host.
  • USB Universal Serial Bus
  • the universal serial bus device controller further includes a timer
  • the Universal Serial Bus device controller is configured as follows:
  • the system continues to iteratively control the next controllable drive unit to interact with the server host based on the next running state of the timer.
  • the universal serial bus device controller is further configured as follows:
  • the cycle period of the timer 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 Universal Serial Bus device driver unit.
  • the universal serial bus device controller is further configured as follows:
  • the device address in the device address register is switched to the device address of the current driver unit to be controlled, and the device address register is locked.
  • the universal serial bus device controller is further configured as follows:
  • the current task processing request is transmitted to the current drive unit to be controlled;
  • the locking operation on the device address register is released.
  • the universal serial bus device controller is further configured as follows:
  • the current task processing request is transmitted to the current controllable drive unit based on the target device address.
  • the universal serial bus device controller is further configured as follows:
  • the current task processing request is stored in the cache queue.
  • the current requested device address is matched with the device address of the next driver unit to be controlled obtained from the switch in the device address register.
  • the current task processing request is retrieved from the cache queue and transmitted to the next driver unit to be controlled.
  • the universal serial bus device hub driver unit is configured as follows:
  • the server host Receives the first enumeration request sent by the server host; the first enumeration request is used to enumerate the Universal Serial Bus device hub driver unit;
  • the receiving server host assigns a device address to the Universal Serial Bus device hub driver unit based on the second response information
  • the device status of each Universal Serial Bus device driver unit is reported to the server host based on the device address of the Universal Serial Bus device hub driver unit.
  • the receiving server host enumerates and assigns device addresses to each Universal Serial Bus (USB) device driver unit based on the device status of each USB device driver unit, and transmits the device addresses of each USB device driver unit to each USB device driver unit.
  • USB Universal Serial Bus
  • the universal serial bus device hub driver unit is further configured as follows:
  • the target device status of the current Universal Serial Bus device driver unit is sent to the server host based on the device address of the Universal Serial Bus device hub driver unit.
  • the current Universal Serial Bus device driver unit sends the third response information returned by the second enumeration request to the server host;
  • the server host transmits the device address assigned to the current Universal Serial Bus device driver unit based on the third response information to the current Universal Serial Bus device driver unit.
  • 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 (USB) device hub driver is assigned by the server host based on the device type and port number of the USB device hub driver.
  • the second response information also includes the query time interval of each universal serial bus device driver unit
  • the status acquisition commands of the Universal Serial Bus device driver unit are sent periodically according to the query time interval.
  • the driver unit for each of the Universal Serial Bus device hub driver unit and multiple Universal Serial Bus device driver units, the driver unit is configured with at least one port number.
  • the drive unit is configured as follows:
  • the target port number is obtained from at least one port number based on the task type and data transmission mode corresponding to the task processing request.
  • the task processing request is processed, and the task processing result is returned to the server host.
  • the port number of the drive unit is configured according to the device type of the drive unit.
  • the port number of the input terminal of any driving unit is the same as the port number of the output port of any other driving unit besides any driving unit.
  • the multiple 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 driver unit is configured to drive the virtual human-machine interface device
  • the network controller driver unit is configured to drive virtual network devices
  • the memory driver unit is configured to drive the virtual memory.
  • a second aspect of this application also provides a universal serial bus control system, including any of the universal serial bus control devices and server hosts described above.
  • a third aspect of this application also provides a universal serial bus control method, the method comprising:
  • 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;
  • the device address register is a register shared by the Universal Serial Bus (USB) device hub driver unit and multiple USB device driver units in the USB device controller
  • the control port is a port shared by the USB device hub driver unit and multiple USB device driver units in the USB device controller.
  • 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:
  • a fourth aspect of this application also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement any of the general serial bus control methods described above.
  • a fifth aspect of this application also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements any of the general serial bus control methods described above.
  • a sixth aspect of this application also provides a computer program product, including a computer program that, when executed by a processor, implements any of the general serial bus control methods described above.
  • the Universal Serial Bus (UBC) control device by configuring a UBC device controller, a UBC device hub driver unit, and multiple UBC device driver units that implement different types of virtual USB device functions within the BMC, and by having the UBC device controller switch the device address register configured inside the controller in real time according to the address switching time slices corresponding to the UBC device hub driver units and the address switching time slices corresponding to each UBC device driver unit, the UBC device controller controls different UBC device driver units to interact with the server host in different time slices based on the switched device address and the control port multiplexed by multiple driver units configured inside the UBC device controller, can effectively avoid allocating independent hardware resources for each USB device. Even with only one UDC module, unified control of multiple USB devices can be achieved, reducing the hardware resource cost required for one-to-one configuration of UDC modules and improving the flexibility of resource utilization. Thus, low-cost and convenient unified control of multiple USB devices is achieved.
  • FIG. 1 is a schematic diagram of the USB software architecture provided by related technologies.
  • FIG. 1 is one of the structural schematic diagrams of the universal serial bus control device provided in this application.
  • FIG. 3 is a schematic diagram of the USB software architecture provided in this application.
  • Figure 4 is a second schematic diagram of the structure of the universal serial bus control device provided in this application.
  • FIG. 5 is one of the flowcharts illustrating the address switching process provided in this application.
  • FIG. 6 is the second schematic diagram of the address switching process provided in this application.
  • Figure 7 is a flowchart illustrating the device enumeration process provided in this application.
  • Figure 8 is a flowchart illustrating the universal serial bus control method provided in this application.
  • Figure 9 is a schematic diagram of the structure of the electronic device provided in this application.
  • 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.
  • BMC Baseband Management Unit
  • BMC can use KVM functionality to virtualize a mouse, keyboard, network card, and virtual media devices, thereby enabling remote control of the server host. This feature greatly enhances the remote management experience of the server and improves operational efficiency.
  • FIG. 1 is a schematic diagram of the USB software architecture provided by related technologies. As shown in Figure 1, in traditional designs, it is usually necessary to configure independent UDC modules for different types of USB devices within the BMC to control the USB devices, and to 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.
  • the USB software architecture consists of a three-layer structure: a Multi-USB (MUSB) driver unit, a gadget driver unit (the driver unit for a single USB device), i.e., the driver unit for that USB device, and an upper-layer application.
  • MUSB Multi-USB
  • gadget driver unit the driver unit for a single USB device
  • USB device expansion solutions from the perspective of server software architecture design. Furthermore, such solutions should be able to improve the flexibility of device expansion while minimizing the investment of human, material, and time costs caused by hardware design changes.
  • this embodiment proposes a Universal Serial Bus (USB) control device.
  • This device configures a USB device controller, a USB device hub driver unit, and multiple USB device drivers configured to implement different types of virtual USB devices within the BMC management unit, constructing a multi-USB control architecture.
  • the device interconnects with the server host via a UDC module.
  • Various USB device drivers communicate with the host by sharing the UDC device address register and control endpoint. This allows for unified control of multiple USB devices using a single UDC module, based on the shared device address register and control port between the USB device hub driver unit and multiple USB device drivers. It eliminates the need for multiple independent UDC modules, enabling unified control of multiple USB devices even with only one UDC module.
  • USB Universal Serial Bus
  • the Universal Serial Bus (USB) control device can be applied to scenarios such as data centers and computer clusters.
  • the following description of the USB control device provided in this embodiment is based on the example of the device being applied to a data center. For other scenarios, the device can be adapted accordingly.
  • FIG 2 is one of the structural schematic diagrams of the Universal Serial Bus (USB) control device provided in this application.
  • the device can be a baseboard management controller 210 configured in a data center and communicatively connected to a server host.
  • the device includes a USB device controller 211, a USB device hub driver unit 212, and multiple USB device driver units 213, which work together to ensure efficient and stable communication between multiple USB devices and the server host 220 (also known as the Host).
  • the Host acts as the USB host, the user of USB devices, and the initiator of USB communication.
  • the Host is typically responsible for USB device enumeration, configuration, power management, data transfer control, error detection and recovery, and device addition and removal management. As shown in Figure 2, the Host can perform these functions by interacting with the UDC in the BMC.
  • the BMC is mainly responsible for the implementation of functional devices such as the Universal Serial Bus Device Hub Driver Unit 212 (also known as the USB Hub Driver Unit) and multiple Universal Serial Bus Device Driver Units 213 (also known as USB Device Driver Units), and involves the loading and unloading of each driver unit.
  • functional devices such as the Universal Serial Bus Device Hub Driver Unit 212 (also known as the USB Hub Driver Unit) and multiple Universal Serial Bus Device Driver Units 213 (also known as USB Device Driver Units), and involves the loading and unloading of each driver unit.
  • each USB device driver unit needs to be bound to the UDC (User Data Center) module within the BMC.
  • UDC User Data Center
  • each USB device driver unit needs to be bound to an independent UDC module for processing.
  • the UDC module in this embodiment includes a device address register and a control port. The device address register is shared by the USB Hub driver unit and multiple USB device drivers, and the control port is multiplexed by the USB Hub driver unit and multiple USB device drivers.
  • the UDC module can communicate with the Host and connect with the USB Hub driver unit and multiple USB device drivers. It controls the USB Hub driver unit and each USB device driver unit through the device address register and control port, enabling effective and stable interaction between each USB Hub driver unit, each USB device driver unit, and the Host.
  • FIG 3 is a schematic diagram of the USB software architecture provided in this application.
  • this embodiment modifies and adds a USB Hub driver unit and multiple USB device driver units to the traditional USB software architecture within the BMC.
  • a driver layer of a USB Hub driver unit is added on the basis of the MUSB driver unit.
  • multiple USB device driver units configured for multiple different types of USB devices are extended.
  • the USB Hub driver unit is located at the layer between the layer where the MUSB driver unit is located and the layer where multiple USB device driver units are located, and the multiple USB device driver units are located at the layer between the layer where the USB Hub driver unit is located and the layer where the application layer is located.
  • a single UDC module can effectively control multiple USB devices, effectively solving the technical difficulties encountered in traditional hardware implementation methods. This makes the implementation of multiple USB devices no longer dependent 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.
  • the MUSB driver unit is responsible for handling various requests and transactions defined in the USB specification, including device enumeration, data transfer, and power management.
  • the USB Hub driver unit primarily manages the interaction between each USB device driver unit and the host, such as device enumeration and data transfer.
  • Each USB device driver unit is typically implemented based on the MUSB driver unit.
  • Above each USB device driver unit are applications configured to drive the corresponding emulated USB devices, enabling them to perform the functions of those devices. This allows Linux devices to act as USB devices, such as mice and keyboards, when connected to the host, responding to the host's requests for data transfer and communication. This allows administrators to remotely control the server host 220 through emulated USB devices.
  • the multiple USB device driver units mentioned here may include multiple USB device driver units of different device types, which can be configured according to the functions required for host monitoring. For example, they may include multiple of the following: human-machine interface driver units, network controller driver units, and memory driver units. They may also include other types of USB device driver units, but this embodiment does not limit this.
  • FIG 4 is a second structural schematic diagram of the Universal Serial Bus Control Device provided in this application; as shown in Figures 3 and 4, in some embodiments, the multiple Universal Serial Bus Device Driver Units 213 include a Human-Machine Interface Driver Unit, a Network Controller Driver Unit, and a Memory Driver Unit.
  • the human-machine interface driver unit is configured to drive the virtual human-machine interface device
  • the network controller driver unit is configured to drive virtual network devices
  • the memory driver unit is configured to drive the virtual memory.
  • the Human Interface Device (HID) driver unit is configured to support HID devices such as mice, keyboards, and gamepads.
  • the HID driver unit is responsible for handling USB requests related to HID devices, such as button events and mouse movements, and passing these events to the upper-layer application.
  • the storage driver unit (also known as the Mass Storage driver unit) is configured to support large storage devices such as USB flash drives and hard drives.
  • This driver unit is responsible for handling USB requests related to storage devices, such as read, write, and format, and provides a standard file system interface to upper-layer applications, allowing applications to access storage devices as if they were operating a local file system.
  • the Ethernet Control Model (ECM) driver unit is configured to support USB network devices. This driver unit is responsible for handling network-related USB requests, such as IP address configuration, packet sending and receiving, and provides a standard network interface to upper-layer applications, enabling applications to connect to the network via the USB interface.
  • ECM Ethernet Control Model
  • the device by configuring a single UDC module to uniformly control the HID driver unit, Mass Storage driver unit, and ECM driver unit, can realize the virtual USB hub function under a single UDC module. It supports virtual human-machine interface devices, such as mice and keyboards, virtual storage devices, such as USB flash drives, and virtual network devices, such as network cards, and other types of USB device functions. It enables parallel access of multiple USB functional devices under a single UDC module on the host side, thereby enabling low-cost and convenient unified control of multiple USB devices and reducing the hardware resource costs and maintenance costs required for host monitoring.
  • virtual human-machine interface devices such as mice and keyboards
  • virtual storage devices such as USB flash drives
  • virtual network devices such as network cards
  • USB Universal Serial Bus
  • HID driver unit HID driver unit
  • Mass Storage driver unit Mass Storage driver unit
  • ECM driver unit ECM driver unit
  • the Universal Serial Bus (USB) device controller 211 includes a device address register and control port shared between the USB device hub driver unit 212 and multiple USB device driver units 213.
  • the Universal Serial Bus (USB) device controller 211 includes a device address register and a control port.
  • the device address register is shared by the USB Hub driver and multiple USB device drivers. This register stores the device address of the driver currently interacting with the Host.
  • the device address can be cyclically switched based on the device address of the driver that needs to interact with the Host, ensuring that each driver can obtain the corresponding communication time and bandwidth when multiple drivers share a host resource, thereby achieving effective communication management between the USB Hub driver and multiple USB device drivers and the Host.
  • the control port is multiplexed by the USB Hub driver and multiple USB device drivers, allowing the USB device controller 211 to achieve unified control of the USB Hub driver and multiple USB device drivers through this control port.
  • the Universal Serial Bus (USB) device controller 211 which is communicatively connected to the server host 220, is configured to switch the device address in the device address register according to the address switching time slice corresponding to the USB device hub driver unit 212 and the address switching time slice corresponding to each USB device driver unit 213. Based on the switched device address and control port, it controls the USB device hub driver unit 212 and each USB device driver unit 213 to interact with the server host 220.
  • USB Universal Serial Bus
  • the BMC management unit since the BMC management unit has only one UDC module, and the hardware only supports one device address register (FADDR), when the host accesses the USB Hub driver unit and its downstream port devices (i.e., each USB device driver unit), it needs to ensure that the device address in the FADDR matches the address of the device requested by the host. Therefore, to ensure normal communication between the host and each driver unit, the problem of insufficient address registers when the same FADDR enables communication between different driver units must be solved.
  • FADDR device address register
  • this embodiment divides the BMC's USB Hub operating time into address switching time slices corresponding to the USB Hub driver unit and address switching time slices corresponding to each USB device driver unit, using time-division multiplexing of address switching based on each time slice to achieve normal communication between each driver unit and the host.
  • 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 have been triggered. Based on the triggering determination result, the target driver unit that needs to interact with the Host is determined among the USB Hub driver unit and multiple USB device driver units. The device address in FADDR is switched 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.
  • the interaction request sent by the Host is transmitted to the target driver unit through the communication connection, and the response information returned by the target driver unit according to the interaction request is transmitted to the Host, thereby realizing the interaction between the target driver unit and the Host.
  • the UDC module continues to 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 have been triggered, based on the above interaction steps. According to the trigger determination result, the target driver unit that needs to interact with the Host next is determined among the USB Hub driver unit and multiple USB device driver units. Based on the target driver unit that needs to interact with the Host next time, the next interaction steps are executed iteratively until the BMC is closed or the BMC configuration is updated.
  • 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 can be divided periodically at certain time intervals, or periodically divided 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 limit the division method.
  • the address switching time slices corresponding to each driving unit here can be triggered periodically or adaptively based on the requests sent by the Host in each interaction process. This embodiment does not limit this.
  • the device provided in this embodiment configures a Universal Serial Bus (UBC) device controller, a UBC device hub driver unit, and multiple UBC device driver units that implement different types of virtual USB device functions within the BMC.
  • the UBC device controller switches the device address registers configured inside the controller in real time according to the address switching time slices corresponding to the UBC device hub driver units and the address switching time slices corresponding to each UBC device driver unit.
  • different UBC device driver units are controlled to interact with the server host in different time slices. This effectively avoids allocating independent hardware resources for each USB device.
  • Even with only one UBC module unified control of multiple USB devices can be achieved, reducing the hardware resource cost required for one-to-one configuration of UBC modules and improving the flexibility of resource utilization. Thus, it achieves low-cost and convenient unified control of multiple USB devices.
  • the Universal Serial Bus device controller 211 further includes a timer
  • Universal Serial Bus device controller 211 is configured as follows:
  • the current driver unit to be controlled is determined when the address switching time slice is triggered.
  • control the current driver unit Based on the target device address and control port, control the current driver unit to be controlled to interact with the server host 220;
  • the UDC module can perform the following steps to achieve interactive control of each drive unit:
  • the UDC module initializes, including configuring the device address register, control ports, and timers.
  • the MUSB driver unit it initializes the USB hardware and registers each driver unit. Timers can be set to trigger interrupts at predetermined time intervals to sequentially control different USB device driver units.
  • 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 period of time each driver unit can occupy the device address register and control port.
  • the UDC module determines whether the timer has reached the address switching time slice that would trigger any driver unit, based on the timer's current running state.
  • the UDC module marks that drive unit as the drive unit that needs to be controlled now, that is, the drive unit to be controlled now.
  • the UDC module switches the device address in the device address register to the device address of the currently controlled driver unit, so that during the current interaction, it is only used for interaction between the currently controlled driver unit and the Host.
  • the UDC module uses the switched target device address and control port to begin controlling the current driver unit to interact with the Host. This interaction includes operations such as data transmission and command execution.
  • the UDC module After learning that the Host has completed its interaction with the currently controlled driver unit, the UDC module will iteratively control the next driver unit to interact with the Host according to the next running state of the timer, until all driver units have completed their interaction within their respective address switching time slices.
  • the UDC module will periodically update the address switching time slice settings to ensure accurate control of all connected USB device driver units.
  • the device provided in this embodiment uses a timer to trigger an interrupt for 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 functional requirements of different USB devices in the data center and reducing the cost of hardware resources.
  • the Universal Serial Bus device controller 211 is further configured to:
  • 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 Universal Serial Bus device driver unit 213.
  • FIG. 5 is one of the flowcharts illustrating the address switching process provided in this application; as shown in Figure 5, the UDC module can also perform the following steps to achieve device address switching:
  • Step 510 Based on the current running status of the timer, determine whether the timer is in a timeout state. If it has timed out, proceed to step 520.
  • Step 520 Determine whether modifying the device address is allowed. If allowed, proceed to step 530; otherwise, proceed to step 510.
  • Step 530 Match the cycle period of the timer 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 Universal Serial Bus device driver unit 213, so as to use the matched address switching time slice as the triggered address switching time slice. Based on the triggered address switching time slice, obtain the device address of the current driver unit to be controlled from the device address list.
  • Step 540 Switch the device address in the device address register according to the obtained device address of the current driver unit to be controlled, and control the current driver unit to be controlled to interact with the server host 220, and then jump to step 510.
  • the device provided in this embodiment triggers the corresponding address switching time slice according to the timeout state of the timer, thereby ensuring that multiple drive units can interact with the server host in a time-division manner according to a predetermined time sequence. This enables a single UDC module to support multiple USB devices communicating with the server host simultaneously, greatly reducing the hardware resource cost of USB device control and improving the management efficiency of multiple USB devices.
  • the Universal Serial Bus device controller 211 is further configured to:
  • the device address in the device address register is switched to the device address of the current driver unit to be controlled, and the device address register is locked.
  • the UDC module can also perform the following steps to switch device addresses:
  • the current access status of FADDR is checked, such as whether FADDR is being accessed by other driver units or whether there are any incomplete read/write operations, in order to determine whether FADDR is in an unoccupied state.
  • FADDR is in an unoccupied state, it is determined that the current driver unit to be controlled has the permission to access the device address register; if it is known that FADDR is in an occupied state, it is determined that the current driver unit to be controlled does not have the permission to access the device address register.
  • the device address in the device address register is switched to the device address of the currently controlled driver unit. Furthermore, to ensure that the device address register is not accessed or modified by other unauthorized driver units after the switch, a locking operation is required on the device address register. This locking can be achieved by setting specific register flags, using mutexes, or other synchronization mechanisms.
  • the device provided in this embodiment can ensure that only driver units with the corresponding permissions can access the device address register, which helps prevent unauthorized access and potential security risks. Furthermore, by performing a locking operation after switching the device address register, it can ensure that only one driver unit can access and modify the register at the same time, thereby helping to reduce resource conflicts and potential data inconsistency problems. In this way, it can ensure that each driver unit can effectively use the device address register to interact with the host, improving the effectiveness of multi-USB device control.
  • the Universal Serial Bus device controller 211 is further configured to:
  • the current task processing request is transmitted to the current drive unit to be controlled;
  • the locking operation on the device address register is released.
  • the UDC module can also perform the following steps to switch device addresses:
  • the UDC module After the locking operation is completed in the device address register, 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 transmitting task processing requests. Once the locking operation is confirmed to be complete, the UDC module will start listening for and receiving current task processing requests initiated by the server host 220; these requests include data transmission, device control, etc.
  • the UDC module 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.
  • the UDC module After the current drive unit to be controlled finishes processing the task and generates response information, the UDC module receives the first response information and transmits it back to the server host 220. After learning that the server host 220 has received the first response information, the UDC module will release the locking operation on the device address register, restoring it to an accessible state for use by other drive units, thereby improving resource utilization.
  • the Universal Serial Bus device controller 211 is further configured to:
  • the current task processing request is transmitted to the current controllable drive unit based on the target device address.
  • the UDC module may perform the following steps to implement the request transmission:
  • the UDC module When the UDC module receives a current task processing request from server host 220, it first parses the request to extract the device address to which the request points, i.e., the current request device address. It then matches the current request device address with the target device address to ensure that the task processing request is sent to the correct target device, preventing data transmission errors or device control malfunctions due to incorrect device addresses.
  • the current task processing request is deemed valid. At this point, the current task processing request can be accurately transmitted to the corresponding current controllable driver unit based on the matched target device address, so that the current controllable driver unit can respond to the current task processing request and achieve effective interaction between the current controllable driver unit and the Host.
  • the device provided in this embodiment can ensure that the request is sent to the correct driver unit by matching the device address before task processing, thus avoiding task processing failure or data transmission errors caused by incorrect device addresses. This improves the accuracy of task processing of the entire system, prevents illegal or incorrect requests from being sent to the driver unit, thereby enhancing the security of the driver unit and reducing potential security risks and vulnerabilities.
  • the UDC module may also perform the following steps to implement the request transmission:
  • the UDC module When the UDC module finds that the current requesting device address does not match the target device address during the matching process, it can store the current task processing request in a cache queue.
  • the purpose of the cache queue is to temporarily store requests waiting to be processed, so that they can be matched and transmitted again at an appropriate time.
  • 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 driver unit to be controlled, it again matches the current request device address of the current task processing request stored in the cache queue with the device address of the next driver unit to be controlled obtained from the switch in the device address register.
  • the current task processing request is retrieved from the cache queue and transmitted to the corresponding next driver unit to be controlled, so that the next driver unit to be controlled can process the current task processing request.
  • the apparatus provided in this embodiment ensures that each request can be processed in a timely manner by storing mismatched requests in a cache queue and re-matching and transmitting them after the device address is switched. Requests are not dropped or delayed due to address mismatch, which greatly improves the efficiency and performance of task processing.
  • Figure 6 is a second schematic diagram of the address switching process provided in this application; as shown in Figure 6, the address switching process can be implemented by the UDC module by executing the following steps:
  • Step 610 If the address switching time slice corresponding to the USB Hub driver unit is determined based on the running status of the timer, then the FADDR operation is locked during the time slice to prevent other processes from accessing FADDR and causing access conflicts, and FADDR is set to the device address of the USB Hub driver unit.
  • Step 620 Wait for the Host to send a task processing request to the USB Hub driver unit, that is, a Hub-type request, such as a 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 for the timer to enter the next address switching state.
  • a Hub-type request such as a request to obtain the port status
  • Step 630 If the address switching time slice corresponding to the Mass Storage driver unit is determined based on the timer running status, the FADDR register operation is locked during the time slice to prevent other processes from accessing FADDR and causing access conflicts. FADDR is set to the device address of the Mass Storage driver unit.
  • Step 640 Wait for the Host to send a request to the Mass Storage driver unit.
  • the Mass Storage driver unit receives the request and responds to the Host's request, it releases the lock operation on FADDR and waits for the timer to enter the next address switching state.
  • Step 650 If the address switching time slice corresponding to the HID driver unit is determined based on the timer running status, the FADDR register operation is locked during the time slice to prevent other processes from accessing FADDR and causing access conflicts, and FADDR is set to the device address of the HID driver unit.
  • Step 660 Wait for the Host to send a request to the HID driver unit.
  • the HID driver unit receives the request and responds to the Host's request, it releases the lock operation on FADDR and waits for the timer to enter the next address switching state.
  • Step 670 If the address switching time slice corresponding to the ECM driver unit is determined based on the timer running status, the FADDR register operation is locked during the time slice to prevent other processes from accessing FADDR and causing access conflicts. FADDR is set to the device address of the ECM driver unit.
  • Step 680 Wait for the Host to send a request to the ECM driver unit.
  • the ECM driver unit receives the request and responds to the Host's request, it releases the lock operation on FADDR and waits for the timer to enter the next address switching state.
  • Step 690 Based on the timer's running status, proceed to step 610.
  • timer operation in the above steps is mainly used to set the address switching time of different devices, and the operation is consistent with the process in Figure 5.
  • the timer-based multi-USB device address switching scheme proposed in this embodiment can better realize the interaction between multiple USB devices and the host, providing the system with greater flexibility and scalability. It can be easily expanded to support more USB devices, meeting the different needs of the BMC when multiple USB devices are connected, and enhancing the system's adaptability and versatility. 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, due to the greater flexibility of the software implementation, it can quickly adapt to market changes and customer needs, reducing the additional costs caused by technological iterations and improving overall economic efficiency.
  • the Universal Serial Bus device hub driver unit 212 is configured as follows:
  • the server host 220 Receives the 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;
  • the receiving server host 220 assigns a device address to the Universal Serial Bus device hub driver unit 212 based on the second response information;
  • each Universal Serial Bus device driver unit 213 is reported to the server host 220 according to the device address of the Universal Serial Bus device hub driver unit 212.
  • the receiving server host 220 enumerates and assigns device addresses to each Universal Serial Bus device driver unit 213 according to the device status of each Universal Serial Bus device driver unit 213, and transmits the device addresses of each Universal Serial Bus device driver unit 213 to each Universal Serial Bus device driver unit 213.
  • USB Hub driver unit controls the USB Hub driver unit to report the status of each USB device driver unit individually, thereby achieving the enumeration of each USB device driver unit.
  • USB Hub driver unit can interact with the Host to perform the following steps to implement enumeration:
  • the USB hub driver unit After the USB hub driver unit is connected to the host, it first receives a first enumeration request sent by the host.
  • the first enumeration request is used to enumerate the USB hub driver unit to obtain its device information and configuration.
  • the USB Hub driver Upon receiving the first enumeration request, the USB Hub driver will return a second response to the Host based on the request's content.
  • This second response information includes, but is not limited to, the device type, port number, and the query time interval for each connected downstream port.
  • the host Based on the returned second response information, the host assigns a device address to the USB Hub driver unit.
  • the USB hub driver receives the device address and stores it in the device address register.
  • the Host may send a USB device driver status acquisition command to query the status of each USB device driver connected to the USB Hub driver.
  • the USB hub driver unit In response to a status acquisition command, the USB hub driver unit reports the device status of each connected USB device driver unit to the host based on its own device address.
  • the device status includes, but is not limited to, the device's connection status, device type, and operating status.
  • the host enumerates and assigns device addresses to each USB device driver unit.
  • the USB hub driver unit receives the device addresses enumerated by the host and transmits them to the corresponding USB device driver units, thereby realizing the enumeration of each driver unit so that each driver unit can interact with the host based on the enumerated device addresses.
  • the device provided in this embodiment through enumeration and address allocation, can ensure the correct connection and communication between the Host and each USB device driver unit, which helps to reduce problems such as system crashes or data loss caused by device connection errors or communication failures, thereby enhancing the stability and reliability of the system.
  • the second response information includes the device type and port number of the Universal Serial Bus device hub driver unit 212;
  • the device address of the Universal Serial Bus device hub driver unit 212 is assigned by the server host 220 according to the device type and port number of the Universal Serial Bus device hub driver unit 212.
  • the USB Hub driver when it receives an enumeration request from the local end, it can report its 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 and then reasonably and efficiently assign a unique device address to the USB Hub driver based on the device type and port number, thereby ensuring the stability and compatibility of the BMC.
  • the second response information may further include the query time interval of each Universal Serial Bus device driver unit 213;
  • the status acquisition command of the Universal Serial Bus device driver unit 213 is sent periodically according to the query time interval.
  • the USB Hub driver when it receives an enumeration request from the local end, it can also report the query time interval of each USB device driver to the Host. This allows the Host to periodically send status acquisition commands for each USB device driver to the USB Hub driver based on the query time interval of each USB device driver, ensuring that the USB Hub driver can successfully send each USB device driver to the Host, thereby improving the response efficiency to the Host.
  • the Universal Serial Bus device hub driver unit 212 is further configured to:
  • 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.
  • the current Universal Serial Bus device driver unit 213 sends the third response information returned by the second enumeration request to the server host 220;
  • the server host 220 transmits the device address assigned to the current Universal Serial Bus device driver unit 213 by the third response information to the current Universal Serial Bus device driver unit 213.
  • USB Hub driver can also interact with the Host to perform the following steps to implement 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, which is 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, so as to report the device status of the downstream port of the USB Hub driver unit to the Host.
  • the current status acquisition command such as the GetPortStatus command
  • the USB hub driver unit checks all its downstream ports and sends the current target device status of the USB device driver unit to the host.
  • USB Hub driver unit clears the FADDR address, sets it to 0, and waits for the Host to begin enumerating downstream port devices.
  • the host Based on the target device status, the host sends a second enumeration request to the current USB device driver downstream of the USB Hub driver unit to enumerate the current USB device driver units downstream of the USB Hub driver unit.
  • the current USB device driver unit responds to the Host's enumeration request by returning a third response information to the Host, and obtains and records the device address assigned by the Host based on the third response information.
  • USB Hub driver unit After the current USB device driver unit enumeration is completed, 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 the status acquisition request of the next USB device driver unit, so as to iteratively execute the next port device enumeration, until all USB device driver units have been enumerated.
  • the apparatus provided in this embodiment can identify and manage all downstream port devices connected to the USB Hub driver unit one by one by iteratively performing port device enumeration. 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.
  • FIG. 7 is a schematic diagram of the device enumeration process provided in this application; as shown in Figure 7, the device enumeration process can be implemented by the USB Hub driver unit and the Host performing the following interactive steps:
  • Step 710 After the USB Hub driver unit is connected to the Host, the Host sends an enumeration request for the USB Hub driver unit.
  • 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.
  • Step 720 After receiving the response information from the USB Hub driver unit, the Host assigns a device address to the USB Hub driver unit, and the USB Hub driver unit records the address and writes it into FADDR;
  • Step 730 The Host periodically sends a GetPortStatus command to request the device status of the downstream port of the USB Hub driver unit based on the query time interval reported by the USB Hub driver unit for each port.
  • Step 740 The USB Hub driver unit determines whether the device status report for all downstream ports has been completed. If the USB Hub driver unit has completed the device status report for all downstream ports, the process ends; otherwise, step 750 is executed.
  • Step 750 The USB Hub driver unit reports the device status of the current downstream port device (the current USB device driver unit), reporting the device status of one device at a time.
  • Step 760 The USB Hub driver clears the FADDR address and sets it to 0, waiting for the Host to enumerate the current downstream port devices of the USB Hub driver;
  • Step 770 The Host initiates an enumeration request to the current downstream port device of the USB Hub driver unit;
  • 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;
  • step 790 the USB Hub driver unit modifies FADDR to its own device address, waits for the Host to continue initiating GetPortStatus requests, and then jumps to step 730.
  • each USB device driver unit under the USB Hub obtains its own device address, which can then be used to achieve accurate and effective interaction between different USB device driver units and the Host.
  • the driver unit is configured with at least one port number.
  • the drive unit is configured as follows:
  • the target port number is obtained from at least one port number based on the task type and data transmission mode corresponding to the task processing request.
  • the task processing request is processed, and the task processing result is returned to the server host 220.
  • the UDC module supports one device address and one control port, which can be encoded as 0.
  • one or more port numbers can be configured for it.
  • each driving unit can be sequentially numbered according to the port position of each driving unit, or adaptively numbered according to the device type of different driving units. This embodiment does not limit this.
  • the port number of the driver unit is configured according to the device type of the driver unit.
  • the corresponding number and type of ports are also different. Therefore, in order to effectively realize the functions of driver units of different device types, the number and type of ports can be determined according to the device type of the driver unit, and different port numbers can be configured according to the corresponding number and type of ports.
  • the port type includes input ports and output ports, or includes ports that are further subdivided into more types based on input ports and output ports.
  • the USB Hub driver unit can be configured with one input (also called IN) endpoint, designated as endpoint 1, and set to interrupt transfer.
  • the HID driver unit is configured with one IN endpoint, designated as endpoint 2, and set to interrupt transfer.
  • the Mass Storage driver unit is configured with two endpoints: one is an IN endpoint, designated as endpoint 3, and set to bulk transfer; the other is an output (OUT) endpoint, designated as endpoint 1, and set to bulk transfer.
  • the ECM driver unit is configured with three endpoints: two are IN endpoints, designated as endpoints 4 and 5, and set to bulk transfer; one is an OUT endpoint, designated as endpoint 2, and set to bulk transfer.
  • port numbers of different types of different drive units can be the same or different.
  • the port number of the input terminal of any driving unit is the same as the port number of the output port of any other driving unit besides any driving unit.
  • the input ports of the HID driver unit may be numbered the same as the output ports of the ECM driver unit, or the output ports of the Mass Storage driver unit may be numbered the same as the input ports of the USB Hub driver unit.
  • each driver unit can perform different task processing initiated by the host based on different port numbers.
  • the following steps can be performed to implement task processing:
  • the task processing request can be parsed to obtain the task type and data transmission mode corresponding to the task processing request; the task type includes, but is not limited to, read and write, and the data transmission mode includes, but is not limited to, interrupted transmission and batch transmission.
  • the driver unit searches for the target port number corresponding to the task type and data transmission mode in its managed port numbers, calls the task operation mode corresponding to the target port number to process the task, and returns 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 batch transmission mode configured on endpoint 3 to read the data and send the data back to the server host 220 through endpoint 1.
  • the device provided in this embodiment uses a USB hub driver unit and multiple USB device driver units to work together to ensure that the host can communicate efficiently and reliably with various USB devices. It manages different USB devices by port number and selects the appropriate processing method according to task type and data transmission mode, thereby realizing the function of supporting multiple USB devices and achieving efficient and reliable management of multiple USB devices.
  • this embodiment also provides a universal serial bus control system, which may be a computer system, a cloud computing system, etc., and this embodiment does not limit it.
  • the universal serial bus control device in this system can communicate with the server host 220 to control the interaction between the USB device driver unit under it and the server host 220, thereby realizing remote monitoring of the server host 220.
  • the system provided in this embodiment configures a Universal Serial Bus (UBC) device controller, a UBC device hub driver unit, and multiple UBC device driver units that implement different types of virtual USB device functions within the BMC.
  • the UBC device controller switches the device address registers configured inside the controller in real time according to the address switching time slices corresponding to the UBC device hub driver units and the address switching time slices corresponding to each UBC device driver unit.
  • different UBC device driver units are controlled to interact with the server host in different time slices. This effectively avoids allocating independent hardware resources for each USB device.
  • Even with only one UBC module unified control of multiple USB devices can be achieved, reducing the hardware resource cost required for one-to-one configuration of UBC modules and improving the flexibility of resource utilization. Thus, it achieves low-cost and convenient unified control of multiple USB devices.
  • this embodiment also provides a Universal Serial Bus (USB) control method, which is implemented based on the USB control device provided in the above embodiments.
  • USB Universal Serial Bus
  • Figure 8 is a schematic flowchart of the USB control method provided in this application; as shown in Figure 8, the method includes steps 810 and 820.
  • 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.
  • Step 820 Based on the switched device address and control port, control the Universal Serial Bus (USB) device hub driver unit and each USB device driver unit to interact with the server host; wherein, the device address register is a register shared by the USB device hub driver unit and multiple USB device driver units in the USB device controller, and the control port is a port shared by the USB device hub driver unit and multiple USB device driver units in the USB device controller.
  • USB Universal Serial Bus
  • the UDC module can determine the target driver unit that needs to interact with the Host in this interaction by 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 Universal Serial Bus device driver unit have been triggered. The module then switches 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.
  • the interaction request sent by the Host is transmitted to the target driver unit through this communication connection, and the response information returned by the target driver unit according to the interaction request is transmitted to the Host, thereby realizing the interaction between the target driver unit and the Host.
  • the UDC module continues to determine the target driver unit for the next interaction with the Host from among the USB Hub driver unit and multiple USB device driver units, based on 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.
  • the interaction steps are executed iteratively until the BMC system is shut down or the BMC configuration is updated.
  • the method provided in this embodiment through a Universal Serial Bus (USB) device controller, performs real-time switching of the device address registers configured within the USB device controller based on the address switching time slices corresponding to the USB device hub driver units and the address switching time slices corresponding to each USB device driver unit.
  • USB Universal Serial Bus
  • This allows for control of different USB device driver units to interact with the server host within different time slices, based on the switched device address and the control ports multiplexed by multiple driver units configured within the USB device controller.
  • 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:
  • the UDC module initializes, including configuring the device address register, control port, and timers, as well as initializing the USB hardware and registering each driver unit within the MUSB driver unit.
  • the timers are configured to trigger interrupts at predetermined time intervals to sequentially control different USB device driver units.
  • 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 period of time each driver unit can occupy the device address register and control port.
  • the UDC module will determine whether the timer has reached the address switching time slice that triggers any driver unit.
  • the UDC module marks that drive unit as the drive unit that needs to be controlled now, that is, the drive unit to be controlled now.
  • the UDC module switches the device address in the device address register to the device address of the currently controlled driver unit, so that during the current interaction, it is only used for the interaction between the currently controlled driver unit and the Host.
  • the UDC module uses the switched target device address and control port to begin controlling the current driver unit to interact with the Host. This interaction includes operations such as data transmission and command execution.
  • the UDC module After learning that the Host has completed its interaction with the currently controlled driver unit, the UDC module will iteratively control the next driver unit to interact with the server host according to the next running state of the timer, until all driver units have completed their interaction within their respective address switching time slices.
  • the method provided in this embodiment uses a timer to trigger an interrupt for 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 functional requirements of data centers for different USB devices and reducing the cost of hardware resources.
  • the method provided in this application is executed based on the above-described device embodiments. Please refer to the above embodiments for the execution process and details, which will not be repeated here.
  • Figure 9 illustrates a schematic diagram of the physical structure of an electronic device.
  • the electronic device may include: a processor 910, a communication interface 920, a 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 logic instructions in the memory 930 to execute a Universal Serial Bus (USB) control method.
  • This method includes: switching the device address in the device address register according to the address switching time slice corresponding to the USB device hub driver unit and the address switching time slice corresponding to each USB device driver unit; and controlling the USB device hub driver unit and each USB device driver unit to interact with the server host according to the switched device address and control port.
  • the device address register is a register shared by the USB device hub driver unit and multiple USB device driver units within the USB device controller
  • the control port is a port shared by the USB device hub driver unit and multiple USB device driver units within the USB device controller.
  • the logical instructions in the aforementioned memory 930 can be implemented as software functional units and, when sold or used as independent products, can be stored in a computer-readable storage medium.
  • This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods in the various embodiments of this application.
  • the aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
  • this application also provides a computer program product, which includes a computer program that can be stored on a non-transitory computer-readable storage medium.
  • the computer can execute the Universal Serial Bus (USB) control method provided by the above methods.
  • the method includes: switching the device address in the device address register according to the address switching time slice corresponding to the USB device hub driver unit and the address switching time slice corresponding to each USB device driver unit; and controlling the USB device hub driver unit and each USB device driver unit to interact with the server host according to the switched device address and the control port.
  • the device address register is a register shared by the USB device hub driver unit and multiple USB device driver units in the USB device controller
  • the control port is a port shared by the USB device hub driver unit and multiple USB device driver units in the USB device controller.
  • this application also provides a non-transitory computer-readable storage medium storing a computer program thereon.
  • the computer program When executed by a processor, the computer program is implemented to perform the Universal Serial Bus (USB) control method provided by the above methods.
  • the method includes: switching the device address in the device address register according to the address switching time slice corresponding to the USB device hub driver unit and the address switching time slice corresponding to each USB device driver unit; controlling the USB device hub driver unit and each USB device driver unit to interact with the server host according to the switched device address and the control port; wherein the device address register is a register shared by the USB device hub driver unit and multiple USB device driver units in the USB device controller, and the control port is a port shared by the USB device hub driver unit and multiple USB device driver units in the USB device controller.
  • USB Universal Serial Bus
  • the device embodiments described above are merely illustrative.
  • the units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without any creative effort.
  • each embodiment can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, it can also be implemented by hardware.
  • This technical solutions in essence or the parts that contribute to the related technology, can be embodied in the form of software products.
  • This computer software product can be stored in a computer-readable storage medium, such as ROM/RAM, magnetic disk, optical disk, etc., including several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods of various embodiments or some parts of embodiments.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Hardware Design (AREA)
  • Information Transfer Systems (AREA)

Abstract

本申请提供一种通用串行总线控制装置、系统、方法、设备、非暂态计算机可读存储介质及产品,涉及计算机技术领域,该装置包括通用串行总线设备控制器、通用串行总线设备集线器驱动单元、多个通用串行总线设备驱动单元;通用串行总线设备控制器,包括设备地址寄存器和控制端口,与服务器主机通信连接,被设置为根据通用串行总线设备集线器驱动单元对应的地址切换时间片、各通用串行总线设备驱动单元对应的地址切换时间片对设备地址寄存器中的设备地址进行切换,并根据切换后的设备地址和控制端口,控制通用串行总线设备集线器驱动单元和各通用串行总线设备驱动单元与服务器主机进行交互,实现在单一UDC模块下低成本、便捷地对多USB设备进行统一控制。

Description

通用串行总线控制装置、系统、方法、设备、非暂态计算机可读存储介质及产品
相关申请的交叉引用
本申请要求于2024年6月28日提交中国专利局,申请号为202410853004.8,申请名称为“通用串行总线控制装置、系统、方法、设备、介质及产品”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及计算机技术领域,尤其涉及一种通用串行总线控制装置、系统、方法、设备、非暂态计算机可读存储介质及产品。
背景技术
基板管理控制器(Baseboard Management Controller,BMC)通过键盘视频鼠标(Keyboard,Video,Mouse,KVM)功能,可以虚拟出鼠标键盘、网卡和虚拟媒体设备等,从而实现对服务器主机的远程操控,这一功能极大地提升了服务器的远程管理体验,提高了运维效率。
而监控功能的实现与BMC的通用串行总线控制器(Universal Serial Bus Device Controller,UDC)模块紧密相关。在传统设计中,通常需要在BMC内部,针对不同类型的USB设备配置独立的UDC模块来进行USB(Universal Serial Bus,通用串行总线)设备的控制,以确保各USB设备与服务器主机之间的通信互不干扰。
但是,随着数据中心对USB设备功能需求的增加,若继续采用为每一USB设备配置独立的UDC模块的方式实现USB设备的控制,则每增加一种类型的USB设备功能,都需要增加额外的UDC硬件资源来支持,由此导致BMC管理的硬件资源成本显著升高。
发明内容
本申请提供一种通用串行总线控制装置、系统、方法、设备、非暂态计算机可读存储介质及产品,用以解决相关技术中为每一USB设备配置独立的UDC模块的方式实现USB设备的控制,导致BMC管理的硬件资源成本显著升高的缺陷,实现低成本、便捷地对多USB设备进行统一控制。
本申请的第一方面提供一种通用串行总线控制装置,装置与服务器主机通信连接,装置包括通用串行总线设备控制器、通用串行总线设备集线器驱动单元、多个通用串行总线设备驱动单元;
通用串行总线设备控制器包括通用串行总线设备集线器驱动单元和多个通用串行总线设备驱动单元之间共享的设备地址寄存器和控制端口;
通用串行总线设备控制器,被设置为根据通用串行总线设备集线器驱动单元对应的地址切换时间片、各通用串行总线设备驱动单元对应的地址切换时间片,对设备地址寄存器中的设备地址进行切换,并根据切换后的设备地址和控制端口,控制通用串行总线设备集线器驱动单元和各通用串行总线设备驱动单元,与服务器主机进行交互。
根据本申请提供的一种通用串行总线控制装置,通用串行总线设备控制器还包括定时器;
通用串行总线设备控制器,被设置为:
对于当前次交互,根据定时器的当前运行状态,判断通用串行总线设备集线器驱动单元对应的地址切换时间片、各通用串行总线设备驱动单元对应的地址切换时间片是否被触发;
在通用串行总线设备集线器驱动单元和多个通用串行总线设备驱动单元中,确定地址切换时间片被触发的当前待控制驱动单元;
将设备地址寄存器中的设备地址切换为当前待控制驱动单元的设备地址,得到目标设备地址;
根据目标设备地址和控制端口,控制当前待控制驱动单元与服务器主机进行交互;
继续根据定时器的下一运行状态,迭代控制下一待控制驱动单元与服务器主机进行交互。
根据本申请提供的一种通用串行总线控制装置,通用串行总线设备控制器,还被设置为:
根据定时器的当前运行状态,判断定时器是否处于超时状态;
在判断获知定时器处于超时状态的情况下,将定时器所属的循环周期,分别与通用串行总线设备集线器驱动单元对应的地址切换时间片,以及各通用串行总线设备驱动单元对应的地址切换时间片进行匹配;
根据匹配结果,判断通用串行总线设备集线器驱动单元对应的地址切换时间片、各通用串行总线设备驱动单元对应的地址切换时间片是否被触发。
根据本申请提供的一种通用串行总线控制装置,通用串行总线设备控制器,还被设置为:
根据设备地址寄存器的当前访问状态,确定当前待控制驱动单元的当前访问权限信息;
在根据当前待控制驱动单元的当前访问权限信息,判断获知当前待控制驱动单元具备访问设备地址寄存器的权限的情况下,将设备地址寄存器中的设备地址切换为当前待控制驱动单元的设备地址,并为设备地址寄存器进行加锁操作。
根据本申请提供的一种通用串行总线控制装置,通用串行总线设备控制器,还被设置为:
在判断获知设备地址寄存器加锁操作完成的情况下,接收服务器主机发起的当前任务处理请求;
根据目标设备地址,将当前任务处理请求传输至当前待控制驱动单元;
将当前待控制驱动单元根据当前任务处理请求返回的第一响应信息传输至服务器主机;
在判断获知服务器主机接收到第一响应信息的情况下,解除对设备地址寄存器的加锁操作。
根据本申请提供的一种通用串行总线控制装置,通用串行总线设备控制器,还被设置为:
根据当前任务处理请求,获取当前请求设备地址;
将当前请求设备地址与目标设备地址进行匹配;
在匹配获知当前请求设备地址与目标设备地址一致的情况下,根据目标设备地址,将当前任务处理请求传输至当前待控制驱动单元。
根据本申请提供的一种通用串行总线控制装置,通用串行总线设备控制器,还被设置为:
在匹配获知当前请求设备地址与目标设备地址不一致的情况下,将当前任务处理请求存储至缓存队列;
在判断获知设备地址寄存器中的设备地址切换为下一待控制驱动单元的设备地址的情况下,继续将当前请求设备地址与设备地址寄存器中切换得到的下一待控制驱动单元的设备地址进行匹配;
在匹配获知当前请求设备地址与下一待控制驱动单元的设备地址匹配的情况下,将当前任务处理请求从缓存队列中取出后传输至下一待控制驱动单元。
根据本申请提供的一种通用串行总线控制装置,通用串行总线设备集线器驱动单元,被设置为:
接收服务器主机发送的第一枚举请求;第一枚举请求用于对通用串行总线设备集线器驱动单元进行枚举;
根据第一枚举请求,向服务器主机返回第二响应信息;
接收服务器主机根据第二响应信息,为通用串行总线设备集线器驱动单元分配的设备地址;
将设备地址寄存器修改为通用串行总线设备集线器驱动单元的设备地址;
接收服务器主机发送的通用串行总线设备驱动单元的状态获取命令;
响应于状态获取命令,根据通用串行总线设备集线器驱动单元的设备地址,向服务器主机报告各通用串行总线设备驱动单元的设备状态;
接收服务器主机根据各通用串行总线设备驱动单元的设备状态,为各通用串行总线设备驱动单元枚举分配的设备地址,并将各通用串行总线设备驱动单元的设备地址传输至各通用串行总线设备驱动单元。
根据本申请提供的一种通用串行总线控制装置,通用串行总线设备集线器驱动单元,还被设置为:
对于当前次端口设备枚举,将设备地址寄存器修改为通用串行总线设备集线器驱动单元的设备地址;
接收服务器主机发送的当前通用串行总线设备驱动单元的当前状态获取命令;
响应于当前状态获取命令,根据通用串行总线设备集线器驱动单元的设备地址,将当前通用串行总线设备驱动单元的目标设备状态发送至服务器主机;
对设备地址寄存器进行清除,并根据目标设备状态,接收服务器主机根据目标设备状态发送的当前通用串行总线设备驱动单元的第二枚举请求;
将当前通用串行总线设备驱动单元根据第二枚举请求返回的第三响应信息发送至服务器主机;
将服务器主机根据第三响应信息为当前通用串行总线设备驱动单元分配的设备地址传输至当前通用串行总线设备驱动单元;
返回至将设备地址寄存器修改为通用串行总线设备集线器驱动单元的设备地址,迭代执行下一次端口设备枚举,直到所有通用串行总线设备驱动单元均枚举完成。
根据本申请提供的一种通用串行总线控制装置,第二响应信息包括通用串行总线设备集线器驱动单元的设备类型和端口编号;
通用串行总线设备集线器驱动单元的设备地址是由服务器主机根据通用串行总线设备集线器驱动单元的设备类型和端口编号进行分配的。
根据本申请提供的一种通用串行总线控制装置,第二响应信息还包括各通用串行总线设备驱动单元的查询时间间隔;
通用串行总线设备驱动单元的状态获取命令是根据查询时间间隔周期性发送的。
根据本申请提供的一种通用串行总线控制装置,对于通用串行总线设备集线器驱动单元和多个通用串行总线设备驱动单元中的每一驱动单元,驱动单元配置有至少一个端口编号;
驱动单元,被设置为:
在接收服务器主机发起的任务处理请求的情况下,根据任务处理请求对应的任务类型和数据传输模式,在至少一个端口编号中,获取目标端口编号;
根据目标端口编号对应的任务操作模式,对任务处理请求进行处理,并将任务处理结果返回至服务器主机。
根据本申请提供的一种通用串行总线控制装置,驱动单元的端口编号是根据驱动单元的设备类型进行配置的。
根据本申请提供的一种通用串行总线控制装置,任一驱动单元的输入端的端口编号,与除任一驱动单元之外的任一其他驱动单元的输出端口的端口编号相同。
根据本申请提供的一种通用串行总线控制装置,多个通用串行总线设备驱动单元包括人机接口驱动单元、网络控制器驱动单元和存储器驱动单元;
人机接口驱动单元被设置为驱动虚拟人机接口设备;
网络控制器驱动单元被设置为驱动虚拟网络设备;
存储器驱动单元被设置为驱动虚拟存储器。
本申请的第二方面还提供一种通用串行总线控制系统,包括如上述任一项通用串行总线控制装置和服务器主机;
通用串行总线控制装置与服务器主机之间通信连接。
本申请的第三方面还提供一种通用串行总线控制方法,方法包括:
根据通用串行总线设备集线器驱动单元对应的地址切换时间片、各通用串行总线设备驱动单元对应的地址切换时间片,对设备地址寄存器中的设备地址进行切换;
根据切换后的设备地址和控制端口,控制通用串行总线设备集线器驱动单元和各通用串行总线设备驱动单元,与服务器主机进行交互;
其中,设备地址寄存器为通用串行总线设备控制器中,通用串行总线设备集线器驱动单元和多个通用串行总线设备驱动单元之间共享的寄存器,控制端口为通用串行总线设备控制器中,通用串行总线设备集线器驱动单元和多个通用串行总线设备驱动单元之间共享的端口。
根据本申请提供的一种通用串行总线控制方法,根据通用串行总线设备集线器驱动单元对应的地址切换时间片、各通用串行总线设备驱动单元对应的地址切换时间片,对设备地址寄存器中的设备地址进行切换,包括:
对于当前次交互,根据定时器的当前运行状态,判断通用串行总线设备集线器驱动单元对应的地址切换时间片、各通用串行总线设备驱动单元对应的地址切换时间片是否被触发;
在通用串行总线设备集线器驱动单元和多个通用串行总线设备驱动单元中,确定地址切换时间片被触发的当前待控制驱动单元;
将设备地址寄存器中的设备地址切换为当前待控制驱动单元的设备地址。
本申请的第四方面还提供一种电子设备,包括存储器、处理器及存储在存储器上并可在处理器上运行的计算机程序,处理器执行程序时实现如上述任一种通用串行总线控制方法。
本申请的第五方面还提供一种非暂态计算机可读存储介质,其上存储有计算机程序,该计算机程序被处理器执行时实现如上述任一种通用串行总线控制方法。
本申请的第六方面还提供一种计算机程序产品,包括计算机程序,计算机程序被处理器执行时实现如上述任一种通用串行总线控制方法。
本申请提供的通用串行总线控制装置、系统、方法、设备、非暂态计算机可读存储介质及产品,通过在BMC内部配置通用串行总线设备控制器、通用串行总线设备集线器驱动单元、以及实现不同类型的虚拟USB设备功能的多个通用串行总线设备驱动单元,并由通用串行总线设备控制器,依据通用串行总线设备集线器驱动单元对应的地址切换时间片、各通用串行总线设备驱动单元对应的地址切换时间片,对通用串行总线设备控制器内部配置的设备地址寄存器进行实时切换,以依据切换后的设备地址和通用串行总线设备控制器内部配置的被多驱动单元复用的控制端口,控制不同通用串行总线设备驱动单元在不同的时间片内与服务器主机进行交互,可有效避免为每个USB设备分配独立的硬件资源,即使只有一个UDC模块的情况下,也能实现多USB设备的统一控制,减少了一对一配置UDC模块所需消耗的硬件资源成本以及提高了资源利用的灵活性,由此实现了低成本、便捷地对多USB设备进行统一控制。
附图说明
为了更清楚地说明本申请或相关技术中的技术方案,下面将对实施例或相关技术描述中所需要使用的附图作一简单地介绍,显而易见地,下面描述中的附图是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。
图1是相关技术提供的USB软件架构的结构示意图。
图2是本申请提供的通用串行总线控制装置的结构示意图之一。
图3本申请提供的USB软件架构的结构示意图。
图4是本申请提供的通用串行总线控制装置的结构示意图之二。
图5是本申请提供的地址切换的流程示意图之一。
图6是本申请提供的地址切换的流程示意图之二。
图7是本申请提供的设备枚举的流程示意图。
图8是本申请提供的通用串行总线控制方法的流程示意图。
图9是本申请提供的电子设备的结构示意图。
附图标记:
210:基板管理控制器;211:通用串行总线设备控制器;212:通用串行总线设备集线器驱动单元;
213:通用串行总线设备驱动单元;220:服务器主机。
具体实施方式
为使本申请的目的、技术方案和优点更加清楚,下面将结合本申请中的附图,对本申请中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。
随着云计算和大数据技术的突飞猛进,数据中心作为支撑这些技术的关键基础设施,其规模和复杂性日益增加。数据中心不仅是信息处理和存储的枢纽,也是推动现代信息化社会发展的强劲引擎。然而,随着数据中心业务量的激增,确保数据中心的高可靠性、稳定性和可用性变得尤为关键。在这样的背景下,数据中心各服务器节点的核心带外管理单元BMC,扮演着至关重要的角色。BMC负责服务器的温度监控、固件升级、故障诊断以及通过KVM实现远程监控等功能,对于保障服务器的稳定运行具有不可替代的作用,因此受到了服务器行业的广泛关注。
特别地,BMC通过KVM功能,可以虚拟出鼠标键盘、网卡和虚拟媒体设备等,从而实现对服务器主机的远程操控,这一功能极大地提升了服务器的远程管理体验,提高了运维效率。
而监控功能的实现,与BMC的UDC模块紧密相关。图1为相关技术提供的USB软件架构的结构示意图;如图1所示,在传统设计中,通常需要在BMC内部,针对不同类型的USB设备配置独立的UDC模块来进行USB设备控制,并针对不同类型的USB设备配置独立的USB软件架构,以确保各USB设备与服务器主机之间的通信互不干扰。例如,对于单一USB设备配置的USB软件架构,该USB软件架构分别由多USB(Multi-USB,MUSB)驱动单元、gadget驱动单元(单一USB设备的驱动单元),也即该USB设备的驱动单元,以及上层应用三层结构组成。
上述这种设计在功能上可行,但是随着数据中心对USB设备功能需求的增加,这种设计会导致BMC管理的硬件资源成本显著升高,体现在如下方面:一方面,随着数据中心对USB设备功能需求的增加,继续采用为每一USB设备配置独立的UDC模块的方式实现USB设备的控制,则每增加一种类型的USB设备功能,都需要增加额外的UDC硬件资源来支持,由此导致BMC管理的硬件资源成本显著升高;另一方面,当所需的USB设备数目超过现有UDC模块的数量时,BMC管理单元在实现更多USB设备扩展方面将面临较大的挑战。传统的解决方案是重新设计规格更高的BMC管理芯片,但这不仅需要投入大量的人力物力成本,而且还要承担芯片流片失败的风险,以及由此带来的时间成本,因此此种方式也是通过额外的硬件资源来支持BMC管理单元实现更多USB设备的管理,也会导致BMC管理的硬件资源成本显著升高。
综上,业界亟需从服务器软件架构设计层面出发,探索更为有效的USB设备扩展方案。且这种方案应当能够在提升设备扩展灵活性的同时,尽可能降低因硬件设计变更带来的人力物力和时间成本的投入。
对此,本实施例提出一种通用串行总线控制装置,该装置在BMC管理单元内部配置通用串行总线设备控制器、通用串行总线设备集线器驱动单元、以及被设置为实现不同类型的虚拟USB设备功能的多个通用串行总线设备驱动单元,构建多通用串行总线控制架构,并在此架构下,通过UDC模块与服务器主机进行互连,而各种USB设备驱动单元则通过共享UDC设备地址寄存器和控制端点来实现与Host之间的通信,由此实现采用单一UDC模块,依据通用串行总线设备集线器驱动单元和多个通用串行总线设备驱动单元之间共享的设备地址寄存器和控制端口,即可统一实现不同USB设备驱动单元与服务器主机之间的交互,不再依赖于多个独立的UDC模块,而是在即使只有一个UDC模块的情况下,也能实现多USB设备的统一控制,不仅可以降低BMC管理的硬件资源成本,还可以降低因硬件设计变更而频繁进行的芯片规格迭代升级,有效降低BMC整体的运维成本和时间成本,进而提高了数据中心的硬件成本、运维效率,且为数据中心的可持续发展提供了有力的技术支持。
为了更清晰地阐述本实施例提出的通用串行总线控制装置的内容,接下来分别从装置结构、软件架构、枚举流程与设备地址切换流程等方面对本实施例所提供的通用串行总线控制装置进行详细阐述。
需要说明的是,通用串行总线控制装置可以是应用于数据中心、计算机集群等场景,以下该装置应用于数据中心为例,对本实施例提供的通用串行总线控制装置展开描述,对于其他场景可参照该场景进行适应性地替换。
图2为本申请提供的通用串行总线控制装置的结构示意图之一;如图2所示,该装置可以是配置在数据中心的基板管理控制器210,且与服务器主机通信连接。该装置包括通用串行总线设备控制器211、通用串行总线设备集线器驱动单元212、多个通用串行总线设备驱动单元213,以通过这些单元之间的协同工作,确保多USB设备与服务器主机220(也称Host)之间的高效、稳定通信。
其中,对于Host,其担当USB主机的角色,是USB设备的使用者,也是USB通信的发起者。Host通常负责USB设备枚举、配置、电源管理、数据传输控制、错误检测与恢复、设备添加移除管理等操作。如图2所示,Host可通过与BMC中的UDC交互完成上述功能。
对于BMC,其主要负责通用串行总线设备集线器驱动单元212(也称USB Hub驱动单元)、多个通用串行总线设备驱动单元213(也称USB设备驱动单元)等的功能设备的实现,涉及各驱动单元的加载和卸载。
传统技术中,基于BMC的硬件设计规则,各USB设备驱动单元需要绑定到BMC中的UDC模块上。对于多UDC场景,每个USB设备驱动单元需要绑定到一个独立的UDC模块上进行处理。而基于本实施例针对一个UDC模块的场景,将所有的USB设备驱动单元使用同一个UDC模块,通过软件设计方法实现UDC模块的共享。因此,对于UDC模块,本实施例设计其包括一个设备地址寄存器和一个控制端口,该设备地址寄存器被USB Hub驱动单元和多个USB设备驱动单元所共享,该控制端口被USB Hub驱动单元和多个USB设备驱动单元所复用;UDC模块,可与Host通信连接,并与USB Hub驱动单元和多个USB设备驱动单元之间连接,其通过设备地址寄存器和控制端口对USB Hub驱动单元、各USB设备驱动单元进行控制,以使得各USB Hub驱动单元、各USB设备驱动单元与Host之前进行有效、稳定的交互。
图3为本申请提供的USB软件架构的结构示意图。如图3所示,对于USB Hub驱动单元和多个USB设备驱动单元,由于本实施例聚焦于BMC管理芯片中的UDC模块硬件成本较高的应用场景,因此针对每一UDC模块配置单一USB软件架构的传统设计方式不再适用,对此,为了应对数据中心对USB设备功能需求增加所带来的硬件成本增加的挑战,本实施例针对BMC内部,在传统USB软件架构上修改增加USB Hub驱动单元和多个USB设备驱动单元。在MUSB驱动单元的基础上增加了一个USB Hub驱动单元的驱动层,在单一USB设备驱动单元的基础上,扩展针对多个不同类型USB设备配置的多个USB设备驱动单元,也即USB Hub驱动单元位于MUSB驱动单元所在层级和多个USB设备驱动单元所在层级之间的层级上,多个USB设备驱动单元位于USB Hub驱动单元所在层级和应用层所在层级之间的层级上。
通过上述软件架构设计,可以有效实现单一UDC模块对多个USB设备的控制,有效解决传统硬件实现方式中遇到的技术难题,使得多USB设备的实现不再依赖于独立的UDC硬件资源,显著减少了对硬件UDC模块的设计投入,有效节省了硬件开发过程中的人力与时间成本,提高了开发效率。
其中,MUSB驱动单元作为Linux系统内核的一部分,负责处理USB规范中定义的各种请求和事务,包括设备枚举、数据传输、电源管理等。USB Hub驱动单元,主要负责管理各USB设备驱动单元与Host间的交互过程,如设备枚举和数据传输等。各USB设备驱动单元,通常是在MUSB驱动单元的基础上实现,在各USB设备驱动单元之上则存储有为使用USB设备的应用程序,被设置为驱动相应的模拟USB设备,以实现相应USB设备的功能,其允许Linux设备在连接到Host时扮演USB设备,如鼠标键盘等的角色以响应Host的请求,进行数据传输和通信,以便管理人员通过模拟USB设备实现对服务器主机220的远程操控。
此处的多个USB设备驱动单元可以是包括多个不同设备类型的USB设备驱动单元,可以根据Host监控所需的功能进行配置,如包括人机接口驱动单元、网络控制器驱动单元和存储器驱动单元中的多项,还可包括其他类型的USB设备驱动单元,本实施例对此不作限定。
图4为本申请提供的通用串行总线控制装置的结构示意图之二;如图3和图4所示,在一些实施例中,多个通用串行总线设备驱动单元213包括人机接口驱动单元、网络控制器驱动单元和存储器驱动单元;
人机接口驱动单元被设置为驱动虚拟人机接口设备;
网络控制器驱动单元被设置为驱动虚拟网络设备;
存储器驱动单元被设置为驱动虚拟存储器。
其中,人机接口(Human Interface Device,HID)驱动单元,被设置为支持人机接口设备,如鼠标、键盘、手柄等。HID驱动单元负责处理与人机接口设备相关的USB请求,如按键事件、鼠标移动等,并将这些事件传递给上层应用。
存储器驱动单元(也称Mass Storage驱动单元),被设置为支持大存储器,如U盘、硬盘等。该驱动单元负责处理与存储设备相关的USB请求,如读取、写入、格式化等,并提供一个标准的文件系统接口给上层应用,使得应用可以像操作本地文件系统一样来访问存储设备。
网络控制器(Ethernet Control Model,ECM)驱动单元,被设置为支持USB网络设备。该驱动单元负责处理与网络相关的USB请求,如IP地址配置、数据包发送接收等,并提供一个标准的网络接口给上层应用,使得应用可以通过USB接口连接到网络。
综上,本实施例提供的装置,通过配置单一UDC模块对HID驱动单元、Mass Storage驱动单元、ECM驱动单元进行统一控制,可以实现一个UDC模块下的虚拟USB hub功能,支持虚拟人机接口设备,如鼠标键盘、虚拟存储器,如U盘,以及虚拟网络设备,如网卡等多种类型USB设备功能,实现一个UDC模块下多个USB功能设备在Host侧的并行访问,由此低成本、便捷地对多USB设备进行统一控制,减少Host监控所需的硬件资源成本和维护成本。
为了简化描述,以下以多个通用串行总线设备驱动单元213包括HID驱动单元、Mass Storage驱动单元、ECM驱动单元为例,对本实施例提供的通用串行总线控制装置展开描述。
如图2所示,通用串行总线设备控制器211包括通用串行总线设备集线器驱动单元212和多个通用串行总线设备驱动单元213之间共享的设备地址寄存器和控制端口。
可选地,通用串行总线设备控制器211包括设备地址寄存器和控制端口。设备地址寄存器为可被USB Hub驱动单元和多个USB设备驱动单元所共享的设备地址寄存器,该设备地址寄存器被设置为存储当前与Host交互的驱动设备的设备地址,其中的设备地址可以根据所需与Host交互的驱动单元的设备地址进行循环切换,以确保了在多个驱动设备共享一个主机资源时,每个驱动设备都能获得相应的通信时间和带宽,进而实现USB Hub驱动单元和多个USB设备驱动单元与Host之间的有效通信管理。该控制端口被USB Hub驱动单元和多个USB设备驱动单元所复用,以使得通用串行总线设备控制器211通过该控制端口实现对USB Hub驱动单元和多个USB设备驱动单元的统一控制。
通用串行总线设备控制器211,与服务器主机220通信连接,被设置为根据通用串行总线设备集线器驱动单元212对应的地址切换时间片、各通用串行总线设备驱动单元213对应的地址切换时间片,对设备地址寄存器中的设备地址进行切换,并根据切换后的设备地址和控制端口,控制通用串行总线设备集线器驱动单元212和各通用串行总线设备驱动单元213,与服务器主机220进行交互。
可选地,由于BMC管理单元只有一个UDC模块,其中硬件只支持一个设备地址寄存器(Function Address Register,FADDR),而Host对USB Hub驱动单元及USB Hub驱动单元的下游端口设备(也即各USB设备驱动单元)进行访问时,需要保证FADDR的设备地址与Host请求的设备对应地址一致。因此,为了确保Host与各驱动单元进行正常通信,必须解决同一个FADDR实现不同驱动单元通信时地址寄存器不足的问题。对此,本实施例将BMC的USB Hub工作时间切分为USB Hub驱动单元对应的地址切换时间片、各USB设备驱动单元对应的地址切换时间片,以基于各时间片进行分时复用的地址切换,以实现各驱动单元与Host之间的正常通信。
可选地,对于每一次交互,UDC模块可以判断USB Hub驱动单元对应的地址切换时间片、各USB设备驱动单元对应的地址切换时间片是否被触发,根据触发判断结果,在USB Hub驱动单元和多个USB设备驱动单元中,确定该次所需与Host交互的目标驱动单元,依据目标驱动单元的设备地址对FADDR中的设备地址进行实时切换,以通过切换后的设备地址,建立目标驱动单元与Host之间的通信连接,并在目标驱动单元对应的地址切换时间片内,通过该通信连接,将Host发送的交互请求传递至目标驱动单元,以及将目标驱动单元依据交互请求返回的响应信息传递至Host,由此实现目标驱动单元与Host之间的交互。在当前次交互结束后,UDC模块基于上述交互步骤,继续判断USB Hub驱动单元对应的地址切换时间片、各USB设备驱动单元对应的地址切换时间片是否被触发,根据触发判断结果,在USB Hub驱动单元和多个USB设备驱动单元中,确定下一次所需与Host交互的目标驱动单元,在下一次所需与Host交互的目标驱动单元的基础上,迭代执行下一次交互步骤,直到BMC关闭或者BMC配置更新。
此处的USB Hub驱动单元对应的地址切换时间片和各USB设备驱动单元对应的地址切换时间片的时间片划分可以是按一定时间间隔进行周期性地划分、或者根据各驱动单元的处理性能、数据包传输模式等进行周期性地划分,以使得各驱动单元能够有序且高效地与Host通信,本实施例对划分方式不作限定。
此处的各驱动单元对应的地址切换时间片可以是周期性地定时触发,也可以是根据Host在每次交互过程发送的请求进行适应性地触发,本实施例对此不作限定。
本实施例提供的装置,通过在BMC内部配置通用串行总线设备控制器、通用串行总线设备集线器驱动单元、以及实现不同类型的虚拟USB设备功能的多个通用串行总线设备驱动单元,并由通用串行总线设备控制器,依据通用串行总线设备集线器驱动单元对应的地址切换时间片、各通用串行总线设备驱动单元对应的地址切换时间片,对通用串行总线设备控制器内部配置的设备地址寄存器进行实时切换,以依据切换后的设备地址和通用串行总线设备控制器内部配置的被多驱动单元复用的控制端口,控制不同通用串行总线设备驱动单元在不同的时间片内与服务器主机进行交互,可有效避免为每个USB设备分配独立的硬件资源,即使只有一个UDC模块的情况下,也能实现多USB设备的统一控制,减少了一对一配置UDC模块所需消耗的硬件资源成本以及提高了资源利用的灵活性,由此实现了低成本、便捷地对多USB设备进行统一控制。
在一些实施例中,通用串行总线设备控制器211还包括定时器;
通用串行总线设备控制器211,被设置为:
对于当前次交互,根据定时器的当前运行状态,判断通用串行总线设备集线器驱动单元212对应的地址切换时间片、各通用串行总线设备驱动单元213对应的地址切换时间片是否被触发;
在通用串行总线设备集线器驱动单元212和多个通用串行总线设备驱动单元213中,确定地址切换时间片被触发的当前待控制驱动单元;
将设备地址寄存器中的设备地址切换为当前待控制驱动单元的设备地址,得到目标设备地址;
根据目标设备地址和控制端口,控制当前待控制驱动单元与服务器主机220进行交互;
继续根据定时器的下一运行状态,迭代控制下一待控制驱动单元与服务器主机220进行交互。
可选地,UDC模块可执行如下步骤实现各驱动单元的交互控制:
在BMC启动时,UDC模块会进行初始化,其中包括设备地址寄存器、控制端口、定时器的配置,以及在MUSB驱动单元中,实现USB硬件的初始化和各驱动单元的注册。定时器可以被设置为按照预定的时间间隔触发中断,以便按顺序控制不同的USB设备驱动单元。
在初始化过程中,UDC模块会为USB Hub驱动单元和每个USB设备驱动单元分配地址切换时间片。这些时间片定义了每个驱动单元可以占用设备地址寄存器和控制端口的时间段。
在当前次交互过程中,UDC模块根据定时器的当前运行状态,判断定时器当前是否到触发任一驱动单元的地址切换时间片。
在确定定时器当前触发了任一驱动单元的地址切换时间片,UDC模块将该驱动单元标记为当前所需控制的驱动单元,也即当前待控制驱动单元。
随后,UDC模块将设备地址寄存器中的设备地址切换为当前待控制驱动单元的设备地址,以便当前次交互过程中,仅供当前待控制驱动单元与Host之间的交互。
随后,UDC模块使用切换后的目标设备地址和控制端口,开始控制当前待控制驱动单元与Host进行交互,所称的交互包括数据传输、命令执行等操作。
在获知Host完成与当前待控制驱动单元的交互后,UDC模块会根据定时器的下一运行状态,迭代控制下一个待控制驱动单元与Host进行交互,直到所有的驱动单元都完成了各自的地址切换时间片内的交互。
需要说明的是,为了应对USB设备连接状态的动态变化,如设备插拔、设备类型变更等,UDC模块会周期性地更新地址切换时间片的设置,以确保能够准确地控制所有连接的USB设备驱动单元。
本实施例提供的装置,利用定时器来触发地址切换时间片的中断,UDC模块能够高效地控制多个USB设备驱动单元与Host进行交互,从而满足数据中心对不同USB设备功能需求的增加,同时降低了硬件资源的成本。
在一些实施例中,通用串行总线设备控制器211,还被设置为:
根据定时器的当前运行状态,判断定时器是否处于超时状态;
在判断获知定时器处于超时状态的情况下,将定时器所属的循环周期,分别与通用串行总线设备集线器驱动单元212对应的地址切换时间片,以及各通用串行总线设备驱动单元213对应的地址切换时间片进行匹配;
根据匹配结果,判断通用串行总线设备集线器驱动单元212对应的地址切换时间片、各通用串行总线设备驱动单元213对应的地址切换时间片是否被触发。
图5为本申请提供的地址切换的流程示意图之一;如图5所示,UDC模块还可执行如下步骤实现设备地址切换:
步骤510,依据定时器的当前运行状态,判断定时器是否处于超时状态,若超时,则执行步骤520;
步骤520,判断是否允许修改设备地址,如果允许则执行步骤530,否则执行步骤510;
步骤530:将定时器所属的循环周期,分别与通用串行总线设备集线器驱动单元212对应的地址切换时间片,以及各通用串行总线设备驱动单元213对应的地址切换时间片进行匹配,以将匹配的地址切换时间片作为被触发的地址切换时间片,由此依据被触发的地址切换时间片,在设备地址列表中获取当前待控制驱动单元的设备地址;
步骤540:根据获取的当前待控制驱动单元的设备地址对设备地址寄存器中的设备地址进行切换,并控制当前待控制驱动单元与服务器主机220进行交互,之后跳转至步骤510。
本实施例提供的装置,通过依据定时器的超时状态触发相应的地址切换时间片,从而确保多个驱动单元能够按照预定的时间顺序与服务器主机进行分时交互,实现单一UDC模块支持多个USB设备同时与服务器主机进行通信,大大降低了USB设备控制的硬件资源成本和提高了多USB设备管理效率。
在一些实施例中,通用串行总线设备控制器211,还被设置为:
根据设备地址寄存器的当前访问状态,确定当前待控制驱动单元的当前访问权限信息;
在根据当前待控制驱动单元的当前访问权限信息,判断获知当前待控制驱动单元具备访问设备地址寄存器的权限的情况下,将设备地址寄存器中的设备地址切换为当前待控制驱动单元的设备地址,并为设备地址寄存器进行加锁操作。
可选地,为了避免FADDR访问冲突,UDC模块还可执行如下步骤实现设备地址切换:
首先,检测FADDR的当前访问状态,如FADDR是否正在被其他驱动单元访问、是否有未完成的读写操作等,以判断FADDR是否处于未占用状态。
在获知FADDR处于未占用状态的情况下,则确定当前待控制驱动单元具备访问设备地址寄存器的权限,在获知FADDR处于占用状态的情况下,则确定当前待控制驱动单元不具备访问设备地址寄存器的权限。
若确定当前待控制驱动单元具备访问设备地址寄存器的权限,则将设备地址寄存器中的设备地址切换为当前待控制驱动单元的设备地址,并且为确保设备地址寄存器在切换后不被其他未授权的驱动单元访问或修改,还需要对设备地址寄存器进行加锁操作。所称的加锁可以通过设置特定的寄存器标志位、使用互斥锁或其他同步机制来实现。
本实施例提供的装置,通过访问权限控制,能够确保只有具备相应权限的驱动单元才能访问设备地址寄存器,有助于防止未授权的访问和潜在的安全风险,且通过在设备地址寄存器切换后进行加锁操作,能够确保同一时间只有一个驱动单元能够访问和修改寄存器,以助于减少资源冲突和潜在的数据不一致问题,进而确保每个驱动单元都能够有效地使用设备地址寄存器与Host交互,提高多USB设备控制的有效性。
在一些实施例中,通用串行总线设备控制器211,还被设置为:
在判断获知设备地址寄存器加锁操作完成的情况下,接收服务器主机220发起的当前任务处理请求;
根据目标设备地址,将当前任务处理请求传输至当前待控制驱动单元;
将当前待控制驱动单元根据当前任务处理请求返回的第一响应信息传输至服务器主机220;
在判断获知服务器主机220接收到第一响应信息的情况下,解除对设备地址寄存器的加锁操作。
可选地,为了提高资源利用率,UDC模块还可执行如下步骤实现设备地址切换:
在设备地址寄存器完成加锁操作后,UDC模块会检测并确认加锁操作已经完成,以确保在传输任务处理请求之前,设备地址寄存器处于安全、独占的状态。一旦确认加锁操作完成,UDC模块会开始监听并接收来自服务器主机220发起的当前任务处理请求;所称的请求包括数据传输、设备控制等。
UDC模块接收到当前任务处理请求后,会解析任务处理请求,并根据目标设备地址,将请求准确地传输至当前待控制驱动单元。
在当前待控制驱动单元处理完任务并生成响应信息后,UDC模块接收第一响应信息,并将其传输回服务器主机220;在获知服务器主机220已接收到第一响应信息后,UDC模块会解除对设备地址寄存器的加锁操作,使其恢复为可访问状态,供其他驱动单元使用,由此提高资源利用率。
在一些实施例中,通用串行总线设备控制器211,还被设置为:
根据当前任务处理请求,获取当前请求设备地址;
将当前请求设备地址与目标设备地址进行匹配;
在匹配获知当前请求设备地址与目标设备地址一致的情况下,根据目标设备地址,将当前任务处理请求传输至当前待控制驱动单元。
可选地,为了确保请求传输的正确性,UDC模块可执行如下步骤实现请求传输:
当UDC模块接收到来自服务器主机220的当前任务处理请求时,首先解析当前任务处理请求,从中提取出请求所指向的设备地址,即当前请求设备地址。将当前请求设备地址与目标设备地址进行匹配,以确保任务处理请求被发送到正确的目标设备上,防止因为设备地址错误而导致的数据传输错误或设备控制异常。
如果在匹配过程中,确定当前请求设备地址与目标设备地址一致,则确定当前任务处理请求有效,此时,可根据匹配到的目标设备地址,将当前任务处理请求准确地传输至对应的当前待控制驱动单元,以便当前待控制驱动单元进行当前任务处理请求响应,实现当前待控制驱动单元与Host之间的有效交互。
本实施例提供的装置,通过在任务处理之前进行设备地址的匹配,可以确保请求被发送到正确的驱动单元上,避免了因为设备地址错误而导致的任务处理失败或数据传输错误,提高了整个系统的任务处理准确性,防止非法的请求或错误的请求被发送到驱动单元中,从而增强了驱动单元的安全性,减少了潜在的安全风险和漏洞。
可选地,为了确保请求传输的正确性,UDC模块还可执行如下步骤实现请求传输:
当UDC模块在匹配过程中发现当前请求设备地址与目标设备地址不一致时,可将当前任务处理请求存储到一个缓存队列中。缓存队列的作用是临时存储等待处理的请求,以便在适当的时机再次进行匹配和传输。
UDC模块持续监控设备地址寄存器的变化,当设备地址寄存器中的设备地址切换到下一个待控制驱动单元的设备地址时,再次将缓存队列中存储的当前任务处理请求的当前请求设备地址与设备地址寄存器中切换得到的下一待控制驱动单元的设备地址进行匹配。
如果在重新匹配的过程中,获知当前请求设备地址与下一待控制驱动单元的设备地址一致,则将当前任务处理请求从缓存队列中取出,并传输至对应的下一待控制驱动单元,以便下一待控制驱动单元对当前任务处理请求进行处理。
本实施例提供的装置,通过将不匹配的请求存储到缓存队列中,并在设备地址切换后重新进行匹配和传输,可以确保每个请求都能够得到及时的处理,不会因为地址不匹配而被丢弃或延迟,大大提高了任务处理的效率和性能。
以下以可选的实例,对本实施例提供的地址切换流程展开描述。
图6为本申请提供的地址切换的流程示意图之二;如图6所示,地址切换流程可以是由UDC模块执行如下步骤实现:
步骤610,若根据定时器的运行状态判断获知进入USB Hub驱动单元对应的地址切换时间片,则在该时间片内为FADDR操作加锁,防止其他进程访问FADDR而导致访问冲突,设置FADDR为USB Hub驱动单元的设备地址;
步骤620,等待Host向USB Hub驱动单元发起的任务处理请求,也即Hub类请求,如获取端口状态的请求;在USB Hub驱动单元收到请求后且响应Host的请求后,解除对FADDR的锁操作,等待定时进入下一地址切换状态;
步骤630,若根据定时器运行状态判断获知进入Mass Storage驱动单元对应的地址切换时间片,则在该时间片内为FADDR寄存器操作加锁,防止其他进程访问FADDR而导致访问冲突,设置FADDR为Mass Storage驱动单元的设备地址;
步骤640,等待Host向Mass Storage驱动单元发起请求,在Mass Storage驱动单元收到请求后响应Host的请求时,解除对FADDR的锁操作,等待定时进入下一地址切换状态;
步骤650,若根据定时器运行状态判断获知进入HID驱动单元对应的地址切换时间片,则在该时间片内为FADDR寄存器操作加锁,防止其他进程访问FADDR而导致访问冲突,设置FADDR为HID驱动单元的设备地址;
步骤660,等待Host向HID驱动单元发起请求,在HID驱动单元收到请求后响应Host的请求时,解除对FADDR的锁操作,等待定时进入下一地址切换状态;
步骤670,若根据定时器运行状态判断获知进入ECM驱动单元对应的地址切换时间片,则在该时间片内为FADDR寄存器操作加锁,防止其他进程访问FADDR而导致访问冲突,设置FADDR为ECM驱动单元的设备地址;
步骤680,等待Host向ECM驱动单元发起请求,在ECM驱动单元收到请求后响应Host的请求时,解除对FADDR的锁操作,等待定时进入下一地址切换状态;
步骤690,根据定时器运行状态,跳转至步骤610。
需要说明的是,上述步骤中定时器的操作主要用于设置不同设备的地址切换时间,操作与图5过程一致。
综上,本实施例提出的基于定时器的多USB设备地址切换方案,能够更好地实现多USB设备与Host之间的交互,为系统提供了较大的灵活性与扩展性,能够较容易地扩展至更多USB设备的接入,满足BMC在多USB设备接入时的不同需求场景,增强了系统的适应性和通用性;其次,避免了因硬件UDC模块数量不足而需要频繁进行的硬件升级或更换,从而减少了相关的硬件成本。同时,由于软件实现方式具有更高的灵活性,可以快速适应市场变化和客户需求,减少了因技术迭代带来的额外成本,提高了整体的经济效益。
在一些实施例中,通用串行总线设备集线器驱动单元212,被设置为:
接收服务器主机220发送的第一枚举请求;第一枚举请求用于对通用串行总线设备集线器驱动单元212进行枚举;
根据第一枚举请求,向服务器主机220返回第二响应信息;
接收服务器主机220根据第二响应信息,为通用串行总线设备集线器驱动单元212分配的设备地址;
将设备地址寄存器修改为通用串行总线设备集线器驱动单元212的设备地址;
接收服务器主机220发送的通用串行总线设备驱动单元213的状态获取命令;
响应于状态获取命令,根据通用串行总线设备集线器驱动单元212的设备地址,向服务器主机220报告各通用串行总线设备驱动单元213的设备状态;
接收服务器主机220根据各通用串行总线设备驱动单元213的设备状态,为各通用串行总线设备驱动单元213枚举分配的设备地址,并将各通用串行总线设备驱动单元213的设备地址传输至各通用串行总线设备驱动单元213。
需要说明的是,Host枚举BMC的USB设备是USB通信的基础,涉及Host识别和配置USB设备的过程,只有成功枚举才能实现Host与USB设备间的数据通信。由于本实施例仅配置一个UDC模块,即只有一个FADDR,因此在Host枚举USB设备时,USB Hub驱动单元、多个USB设备驱动单元需要共用这个FADDR,在软件上必须设计一套寄存器共享方案实现所有USB设备的枚举。鉴于此,本实施例通过控制USB Hub驱动单元逐驱动单元地报告各USB设备驱动单元的状态,以实现各USB设备驱动单元的枚举。
可选地,USB Hub驱动单元可与Host交互执行如下步骤实现枚举:
USB Hub驱动单元接入Host后,首先接收来自Host发送的第一枚举请求。所称的第一枚举请求用于对USB Hub驱动单元进行枚举,以获取其设备信息和配置。
在接收到第一枚举请求后,USB Hub驱动单元会根据请求的内容,向Host返回第二响应信息。所称的第二响应信息包括但不限于设备类型、端口编号和所连接的各下游端口的查询时间间隔等。
Host根据返回的第二响应信息,为USB Hub驱动单元分配一个设备地址。
USB Hub驱动单元接收该设备地址,并将其存储在设备地址寄存器中。
随后,Host可能会发送一个USB设备驱动单元的状态获取命令,以查询USB Hub驱动单元所连接的各个USB设备驱动单元的状态。
USB Hub驱动单元响应于状态获取命令,根据自身的设备地址,向Host报告其所连接的各个USB设备驱动单元的设备状态。所称的设备状态包括但不限于设备的连接状态、设备类型、运行状态等。
Host根据接收到的设备状态信息,为各个USB设备驱动单元枚举分配设备地址。USB Hub驱动单元接收Host枚举的设备地址,并将其分别传输至对应的USB设备驱动单元,由此实现各驱动单元的枚举,以便后续各驱动单元依据枚举生成的设备地址与Host进行交互。
本实施例提供的装置,通过枚举和地址分配,能够确保Host与各USB设备驱动单元的正确连接和通信,有助于减少因设备连接错误或通信故障导致的系统崩溃或数据丢失等问题,从而增强系统的稳定性和可靠性。
在一些实施例中,第二响应信息包括通用串行总线设备集线器驱动单元212的设备类型和端口编号;
通用串行总线设备集线器驱动单元212的设备地址是由服务器主机220根据通用串行总线设备集线器驱动单元212的设备类型和端口编号进行分配的。
可选地,USB Hub驱动单元在接收到本端的枚举请求时,可向Host报告自身的设备类型和端口编号,以便Host能够更准确地识别USB Hub驱动单元的特性和功能,进而可依据设备类型和端口编号合理、高效地为USB Hub驱动单元分配相应的唯一的设备地址,以保障BMC的稳定性和兼容性。
在一些实施例中,第二响应信息还包括各通用串行总线设备驱动单元213的查询时间间隔;
通用串行总线设备驱动单元213的状态获取命令是根据查询时间间隔周期性发送的。
可选地,USB Hub驱动单元在接收到本端的枚举请求时,还可向Host报告各USB设备驱动单元的查询时间间隔,以便Host能够根据各USB设备驱动单元的查询时间间隔,周期性地向USB Hub驱动单元发送USB设备驱动单元的状态获取命令,以确保USB Hub驱动单元可以将各USB设备驱动单元顺利地发送至Host,从而提高对Host的响应效率。
在一些实施例中,通用串行总线设备集线器驱动单元212,还被设置为:
对于当前次端口设备枚举,将设备地址寄存器修改为通用串行总线设备集线器驱动单元212的设备地址;
接收服务器主机220发送的当前通用串行总线设备驱动单元213的当前状态获取命令;
响应于当前状态获取命令,根据通用串行总线设备集线器驱动单元212的设备地址,将当前通用串行总线设备驱动单元213的目标设备状态发送至服务器主机220;
对设备地址寄存器进行清除,并根据目标设备状态,接收服务器主机220根据目标设备状态发送的当前通用串行总线设备驱动单元213的第二枚举请求;
将当前通用串行总线设备驱动单元213根据第二枚举请求返回的第三响应信息发送至服务器主机220;
将服务器主机220根据第三响应信息为当前通用串行总线设备驱动单元213分配的设备地址传输至当前通用串行总线设备驱动单元213;
返回至将设备地址寄存器修改为通用串行总线设备集线器驱动单元212的设备地址,迭代执行下一次端口设备枚举,直到所有通用串行总线设备驱动单元213均枚举完成。
可选地,USB Hub驱动单元还可与Host交互执行如下步骤实现枚举:
对于当前次端口设备枚举,USB Hub驱动单元将设备地址寄存器修改为USB Hub驱动单元的设备地址,并接收Host根据USB Hub驱动单元返回的第二响应信息中报告的各端口查询时间间隔,周期性地发送的当前状态获取命令,如GetPortStatus(获取端口状态)命令,以将USB Hub驱动单元的下游端口的设备状态报告给Host。
USB Hub驱动单元检查其所有下游端口,并将当前USB设备驱动单元的目标设备状态发送至Host。
在当前USB设备驱动单元的设备的状态报告后,USB Hub驱动单元清除FADDR地址,设置为0,等待Host开始枚举下游端口设备。
Host根据目标设备状态,向USB Hub驱动单元下游的当前USB设备驱动单元发送第二枚举请求,以枚举USB Hub驱动单元下游的当前USB设备驱动单元。
当前USB设备驱动单元响应Host的枚举请求返回第三响应信息至Host,并获取Host依据第三响应信息分配的设备地址进行记录。
在当前USB设备驱动单元枚举完成之后,USB Hub驱动单元返回至USB Hub驱动单元将设备地址寄存器修改为USB Hub驱动单元的设备地址的步骤,继续等待Host继续发起下一USB设备驱动单元的状态获取请求,以迭代执行下一次端口设备枚举,直到所有USB设备驱动单元均枚举完成。
本实施例提供的装置,通过迭代执行端口设备枚举,以能够逐一识别并管理连接到USB Hub驱动单元的所有下游端口设备,此种有序的枚举过程确保了各下游端口设备能够被正确地枚举,避免了因设备冲突或识别错误导致的性能问题,进而提高多USB设备管理的正确性。
以下以可选的实例,对本实施例提供的设备枚举流程展开描述。
图7为本申请提供的设备枚举的流程示意图;如图7所示,设备枚举流程可以是由USB Hub驱动单元与Host执行如下交互步骤实现:
步骤710,USB Hub驱动单元接入Host后,Host发出对USB Hub驱动单元的枚举请求,Hub响应枚举请求,报告包括自身的设备类型和端口编号,以及其下游的各端口的查询时间间隔的响应信息;
步骤720,Host收到USB Hub驱动单元的响应信息后,为USB Hub驱动单元分配设备地址,USB Hub驱动单元记录该地址并将其写入FADDR中;
步骤730,Host根据USB Hub驱动单元报告的各端口的查询时间间隔,周期性地发送GetPortStatus(端口状态获取)命令,请求获取USB Hub驱动单元的下游端口的设备状态;
步骤740,USB Hub驱动单元判断是否完成所有下游端口的设备状态报告,如果USB Hub驱动单元已完成所有下游端口的设备状态报告,则结束,否则执行步骤750;
步骤750,USB Hub驱动单元报告当前下游端口设备(当前USB设备驱动单元)的设备状态,一次报告一种设备的设备状态;
步骤760,USB Hub驱动单元清除FADDR地址,将其设置为0,等待Host枚举USB Hub驱动单元的当前下游端口设备;
步骤770,Host向USB Hub驱动单元的当前下游端口设备发起枚举请求;
步骤780,当前下游端口设备响应Host的枚举请求,获取Host分配的设备地址并记录;
步骤790,USB Hub驱动单元修改FADDR为自身的设备地址,等待Host继续发起GetPortStatus请求,跳转至步骤730。
经上述步骤,USB Hub下的各USB设备驱动单元均获取了各自的设备地址,后续可依据此设备地址实现不同USB设备驱动单元与Host之间的精准、有效交互。
在一些实施例中,对于通用串行总线设备集线器驱动单元212和多个通用串行总线设备驱动单元213中的每一驱动单元,驱动单元配置有至少一个端口编号;
驱动单元,被设置为:
在接收服务器主机220发起的任务处理请求的情况下,根据任务处理请求对应的任务类型和数据传输模式,在至少一个端口编号中,获取目标端口编号;
根据目标端口编号对应的任务操作模式,对任务处理请求进行处理,并将任务处理结果返回至服务器主机220。
如图4所示,UDC模块支持1个设备地址与1个控制端口,该控制端口可编码为0,为了完成多USB设备的支持,对于USB Hub驱动单元和多个USB设备驱动单元中的每一驱动单元端点配置,可以是针对其配置一个或多个端口编号。
每一驱动单元的端点配置可以依据每一驱动单元的端口位置进行顺序编号,或者依据不同驱动单元的设备类型进行自适应地编号,本实施例对此不作限定。
在一些实施例中,驱动单元的端口编号是根据驱动单元的设备类型进行配置的。
可选地,由于对于不同设备类型的驱动单元,其数据操作方式不同,对应的端口数量、端口类型也不同。因此,为了能够有效实现不同设备类型的驱动单元的功能,可以依据驱动单元的设备类型,确定其对应的端口数量和端口类型,依据其对应的端口数量和端口类型配置不同的端口编号。所称的端口类型包括输入端口和输出端口,或者包括针对输入端口和输出端口细化分更多类型的端口。
表1端点配置表
如表1所示和图4,为一种示例性的端点配置方式,其中,USB Hub驱动单元、HID驱动单元、Mass Storage驱动单元及ECM驱动单元共用控制端点0。USB Hub驱动单元,可为其配置一个输入(也称IN)端点,并为其编号为端点1,设定传输类型为中断传输;HID驱动单元配置一个IN端点,并为其编号为端点2,设定传输类型为中断传输;Mass Storage驱动单元配置两个端点,一个为IN端点,并为其编号为端点3,设定传输类型为批量传输;另一个为输出(OUT)端点,并为其编号为端点1,设定传输类型为批量传输;ECM驱动单元配置三个端点,两个为IN端点,并为其编号为端点4和5,设定传输类型为批量传输,一个为OUT端点,并为其编号为端点2,设定传输类型为批量传输。
需要说明的是不同驱动单元的不同类型的端口的编号可以相同也可以不同。
在一些实施例中,任一驱动单元的输入端的端口编号,与除任一驱动单元之外的任一其他驱动单元的输出端口的端口编号相同。
可选地,不同驱动单元的不同类型的端口的编号可以相同,优化系统资源的分配和使用,无需为每个端口单独设计和管理编号,减少了开发成本和复杂性。例如,HID驱动单元的输入端口的编号与ECM驱动单元的输出端口的编号相同,又如,Mass Storage驱动单元的输出端口的编号与USB Hub驱动单元的输入端口的编号相同。
可选地,在各驱动单元的端口编号配置完成之后,各驱动单元可以依据不同端口编号完成Host发起的不同的任务处理。对于每一驱动单元可以执行如下步骤实现任务处理:
在接收到Host发起的任务处理请求的情况下,可以是对任务处理请求进行解析,以获取该任务处理请求对应的任务类型和数据传输模式;所称的任务类型包括但不限于读和写,数据传输模式包括但不限于中断传输和批量传输。
随后,根据对应的任务类型和数据传输模式,在其管理的端口编号中查找对应任务类型和数据传输模式的目标端口编号,以调用该目标端口编号对应的任务操作模式来处理任务,并将处理结果返回至Host。例如,如果任务请求是向HID设备发送数据,驱动单元就会使用配置在端点2上的中断传输模式来发送数据;如果任务请求是从Mass Storage设备读取数据,驱动单元就会使用配置在端点3上的批量传输模式来读取数据,并通过端点1将数据发送回服务器主机220。
本实施例提供的装置,USB Hub驱动单元和多个USB设备驱动单元共同协作,确保Host能够与各种USB设备进行高效、可靠的通信,且通过端口编号来管理不同的USB设备,并根据任务类型和数据传输模式来选择合适的处理方式,从而实现了多USB设备支持的功能,进而实现高效、可靠地多USB设备管理。
在一些实施例中,本实施例还提供一种通用串行总线控制系统,该控制系统可以是计算机系统、云计算系统等,本实施例对此不作限定。
如图2所示,该系统中的通用串行总线控制装置,可与服务器主机220通信连接,以实现控制其下的USB设备驱动单元与服务器主机220交互,由此实现服务器主机220的远程监控。
本实施例提供的系统,通过在BMC内部配置通用串行总线设备控制器、通用串行总线设备集线器驱动单元、以及实现不同类型的虚拟USB设备功能的多个通用串行总线设备驱动单元,并由通用串行总线设备控制器,依据通用串行总线设备集线器驱动单元对应的地址切换时间片、各通用串行总线设备驱动单元对应的地址切换时间片,对通用串行总线设备控制器内部配置的设备地址寄存器进行实时切换,以依据切换后的设备地址和通用串行总线设备控制器内部配置的被多驱动单元复用的控制端口,控制不同通用串行总线设备驱动单元在不同的时间片内与服务器主机进行交互,可有效避免为每个USB设备分配独立的硬件资源,即使只有一个UDC模块的情况下,也能实现多USB设备的统一控制,减少了一对一配置UDC模块所需消耗的硬件资源成本以及提高了资源利用的灵活性,由此实现了低成本、便捷地对多USB设备进行统一控制。
在一些实施例中,本实施例还提供一种通用串行总线控制方法,该方法是在上述各实施例提供的通用串行总线控制装置的基础上执行实现的。图8为本申请提供的通用串行总线控制方法的流程示意图;如图8所示,该方法包括步骤810和步骤820。
步骤810,根据通用串行总线设备集线器驱动单元对应的地址切换时间片、各通用串行总线设备驱动单元对应的地址切换时间片,对设备地址寄存器中的设备地址进行切换。
步骤820,根据切换后的设备地址和控制端口,控制通用串行总线设备集线器驱动单元和各通用串行总线设备驱动单元,与服务器主机进行交互;其中,设备地址寄存器为通用串行总线设备控制器中,通用串行总线设备集线器驱动单元和多个通用串行总线设备驱动单元之间共享的寄存器,控制端口为通用串行总线设备控制器中,通用串行总线设备集线器驱动单元和多个通用串行总线设备驱动单元之间共享的端口。
可选地,对于每一次交互,UDC模块可以通过判断通用串行总线设备集线器驱动单元对应的地址切换时间片、各通用串行总线设备驱动单元对应的地址切换时间片是否被触发,在USB Hub驱动单元和多个USB设备驱动单元中,确定该次所需与Host交互的目标驱动单元,并依据目标驱动单元的设备地址对FADDR中的设备地址进行实时切换,以通过切换后的设备地址,建立目标驱动单元与Host之间的通信连接,并在目标驱动单元对应的地址切换时间片,通过该通信连接,将Host发送的交互请求传递至目标驱动单元,以及将目标驱动单元依据交互请求返回的响应信息传递至Host,由此实现目标驱动单元与Host之间的交互。
在当前次交互结束后,UDC模块继续根据通用串行总线设备集线器驱动单元对应的地址切换时间片、各通用串行总线设备驱动单元对应的地址切换时间片,在USB Hub驱动单元和多个USB设备驱动单元中,确定下一次所需与Host交互的目标驱动单元,以迭代执行交互步骤,直到BMC系统关闭或者BMC配置更新。
本实施例提供的方法,通过通用串行总线设备控制器,依据通用串行总线设备集线器驱动单元对应的地址切换时间片、各通用串行总线设备驱动单元对应的地址切换时间片,对通用串行总线设备控制器内部配置的设备地址寄存器进行实时切换,以依据切换后的设备地址和通用串行总线设备控制器内部配置的被多驱动单元复用的控制端口,控制不同通用串行总线设备驱动单元在不同的时间片内与服务器主机进行交互,可有效避免为每个USB设备分配独立的硬件资源,即使只有一个UDC模块的情况下,也能实现多USB设备的统一控制,减少了一对一配置UDC模块所需消耗的硬件资源成本以及提高了资源利用的灵活性,由此实现了低成本、便捷地对多USB设备进行统一控制。
在一些实施例中,根据通用串行总线设备集线器驱动单元对应的地址切换时间片、各通用串行总线设备驱动单元对应的地址切换时间片,对设备地址寄存器中的设备地址进行切换,包括:
对于当前次交互,根据定时器的当前运行状态,判断通用串行总线设备集线器驱动单元对应的地址切换时间片、各通用串行总线设备驱动单元对应的地址切换时间片是否被触发;
在通用串行总线设备集线器驱动单元和多个通用串行总线设备驱动单元中,确定地址切换时间片被触发的当前待控制驱动单元;
将设备地址寄存器中的设备地址切换为当前待控制驱动单元的设备地址。
可选地,在BMC启动时,UDC模块会进行初始化,其中包括设备地址寄存器、控制端口、定时器的配置,以及在MUSB驱动单元中,实现USB硬件的初始化和各驱动单元的注册。定时器被设置为按照预定的时间间隔触发中断,以便按顺序控制不同的USB设备驱动单元。
在初始化过程中,UDC模块会为USB Hub驱动单元和每个USB设备驱动单元分配地址切换时间片。这些时间片定义了每个驱动单元可以占用设备地址寄存器和控制端口的时间段。
在当前次交互过程中,根据定时器的当前运行状态,UDC模块会判断定时器当前是否到触发任一驱动单元的地址切换时间片。
在确定定时器当前触发了任一驱动单元的地址切换时间片,UDC模块将该驱动单元标记为当前所需控制的驱动单元,也即当前待控制驱动单元。
UDC模块将设备地址寄存器中的设备地址切换为当前待控制驱动单元的设备地址,以便当前次交互过程中,仅供当前待控制驱动单元与Host之间的交互。
UDC模块使用切换后的目标设备地址和控制端口,开始控制当前待控制驱动单元与Host进行交互,所称的交互包括数据传输、命令执行等操作。
在获知Host完成与当前待控制驱动单元的交互后,UDC模块会根据定时器的下一运行状态,迭代控制下一个待控制驱动单元与服务器主机进行交互,直到所有的驱动单元都完成了各自的地址切换时间片内的交互。
本实施例提供的方法,利用定时器来触发地址切换时间片的中断,USB设备控制器能够高效地控制多个USB设备驱动单元与服务器主机进行交互,从而满足数据中心对不同USB设备功能需求的增加,同时降低了硬件资源的成本。
本申请提供的方法是基于上述各装置实施例执行的,执行流程和详细内容请参照上述实施例,此处不再赘述。
图9示例了一种电子设备的实体结构示意图,如图9所示,该电子设备可以包括:处理器(processor)910、通信接口(Communications Interface)920、存储器(memory)930和通信总线940,其中,处理器910,通信接口920,存储器930通过通信总线940完成相互间的通信。处理器910可以调用存储器930中的逻辑指令,以执行通用串行总线控制方法,该方法包括:根据通用串行总线设备集线器驱动单元对应的地址切换时间片、各通用串行总线设备驱动单元对应的地址切换时间片,对设备地址寄存器中的设备地址进行切换;根据切换后的设备地址和控制端口,控制通用串行总线设备集线器驱动单元和各通用串行总线设备驱动单元,与服务器主机进行交互;其中,设备地址寄存器为通用串行总线设备控制器中,通用串行总线设备集线器驱动单元和多个通用串行总线设备驱动单元之间共享的寄存器,控制端口为通用串行总线设备控制器中,通用串行总线设备集线器驱动单元和多个通用串行总线设备驱动单元之间共享的端口。
此外,上述的存储器930中的逻辑指令可以通过软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本申请的技术方案本质上或者说对相关技术做出贡献的部分或者该技术方案的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本申请各个实施例方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,Random Access Memory)、磁碟或者光盘等各种可以存储程序代码的介质。
另一方面,本申请还提供一种计算机程序产品,计算机程序产品包括计算机程序,计算机程序可存储在非暂态计算机可读存储介质上,计算机程序被处理器执行时,计算机能够执行上述各方法所提供的通用串行总线控制方法,该方法包括:根据通用串行总线设备集线器驱动单元对应的地址切换时间片、各通用串行总线设备驱动单元对应的地址切换时间片,对设备地址寄存器中的设备地址进行切换;根据切换后的设备地址和控制端口,控制通用串行总线设备集线器驱动单元和各通用串行总线设备驱动单元,与服务器主机进行交互;其中,设备地址寄存器为通用串行总线设备控制器中,通用串行总线设备集线器驱动单元和多个通用串行总线设备驱动单元之间共享的寄存器,控制端口为通用串行总线设备控制器中,通用串行总线设备集线器驱动单元和多个通用串行总线设备驱动单元之间共享的端口。
又一方面,本申请还提供一种非暂态计算机可读存储介质,其上存储有计算机程序,该计算机程序被处理器执行时实现以执行上述各方法提供的通用串行总线控制方法,该方法包括:根据通用串行总线设备集线器驱动单元对应的地址切换时间片、各通用串行总线设备驱动单元对应的地址切换时间片,对设备地址寄存器中的设备地址进行切换;根据切换后的设备地址和控制端口,控制通用串行总线设备集线器驱动单元和各通用串行总线设备驱动单元,与服务器主机进行交互;其中,设备地址寄存器为通用串行总线设备控制器中,通用串行总线设备集线器驱动单元和多个通用串行总线设备驱动单元之间共享的寄存器,控制端口为通用串行总线设备控制器中,通用串行总线设备集线器驱动单元和多个通用串行总线设备驱动单元之间共享的端口。
以上所描述的装置实施例仅仅是示意性的,其中作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部模块来实现本实施例方案的目的。本领域普通技术人员在不付出创造性的劳动的情况下,即可以理解并实施。
通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到各实施方式可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件。基于这样的理解,上述技术方案本质上或者说对相关技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品可以存储在计算机可读存储介质中,如ROM/RAM、磁碟、光盘等,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行各个实施例或者实施例的某些部分的方法。
最后应说明的是:以上实施例仅用以说明本申请的技术方案,而非对其限制;尽管参照前述实施例对本申请进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本申请各实施例技术方案的精神和范围。

Claims (21)

  1. 一种通用串行总线控制装置,其特征在于,所述装置与服务器主机通信连接,所述装置包括通用串行总线设备控制器、通用串行总线设备集线器驱动单元、多个通用串行总线设备驱动单元;
    所述通用串行总线设备控制器包括所述通用串行总线设备集线器驱动单元和多个所述通用串行总线设备驱动单元之间共享的设备地址寄存器和控制端口;
    所述通用串行总线设备控制器,被设置为根据所述通用串行总线设备集线器驱动单元对应的地址切换时间片、各所述通用串行总线设备驱动单元对应的地址切换时间片,对所述设备地址寄存器中的设备地址进行切换,并根据切换后的设备地址和所述控制端口,控制所述通用串行总线设备集线器驱动单元和各所述通用串行总线设备驱动单元,与所述服务器主机进行交互。
  2. 根据权利要求1所述的通用串行总线控制装置,其特征在于,所述通用串行总线设备控制器还包括定时器;
    所述通用串行总线设备控制器,被设置为:
    对于当前次交互,根据所述定时器的当前运行状态,判断所述通用串行总线设备集线器驱动单元对应的地址切换时间片、各所述通用串行总线设备驱动单元对应的地址切换时间片是否被触发;
    在所述通用串行总线设备集线器驱动单元和多个所述通用串行总线设备驱动单元中,确定地址切换时间片被触发的当前待控制驱动单元;
    将所述设备地址寄存器中的设备地址切换为所述当前待控制驱动单元的设备地址,得到目标设备地址;
    根据所述目标设备地址和所述控制端口,控制所述当前待控制驱动单元与所述服务器主机进行交互;
    继续根据所述定时器的下一运行状态,迭代控制下一待控制驱动单元与所述服务器主机进行交互。
  3. 根据权利要求2所述的通用串行总线控制装置,其特征在于,所述通用串行总线设备控制器,还被设置为:
    根据所述定时器的当前运行状态,判断所述定时器是否处于超时状态;
    在判断获知所述定时器处于超时状态的情况下,将所述定时器所属的循环周期,分别与所述通用串行总线设备集线器驱动单元对应的地址切换时间片,以及各所述通用串行总线设备驱动单元对应的地址切换时间片进行匹配;
    根据匹配结果,判断所述通用串行总线设备集线器驱动单元对应的地址切换时间片、各所述通用串行总线设备驱动单元对应的地址切换时间片是否被触发。
  4. 根据权利要求2所述的通用串行总线控制装置,其特征在于,所述通用串行总线设备控制器,还被设置为:
    根据所述设备地址寄存器的当前访问状态,确定所述当前待控制驱动单元的当前访问权限信息;
    在根据所述当前待控制驱动单元的当前访问权限信息,判断获知所述当前待控制驱动单元具备访问所述设备地址寄存器的权限的情况下,将所述设备地址寄存器中的设备地址切换为所述当前待控制驱动单元的设备地址,并为所述设备地址寄存器进行加锁操作。
  5. 根据权利要求4所述的通用串行总线控制装置,其特征在于,所述通用串行总线设备控制器,还被设置为:
    在判断获知所述设备地址寄存器加锁操作完成的情况下,接收所述服务器主机发起的当前任务处理请求;
    根据所述目标设备地址,将所述当前任务处理请求传输至所述当前待控制驱动单元;
    将所述当前待控制驱动单元根据所述当前任务处理请求返回的第一响应信息传输至所述服务器主机;
    在判断获知所述服务器主机接收到所述第一响应信息的情况下,解除对所述设备地址寄存器的加锁操作。
  6. 根据权利要求5所述的通用串行总线控制装置,其特征在于,所述通用串行总线设备控制器,还被设置为:
    根据所述当前任务处理请求,获取当前请求设备地址;
    将所述当前请求设备地址与所述目标设备地址进行匹配;
    在匹配获知所述当前请求设备地址与所述目标设备地址一致的情况下,根据所述目标设备地址,将所述当前任务处理请求传输至所述当前待控制驱动单元。
  7. 根据权利要求6所述的通用串行总线控制装置,其特征在于,所述通用串行总线设备控制器,还被设置为:
    在匹配获知所述当前请求设备地址与所述目标设备地址不一致的情况下,将所述当前任务处理请求存储至缓存队列;
    在判断获知所述设备地址寄存器中的设备地址切换为下一待控制驱动单元的设备地址的情况下,继续将所述当前请求设备地址与所述设备地址寄存器中切换得到的下一待控制驱动单元的设备地址进行匹配;
    在匹配获知所述当前请求设备地址与所述下一待控制驱动单元的设备地址匹配的情况下,将所述当前任务处理请求从所述缓存队列中取出后传输至所述下一待控制驱动单元。
  8. 根据权利要求1-7任一项所述的通用串行总线控制装置,其特征在于,所述通用串行总线设备集线器驱动单元,被设置为:
    接收所述服务器主机发送的第一枚举请求;所述第一枚举请求用于对所述通用串行总线设备集线器驱动单元进行枚举;
    根据所述第一枚举请求,向所述服务器主机返回第二响应信息;
    接收所述服务器主机根据所述第二响应信息,为所述通用串行总线设备集线器驱动单元分配的设备地址;
    将所述设备地址寄存器修改为所述通用串行总线设备集线器驱动单元的设备地址;
    接收所述服务器主机发送的通用串行总线设备驱动单元的状态获取命令;
    响应于所述状态获取命令,根据所述通用串行总线设备集线器驱动单元的设备地址,向所述服务器主机报告各所述通用串行总线设备驱动单元的设备状态;
    接收所述服务器主机根据各所述通用串行总线设备驱动单元的设备状态,为各所述通用串行总线设备驱动单元枚举分配的设备地址,并将各所述通用串行总线设备驱动单元的设备地址传输至各所述通用串行总线设备驱动单元。
  9. 根据权利要求8所述的通用串行总线控制装置,其特征在于,所述通用串行总线设备集线器驱动单元,还被设置为:
    对于当前次端口设备枚举,将所述设备地址寄存器修改为所述通用串行总线设备集线器驱动单元的设备地址;
    接收所述服务器主机发送的当前通用串行总线设备驱动单元的当前状态获取命令;
    响应于所述当前状态获取命令,根据所述通用串行总线设备集线器驱动单元的设备地址,将所述当前通用串行总线设备驱动单元的目标设备状态发送至所述服务器主机;
    对所述设备地址寄存器进行清除,并根据所述目标设备状态,接收所述服务器主机根据所述目标设备状态发送的所述当前通用串行总线设备驱动单元的第二枚举请求;
    将所述当前通用串行总线设备驱动单元根据所述第二枚举请求返回的第三响应信息发送至所述服务器主机;
    将所述服务器主机根据所述第三响应信息为所述当前通用串行总线设备驱动单元分配的设备地址传输至所述当前通用串行总线设备驱动单元;
    返回至将所述设备地址寄存器修改为所述通用串行总线设备集线器驱动单元的设备地址,迭代执行下一次端口设备枚举,直到所有所述通用串行总线设备驱动单元均枚举完成。
  10. 根据权利要求8所述的通用串行总线控制装置,其特征在于,所述第二响应信息包括所述通用串行总线设备集线器驱动单元的设备类型和端口编号;
    所述通用串行总线设备集线器驱动单元的设备地址是由所述服务器主机根据所述通用串行总线设备集线器驱动单元的设备类型和端口编号进行分配的。
  11. 根据权利要求10所述的通用串行总线控制装置,其特征在于,所述第二响应信息还包括各所述通用串行总线设备驱动单元的查询时间间隔;
    所述通用串行总线设备驱动单元的状态获取命令是根据所述查询时间间隔周期性发送的。
  12. 根据权利要求1-7任一项所述的通用串行总线控制装置,其特征在于,对于所述通用串行总线设备集线器驱动单元和多个所述通用串行总线设备驱动单元中的每一驱动单元,所述驱动单元配置有至少一个端口编号;
    所述驱动单元,被设置为:
    在接收所述服务器主机发起的任务处理请求的情况下,根据所述任务处理请求对应的任务类型和数据传输模式,在至少一个所述端口编号中,获取目标端口编号;
    根据所述目标端口编号对应的任务操作模式,对所述任务处理请求进行处理,并将任务处理结果返回至所述服务器主机。
  13. 根据权利要求12所述的通用串行总线控制装置,其特征在于,所述驱动单元的端口编号是根据所述驱动单元的设备类型进行配置的。
  14. 根据权利要求12所述的通用串行总线控制装置,其特征在于,任一驱动单元的输入端的端口编号,与除所述任一驱动单元之外的任一其他驱动单元的输出端口的端口编号相同。
  15. 根据权利要求1-7任一项所述的通用串行总线控制装置,其特征在于,多个所述通用串行总线设备驱动单元包括人机接口驱动单元、网络控制器驱动单元和存储器驱动单元;
    所述人机接口驱动单元被设置为驱动虚拟人机接口设备;
    所述网络控制器驱动单元被设置为驱动虚拟网络设备;
    所述存储器驱动单元被设置为驱动虚拟存储器。
  16. 一种通用串行总线控制系统,其特征在于,包括如权利要求1至15任一项所述通用串行总线控制装置和服务器主机;
    所述通用串行总线控制装置与所述服务器主机之间通信连接。
  17. 一种通用串行总线控制方法,其特征在于,所述方法包括:
    根据通用串行总线设备集线器驱动单元对应的地址切换时间片、各通用串行总线设备驱动单元对应的地址切换时间片,对设备地址寄存器中的设备地址进行切换;
    根据切换后的设备地址和控制端口,控制所述通用串行总线设备集线器驱动单元和各所述通用串行总线设备驱动单元,与服务器主机进行交互;
    其中,所述设备地址寄存器为通用串行总线设备控制器中,所述通用串行总线设备集线器驱动单元和多个所述通用串行总线设备驱动单元之间共享的寄存器,所述控制端口为所述通用串行总线设备控制器中,所述通用串行总线设备集线器驱动单元和多个所述通用串行总线设备驱动单元之间共享的端口。
  18. 根据权利要求17所述的通用串行总线控制方法,其特征在于,所述根据通用串行总线设备集线器驱动单元对应的地址切换时间片、各通用串行总线设备驱动单元对应的地址切换时间片,对设备地址寄存器中的设备地址进行切换,包括:
    对于当前次交互,根据定时器的当前运行状态,判断所述通用串行总线设备集线器驱动单元对应的地址切换时间片、各所述通用串行总线设备驱动单元对应的地址切换时间片是否被触发;
    在所述通用串行总线设备集线器驱动单元和多个所述通用串行总线设备驱动单元中,确定地址切换时间片被触发的当前待控制驱动单元;
    将所述设备地址寄存器中的设备地址切换为所述当前待控制驱动单元的设备地址。
  19. 一种电子设备,包括存储器、处理器及存储在所述存储器上并可在所述处理器上运行的计算机程序,其特征在于,所述处理器执行所述程序时实现如权利要求17至18任一项所述通用串行总线控制方法。
  20. 一种非暂态计算机可读存储介质,其上存储有计算机程序,其特征在于,所述计算机程序被处理器执行时实现如权利要求17至18任一项所述通用串行总线控制方法。
  21. 一种计算机程序产品,包括计算机程序,其特征在于,所述计算机程序被处理器执行时实现如权利要求17至18任一项所述通用串行总线控制方法。
PCT/CN2025/082441 2024-06-28 2025-03-13 通用串行总线控制装置、系统、方法、设备、非暂态计算机可读存储介质及产品 Pending WO2026001088A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202410853004.8A CN118394695B (zh) 2024-06-28 2024-06-28 通用串行总线控制装置、系统、方法、设备、介质及产品
CN202410853004.8 2024-06-28

Publications (1)

Publication Number Publication Date
WO2026001088A1 true WO2026001088A1 (zh) 2026-01-02

Family

ID=92001665

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2025/082441 Pending WO2026001088A1 (zh) 2024-06-28 2025-03-13 通用串行总线控制装置、系统、方法、设备、非暂态计算机可读存储介质及产品

Country Status (2)

Country Link
CN (1) CN118394695B (zh)
WO (1) WO2026001088A1 (zh)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN118394695B (zh) * 2024-06-28 2024-10-01 苏州元脑智能科技有限公司 通用串行总线控制装置、系统、方法、设备、介质及产品
CN119271608A (zh) * 2024-09-30 2025-01-07 苏州元脑智能科技有限公司 硬盘管理系统、丝印信息获取方法、电子设备及存储介质
CN120872877B (zh) * 2025-09-24 2025-12-05 浪潮电子信息产业股份有限公司 管理控制器总线适配方法及电子设备

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1388670A (zh) * 2001-03-30 2003-01-01 株式会社东芝 Usb通信控制装置,usb通信系统及usb通信控制方法
CN101071406A (zh) * 2007-02-06 2007-11-14 南京大学 接口可配置的通用串行总线控制器
CN101308484A (zh) * 2007-05-14 2008-11-19 宏正自动科技股份有限公司 串行总线装置、传输方法以及通用串行总线(usb)装置
CN104035905A (zh) * 2014-07-03 2014-09-10 开曼群岛威睿电通股份有限公司 通用串行总线装置及通用串行总线装置处理数据的方法
CN204595844U (zh) * 2015-01-30 2015-08-26 亚信电子股份有限公司 Usb多电脑切换器
US20190045654A1 (en) * 2017-08-07 2019-02-07 Lenovo Enterprise Solutions (Singapore) Pte. Ltd. Server having a dual-mode serial bus port enabling selective access to a baseboard management controller
CN109522257A (zh) * 2017-09-20 2019-03-26 旺玖科技股份有限公司 通用串行总线集线器
CN118394695A (zh) * 2024-06-28 2024-07-26 苏州元脑智能科技有限公司 通用串行总线控制装置、系统、方法、设备、介质及产品

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6457084B1 (en) * 1998-11-23 2002-09-24 Advanced Micro Devices, Inc. Target side distributor mechanism for connecting multiple functions to a single logical pipe of a computer interconnection bus
CN100354848C (zh) * 2004-09-06 2007-12-12 康奈科技股份有限公司 通用串行总线系统和复合装置及设定复合装置地址的方法
CN100481051C (zh) * 2007-04-24 2009-04-22 杭州华三通信技术有限公司 通用串口总线主机控制器驱动通用适配层实现方法及装置
CN101539897B (zh) * 2008-03-21 2010-10-13 安国国际科技股份有限公司 多计算机切换装置及其运行方法
CN117806900B (zh) * 2023-07-28 2024-05-07 苏州浪潮智能科技有限公司 服务器管理方法、装置、电子设备及存储介质

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1388670A (zh) * 2001-03-30 2003-01-01 株式会社东芝 Usb通信控制装置,usb通信系统及usb通信控制方法
CN101071406A (zh) * 2007-02-06 2007-11-14 南京大学 接口可配置的通用串行总线控制器
CN101308484A (zh) * 2007-05-14 2008-11-19 宏正自动科技股份有限公司 串行总线装置、传输方法以及通用串行总线(usb)装置
CN104035905A (zh) * 2014-07-03 2014-09-10 开曼群岛威睿电通股份有限公司 通用串行总线装置及通用串行总线装置处理数据的方法
CN204595844U (zh) * 2015-01-30 2015-08-26 亚信电子股份有限公司 Usb多电脑切换器
US20190045654A1 (en) * 2017-08-07 2019-02-07 Lenovo Enterprise Solutions (Singapore) Pte. Ltd. Server having a dual-mode serial bus port enabling selective access to a baseboard management controller
CN109522257A (zh) * 2017-09-20 2019-03-26 旺玖科技股份有限公司 通用串行总线集线器
CN118394695A (zh) * 2024-06-28 2024-07-26 苏州元脑智能科技有限公司 通用串行总线控制装置、系统、方法、设备、介质及产品

Also Published As

Publication number Publication date
CN118394695B (zh) 2024-10-01
CN118394695A (zh) 2024-07-26

Similar Documents

Publication Publication Date Title
WO2026001088A1 (zh) 通用串行总线控制装置、系统、方法、设备、非暂态计算机可读存储介质及产品
JP5305848B2 (ja) データ処理システム内で入出力(i/o)仮想化を管理するための方法およびデータ処理システムならびにコンピュータ・プログラム
JP5305866B2 (ja) データ処理システム内で入出力(i/o)仮想化を管理するための方法およびコンピュータ・プログラムならびにデータ処理システム
US8141093B2 (en) Management of an IOV adapter through a virtual intermediary in an IOV management partition
CN104636076B (zh) 一种用于云存储的分布式块设备驱动方法和系统
JP4087072B2 (ja) ストレージシステム及び仮想プライベートボリューム制御方法
CN119917180B (zh) 服务器启动项的启动方法及装置
CN100428164C (zh) 一种虚拟机系统及其设备访问方法
WO2016037503A1 (zh) PCIe拓扑的配置方法和装置
JP2006072591A (ja) 仮想計算機制御方法
CN106445577A (zh) 更新方法、服务器系统以及非瞬态计算机可读取介质
US10782992B2 (en) Hypervisor conversion
EP3627334A1 (en) Extended storage device based on pcie bus
WO2014000299A1 (zh) 串口重定向处理方法、设备和系统
WO2025161452A1 (zh) 代码共享方法、装置、交换机、多主机系统、设备和介质
WO2021077742A1 (zh) 一种业务处理方法、系统、装置及可读存储介质
US11409624B2 (en) Exposing an independent hardware management and monitoring (IHMM) device of a host system to guests thereon
US10127053B2 (en) Hardware device safe mode
CN102622245B (zh) 一种sun4v架构下的虚拟机自动启动控制方法
US20090049227A1 (en) Avoiding failure of an initial program load in a logical partition of a data storage system
WO2025172795A1 (zh) 服务器故障处理方法、系统、电子设备、计算机存储介质和计算机程序产品
JP2007079749A (ja) ストレージ装置およびディスク制御方法
US20100017189A1 (en) Transparent Intellectual Network Storage Device
CN117135189A (zh) 服务器的访问方法及装置、存储介质、电子设备
CN116627472A (zh) 高速外围组件设备的固件程序升级方法及服务器

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 25824483

Country of ref document: EP

Kind code of ref document: A1