Resource allocation localization method, electronic device, storage medium, and product

By comparing the resource allocation text files of the BIOS and OS, the difficulty in identifying incorrect resource allocation in the BIOS and OS was resolved, enabling rapid location and efficient analysis, and reducing communication costs and wasted time.

WO2026086497A1PCT designated stage Publication Date: 2026-04-30INSPUR SUZHOU INTELLIGENT TECH CO LTD
View PDF 7 Cites 0 Cited by

Patent Information

Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Filing Date
2025-09-16
Publication Date
2026-04-30

AI Technical Summary

Technical Problem

During product development, it is difficult to quickly identify issues with incorrect allocation of PCIe device resources by the BIOS and OS, resulting in high communication costs and long analysis times.

Method used

By obtaining and comparing the corresponding text files of resource allocation in the basic input/output system and the operating system, the domain of the resource allocation problem can be located.

Benefits of technology

Quickly pinpointing the area where resource allocation is incorrect avoids wasting resources and time, reduces communication costs, and increases the speed of problem analysis.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2025121668_30042026_PF_FP_ABST
    Figure CN2025121668_30042026_PF_FP_ABST
Patent Text Reader

Abstract

Provided in the embodiments of the present application are a resource allocation localization method, an electronic device, a storage medium, and a product. The method comprises: acquiring a first text file corresponding to initial resource allocation performed by a basic input / output system, and a second text file corresponding to secondary resource allocation performed by an operating system; comparing the first text file with the second text file to obtain a comparison result; and on the basis of the comparison result, performing localization to determine a target system, wherein the target system is the basic input / output system or the operating system. In the embodiments of the present application, directly acquiring and comparing text files corresponding to resource allocation to PCIe devices under a basic input / output system and an operating system enable rapid localization to determine a domain to which a resource allocation problem belongs, thereby shortening the problem analysis time, streamlining the problem analysis process, also avoiding the problems of information communication time consumption and information deviation between different domains, reducing the communication cost, and thus accelerating problem analysis during research and development.
Need to check novelty before this filing date? Find Prior Art

Description

Resource allocation and positioning methods, electronic devices, storage media and products

[0001] Cross-reference to related applications

[0002] This application claims priority to Chinese Patent Application No. 202411488099.4, filed on October 23, 2024, entitled “Resource Allocation and Positioning Method, Electronic Device, Storage Medium and Product”, the entire contents of which are incorporated herein by reference. Technical Field

[0003] This application relates to the field of computer technology, and in particular to a resource allocation and positioning method, an electronic device, a computer non-volatile readable storage medium, and a computer program product. Background Technology

[0004] During product development, issues such as incorrect resource allocation for PCIe (Peripheral Component Interconnect Express, a high-speed serial computer expansion bus standard) devices are frequently encountered. However, resource allocation involves both the BIOS (Basic Input Output System) initialization and resource allocation of PCIe devices, and the OS's (Operating System) reallocation of resources after entering the OS. Therefore, it is often difficult to quickly determine whether these incorrect resource allocations are due to BIOS or OS issues. In related technologies, BIOS engineers typically first determine if the BIOS resource allocation is incorrect based on the serial port logs of the PCIe device initialization and resource reservation code, as well as the resource allocation information in the BIOS Shell. This information is then provided to OS engineers for analysis of the PCIe device resource allocation information within the OS.

[0005] Therefore, analyzing problems involving different fields during product development often requires a significant amount of time for communication, and may involve unnecessary analysis due to uncertainty about the specific area of ​​the problem, thereby increasing the time cost of development. Summary of the Invention

[0006] This application provides a resource allocation and positioning method, an electronic device, a computer non-volatile readable storage medium, and a computer program product to solve the problem that in the product development process, it is difficult to quickly identify the problem of incorrect allocation of PCIe device resources by BIOS and OS, resulting in high communication costs and long analysis time.

[0007] This application discloses a resource allocation and positioning method. Resource allocation involves a basic input / output system and an operating system. After the basic input / output system performs an initial resource allocation, the resources obtained are sent to the operating system for secondary resource allocation. The method includes:

[0008] Obtain the first text file corresponding to the initial resource allocation by the basic input / output system, and the second text file corresponding to the secondary resource allocation by the operating system;

[0009] The first text file and the second text file are compared to obtain the comparison results;

[0010] The target system is located based on the comparison results; the target system is a basic input / output system or an operating system.

[0011] In some embodiments of this application, obtaining a first text file corresponding to the initial resource allocation by the basic input / output system and a second text file corresponding to the secondary resource allocation by the operating system includes:

[0012] Obtain the first resource allocation information from the first text file and the second resource allocation information from the second text file; the first resource allocation information is the resource allocation information when the basic input / output system performs the initial resource allocation, and the second resource allocation information is the resource allocation information when the operating system performs the secondary resource allocation.

[0013] In some embodiments of this application, after obtaining the first resource allocation information in the first text file and the second resource allocation information in the second text file, the method further includes:

[0014] The configuration space information corresponding to the first resource allocation information in the first text file and the configuration space information corresponding to the second resource allocation information in the second text file are obtained. The basic input / output system performs initial resource allocation based on the configuration space information corresponding to the first resource allocation information, and the operating system performs secondary resource allocation based on the configuration space information corresponding to the first resource allocation information.

[0015] In some embodiments of this application, before obtaining the first text file corresponding to the initial resource allocation by the basic input / output system and the second text file corresponding to the secondary resource allocation by the operating system, the method further includes:

[0016] A first interrupt interface and a first program are constructed under a basic input / output system, and a second interrupt interface and a second program are constructed under an operating system.

[0017] Link the first interrupt interface to the first program, and link the second interrupt interface to the second program;

[0018] First resource allocation information is obtained through the first interrupt interface, and second resource allocation information is obtained through the second interrupt interface;

[0019] The first resource allocation information is stored in the first text file through the first program, and the second resource allocation information is stored in the second text file through the second program.

[0020] In some embodiments of this application, after storing the first resource allocation information into a first text file through a first procedure and storing the second resource allocation information into a second text file through a second procedure, the method further includes:

[0021] Add configuration space commands to both the first and second programs;

[0022] The configuration space information corresponding to the first resource allocation information is obtained through the configuration space command in the first program, and the configuration space information corresponding to the first resource allocation information is stored in the first text file; and the configuration space information corresponding to the second resource allocation information is obtained through the configuration space command in the second program, and the configuration space information corresponding to the second resource allocation information is stored in the second text file.

[0023] In some embodiments of this application, a comparison is made between a first text file and a second text file to obtain a comparison result, including:

[0024] The first resource allocation information and the second resource allocation information are compared to obtain the first comparison result;

