A resource allocation method and device of a data processing unit, an electronic device, and a storage medium

By reading and dynamically adjusting the initial and current position information of the DPU, the problems of inflexible and inaccurate DPU resource allocation are solved, and more efficient resource allocation is achieved.

CN119781844BActive Publication Date: 2026-04-17INSPUR SUZHOU INTELLIGENT TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
INSPUR SUZHOU INTELLIGENT TECH CO LTD
Filing Date
2024-12-27
Publication Date
2026-04-17

AI Technical Summary

Technical Problem

In existing technologies, the DPU resource allocation method is singular and inflexible, which requires code modification when the hardware location changes or the link design is altered, resulting in wasted manpower and inaccurate allocation.

Method used

Resource reservation is performed by reading the initial location information from the memory, and resource allocation is dynamically adjusted by combining the current location information and identifier matching to improve flexibility and accuracy.

Benefits of technology

It achieves flexibility and accuracy in DPU resource allocation, reduces the dependence of hardware changes on code, and improves the efficiency and accuracy of resource allocation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119781844B_ABST
    Figure CN119781844B_ABST
Patent Text Reader

Abstract

This application relates to a resource allocation method, apparatus, electronic device, and storage medium for a data processing unit. The method includes: in response to the Basic Input / Output System (BIOS) booting to the pre-firmware interface initialization phase, reading a location variable containing initial location information; in response to successful reading of the location variable, reserving resources for the data processing unit based on the initial location information; in response to the BIOS continuing booting to the PCIe device enumeration phase, traversing multiple PCIe devices to obtain corresponding multiple identification information, and determining whether the data processing unit is present based on the multiple identification information; in response to the data processing unit being present, obtaining current location information; and determining whether to allocate resources to the data processing unit based on the current location information and the initial location information, according to the initial location information and the resource reservation status. This method can improve the flexibility and accuracy of resource allocation for the data processing unit.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer technology, and in particular to a resource allocation method, apparatus, electronic device, and storage medium for a data processing unit. Background Technology

[0002] With the rapid growth and increasing complexity of data, many applications need to handle massive datasets. Traditional CPUs (Central Processing Units) may experience performance bottlenecks when handling this type of workload. Therefore, dedicated hardware devices for accelerating data processing, namely Data Processing Units (DPUs), have been introduced. DPUs can leverage their specific architecture and hardware design to efficiently execute parallel computing tasks, thus providing better performance and acceleration. Furthermore, DPUs are also commonly used in network devices, including processing data packets, executing protocol stacks, and network functions such as firewalls and VPNs (Virtual Private Networks). This helps improve network throughput, reduce latency, and support higher levels of network security and quality of service.

[0003] To better utilize the DPU, the BIOS (Basic Input Output System) must allocate the bus and MMIO (Memory-Mapped I / O) resources required by the DPU during the boot process to meet the DPU's operating environment. Currently, resources are allocated directly to the bus location where the DPU resides during BIOS startup, or during device enumeration, the device ID and vendor ID are checked to determine if the device is a DPU device before resource allocation. This allocation method is simplistic, and any changes in hardware location or link design require code modification and re-adaptation. This approach is clearly inflexible and wastes manpower.

[0004] Therefore, there is an urgent need to propose a resource allocation method, device, electronic device, and storage medium for a data processing unit that can improve the flexibility and accuracy of resource allocation. Summary of the Invention

[0005] Therefore, it is necessary to provide a resource allocation method, apparatus, electronic device, and storage medium for a data processing unit that can improve the flexibility and accuracy of resource allocation in the data processing unit, addressing the aforementioned technical problems.

[0006] Firstly, a resource allocation method for a data processing unit is provided, applied to a basic input / output system, the method comprising:

[0007] In response to the basic input / output system booting to the pre-firmware interface initialization phase, the position variables stored in the memory are read, where the position variables contain the initial position information of the data processing unit;

[0008] In response to the successful reading of the location variable, resources are reserved for the data processing unit based on the initial location information;

[0009] In response to the basic input / output system continuing to boot into the PCIe device enumeration stage, multiple PCIe devices are traversed to obtain the corresponding identification information, and the data processing unit is determined to be in place based on the multiple identification information;

[0010] In response to the presence of the data processing unit, obtain the current location information of the data processing unit;

[0011] Based on the current location information and the initial location information, determine whether to allocate resources to the data processing unit according to the initial location information and resource reservation.

[0012] In one embodiment, reserving resources for the data processing unit based on initial location information includes:

