Control method and apparatus for universal serial bus port, and product
By obtaining the project number from the server's basic input/output system and generating a port configuration table, and by utilizing the power control signals of the input/output control chip, the problem of traditional USB controllers' inability to accurately control USB ports is solved, thus achieving precise control and flexible management of server USB ports.
Patent Information
- Application Number
- PCT/CN2025/087038
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2024-06-27
- Filing Date
- 2025-04-03
- Publication Date
- 2026-01-02
AI Technical Summary
In servers, traditional methods make it difficult to accurately control multiple USB ports, especially when the processor does not support USB integration. When expanding via PCI-to-USB chips, the USB controller struggles to achieve precise control over the USB ports.
By obtaining the current project number from the server's basic input/output system and determining the target USB port configuration information based on the project number, a port configuration table is generated and loaded after the operating system starts to control multiple USB ports. At the same time, the power control signal of the USB port is connected to the pins of the input/output control chip, and the control strategy is executed by monitoring events to achieve precise control.
It enables precise control of multiple USB ports on a server, and can automatically adjust the enabling status of USB ports according to the current project. It is suitable for servers with different architectures and improves the accuracy and flexibility of USB port control.
Smart Images

Figure CN2025087038_02012026_PF_FP_ABST
Abstract
Description
A control method, device and product of a universal serial bus port
[0001] Cross-reference to Related Applications
[0002] The present application claims priority from the Chinese patent application No. 202410850515.4 filed on June 27, 2024, and entitled "A control method, device and product of a universal serial bus port", the content of which is incorporated herein by reference in its entirety. TECHNICAL FIELD
[0003] Embodiments of the present application relate to the technical field of servers, in particular, to a control method, device and product of a universal serial bus port. BACKGROUND
[0004] USB (Universal Serial Bus) is a computer hardware interface standard used to realize data transmission and communication between different devices. For example, USB can realize data transmission between a computer and other devices such as a keyboard, a mouse, a printer, a camera, a USB hard disk, a U disk, etc. The emergence of USB greatly improves the expandability and convenience of computers, allowing users to easily connect and use various external devices.
[0005] USB interfaces need to be integrated in the core components of USB devices. Without hardware link support for USB ports, USB devices cannot be used. In servers, USB interfaces are a basic peripheral interface that must exist. However, some processors do not support USB integration, such as some processors that only support PCI (Peripheral Component Interconnect) protocol and memory controller without USB protocol. In this case, a PCI-to-USB chip is needed for physical expansion to enable a server product using the current processor to support USB port functions.
[0006] However, in actual application, when multiple processors are used, the number of USB ports increases exponentially, and not all ports need to be used. Therefore, USB ports need to be controlled. However, the traditional way is to close the USB controller, but the USB controller controls multiple USB ports, making it difficult to accurately control the USB ports. SUMMARY
[0007] Embodiments of the present application provide a control method, device and product of a universal serial bus port, aiming to accurately control the universal serial bus port.
[0008] The first aspect provides a universal serial bus port control method, which is applied to a basic input / output system in a server, the server comprising a plurality of universal serial bus ports, and the method comprising:
[0009] After the server is powered on, a first control strategy is executed, the first control strategy comprising:
[0010] The basic input / output system acquires a current project number of the server in a driver execution environment stage;
[0011] According to the current project number, target universal serial bus port configuration information corresponding to the current project number is determined, and a port configuration table corresponding to the current project number is generated according to the target universal serial bus port configuration information;
[0012] A default port configuration table in the basic input / output system is unloaded, and the port configuration table corresponding to the current project number is loaded, and when an operating system of the server is started, the operating system calls the port configuration table corresponding to the current project number to control the plurality of universal serial bus ports.
[0013] In some embodiments of the present application, the current project number of the server is acquired by:
[0014] A state value of one or more target universal input / output interfaces is acquired;
[0015] In a preset project number configuration table, the current project number of the server is found according to the state value of the one or more target universal input / output interfaces;
[0016] The project number configuration table comprises a plurality of project numbers each corresponding to a state value of one or more target universal input / output interfaces.
[0017] In some embodiments of the present application, the current project number of the server is acquired by:
[0018] Part number information in information of a field replaceable unit is acquired;
[0019] According to a value of the part number information, the current project number of the server is determined;
[0020] The value of the part number information and the project number are in one-to-one correspondence.
[0021] In some embodiments of the present application, the method further comprises:
[0022] In response to a first configuration operation, a region block is created in the basic input / output system;
[0023] In response to a second configuration operation, universal serial bus port configuration information corresponding to a plurality of project numbers is acquired;
[0024] According to the universal serial bus port configuration information corresponding to each of the project numbers, a project number port configuration table is created and stored in the region block.
[0025] In some embodiments of the present application, the target universal serial bus port configuration information corresponding to the current project number is determined according to the current project number, including:
[0026] According to the current project number, the basic input / output system searches for the target universal serial bus port configuration information corresponding to the current project number in the project number port configuration table stored in the region block of the basic input / output system.
[0027] In some embodiments of the present application, the port configuration table corresponding to the current project number is generated according to the target universal serial bus port configuration information, including:
[0028] According to the target universal serial bus port configuration information, the configuration information corresponding to each of the universal serial bus ports in the first port configuration mode and the second port configuration mode is set in the default port configuration table in the basic input / output system, and the port configuration table corresponding to the current project number is generated.
[0029] In some embodiments of the present application, the configuration information corresponding to each of the universal serial bus ports in the first port configuration mode is set in the default port configuration table in the basic input / output system, including:
[0030] In the first port configuration mode of the default port configuration table, a first variable is set according to whether any universal serial bus port is the target port corresponding to the current project number.
[0031] According to the universal serial bus protocol type supported by any universal serial bus port, a second variable is set.
[0032] In some embodiments of the present application, the configuration information corresponding to each of the universal serial bus ports in the second port configuration mode is set in the default port configuration table in the basic input / output system, including:
[0033] In the second port configuration mode of the default port configuration table, a third variable is set according to whether any universal serial bus port is the target port corresponding to the current project number, and the third variable is used to represent whether any universal serial bus port is visible.
[0034] According to the universal serial bus protocol type supported by any universal serial bus port, a fourth variable is set, and the fourth variable is used to describe the universal serial bus device group to which any universal serial bus port belongs.
[0035] In some embodiments of the present application, an input-output control chip is arranged in the server, and each pin of the input-output control chip is connected to a power control signal of a universal serial bus port. The method further comprises:
[0036] When the target event is monitored, the second control strategy is executed.
[0037] The second control strategy comprises:
[0038] In response to a selection operation of a user on a universal serial bus port configuration option of a basic input-output system interface, control information of any universal serial bus port is obtained.
[0039] According to the control information of any universal serial bus port, the output state of a pin of the input-output control chip connected to the universal serial bus port is controlled, so as to control the power control signal of the universal serial bus port.
[0040] In some embodiments of the present application, according to the control information of any universal serial bus port, the output state of a pin of the input-output control chip connected to the universal serial bus port is controlled, comprising:
[0041] When the control information of any universal serial bus port is enabled, the output state of a pin of the input-output control chip connected to the universal serial bus port is high level.
[0042] When the control information of any universal serial bus port is closed, the output state of a pin of the input-output control chip connected to the universal serial bus port is low level.
[0043] In some embodiments of the present application, when the target event is monitored, the second control strategy is executed, comprising:
[0044] When it is monitored that the basic input-output system does not obtain the current project number of the server within a first preset time period, the second control strategy is executed.
[0045] In some embodiments of the present application, when the target event is monitored, the second control strategy is executed, comprising:
[0046] When it is monitored that the basic input-output system does not generate a port configuration table corresponding to the current project number within a second preset time period, the second control strategy is executed.
[0047] In some embodiments of the present application, when the target event is monitored, the second control strategy is executed, comprising:
[0048] When it is monitored that the user performs a selection operation on a universal serial bus port configuration option of a basic input-output system interface, the second control strategy is executed.
[0049] In some embodiments of the present application, when the target event is monitored, the second control strategy is executed, including:
[0050] When the selection operation of the user on the basic input output system interface for the universal serial bus port configuration strategy is monitored, it is determined to execute the first control strategy or the second control strategy.
[0051] In a second aspect, the embodiments of the present application provide a control device of a universal serial bus port, which is applied to a basic input output system in a server, the server including a plurality of universal serial bus ports, and the device including:
[0052] A first control strategy execution module, configured to execute the first control strategy after the server is powered on, the first control strategy including:
[0053] The basic input output system acquires the current project number of the server in the driver execution environment stage;
[0054] According to the current project number, the target universal serial bus port configuration information corresponding to the current project number is determined, and the port configuration table corresponding to the current project number is generated according to the target universal serial bus port configuration information;
[0055] The default port configuration table in the basic input output system is unloaded, and the port configuration table corresponding to the current project number is loaded, and when the operating system of the server is started, the operating system calls the port configuration table corresponding to the current project number to control the plurality of universal serial bus ports.
[0056] In a third aspect, the embodiments of the present application provide a server, the server including a basic input output system and a plurality of universal serial bus ports, and the server being configured to execute the control method of the universal serial bus port of the first aspect.
[0057] In a fourth aspect, the embodiments of the present application provide a server, the server including a basic input output system and a plurality of universal serial bus ports, and an input output control chip being arranged in the server, each pin of the input output control chip being connected to a power control signal of one universal serial bus port, and the server being configured to execute the control method of the universal serial bus port of the first aspect.
[0058] In a fifth aspect, the embodiments of the present application provide a computer device, including at least one processor and a memory, the memory storing a computer program capable of running on the processor, and when the processor executes the computer program, the control method of the universal serial bus port of the first aspect is executed.
[0059] In a sixth aspect, an embodiment of the present application provides a non-volatile readable storage medium, the non-volatile readable storage medium storing a computer program, wherein the computer program is executed by a processor to implement the control method of the universal serial bus port in the first aspect of the embodiment.
[0060] In a seventh aspect, an embodiment of the present application provides a computer program product, including computer programs / instructions, which are executed by a processor to implement the control method of the universal serial bus port in the first aspect of the embodiment. Advantages:
[0061] After the server is powered on, the first control strategy is executed, and the first control strategy includes: obtaining, by a basic input output system, a current project number of the server in a driver execution environment stage; determining target universal serial bus port configuration information corresponding to the current project number according to the current project number, and generating a port configuration table corresponding to the current project number according to the target universal serial bus port configuration information; uninstalling a default port configuration table in the basic input output system, and loading the port configuration table corresponding to the current project number, and when an operating system of the server is started, the operating system calls the port configuration table corresponding to the current project number to control the plurality of universal serial bus ports.
[0062] The basic input output system obtains the current project number of the server in the driver execution environment stage, that is, in the DXE stage of the BIOS, determines the target universal serial bus port configuration information corresponding to the current project number according to the current project number, generates the port configuration table corresponding to the current project number according to the target universal serial bus port configuration information, and loads the port configuration table corresponding to the current project number, so that when the operating system (OS) of the server is started, the port configuration table corresponding to the current project number is called, thereby achieving the control of the plurality of universal serial bus ports, and having the effect of automatically controlling the USB port according to the current project. BRIEF DESCRIPTION OF DRAWINGS
[0063] In order to more clearly illustrate the technical solutions of the embodiments of the present application or the prior art, the drawings needed in the embodiment or prior art description will be briefly introduced.
[0064] FIG. 1 shows a step flowchart of the first control strategy provided by an embodiment of the present application;
[0065] FIG. 2 shows a swim lane diagram of the first control strategy provided by an embodiment of the present application;
[0066] FIG. 3 shows a step flowchart of the second control strategy provided by an embodiment of the present application;
[0067] FIG. 4 shows a swim lane diagram of the second control strategy provided by an embodiment of the present application;
[0068] Figure 5 shows a functional module diagram of the control device of the universal serial bus port according to an embodiment of the present application;
[0069] Figure 6 shows a schematic diagram of a server according to an embodiment of the present application;
[0070] Figure 7 shows a schematic diagram of a server according to an embodiment of the present application;
[0071] Figure 8 shows a schematic diagram of a computer device according to an embodiment of the present application;
[0072] Figure 9 shows a schematic diagram of a non-volatile readable storage medium according to an embodiment of the present application;
[0073] Figure 10 shows a schematic diagram of a computer program product according to an embodiment of the present application. DETAILED DESCRIPTION
[0074] The technical solutions in the embodiments of the present application will be described below with reference to the drawings.
[0075] To make the objectives, technical solutions, and advantages of the embodiments of the present application clearer, the embodiments of the present application will be described in detail below with reference to the drawings. However, those skilled in the art can understand that, in the embodiments of the present application, many technical details are presented in order to make the readers better understand the present application. However, the technical solutions claimed by the present application can be implemented even without these technical details and based on various changes and modifications of the following embodiments. The division of the following embodiments is for the convenience of description, and should not constitute any limitation on the specific implementation of the present application. The embodiments can be combined and referenced with each other on the premise of no contradiction.
[0076] BIOS: Basic Input Output System, basic input output system
[0077] OS: Operating System, operating system
[0078] BMC: Baseboard Management Controller, baseboard management controller
[0079] PCI: Peripheral Component Interconnect, the abbreviation of peripheral component interconnect standard
[0080] USB: Universal Serial Bus, universal serial bus
[0081] ACPI: Advanced Configuration and Power Management Interface, high-level configuration and power management interface
[0082] PCH: Platform Controller Hub, platform control hub
[0083] GPIO: General Purpose Input / Output, general-purpose input / output
[0084] DXE: Driver Execution Environment, driver execution environment stage, which performs most of the system initialization work, when entering this stage, the memory can be fully used, so this stage can perform a lot of complex work
[0085] FRU: Field Replace Unit, field replaceable unit
[0086] PPN: production part number, production part number
[0087] I2C: Inter-Integrated Circuit, Inter-Integrated Circuit bus, a kind of serial communication bus
[0088] IPMI: Intelligent Platform Management Interface, an industrial standard adopted by Intel architecture enterprise systems peripheral devices, which can cross different operating systems, firmware and hardware platforms.
[0089] USB is a kind of computer hardware interface standard, which is used to realize data transmission and communication between different devices, for example, USB can realize data transmission between computer and other devices, such as keyboard, mouse, printer, camera, USB hard disk and U disk, etc. The emergence of USB greatly improves the expansibility and convenience of computer, so that users can easily connect and use various external devices.
[0090] USB devices are divided into two types: Host (master device) and Device (peripheral device), Host device is responsible for controlling and transmitting data, while Device device is responsible for sending or receiving data to Host, USB devices are widely used in various electronic products, such as notebook computers, servers, mobile phones, cameras, etc.
[0091] The USB interface needs to be integrated in the core components of the USB device. If there is no hardware link to support the USB port, the USB device cannot be used. In a server, the USB interface is a basic peripheral interface that must exist. However, some processors do not support USB integration, such as some processors that only support the PCI protocol and the memory controller without the USB protocol. At this time, a PCI-to-USB chip needs to be used for physical expansion to enable the server product using the current processor to support the function of the USB port.
[0092] For example, the early Intel processor integrates the USB link on the PCH chip, and the processor chip does not have the function of integrating the USB port. The USB controller on the PCH directly controls the setting of the specific USB port, such as the function of turning on or off. If other architecture processors do not have the USB link port, the USB port is expanded through the PCI-to-USB chip. According to the data manual of the PCI-to-USB chip, the register of the USB interface is enabled or disabled to control the USB port.
[0093] However, in the actual application process, when multiple processors are used, the number of USB ports increases exponentially, and not all ports need to be used. Therefore, the USB ports need to be controlled. However, the traditional method is to turn off the USB controller, but the USB controller controls multiple USB ports, and it is difficult to accurately control the USB ports.
[0094] Therefore, in order to accurately control the use of each USB port, the embodiment of the present application provides a universal serial bus port control method.
[0095] The universal serial bus port control method provided by the embodiment of the present application is applied to a basic input and output system in a server. The server includes a plurality of universal serial bus ports. The method includes executing a first control strategy after the server is powered on and started.
[0096] Referring to FIG. 1, a step flowchart of the first control strategy provided by the embodiment of the present application is shown. The first control strategy includes the following steps:
[0097] S11: The basic input and output system obtains the current project number of the server in the driver execution environment stage.
[0098] In the actual implementation process, a server has different usage modes according to different application projects, including the usage mode of the universal serial bus port, that is, the USB port in the server. The number and position of the ports corresponding to different projects are also different. In the actual implementation process, each USB port can be labeled according to the position.
[0099] For example, project 1 can use 4 USB ports: USB port 1, USB port 2, USB port 3 and USB port 4; project 2 can use 4 USB ports: USB port 1, USB port 2, USB port 6 and USB port 8; project 3 can use 8 USB ports: USB port 1, USB port 2, USB port 6 and USB port 8.
[0100] In the basic input output system (BIOS), the driver execution environment stage refers to the next DXE stage after the PEI stage, which is used to implement the establishment of the driver environment, and the current project number of the server is obtained in the DXE stage of the BIOS.
[0101] In an available embodiment, obtaining the current project number of the server comprises:
[0102] Obtaining a state value of one or more target general input output interfaces; and searching for the current project number of the server according to the state value of the one or more target general input output interfaces in a preset project number configuration table.
[0103] The project number configuration table contains the state value of one or more target general input output interfaces corresponding to each project number.
[0104] The project number configuration table can be stored in the BIOS in advance, and the project number configuration table contains the state value of one or more target general input output interfaces corresponding to each project number. In the actual implementation process, the number of target general input output interfaces of the project number can be customized according to the actual application requirements. For example, it is assumed that the project number of the server can be determined by the combination of the state values of 3 GPIO interfaces: GPIO0, GPIO01 and GPIO02, and the project number configuration table can be as shown in Table 1.
[0105] Table 1 Project number configuration table
[0106] In the DXE stage of the BIOS, the BIOS obtains the state values of GPIO0, GPIO01 and GPIO02, and the project number of the server can be determined according to the combination of the state values of GPIO0, GPIO01 and GPIO02. For example, the combination of the state values of GPIO0, GPIO01 and GPIO02 is 011, and the current project number corresponding to 011 in the project number configuration table is project 4.
[0107] In another available embodiment, when obtaining the current project number of the server, the BIOS can obtain part number information in the information of the field replaceable unit; determine the current project number of the server according to the value of the part number information; and the value of the part number information and the project number are one-to-one corresponding.
[0108] Specifically, the part number information (PPN information) in the field replaceable unit (FRU) information can be updated by the BMC in the server, and a corresponding relationship between the PPN information and the project number can be established. For example, the corresponding relationship between the PPN information and the project number can be: PPN=1 corresponds to project 1, PPN=2 corresponds to project 2, and PPN=N corresponds to project N.
[0109] In the DXE stage of the BIOS, the BIOS acquires the PPN information in the FRU information through the IPMI protocol, and according to the value of the PPN information, the current project number can be determined. For example, if PPN=1 is read, the current project number is project 1.
[0110] In other embodiments, other ways can also be used to acquire the current project number of the server. For example, an option for setting the current project number can be provided on the interface of the BIOS, and the current project number of the server can be determined in response to a selection operation of a user on the option for setting the current project number on the interface of the BIOS.
[0111] S12: According to the current project number, determine the target universal serial bus port configuration information corresponding to the current project number.
[0112] In a feasible embodiment, a region block can be created in the BIOS in advance, and then a project number port configuration table can be stored in the region block. The project number port configuration table stores the USB port configuration information corresponding to each project number.
[0113] Specifically, in response to a first configuration operation, a region block is created in the BIOS; in response to a second configuration operation, the USB port configuration information corresponding to each project number is acquired; according to the USB port configuration information corresponding to each project number, a project number port configuration table is created, and the project number port configuration table is stored in the region block.
[0114] Then, when determining the target USB port configuration information corresponding to the current project number according to the current project number, the target USB port configuration information corresponding to the current project number is searched for in the project number port configuration table stored in the region block of the BIOS according to the current project number.
[0115] For example, the USB port configuration information corresponding to each project number included in the project number port configuration table can only include the number of enabled USB ports, and the project number port configuration table is shown in Table 2.
[0116] Table 2 Project number port configuration table
[0117] For example, the USB port configuration information corresponding to each item number in the item number port configuration table can also include the number of enabled USB ports and the USB port position and the USB port position. The item number port configuration table is shown in Table 3.
[0118] Table 3 Item number port configuration table
[0119] When the USB port configuration information only includes the number of enabled USB ports, the BIOS can configure the corresponding number of USB ports to be in the enabled state according to the number of USB ports required by the item number. When the USB port configuration information includes the number of enabled USB ports and the USB port position and the USB port position, the corresponding USB port is set to the enabled state according to the USB port position.
[0120] S13: Generate a port configuration table corresponding to the current item number according to the target universal serial bus port configuration information.
[0121] Specifically, according to the target USB port configuration information, set the configuration information corresponding to each of the plurality of USB ports in the first port configuration mode and the second port configuration mode in the default port configuration table in the BIOS, and generate a port configuration table corresponding to the current item number. Specifically, the port configuration table can be an ACPI table, and the ACPI table is used to manage the configuration of all USB ports of the server.
[0122] The USB port setting includes a first port configuration mode, such as a UPC mode, and a second port configuration mode, such as a PLD mode. The UPC mode includes two variables: a first variable and a second variable. The first variable is used to define whether the USB port is connected, and the second variable is used to define the supported USB device type.
[0123] In the process of setting the configuration information corresponding to each of the plurality of USB ports in the UPC mode in the default ACPI table in the BIOS, in the UPC mode of the default ACPI table, set the first variable according to whether any USB port is the target port corresponding to the current item number, and set the second variable according to the universal serial bus protocol, i.e., the USB protocol type, supported by any USB port.
[0124] For example, when any USB port is the target port corresponding to the current item number, the value of the first variable is set to 0xFF, indicating that the USB port is connected and can be used, i.e., the USB port is configured to be in the enabled state. When any USB port is not the target port corresponding to the current item number, the value of the first variable is set to 0x00, indicating that the USB port is not connected, i.e., cannot be used, i.e., the USB port is configured to be in the closed state.
[0125] When any one of the USB ports only supports USB 2.0 devices, the value of the second variable is set to 0x00; when any one of the USB ports only supports USB 3.0 devices, the value of the second variable is set to 0x03.
[0126] Two variables are also included in the PLD mode: a third variable and a fourth variable, the third variable is used to define whether the USB port device is visible, and the fourth variable is used to define the universal serial bus device group to which the device connected by the port belongs.
[0127] In the process of setting the plurality of USB ports in the default ACPI table in the BIOS to the respective configuration information corresponding to the PLD mode respectively, in the PLD mode of the default ACPI table, the third variable is set according to whether any one of the USB ports is the target port corresponding to the current item number, and the fourth variable is set according to the universal serial bus protocol type supported by any one of the USB ports.
[0128] For example, when any one of the USB ports is the target port corresponding to the current item number, the value of the third variable is set to 0x01, indicating that the USB port is visible, i.e., can be recognized; when any one of the USB ports is not the target port corresponding to the current item number, the value of the third variable is set to 0x00, indicating that the USB port is not visible, i.e., cannot be recognized.
[0129] In actual implementation, the first variable and the third variable have a corresponding relationship, specifically, after the value of the first variable is set in the UPC mode, in the PLD mode, the value of the third variable can be determined according to the value of the first variable; that is, when the value of the first variable is 0xFF, indicating that the USB port has been connected and can be used, the value of the third variable is 0x01, indicating that the USB port is visible; when the value of the first variable is 0x00, indicating that the USB port has not been connected, i.e., cannot be used, the value of the third variable is 0x00, indicating that the USB port is not visible.
[0130] When the USB protocol type supported by any one of the USB ports is USB 2.0, the value of the fourth variable is set to 0x00, indicating that the universal serial bus device group to which the device connected by the USB port belongs is the USB 2.0 group; when the USB protocol type supported by any one of the USB ports is USB 3.0, the value of the fourth variable is set to 0x01, indicating that the universal serial bus device group to which the device connected by the USB port belongs is the USB 3.0 group.
[0131] In actual implementation, the second variable and the fourth variable have a corresponding relationship, specifically, after the value of the second variable is set in the UPC mode, in the PLD mode, the value of the fourth variable can be determined according to the value of the second variable.
[0132] For example, when any USB port only supports a USB 2.0 device, the value of the second variable is set as 0x00, and the value of the fourth variable is 0x00, indicating that the USB port connected device belongs to the USB 2.0 group; when any USB port only supports a USB 3.0 device, the value of the second variable is set as 0x03, and the value of the fourth variable is 0x01, indicating that the USB port connected device belongs to the USB 3.0 group.
[0133] The plurality of USB ports are respectively set with corresponding configuration information in the default ACPI table in the BIOS in the UPC mode and the PLD mode, so as to generate the ACPI table corresponding to the current project number as the port configuration table.
[0134] S14: uninstall the default port configuration table in the basic input and output system, and load the port configuration table corresponding to the current project number, so that the operating system of the server can control the plurality of universal serial bus ports after the operating system is started.
[0135] The default port configuration table loaded in the BIOS is uninstalled, and then the port configuration table corresponding to the current project number is loaded, so that the operating system (OS) can automatically call the port configuration table corresponding to the current project number, and then control the plurality of USB ports according to the port configuration table corresponding to the current project number, thereby realizing accurate control of the plurality of USB ports.
[0136] Referring to FIG. 2, a swim lane diagram of the first control strategy provided by the embodiment of the application is shown. In the first control strategy, after the server is powered on, the basic input and output system (BIOS) obtains the current project number in the driver execution environment stage, and then the BIOS determines the target universal serial bus port configuration information corresponding to the current project number according to the current project number.
[0137] Then, in the default port configuration table (default ACPI table) of the BIOS, the configuration information corresponding to any USB port in the first port configuration mode is set, and the first variable is set according to whether any port is the target port corresponding to the current project number, and then the second variable is set according to the universal serial bus protocol (USB protocol type) supported by any port.
[0138] Specifically, when any one of the USB ports is the target port corresponding to the current item number, the value of the first variable is 0xFF, indicating that the USB port is connected and available; when any one of the USB ports is not the target port corresponding to the current item number, the value of the first variable is 0x00, indicating that the USB port is not connected and unavailable; when any one of the USB ports only supports a USB 2.0 device, the value of the second variable is 0x00; when any one of the USB ports only supports a USB 3.0 device, the value of the second variable is 0x03.
[0139] In the default port configuration table of the BIOS, configuration information corresponding to any USB port in the second port configuration mode is set, and a third variable is set according to whether any port is the target port corresponding to the current item number; a fourth variable is set according to the type of the universal serial bus protocol supported by any port.
[0140] Specifically, when any one of the USB ports is the target port corresponding to the current item number, the value of the third variable is 0x01, indicating that the USB port is visible; when any one of the USB ports is not the target port corresponding to the current item number, the value of the third variable is 0x00, indicating that the USB port is invisible; when the USB protocol type supported by any USB port is USB 2.0, the value of the fourth variable is 0x00, indicating that the universal serial bus device group to which the device connected by the USB port belongs is the USB 2.0 group; when the USB protocol type supported by any USB port is USB 3.0, the value of the fourth variable is 0x01, indicating that the universal serial bus device group to which the device connected by the USB port belongs is the USB 3.0 group; and the first variable and the third variable have a corresponding relationship, and the second variable and the fourth variable have a corresponding relationship.
[0141] Finally, the BIOS unloads the default port configuration table and loads the port configuration table corresponding to the current item number.
[0142] In addition to the precise control of the plurality of USB ports in the server through the first control strategy, an input-output control chip, i.e., a GPIO control chip, can also be set in the server, each pin of the GPIO control chip is connected to a power control signal of a USB port, and then the second control strategy is executed when a target event is monitored.
[0143] Referring to FIG. 3, a step flowchart of the second control strategy provided by the embodiment of the application is shown, and the second control strategy includes the following steps:
[0144] S21: In response to a selection operation of a user on a universal serial bus port configuration option in a basic input-output system interface, control information of any universal serial bus port is obtained.
[0145] The USB port configuration option is added on the interface of the BIOS, and the user can configure the control information of any USB port on the USB port configuration option on the interface of the BIOS, so as to determine the enabled state or closed state of the USB port.
[0146] S22: According to the control information of any universal serial bus port, the output state of the pin connected to the universal serial bus port on the input and output control chip is controlled to control the power control signal of the universal serial bus port.
[0147] Specifically, when the control information of any USB port is enabled, the output state of the pin connected to the USB port on the GPIO control chip is high; when the control information of any USB port is closed, the output state of the pin connected to the USB port on the GPIO control chip is low.
[0148] Specifically, the BIOS can control the output state of any pin of the GPIO control chip based on the I2C protocol, when the BIOS controls the output state of the pin connected to the USB port on the GPIO control chip to be high, the power control signal of the USB port is powered, when the BIOS controls the output state of the pin connected to the USB port on the GPIO control chip to be low, the power control signal of the USB port is not powered, after the BIOS sets up each pin connected to the USB port on the GPIO control chip, the BIOS enables the output state of the pin of the GPIO through I2C and starts normally, thereby completing the accurate control of each USB port.
[0149] In a possible implementation, the target event can be whether the BIOS acquires the current project number of the server within a first preset time period, when it is monitored that the BIOS does not acquire the current project number of the server within the first preset time period, the second control strategy is executed; when it is monitored that the BIOS acquires the current project number of the server within the first preset time period, the first control strategy can be executed.
[0150] In a possible implementation, the target event can also be whether the BIOS generates the port configuration table corresponding to the current project number within a second preset time period, when it is monitored that the BIOS does not generate the port configuration table corresponding to the current project number within the second preset time period, the second control strategy is executed; when it is monitored that the BIOS generates the port configuration table corresponding to the current project number within the second preset time period, the first control strategy can be continued to be executed.
[0151] The time length of the second preset time period is greater than the time length of the first preset time period.
[0152] In an implementable embodiment, the target event can also be monitoring whether the user operates the USB port configuration option on the BIOS interface, when it is monitored that the user selects the USB port configuration option on the BIOS interface, the second control strategy is executed; when it is not monitored that the user selects the USB port configuration option on the BIOS interface, the second control strategy is continuously executed.
[0153] In addition, the user can also autonomously select to adopt the first control strategy or the second control strategy to accurately control the plurality of USB ports, specifically, when it is monitored that the user selects the USB port configuration strategy on the BIOS interface, it is determined to execute the first control strategy or the second control strategy.
[0154] Referring to FIG. 4, a swim lane diagram of the second control strategy provided by the embodiments of the present application is shown. After the server is powered on, the basic input output system acquires the control information of any universal serial bus port in response to the selection operation of the user on the universal serial bus port configuration option of the basic input output system interface; it is judged whether the control information of any universal serial bus port is enabled; when the control information of any universal serial bus port is not enabled, the output state of the pin connected to the universal serial bus port on the input output control chip is controlled to be high; when the control information of any universal serial bus port is closed, the output state of the pin connected to the universal serial bus port on the input output control chip is controlled to be low; it is judged whether the control information of all universal serial bus ports is executed, when not all control information of the universal serial bus ports is executed, the control information of the next universal serial bus port is continuously judged; after all control information of the universal serial bus ports is executed, the basic input output system enables the output state of the pin of the input output control chip through I2C and normally starts; the basic input output system continues to start.
[0155] The method adopts two USB control strategies to accurately control the USB port, one is that the BIOS determines the target USB port configuration information required by the current project number according to the obtained current project number, sets the first port configuration mode and the second port configuration mode of any USB port in the default port configuration table, including setting whether any port is connected, support type, whether visible, and USB device grouping and other information, and the BIOS controls the USB port by unloading the default port configuration table and loading the port configuration table corresponding to the current project number; the other is to introduce a GPIO control chip in the hardware, physically link the GPIO control chip pin and the power supply signal of the USB port, and add USB port configuration options on the interface of the BIOS, and enable or close the control information set by the BIOS, set the output state of the GPIO control chip to high or low level through the I2C protocol, and high level represents that the USB port is enabled, and low represents that the USB port is closed, so as to realize the control opening and closing function of the specific USB port. The method can not only accurately control the enablement or closing of the USB port, but also can be applied to any architecture server, and has high applicability.
[0156] Referring to FIG. 5, a universal serial bus port control device function module diagram provided by an embodiment of the application is shown, which is applied to a basic input and output system in a server, the server includes a plurality of universal serial bus ports, and the device includes:
[0157] A first control strategy execution module 100 is configured to execute a first control strategy after the server is powered on, and the first control strategy includes:
[0158] The basic input and output system obtains a current project number of the server in a driver execution environment stage;
[0159] According to the current project number, target universal serial bus port configuration information corresponding to the current project number is determined, and a port configuration table corresponding to the current project number is generated according to the target universal serial bus port configuration information;
[0160] The default port configuration table in the basic input and output system is unloaded, and the port configuration table corresponding to the current project number is loaded, and when the operating system of the server is started, the operating system calls the port configuration table corresponding to the current project number to control the plurality of universal serial bus ports.
[0161] In some embodiments of the application, the first control strategy execution module includes a first project number acquisition unit, configured to:
[0162] Obtain the state value of one or more target universal input and output interfaces;
[0163] In the preset project number configuration table, according to the state value of one or more target general input / output interfaces, the current project number of the server is found;
[0164] The project number configuration table contains the state value of one or more target general input / output interfaces corresponding to each of the plurality of project numbers.
[0165] In some embodiments of the present application, the first control strategy execution module includes a second project number acquisition unit, configured to:
[0166] Obtain the part number information in the information of the field replaceable unit;
[0167] According to the value of the part number information, the current project number of the server is determined;
[0168] The value of the part number information and the project number are one-to-one corresponding.
[0169] In some embodiments of the present application, the first control strategy execution module includes a project number port configuration table configuration unit, configured to:
[0170] In response to the first configuration operation, a region block is created in the basic input / output system;
[0171] In response to the second configuration operation, the general serial bus port configuration information corresponding to each of the plurality of project numbers is obtained;
[0172] According to the general serial bus port configuration information corresponding to each of the plurality of project numbers, a project number port configuration table is created, and the project number port configuration table is stored in the region block.
[0173] In some embodiments of the present application, the first control strategy execution module includes a target general serial bus port configuration information determination unit, configured to:
[0174] According to the current project number, the target general serial bus port configuration information corresponding to the current project number is found in the project number port configuration table stored in the region block of the basic input / output system.
[0175] In some embodiments of the present application, the first control strategy execution module includes a port configuration table generation unit, configured to:
[0176] According to the target general serial bus port configuration information, the configuration information corresponding to each of the plurality of general serial bus ports in the first port configuration mode and the second port configuration mode is set in the default port configuration table in the basic input / output system, and the port configuration table corresponding to the current project number is generated.
[0177] In some embodiments of the present application, the port configuration table generation unit includes a first port configuration mode configuration unit, configured to:
[0178] In the first port configuration mode of the default port configuration table, a first variable is set according to whether any universal serial bus port is a target port corresponding to a current item number;
[0179] A second variable is set according to a universal serial bus protocol type supported by any universal serial bus port.
[0180] In some embodiments of the present application, the port configuration table generation unit comprises a second port configuration mode configuration unit, configured to:
[0181] In the second port configuration mode of the default port configuration table, a third variable is set according to whether any universal serial bus port is a target port corresponding to a current item number, the third variable being used to represent whether any universal serial bus port is visible;
[0182] A fourth variable is set according to a universal serial bus protocol type supported by any universal serial bus port, the fourth variable being used to describe a universal serial bus device group to which any universal serial bus port belongs.
[0183] In some embodiments of the present application, an input-output control chip is arranged in the server, each pin of the input-output control chip being connected to a power control signal of a universal serial bus port, and the device further comprises a second control strategy execution module, configured to:
[0184] When a target event is monitored, the second control strategy is executed;
[0185] The second control strategy comprises:
[0186] In response to a selection operation of a user on a universal serial bus port configuration option of a basic input-output system interface, control information of any universal serial bus port is acquired;
[0187] According to the control information of any universal serial bus port, an output state of a pin of the input-output control chip connected to the universal serial bus port is controlled, so as to control a power control signal of the universal serial bus port.
[0188] In some embodiments of the present application, the second control strategy execution module comprises a control unit, configured to:
[0189] When the control information of any universal serial bus port is enabled, the output state of the pin of the input-output control chip connected to the universal serial bus port is a high level;
[0190] When the control information of any universal serial bus port is closed, the output state of the pin of the input-output control chip connected to the universal serial bus port is a low level.
[0191] In some embodiments of the present application, the second control strategy execution module comprises a first monitoring unit, configured to:
[0192] When it is monitored that the basic input / output system does not obtain the current project number of the server within the first preset time period, the second control strategy is executed.
[0193] In some embodiments of the present application, the second control strategy execution module comprises a second monitoring unit, configured to:
[0194] When it is monitored that the basic input / output system does not generate the port configuration table corresponding to the current project number within the second preset time period, the second control strategy is executed.
[0195] In some embodiments of the present application, the second control strategy execution module comprises a third monitoring unit, configured to:
[0196] When it is monitored that the user performs a selection operation on the universal serial bus port configuration option on the basic input / output system interface, the second control strategy is executed.
[0197] In some embodiments of the present application, the second control strategy execution module comprises a fourth monitoring unit, configured to:
[0198] When it is monitored that the user performs a selection operation on the universal serial bus port configuration strategy on the basic input / output system interface, it is determined to execute the first control strategy or the second control strategy.
[0199] Referring to FIG. 6, a schematic diagram of a server according to an embodiment of the present application is shown. The server comprises a basic input / output system and a plurality of universal serial bus ports. The server comprises a plurality of central processing units, such as central processing unit 0 and central processing unit 1. Each central processing unit is connected to a plurality of universal serial bus ports. For example, central processing unit 0 is connected to universal serial bus port 0 to universal serial bus port m, and central processing unit 1 is connected to universal serial bus port l to universal serial bus port n. The server is configured to execute the first control strategy of the universal serial bus port control method according to the embodiment.
[0200] Referring to FIG. 7, a schematic diagram of a server according to an embodiment of the present application is shown. The server comprises a basic input / output system and a plurality of universal serial bus ports. The server further comprises an input / output control chip. Each pin of the input / output control chip is connected to a power control signal of a universal serial bus port. The basic input / output system accesses the input / output control chip based on the I2C protocol. The server is configured to execute the universal serial bus port control method according to the embodiment, including executing the first control strategy and / or the second control strategy.
[0201] With reference to FIG. 8, a schematic diagram of a computer device is shown, which includes at least one processor 801 and a memory 802, the memory 802 storing a computer program capable of running on the processor 801, wherein the processor 801 executes the computer program to perform the method for controlling the USB port.
[0202] With reference to FIG. 9, a schematic diagram of a nonvolatile readable storage medium is shown, the nonvolatile readable storage medium 900 storing a computer program 901, wherein the computer program is executed by a processor to perform the method for controlling the USB port.
[0203] With reference to FIG. 10, a schematic diagram of a computer program product is shown, the computer program product 1000 including computer programs / instructions, which, when executed by a processor, implement the method for controlling the USB port.
[0204] Each of the embodiments in the specification is described in a progressive manner, and each embodiment focuses on the difference from other embodiments. The same and similar parts of each embodiment can be referred to each other.
[0205] Those skilled in the art should understand that the embodiments of the present application can be provided as a method, device, or computer program product. Therefore, the embodiments of the present application can be in the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware aspects. Moreover, the embodiments of the present application can be in the form of a computer program product implemented on one or more computer usable storage media (including but not limited to magnetic disk storage, CD-ROM, optical storage, etc.) containing computer usable program code.
[0206] The embodiments of the present application are described with reference to flowcharts and / or block diagrams according to the method, terminal device (system), and computer program product of the embodiments of the present application. It should be understood that each flow and / or block in the flowcharts and / or block diagrams, and the combination of the flows and / or blocks, can be implemented by computer program instructions. These computer program instructions can be provided to a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing terminal device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing terminal device produce a device for implementing the functions specified in one or more flows of the flowcharts and / or one or more blocks of the block diagrams.
[0207] These computer program instructions can also be stored in a computer- readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instructions which implement the function specified in the flowchart or flowsheets and / or block or blocks of the block diagrams.
[0208] These computer program instructions can also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart or flowsheets and / or block or blocks of the block diagrams.
[0209] Although preferred embodiments of the application have been described, those skilled in the art will recognize that additional modifications and changes can be made thereto without departing from the scope of the present application. Accordingly, the appended claims are intended to cover all such modifications and changes as fall within the scope of the application.
[0210] Finally, it should be noted that the terms "first", "second", and the like, herein do not denote any order, quantity, combination, or importance, but rather are used to distinguish one element from another, and are more especially used for the purpose of identification of conceptual breach. Also, the terms "comprises", "comprising", or any other variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but can include other elements not expressly listed or inherent to such process, method, article, or apparatus. An element proceeded by "comprises... a" does not, without more constraints, exclude the existence of additional identical elements in the process, method, article, or apparatus that comprises the element. The terms "a" and "an" are defined as one or more unless explicitly indicated to the contrary or indicated to the contrary by context.
[0211] The principles and implementations of the present application have been described in specific examples, the above descriptions of the embodiments are only for the purpose of understanding the method of the present application and its core idea; meanwhile, for those skilled in the art, according to the idea of the present application, the specific implementation and application range will be changed, and the above description of the specification should not be understood as a limitation of the present application.
Claims
1. A control method for a universal serial bus port, characterized in that, A basic input / output system applied in a server, the server including multiple universal serial bus ports, the method comprising: After the server powers on and starts up, a first control policy is executed, which includes: The basic input / output system obtains the current project number of the server during the driver execution environment phase; Based on the current project number, determine the target universal serial bus port configuration information corresponding to the current project number, and generate the port configuration table corresponding to the current project number based on the target universal serial bus port configuration information; Unload the default port configuration table in the basic input / output system and load the port configuration table corresponding to the current project number. When the operating system of the server starts, the operating system calls the port configuration table corresponding to the current project number to control the multiple general serial bus ports.
2. The method according to claim 1, characterized in that, Obtain the current project number of the server, including: Obtain the status values of one or more target general-purpose input / output interfaces; In the preset project number configuration table, the current project number of the server is found based on the status value of the one or more target general input / output interfaces; The project number configuration table contains the status values of one or more target general input / output interfaces corresponding to multiple project numbers.
3. The method according to claim 1, characterized in that, Obtain the current project number of the server, including: Obtain the part number information from the information of replaceable units in the field; Based on the value of the part number information, determine the current project number of the server; The part number information corresponds one-to-one with the project number.
4. The method according to claim 1, characterized in that, The method further includes: In response to the first configuration operation, a region block is created in the basic input / output system; In response to the second configuration operation, obtain the general serial bus port configuration information corresponding to each of the multiple project numbers; Based on the general serial bus port configuration information corresponding to each of the multiple project numbers, a project number port configuration table is created and stored in the region block.
5. The method according to claim 4, characterized in that, Based on the current project number, determine the target universal serial bus port configuration information corresponding to the current project number, including: Based on the current item number, the Basic Input / Output System (PIOS) looks up the target Universal Serial Bus (USB) port configuration information corresponding to the current item number in the item number port configuration table stored in the PIOS region block.
6. The method according to claim 1, characterized in that, Based on the target universal serial bus port configuration information, generate a port configuration table corresponding to the current project number, including: Based on the target Universal Serial Bus (USB) port configuration information, the configuration information corresponding to the multiple USB ports in the default port configuration table of the basic input / output system is set in the first port configuration mode and the second port configuration mode respectively, and the port configuration table corresponding to the current project number is generated.
7. The method according to claim 6, characterized in that, In the default port configuration table of the basic input / output system, the configuration information corresponding to each of the multiple universal serial bus ports in the first port configuration mode is set, including: In the first port configuration mode of the default port configuration table, a first variable is set according to whether any general serial bus port is the target port corresponding to the current project number; Set the second variable according to the type of Universal Serial Bus protocol supported by any Universal Serial Bus port.
8. The method according to claim 7, characterized in that, In the default port configuration table of the basic input / output system, the configuration information corresponding to each of the multiple universal serial bus ports in the second port configuration mode is set, including: In the second port configuration mode of the default port configuration table, a third variable is set according to whether any Universal Serial Bus port is the target port corresponding to the current project number. The third variable is used to characterize whether any Universal Serial Bus port is visible. A fourth variable is set based on the Universal Serial Bus protocol type supported by any Universal Serial Bus port. This fourth variable is used to describe the Universal Serial Bus device group to which any Universal Serial Bus port belongs.
9. The method according to claim 1, characterized in that, The server is equipped with an input / output control chip, and each pin of the input / output control chip is connected to a power control signal of a universal serial bus port. The method further includes: When a target event is detected, the second control strategy is executed; The second control strategy includes: In response to the user's selection operation on the Universal Serial Bus port configuration options in the Basic Input / Output System interface, control information for any Universal Serial Bus port is obtained; Based on the control information of any Universal Serial Bus (USB) port, the output state of the pins connected to the USB port on the input / output control chip is controlled to control the power control signal of the USB port.
10. The method according to claim 9, characterized in that, Based on the control information from any Universal Serial Bus (USB) port, control the output state of the pins connected to that USB port on the input / output control chip, including: When the control information of any Universal Serial Bus port is enabled, the output state of the pin connected to the Universal Serial Bus port on the control input / output control chip is high. When the control information of any Universal Serial Bus (USB) port is closed, the output state of the pin connected to the USB port on the input / output control chip is low.
11. The method according to claim 9, characterized in that, When a target event is detected, the second control strategy is executed, including: When the basic input / output system detects that it has not obtained the current project number of the server within a first preset time period, the second control strategy is executed.
12. The method according to claim 9, characterized in that, When a target event is detected, the second control strategy is executed, including: When it is detected that the basic input / output system has not generated the port configuration table corresponding to the current project number within a second preset time period, the second control strategy is executed.
13. The method according to claim 9, characterized in that, When a target event is detected, the second control strategy is executed, including: When a user selects a configuration option for the Universal Serial Bus port on the Basic Input / Output System interface, the second control strategy is executed.
14. The method according to claim 9, characterized in that, When a target event is detected, the second control strategy is executed, including: When a user selects a configuration strategy for a Universal Serial Bus port on the Basic Input / Output System interface, it is determined whether to execute the first control strategy or the second control strategy.
15. A control device for a universal serial bus port, characterized in that, A basic input / output system for use in a server, the server including multiple universal serial bus ports, the device comprising: The first control policy execution module is used to execute a first control policy after the server is powered on and started, the first control policy including: The basic input / output system obtains the current project number of the server during the driver execution environment phase; Based on the current project number, determine the target universal serial bus port configuration information corresponding to the current project number, and generate the port configuration table corresponding to the current project number based on the target universal serial bus port configuration information; Unload the default port configuration table in the basic input / output system and load the port configuration table corresponding to the current project number. When the operating system of the server starts, the operating system calls the port configuration table corresponding to the current project number to control the multiple general serial bus ports.
16. A server, characterized in that, The server includes a basic input / output system and multiple universal serial bus ports, and the server is used to execute the control method of the universal serial bus ports according to any one of claims 1-8.
17. A server, characterized in that, The server includes a basic input / output system and multiple universal serial bus ports. The server is equipped with an input / output control chip, and each pin of the input / output control chip is connected to a power control signal of a universal serial bus port. The server is used to execute the control method of the universal serial bus port according to any one of claims 1-14.
18. A computer device, characterized in that, include: At least one processor, and a memory storing a computer program executable on the processor, wherein the processor executes the computer program to perform the control method for a universal serial bus port as described in any one of claims 1-14.
19. A non-volatile readable storage medium, characterized in that, The non-volatile readable storage medium stores a computer program, wherein when the computer program is executed by a processor, it performs the control method for a universal serial bus port as described in any one of claims 1-14.
20. A computer program product comprising a computer program / instructions, characterized in that, When the computer program / instruction is executed by the processor, it implements the control method for the universal serial bus port as described in any one of claims 1-14.
Citation Information
Patent Citations
Method for controlling universal serial bus (USB) port equipment switch
CN102332073A
USB port disabling method and device, controlled terminal and storage medium
CN108985074A
Method and device for configuring project port in BIOS, terminal and storage medium
CN113064647A
Server starting control method and device and server
CN117519836A
Control method and device of universal serial bus port and product
CN118445237A