[0025] The configuration space information corresponding to the first resource allocation information and the configuration space information corresponding to the second resource allocation information are compared to obtain the second comparison result;

[0026] The first and second comparison results are used as comparison results.

[0027] In some embodiments of this application, locating the target system based on comparison results includes:

[0028] When both the first comparison result and the second comparison result are the first preset result, or when the first comparison result is the second preset result and the second comparison result is the first preset result, the target system is identified as a basic input-output system; the first preset result is used to characterize data consistency, and the second preset result is used to characterize data inconsistency.

[0029] When the first comparison result is the first preset result and the second comparison result is the second preset result, the target system is located as the operating system;

[0030] When both the first comparison result and the second comparison result indicate that the data are inconsistent, the target system is located based on the first comparison result and the second comparison result.

[0031] In some embodiments of this application, locating the target system based on a first comparison result and a second comparison result includes:

[0032] Data that is inconsistent between the first resource allocation information and the second resource allocation information shall be identified as the first data.

[0033] Data that is inconsistent between the configuration space information corresponding to the first resource allocation information and the configuration space information corresponding to the second resource allocation information is identified as the second data.

[0034] The target system is located based on the first and second data.

[0035] In some embodiments of this application, locating the target system based on first data and second data includes:

[0036] When the first and second data are caused by the basic input / output system, the target system is identified as the basic input / output system.

[0037] When the first and second data are caused by the operating system, the target system is identified as the operating system.

[0038] In some embodiments of this application, when the first program is executed, the first program calls the first interrupt interface to store the first resource allocation information in the first text file; when the second program is executed, the second program calls the second interrupt interface to store the second resource allocation information in the second text file.

[0039] In some embodiments of this application, the first resource allocation information and the second resource allocation information respectively include: resource base address, input and output resource size, resource mapping information, resource enumeration part, and resource allocation part.

[0040] In some embodiments of this application, the first text file is saved in the same path as the first program, and the second text file is saved in the same path as the second program.

[0041] This application also discloses an electronic device, including a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other through the communication bus;

[0042] Memory, used to store computer programs;

[0043] A processor, when executing a program stored in memory, implements the method as described in the embodiments of this application.

[0044] This application also discloses a computer non-volatile readable storage medium storing instructions that, when executed by one or more processors, cause the processors to perform the methods described in this application.

[0045] This application also discloses a computer program product stored in a storage medium, which is executed by at least one processor to implement the method as described in this application.

[0046] The embodiments of this application have the following advantages:

[0047] In this embodiment of the application, a first text file corresponding to the initial resource allocation of the basic input / output system and a second text file corresponding to the secondary resource allocation of the operating system are obtained; the first text file and the second text file are compared to obtain a comparison result; the target system is located based on the comparison result; the target system is the basic input / output system or the operating system.

[0048] This application's embodiments, by directly obtaining the text files corresponding to PCIe device resource allocation under the Basic Input / Output System (BIOS) and the Operating System (OS), avoid the risk that BIOS engineers and OS engineers would need to additionally add or enable serial port printing information and re-flash the system version after encountering incorrect resource allocation issues. This shortens problem analysis time, simplifies the problem analysis process, and avoids information communication time and discrepancies between different areas, reducing communication costs and thus improving the speed of problem analysis during the R&D process. Furthermore, by comparing the text files corresponding to resource allocation under the BIOS and the Operating System, the domain to which the incorrect resource allocation problem belongs can be quickly located, avoiding resource and time waste and further improving the speed of problem analysis during the R&D process. Attached Figure Description

[0049] Figure 1 is a hardware architecture diagram of a resource allocation and positioning method provided in an embodiment of this application;

[0050] Figure 2 is a schematic diagram of resource allocation in a basic input / output system and operating system provided in an embodiment of this application;

[0051] Figure 3 is a schematic diagram of an application environment provided in an embodiment of this application;

[0052] Figure 4 is a flowchart of a resource allocation and positioning method provided in an embodiment of this application;

[0053] Figure 5 is a schematic diagram of a process for obtaining a first text file in a basic input / output system according to an embodiment of this application;

[0054] Figure 6 is a schematic diagram of a process for obtaining a second text file in an operating system according to an embodiment of this application;

[0055] Figure 7 is a schematic diagram of the hardware structure of an electronic device that implements various embodiments of this application;

[0056] Figure 8 is a schematic diagram of a computer-readable medium provided in an embodiment of this application. Detailed Implementation

[0057] To make the above-mentioned objectives, features and advantages of this application more apparent and understandable, the application will be further described in detail below with reference to the accompanying drawings and specific embodiments.

[0058] As the lowest-level and most direct manager of hardware settings and control on the server motherboard, the BIOS provides servers with more user-friendly functions. The BIOS acts as a bridge between hardware devices and software programs. During the boot process, the BIOS first performs a self-test (POST) to initialize the hardware devices. This POST includes tests on the CPU (Central Processing Unit), memory, motherboard, serial and parallel ports, and hard drives, as well as loading drivers for PCIe devices and I / O (Input / Output) devices. PCIe, as a local bus of the processor system, is primarily used to connect external devices within the processor system. PCIe links use an end-to-end data transmission method. In a PCIe link, the two ports are completely equivalent, connecting to the sending and receiving devices respectively, and only one sending or receiving device can be connected to one segment of a PCIe link. The number of PCIe links that can be extended by different processors varies depending on the processor's design and support capabilities. Different server manufacturers also use the extended PCIe links of their processors differently. The design and use of processor PCIe links also differ depending on the hardware design. Different hardware designs use PCIe links to connect different external devices, and different hardware PCIe devices have different levels of support for PCIe links based on their own designs.

[0059] Referring to Figure 1, a hardware architecture diagram of a resource allocation and positioning method provided in an embodiment of this application is shown. The central processing unit (CPU) is connected to the basic input / output system (BIOS) via SPI (Serial Peripheral Interface Bus) and is responsible for the main computing tasks. The CPU is also connected to the BMC (Baseboard Management Controller) and CPLD (Complex Programmable Logic Device) via eSPI (Enhanced Serial Peripheral Interface). The Baseboard Management Controller communicates with the Complex Programmable Logic Device via I2C (Inter-Integrated Circuit). The first selection signal and the second selection signal are used to represent the selection signal between the Baseboard Management Controller and the Complex Programmable Logic Device.

[0060] Specifically, in resource allocation, the BMC and CPLD are responsible for monitoring various status information of the system, such as load, temperature, and power consumption. This information is transmitted to the CPU via the I2C bus. After receiving this status information, the CPU sends it to the BIOS via the SPI interface so that the BIOS can decide how to allocate resources based on the received status information.