[0013] Obtain the first total resource amount, where the first total resource amount represents the total amount of bus resources;

[0014] Calculate the first fixed resource reserve based on the first total resource amount;

[0015] Subtract the first fixed resource reserve from the first total resource amount to obtain the first resource reserve to be allocated;

[0016] The first resource reservation amount of the data processing unit is calculated based on the initial location information, wherein the first resource reservation amount is less than the first resource reservation amount to be allocated;

[0017] Obtain the second total resource amount, where the second total resource amount represents the total amount of memory-mapped input / output resources;

[0018] Calculate the second fixed resource reserve based on the second total resource amount;

[0019] Subtract the second fixed resource reserve from the second total resource amount to obtain the second resource reserve to be allocated;

[0020] The second resource reservation amount of the data processing unit is calculated based on the initial location information, wherein the second resource reservation amount is less than the second resource reservation amount to be allocated.

[0021] In one embodiment, calculating the first resource reservation amount for the data processing unit based on the initial location information includes:

[0022] The interface information of the data processing unit is obtained from the initial location information. The interface information includes the interface connection type and the corresponding number of root ports. The interface connection type includes the first interface connection type and the second interface connection type.

[0023] In response to the interface connection type being the first interface connection type, the first resource reservation amount of the data processing unit is calculated based on the number of root ports corresponding to the first interface type;

[0024] In response to the interface connection type being the second interface connection type, the first resource reservation amount of the data processing unit is calculated based on the number of root ports corresponding to the second interface type.

[0025] In one embodiment, calculating the second resource reservation amount of the data processing unit based on the initial location information includes:

[0026] The interface information of the data processing unit is obtained from the initial location information. The interface information includes the interface connection type and the corresponding number of root ports. The interface connection type includes the first interface connection type and the second interface connection type.

[0027] In response to the interface connection type being the first interface connection type, the second resource reservation amount of the data processing unit is calculated based on the number of root ports corresponding to the first interface type;

[0028] In response to the interface connection type being the second interface connection type, the second resource reservation amount of the data processing unit is calculated based on the number of root ports corresponding to the second interface type.

[0029] In one embodiment, multiple PCIe devices are traversed to obtain corresponding identification information, and the presence of the data processing unit is determined based on the multiple identification information, including:

[0030] Iterate through multiple PCIe devices to obtain multiple corresponding first identification information, wherein the first identification information includes the device ID and manufacturer ID of the corresponding PCIe device;

[0031] Obtain the second identification information stored in the memory, wherein the second identification information includes the device ID and manufacturer ID of the data processing unit;

[0032] The second identifier information is matched with multiple first identifier information to obtain the identifier matching result;

[0033] The presence of the data processing unit is determined based on the identifier matching result.

[0034] In one embodiment, determining whether the data processing unit is in place based on the identifier matching result includes:

[0035] In response to the identifier matching result indicating that the second identifier information successfully matches one of the first identifier information, it is determined that the data processing unit is in place;

[0036] In response to the identifier matching result indicating that the second identifier information fails to match with multiple first identifier information, it is determined that the data processing unit is not in place.

[0037] In one embodiment, determining whether to allocate resources to the data processing unit based on the current location information and the initial location information, and the resource reservation status, includes:

[0038] The current location information is compared with the initial location information to obtain the location comparison result;

[0039] In response to the location comparison result indicating that the current location information is inconsistent with the initial location information, the initial location information in the location variable is changed to the current location information, and resources are allocated to the data processing unit according to the current location information and resource reservation.

[0040] In response to the location comparison result indicating that the current location information is consistent with the initial location information, resource allocation is performed on the data processing unit based on the initial location information and resource reservation.

[0041] The resource reservation status includes the first resource reservation amount and the second resource reservation amount.

[0042] Secondly, a resource allocation device for a data processing unit is provided, the device comprising:

[0043] The read module is used to read the position variables stored in the memory in response to the startup of the basic input / output system to the pre-firmware interface initialization phase. The position variables contain the initial position information of the data processing unit.

[0044] The resource reservation module is used to reserve resources for the data processing unit based on the initial location information in response to the successful reading of the location variable.

[0045] The traversal module is used to respond to the basic input / output system continuing to the PCIe device enumeration stage, traversing multiple PCIe devices to obtain the corresponding identification information;

[0046] The first judgment module is used to determine whether the data processing unit is in place based on multiple identification information;

[0047] The acquisition module is used to acquire the current location information of the data processing unit in response to the data processing unit being in place.

