Method for optimizing starting time of UEFI firmware, electronic equipment and storage medium

By optimizing the loading order of UEFI firmware, the problem of increasing startup time caused by multiple loading of drivers in the prior art is solved, and a faster UEFI firmware startup is achieved.

CN119396477APending Publication Date: 2025-02-07SHENZHEN JAGUAR MICROSYSTEMS CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411503170.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-25
Publication Date
2025-02-07

AI Technical Summary

Technical Problem

In the prior art, when optimizing the UEFI firmware startup time, the driver's loading conditions are not satisfied, resulting in multiple loadings, increasing the startup time.

Method used

By obtaining the default loading order and loading relationship files of multiple drivers, determine the loading conditions of each driver, and optimize the loading order according to these conditions, generate the executable file of the UEFI firmware so that it loads the driver in the optimized order at startup program.

Benefits of technology

Reduces the time to detect and wait for driver loading conditions when UEFI firmware is started, thus shortening the startup time of UEFI firmware.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119396477A_ABST
    Figure CN119396477A_ABST
Patent Text Reader

Abstract

The invention discloses a method for optimizing starting time of UEFI firmware, electronic equipment and a storage medium. The method comprises the following steps: acquiring a default loading sequence of a plurality of driving programs; obtaining a loading relation file of each driving program; determining a loading condition of each driving program according to the loading relation file of each driving program; optimizing the default loading sequence according to the loading condition of each driving program to obtain an optimized loading sequence; and generating an executable file of the UEFI firmware according to the optimized loading sequence. According to the method, the executable file of the UEFI firmware is generated and stored according to the optimized loading sequence, when the UEFI firmware is operated, the UEFI firmware can load each driving program in sequence according to the optimized loading sequence, the time for detecting whether the driving program meets the loading condition or not and the time for waiting for the driving program to meet the loading condition when the UEFI firmware is started can be shortened, and the user experience is improved. Therefore, the starting time of the UEFI firmware is shortened.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and in particular to a method for optimizing the boot time of UEFI firmware, an electronic device and a storage medium. Background Art

[0002] In modern computer systems, UEFI (Unified Extensible Firmware Interface) firmware is a key component in the system startup process. It is responsible for initializing hardware and loading the operating system, which directly affects the computer's startup speed.

[0003] Currently, in order to optimize the boot time of UEFI firmware, commonly used methods include cutting unnecessary drivers or running minimized necessary drivers to boot the system.

[0004] However, with the existing method, sometimes the driver needs to be loaded multiple times before it can be executed because the loading conditions of the driver are not met, which increases the startup time. Summary of the invention

[0005] In view of the deficiencies in the prior art, the present application provides a method, an electronic device and a storage medium for optimizing the boot time of UEFI firmware. By generating and storing an executable file of the UEFI firmware according to an optimized loading order, when the UEFI firmware is running, the UEFI firmware can load each driver program in sequence according to the optimized loading order, which can reduce the time for detecting whether the driver program meets the loading conditions and the time for waiting for the driver program to meet the loading conditions when the UEFI firmware is started, thereby reducing the boot time of the UEFI firmware.

[0006] To solve the above problems, the present invention provides the following technical solutions:

[0007] In a first aspect, an embodiment of the present application provides a method for optimizing the boot time of UEFI firmware, including: obtaining a default loading order of multiple drivers;

[0008] Obtaining a loading relationship file of each of the drivers;

[0009] Determining a loading condition of each of the drivers according to a loading relationship file of each of the drivers;

[0010] Optimizing the default loading order according to the loading condition of each driver to obtain an optimized loading order, so that the optimized loading order meets the loading condition of each driver;

[0011] An executable file of the UEFI firmware is generated according to the optimized loading sequence, and the executable file of the UEFI firmware is used to allow the UEFI firmware to load each of the drivers in sequence according to the optimized loading sequence when being executed.

[0012] In some implementations, obtaining the default loading order of multiple drivers includes:

[0013] Obtaining the FDF file of the UEFI firmware, identifying the FDF file to obtain the default loading order of the multiple drivers;