[0061] Referring to Figure 2, a schematic diagram is shown of a basic input / output system and an operating system allocating resources according to an embodiment of this application. The basic input / output system is responsible for initializing the device and loading the startup items. After completing the hardware initialization, it hands over control to the operating system, which is responsible for managing computer resources (resource management) and task scheduling (process management) to ensure the normal operation of the system.

[0062] Specifically, during the server startup process, the BIOS is responsible for allocating system resources, including resources for PCIe devices. During startup, the BIOS scans all PCIe bridges and devices according to the PCIe topology and performs Bus (DataBus), I / O (Input / Output), and Mmio (Memory-Mapped I / O) resource allocation to ensure normal system operation. After the BIOS loads and initializes all devices in the system, it loads the Bootloader from the hard drive. Once the Bootloader is loaded into memory, the CPU (Central Processing Unit) controller is transferred to the Bootloader. The Bootloader then loads functions, and the OS takes over control of the CPU. After taking over CPU control, the OS reallocates resources to the BIOS-initialized devices to ensure that each device can function properly under the OS. That is, the resources obtained by the basic input / output system after the initial resource allocation are sent to the operating system for secondary resource allocation. Therefore, the problem of incorrect PCIe device resource allocation mentioned in the embodiments of this application may exist in the basic input / output system or the operating system.

[0063] Referring to Figure 3, a schematic diagram of an application environment provided in this embodiment is shown. A first interrupt interface (SMI (System Management Interrupt) interface) and a first program are created in the Basic Input / Output System (BIOS), and a second interrupt interface (SMI interface) and a second program are created in the Operating System (OS). Therefore, if an incorrect allocation of PCIe device resources occurs during product development, this embodiment can directly obtain the text files corresponding to PCIe device resource allocation under the BIOS and the Operating System through the first and second programs. By comparing the text files corresponding to resource allocation under the BIOS and the Operating System, the domain of the resource allocation problem can be quickly located, avoiding resource and time waste and further improving the speed of problem analysis during the development process.

[0064] Referring to Figure 4, a flowchart of the steps of a resource allocation and positioning method provided in an embodiment of this application is shown, which may specifically include the following steps:

[0065] Step 401: Obtain the first text file corresponding to the initial resource allocation of the basic input / output system, and the second text file corresponding to the secondary resource allocation of the operating system;

[0066] In one embodiment of this application, a monitoring tool continuously monitors system resource allocation information. When resource conflicts or unallocated resources are automatically detected, it can be considered that there is a problem with incorrect resource allocation. Upon discovering the problem, a first program and a second program are automatically executed to obtain text files of the initial and secondary resource allocations. This not only reduces the time and complexity of manual operations and avoids human error, but also allows for a rapid response to resource allocation problems, immediately obtaining the required text files, shortening the time for problem localization, and further improving the speed of problem analysis during the R&D process.

[0067] In one embodiment of this application, the problem of incorrect resource allocation can also be discovered by manually observing system behavior. Specifically, the operator can observe whether the system exhibits abnormal behavior, such as system crashes, unrecognized devices, or performance degradation; or check system logs (such as operating system logs and device manager logs) to look for error messages or warnings related to resource allocation; they can also manually test each hardware device to ensure that each hardware device is working properly, and if some devices are not working properly, there may be a problem of incorrect resource allocation; or they can use system tools (such as lspci, lsusb, dmidecode, etc.) to view system resource allocation information and manually check for resource conflicts or unallocated resources.

[0068] As shown in Figure 3, the first program runs in the BIOS (Basic Input / Output System) environment and is responsible for obtaining detailed information about the BIOS's initial resource allocation to generate a detailed text file (the first text file), recording all the details of the initial resource allocation. The second program runs in the OS (Operating System) environment and is responsible for obtaining detailed information about the OS's secondary resource allocation to generate another detailed text file (the second text file), recording all the details of the secondary resource allocation. The initial resource allocation typically occurs during computer startup, including allocating memory addresses for various hardware devices, IRQ (Interrupt Request), DMA (Direct Memory Access) channels, etc. The secondary resource allocation occurs after the OS starts up, and the OS further allocates and manages resources based on the resources allocated by the BIOS.

[0069] This application embodiment directly obtains the text files corresponding to PCIe device resource allocation under the Basic Input / Output System and the operating system. This avoids the risk that BIOS engineers and OS engineers would need to add or open serial port printing information and re-flash the version after encountering incorrect resource allocation problems. This shortens the problem analysis time, simplifies the problem analysis process, avoids information communication time and information deviation problems between different fields, reduces communication costs, and thus improves the problem analysis speed in the R&D process.

[0070] Step 402: Compare the first text file and the second text file to obtain the comparison result;

[0071] In this application embodiment, by comparing the contents of two text files, the differences between them can be found, that is, the comparison results, including differences in resource allocation, configuration parameters, device status, etc., and these differences help to identify the root cause of the problem of incorrect resource allocation.

[0072] Step 403: Locate the target system based on the comparison results; the target system is a basic input / output system or an operating system.

[0073] In this application embodiment, based on the differences reflected in the comparison results, it can be determined whether the problem of incorrect resource allocation is caused by the initial resource allocation of the BIOS or by the secondary resource allocation of the operating system.

[0074] If the comparison results show that there is a problem with the initial resource allocation (first text file), such as resource conflicts or incorrect allocation, the problem may be in the Elementary Input / Output System (PIOS), and the target system in this case is the PIOS. If the comparison results show that there is a problem with the secondary resource allocation (second text file), such as duplicate resource allocation or configuration errors, the problem may be in the operating system, and the target system in this case is the operating system.

[0075] Of course, if the comparison results do not show any differences between the two text files, and there are issues with incorrect resource allocation, it indicates that the operating system did not modify or adjust the initial resource allocation during the secondary allocation. Since secondary resource allocation depends on the result of the initial allocation, if there are problems with the initial allocation, the operating system will also encounter resource conflicts and unallocated resources during the secondary allocation. In this case, it can be directly determined that the problem lies in the initial resource allocation; that is, the problem occurs in the Basic Input / Output System (PIS), and the target system in this case is the PIS.

[0076] This application embodiment, by comparing the text files corresponding to resource allocation under the basic input / output system and the operating system, can quickly locate the domain to which the problem of incorrect resource allocation belongs, avoiding waste of resources and time, and further improving the speed of problem analysis in the research and development process.

[0077] In one embodiment of this application, obtaining a first text file corresponding to the initial resource allocation by the basic input / output system and a second text file corresponding to the secondary resource allocation by the operating system includes:

[0078] Obtain the first resource allocation information from the first text file and the second resource allocation information from the second text file; the first resource allocation information is the resource allocation information when the basic input / output system performs the initial resource allocation, and the second resource allocation information is the resource allocation information when the operating system performs the secondary resource allocation.