[0048] The second judgment module is used to determine whether to allocate resources to the data processing unit based on the current location information and the initial location information, and the resource reservation status.

[0049] Thirdly, an electronic device is provided, comprising one or more processors; and a memory associated with the one or more processors, the memory for storing program instructions, which, when read and executed by the one or more processors, perform the steps of any of the methods described in the first aspect above.

[0050] Fourthly, a computer-readable storage medium is provided, on which a computer program is stored, wherein when the computer program is executed by a processor, the steps of any one of the methods described in the first aspect are performed.

[0051] Fifthly, a computer program product is provided, comprising a computer program that, when executed by a processor, implements the steps of any one of the methods described in the first aspect above.

[0052] The resource allocation method, apparatus, electronic device, and storage medium of the aforementioned data processing unit perform resource reservation processing based on the initial position information of the data processing unit pre-stored in the memory, thereby improving the accuracy of resource allocation for the data processing unit; and further, based on the comparison result between the current position information and the initial position information of the data processing unit, it is determined whether to allocate resources to the data processing unit according to the initial position information and the resource reservation status, thereby improving the flexibility of resource allocation for the data processing unit. Attached Figure Description

[0053] Figure 1 This is a flowchart illustrating the resource allocation method of a data processing unit in one embodiment;

[0054] Figure 2 This is a schematic diagram showing the connection of the initial position information of the data processing unit in one embodiment;

[0055] Figure 3 This is a detailed flowchart of the resource allocation method for a data processing unit in one embodiment;

[0056] Figure 4 This is a structural block diagram of the resource allocation device of the data processing unit in one embodiment;

[0057] Figure 5 This is a diagram of the internal structure of an electronic device in one embodiment. Detailed Implementation

[0058] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.

[0059] Example 1

[0060] In one embodiment, such as Figure 1 As shown, a resource allocation method for a data processing unit is provided, applied to a basic input / output system. The method includes:

[0061] In response to the basic input / output system booting to the pre-firmware interface initialization phase, the position variables stored in the memory are read, where the position variables contain the initial position information of the data processing unit;

[0062] In response to the successful reading of the location variable, resources are reserved for the data processing unit based on the initial location information;

[0063] In response to the basic input / output system continuing to boot into the PCIe device enumeration stage, multiple PCIe devices are traversed to obtain the corresponding identification information, and the data processing unit is determined to be in place based on the multiple identification information;

[0064] In response to the presence of the data processing unit, obtain the current location information of the data processing unit;

[0065] Based on the current location information and the initial location information, determine whether to allocate resources to the data processing unit according to the initial location information and resource reservation.

[0066] Specifically, resource reservation is performed based on the initial position information of the data processing unit pre-stored in the memory, which improves the accuracy of resource allocation for the data processing unit; then, based on the comparison result between the current position information and the initial position information of the data processing unit, it is determined whether to allocate resources to the data processing unit according to the initial position information and the resource reservation status, which improves the flexibility of resource allocation for the data processing unit.

[0067] In one embodiment, reserving resources for the data processing unit based on initial location information includes:

[0068] Obtain the first total resource amount, where the first total resource amount represents the total amount of bus resources;

[0069] Calculate the first fixed resource reserve based on the first total resource amount;

[0070] Subtract the first fixed resource reserve from the first total resource amount to obtain the first resource reserve to be allocated;

[0071] The first resource reservation amount of the data processing unit is calculated based on the initial location information, wherein the first resource reservation amount is less than the first resource reservation amount to be allocated;

[0072] Obtain the second total resource amount, where the second total resource amount represents the total amount of memory-mapped input / output resources;

[0073] Calculate the second fixed resource reserve based on the second total resource amount;

[0074] Subtract the second fixed resource reserve from the second total resource amount to obtain the second resource reserve to be allocated;

[0075] The second resource reservation amount of the data processing unit is calculated based on the initial location information, wherein the second resource reservation amount is less than the second resource reservation amount to be allocated.

[0076] Specifically, the first and second resource reservations are calculated to facilitate subsequent resource allocation to the data processing unit, thereby improving the accuracy of resource allocation within the data processing unit.

[0077] In a specific embodiment, when allocating bus resources, a first resource reservation main function, such as `CalculateBusResourcesPerSocket()`, first calculates how many buses need to be reserved in the socket for UBOX / accelerators, etc. Then, a first preset function `AddRsvdBus()` is added to the first resource reservation main function to determine how many buses need to be reserved in the socket for the DPU based on the initial position information of the DPU stored in the position variable. Similarly, a second resource reservation main function, such as `CalculateMmiolResources()`, first calculates the fixed reserved mmio resources. Then, a second preset function `AddRsvdMmio()` is added to the second resource reservation main function to determine how many mmio resources to allocate to the DPU based on the initial position information of the DPU.