[0014] Determining the loading condition of each driver according to the loading relationship file of each driver includes:

[0015] Determining the loading condition of each driver according to the Depex expression and GUID generation description information in the loading relationship file of each driver;

[0016] The step of generating an executable file of the UEFI firmware according to the optimized loading sequence includes:

[0017] The FDF file is compiled according to the optimized loading sequence to obtain an executable file of the UEFI firmware, and the executable file is stored.

[0018] In some implementations, the loading conditions include a plurality of different types, and optimizing the default loading order according to the loading conditions of each of the drivers to obtain an optimized loading order so that the optimized loading order satisfies the loading conditions of each of the drivers includes:

[0019] The default loading order is optimized in turn according to the loading conditions of each type and the loading conditions of each driver program to obtain a final optimized loading order.

[0020] In some implementations, optimizing the default loading order in sequence according to the loading condition of each type and the loading condition of each driver program includes:

[0021] Determine a target driver with the same type of loading condition according to the current type of loading condition;

[0022] The loading mode is determined based on the loading condition of the current type, and the loading order of all the target drivers is set according to the loading mode, thereby optimizing the default loading order.

[0023] In some implementations, the loading condition includes a Before type, an After type, and a GUID type, the loading mode is determined based on the loading condition of the current type, and the loading order of all the target drivers is set according to the loading mode, thereby optimizing the default loading order once, including:

[0024] When the current type of loading condition is the Before type, determining the driver corresponding to the target driver according to the loading condition of each target driver, and arranging the loading order of the target driver before the loading order of the corresponding driver;

[0025] When the current type of loading condition is the After type, determining the driver corresponding to the target driver according to the loading condition of each target driver, and arranging the loading order of the target driver after the loading order of the corresponding driver;

[0026] When the current type of loading condition is a GUID type, a driver that generates a corresponding GUID is determined according to the loading condition of each target driver, and the loading order of the target driver is arranged after the loading order of the corresponding driver.

[0027] In some implementations, before optimizing the default loading order according to the loading condition of each driver to obtain an optimized loading order so that the optimized loading order satisfies the loading condition of each driver, the method further includes:

[0028] Constructing a sequential linked list according to the default loading order of the plurality of drivers;

[0029] The step of optimizing the default loading sequence according to the loading condition of each driver to obtain an optimized loading sequence, so that the optimized loading sequence satisfies the loading condition of each driver, comprises:

[0030] The loading order of each driver in the sequential linked list is updated according to the loading condition of each driver, thereby obtaining a sequential linked list representing the optimized loading order.

[0031] In some implementations, obtaining the default loading order of multiple drivers includes:

[0032] Get the default loading order for multiple drivers when compiling and creating a UEFI firmware volume.

[0033] In a second aspect, an embodiment of the present application provides a method for optimizing the boot time of UEFI firmware, including:

[0034] Obtaining an executable file of the UEFI firmware, wherein the executable file includes an optimized loading sequence obtained by optimizing the default loading sequence;

[0035] When executing the executable file of the UEFI firmware, each driver is loaded in sequence according to the optimized loading order in the executable file.

[0036] In a third aspect, an embodiment of the present application provides an electronic device, the electronic device comprising:

[0037] at least one processor; and,

[0038] a memory communicatively connected to the at least one processor; wherein,

[0039] The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to execute the method for optimizing the boot time of UEFI firmware as described in the first aspect or the second aspect.

[0040] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores an executable program, and the executable program is executed by a processor to implement the method for optimizing the boot time of UEFI firmware as described in the first aspect or the second aspect.

[0041] The present application provides a method, electronic device and storage medium for optimizing the boot time of UEFI firmware. The present application generates and stores an executable file of UEFI firmware according to an optimized loading sequence. When the UEFI firmware is running, the UEFI firmware can sequentially load each driver according to the optimized loading sequence, thereby reducing the time for detecting whether the driver meets the loading conditions and the time for waiting for the driver to meet the loading conditions when the UEFI firmware is started, thereby reducing the boot time of the UEFI firmware. BRIEF DESCRIPTION OF THE DRAWINGS

