Resource allocation method and device for data processing unit, electronic equipment and storage medium

By reading and using the initial location information of the data processing unit during the BIOS startup process for resource reservation, and dynamically adjusting resource allocation during the PCIE device enumeration stage, the problems of inflexible and inaccurate resource allocation in the existing technology are solved, and more efficient human-computer interaction and resource utilization are achieved.

CN119781844AActive Publication Date: 2025-04-08INSPUR SUZHOU INTELLIGENT TECH CO LTD

Patent Information

Application Number
CN202411945266.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-27
Publication Date
2025-04-08
Estimated Expiration
2044-12-27

AI Technical Summary

Technical Problem

The prior art lacks flexibility and accuracy in allocating data processing unit (DPU) resources, resulting in the need to modify code when hardware location changes or link design changes, resulting in waste of manpower.

Method used

By reading the position variables stored in the memory during the BIOS startup process, the initial position information of the data processing unit is obtained, and resource reservation is made based on this information. Subsequently, multiple PCIE devices are traversed in the PCIE device enumeration stage, and whether the data processing unit is in place is determined based on the current and initial position information is used to determine whether resource allocation is performed.

Benefits of technology

It improves the flexibility and accuracy of resource allocation of data processing units, reduces the need for code modification when hardware changes, and reduces labor costs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119781844A_ABST
    Figure CN119781844A_ABST
Patent Text Reader

Abstract

The invention relates to a resource allocation method and device of a data processing unit, electronic equipment and a storage medium. The method comprises the steps that in response to the fact that a basic input and output system is started to a pre-firmware interface initialization stage, a position variable is read, and the position variable comprises initial position information; in response to successful reading of the position variable, performing resource reservation on the data processing unit according to the initial position information; responding to the condition that the basic input and output system continues to be started to the PCIE equipment enumeration stage, traversing the multiple pieces of PCIE equipment to obtain multiple pieces of corresponding identification information, and judging whether the data processing unit is in place or not according to the multiple pieces of identification information; acquiring current position information in response to the fact that the data processing unit is in place; and according to the current position information and the initial position information, determining whether to perform resource allocation on the data processing unit according to the initial position information and the resource reservation condition. By adopting the method, the flexibility and accuracy of resource allocation of the data processing unit can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

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

[0002] With the rapid growth of data volume and increasing complexity, many applications need to process large-scale data sets. Traditional CPUs (Central Processing Units) may have performance bottlenecks when processing this type of workload. Therefore, a hardware device specifically designed to accelerate data processing, namely DPU (Data Processing Unit), was introduced. DPU can efficiently perform parallel computing tasks using its specific architecture and hardware design, thereby providing better performance and acceleration. And 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 to improve network throughput, reduce latency, and support higher levels of network security and quality of service.

[0003] In order to make better use of the DPU, the BIOS (Basic Input Output System) must allocate the bus resources and mmio (Memory-Mapped I / O) resources required by the DPU in advance during the boot process to meet the operating environment of the DPU. Currently, fixed resources are directly allocated to the bus position where the DPU is located during the BIOS startup process, or the device ID and manufacturer ID of the device are determined to be a DPU device during the device enumeration process, and then resources are allocated to the device. The allocation method is single, and once the hardware position changes or the link design changes, the code needs to be modified and re-adapted. This allocation method is obviously not flexible enough and causes a waste of 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 of the data processing unit. Summary of the invention

[0005] Based on this, it is necessary to provide 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 of the data processing unit in response to the above technical problems.

[0006] In a first aspect, a resource allocation method for a data processing unit is provided, which is applied to a basic input and output system. The method comprises:

[0007] In response to the basic input and output system starting up to the pre-firmware interface initialization phase, reading the position variable stored in the memory, wherein the position variable includes initial position information of the data processing unit;

[0008] In response to the position variable being read successfully, reserving resources for the data processing unit according to the initial position information;

[0009] In response to the basic input and output system continuing to start up to the PCIE device enumeration phase, traversing multiple PCIE devices to obtain corresponding multiple identification information, and judging whether the data processing unit is in place according to the multiple identification information;

[0010] In response to the data processing unit being in position, obtaining current position information of the data processing unit;

[0011] According to the current location information and the initial location information, it is determined whether to allocate resources to the data processing unit according to the initial location information and the resource reservation status.