[0078] In one embodiment, calculating the first resource reservation amount for the data processing unit based on initial location information includes:

[0079] The interface information of the data processing unit is obtained from the initial location information. The interface information includes the interface connection type and the corresponding number of root ports. The interface connection type includes the first interface connection type and the second interface connection type.

[0080] In response to the interface connection type being the first interface connection type, the first resource reservation amount of the data processing unit is calculated based on the number of root ports corresponding to the first interface type;

[0081] In response to the interface connection type being the second interface connection type, the first resource reservation amount of the data processing unit is calculated based on the number of root ports corresponding to the second interface type.

[0082] Specifically, based on the interface connection type and the corresponding number of root ports in the initial location information, the first resource reservation is determined so that the first resource reservation can be allocated to the data processing unit later, thereby improving the accuracy of resource allocation for the data processing unit.

[0083] In a specific implementation, the SetBusBaseAndLimit() function calculates how many buses each stack is specifically assigned to. For example... Figure 2 As shown, the first interface connection type, Single-host, occupies a x16 root port, so 64 buses need to be allocated to the corresponding stack. The second interface connection type, Multi-host, occupies two x8 root ports, and theoretically, 32 buses should be allocated to the corresponding stack. At this point, we need to pay attention to the compatibility with hardware devices. The first 8 lanes of some PE ports may contain hardware devices such as VGA / M.2 / USB, so these ports need to be allocated separately. For example, allocate (32+7) buses (VGA:2, M.2:2, USB:1, RootPort:1) to this stack. If the stack does not contain other hardware, allocate (32+3) buses.

[0084] In one embodiment, calculating the second resource reservation amount for the data processing unit based on the initial location information includes:

[0085] The interface information of the data processing unit is obtained from the initial location information. The interface information includes the interface connection type and the corresponding number of root ports. The interface connection type includes the first interface connection type and the second interface connection type.

[0086] In response to the interface connection type being the first interface connection type, the second resource reservation amount of the data processing unit is calculated based on the number of root ports corresponding to the first interface type;

[0087] In response to the interface connection type being the second interface connection type, the second resource reservation amount of the data processing unit is calculated based on the number of root ports corresponding to the second interface type.

[0088] Specifically, based on the interface connection type and the corresponding number of root ports in the initial location information, the second resource reservation is determined so that the second resource reservation can be allocated to the data processing unit later, thereby improving the accuracy of resource allocation for the data processing unit.

[0089] In one embodiment, such as Figure 3As shown, multiple PCIe devices are traversed to obtain corresponding identification information, and the presence of the data processing unit is determined based on the identification information, including:

[0090] Iterate through multiple PCIe devices to obtain multiple corresponding first identification information, wherein the first identification information includes the device ID and manufacturer ID of the corresponding PCIe device;

[0091] Obtain the second identification information stored in the memory, wherein the second identification information includes the device ID and manufacturer ID of the data processing unit;

[0092] The second identifier information is matched with multiple first identifier information to obtain the identifier matching result;

[0093] The presence of the data processing unit is determined based on the identifier matching result.

[0094] In one embodiment, determining whether a data processing unit is in place based on the identifier matching result includes:

[0095] In response to the identifier matching result indicating that the second identifier information successfully matches one of the first identifier information, it is determined that the data processing unit is in place;

[0096] In response to the identifier matching result indicating that the second identifier information fails to match with multiple first identifier information, it is determined that the data processing unit is not in place.

[0097] In one embodiment, determining whether to allocate resources to the data processing unit based on the current location information and the initial location information, and the resource reservation status, includes:

[0098] The current location information is compared with the initial location information to obtain the location comparison result;

[0099] In response to the location comparison result indicating that the current location information is inconsistent with the initial location information, the initial location information in the location variable is changed to the current location information, and resources are allocated to the data processing unit according to the current location information and resource reservation.

[0100] In response to the location comparison result indicating that the current location information is consistent with the initial location information, resource allocation is performed on the data processing unit based on the initial location information and resource reservation.

[0101] The resource reservation status includes the first resource reservation amount and the second resource reservation amount.

[0102] Specifically, the initial location information includes the initial address of the data processing unit, and the current location information includes the current address of the data processing unit. Based on the location comparison result, it is determined whether to allocate the first resource reservation and the second resource reservation to the initial address or the current address of the data processing unit, thereby improving the flexibility of resource allocation for the data processing unit.