[0042] Figure 1 It is a flowchart of a first implementation method of a first method for optimizing the boot time of UEFI firmware provided in an embodiment of the present application.

[0043] Figure 2A It is a schematic diagram of the default loading sequence provided in the embodiment of the present application.

[0044] Figure 2B It is a schematic diagram of the default loading order after the first optimization according to the Before type loading condition provided in an embodiment of the present application.

[0045] Figure 2CIt is a schematic diagram of the default loading order after the second optimization according to the After type loading condition provided in an embodiment of the present application.

[0046] Figure 2D It is a schematic diagram of the default loading order after the third optimization based on the loading conditions of the GUID type provided in an embodiment of the present application.

[0047] Figure 3 It is a flow chart of the second implementation mode of the first method for optimizing the boot time of UEFI firmware provided in an embodiment of the present application.

[0048] Figure 4 It is a flowchart of a second method for optimizing the boot time of UEFI firmware provided in an embodiment of the present application.

[0049] Figure 5 It is a structural schematic diagram of a device for optimizing the boot time of UEFI firmware provided in an embodiment of the present application.

[0050] Figure 6 It is a structural schematic diagram of an electronic device provided in an embodiment of the present application.

[0051] Figure 7 It is a structural block diagram of a computer-readable storage medium provided in an embodiment of the present application. DETAILED DESCRIPTION

[0052] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0053] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Therefore, the features defined as "first" and "second" may explicitly or implicitly include one or more of the features. In the description of the present invention, the meaning of "plurality" is two or more, unless otherwise clearly and specifically defined.

[0054] The present application provides a method, electronic device and storage medium for optimizing the boot time of UEFI firmware. By generating and storing an executable file of UEFI firmware according to an optimized loading sequence, when the UEFI firmware is running, the UEFI firmware can sequentially load each driver according to the optimized loading sequence, which can reduce the time for detecting whether the driver meets the loading condition and the time for waiting for the driver to meet the loading condition when the UEFI firmware is started, thereby reducing the boot time of the UEFI firmware.

[0055] The method for optimizing the boot time of UEFI firmware provided by the present application will be described in detail below with reference to the accompanying drawings.

[0056] See also Figure 1 , Figure 1 1 is a flow chart of a first implementation method of a first method for optimizing the boot time of UEFI firmware provided in an embodiment of the present application. Figure 1 As shown, the method for optimizing the boot time of UEFI firmware includes: steps S100 to S500.

[0057] Step S100: Obtaining the default loading order of multiple driver programs.

[0058] In some implementations, when compiling and creating a UEFI firmware volume, the default loading order of multiple drivers is obtained. A UEFI firmware volume is a logical firmware device and a basic storage repository for storing data and code. A UEFI firmware volume can be converted into an executable file of the UEFI firmware.

[0059] In some implementations, before compiling and creating a UEFI firmware volume, steps S100 to S400 of the first method are performed to pre-process the default loading order of the driver.

[0060] In some implementations, an FDF file of the UEFI firmware is obtained, and the FDF file is identified to obtain a default loading order of multiple drivers.

[0061] Optionally, FDF is a format of a description file, and the FDF file includes a default loading order of multiple drivers and an address of a loading relationship file of each driver.

[0062] See also Figure 2A , Figure 2A Schematic diagram of the default loading sequence provided by the embodiment of the present application. Figure 2A As shown, exemplarily, the default loading order is to load driver A, driver B, driver C, driver D, driver E, and driver F in sequence.

[0063] Step S200: Obtain the loading relationship file of each driver.

[0064] In some implementations, the loading relationship file of each driver is obtained according to the address of the loading relationship file of each driver in the FDF file.

[0065] Optionally, one driver corresponds to one loading relationship file.

[0066] Optionally, the format of the loading relationship file is INF (Device INFormation File, device information file).

[0067] Step S300: Determine the loading condition of each driver program according to the loading relationship file of each driver program.

[0068] In some implementations, the loading condition of each driver is determined based on the Depex expression and GUID generation description information in the loading relationship file of each driver.