[0079] In this embodiment of the application, the first program generates a detailed text file (first text file) during execution, which includes all the details of the initial resource allocation, i.e., the first resource allocation information; the second program generates another detailed text file (second text file) during execution, which includes all the details of the secondary resource allocation, i.e., the second resource allocation information.

[0080] This application embodiment obtains detailed information on the initial and secondary resource allocations (first resource allocation information, second resource allocation information), providing basic data for subsequent comparison and problem localization. This effectively reduces communication costs, improves the efficiency of problem localization, and thus accelerates the product development process.

[0081] In one embodiment of this application, the first resource allocation information and the second resource allocation information respectively include: resource base address, input and output resource size, resource mapping information, resource enumeration part, and resource allocation part.

[0082] In this embodiment of the application, the first resource allocation information and the second resource allocation information respectively include the following contents:

[0083] Resource Base Address: The starting address for resource allocation. In both primary resource allocation (BIOS) and secondary resource allocation (OS), each resource (such as memory address, I / O address, etc.) has a base address. The base address determines the resource's location within the system and is the foundation of resource allocation. For example, if a PCIe device's memory base address is 0x80000000, it means that the device's memory resources are allocated starting from address 0x80000000.

[0084] Required I / O resource size (input / output resource size): The capacity or range of resource allocation. In both primary resource allocation (BIOS) and secondary resource allocation (OS), each resource (such as memory, input / output ports, etc.) has a size to determine its usage range; this is a crucial parameter for resource allocation. For example, an input / output resource size of 0x1000 for a PCIe device means that the device's input / output resources occupy 0x1000 address spaces.

[0085] Information on how PCIe device resources fall within the CPU's resource range (resource mapping information): This refers to the mapping of PCIe device resources (such as memory, I / O ports, etc.) in the system, specifically whether these resources fall within the CPU's resource range (such as memory address space, I / O address space, etc.). This mapping information is used to determine the specific location and usage of PCIe device resources in the system, ensuring that the CPU can correctly access these resources. For example, if a PCIe device's memory resources are mapped to the CPU's memory address space from 0x80000000 to 0x80001000, it means that the device's memory resources can be accessed by the CPU.

[0086] The PCIe resource enumeration section (resource enumeration part) is responsible for the enumeration and identification of all PCIe resources in the system. During the initial resource allocation (BIOS) and secondary resource allocation (OS), the system needs to enumerate all available PCIe resources and identify each resource. The resource enumeration part is used to determine all available PCIe resources in the system and is a prerequisite for resource allocation. For example, the system enumerates all PCIe devices and identifies the resource type and quantity of each device.

[0087] PCIe Resource Allocation Section (Resource Allocation Part): This section details the allocation process of PCIe resources. In the initial resource allocation (BIOS) and secondary resource allocation (OS), the system needs to perform specific resource allocation based on the resource requirements of the PCIe devices and the available resources. The resource allocation part is responsible for determining the allocation result for each PCIe resource and is the core of resource allocation. For example, the system allocates corresponding memory addresses, input / output addresses, and interrupt requests based on the resource requirements of the PCIe devices.

[0088] In one embodiment of this application, the first text file is saved in the same path as the first program, and the second text file is saved in the same path as the second program.

[0089] In this embodiment, to simplify path management, text files and programs are placed in the same directory to ensure they share the same save path. Therefore, when reading or writing text files, the program can directly use relative paths without specifying absolute paths. Furthermore, placing text files and programs in the same directory allows for quick location and access to relevant files within the same path during program execution, reducing file search time and thus improving the speed of problem analysis during the R&D process.

[0090] In one embodiment of this application, after obtaining the first resource allocation information in the first text file and the second resource allocation information in the second text file, the method further includes:

[0091] The configuration space information corresponding to the first resource allocation information in the first text file and the configuration space information corresponding to the second resource allocation information in the second text file are obtained. The basic input / output system performs initial resource allocation based on the configuration space information corresponding to the first resource allocation information, and the operating system performs secondary resource allocation based on the configuration space information corresponding to the first resource allocation information.

[0092] In the process of resource allocation and positioning, obtaining configuration space information is very important. Therefore, in this embodiment of the application, when the first program and the second program are executed, in addition to obtaining the first resource allocation information and the second resource allocation information, it is also necessary to obtain the configuration space information corresponding to the first resource allocation information and the configuration space information corresponding to the second resource allocation information.

[0093] Configuration space information refers to hardware configuration space information related to resource allocation, which typically includes the device's configuration registers, status registers, control registers, etc. This information is used to describe the configuration and status of the hardware device and reflects the actual execution of resource allocation.

[0094] Configuration space information provides detailed configuration and status of hardware devices, enabling a comprehensive understanding of the actual execution of resource allocation. However, simply obtaining resource allocation information may not fully reflect the configuration and status of hardware devices, thus making it impossible to correctly locate resource allocation.

[0095] This application embodiment, by obtaining configuration space information, can comprehensively understand the actual execution of resource allocation, locate hardware configuration problems, verify the correctness of resource allocation, effectively reduce communication costs, improve the efficiency of problem location, and thus accelerate the product development process.

[0096] In one embodiment of this application, before obtaining the first text file corresponding to the initial resource allocation by the basic input / output system and the second text file corresponding to the secondary resource allocation by the operating system, the method further includes:

[0097] A first interrupt interface and a first program are constructed under a basic input / output system, and a second interrupt interface and a second program are constructed under an operating system.

[0098] Link the first interrupt interface to the first program, and link the second interrupt interface to the second program;

[0099] First resource allocation information is obtained through the first interrupt interface, and second resource allocation information is obtained through the second interrupt interface;

[0100] The first resource allocation information is stored in the first text file through the first program, and the second resource allocation information is stored in the second text file through the second program.

[0101] In this embodiment, an SMI (System Management Interrupt) interface (first interrupt interface and second interrupt interface) needs to be created on both the BIOS and OS sides. The SMI interface is used to collect resource allocation information of PCIe devices, including resource base address, required IO resource size, and whether the PCIe device's resources fall within the CPU resource range. An executable program (first program and second program) also needs to be created on both the BIOS and OS sides. After execution, the executable program links to the aforementioned newly created SMI interface, collecting and outputting PCIe device resource allocation information, allocation process, and allocation results through the SMI interface. The executable program then stores the information obtained from the SMI interface into text files (first text file and second text file).

[0102] In another embodiment of this application, the user can manually execute this executable program to obtain resource allocation information of the PCIe device.

[0103] In this embodiment of the application, the first interrupt interface and the second interrupt interface are only activated when an executable program is executed under BIOS or OS, and will not affect the normal power-on and power-off of the server in daily use.