[0012] In one embodiment, reserving resources for a data processing unit according to the initial location information includes:

[0013] Acquire a first total amount of resources, wherein the first total amount of resources represents a total amount of bus resources;

[0014] Calculating a first fixed resource reservation amount based on the first total resource amount;

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

[0016] Calculate a first resource reservation amount of the data processing unit according to the initial position information, wherein the first resource reservation amount is less than a first resource reservation amount to be allocated;

[0017] Obtaining a second total amount of resources, wherein the second total amount of resources represents a total amount of memory-mapped input / output resources;

[0018] Calculating a second fixed resource reservation amount based on the second total resource amount;

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

[0020] A second resource reservation amount of the data processing unit is calculated according to the initial position information, wherein the second resource reservation amount is smaller than the second resource reservation amount to be allocated.

[0021] In one of the embodiments, calculating the first resource reservation amount of the data processing unit according to the initial location information includes:

[0022] Acquire interface information of the data processing unit from the initial position information, wherein the interface information includes an interface connection type and a corresponding number of root ports, and the interface connection type includes a first interface connection type and a second interface connection type;

[0023] In response to the interface connection type being the first interface connection type, calculating a first resource reservation amount of the data processing unit according to 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, a first resource reservation amount of the data processing unit is calculated according to the number of root ports corresponding to the second interface type.

[0025] In one of the embodiments, calculating the second resource reservation amount of the data processing unit according to the initial location information includes:

[0026] Acquire interface information of the data processing unit from the initial position information, wherein the interface information includes an interface connection type and a corresponding number of root ports, and the interface connection type includes a first interface connection type and a second interface connection type;

[0027] In response to the interface connection type being the first interface connection type, calculating a second resource reservation amount of the data processing unit according to 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, a second resource reservation amount of the data processing unit is calculated according to the number of root ports corresponding to the second interface type.

[0029] In one embodiment, traversing multiple PCIE devices to obtain corresponding multiple identification information, and judging whether the data processing unit is in place according to the multiple identification information, includes:

[0030] Traversing multiple PCIE devices to obtain corresponding multiple first identification information, wherein the first identification information includes a device ID and a manufacturer ID of the corresponding PCIE device;

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

[0032] Matching the second identification information with the plurality of first identification information to obtain an identification matching result;

[0033] Determine whether the data processing unit is in place according to the identification matching result.

[0034] In one embodiment, determining whether the data processing unit is in place according to the identification matching result includes:

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

[0036] In response to the identification matching result indicating that the second identification information fails to match the plurality of first identification 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 according to the initial location information and the resource reservation status according to the current location information and the initial location information includes:

[0038] Compare the current location information with the initial location information to obtain a location comparison result;

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

[0040] In response to the position comparison result indicating that the current position information is consistent with the initial position information, allocating resources to the data processing unit according to the initial position information and the resource reservation status;

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

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

[0043] A reading module, the reading module is used to read the position variable stored in the memory in response to the basic input and output system starting to the pre-firmware interface initialization stage, wherein the position variable contains the initial position information of the data processing unit;

[0044] A resource reservation module, the resource reservation module is used to reserve resources for the data processing unit according to the initial position information in response to the successful reading of the position variable;

[0045] A traversal module, the traversal module is used for traversing a plurality of PCIE devices to obtain a plurality of corresponding identification information in response to the basic input and output system continuing to start up to the PCIE device enumeration phase;

[0046] A first judgment module, the first judgment module is used to judge whether the data processing unit is in place according to multiple identification information;

[0047] An acquisition module, the acquisition module is used to acquire current position information of the data processing unit in response to the data processing unit being in position;

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

[0049] In a third aspect, an electronic device is provided, comprising one or more processors; and a memory associated with the one or more processors, the memory being used to store program instructions, which, when read and executed by the one or more processors, execute the steps of any one of the methods in the first aspect described above.

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

[0051] In a fifth aspect, a computer program product is provided, comprising a computer program, which, when executed by a processor, implements the steps of any one of the methods in the first aspect.