[0069] Depex (Dependency Expression) expression is also called dependency expression, which is used to describe the loading dependency between drivers, that is, the loading condition. GUID generation description information indicates that the driver generates a GUID (Globally Unique Identifier) ​​variable.

[0070] Optionally, the loading condition of the driver is: the loading dependency of the driver is satisfied.

[0071] In some embodiments, the loading conditions include a plurality of different types.

[0072] Optionally, the loading condition includes a Before type, an After type, and a GUID type.

[0073] Optionally, the loading condition also includes a True type.

[0074] Optionally, the loading condition also includes other types.

[0075] like Figure 2A As shown, illustratively, according to the Depex expression of driver A, it can be determined that the loading condition of driver A is After B, which means that the loading condition of driver A is of After type, and the loading condition of driver A is: driver A can be loaded only after driver B is loaded.

[0076] like Figure 2AAs shown, illustratively, according to the Depex expression of driver B, it can be determined that the loading condition of driver B is True, indicating that the loading condition of driver B is of True type, and the loading condition of driver B is: driver B can be loaded in any loading order.

[0077] like Figure 2A As shown, exemplarily, according to the Depex expression of driver C, it can be determined that the loading condition of driver C is gabcdProtocolguid. Among them, gabcdProtocolguid is a GUID variable, indicating that the loading condition of driver C is of GUID type. GUID (Globally Unique Identifier) ​​is a digital identifier with a binary length of 128 bits generated by an algorithm. The loading condition of driver C is: driver C can be loaded only after gabcdProtocolguid is generated.

[0078] like Figure 2A As shown, exemplarily, according to the Depex expression of driver D, it can be determined that the loading condition of driver D is Before A, which means that the loading condition of driver D is of Before type, and the loading condition of driver D is: load driver D before driver A is loaded.

[0079] like Figure 2A As shown, illustratively, according to the Depex expression of driver E, it can be determined that the loading condition of driver E is Before C, which means that the loading condition of driver E is of Before type, and the loading condition of driver E is: load driver E before driver C is loaded.

[0080] like Figure 2A As shown, exemplarily, based on the GUID generation description information of driver F, it can be determined that driver F will generate gabcdProtocolguid when loaded. As mentioned above, the loading condition of driver C is: driver C can be loaded only after gabcdProtocolguid is generated. Therefore, the loading condition of driver F is: load driver F before driver C is loaded.

[0081] Step S400: optimizing the default loading sequence according to the loading condition of each driver program to obtain an optimized loading sequence, so that the optimized loading sequence satisfies the loading condition of each driver program.

[0082] In some implementations, the default loading order is optimized in turn according to the loading conditions of each type and the loading conditions of each driver to obtain a final optimized loading order.

[0083] In some implementations, the default loading order is optimized in sequence according to the loading conditions of each type and the loading conditions of each driver, including steps (400.1) to (400.2).

[0084] (400.1) Determine a target driver with the same type of loading condition according to the current type of loading condition.

[0085] like Figure 2A As shown, exemplarily, the loading conditions of the driver D and the driver E are both of the Before type. When the current type of loading condition is of the Before type, the driver D and the driver E are both target drivers.

[0086] (400.2) Determine the loading mode based on the current type of loading conditions, and set the loading order of all target drivers according to the loading mode, thereby optimizing the default loading order.

[0087] In some embodiments, step (400.2) includes steps (400.2.1) to (400.2.3).

[0088] (400.2.1) When the current type of loading condition is the Before type, the driver corresponding to the target driver is determined according to the loading condition of each target driver, and the loading order of the target driver is arranged before the loading order of the corresponding driver.

[0089] like Figure 2A As shown, exemplarily, the loading condition of driver D is of Before type, and the loading condition of driver D is: load driver D before driver A is loaded, so the driver corresponding to driver D is driver A, and the loading order of driver D is placed before the loading order of driver A.

[0090] Exemplarily, the loading condition of driver E is of Before type, and the loading condition of driver E is: load driver E before driver C is loaded, so the driver corresponding to driver E is driver C, and the loading order of driver E is placed before the loading order of driver C.