[0104] This application embodiment establishes SMI interfaces and executable programs under BIOS and OS respectively, which can not only automatically collect resource allocation information, allocation process and allocation results of PCIe devices, reducing the time and complexity of manual operation, but also reduce communication costs between different departments (such as BIOS engineers and OS engineers), avoid deviations in information transmission, centralize the management of problem location and resolution processes, reduce communication and coordination time, improve the efficiency of problem location, and thus accelerate the product development process.

[0105] In one embodiment of this application, when the first program is executed, the first program calls the first interrupt interface to store the first resource allocation information in the first text file; when the second program is executed, the second program calls the second interrupt interface to store the second resource allocation information in the second text file.

[0106] In this embodiment of the application, when the first program and the second program are executed, it is necessary to obtain the first resource allocation information and the second resource allocation information. Therefore, the first program needs to call the first interrupt interface and the second program needs to call the second interrupt interface to output and print the resource allocation information obtained by the interrupt interface to a text file so that the text file can be directly obtained for resource allocation positioning later.

[0107] In one embodiment of this application, after storing the first resource allocation information into a first text file through a first procedure and storing the second resource allocation information into a second text file through a second procedure, the method further includes:

[0108] Add configuration space commands to both the first and second programs;

[0109] The configuration space information corresponding to the first resource allocation information is obtained through the configuration space command in the first program, and the configuration space information corresponding to the first resource allocation information is stored in the first text file; and the configuration space information corresponding to the second resource allocation information is obtained through the configuration space command in the second program, and the configuration space information corresponding to the second resource allocation information is stored in the second text file.

[0110] Since operating systems typically control access to hardware, ordinary applications cannot directly access the hardware configuration space. Therefore, in this embodiment of the application, by adding a configuration space command to the executable program, it can be ensured that the program has sufficient permissions to access the hardware configuration space.

[0111] Specifically, configuration space commands are added to the first program and the second program respectively. After obtaining the configuration space information corresponding to the first resource allocation information and the configuration space information corresponding to the second resource allocation information through the configuration space commands, they are stored in the first text file and the second text file respectively.

[0112] This embodiment of the application stores configuration space information and resource allocation information in the same text file, which comprehensively records the detailed process and results of resource allocation, so that all relevant information can be obtained at once later, avoiding omissions caused by scattered information. It also simplifies the analysis process. When comparing files later, only the differences between the first and second text files can be analyzed, without having to process multiple files simultaneously. In addition, one system corresponds to one text file, which reduces the complexity of file management and avoids file loss or confusion.

[0113] In one embodiment of this application, comparing a first text file and a second text file to obtain a comparison result includes:

[0114] The first resource allocation information and the second resource allocation information are compared to obtain the first comparison result;

[0115] The configuration space information corresponding to the first resource allocation information and the configuration space information corresponding to the second resource allocation information are compared to obtain the second comparison result;

[0116] The first and second comparison results are used as comparison results.

[0117] In this embodiment of the application, it is necessary to compare the resource allocation information and configuration space information in the two text files respectively.

[0118] Specifically, by comparing the first and second resource allocation information, differences between them can be identified, yielding a first comparison result. This first comparison result may include changes in resource base addresses, input / output resource sizes, and resource mapping information. The first comparison result indicates whether the first and second resource allocation information are consistent. Similarly, by comparing the configuration space information corresponding to the first and second resource allocation information, differences between them can be identified, yielding a second comparison result. This second comparison result may include changes in configuration registers, status registers, and control registers. The second comparison result indicates whether the first and second configuration space information are consistent. By comparing these results, data consistency can be determined for further analysis, ultimately pinpointing the area to which the incorrect resource allocation problem belongs.

[0119] This application embodiment simplifies the problem localization process by quickly comparing two text files to generate comparison results. Furthermore, by comparing resource allocation information and configuration space information separately, it can comprehensively analyze the differences in resource allocation and hardware configuration, thereby improving the accuracy of problem localization.

[0120] In one embodiment of this application, locating the target system based on the comparison results includes:

[0121] When both the first comparison result and the second comparison result are the first preset result, or when the first comparison result is the second preset result and the second comparison result is the first preset result, the target system is identified as a basic input-output system; the first preset result is used to characterize data consistency, and the second preset result is used to characterize data inconsistency.

[0122] When the first comparison result is the first preset result and the second comparison result is the second preset result, the target system is located as the operating system;

[0123] When both the first comparison result and the second comparison result indicate that the data are inconsistent, the target system is located based on the first comparison result and the second comparison result.

[0124] In this embodiment of the application, a first preset result is used to characterize data consistency, and a second preset result is used to characterize data inconsistency. Therefore, the comparison results can have various cases, as shown below:

[0125] 1) The case where both the first comparison result and the second comparison result are the first preset result.

[0126] In this situation, if there is an incorrect resource allocation problem, the OS relies on the resource information allocated by the BIOS, as the BIOS is the initial stage of resource allocation. If the resource information allocated by the BIOS is incorrect, the OS will also receive incorrect information when reading the configuration space. Therefore, the domain of the incorrect resource allocation problem in this case is the Basic Input / Output System (BIOS), that is, the target system is the Basic Input / Output System (BIOS).

[0127] For example, suppose the resource base address of a PCIe device is incorrectly assigned to 0x1000 during the BIOS phase and also incorrectly adjusted to 0x1000 during the OS phase. In this case, although the resource base address in the two text files is the same, there is a clear error.

[0128] In this situation, consistent resource allocation and configuration space information can quickly pinpoint the root cause of incorrect resource allocation in the BIOS, reducing misjudgments and avoiding situations where incorrect OS configuration space information leads to misdiagnosis as an OS problem.

[0129] 2) The case where the first comparison result is the second preset result, and the second comparison result is the first preset result.

[0130] The inconsistency in resource allocation information, despite the consistency in configuration space information, indicates a problem with resource allocation. Since the Basic Input / Output System (BIOS) is responsible for initializing resource allocation, the BIOS can be directly identified as the system with incorrect resource allocation; therefore, the target system is the BIOS.

[0131] In this situation, the inconsistency in resource allocation information directly pinpoints the BIOS as the root cause of the incorrect resource allocation, simplifying the problem localization process and avoiding further analysis of configuration space information.

[0132] 3) The case where the first comparison result is the first preset result and the second comparison result is the second preset result.

[0133] Since the resource allocation information is consistent, but the configuration space information is inconsistent, the problem lies in the handling of the configuration space. The operating system (OS) is responsible for handling configuration space information; therefore, the OS can be directly identified as the system with the incorrect resource allocation problem. In other words, the target system is the operating system (OS).