[0052] The resource allocation method, device, electronic device and storage medium of the above-mentioned data processing unit perform resource reservation processing according to the initial position information of the data processing unit pre-stored in the memory, thereby improving the accuracy of resource allocation of the data processing unit; then, based on the comparison result of 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 situation, thereby improving the flexibility of resource allocation of the data processing unit. BRIEF DESCRIPTION OF THE DRAWINGS

[0053] Figure 1 A schematic diagram of a flow chart of a resource allocation method for a data processing unit in one embodiment;

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

[0055] Figure 3 is a detailed flow chart of a method for allocating resources of a data processing unit in one embodiment;

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

[0057] Figure 5 FIG. 4 is a diagram showing the internal structure of an electronic device in one embodiment. DETAILED DESCRIPTION

[0058] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0059] Embodiment 1

[0060] In one embodiment, Figure 1 As shown, a resource allocation method for a data processing unit is provided, which is applied to a basic input and output system, and the method includes:

[0061] In response to the basic input and output system starting up to the pre-firmware interface initialization phase, reading the position variable stored in the memory, wherein the position variable includes initial position information of the data processing unit;

[0062] In response to the position variable being read successfully, reserving resources for the data processing unit according to the initial position information;

[0063] In response to the basic input and output system continuing to start up to the PCIE device enumeration phase, traversing multiple PCIE devices to obtain corresponding multiple identification information, and judging whether the data processing unit is in place according to the multiple identification information;

[0064] In response to the data processing unit being in position, obtaining current position information of the data processing unit;

[0065] According to the current location information and the initial location information, it is determined whether to allocate resources to the data processing unit according to the initial location information and the resource reservation status.

[0066] Specifically, resource reservation processing is performed based on the initial position information of the data processing unit pre-stored in the memory, thereby improving the accuracy of resource allocation of the data processing unit; then, based on the comparison result of 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 based on the initial position information and the resource reservation situation, thereby improving the flexibility of resource allocation of the data processing unit.

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

[0068] Acquire a first total amount of resources, wherein the first total amount of resources represents a total amount of bus resources;

[0069] Calculating a first fixed resource reservation amount based on the first total resource amount;

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

[0071] Calculate a first resource reservation amount of the data processing unit according to the initial position information, wherein the first resource reservation amount is less than a first resource reservation amount to be allocated;

[0072] Obtaining a second total amount of resources, wherein the second total amount of resources represents a total amount of memory-mapped input / output resources;

[0073] Calculating a second fixed resource reservation amount based on the second total resource amount;

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

[0075] A second resource reservation amount of the data processing unit is calculated according to the initial position information, wherein the second resource reservation amount is smaller than the second resource reservation amount to be allocated.

[0076] Specifically, the first resource reservation amount and the second resource reservation amount are calculated so as to allocate resources to the data processing unit later, thereby improving the accuracy of resource allocation to the data processing unit.

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

[0078] In one embodiment, calculating the first resource reservation amount of the data processing unit according to the initial location information includes:

[0079] Acquire interface information of the data processing unit from the initial position information, wherein the interface information includes an interface connection type and a corresponding number of root ports, and the interface connection type includes a first interface connection type and a second interface connection type;

[0080] In response to the interface connection type being the first interface connection type, calculating a first resource reservation amount of the data processing unit according to 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, a first resource reservation amount of the data processing unit is calculated according to the number of root ports corresponding to the second interface type.

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

[0083] In a specific embodiment, the number of buses allocated to each stack is calculated in the SetBusBaseAndLimit() function. Figure 2 As shown, the first interface connection type Single-host connection occupies the x16 root port, so 64 buses should be allocated to the corresponding stack; the second interface connection type multi-host connection occupies two x8 root ports, and theoretically 32 buses should be allocated to the corresponding stack. At this time, we must pay attention to the matching with the hardware devices. The first 8 lanes of some PE ports will contain some hardware devices such as VGA / M.2 / USB, so these ports must be allocated separately. For example, (32+7) (VGA: 2, M.2: 2, USB: 1, RootPort: 1) buses are allocated to this stack. If the stack does not contain other hardware, (32+3) buses are allocated.

[0084] In one embodiment, calculating the second resource reservation amount of the data processing unit according to the initial location information includes:

[0085] Acquire interface information of the data processing unit from the initial position information, wherein the interface information includes an interface connection type and a corresponding number of root ports, and the interface connection type includes a first interface connection type and a second interface connection type;