[0091] See also Figure 2B , Figure 2B Schematic diagram of the default loading order after the first optimization according to the Before type loading condition provided in the embodiment of the present application. Figure 2B As shown, exemplarily, the default loading order after the first optimization is to load driver D, driver A, driver B, driver E, driver C, and driver F in sequence.

[0092] (400.2.2) When the current type of loading condition is the After type, the driver corresponding to the target driver is determined according to the loading condition of each target driver, and the loading order of the target driver is arranged after the loading order of the corresponding driver.

[0093] like Figure 2B As shown, exemplarily, the loading condition of driver A is of After type, and the loading condition of driver A is: driver A can be loaded only after driver B is loaded. Therefore, the driver corresponding to driver A is driver B, and the loading order of driver A is arranged after the loading order of driver B.

[0094] See also Figure 2C , Figure 2C Schematic diagram of the default loading order after the second optimization according to the After type loading condition provided in the embodiment of the present application. Figure 2C As shown, exemplarily, the default loading order after the second optimization is to load driver D, driver B, driver A, driver E, driver C, and driver F in sequence.

[0095] (400.2.3) When the current type of loading condition is a GUID type, the driver that generates the corresponding GUID is determined according to the loading condition of each target driver, and the loading order of the target driver is arranged after the loading order of the corresponding driver.

[0096] like Figure 2C As shown, exemplarily, the loading condition of driver C is of GUID type, and the loading condition of driver C is: driver C can be loaded only after gabcdProtocolguid is generated. According to the GUID generation description information of driver F, it can be determined that driver F will generate gabcdProtocolguid when loading. Therefore, it can be determined that the driver corresponding to driver C is driver F, and the loading order of driver C is placed after the loading order of driver F.

[0097] See also Figure 2D , Figure 2D Schematic diagram of the default loading order after the third optimization according to the loading conditions of the GUID type provided in the embodiment of the present application. Figure 2D As shown, exemplarily, the default loading order after the third optimization is to load driver D, driver B, driver A, driver E, driver F, and driver C in sequence.

[0098] In some implementations, when the default loading order is optimized in sequence according to all types of loading conditions and the loading conditions of each driver, the final optimized loading order is obtained.

[0099] See also Figure 3 , Figure 3 1 is a flow chart of a second implementation of the first method for optimizing the boot time of UEFI firmware provided in an embodiment of the present application. Figure 3 As shown, the method for optimizing the boot time of UEFI firmware further includes step S310 before step S400.

[0100] Step S310: construct a sequential linked list according to the default loading order of multiple drivers.

[0101] For example, when the default loading order is to load driver A, driver B, driver C, driver D, driver E, and driver F in sequence, the first node of the sequential linked list represents driver A, the second node represents driver B, the third node represents driver C, and so on.

[0102] In some implementations, step S400 includes: updating the loading order of each driver in the sequential linked list according to the loading condition of each driver, thereby obtaining a sequential linked list representing an optimized loading order.

[0103] Optionally, by updating the pointer of each node in the sequential linked list, the loading order of each driver in the sequential linked list can be updated, thereby obtaining a sequential linked list representing the optimized loading order. For example, when it is necessary to arrange the loading order of driver D before the loading order of driver A, the pointer of the node representing driver D is pointed to the node representing driver A, thereby arranging the loading order of driver D before the loading order of driver A. In this way, compared with the method of updating the array, it is convenient to update the loading order of each driver, thereby reducing the processing time.

[0104] Step S500: Generate an executable file of the UEFI firmware according to the optimized loading sequence.

[0105] The executable file of the UEFI firmware is used to allow the UEFI firmware to load each driver in sequence according to the optimized loading order when being executed.

[0106] In some implementations, the FDF file is compiled according to the optimized loading order to obtain an executable file of the UEFI firmware, and the executable file is stored.

[0107] Optionally, an optimized loading order is identified based on the final updated sequential linked list.

[0108] As described above, the FDF file includes a default load order for multiple drivers. Optionally, replace the default load order in the FDF file with an optimized load order, and then compile the FDF file.

[0109] Optionally, the FDF file and other component files of the UEFI firmware are compiled together according to the optimized loading order to obtain an executable file of the UEFI firmware.