[0134] In this case, by analyzing the inconsistency in configuration space information, the root cause of the problem—the OS—is directly identified as incorrect resource allocation, simplifying the problem localization process and avoiding further analysis of resource allocation information.

[0135] 4) The case where both the first comparison result and the second comparison result are the second preset result.

[0136] In this situation, further analysis of the specific inconsistencies is needed to determine whether the problem lies with the BIOS or the OS in incorrect resource allocation. This allows for accurate identification of the system with the incorrect resource allocation problem, avoiding misjudgment and simplifying the problem localization process.

[0137] In one embodiment of this application, locating the target system based on a first comparison result and a second comparison result includes:

[0138] Data that is inconsistent between the first resource allocation information and the second resource allocation information shall be identified as the first data.

[0139] Data that is inconsistent between the configuration space information corresponding to the first resource allocation information and the configuration space information corresponding to the second resource allocation information is identified as the second data.

[0140] The target system is located based on the first and second data.

[0141] In this embodiment, inconsistent data between the first resource allocation information and the second resource allocation information are identified as first data, reflecting inconsistencies in the resource allocation information. Inconsistent data between the configuration space information corresponding to the first resource allocation information and the configuration space information corresponding to the second resource allocation information are identified as second data, reflecting inconsistencies in the configuration space information.

[0142] By analyzing the data sources, trends, and correlations of the first and second data, the target system can be further identified. For example, if the changes in the first and second data are mainly caused by the BIOS, it can be determined that the BIOS has an incorrect resource allocation problem; if the changes in the first and second data are mainly caused by the OS, it can be determined that the OS has an incorrect resource allocation problem.

[0143] This application embodiment can quickly and accurately locate the target system by analyzing the inconsistent data (first data and second data) in the first comparison result and the second comparison result, thereby improving the efficiency and accuracy of problem investigation and enhancing the stability and reliability of the system.

[0144] In one embodiment of this application, locating the target system based on first data and second data includes:

[0145] When the first and second data are caused by the basic input / output system, the target system is identified as the basic input / output system.

[0146] When the first and second data are caused by the operating system, the target system is identified as the operating system.

[0147] In this embodiment of the application, the first data and the second data can be analyzed from aspects such as data source, trend of change, and correlation to obtain analysis results. These analysis results are used to characterize which system (BIOS or OS) caused the first data and the second data, as follows:

[0148] Data source analysis: Analyze the source of the first and second data to determine whether the data was generated by the BIOS or the OS.

[0149] Data trend analysis: Analyze the trends of the first and second data to determine whether the changes in these data are caused by the BIOS or the OS.

[0150] Data correlation analysis: Analyze the correlation between the first and second data to determine whether there is a causal relationship between the changes in these data.

[0151] This application embodiment can quickly locate the target system by analyzing the first data and the second data, reducing the troubleshooting time; and through clear analysis steps, it simplifies the problem localization process, making the problem troubleshooting more intuitive and systematic.

[0152] This application provides a method for automatically comparing resource allocation under BIOS and OS and quickly locating problems. Through interrupt interfaces and executable programs, after a PCIe resource allocation failure, BIOS engineers and OS engineers do not need to add or open serial port printing information and re-flash the version. This saves time for direct communication between different fields and avoids information discrepancies between different fields. It can quickly locate the field to which the problem belongs, avoiding waste of resources and time. After being given to the correct field, it can quickly perform localization analysis and provide solutions, reducing problems in the R&D process and improving R&D efficiency.

[0153] Referring to Figure 5, a schematic diagram of a process for obtaining a first text file in a basic input / output system is shown in an embodiment of this application.

[0154] Step 501: Create the first interrupt interface and the first program;

[0155] Step 502: When the first program is executed, obtain the first resource allocation information and the configuration space information corresponding to the first resource allocation information, and store them in the first text file;

[0156] Step 503: Output the first text file.

[0157] Referring to Figure 6, a schematic diagram of a process for obtaining a second text file in an operating system is shown in an embodiment of this application.

[0158] Step 601: Create a second interrupt interface and a second program;

[0159] Step 602: When the second program is executed, obtain the second resource allocation information and the configuration space information corresponding to the second resource allocation information, and store them in the second text file;

[0160] Step 603: Output the second text file.

[0161] It should be noted that, for the sake of simplicity, the method embodiments are all described as a series of actions. However, those skilled in the art should understand that the embodiments of this application are not limited to the described order of actions, because according to the embodiments of this application, some steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also understand that the embodiments described in the specification are all preferred embodiments, and the actions involved are not necessarily required by the embodiments of this application.

[0162] In addition, this application also provides an electronic device, including a processor, a communication interface, a memory, and a communication bus. The processor, the communication interface, and the memory communicate with each other through the communication bus. The memory is used to store computer programs. When the processor executes the program stored in the memory, it implements the various processes of the above-described resource allocation and positioning method embodiments and can achieve the same technical effect. To avoid repetition, it will not be described again here.

[0163] This application also provides a computer non-volatile readable storage medium storing instructions that, when executed by one or more processors, cause the processors to perform the various processes of the resource allocation and positioning method embodiments described above, achieving the same technical effect. To avoid repetition, these instructions will not be elaborated upon here. The computer non-volatile readable storage medium may include read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0164] This application also provides a computer program product, which is stored in a storage medium and executed by at least one processor to implement the various processes of the resource allocation and positioning method embodiments described above, and can achieve the same technical effect. To avoid repetition, it will not be described again here.

[0165] Figure 7 is a schematic diagram of the hardware structure of an electronic device that implements various embodiments of this application.

[0166] The electronic device 700 includes, but is not limited to, components such as: a radio frequency unit 701, a network module 702, an audio output unit 703, an input unit 704, a sensor 705, a display unit 706, a user input unit 707, an interface unit 708, a memory 709, a processor 710, and a power supply 711. Those skilled in the art will understand that the electronic device structure shown in FIG. 7 does not constitute a limitation on the electronic device; the electronic device may include more or fewer components than shown, or combine certain components, or have different component arrangements. In the embodiments of this application, the electronic device includes, but is not limited to, mobile phones, tablet computers, laptop computers, PDAs, in-vehicle terminals, wearable devices, and pedometers.

[0167] It should be understood that, in this embodiment, the radio frequency unit 701 can be used for receiving and transmitting signals during information transmission or calls. Specifically, it receives downlink data from the base station and processes it with the processor 710; additionally, it transmits uplink data to the base station. Typically, the radio frequency unit 701 includes, but is not limited to, an antenna, at least one amplifier, a transceiver, a coupler, a low-noise amplifier, a duplexer, etc. Furthermore, the radio frequency unit 701 can also communicate with networks and other devices through a wireless communication system.