[0086] In response to the interface connection type being the first interface connection type, calculating a second resource reservation amount of the data processing unit according to 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, a second resource reservation amount of the data processing unit is calculated according to the number of root ports corresponding to the second interface type.

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

[0089] In one embodiment, Figure 3As shown, traversing multiple PCIE devices to obtain corresponding multiple identification information, and judging whether the data processing unit is in place according to the multiple identification information, including:

[0090] Traversing multiple PCIE devices to obtain corresponding multiple first identification information, wherein the first identification information includes a device ID and a manufacturer ID of the corresponding PCIE device;

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

[0092] Matching the second identification information with the plurality of first identification information to obtain an identification matching result;

[0093] Determine whether the data processing unit is in place according to the identification matching result.

[0094] In one embodiment, determining whether the data processing unit is in place according to the identification matching result includes:

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

[0096] In response to the identification matching result indicating that the second identification information fails to match the plurality of first identification 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 according to the initial location information and the resource reservation status according to the current location information and the initial location information includes:

[0098] Compare the current location information with the initial location information to obtain a location comparison result;

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

[0100] In response to the position comparison result indicating that the current position information is consistent with the initial position information, allocating resources to the data processing unit according to the initial position information and the resource reservation status;

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

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

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

[0104] In response to a failure to read the position variable, waiting for the basic input and output system to enter a PCIE device enumeration phase;

[0105] In response to the basic input and output system continuing to start up to the PCIE device enumeration phase, traversing multiple PCIE devices to obtain corresponding multiple identification information, and judging whether the data processing unit is in place according to the multiple identification information;

[0106] In response to the data processing unit being in place, obtaining current location information of the data processing unit, and reserving resources for the data processing unit according to the current location information;

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

[0108] In response to the data processing unit being not in place, setting the current position information of the data processing unit to null, and setting the position comparison result to inconsistent;

[0109] The initial position information in the position variable is changed to empty, and resources are reallocated to the data processing unit.

[0110] Specifically, when the position variable fails to be read and the data processing unit is in place, resources are reserved according to the current position information, and resources are allocated to the data processing unit according to the current position information and resource reservation; when the data variable fails to be read and the data processing unit is not in place, resources are re-allocated to the data processing unit. This improves the flexibility and accuracy of resource allocation of the data processing unit.

[0111] It should be understood that although Figure 1 , Figure 3 The steps in the flowchart are shown in sequence 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 restriction for the execution of these steps, and these steps can be executed in other orders. Moreover, Figure 1 , Figure 3At least part of the steps may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily executed 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 part of the sub-steps or stages of other steps.

[0112] Embodiment 2

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

[0114] A reading module, the reading module is used to read the position variable stored in the memory in response to the basic input and output system starting to the pre-firmware interface initialization stage, wherein the position variable contains the initial position information of the data processing unit;

[0115] A resource reservation module, the resource reservation module is used to reserve resources for the data processing unit according to the initial position information in response to the successful reading of the position variable;

[0116] A traversal module, the traversal module is used for traversing a plurality of PCIE devices to obtain a plurality of corresponding identification information in response to the basic input and output system continuing to start up to the PCIE device enumeration phase;

[0117] A first judgment module, the first judgment module is used to judge whether the data processing unit is in place according to multiple identification information;

[0118] An acquisition module, the acquisition module is used to acquire current position information of the data processing unit in response to the data processing unit being in position;

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

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

[0121] Acquire a first total amount of resources, wherein the first total amount of resources represents a total amount of bus resources;

[0122] Calculating a first fixed resource reservation amount based on the first total resource amount;

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

[0124] Calculate a first resource reservation amount of the data processing unit according to the initial position information, wherein the first resource reservation amount is less than a first resource reservation amount to be allocated;

[0125] Obtaining a second total amount of resources, wherein the second total amount of resources represents a total amount of memory-mapped input / output resources;

[0126] Calculating a second fixed resource reservation amount based on the second total resource amount;

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

[0128] A second resource reservation amount of the data processing unit is calculated according to the initial position information, wherein the second resource reservation amount is smaller than the second resource reservation amount to be allocated.

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

