Bus serial number distribution method and computing device
Obtaining and utilizing PCIE port priority configuration information through BIOS solves the problem of low efficiency in bus serial number allocation in computing devices, achieves flexible and efficient allocation of bus serial numbers, meets user needs and reduces hardware adjustment costs.
Patent Information
- Application Number
- CN202410494253.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-04-22
- Publication Date
- 2024-09-17
AI Technical Summary
In the existing technology, the allocation efficiency of PCIE device bus serial numbers in computing devices is low, cannot flexibly meet user needs, and the cost of hardware adjustment is high.
Obtain the PCIE port priority configuration information on the CPU through the BIOS, scan and assign the bus serial number in the order indicated by the priority configuration information, avoid manually adjusting the hardware port number, and determine the bus serial number by utilizing the positive correlation between the priority configuration information and the port number.
It achieves flexible and efficient allocation of bus serial numbers, improves allocation efficiency, meets the different needs of users, and reduces the cost of hardware adjustment.
Smart Images

Figure CN118656329A
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the field of computer technology, and in particular to a bus sequence number allocation method and a computing device. Background Art
[0002] For a PCIE device connected to a peripheral component interconnect express (PCIE) port in a computing device, a specific bus number will be assigned before the operating system of the computing device is started so that the operating system can identify and manage the hardware device. Among them, the bus number can be used to indicate the physical location of the PCIE device in the operating system, which is the connection location between the PCIE device and the bus. The bus number can also be used to determine access rights and communication order, etc. In some scenarios, the user hopes that the specified hardware device can be assigned a bus number first, that is, assigned the smallest bus number.
[0003] In the related art, the order in which the bus numbers are assigned to the hardware devices can only be adjusted by changing the physical ports where the hardware devices are located. However, the adjustment of the hardware devices not only cannot flexibly meet the needs of users, but also has a high cost for hardware adjustment, thus resulting in low efficiency in the allocation of bus numbers. Summary of the invention
[0004] The embodiment of the present application provides a bus number allocation method and computing device, which can avoid manually adjusting the PCIE port number to which the PCIE device is connected, so that the bus number allocation can be flexibly performed, thereby improving the bus number allocation efficiency. The technical solution is as follows:
[0005] In the first aspect, a method for allocating bus numbers is provided, which is applied to a computing device, and the computing device is operated by a BIOS, including: obtaining priority configuration information of a PCIE port on a CPU through the BIOS, the priority configuration information is used to indicate the order in which the BIOS scans the PCIE ports on the CPU, wherein the order of scanning the PCIE ports in sequence indicated by the priority configuration information is different from the order of the port numbers of the PCIE ports. According to the order indicated by the priority configuration information, the first PCIE port to be scanned at the current moment is determined through the BIOS. If it is determined by scanning the first PCIE port that a PCIE device is hung under the first PCIE port, the bus number corresponding to the first PCIE port is allocated to the PCIE device hung under the first PCIE port through the BIOS, and the size of the bus number corresponding to the first PCIE port is positively correlated with the number of the second PCIE ports, and the second PCIE port is a PCIE port on the CPU that has been determined to have a PCIE device hung under it after scanning before the current moment.
[0006] It is understandable that the computing device can obtain the priority configuration information of the PCIE port on the CPU through the BIOS, and the BIOS can sequentially scan the PCIE ports on the CPU in the order indicated by the priority configuration information, and assign corresponding bus numbers to the ports with PCIE devices attached thereto. Since the order of sequentially scanning the PCIE ports indicated by the priority configuration information is different from the order of the port numbers of the PCIE ports, it is possible to avoid allocating bus numbers by hardware design or manually changing the PCIE port numbers corresponding to the PCIE devices, and the bus numbers can be allocated flexibly and efficiently, thereby greatly improving the efficiency of bus number allocation.
[0007] In a possible implementation manner, the priority configuration information includes the sequence information of the PCIE port with each port number during the PCIE port scanning process.
[0008] It is understandable that when the priority configuration information includes the order information of the PCIE ports of each port number during the PCIE port scanning process, all PCIE ports can be sorted to meet different business needs, making the bus number allocation method more flexible.
[0009] In a possible implementation manner, the priority configuration information includes information that a PCIE port with a specified port number is in a specified sequence during a process of scanning PCIE ports.
[0010] It is understandable that when the priority configuration information includes the PCIE port of the designated port being in the designated sequence information during the PCIE port scanning process, the scanning order of the designated port can be adjusted so that the device connected to the designated port can be assigned to the designated bus number.
[0011] In a possible implementation, the first PCIE port to be scanned at the current moment is determined by BIOS according to the order indicated by the priority configuration information and the port number of the PCIE port. The PCIE ports whose order is not indicated in the priority configuration information are determined in the order of the size of the port number of the PCIE port in the process of scanning the PCIE port.
[0012] It is understandable that the computing device can determine the first PCIE port that the BIOS is currently scanning based on the priority configuration information and the port number of the PCIE port. For the PCIE port with the specified sequence information, the scanning order can be determined according to the size order of the PCIE port number. In other words, the default order of the PCIE ports is in the size order of the PCIE port numbers. The combination of the priority configuration information and the default order can more accurately determine the first PCIE port that the BIOS is currently scanning.
[0013] In a possible implementation, a scan request is sent to the first PCIE port through BIOS. If the BIOS receives a scan response returned by the first PCIE port, the BIOS allocates I / O resources, MMIO resources and a bus number corresponding to the first PCIE port to the PCIE device connected to the first PCIE port.
[0014] It is understandable that when the computing device scans the first PCIE port through the BIOS, not only a bus number is allocated to the PCIE device connected to the first PCIE port according to the scan response, but the BIOS also allocates I / O resources and MMIO resources to the PCIE device connected to the first PCIE port. Therefore, the initialization efficiency of the PCIE device connected to the first PCIE port can be improved.
[0015] In a possible implementation, the number n of the second PCIE ports is obtained, where n is an integer greater than or equal to 0. The bus number corresponding to the first PCIE port is assigned to the PCIE device connected to the first PCIE port through BIOS as n.
[0016] It is understandable that the port number assigned by the computing device to the PCIE device hanging under the first PCIE port through the BIOS is equal to the number of the second PCIE ports. Since the second PCIE port is a port with a PCIE device hanging under it scanned before the current moment, and the size of the bus number corresponding to the first PCIE port is positively correlated with the number of the second PCIE ports, the port number assigned by the computing device to the PCIE device hanging under the first PCIE port through the BIOS is equal to the number of the second PCIE ports. Therefore, the accuracy of bus number allocation can be guaranteed.
[0017] In a possible implementation, priority configuration information of a PCIE port on a CPU sent by a display device is received, and the display device is used to display a BIOS menu interface to a user.
[0018] It is understandable that the computing device can receive the priority configuration information of the PCIE port on the CPU sent by the display device. The display device can display the BIOS menu interface to the user. That is, the user can input the priority configuration information of the PCIE port on the CPU through the BIOS menu interface, which can make the configuration of the scanning order of the PCIE port on the CPU more flexible and convenient, thereby improving the allocation efficiency of the bus sequence number.
[0019] In one possible implementation, if the computing device includes at least two CPUs, and each CPU includes a PCIE port that supports configuration priority, before determining the first PCIE port to be scanned at the current moment through BIOS in the order indicated by the priority configuration information, the method also includes: obtaining priority information of at least two CPUs respectively, the priority information is used to indicate the order in which BIOS scans the PCIE ports on at least two CPUs respectively. Determine the first CPU to be scanned at the current moment according to the priority information of at least two CPUs. Determine the first PCIE port to be scanned at the current moment through BIOS in the order indicated by the priority configuration information, including: determine the first PCIE port on the first CPU to be scanned at the current moment through BIOS in the order indicated by the priority configuration information of the first CPU.
[0020] It is understandable that for a computing device including at least two CPUs, the computing device can scan the at least two CPUs in sequence through the BIOS according to the priority information of the at least two CPUs. The computing device allocates bus numbers to the PCIE devices under each CPU respectively, thereby improving the flexibility and extensiveness of the bus number allocation method.
[0021] In a second aspect, a method for allocating bus numbers is provided, which is applied to a display device, comprising: displaying a BIOS menu interface of a computing device, the BIOS menu interface being used to configure a scanning priority of a PCIE port on a CPU of the computing device; receiving user operations on the BIOS menu interface, generating priority configuration information, the priority configuration information being used to indicate the order in which the BIOS scans the PCIE ports on the CPU, wherein the order in which the PCIE ports are scanned indicated by the priority configuration information is different from the order in which the port numbers of the PCIE ports are respectively scanned; sending the priority configuration information to the computing device; wherein the size of the bus number allocated by the computing device to the PCIE port on the CPU is positively correlated with the scanning order indicated by the priority configuration information.
[0022] It is understandable that the display device can generate priority configuration information of the PCIE port on the CPU according to the user operation. And send the priority configuration information to the computing device, so that the computing device can complete the allocation of bus numbers in the order indicated by the priority configuration information. In the above, through the page interaction method, the configuration flexibility and convenience of the scanning order of the PCIE port on the CPU can be improved, and at the same time, the different needs of users can be met, thereby improving the efficiency of bus number allocation.
[0023] In the third aspect, a device for allocating bus numbers is provided. The embodiment of the present application can divide the function modules of the device for allocating bus numbers according to the method provided in the first aspect. For example, each function module can be divided according to each function, or two or more functions can be inherited in one processing module. Exemplarily, the embodiment of the present application can divide the device for allocating bus numbers into an acquisition module and a processing module according to the function. The description of the possible technical solutions and beneficial effects executed by each of the functional modules divided above can refer to the technical solutions provided by the first aspect or its corresponding possible implementation method, which will not be repeated here.
[0024] In a fourth aspect, a device for allocating bus numbers is provided. The embodiment of the present application can divide the function modules of the device for allocating bus numbers according to the method provided in the second aspect. For example, each function module can be divided according to each function, or two or more functions can be inherited in one processing module. Exemplarily, the embodiment of the present application can divide the device for allocating bus numbers into a display module, a processing module, and a sending module according to the function. The description of the possible technical solutions and beneficial effects executed by each of the functional modules divided above can refer to the technical solutions provided by the second aspect or its corresponding possible implementation method, which will not be repeated here.
[0025] In a fifth aspect, an embodiment of the present application provides a computing device, the computing device comprising a processor and a memory, the memory storing computer instructions, the computer instructions being loaded and executed by the processor so that the computing device implements the bus number allocation method as described above.
[0026] In a sixth aspect, an embodiment of the present application provides a computer-readable storage medium, in which at least one computer program is stored, and the computer program is loaded and executed by a processor to implement the bus number allocation method as described above.
[0027] In a seventh aspect, an embodiment of the present application provides a computer program product or a computer program, the computer program product or the computer program including a computer instruction, the computer instruction being stored in a computer-readable storage medium. A processor of a terminal reads the computer instruction from the computer-readable storage medium, and the processor executes the computer instruction, so that the terminal executes the bus sequence number allocation method provided in various optional implementations of the above aspects.
[0028] For the specific description of the third to seventh aspects and their various implementations in the embodiments of the present application, reference can be made to the detailed description in the first aspect, the second aspect and their various implementations; and for the beneficial effects of the third to seventh aspects and their various implementations, reference can be made to the analysis of the beneficial effects in the first aspect, the second aspect and their various implementations, which will not be repeated here.
[0029] These and other aspects of the embodiments of the present application will be more clearly understood in the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0030] Figure 1 It is a schematic diagram of the structure of a bus serial number allocation system provided in an embodiment of the present application;
[0031] Figure 2 is a schematic diagram of the hardware structure of a computing device provided in an embodiment of the present application;
[0032] Figure 3 It is a flowchart of a method for allocating bus serial numbers provided in an embodiment of the present application;
[0033] Figure 4 is based on Figure 3 A schematic diagram of a BIOS menu interface provided by the illustrated embodiment;
[0034] Figure 5 It is a logical schematic diagram of a bus sequence number allocation method provided in an embodiment of the present application;
[0035] Figure 6 It is a schematic diagram of an interactive process of implementing a method for allocating bus numbers provided in an embodiment of the present application;
[0036] Figure 7 A schematic diagram of the structure of a bus sequence number allocation device 800 provided in an embodiment of the present application is shown;
[0037] Figure 8 A schematic structural diagram of a bus sequence number allocation device 900 provided in an embodiment of the present application is shown. DETAILED DESCRIPTION
[0038] In order to make the objectives, technical solutions and advantages of the embodiments of the present application clearer, the implementation methods of the present application will be further described in detail below in conjunction with the accompanying drawings.
[0039] The term "multiple" as used herein refers to two or more than two. "And / or" describes the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. The character " / " generally indicates that the related objects are in an "or" relationship.
[0040] First, the application scenarios of the embodiments of the present application are exemplarily introduced.
[0041] Usually, before the operating system of the computing device is started, the computing device will assign a specific bus number to the hardware device of the computing device through BIOS, so that the hardware device can be identified and managed after the operating system is started. At the same time, the bus number can also be used to indicate the physical position of the PCIE device in the operating system and determine the communication order of the PCIE device. Generally, the physical position and access order of the hardware device with a smaller bus number are in the front.
[0042] In some application scenarios, users hope that specific hardware devices can be assigned to specific bus numbers so that after the operating system is started, the specific hardware devices can have a specific communication order. For example, some Internet application users hope that the smart network card device can be assigned to the smallest bus number, and then after the Linux operating system is started, according to the operating rules of the Linux operating system, the smart network card device can obtain the network port number ETH0. Not only can it reduce the complexity of users in configuring the network and facilitate user operations; but the ETH0 network port number has become a convention in the Linux system, allowing different devices or software to use unified network port naming, reducing compatibility issues caused by inconsistent naming, thereby improving system compatibility.
[0043] In one implementation, the computing device allocates bus numbers to the hardware devices under each PCIE port according to the default physical position order of the PCIE ports on the CPU, that is, the order of the PCIE port numbers. If the bus number of the hardware device is to be adjusted, the user's needs can usually only be met through hardware design or manual removal of the hardware device. However, the above method not only cannot flexibly meet the user's bus number allocation needs, but also consumes a lot of manpower and material resources, resulting in low efficiency in bus number allocation.
[0044] The embodiment of the present application provides a method for allocating bus serial numbers, which can be applied to computing devices. The computing device can obtain the priority configuration information of the PCIE port on the central processing unit (CPU) through the basic input output system (BIOS). Among them, the priority configuration information can be used to indicate the order in which the BIOS scans the PCIE ports on the CPU in sequence. At the same time, the order of scanning the PCIE ports in sequence indicated by the priority configuration information is different from the order of the port numbers of the PCIE ports. The computing device can determine the first PCIE port to be scanned at the current moment through the BIOS in the order indicated by the priority configuration information. If it is determined by scanning the first PCIE port that a PCIE device is hung under the first PCIE port, the computing device can allocate the bus serial number corresponding to the first PCIE port to the PCIE device hung under the first PCIE port through the BIOS. The size of the bus serial number corresponding to the first PCIE port is positively correlated with the number of the second PCIE ports. Among them, the second PCIE port is a PCIE port on the CPU that was determined to have a PCIE device hung under it after scanning before the current moment. The above method can adjust the scanning order of the BIOS for the devices connected to the PCIE port according to the priority configuration information without changing the PCIE port of the PCIE device, thereby allocating bus numbers to the PCIE devices connected to the PCIE port. This avoids manually removing the PCIE device to adjust the order of the PCIE ports, can flexibly and efficiently meet business needs, and greatly improves the efficiency of bus number allocation.
[0045] Secondly, the system architecture of the embodiment of the present application is exemplarily introduced.
[0046] Figure 1 is a schematic diagram of a bus number allocation system structure provided in an embodiment of the present application, such as Figure 1 As shown, the bus number allocation system may include a computing device 110 and a display device 120 .
[0047] The computing device 110 may be a standard general-purpose server, specifically a blade server, a high-density server, a rack server, or a high-performance server, etc. The computing device 110 runs a BIOS.
[0048] The computing device 110 can obtain the priority configuration information of the PCIE port on the CPU through the BIOS. According to the order indicated by the priority configuration information, the computing device 110 can determine the first PCIE port being scanned at the current moment through the BIOS. If it can be determined that a PCIE device is hung under the first PCIE port by scanning the first PCIE port, the computing device 110 can assign the bus number corresponding to the first PCIE port to the PCIE device hung under the first PCIE port through the BIOS. Among them, the size of the bus number corresponding to the first PCIE port is positively correlated with the number of the second PCIE ports. The second PCIE port is a PCIE port on the CPU that has been scanned before the current moment and can determine the PCIE port on the CPU with the PCIE device hung under it.
[0049] The display device 120 may be an electronic device with a display function, specifically a terminal, a display, a tablet computer, a projector, etc. The display device 120 is used to display a bus number allocation interface and can interact with the computing device 110 .
[0050] Optionally, the computing device 110 may also be a personal computer or an all-in-one computer with a display function.
[0051] The display device 120 may be used to display a BIOS menu interface. The display device 120 may also generate priority configuration information of a PCIE port on the CPU in response to a received trigger operation, and send the priority configuration information to the BIOS of the computing device 110. The BIOS menu interface is used to configure the priority configuration information of the PCIE port on the CPU. The priority configuration information is used to indicate the order in which the BIOS sequentially scans the PCIE ports on the CPU, wherein the order in which the PCIE ports are sequentially scanned indicated by the priority configuration information is different from the order of the port numbers of the PCIE ports.
[0052] The display device 120 interacts with the computing device 110, and the display device 120 can display the BIOS menu interface and obtain the priority configuration information of the PCIE port on the CPU, which can improve the flexibility and convenience of obtaining the priority configuration information, thereby improving the efficiency of bus number allocation.
[0053] The solution shown in the embodiment of the present application can be executed by a computing device. Figure 2 FIG. 1 is a schematic diagram showing a hardware structure of a computing device provided in an embodiment of the present application. Figure 2 As shown, the computing device 110 may include a CPU 210, a memory 220, and a bus 240. The CPU 210 and the memory 220 are usually connected to each other via the bus 240, or are connected to each other in other ways.
[0054] Among them, BIOS 230 runs on CPU 210. There are 5 ports (performance event, PE) exposed to the outside on CPU 210. Among them, PE port is the grouping of PCIE ports by CPU, and one PE port contains 16 PCIE channels. They can be configured as PE0, PE1, PE2, PE3, and PE4 respectively, for connecting PCIE devices. PCIE devices refer to devices that adopt the PCIE interface standard, and can specifically be devices such as sound cards, network cards, and graphics cards.
[0055] The memory 220 stores instructions for executing bus number allocation, and is used to execute the instructions for executing bus number allocation to implement the method for assigning bus numbers.
[0056] Among them, BIOS230 can obtain the priority configuration information of the PE port on CPU 210, wherein the PE port is a grouping of PCIE ports, and a PE port can be configured as an X16 PCIE port; BIOS230 can determine the first PCIE port that needs to be scanned at the current moment according to the priority configuration information. If BIOS230 scans the first PCIE port and determines that a PCIE device is hung under the first PCIE port, BIOS230 assigns the bus number corresponding to the first PCIE port to the PCIE device hung under the first PCIE port. The size of the bus number corresponding to the first PCIE port is positively correlated with the number of the second PCIE ports. Among them, the second PCIE port is a PCIE port on the CPU that has been scanned and determined to have a PCIE device hung under it before the current moment.
[0057] For example, if the priority configuration information of the PCIE port on the CPU 210 obtained by the BIOS 230 is that PE1 is the fourth priority. The fourth priority means that the order of PE1 when the BIOS 230 performs the scan is the fourth. The remaining PE ports on the CPU 210 are scanned in the order of the port numbers. That is, the scanning order of the PE ports on the CPU 210 is PE0, PE2, PE3, PE1, PE4.
[0058] BIOS230 determines that the first PCIE port scanned at the current moment is the PE1 port according to the order indicated by the priority configuration information, based on the priority configuration information. If a PCIE device is hung under the PE1 port, BIOS230 assigns the bus serial number corresponding to the PE1 port to the PCIE device hung under the PE1 port. Among them, the second PCIE port is a PE port on the CPU 210 that has been scanned and determined to have a PCIE device hung under it before the current moment. The more the number of second PCIE ports, the larger the bus serial number of the first PCIE port. That is, the second PCIE ports are PE0, PE2, and PE3. If there are PCIE devices hung under PE0, PE2, and PE3, BIOS230 assigns the bus serial number corresponding to the PE1 port to the PCIE device hung under the PE1 port as 04.
[0059] It should be noted that the system architecture and application scenarios described in the embodiments of the present application are intended to more clearly illustrate the technical solutions of the embodiments of the present application, and do not constitute a limitation on the technical solutions provided in the embodiments of the present application. Ordinary technicians in this field can know that with the evolution of the system architecture and the emergence of new business scenarios, the technical solutions provided in the embodiments of the present application are also applicable to similar technical problems.
[0060] For ease of understanding, the following is an exemplary introduction to the bus number allocation method provided by the present application in conjunction with the accompanying drawings. The bus number allocation method is applicable to Figure 2 The computing device shown.
[0061] Figure 3 A schematic flow chart of a bus number allocation method provided in an embodiment of the present application is shown. The bus number allocation method includes the following steps:
[0062] S101, a computing device obtains priority configuration information of a PCIE port on a CPU through BIOS.
[0063] The priority configuration information is used to indicate the order in which the BIOS scans the PCIE ports on the CPU in sequence; the order in which the PCIE ports are scanned in sequence indicated by the priority configuration information is different from the order of the port numbers of the PCIE ports.
[0064] Exemplarily, the number of PCIE ports on the CPU may be 5, and the port numbers of the PCIE ports may be PCIE0, PCIE1, PCIE2, PCIE3, and PCIE4, respectively. The order of scanning the PCIE ports in sequence indicated by the priority configuration information is different from the order of the size of the PCIE port numbers. In other words, the order indicated by the priority configuration information is different from the order of the ports from PCIE0 to PCIE4.
[0065] In a possible implementation manner, the priority configuration information may include the sequence information of the PCIE port with each port number during the PCIE port scanning process.
[0066] That is to say, the priority configuration information may include the order information of each PCIE port on the CPU during scanning.
[0067] For example, there are 5 PCIE ports exposed to the outside on the CPU, and the port numbers are PCIE0, PCIE1, PCIE2, PCIE3, and PCIE4. The priority configuration information can be PCIE2 as the first priority, PCIE1 as the second priority, PCIE3 as the third priority, PCIE4 as the fourth priority, and PCIE0 as the fifth priority. Among them, the priority is sorted from high to low as follows: first priority > second priority > third priority > fourth priority > fifth priority. Therefore, the order in which the BIOS scans the PCIE ports on the CPU is: PCIE2, PCIE1, PCIE3, PCIE4, and PCIE0.
[0068] In a possible implementation manner, the priority configuration information includes information that a PCIE port with a specified port number is in a specified sequence during a process of scanning PCIE ports.
[0069] Exemplarily, the configuration information may include information on the specified order of the PCIE ports of the specified port number on the CPU scanned by the BIOS. The PCIE ports whose order is not indicated in the priority configuration information are determined in the order of the size of the port numbers of the PCIE ports in the process of scanning the PCIE ports. That is, for other PCIE ports on the CPU, the BIOS scans them in sequence according to the order indicated by the PCIE port numbers.
[0070] For example, there are 5 PCIE ports exposed to the outside on the CPU, and the port numbers are PCIE0, PCIE1, PCIE2, PCIE3, and PCIE4. The priority configuration information can be that the scanning order of the PCIE2 port on the CPU is the first. For other PCIE ports on the CPU, the BIOS scans in the order indicated by the PCIE port number, that is, PCIE0, PCIE1, PCIE3, and PCIE4. Therefore, the order in which the BIOS scans the PCIE ports on the CPU is: PCIE2, PCIE0, PCIE1, PCIE3, and PCIE4.
[0071] In a possible implementation, before the computing device obtains the priority configuration information of the PCIE port on the CPU through the BIOS, the computing device may receive the priority configuration information of the PCIE port on the CPU sent by the display device.
[0072] The display device is used to display the BIOS menu interface to the user.
[0073] Exemplarily, the display device can display a BIOS menu interface to the user, and the user inputs the priority configuration information through the display device. The display device can send the priority configuration information to the computing device, so that the computing device can obtain the priority configuration information of the PCIE port on the CPU through the BIOS.
[0074] for example, Figure 4 Schematic diagram of a BIOS menu interface involved in the embodiment of the present application. Figure 4 As shown, the BIOS menu interface 410 includes a PCIE port number 420 and a priority order option 430. Among them, the PCIE port number 420 includes all PCIE ports on the CPU corresponding to the computing device, which are PCIE0 port, PCIE1 port, PCIE2 port...PCIEN port in order of port number. The priority order option 430 includes priority options corresponding to all PCIE ports on the CPU. In addition, the BIOS menu interface 410 also includes cancel and confirm options and corresponding controls.
[0075] The display device can display the BIOS menu interface 410 to the user, and the user enters the order in which the BIOS scans the PCIE ports on the CPU in sequence through the BIOS menu interface 410. The user clicks the triangle control of the priority order option corresponding to the PCIE port on the CPU, and the BIOS will jump or pull down the priority option. The priority options include the first priority, the second priority, the third priority...the Nth priority and the default priority. Among them, the priorities are sorted from high to low as follows: the first priority>the second priority>the third priority>the Nth priority. The default priority means that the order in the process of scanning the PCIE port is determined according to the size of the port number of the PCIE port. When entering the BIOS menu interface 410, the priority options of all PCIE ports on the CPU are the default priorities.
[0076] Users can input priority configuration information according to business needs. The circular controls corresponding to each priority in the drop-down options can respond to user click operations. When the user determines that the priority of the PCIE0 port is the default priority, the circular control corresponding to the default priority becomes solid. Only one priority option can be selected for a PCIE port. If the user completes the configuration of the scan order of the PCIE port on the CPU according to business needs, click the confirmation option, and the circular control corresponding to the confirmation option becomes solid. This completes the configuration of the scan order of the PCIE port on the CPU.
[0077] Therefore, the BIOS menu interface is displayed to the user through the display device, the user can input the priority configuration information of the PCIE port on the CPU through the BIOS menu interface, and the computing device can receive the priority configuration information of the PCIE port on the CPU sent by the display device, which can make the configuration of the scanning order of the PCIE port on the CPU more flexible and convenient, thereby improving the allocation efficiency of the bus number.
[0078] It should be noted that the computing device can obtain the priority configuration information of the PCIE port on the CPU input by the user through the BIOS; the priority configuration information of the PCIE port on the CPU can also be pre-stored in the computing device and obtained by the BIOS when the computing device is started. The above-mentioned way in which the computing device receives the priority configuration information of the PCIE port on the CPU sent by the display device is only used as an example and does not constitute a limitation.
[0079] S102, the computing device determines the first PCIE port to be scanned at the current moment through BIOS according to the order indicated by the priority configuration information.
[0080] In the embodiment of the present application, the BIOS can scan the PCIE ports on the CPU in sequence according to the order indicated by the priority configuration information. Therefore, the computing device can determine the first PCIE port to be scanned at the current moment through the BIOS.
[0081] In a possible implementation, the computing device can determine the first PCIE port to be scanned at the current moment through BIOS according to the order indicated by the priority configuration information and the port number of the PCIE port.
[0082] The PCIE ports whose priority is not indicated in the priority configuration information have their priority determined in the process of scanning the PCIE ports according to the order of the port numbers of the PCIE ports.
[0083] That is, when the configuration information includes information on the specified order of the PCIE port with the specified port number on the CPU scanned by the BIOS, the computing device determines the first PCIE port to be scanned at the current moment through the BIOS according to the order indicated by the priority configuration information and the port number of the PCIE port.
[0084] For example, there are 5 PCIE ports exposed to the outside on the CPU, and the port numbers are PCIE0, PCIE1, PCIE2, PCIE3, and PCIE4. The priority configuration information can be that the scanning order of the PCIE2 port on the CPU is the first. For other PCIE ports on the CPU, the BIOS scans in the order indicated by the PCIE port number, that is, PCIE0, PCIE1, PCIE3, and PCIE4. Therefore, the order in which the BIOS scans the PCIE ports on the CPU is: PCIE2, PCIE0, PCIE1, PCIE3, and PCIE4. The BIOS can determine that the first PCIE port to be scanned at the current moment is the PCIE1 port based on the fact that the scanning order of the PCIE port is the third.
[0085] S103, the computing device allocates a bus number corresponding to the first PCIE port to the PCIE device connected to the first PCIE port through BIOS.
[0086] In an embodiment of the present application, the BIOS can scan the PCIE port and the PCIE device connected to the PCIE port, and assign a bus number to the PCIE device.
[0087] In a possible implementation, it is determined that a PCIE device is connected to the first PCIE port. If it is determined that a PCIE device is connected to the first PCIE port by scanning the first PCIE port, a bus number corresponding to the first PCIE port is allocated to the PCIE device connected to the first PCIE port by BIOS.
[0088] In another possible implementation, if it is determined by scanning the first PCIE port that no PCIE device exists under the first PCIE port, the BIOS will scan the next PCIE port in the order indicated by the priority configuration information.
[0089] Exemplarily, the computing device can determine the scanning order of the PCIE ports on the CPU through the BIOS according to the order indicated by the priority configuration information and the port number of the PCIE port: PCIE2, PCIE0, PCIE1, PCIE3, PCIE4. When the BIOS scans to the third position in the order, the first PCIE port scanned at the current moment is the PCIE1 port. The computing device can determine whether there is a PCIE device under the PCIE1 port by scanning the PCIE1 port through the BIOS. If the PCIE device 001 is hung under the PCIE1 port, the computing device can assign a bus number to the PCIE device 001 through the BIOS; if there is no PCIE device under the PCIE port, the computing device scans the next port through the BIOS according to the scanning order of the PCIE ports on the CPU, that is, the fourth PCIE3 port.
[0090] In one possible implementation, the computing device sends a scan request to the first PCIE port through the BIOS; if the BIOS receives a scan response returned by the first PCIE port, the computing device allocates I / O resources, MMIO resources and a bus number corresponding to the first PCIE port to the PCIE device attached to the first PCIE port through the BIOS.
[0091] Among them, the input / output (I / O) resource can be a mapping of the memory resource of the PCIE device, and the memory of the PCIE device can be mapped to the memory address space of the operating system, so that data transmission and access can be performed efficiently. The memory mapped input / output resource (MMIO) refers to a resource that maps the I / O port to memory for access.
[0092] That is, the computing device sends a scan request to the current PCIE port through the BIOS. If it is determined that there is a PCIE device under the current PCIE port, the computing device scans the PCIE device under the current PCIE port through the BIOS and allocates I / O resources, MMIO resources, and the bus number corresponding to the current PCIE port. After the BIOS completes the resource allocation for the PCIE device under the current PCIE port, the computing device sends a scan request to the next PCIE port through the BIOS and repeats the above process.
[0093] Exemplarily, the computing device may send a scan request to the first PCIE port through the BIOS. If the BIOS cannot receive the scan response returned by the first PCIE port, it may be determined that there is no PCIE device under the first PCIE port. If the BIOS can receive the scan response returned by the first PCIE port, it may be determined that a PCIE device is hung under the first PCIE port. The computing device scans the PCIE device under the first PCIE port through the BIOS according to the scan response, and allocates I / O resources, MMIO resources, and the bus number corresponding to the first PCIE port to the PCIE device hung under the first PCIE port. The scan response may include I / O resource requirement information and MMIO resource requirement information corresponding to the PCIE device.
[0094] For example, according to the priority configuration information, the computing device determines through the BIOS that the first PCIE port to be scanned at the current moment is the PCIE2 port. The computing device sends a scan request to the PCIE2 port through the BIOS. The BIOS can receive a scan response returned by the PCIE2 port. The BIOS scans the PCIE device under the PCIE2 port according to the scan response returned by the PCIE2 port, and allocates I / O resources, MMIO resources, and the bus number corresponding to the PCIE2 port to the PCIE2 port.
[0095] In a possible implementation manner, the size of the bus number corresponding to the first PCIE port is positively correlated with the number of the second PCIE ports.
[0096] The second PCIE port is a PCIE port on a CPU that is determined to have a PCIE device attached to it through scanning before the current moment.
[0097] That is to say, the more the number of second PCIE ports is, the larger the bus number of the first PCIE port is. Because the scanning order of the second PCIE port is before the first PCIE port, the BIOS will give priority to assigning bus numbers to the second PCIE ports, and the earlier the bus number is assigned, the smaller the bus number is. Therefore, the bus number of the second PCIE port is smaller than the bus number of the first PCIE port, that is, the size of the bus number corresponding to the first PCIE port is positively correlated with the number of the second PCIE ports.
[0098] In a possible implementation, the computing device may obtain the number n of the second PCIE ports, and assign the bus number n corresponding to the first PCIE port to the PCIE device connected to the first PCIE port through BIOS.
[0099] Wherein, n is an integer greater than or equal to 0.
[0100] That is to say, the BIOS assigns a bus number to the second PCIE port according to the scanning order. The earlier the PCIE port in the scanning order, the smaller the bus number assigned by the BIOS to the corresponding PCIE device. Because the second PCIE port is a PCIE port on the CPU that has been scanned and determined to have a PCIE device attached before the current moment, the computing device can assign a bus number n to the first PCIE port according to the number n of the second PCIE ports.
[0101] For example, the computing device can determine the scanning order of the PCIE ports on the CPU through the BIOS according to the order indicated by the priority configuration information and the port number of the PCIE port: PCIE2, PCIE0, PCIE1, PCIE3, PCIE4. When the BIOS scans to the third position in the order, the first PCIE port scanned at the current moment is the PCIE1 port. The second PCIE port scanned before the current moment is the first and second positions, that is, the PCIE2 port and the PCIE0 port.
[0102] If both the PCIE2 port and the PCIE0 port have PCIE devices connected to them, then the number n of the second PCIE ports is 2. Therefore, the bus number assigned by the computing device to the PCIE1 port through BIOS is 2.
[0103] If there is no PCIE device under the PCIE2 port and the PCIE0 port, then the number n of the second PCIE port is 0. Therefore, the bus number assigned by the computing device to the PCIE1 port through BIOS is 0.
[0104] If a PCIE device is connected to the PCIE2 port and no PCIE device exists under PCIE0, or no PCIE device exists under PCIE2 port and a PCIE device is connected to PCIE0, then the number n of the second PCIE ports is 1. Therefore, the bus number assigned by the computing device to the PCIE1 port through BIOS is 1.
[0105] For example, if the PCIE device attached to the PCIE2 port is a smart network card, the computing device can scan the smart network card in the first place through BIOS according to the order indicated by the priority configuration information, and assign the smart network card a bus number of 0. After the operating system of the computing device is started, according to the running kernel of the operating system, the smart network card attached to the PCIE2 port can obtain the network port number of ETH0, which meets the needs of users.
[0106] In an embodiment of the present application, the computing device can determine the first PCIE port to be scanned at the current moment through BIOS according to the order indicated by the priority configuration information and the port number of the PCIE port; and assign a bus number to the first PCIE port.
[0107] Figure 5 FIG. 1 shows a logic diagram of a bus sequence number allocation method provided by an embodiment of the present application. Figure 5As shown, the computing device starts the BIOS (S501), and the computing device determines whether to obtain the priority configuration information of the PCIE port on the CPU through the BIOS (S502). Among them, the priority configuration information is used to indicate the order in which the BIOS scans the PCIE ports on the CPU in sequence. At the same time, the order of scanning the PCIE ports in sequence indicated by the priority configuration information is different from the order of the port numbers of the PCIE ports.
[0108] If the computing device obtains the priority configuration information of the PCIE port on the CPU, the computing device can allocate bus numbers to the PCIE devices hanging under the PCIE port on the CPU through the BIOS in the order indicated by the priority configuration information (S503). Among them, the computing device can determine the first PCIE port being scanned at the current moment through the BIOS in the order indicated by the priority configuration information. If it is determined that there is a PCIE device hanging under the first PCIE port by scanning the first PCIE port, the bus number corresponding to the first PCIE port is allocated to the PCIE device hanging under the first PCIE port through the BIOS. Specifically, the computing device can send a scan request to the first PCIE port through the BIOS, and the BIOS allocates I / O resources, MMIO resources and the bus number corresponding to the first PCIE port to the PCIE device hanging under the first PCIE port according to the scan response. Among them, the scan response may include I / O resource demand information and MMIO resource demand information corresponding to the PCIE device. After the computing device allocates bus numbers to all devices hanging under the PCIE ports on the CPU through the BIOS in the order indicated by the priority configuration information, the computing device can start the operating system and start the PCIE devices in the order of the bus numbers (S505).
[0109] If the computing device does not obtain the priority configuration information of the PCIE port on the CPU, the computing device allocates bus numbers to the PCIE ports on the CPU through the BIOS in the order of the PCIE port numbers (S504). For example, in the order of PCIE0, PCIE1, PCIE2, ... PCIEN, bus numbers are allocated to the PCIE devices connected to the PCIE0 port, PCIE1 port, PCIE2 port, ... PCIEN port. Therefore, the computing device can start the operating system and start the PCIE devices in the order of the bus numbers (S505).
[0110] As can be seen from the above, the computing device can obtain the priority configuration information of the PCIE port on the CPU through the BIOS, and allocate bus numbers to the PCIE devices hanging under the PCIE port on the CPU in sequence through the BIOS in the order indicated by the priority configuration information. Among them, the order indicated by the priority configuration information is different from the order of the port numbers of the PCIE ports on the CPU. When allocating bus numbers to the PCIE devices hanging under the CPU, it is possible to avoid manual removal of the PCIE devices, and flexibly allocate bus numbers to the PCIE devices according to the bus numbers of the PCIE devices to be allocated as indicated by business needs.
[0111] The embodiment of the present application also provides a method for allocating bus serial numbers for PCIE devices connected to PCIE ports on at least two CPUs, which can be applied to a computing device. The computing device includes at least two CPUs. The method includes: the computing device can obtain priority information of at least two CPUs. According to the priority information of at least two CPUs, the first CPU to be scanned at the current moment is determined. The computing device determines the first PCIE port on the first CPU to be scanned at the current moment through BIOS according to the order indicated by the priority configuration information of the first CPU.
[0112] The priority information is used to indicate the order in which the BIOS scans the PCIE ports on at least two CPUs respectively.
[0113] Exemplarily, the computing device may obtain priority information of at least two CPUs, and scan the at least two CPUs in sequence through the BIOS in the order indicated by the priority information of the at least two CPUs. When the computing device scans the first CPU at the current moment through the BIOS, the computing device may allocate bus numbers to the PCIE devices connected to the PCIE port on the first CPU in sequence through the BIOS in the order indicated by the priority configuration information of the first CPU.
[0114] For example, the computing device includes CPU A1, CPU A2, and CPU A3. The computing device can receive priority information of CPU A1, CPU A2, and CPU A3. According to the priority information, it can be determined that the order of scanning CPU A1, CPU A2, and CPU A3 through BIOS is CPU A2, CPU A3, and CPU A1. Therefore, BIOS scans sequentially according to the scanning order. When the computing device scans CPU A2 through BIOS, the computing device can obtain the priority configuration information of the PCIE port on CPU A2. According to the order indicated by the priority configuration information, the computing device sequentially allocates bus numbers to the PCIE devices connected to the PCIE port on CPU A2 through BIOS. The specific method of allocating bus numbers is the same as that in the above embodiment. Figure 3 The method described in S103 is the same as that described in S103 and will not be repeated here.
[0115] As can be seen from the above, when at least two CPUs are included in the computing device, the computing device can determine the scanning order of at least two CPUs according to the priority information of the at least two CPUs. According to the scanning order, the computing device scans in sequence through the BIOS, and determines the scanning order of the PCIE port on the currently scanned CPU according to the priority configuration information of the PCIE port. The BIOS allocates bus numbers to the PCIE devices hanging under the PCIE port on the currently scanned CPU according to the scanning order of the PCIE port on the currently scanned CPU. It can be achieved that in the case of at least two CPUs, the bus numbers of the PCIE devices under the CPU are allocated respectively, which improves the flexibility and extensiveness of the bus number allocation method.
[0116] The above embodiment discusses the method for allocating bus numbers from the perspective of a computing device. The present application also provides a method for allocating bus numbers. The method can be applied to a display device, including displaying a BIOS menu interface of a computing device, the display device receiving a user operation on the BIOS menu interface, generating priority configuration information; and the display device sending the priority configuration information to the computing device.
[0117] Among them, the BIOS menu interface is used to configure the scanning priority of the PCIE port on the CPU of the computing device; the priority configuration information is used to indicate the order in which the BIOS scans the PCIE ports on the CPU; the order in which the PCIE ports are scanned indicated by the priority configuration information is different from the order of the port numbers of the PCIE ports; the size of the bus number allocated by the computing device to the PCIE port on the CPU is positively correlated with the scanning order indicated by the priority configuration information.
[0118] That is to say, the display device can generate the priority configuration information of the PCIE port on the CPU through the BIOS menu interface. The display device sends the generated priority configuration information to the BIOS of the computing device, so that the BIOS of the computing device can scan the PCIE ports on the CPU in sequence according to the order indicated by the priority configuration information. If there is a PCIE device hanging under the PCIE port on the CPU, the computing device allocates bus numbers to the PCIE devices hanging under the PCIE port on the CPU in sequence through BIOS.
[0119] Thus, the display device can display the BIOS menu interface, and in response to the received trigger operation, can generate the priority configuration information of the PCIE port on the CPU according to the user input. The display device can send the generated priority configuration information to the computing device, so that the computing device can complete the allocation of the bus sequence number in the order indicated by the priority configuration information. Through the human-computer interaction method, the configuration of the scanning order of the PCIE port on the CPU is more flexible and convenient, which can meet the different needs of users, thereby improving the allocation efficiency of the bus sequence number.
[0120] The above embodiments discuss the bus number allocation method from the perspectives of a computing device and a display device, respectively. The following will discuss the bus number allocation method from the perspective of interaction between a user computing device and a display device.
[0121] Figure 6 FIG. 1 is a schematic diagram of an interactive process for implementing a method for allocating bus numbers provided by an embodiment of the present application. Figure 6 As shown, it includes a computing device 110 and a display device 610. The display device 610 can display a BIOS menu interface (S601). The BIOS menu interface can be used to configure the priority configuration information of the PCIE port on the CPU. The display device can generate the priority configuration information of the PCIE port on the CPU in response to the received trigger operation (S602). Among them, the priority configuration information is used to indicate the order in which the BIOS scans the PCIE ports on the CPU in sequence, and at the same time, the order of scanning the PCIE ports in sequence indicated by the priority configuration information is different from the order of the port numbers of the PCIE ports. For example, a user can enter the priority configuration information of the PCIE port on the CPU through the BIOS menu interface. Alternatively, a user can click the priority configuration option through the BIOS menu to set the priority configuration information for at least one PCIE port.
[0122] After the display device generates the priority configuration information of the PCIE port on the CPU, the display device can send the priority configuration information to the BIOS of the computing device (S603). After the computing device obtains the priority configuration information through the BIOS (S604), the computing device can determine the first PCIE port to be scanned at the current moment through the BIOS in the order indicated by the priority configuration information (S605). For a detailed description of the above optional method, please refer to the above Figure 3 S102 in the method embodiment is not described here in detail. The computing device allocates a bus number corresponding to the first PCIE port to the PCIE device connected to the first PCIE port through BIOS (S606). For a detailed description of the above optional method, please refer to the above Figure 3 S103 in the method embodiment will not be described in detail here.
[0123] After the computing device allocates bus numbers to the PCIE devices connected to the PCIE ports on the CPU in sequence according to the order indicated by the priority configuration information through the BIOS, the computing device may send configuration result information to the display device (S607). The configuration result information is used to indicate the allocation result of the bus number of the PCIE device by the computing device. The display device may display the configuration result (S608). The user may determine the allocation result of the bus number of the PCIE device by the computing device based on the configuration result, and perform the next related business operation based on the configuration result.
[0124] In summary, the embodiment of the present application provides a method for allocating bus serial numbers, which can improve the efficiency of bus serial number allocation. The computing device can obtain the priority configuration information of the PCIE port on the CPU. According to the order indicated by the priority configuration information, the first PCIE port to be scanned at the current moment is determined by the BIOS. Among them, the priority configuration information can be used to indicate the order in which the BIOS scans the PCIE ports on the CPU in sequence. At the same time, the order of scanning the PCIE ports in sequence indicated by the priority configuration information is different from the order of the port numbers of the PCIE ports. When the computing device scans the first PCIE port through the BIOS, if it is determined that a PCIE device is hung under the first PCIE port, the computing device allocates the bus serial number corresponding to the first PCIE port to the PCIE device hung under the first PCIE port through the BIOS. The size of the bus serial number corresponding to the first PCIE port is positively correlated with the number of the second PCIE ports. Among them, the second PCIE port is a PCIE port on the CPU that has been scanned and determined to have a PCIE device hung under it before the current moment. It is possible to flexibly allocate bus serial numbers to the PCIE devices under the PCIE port on the CPU, avoid manually removing the PCIE device, and change the PCIE port number where the PCIE device is located, thereby greatly improving the efficiency of bus serial number allocation.
[0125] The above mainly introduces the scheme of the embodiment of the present application from the perspective of the method. It is understandable that in order to realize the above functions, the bus sequence number allocation device includes at least one of the hardware structure and software modules corresponding to the execution of each function. It should be easily appreciated by those skilled in the art that, in combination with the units and algorithm steps of each example described in the embodiments disclosed herein, the embodiments of the present application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a function is executed in the form of hardware or computer software driving hardware depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of the embodiments of the present application.
[0126] The embodiment of the present application can divide the bus sequence number allocation device into functional units according to the above method example. For example, each functional unit can be divided according to each function, or two or more functions can be integrated into one processing unit. The above integrated unit can be implemented in the form of hardware or in the form of software functional units. It should be noted that the division of units in the embodiment of the present application is schematic and is only a logical function division. There may be other division methods in actual implementation.
[0127] For example, Figure 7 FIG. 8 is a schematic diagram showing a structure of a bus number allocation device 800 provided in an embodiment of the present application. Figure 7 As shown, the bus number allocation device 800 can be applied to a computing device, and the bus number allocation device 800 includes:
[0128] An acquisition module 801 is used to acquire priority configuration information of a PCIE port on a CPU through a BIOS, where the priority configuration information is used to indicate an order in which the BIOS sequentially scans the PCIE ports on the CPU, wherein the order in which the PCIE ports are sequentially scanned indicated by the priority configuration information is different from an order in which the port numbers of the PCIE ports are respectively determined;
[0129] The processing module 802 is used to determine the first PCIE port being scanned at the current moment through the BIOS in the order indicated by the priority configuration information. If it is determined by scanning the first PCIE port that a PCIE device is hung under the first PCIE port, a bus number corresponding to the first PCIE port is allocated to the PCIE device hung under the first PCIE port through the BIOS, and the size of the bus number corresponding to the first PCIE port is positively correlated with the number of the second PCIE ports, and the second PCIE port is a PCIE port on the CPU that is determined to have a PCIE device hung under it through scanning before the current moment.
[0130] In a possible implementation, the acquisition module 801 is further configured to acquire the number n of the second PCIE ports, where n is an integer greater than or equal to 0.
[0131] In a possible implementation, the acquisition module 801 is further used to receive priority configuration information of a PCIE port on a CPU sent by a display device, where the display device is used to display a BIOS menu interface to a user.
[0132] In a possible implementation, the acquisition module 801 is further used to acquire priority information of at least two CPUs respectively, where the priority information is used to indicate the order in which the BIOS scans the PCIE ports on the at least two CPUs respectively.
[0133] In a possible implementation, the processing module 802 is further configured to allocate, through the BIOS, a bus number n corresponding to the first PCIE port to the PCIE device connected to the first PCIE port.
[0134] In a possible implementation, the processing module 802 is further configured to determine the first PCIE port to be scanned at the current moment through the BIOS according to the order indicated by the priority configuration information and the port number of the PCIE port. The PCIE ports whose order is not indicated in the priority configuration information are determined in the order of the size of the port number of the PCIE port in the process of scanning the PCIE port.
[0135] In a possible implementation, the processing module 802 is further configured to send a scan request to the first PCIE port through the BIOS. If the BIOS receives a scan response returned by the first PCIE port, the BIOS allocates I / O resources, MMIO resources, and a bus number corresponding to the first PCIE port to the PCIE device connected to the first PCIE port.
[0136] In a possible implementation, the processing module 802 is further configured to determine the first CPU to be scanned at the current moment according to the priority information of at least two CPUs. Determine the first PCIE port to be scanned at the current moment through the BIOS according to the order indicated by the priority configuration information, including determining the first PCIE port on the first CPU to be scanned at the current moment through the BIOS according to the order indicated by the priority configuration information of the first CPU.
[0137] Since the bus number allocation device 800 in the above embodiment can be applied to a computing device, Figure 1 The bus number allocation system is shown.
[0138] For example, Figure 8 FIG. 9 is a schematic diagram showing the structure of a bus number allocation device 900 provided in an embodiment of the present application. Figure 8 As shown, the bus number allocation device 900 can be applied to a display device, and the bus number allocation device 900 includes:
[0139] The display module 901 is used to display the BIOS menu interface of the computing device, where the BIOS menu interface is used to configure the scanning priority of the PCIE port on the CPU of the computing device.
[0140] Processing module 902 is used to receive user operations on the BIOS menu interface and generate priority configuration information, where the priority configuration information is used to indicate the order in which the BIOS scans the PCIE ports on the CPU; wherein the order in which the PCIE ports are scanned indicated by the priority configuration information is different from the order of the port numbers of the PCIE ports.
[0141] The sending module 903 is used to send priority configuration information to the computing device; wherein the size of the bus number allocated by the computing device to the PCIE port on the CPU is positively correlated with the scanning order indicated by the priority configuration information.
[0142] Since the bus number allocation device 900 in the above embodiment can be applied to a display device, Figure 1 The bus number allocation system is shown.
[0143] In addition, the explanation and description of the beneficial effects of any of the bus number allocation devices 800 and 900 provided above can refer to the corresponding method embodiments above, which will not be repeated here.
[0144] The embodiment of the present application also provides a computer-readable storage medium, in which at least one computer instruction is stored, and the at least one computer instruction is loaded and executed by a processor to implement the storage space management method described in each of the above embodiments. For the explanation of the relevant contents and the description of the beneficial effects in any of the above-mentioned computer-readable storage media, reference can be made to the above-mentioned corresponding embodiments, which will not be repeated here.
[0145] The present application embodiment also provides a computer program product including instructions, when the instructions are run on a computer, the computer executes any one of the bus sequence number allocation methods in the above embodiments. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on the computer, the process or function according to the embodiment of the present application is generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions may be transmitted from a website site, a computer, a server, or a data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (digital subscriber line, DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode to another website site, computer, server, or data center. The computer-readable storage medium may be any available medium that a computer can access or a data storage device such as a server, a data center, etc. that may be integrated with one or more media. The available medium may be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., an SSD), etc.
[0146] It should be noted that the above-mentioned device for storing computer instructions or computer programs provided in the embodiments of the present application, such as but not limited to, the above-mentioned memory, computer-readable storage medium and communication chip, etc., all have non-volatile (non-transitory). Those skilled in the art should be aware that in the above one or more examples, the functions described in the embodiments of the present application can be implemented with hardware, software, firmware or any combination thereof. When implemented using software, these functions can be stored in a computer-readable storage medium or transmitted as one or more instructions or codes on a computer-readable storage medium. Computer-readable storage media include computer storage media and communication media, wherein the communication medium includes any medium that is convenient for transmitting a computer program from one place to another. The storage medium can be any available medium that a general or special-purpose computer can access.
[0147] The above description is only an optional embodiment of the present application and is not intended to limit the present application. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application shall be included in the protection scope of the present application.
Claims
1. A method for allocating bus numbers, It is characterized in that The method is applied to a computing device, wherein the computing device runs a basic input and output system BIOS, and comprises: Acquire, through the BIOS, priority configuration information of the PCIE ports on the CPU, the priority configuration information being used to indicate an order in which the BIOS scans the PCIE ports on the CPU, wherein the order in which the PCIE ports are scanned indicated by the priority configuration information is different from an order of port numbers of the PCIE ports; Determine, by BIOS, the first PCIE port to be scanned at the current moment according to the order indicated by the priority configuration information; If it is determined by scanning the first PCIE port that a PCIE device is hung under the first PCIE port, the bus number corresponding to the first PCIE port is allocated to the PCIE device hung under the first PCIE port through the BIOS, and the size of the bus number corresponding to the first PCIE port is positively correlated with the number of second PCIE ports, and the second PCIE port is the PCIE port on the CPU that is determined to have a PCIE device hung under it through scanning before the current moment.
2. The method according to claim 1, It is characterized in that The priority configuration information includes the order information of the PCIE ports of each port number during the process of scanning the PCIE ports.
3. The method according to claim 1, It is characterized in that The priority configuration information includes information that a PCIE port with a specified port number is in a specified order during a process of scanning the PCIE ports.
4. The method according to claim 3, It is characterized in that The step of determining the first PCIE port to be scanned at the current moment by BIOS according to the order indicated by the priority configuration information includes: Determine, by BIOS, the first PCIE port to be scanned at the current moment according to the order indicated by the priority configuration information and the port number of the PCIE port; The PCIE ports whose priority is not indicated in the priority configuration information are ranked in the process of scanning the PCIE ports according to the order of the port numbers of the PCIE ports.
5. The method according to any one of claims 1 to 4, It is characterized in that If it is determined by scanning the first PCIE port that a PCIE device is connected to the first PCIE port, allocating a bus number corresponding to the first PCIE port to the PCIE device connected to the first PCIE port through BIOS, comprising: Sending a scan request to the first PCIE port through BIOS; If the BIOS receives the scan response returned by the first PCIE port, the BIOS allocates I / O resources, MMIO resources and a bus number corresponding to the first PCIE port to the PCIE device connected to the first PCIE port.
6. The method according to any one of claims 1 to 5, It is characterized in that The allocating, by BIOS, a bus number corresponding to the first PCIE port to the PCIE device connected to the first PCIE port, includes: Obtain the number n of the second PCIE ports, where n is an integer greater than or equal to 0; The bus number corresponding to the first PCIE port is assigned to the PCIE device connected to the first PCIE port through BIOS as n.
7. The method according to any one of claims 1 to 6, It is characterized in that Before obtaining the priority configuration information of the PCIE port on the CPU through the BIOS, the method further includes: The priority configuration information of the PCIE port on the CPU sent by a display device is received, and the display device is used to display a BIOS menu interface to a user.
8. The method according to any one of claims 1 to 7, It is characterized in that If the computing device includes at least two CPUs, and each CPU includes a PCIE port that supports configuration priority, before determining, by BIOS, the first PCIE port to be scanned at the current moment in the order indicated by the priority configuration information, the method further includes: Acquire priority information of each of the at least two CPUs, where the priority information is used to indicate the order in which the BIOS scans the PCIE ports on the at least two CPUs respectively; Determining a first CPU to be scanned at a current moment according to the priority information of the at least two CPUs; The step of determining the first PCIE port to be scanned at the current moment by BIOS according to the order indicated by the priority configuration information includes: The first PCIE port on the first CPU currently being scanned is determined through BIOS according to the order indicated by the priority configuration information of the first CPU.
9. A method for allocating bus numbers, It is characterized in that The method is applied to a display device, comprising: Displaying a BIOS menu interface of a computing device, wherein the BIOS menu interface is used to configure a scanning priority of a PCIE port on a CPU of the computing device; receiving a user operation on the BIOS menu interface, generating priority configuration information, wherein the priority configuration information is used to indicate an order in which the BIOS scans the PCIE ports on the CPU, wherein the order in which the PCIE ports are scanned indicated by the priority configuration information is different from an order of the port numbers of the PCIE ports; The priority configuration information is sent to the computing device; wherein the size of the bus number allocated by the computing device to the PCIE port on the CPU is positively correlated with the scanning order indicated by the priority configuration information.
10. A computing device, It is characterized in that The computing device includes: a processor and a memory for storing instructions executable by the processor; The processor is configured to execute the instructions so that the computing device performs the bus sequence number allocation method according to any one of claims 1 to 9.