[0110] Optionally, the format of the executable file is a BIN file.

[0111] See also Figure 4 , Figure 4 1 is a flow chart of a second method for optimizing the boot time of UEFI firmware provided in an embodiment of the present application. Figure 4 As shown, in some embodiments, the second method includes: steps S600 to S700.

[0112] Step S600: Obtain the executable file of the UEFI firmware.

[0113] The executable file includes an optimized loading order obtained by optimizing the default loading order.

[0114] Step S700: when executing the executable file of the UEFI firmware, each driver is loaded in sequence according to the optimized loading order in the executable file.

[0115] By adopting the above method, the driver program will not need to be loaded multiple times before being executed due to failure to meet the loading conditions of the driver program, thereby reducing the startup time of the UEFI firmware.

[0116] In some implementations, during the PEI (Pre-EFI Initialization) phase and the DXE (Driver Execution Environment) phase of UEFI firmware startup, each driver is loaded in sequence according to an optimized loading order.

[0117] In summary, the method for optimizing the boot time of UEFI firmware provided by the embodiment of the present application has the following advantages:

[0118] 1. By generating and storing the executable file of the UEFI firmware according to the optimized loading order, when the UEFI firmware is running, the UEFI firmware can load each driver in sequence according to the optimized loading order, which can reduce the time for detecting whether the driver meets the loading conditions and the time for waiting for the driver to meet the loading conditions when the UEFI firmware is started, thereby reducing the startup time of the UEFI firmware.

[0119] 2. By updating the sequential linked list, compared with the array update method, it is convenient to update the loading order of each driver, thereby reducing the processing time.

[0120] See also Figure 5 , Figure 5 Schematic diagram of the structure of the device for optimizing the boot time of UEFI firmware provided in the embodiment of the present application. Figure 5 As shown, the apparatus 300 for optimizing the boot time of UEFI firmware includes a pre-processing module 310 and a generating module 320 .

[0121] In some embodiments, the preprocessing module 310 is used to obtain the default loading order of multiple drivers; obtain the loading relationship file of each driver; determine the loading condition of each driver based on the loading relationship file of each driver; optimize the default loading order according to the loading condition of each driver to obtain an optimized loading order, so that the optimized loading order meets the loading condition of each driver.

[0122] In some implementations, the generation module 320 is used to generate an executable file of the UEFI firmware according to the optimized loading order, and the executable file of the UEFI firmware is used to allow the UEFI firmware to load each driver in sequence according to the optimized loading order when executed.

[0123] See also Figure 6 , Figure 6 Schematic diagram of the structure of an electronic device provided in an embodiment of the present application. Figure 6 As shown, the electronic device 400 includes: one or more processors 410 and a memory 420, Figure 6 A processor 410 is taken as an example.

[0124] In some implementations, the processor 410 and the memory 420 may be connected via a bus or other means. Figure 6 The example of connecting through bus is taken in the following.

[0125] In some embodiments, the processor 410 is used to obtain a default loading order of multiple drivers; obtain a loading relationship file of each driver; determine the loading condition of each driver according to the loading relationship file of each driver; optimize the default loading order according to the loading condition of each driver to obtain an optimized loading order, so that the optimized loading order meets the loading condition of each driver; generate an executable file of the UEFI firmware according to the optimized loading order, and the executable file of the UEFI firmware is used to allow the UEFI firmware to load each driver in sequence according to the optimized loading order when executed.

[0126] In some implementations, the processor 410 is configured to obtain an executable file of the UEFI firmware; when executing the executable file of the UEFI firmware, each driver is sequentially loaded according to an optimized loading order in the executable file.

[0127] In some embodiments, the memory 420, as a non-volatile computer-readable storage medium, can be used to store non-volatile software programs, non-volatile computer executable programs and modules, such as the program instructions / modules of the first method or the second method for optimizing the boot time of the UEFI firmware in the embodiments of the present application. The processor 410 executes various functional applications and data processing of the electronic device 400 by running the non-volatile software programs, instructions and modules stored in the memory 420, that is, the first method or the second method for optimizing the boot time of the UEFI firmware in the above method embodiments is implemented.