[0130] Acquire interface information of the data processing unit from the initial position information, wherein the interface information includes an interface connection type and a corresponding number of root ports, and the interface connection type includes a first interface connection type and a second interface connection type;

[0131] In response to the interface connection type being the first interface connection type, calculating a first resource reservation amount of the data processing unit according to 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, a first resource reservation amount of the data processing unit is calculated according to the number of root ports corresponding to the second interface type.

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

[0134] Acquire interface information of the data processing unit from the initial position information, wherein the interface information includes an interface connection type and a corresponding number of root ports, and the interface connection type includes a first interface connection type and a second interface connection type;

[0135] In response to the interface connection type being the first interface connection type, calculating a second resource reservation amount of the data processing unit according to 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, a second resource reservation amount of the data processing unit is calculated according to 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 to:

[0138] Traversing multiple PCIE devices to obtain corresponding multiple first identification information, wherein the first identification information includes a device ID and a manufacturer ID of the corresponding PCIE device;

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

[0140] Matching the second identification information with the plurality of first identification information to obtain an identification matching result;

[0141] Determine whether the data processing unit is in place according to the identification 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 according to the identification matching result, including:

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

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

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

[0146] Compare the current location information with the initial location information to obtain a location comparison result;

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

[0148] In response to the position comparison result indicating that the current position information is consistent with the initial position information, allocating resources to the data processing unit according to the initial position information and the resource reservation status;

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

[0150] For the specific definition of the resource allocation device of the data processing unit, please refer to the definition of the resource allocation method of the data processing unit in the above text, which will not be repeated here. Each module in the resource allocation device of the above data processing unit can be implemented in whole or in part by software, hardware and a combination thereof. The above modules can be embedded in or independent of the processor in the electronic device in the form of hardware, or can be stored in the memory of the electronic device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.

[0151] Embodiment 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 implements the following steps when executing the computer program:

[0153] In response to the basic input and output system starting up to the pre-firmware interface initialization phase, reading the position variable stored in the memory, wherein the position variable includes initial position information of the data processing unit;

[0154] In response to the position variable being read successfully, reserving resources for the data processing unit according to the initial position information;

[0155] In response to the basic input and output system continuing to start up to the PCIE device enumeration phase, traversing multiple PCIE devices to obtain corresponding multiple identification information, and judging whether the data processing unit is in place according to the multiple identification information;

[0156] In response to the data processing unit being in position, obtaining current position information of the data processing unit;

[0157] According to the current location information and the initial location information, it is determined whether to allocate resources to the data processing unit according to the initial location information and the resource reservation status.

[0158] When the program instructions are read and executed by one or more processors, they can also perform operations corresponding to the various steps in the above method embodiments. Please refer to the above description and will not be repeated here. Figure 5 , which exemplarily shows the architecture of an electronic device, which may specifically 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, the video display adapter 511, the disk drive 512, the input / output interface 513, the network interface 514, and the memory 520 may be communicatively connected via a communication bus 530.

[0159] Among them, the processor 510 can be implemented by a general-purpose central processing unit (CPU), a microprocessor, an 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 in the form of a read-only memory (ROM), a random access memory (RAM), a static storage device, a dynamic storage device, etc. The memory 520 can store an operating system 521 for controlling the operation of the electronic device 500, and a basic input and output system (BIOS) 522 for controlling the low-level operation of the electronic device 500. In addition, a web browser 523, a data storage manager 524, and an icon font processing system 525, etc. can also be stored. The above-mentioned icon font processing system 525 can be an application program that specifically implements the operations of the aforementioned steps in the embodiment of the present application. In short, when the technical solution provided in the present application is implemented by software or firmware, the relevant program code is stored in the memory 520 and is called and executed by the processor 510.

[0161] The input / output interface 513 is used to connect the input / output module to realize information input and output. The input / output module can be configured in the device as a component (not shown in the figure), or it can be externally connected to the device to provide corresponding functions. The input device may include a keyboard, a mouse, a touch screen, a microphone, various sensors, etc., and the output device may include a display, a speaker, a vibrator, an indicator light, etc.

[0162] The network interface 514 is used to connect to a communication module (not shown) to realize communication interaction between the device and other devices. The communication module can realize communication through a wired mode (such as USB, network cable, etc.) or a wireless mode (such as mobile network, WIFI, Bluetooth, etc.).