[0103] In one embodiment, such as Figure 3 As shown, the method also includes:

[0104] In response to a location variable read failure, wait for the Basic Input / Output System to enter the PCIe device enumeration phase;

[0105] In response to the basic input / output system continuing to boot into the PCIe device enumeration stage, multiple PCIe devices are traversed to obtain the corresponding identification information, and the data processing unit is determined to be in place based on the multiple identification information;

[0106] In response to the presence of the data processing unit, the current location information of the data processing unit is obtained, and resources are reserved for the data processing unit based on the current location information;

[0107] Allocate resources to the data processing unit based on current location information and resource reservation status;

[0108] In response to the data processing unit being out of place, the current location information of the data processing unit is set to empty, and the location comparison result is set to inconsistent;

[0109] Change the initial position information in the position variable to empty, and reallocate resources to the data processing unit.

[0110] Specifically, when reading a location variable fails and the data processing unit is in place, resources are reserved based on the current location information, and resources are allocated to the data processing unit based on the current location information and resource reservation. When reading a data variable fails and the data processing unit is not in place, resources are reallocated to the data processing unit. This improves the flexibility and accuracy of resource allocation for the data processing unit.

[0111] It should be understood that, although Figure 1 , Figure 3 The steps in the flowchart are shown sequentially as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified in this document, there is no strict order in which these steps are executed, and they can be performed in other orders. Figure 1 , Figure 3At least some of the steps in the process may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be executed in turn or alternately with other steps or at least some of the sub-steps or stages of other steps.

[0112] Example 2

[0113] In one embodiment, such as Figure 4 As shown, a resource allocation device for a data processing unit is provided, the device comprising:

[0114] The read module is used to read the position variables stored in the memory in response to the startup of the basic input / output system to the pre-firmware interface initialization phase. The position variables contain the initial position information of the data processing unit.

[0115] The resource reservation module is used to reserve resources for the data processing unit based on the initial location information in response to the successful reading of the location variable.

[0116] The traversal module is used to respond to the basic input / output system continuing to the PCIe device enumeration stage, traversing multiple PCIe devices to obtain the corresponding identification information;

[0117] The first judgment module is used to determine whether the data processing unit is in place based on multiple identification information;

[0118] The acquisition module is used to acquire the current location information of the data processing unit in response to the data processing unit being in place.

[0119] The second judgment module is used to determine whether to allocate resources to the data processing unit based on the current location information and the initial location information, and the resource reservation status.

[0120] In one embodiment, the resource reservation module is used for:

[0121] Obtain the first total resource amount, where the first total resource amount represents the total amount of bus resources;

[0122] Calculate the first fixed resource reserve based on the first total resource amount;

[0123] Subtract the first fixed resource reserve from the first total resource amount to obtain the first resource reserve to be allocated;

[0124] The first resource reservation amount of the data processing unit is calculated based on the initial location information, wherein the first resource reservation amount is less than the first resource reservation amount to be allocated;

[0125] Obtain the second total resource amount, where the second total resource amount represents the total amount of memory-mapped input / output resources;

[0126] Calculate the second fixed resource reserve based on the second total resource amount;

[0127] Subtract the second fixed resource reserve from the second total resource amount to obtain the second resource reserve to be allocated;

[0128] The second resource reservation amount of the data processing unit is calculated based on the initial location information, wherein the second resource reservation amount is less than the second resource reservation amount to be allocated.

[0129] In one embodiment, the resource reservation module is used to calculate a first resource reservation amount for the data processing unit based on the initial location information, including:

[0130] The interface information of the data processing unit is obtained from the initial location information. The interface information includes the interface connection type and the corresponding number of root ports. The interface connection type includes the first interface connection type and the second interface connection type.

[0131] In response to the interface connection type being the first interface connection type, the first resource reservation amount of the data processing unit is calculated based on the number of root ports corresponding to the first interface type;

[0132] In response to the interface connection type being the second interface connection type, the first resource reservation amount of the data processing unit is calculated based on the number of root ports corresponding to the second interface type.

[0133] In one embodiment, the resource reservation module is used to calculate a second resource reservation amount for the data processing unit based on the initial location information, including:

[0134] The interface information of the data processing unit is obtained from the initial location information. The interface information includes the interface connection type and the corresponding number of root ports. The interface connection type includes the first interface connection type and the second interface connection type.