[0128] In some embodiments, the memory 420 may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function; the data storage area may store data created according to the use of the electronic device 400, etc. In addition, the memory 420 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other non-volatile solid-state storage device. In some embodiments, the memory 420 may optionally include a memory remotely arranged relative to the processor 410, and these remote memories may be connected to the controller via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0129] In some embodiments, one or more modules are stored in the memory 420, and when executed by one or more processors 410, the first method for optimizing the boot time of the UEFI firmware in any of the above method embodiments is executed, for example, the first method for optimizing the boot time of the UEFI firmware described above is executed. Figure 1 The method comprises steps S100 to S500.

[0130] In some embodiments, one or more modules are stored in the memory 420, and when executed by one or more processors 410, the second method for optimizing the boot time of the UEFI firmware in any of the above method embodiments is executed, for example, the above described second method for optimizing the boot time of the UEFI firmware is executed. Figure 4 Method steps S600 to S700.

[0131] In some embodiments, the electronic device may be a chip, such as a data processor (DPU) chip used in a data center, or the electronic device may be a network interface card including a chip and multiple interfaces (such as a PCI / PCIE interface, a UART interface, a USB interface, etc.), or the electronic device may be a traditional server, or a server including a network interface card or a chip, wherein the server includes a host and a data processor, wherein the data processor is used to dispatch messages to the host or the data processor itself for processing, and the host is used to process messages dispatched by the data processor.

[0132] Please refer to Figure 7 , Figure 7 The computer-readable storage medium 500 stores a program code 510, which can be called by a processor to execute the first method or the second method for optimizing the boot time of UEFI firmware described in the above method embodiment.

[0133] The computer-readable storage medium 500 may be an electronic memory such as a flash memory, an EEPROM (electrically erasable programmable read-only memory), an EPROM, a hard disk, or a ROM. Optionally, the computer-readable storage medium includes a non-transitory computer-readable storage medium. The computer-readable storage medium 500 has a storage space for program codes for executing any method steps in the first method or the second method for optimizing the boot time of the UEFI firmware described above. These program codes may be read from or written to one or more computer program products. The program code may be compressed, for example, in an appropriate form.

[0134] In some implementations, the embodiments of the present application further provide a computer program product, including a computer program, which, when executed by a processor, implements the above-mentioned first method for optimizing the boot time of UEFI firmware.

[0135] In some implementations, the embodiments of the present application further provide a computer program product, including a computer program, which, when executed by a processor, implements the above-mentioned second method for optimizing the boot time of UEFI firmware.

[0136] Those of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a computer-readable storage medium 500. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile and volatile memory. Non-volatile memory may include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory may include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited thereto. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., but are not limited thereto.

[0137] In summary, the present application provides a method, electronic device and storage medium for optimizing the boot time of UEFI firmware, and the method for optimizing the boot time of UEFI firmware includes: obtaining the default loading order of multiple drivers; obtaining the loading relationship file of each driver; determining the loading condition of each driver according to the loading relationship file of each driver; optimizing the default loading order according to the loading condition of each driver to obtain an optimized loading order, so that the optimized loading order meets the loading condition of each driver; generating an executable file of UEFI firmware according to the optimized loading order, and the executable file of UEFI firmware is used to allow UEFI firmware to load each driver in sequence according to the optimized loading order when executed. The present application generates and stores the executable file of UEFI firmware according to the optimized loading order. When the UEFI firmware is running, the UEFI firmware can load each driver in sequence according to the optimized loading order, which can reduce the time of detecting whether the driver meets the loading condition and the time of waiting for the driver to meet the loading condition when the UEFI firmware starts, thereby reducing the boot time of the UEFI firmware.

[0138] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit it. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present application.

Claims