[0163] The bus 530 comprises a pathway for transmitting information between the various components of the device (eg, the processor 510, the video display adapter 511, the disk drive 512, the input / output interface 513, the network interface 514, and the memory 520).

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

[0165] It should be noted that, although the 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, a bus 530, etc., in the specific implementation process, the electronic device may also include other components necessary for normal operation. In addition, it can be understood by those skilled in the art that the above device may also only include components necessary for implementing the solution of the present application, and does not necessarily include all the components shown in the figure.

[0166] It can be seen from the description of the above implementation methods that those skilled in the art can clearly understand that the present application can be implemented by means of software plus a necessary general hardware platform. Based on this understanding, the technical solution of the present application can essentially or in other words, the part that contributes to the prior art can be embodied in the form of a software product, which can be stored in a storage medium such as ROM / RAM, a disk, an optical disk, etc., including several instructions for enabling an electronic device (which can be a personal computer, a cloud server, or a network device, etc.) to execute the methods of various embodiments of the present application or certain parts of the embodiments.

[0167] Embodiment 4

[0168] In one embodiment, a computer readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented:

[0169] In response to the basic input and output system starting up to the pre-firmware interface initialization phase, reading the position variable stored in the memory, wherein the position variable includes initial position information of the data processing unit;

[0170] In response to the position variable being read successfully, reserving resources for the data processing unit according to the initial position information;

[0171] In response to the basic input and output system continuing to start up to the PCIE device enumeration phase, traversing multiple PCIE devices to obtain corresponding multiple identification information, and judging whether the data processing unit is in place according to the multiple identification information;

[0172] In response to the data processing unit being in position, obtaining current position information of the data processing unit;

[0173] According to the current location information and the initial location information, it is determined whether to allocate resources to the data processing unit according to the initial location information and the resource reservation status.

[0174] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in the present 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. As an illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).

[0175] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, 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 only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the invention patent. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the patent of the present application shall be subject to the attached claims.

[0177] Embodiment 5

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

[0179] In response to the basic input and output system starting up to the pre-firmware interface initialization phase, reading the position variable stored in the memory, wherein the position variable includes initial position information of the data processing unit;

[0180] In response to the position variable being read successfully, reserving resources for the data processing unit according to the initial position information;

[0181] In response to the basic input and output system continuing to start up to the PCIE device enumeration phase, traversing multiple PCIE devices to obtain corresponding multiple identification information, and judging whether the data processing unit is in place according to the multiple identification information;

[0182] In response to the data processing unit being in position, obtaining current position information of the data processing unit;

[0183] According to the current location information and the initial location information, it is determined whether to allocate resources to the data processing unit according to the initial location information and the resource reservation status.

[0184] A person skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be implemented by instructing related hardware through a computer program, and the computer program can be stored in a computer program product. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods.

[0185] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, 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 only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the invention patent. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the patent of the present application shall be subject to the attached claims.

Claims

1. A resource allocation method for a data processing unit, applied to a basic input and output system, characterized in that: The method comprises: In response to the basic input and output system starting up to the pre-firmware interface initialization phase, reading the position variable stored in the memory, wherein the position variable includes initial position information of the data processing unit; In response to the position variable being read successfully, reserving resources for the data processing unit according to the initial position information; In response to the basic input and output system continuing to start up to the PCIE device enumeration phase, traversing multiple PCIE devices to obtain corresponding multiple identification information, and judging whether the data processing unit is in place according to the multiple identification information; In response to the data processing unit being in position, obtaining current position information of the data processing unit; According to the current location information and the initial location information, it is determined whether to allocate resources to the data processing unit according to the initial location information and the resource reservation status.

2. The method according to claim 1, characterized in that: Reserving resources for the data processing unit according to the initial location information includes: Acquire a first total amount of resources, wherein the first total amount of resources represents a total amount of bus resources; Calculating a first fixed resource reservation amount based on the first total resource amount; Subtracting a first fixed resource reservation amount from the first total resource amount to obtain a first resource reservation amount to be allocated; Calculating a first resource reservation amount of the data processing unit according to the initial position information, wherein the first resource reservation amount is less than the first resource reservation amount to be allocated; Obtaining a second total amount of resources, wherein the second total amount of resources represents a total amount of memory-mapped input / output resources; Calculating a second fixed resource reservation amount based on the second total resource amount; Subtracting a second fixed resource reservation amount from the second total resource amount to obtain a second resource reservation amount to be allocated; A second resource reservation amount of the data processing unit is calculated according to the initial position information, wherein the second resource reservation amount is less than the second resource reservation amount to be allocated.