[0168] Electronic devices provide users with wireless broadband internet access through network module 702, such as helping users send and receive emails, browse web pages, and access streaming media.

[0169] The audio output unit 703 can convert audio data received by the radio frequency unit 701 or the network module 702 or stored in the memory 709 into audio signals and output them as sound. Furthermore, the audio output unit 703 can also provide audio output related to specific functions performed by the electronic device 700 (e.g., call signal reception sound, message reception sound, etc.). The audio output unit 703 includes a speaker, a buzzer, and a receiver, etc.

[0170] Input unit 704 is used to receive audio or video signals. Input unit 704 may include a graphics processing unit (GPU) 7041 and a microphone 7042. The GPU 7041 processes image data of still images or videos acquired by an image capture device (such as a camera) in video capture mode or image capture mode. The processed image frames can be displayed on display unit 706. The image frames processed by GPU 7041 can be stored in memory 709 (or other storage medium) or transmitted via radio frequency unit 701 or network module 702. Microphone 7042 can receive sound and process such sound into audio data. The processed audio data can be converted into a format that can be transmitted to a mobile communication base station via radio frequency unit 701 in telephone call mode.

[0171] The electronic device 700 also includes at least one sensor 705, such as a light sensor, a motion sensor, and other sensors. Specifically, the light sensor includes an ambient light sensor and a proximity sensor. The ambient light sensor can adjust the brightness of the display panel 7061 according to the ambient light level, and the proximity sensor can turn off the display panel 7061 and / or backlight when the electronic device 700 is moved to the ear. As a type of motion sensor, an accelerometer sensor can detect the magnitude of acceleration in various directions (generally three axes). When stationary, it can detect the magnitude and direction of gravity and can be used to identify the posture of the electronic device (such as landscape / portrait switching, related games, magnetometer posture calibration), vibration recognition related functions (such as pedometer, tapping), etc. The sensor 705 may also include a fingerprint sensor, pressure sensor, iris sensor, molecular sensor, gyroscope, barometer, hygrometer, thermometer, infrared sensor, etc., which will not be described in detail here.

[0172] The display unit 706 is used to display information input by the user or information provided to the user. The display unit 706 may include a display panel 7061, which may be configured in the form of a liquid crystal display (LCD), an organic light-emitting diode (OLED), or the like.

[0173] User input unit 707 can be used to receive input numerical or character information, and to generate key signal inputs related to user settings and function control of electronic devices. Specifically, user input unit 707 includes a touch panel 7071 and other input devices 7072. Touch panel 7071, also known as a touch screen, can collect touch operations performed by the user on or near it (such as operations performed by the user using a finger, stylus, or any suitable object or accessory on or near touch panel 7071). Touch panel 7071 may include two parts: a touch detection device and a touch controller. The touch detection device detects the user's touch position and the signal generated by the touch operation, and transmits the signal to the touch controller; the touch controller receives touch information from the touch detection device, converts it into touch point coordinates, and sends it to the processor 710, which receives and executes commands from the processor 710. In addition, touch panel 7071 can be implemented using various types such as resistive, capacitive, infrared, and surface acoustic wave. Besides touch panel 7071, user input unit 707 may also include other input devices 7072. Specifically, other input devices 7072 may include, but are not limited to, physical keyboards, function keys (such as volume control buttons, power buttons, etc.), trackballs, mice, joysticks, etc., which will not be described in detail here.

[0174] Furthermore, the touch panel 7071 can cover the display panel 7061. When the touch panel 7071 detects a touch operation on or near it, it transmits the information to the processor 710 to determine the type of touch event. Subsequently, the processor 710 provides corresponding visual output on the display panel 7061 according to the type of touch event. Although in Figure 7, the touch panel 7071 and the display panel 7061 are shown as two separate components to implement the input and output functions of the electronic device, in some embodiments, the touch panel 7071 and the display panel 7061 can be integrated to implement the input and output functions of the electronic device. Specific details are not limited here.

[0175] Interface unit 708 serves as an interface for connecting external devices to electronic device 700. For example, external devices may include a wired or wireless headphone port, an external power supply (or battery charger) port, a wired or wireless data port, a memory card port, a port for connecting a device with an identification module, an audio input / output (I / O) port, a video I / O port, a headphone port, and so on. Interface unit 708 can be used to receive input from external devices (e.g., data, power, etc.) and transmit the received input to one or more components within electronic device 700, or it can be used to transmit data between electronic device 700 and external devices.

[0176] The memory 709 can be used to store software programs and various data. The memory 709 may primarily include a program storage area and a data storage area. The program storage area may store the operating system, applications required for at least one function (such as sound playback, image playback, etc.), etc.; the data storage area may store data created based on the use of the mobile phone (such as audio data, phonebook, etc.). Furthermore, the memory 709 may include high-speed random access memory, and may also include non-volatile memory, such as at least one disk storage device, flash memory device, or other volatile solid-state storage device.

[0177] The processor 710 is the control center of the electronic device. It connects various parts of the electronic device via various interfaces and lines. By running or executing software programs and / or modules stored in the memory 709, and by calling data stored in the memory 709, it performs various functions and processes data, thereby providing overall monitoring of the electronic device. The processor 710 may include one or more processing units; preferably, the processor 710 may integrate an application processor and a modem processor. The application processor mainly handles the operating system, user interface, and applications, while the modem processor mainly handles wireless communication. It is understood that the modem processor may not be integrated into the processor 710.

[0178] The electronic device 700 may also include a power supply 711 (such as a battery) for supplying power to various components. Preferably, the power supply 711 is logically connected to the processor 710 through a power management system, thereby enabling functions such as managing charging, discharging, and power consumption through the power management system.

[0179] In addition, the electronic device 700 includes some functional modules not shown, which will not be described in detail here.

[0180] As shown in Figure 8, in another embodiment provided in this application, a computer non-volatile readable storage medium 801 is also provided. The computer non-volatile readable storage medium stores instructions that, when run on a computer, cause the computer to execute the resource allocation and positioning method in the above embodiment.

[0181] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element.

[0182] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the related technology, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) and includes several instructions to cause a terminal (which may be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods of the various embodiments of this application.

[0183] The embodiments of this application have been described above with reference to the accompanying drawings. However, this application is not limited to the specific embodiments described above. The specific embodiments described above are merely illustrative and not restrictive. Those skilled in the art can make many other forms under the guidance of this application without departing from the spirit and scope of the claims, and all of these forms are within the protection scope of this application.

[0184] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed in this application can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0185] Those skilled in the art will understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.

[0186] In the embodiments provided in this application, it should be understood that the disclosed apparatus and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or units may be electrical, mechanical, or other forms.