1. A method for optimizing the boot time of UEFI firmware, characterized in that: include: Get the default load order of multiple drivers; Obtaining a loading relationship file of each of the drivers; Determining a loading condition of each of the drivers according to a loading relationship file of each of the drivers; Optimizing the default loading order according to the loading condition of each driver to obtain an optimized loading order, so that the optimized loading order meets the loading condition of each driver; An executable file of the UEFI firmware is generated according to the optimized loading sequence, and the executable file of the UEFI firmware is used to allow the UEFI firmware to load each of the drivers in sequence according to the optimized loading sequence when being executed.

2. The method for optimizing the boot time of UEFI firmware according to claim 1, characterized in that: The method of obtaining the default loading order of multiple drivers includes: Obtaining the FDF file of the UEFI firmware, identifying the FDF file to obtain the default loading order of the multiple drivers; Determining the loading condition of each driver according to the loading relationship file of each driver includes: Determining the loading condition of each driver according to the Depex expression and GUID generation description information in the loading relationship file of each driver; The step of generating an executable file of the UEFI firmware according to the optimized loading sequence includes: The FDF file is compiled according to the optimized loading sequence to obtain an executable file of the UEFI firmware, and the executable file is stored.

3. The method for optimizing the boot time of UEFI firmware according to claim 1, characterized in that: The loading conditions include a plurality of different types, and optimizing the default loading order according to the loading conditions of each driver to obtain an optimized loading order so that the optimized loading order satisfies the loading conditions of each driver includes: The default loading order is optimized in turn according to the loading conditions of each type and the loading conditions of each driver program to obtain a final optimized loading order.

4. The method for optimizing the boot time of UEFI firmware according to claim 3, characterized in that: The optimizing the default loading order in sequence according to the loading condition of each type and the loading condition of each driver comprises: Determine a target driver with the same type of loading condition according to the current type of loading condition; The loading mode is determined based on the loading condition of the current type, and the loading order of all the target drivers is set according to the loading mode, thereby optimizing the default loading order.

5. The method for optimizing the boot time of UEFI firmware according to claim 4, characterized in that: The loading conditions include a Before type, an After type and a GUID type, the loading mode is determined based on the loading conditions of the current type, and the loading order of all the target drivers is set according to the loading mode, thereby optimizing the default loading order once, including: When the current type of loading condition is the Before type, determining the driver corresponding to the target driver according to the loading condition of each target driver, and arranging the loading order of the target driver before the loading order of the corresponding driver; When the current type of loading condition is the After type, determining the driver corresponding to the target driver according to the loading condition of each target driver, and arranging the loading order of the target driver after the loading order of the corresponding driver; When the current type of loading condition is a GUID type, a driver that generates a corresponding GUID is determined according to the loading condition of each target driver, and the loading order of the target driver is arranged after the loading order of the corresponding driver.

6. The method for optimizing the boot time of UEFI firmware according to claim 1, characterized in that: Before optimizing the default loading sequence according to the loading condition of each driver to obtain an optimized loading sequence so that the optimized loading sequence satisfies the loading condition of each driver, the method further includes: Constructing a sequential linked list according to the default loading order of the plurality of drivers; The step of optimizing the default loading sequence according to the loading condition of each driver to obtain an optimized loading sequence, so that the optimized loading sequence satisfies the loading condition of each driver, comprises: The loading order of each driver in the sequential linked list is updated according to the loading condition of each driver, thereby obtaining a sequential linked list representing the optimized loading order.

7. The method for optimizing the boot time of UEFI firmware according to claim 1, characterized in that: The method of obtaining the default loading order of multiple drivers includes: Get the default loading order for multiple drivers when compiling and creating a UEFI firmware volume.

8. A method for optimizing the boot time of UEFI firmware, characterized in that: include: Obtaining an executable file of the UEFI firmware, wherein the executable file includes an optimized loading sequence obtained by optimizing the default loading sequence; When executing the executable file of the UEFI firmware, each driver is loaded in sequence according to the optimized loading order in the executable file.

9. An electronic device, characterized in that: The electronic device comprises: at least one processor; and, a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to execute the method for optimizing the boot time of UEFI firmware as described in any one of claims 1 to 7 or claim 8.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores an executable program, and the executable program is executed by a processor to implement the method for optimizing the boot time of UEFI firmware as described in any one of claims 1 to 7 or claim 8.