3. The method according to claim 2, characterized in that: Calculating a first resource reservation amount of a data processing unit according to the initial location information includes: Acquire interface information of the data processing unit from the initial position information, wherein the interface information includes an interface connection type and a 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 a first interface connection type, calculating a first resource reservation amount of the data processing unit according to the number of root ports corresponding to the first interface type; In response to the interface connection type being the second interface connection type, a first resource reservation amount of the data processing unit is calculated according to the number of root ports corresponding to the second interface type.

4. The method according to claim 2, characterized in that: Calculating a second resource reservation amount of the data processing unit according to the initial location information includes: Acquire interface information of the data processing unit from the initial position information, wherein the interface information includes an interface connection type and a 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, calculating a second resource reservation amount of the data processing unit according to the number of root ports corresponding to the first interface type; In response to the interface connection type being the second interface connection type, a second resource reservation amount of the data processing unit is calculated according to the number of root ports corresponding to the second interface type.

5. The method according to claim 1, characterized in that: Traversing multiple PCIE devices to obtain corresponding multiple identification information, and judging whether the data processing unit is in place according to the multiple identification information, including: Traversing multiple PCIE devices to obtain corresponding multiple first identification information, wherein the first identification information includes a device ID and a manufacturer ID of the corresponding PCIE device; Acquire second identification information stored in the memory, wherein the second identification information includes a device ID and a manufacturer ID of the data processing unit; Matching the second identification information with the plurality of first identification information to obtain an identification matching result; Determine whether the data processing unit is in place according to the identification matching result.

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

7. The method according to claim 2, characterized in that: Determining, according to the current location information and the initial location information, whether to allocate resources to the data processing unit according to the initial location information and the resource reservation status includes: Comparing the current location information with the initial location information to obtain a location comparison result; In response to the position comparison result indicating that the current position information is inconsistent with the initial position information, the initial position information in the position variable is changed to the current position information, and resources are allocated to the data processing unit according to the current position information and the resource reservation situation; In response to the position comparison result indicating that the current position information is consistent with the initial position information, allocating resources to the data processing unit according to the initial position information and the resource reservation status; The resource reservation status includes a first resource reservation amount and a second resource reservation amount.

8. A resource allocation device for a data processing unit, characterized in that: The device comprises: A reading module, the reading module is used for reading a position variable stored in a memory in response to the basic input and output system starting up to a pre-firmware interface initialization phase, wherein the position variable includes initial position information of the data processing unit; A resource reservation module, the resource reservation module is used to reserve resources for the data processing unit according to the initial position information in response to the successful reading of the position variable; A traversal module, the traversal module is used for traversing a plurality of PCIE devices to obtain a plurality of corresponding identification information in response to the basic input and output system continuing to start up to the PCIE device enumeration phase; A first judgment module, the first judgment module is used to judge whether the data processing unit is in place according to the multiple identification information; an acquisition module, the acquisition module being used for acquiring current position information of the data processing unit in response to the data processing unit being in position; The second judgment module is used to determine whether to allocate resources to the data processing unit according to the initial location information and the resource reservation status according to the current location information and the initial location information.

9. 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, the steps of the method according to any one of claims 1 to 7 are implemented.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.

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

  • Resource configuration method, device and equipment and readable storage medium

    CN117667388A

  • Intelligent comprehensive energy management optimization method, device, equipment and medium

    CN118551964A

  • Resource allocating and scheduling for a network

    US11588748B1

Cited By

  • Resource allocation method, storage medium, electronic equipment and program product

    CN120234159A

  • Resource configuration method, storage medium, electronic device and program product

    CN120234159B

  • Memory resource allocation method and device for server, equipment, medium and program product

    CN120256128A

  • Server memory resource allocation method, device, equipment, medium and program product

    CN120256128B

  • Computer system starting method and device, electronic equipment and storage medium

    CN121300862A