[0135] In response to the interface connection type being the first interface connection type, the second resource reservation amount of the data processing unit is calculated based on the number of root ports corresponding to the first interface type;

[0136] In response to the interface connection type being the second interface connection type, the second resource reservation amount of the data processing unit is calculated based on the number of root ports corresponding to the second interface type.

[0137] In one embodiment, the traversal module and the first judgment module are used for:

[0138] Iterate through multiple PCIe devices to obtain multiple corresponding first identification information, wherein the first identification information includes the device ID and manufacturer ID of the corresponding PCIe device;

[0139] Obtain the second identification information stored in the memory, wherein the second identification information includes the device ID and manufacturer ID of the data processing unit;

[0140] The second identifier information is matched with multiple first identifier information to obtain the identifier matching result;

[0141] The presence of the data processing unit is determined based on the identifier matching result.

[0142] In one embodiment, the traversal module and the first judgment module are used to determine whether the data processing unit is in place based on the identifier matching result, including:

[0143] In response to the identifier matching result indicating that the second identifier information successfully matches one of the first identifier information, it is determined that the data processing unit is in place;

[0144] In response to the identifier matching result indicating that the second identifier information fails to match with multiple first identifier information, it is determined that the data processing unit is not in place.

[0145] In one embodiment, the second determination module is used for:

[0146] The current location information is compared with the initial location information to obtain the location comparison result;

[0147] In response to the location comparison result indicating that the current location information is inconsistent with the initial location information, the initial location information in the location variable is changed to the current location information, and resources are allocated to the data processing unit according to the current location information and resource reservation.

[0148] In response to the location comparison result indicating that the current location information is consistent with the initial location information, resource allocation is performed on the data processing unit based on the initial location information and resource reservation.

[0149] The resource reservation status includes the first resource reservation amount and the second resource reservation amount.

[0150] Specific limitations regarding the resource allocation device of the data processing unit can be found in the limitations on the resource allocation method of the data processing unit above, and will not be repeated here. Each module in the resource allocation device of the aforementioned data processing unit can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in hardware or independently of the processor in the electronic device, or stored in software in the memory of the electronic device, so that the processor can call and execute the operations corresponding to each module.

[0151] Example 3

[0152] In one embodiment, an electronic device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to perform the following steps:

[0153] In response to the basic input / output system booting to the pre-firmware interface initialization phase, the position variables stored in the memory are read, where the position variables contain the initial position information of the data processing unit;

[0154] In response to the successful reading of the location variable, resources are reserved for the data processing unit based on the initial location information;

[0155] In response to the basic input / output system continuing to boot into the PCIe device enumeration stage, multiple PCIe devices are traversed to obtain the corresponding identification information, and the data processing unit is determined to be in place based on the multiple identification information;

[0156] In response to the presence of the data processing unit, obtain the current location information of the data processing unit;

[0157] Based on the current location information and the initial location information, determine whether to allocate resources to the data processing unit according to the initial location information and resource reservation.

[0158] When the program instructions are read and executed by one or more processors, they can also perform operations corresponding to the steps in the above method embodiments, as described above, and will not be repeated here. Reference Figure 5 This exemplifies the architecture of an electronic device, which may include a processor 510, a video display adapter 511, a disk drive 512, an input / output interface 513, a network interface 514, and a memory 520. The processor 510, video display adapter 511, disk drive 512, input / output interface 513, network interface 514, and memory 520 can communicate with each other via a communication bus 530.