[0187] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0188] In addition, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.

[0189] If a function is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to related technologies, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, ROM, RAM, magnetic disks, or optical disks.

[0190] The above are merely specific embodiments of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.

Claims

1. A resource allocation and positioning method, characterized in that, The resource allocation involves a basic input / output system and an operating system. After the basic input / output system performs an initial resource allocation, the resources obtained are sent to the operating system for a secondary resource allocation. The method includes: Obtain the first text file corresponding to the initial resource allocation of the basic input / output system, and the second text file corresponding to the secondary resource allocation of the operating system; The first text file and the second text file are compared to obtain the comparison result; The target system is located based on the comparison results; the target system is the basic input / output system or the operating system.

2. The method according to claim 1, characterized in that, The step of obtaining the first text file corresponding to the initial resource allocation performed by the basic input / output system and the second text file corresponding to the secondary resource allocation performed by the operating system includes: Obtain first resource allocation information from the first text file and second resource allocation information from the second text file; the first resource allocation information is the resource allocation information of the basic input / output system when performing the initial resource allocation, and the second resource allocation information is the resource allocation information of the operating system when performing the secondary resource allocation.

3. The method according to claim 2, characterized in that, After obtaining the first resource allocation information from the first text file and the second resource allocation information from the second text file, the method further includes: The configuration space information corresponding to the first resource allocation information in the first text file and the configuration space information corresponding to the second resource allocation information in the second text file are obtained. The basic input / output system performs initial resource allocation based on the configuration space information corresponding to the first resource allocation information, and the operating system performs secondary resource allocation based on the configuration space information corresponding to the first resource allocation information.

4. The method according to claim 3, characterized in that, The configuration space information includes the hardware device's configuration register, status register, and control register, which are configured to describe the hardware device's configuration and status.

5. The method according to claim 2, characterized in that, Before obtaining the first text file corresponding to the initial resource allocation performed by the basic input / output system and the second text file corresponding to the secondary resource allocation performed by the operating system, the method further includes: A first interrupt interface and a first program are constructed under the basic input / output system, and a second interrupt interface and a second program are constructed under the operating system; Link the first interrupt interface to the first program, and link the second interrupt interface to the second program; The first resource allocation information is obtained through the first interrupt interface, and the second resource allocation information is obtained through the second interrupt interface; The first resource allocation information is stored in the first text file through the first program, and the second resource allocation information is stored in the second text file through the second program.

6. The method according to claim 5, characterized in that, The first program runs in the basic input / output system environment and is configured to obtain detailed information about the initial resource allocation of the basic input / output system in order to generate the first text file, which records all the details of the initial resource allocation.

7. The method according to claim 5, characterized in that, The second program runs in the operating system environment and is configured to obtain detailed information about the operating system's secondary resource allocation in order to generate the second text file, which records all the details of the secondary resource allocation.

8. The method according to claim 5, characterized in that, After storing the first resource allocation information into the first text file through the first program and storing the second resource allocation information into the second text file through the second program, the method further includes: Add configuration space commands to the first program and the second program respectively; The configuration space information corresponding to the first resource allocation information is obtained through the configuration space command in the first program, and the configuration space information corresponding to the first resource allocation information is stored in the first text file; and the configuration space information corresponding to the second resource allocation information is obtained through the configuration space command in the second program, and the configuration space information corresponding to the second resource allocation information is stored in the second text file.

9. The method according to claim 4, characterized in that, The step of comparing the first text file and the second text file to obtain the comparison result includes: The first resource allocation information and the second resource allocation information are compared to obtain the first comparison result; The configuration space information corresponding to the first resource allocation information and the configuration space information corresponding to the second resource allocation information are compared to obtain a second comparison result; The first comparison result and the second comparison result are used as the comparison result.

10. The method according to claim 9, characterized in that, The second comparison result includes changes to the configuration register, changes to the status register, and changes to the control register.

11. The method according to claim 9, characterized in that, The step of locating the target system based on the comparison results includes: When both the first comparison result and the second comparison result are the first preset result, or when the first comparison result is the second preset result and the second comparison result is the first preset result, the target system is identified as the basic input / output system; the first preset result is configured to represent consistent data, and the second preset result is configured to represent inconsistent data; When the first comparison result is the first preset result and the second comparison result is the second preset result, the target system is identified as the operating system. When both the first comparison result and the second comparison result indicate inconsistent data, the target system is located based on the first comparison result and the second comparison result.

12. The method according to claim 11, characterized in that, The step of locating the target system based on the first comparison result and the second comparison result includes: Data that is inconsistent between the first resource allocation information and the second resource allocation information is identified as the first data; Data that is inconsistent between the configuration space information corresponding to the first resource allocation information and the configuration space information corresponding to the second resource allocation information is identified as the second data. The target system is located based on the first data and the second data.

13. The method according to claim 12, characterized in that, The step of locating the target system based on the first data and the second data includes: When the first data and the second data are caused by the basic input / output system, the target system is identified as the basic input / output system; When the first data and the second data are caused by the operating system, the target system is identified as the operating system.

14. The method according to claim 5, characterized in that, When the first program is executed, it calls the first interrupt interface to store the first resource allocation information in the first text file; when the second program is executed, it calls the second interrupt interface to store the second resource allocation information in the second text file.

15. The method according to claim 9, characterized in that, The first resource allocation information and the second resource allocation information respectively include: resource base address, input and output resource size, resource mapping information, resource enumeration part, and resource allocation part.

16. The method according to claim 15, characterized in that, The first comparison result includes changes in the resource base address, changes in the input / output resource size, and changes in the resource mapping information.

17. The method according to claim 5, characterized in that, The first text file is saved in the same path as the first program, and the second text file is saved in the same path as the second program.

18. An electronic device, characterized in that, It includes a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other through the communication bus; The memory is configured to store computer programs; When the processor is configured to execute a program stored in memory, it implements the method as described in any one of claims 1-17.

19. A computer non-volatile readable storage medium having instructions stored thereon that, when executed by one or more processors, cause the processors to perform the method as described in any one of claims 1-17.

20. A computer program product comprising a computer program / instructions, characterized in that, When the computer program / instructions are executed by the processor, they implement the method as described in any one of claims 1-17.

Citation Information

Patent Citations

  • Fault diagnosis method and device, electronic equipment and storage medium

    CN111767184A

  • Method and device for testing system stability, equipment and storage medium

    CN117251361A

  • Information processing method and device, electronic equipment and storage medium

    CN117687695A

  • Fault diagnosis drive loading method and device, electronic equipment and storage medium

    CN117806721A

  • PCIe resource allocation method and device, electronic equipment and storage medium

    CN118034917A