[0159] The processor 510 can be implemented using a general-purpose central processing unit (CPU), microprocessor, application-specific integrated circuit (ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solution provided in this application.

[0160] The memory 520 can be implemented as a read-only memory (ROM), random access memory (RAM), static storage device, dynamic storage device, etc. The memory 520 can store the operating system 521 for controlling the operation of the electronic device 500, and the basic input / output system (BIOS) 522 for controlling the low-level operations of the electronic device 500. Additionally, it can store a web browser 523, data storage management 524, and an icon / font processing system 525, etc. The aforementioned icon / font processing system 525 can be the application program that specifically implements the aforementioned steps in this embodiment. In summary, when implementing the technical solution provided in this application through software or firmware, the relevant program code is stored in the memory 520 and executed by the processor 510.

[0161] Input / output interface 513 is used to connect input / output modules to realize information input and output. Input / output modules can be configured as components in the device (not shown in the figure) or externally connected to the device to provide corresponding functions. Input devices may include keyboards, mice, touch screens, microphones, various sensors, etc., and output devices may include displays, speakers, vibrators, indicator lights, etc.

[0162] Network interface 514 is used to connect a communication module (not shown in the figure) to enable communication between this device and other devices. The communication module can communicate via wired means (such as USB, Ethernet cable, etc.) or wireless means (such as mobile network, WIFI, Bluetooth, etc.).

[0163] Bus 530 includes a pathway for transmitting information between various components of the device, such as processor 510, video display adapter 511, disk drive 512, input / output interface 513, network interface 514, and memory 520.

[0164] In addition, the electronic device 500 can also obtain information on specific acquisition conditions from the virtual resource object acquisition condition information database 541 for condition judgment, etc.

[0165] It should be noted that although the above-described electronic device 500 only shows a processor 510, a video display adapter 511, a disk drive 512, an input / output interface 513, a network interface 514, a memory 520, and a bus 530, in specific implementations, the electronic device may also include other components necessary for normal operation. Furthermore, those skilled in the art will understand that the above-described device may only include the components necessary for implementing the solution of this application, and does not necessarily include all the components shown in the figures.

[0166] As can be seen from the above description of the embodiments, those skilled in the art can clearly understand that this application can be implemented by means of software plus necessary general-purpose hardware platforms. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause an electronic device (which may be a personal computer, cloud server, or network device, etc.) to execute the methods of various embodiments or some parts of the embodiments of this application.

[0167] Example 4

[0168] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon, the computer program performing the following steps when executed by a processor:

[0169] In response to the basic input / output system booting to the pre-firmware interface initialization phase, the position variables stored in the memory are read, where the position variables contain the initial position information of the data processing unit;

[0170] In response to the successful reading of the location variable, resources are reserved for the data processing unit based on the initial location information;

[0171] In response to the basic input / output system continuing to boot into the PCIe device enumeration stage, multiple PCIe devices are traversed to obtain the corresponding identification information, and the data processing unit is determined to be in place based on the multiple identification information;

[0172] In response to the presence of the data processing unit, obtain the current location information of the data processing unit;

[0173] Based on the current location information and the initial location information, determine whether to allocate resources to the data processing unit according to the initial location information and resource reservation.

[0174] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium. When executed, the computer program can include the processes of the embodiments of the above methods. Any references to memory, storage, databases, or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), RAMbus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and RAMbus dynamic RAM (RDRAM), etc.

[0175] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0176] The above embodiments merely illustrate several implementation methods of this application, and while the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the invention patent. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this patent application should be determined by the appended claims.

[0177] Example 5

[0178] In one embodiment, a computer program product is provided, on which a computer program is stored, the computer program performing the following steps when executed by a processor:

[0179] In response to the basic input / output system booting to the pre-firmware interface initialization phase, the position variables stored in the memory are read, where the position variables contain the initial position information of the data processing unit;

[0180] In response to the successful reading of the location variable, resources are reserved for the data processing unit based on the initial location information;

[0181] In response to the basic input / output system continuing to boot into the PCIe device enumeration stage, multiple PCIe devices are traversed to obtain the corresponding identification information, and the data processing unit is determined to be in place based on the multiple identification information;

[0182] In response to the presence of the data processing unit, obtain the current location information of the data processing unit;

[0183] Based on the current location information and the initial location information, determine whether to allocate resources to the data processing unit according to the initial location information and resource reservation.

[0184] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a computer program product, and when the computer program is executed, it can include the processes of the embodiments of the methods described above.

[0185] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0186] The above embodiments merely illustrate several implementation methods of this application, and while the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the invention patent. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this patent application should be determined by the appended claims.

Claims

1. A resource allocation method of a data processing unit applied to a basic input output system, characterized by, The method includes: In response to the basic input / output system booting to the pre-firmware interface initialization phase, a position variable stored in memory is read, wherein the position variable contains the initial position information of the data processing unit; In response to the successful reading of the location variable, resources are reserved for the data processing unit based on the initial location information; In response to the basic input / output system continuing to boot into the PCIe device enumeration stage, multiple PCIe devices are traversed to obtain corresponding identification information, and the data processing unit is determined to be in place based on the multiple identification information; In response to the data processing unit being in place, the current location information of the data processing unit is obtained; Based on the current location information and the initial location information, determine whether to allocate resources to the data processing unit based on the initial location information and resource reservation status; The process of reserving resources for the data processing unit based on the initial location information includes: Obtain the first total resource amount, where the first total resource amount represents the total amount of bus resources; Based on the first total resource amount, calculate the first fixed resource reserve amount; Subtract the first fixed resource reserve from the first total resource amount to obtain the first resource reserve to be allocated; The first resource reservation amount of the data processing unit is calculated based on the initial location information, wherein the first resource reservation amount is less than the first resource reservation amount to be allocated; Obtain the second total resource amount, where the second total resource amount represents the total amount of memory-mapped input / output resources; Based on the second total resource amount, calculate the second fixed resource reserve; Subtract the second fixed resource reserve from the second total resource amount to obtain the second resource reserve to be allocated; The second resource reservation amount of the data processing unit is calculated based on the initial location information, wherein the second resource reservation amount is less than the second resource reservation amount to be allocated.

2. The method according to claim 1, characterized in that, Calculating the first resource reservation amount of the data processing unit based on the initial location information includes: The interface information of the data processing unit is obtained from the initial location information, wherein the interface information includes the interface connection type and the corresponding number of root ports, and the interface connection type includes a first interface connection type and a second interface connection type. In response to the interface connection type being the first interface connection type, the first resource reservation amount of the data processing unit is calculated based on the number of root ports corresponding to the first interface connection type. In response to the interface connection type being the second interface connection type, the first resource reservation amount of the data processing unit is calculated based on the number of root ports corresponding to the second interface connection type.

3. The method according to claim 1, characterized in that, The second resource reservation amount of the data processing unit is calculated based on the initial location information, including: The interface information of the data processing unit is obtained from the initial location information, wherein the interface information includes the interface connection type and the corresponding number of root ports, and the interface connection type includes a first interface connection type and a second interface connection type. In response to the interface connection type being the first interface connection type, the second resource reservation amount of the data processing unit is calculated based on the number of root ports corresponding to the first interface connection type. In response to the interface connection type being the second interface connection type, the second resource reservation amount of the data processing unit is calculated based on the number of root ports corresponding to the second interface connection type.

4. The method according to claim 1, characterized in that, The process involves iterating through multiple PCIe devices to obtain corresponding identification information, and determining whether the data processing unit is present based on the identification information, including: Multiple PCIe devices are traversed to obtain multiple corresponding first identification information, wherein the first identification information includes the device ID and manufacturer ID of the corresponding PCIe device; Obtain the second identification information stored in the memory, wherein the second identification information includes the device ID and manufacturer ID of the data processing unit; The second identifier information is matched with multiple first identifier information to obtain an identifier matching result; The presence or absence of the data processing unit is determined based on the identifier matching result.

5. The method according to claim 4, characterized in that, Determining whether the data processing unit is in place based on the identifier matching result includes: In response to the identifier matching result indicating that the second identifier information successfully matches one of the first identifier information, it is determined that the data processing unit is in place; In response to the identifier matching result indicating that the second identifier information fails to match with multiple first identifier information, it is determined that the data processing unit is not in place.

6. The method according to claim 1, characterized in that, Based on the current location information and the initial location information, determine whether to allocate resources to the data processing unit according to the initial location information and resource reservation status, including: The current location information is compared with the initial location information to obtain the location comparison result; In response to the location comparison result indicating that the current location information is inconsistent with the initial location information, the initial location information in the location variable is changed to the current location information, and resources are allocated to the data processing unit according to the current location information and resource reservation. In response to the location comparison result indicating that the current location information is consistent with the initial location information, resource allocation is performed on the data processing unit based on the initial location information and resource reservation status; The resource reservation status includes a first resource reservation amount and a second resource reservation amount.

7. A resource allocation apparatus for a data processing unit used to implement the resource allocation method of the data processing unit according to claim 1, characterized in that, The device includes: A reading module is configured to read a position variable stored in a memory in response to the startup of the basic input / output system to the pre-firmware interface initialization phase, wherein the position variable contains the initial position information of the data processing unit; A resource reservation module is used to reserve resources for the data processing unit based on the initial location information in response to the successful reading of the location variable. The traversal module is used to traverse multiple PCIe devices to obtain corresponding identification information in response to the basic input / output system continuing to boot into the PCIe device enumeration stage; The first judgment module is used to determine whether the data processing unit is in place based on the plurality of identification information; An acquisition module is configured to acquire the current location information of the data processing unit in response to the data processing unit being in place. The second judgment module is used to determine whether to allocate resources to the data processing unit based on the current location information and the initial location information, and the resource reservation status.

8. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 6.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 6.

Citation Information

Patent Citations

  • Bus resource reservation method and device, equipment and storage medium

    CN114020344A

  • Method for cooperatively processing computing task by multiple mobile auditing devices in edge computing environment

    CN114675955A