Module execution duration determination method, program product and storage medium

By identifying and utilizing the interface of the entry function during the BIOS boot process to obtain the start time of the module, the problem of inaccurate measurement of the execution time of BIOS functional modules is solved, and precise measurement and optimization of BIOS boot time are achieved.

CN121934898APending Publication Date: 2026-04-28ZHEJIANG DAHUA TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
ZHEJIANG DAHUA TECH CO LTD
Filing Date
2025-12-30
Publication Date
2026-04-28

AI Technical Summary

Technical Problem

Existing technologies cannot accurately measure the execution time of functional modules during the BIOS boot process, making it impossible to effectively optimize BIOS boot time.

Method used

By identifying the entry functions of functional modules during the BIOS boot process and using the interfaces in these functions to obtain the time when the module starts up, a one-to-one correspondence between the module and its start time is established, and the execution time of the module is calculated.

Benefits of technology

It enables precise time measurement of each functional module during the BIOS boot process, reducing the probability of human error and improving the optimization efficiency of BIOS boot time.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121934898A_ABST
    Figure CN121934898A_ABST
Patent Text Reader

Abstract

The invention discloses a module execution duration determination method, a program product and a storage medium, and the method comprises the steps: obtaining a first moment when a first function module is started through a first interface in a first entry function under the condition that the first entry function is recognized in the starting process of a BIOS (Basic Input / Output System); under the condition that a second entry function is recognized in the BIOS starting process, a second moment when a second functional module is started is obtained through a second interface in the second entry function, the second entry function is used for calling the second functional module, and the first entry function and the second entry function are recognized in succession; the time for identifying the first entry function is earlier than the time for identifying the second entry function; and determining a difference value between the second moment and the first moment as a first execution duration of the first function module. By means of the method and device, the problem that the module execution duration cannot be determined in the prior art is solved, and the effect of determining the module execution duration is achieved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer technology, and more specifically, to a method for determining the execution time of a module, a program product, and a storage medium. Background Technology

[0002] In the firmware field, especially in the development and maintenance of the Basic Input Output System (BIOS), optimizing BIOS boot time has always been key to improving system boot efficiency. The BIOS boot process consists of four main phases: Security Phase (SEC), Pre-EFIInitialization Phase (PEI), Driver Execution Environment (DXE), and Boot Device Select (BDS). The number of functional modules and boot time vary in each phase. To optimize BIOS boot time, developers need to accurately measure and analyze the execution time of each phase and module in order to optimize or trim functional modules accordingly.

[0003] In most related technologies, the boot time of the BIOS boot process is obtained by manual timing. However, this method has a large error and cannot obtain the execution time of each functional module. Therefore, manual timing cannot meet the needs of optimizing BIOS boot time.

[0004] In summary, the relevant technologies suffer from the problem of being unable to determine the execution time of functional modules. Summary of the Invention

[0005] This application provides a method for determining the execution time of a module, a program product, and a storage medium, to at least solve the technical problem in the related art that the execution time of a module cannot be determined.

[0006] According to one aspect of the embodiments of this application, a method for determining the execution duration of a module is provided, comprising: when a first entry function is identified during the startup process of a Basic Input / Output System (BIOS), obtaining a first moment for starting a first functional module through a first interface in the first entry function, wherein the first entry function is used to call the first functional module; when a second entry function is identified during the BIOS startup process, obtaining a second moment for starting a second functional module through a second interface in the second entry function, wherein the second entry function is used to call the second functional module, the first entry function and the second entry function are identified sequentially, and the time of identification of the first entry function is earlier than the time of identification of the second entry function; and determining the difference between the second moment and the first moment as the first execution duration of the first functional module.

[0007] In an exemplary embodiment, when a first entry function is identified during the BIOS startup process, obtaining the first moment of starting the first functional module through a first interface in the first entry function includes: during the BIOS startup process, calling one or more files in a file set in a preset order, wherein one of the files is used to implement the function corresponding to a functional module in the BIOS startup process; when the first entry function is identified during the calling of the first file, obtaining a moment through the first interface, and determining that the first entry function is a function that calls the first functional module based on the first name of the first functional module included in the first file, wherein the first file is a file included in the file set, and the first file is used to implement the first function corresponding to the first functional module; and determining the moment obtained through the first interface as the first moment.

[0008] In an exemplary embodiment, when a second entry function is identified during the BIOS boot process, obtaining the second moment of starting the second functional module through the second interface of the second entry function includes: when the second entry function is identified during the calling of the second file, obtaining a moment through the second interface, and determining that the second entry function is a function that calls the second functional module based on the second name of the second functional module included in the second file, wherein the first file and the second file are called sequentially, the second file is a file included in the file set and whose calling time is later than that of the first file, and the second file is used to implement the second function corresponding to the second functional module; and determining the moment obtained through the second interface as the second moment.

[0009] In an exemplary embodiment, after calling one or more files from the file set in a preset order during the BIOS startup process, the method further includes: when all one or more of the files have been called, determining a target functional module based on the name of the functional module corresponding to the function implemented by the one or more of the files, wherein the target functional module is all functional modules started in the target stage, and the target stage is any stage in the BIOS startup process; and determining the sum of the execution times of the target functional modules as the startup time of the target stage.

[0010] In an exemplary embodiment, the method further includes: obtaining an initial time, wherein the initial time is the time when the processor completes the unreset state when the BIOS starts booting; obtaining a target time, wherein the target time is the time when the operating system starts booting; and determining the difference between the target time and the initial time as the boot duration of the BIOS.

[0011] In an exemplary embodiment, before calling one or more files in the file set in a preset order during the BIOS startup process, the method further includes: adding an interface to one or more of the files respectively, wherein the interface added to each of the files is used to obtain the startup time of the functional module corresponding to the function implemented by the file during the BIOS startup process.

[0012] In one exemplary embodiment, the method further includes: receiving a first instruction, wherein the first instruction is used to request the display of time information during the BIOS startup process on a target interface, the time information during the BIOS startup process including at least one of the following: the startup duration of the BIOS, the startup duration of the target stage, and the first execution duration; responding to the first instruction, obtaining the time information during the BIOS startup process from a target data structure; and displaying the time information during the BIOS startup process on the target interface according to a preset display rule.

[0013] According to another aspect of the embodiments of this application, a device for determining the execution duration of a module is also provided, comprising: a first acquisition module, configured to acquire, when a first entry function is identified during the boot process of a Basic Input / Output System (BIOS), a first moment for starting a first functional module is obtained through a first interface in the first entry function, wherein the first entry function is used to call the first functional module; a second acquisition module, configured to acquire, when a second entry function is identified during the boot process of the BIOS, a second moment for starting a second functional module is obtained through a second interface in the second entry function, wherein the second entry function is used to call the second functional module, the first entry function and the second entry function are identified sequentially, and the time of identification of the first entry function is earlier than the time of identification of the second entry function; and a first determination module, configured to determine the difference between the second moment and the first moment as the first execution duration of the first functional module.

[0014] According to another aspect of the embodiments of this application, a computer-readable storage medium is also provided, wherein a computer program is stored therein, wherein the computer program is configured to perform the steps in any of the above method embodiments when executed by a processor.

[0015] According to another aspect of the embodiments of this application, a computer program product or computer program is provided, the computer program product or computer program including computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, causing the computer device to perform the steps in any of the method embodiments described above.

[0016] According to another aspect of the embodiments of this application, an electronic device is also provided, including a memory and a processor, wherein the memory stores a computer program, and the processor is configured to perform the steps of any of the above method embodiments through the computer program.

[0017] This application enables the real-time and precise acquisition of the module's startup time (e.g., first moment, second moment, etc.) during the BIOS boot process, based on specific interfaces (such as the first interface, second interface, etc.) embedded in the entry function of each functional module. Furthermore, upon identifying an entry function and acquiring its corresponding moment, a one-to-one correspondence between the functional module and its execution start time can be established. This allows for the direct determination of the execution duration of a specific functional module based on the subsequently identified entry functions. Therefore, this solves the problem of determining the module execution duration in related technologies, achieving the goal of accurately determining the module execution duration. Attached Figure Description

[0018] Figure 1 This is a schematic diagram illustrating an application scenario of a method for determining module execution time according to an embodiment of this application;

[0019] Figure 2 This is a flowchart illustrating an optional method for determining module execution time according to an embodiment of this application;

[0020] Figure 3 This is a flowchart illustrating another optional method for determining module execution time according to an embodiment of this application. Figure 1 ;

[0021] Figure 4 This is a flowchart illustrating another optional method for determining module execution time according to an embodiment of this application. Figure 2 ;

[0022] Figure 5 This is a flowchart illustrating another optional method for determining module execution time according to an embodiment of this application. Figure 3 ;

[0023] Figure 6 This is a schematic diagram illustrating an optional method for displaying time information during the BIOS startup process, according to an embodiment of this application.

[0024] Figure 7 This is a structural block diagram of an optional module execution duration determination device according to an embodiment of this application. Detailed Implementation

[0025] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present application, and not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative effort should fall within the scope of protection of the present application.

[0026] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.

[0027] According to one aspect of the embodiments of this application, a method for determining the execution time of a module is provided. Optionally, in this embodiment, the above-described method for determining the execution time of a module may be applied, but is not limited to, to applications such as... Figure 1 The hardware environment shown includes terminal device 102 and server 104. Server 104 can be connected to terminal device 102 via a network and can be used to provide services (e.g., application services, etc.) to terminal device 102 or clients installed on terminal device 102. A database can be set up on server 104 or independently of server 104 to provide data storage services for server 104.

[0028] The aforementioned network may include, but is not limited to, at least one of the following: wired network and wireless network. The aforementioned wired network may include, but is not limited to, at least one of the following: wide area network (WAN), metropolitan area network (MAN), and local area network (LAN). The aforementioned wireless network may include, but is not limited to, at least one of the following: Wireless Fidelity (WIFI) and Bluetooth. Terminal device 102 may be, but is not limited to, a personal computer (PC), mobile phone, tablet computer, etc. Server 104 may be, but is not limited to, a cloud server, server cluster, or other server types.

[0029] The method for determining the module execution time in this embodiment can be executed by server 104, terminal device 102, or jointly by server 104 and terminal device 102. Alternatively, the method for determining the module execution time in this embodiment can be executed by a client installed on the terminal device 102.

[0030] Taking the method for determining the module execution time in this embodiment, executed by terminal device 102, as an example, Figure 2 This is a flowchart illustrating an optional method for determining module execution time according to an embodiment of this application, as shown below. Figure 2 As shown, the process of this method may include the following steps:

[0031] Step S202: When the first entry function is identified during the BIOS startup process of the basic input / output system, the first moment of starting the first functional module is obtained through the first interface in the first entry function, wherein the first entry function is used to call the first functional module.

[0032] Step S204: If the second entry function is identified during the BIOS boot process, the second moment of starting the second functional module is obtained through the second interface in the second entry function. The second entry function is used to call the second functional module. The first entry function and the second entry function are identified successively, and the time of identification of the first entry function is earlier than the time of identification of the second entry function.

[0033] Optionally, the BIOS is one of the earliest running software programs in a computer system, used to complete hardware initialization, self-test, and booting of the operating system (OS) before it starts. The BIOS boot process mainly includes the following stages:

[0034] SEC: This is the early stage of BIOS startup, mainly used to set the CPU (Central Processing Unit) microcode and some basic hardware initialization.

[0035] PEI: Following SEC, the PEI stage further initializes the hardware platform to prepare for the establishment of the Extensible Firmware Interface (EFI) environment.

[0036] DXE: The DXE stage loads the drivers and completes the initialization of most hardware devices.

[0037] BDS: BDS is responsible for selecting the boot device and booting the OS.

[0038] Optionally, the functional modules are modules that are in multiple stages during the BIOS boot process, typically corresponding to operations such as initializing hardware devices, performing pre-boot checks, and loading drivers. These multiple stages include the SEC, PEI, DXE, and BDS stages.

[0039] Optionally, each functional module in the BIOS has its own entry function. These entry functions are called first when the functional module is loaded and can be used to identify the start of the functional module. For example, EarlyPeiEntry and DxeMain are the entry functions for the PEI and DXE stages in the BIOS.

[0040] Optionally, the first moment is the precise time point at which the first functional module starts up. Specifically, it can be the real-time clock (RTC) time obtained through the first interface integrated in the first entry function. The first interface can be the ReadRtcTime() interface.

[0041] Optionally, the second moment is the precise time point at which the second functional module starts up. Specifically, it can be the RTC time obtained through the second interface integrated in the second entry function, where the second interface can be the ReadRtcTime() interface.

[0042] Optionally, the first functional module and the second functional module are modules that are started sequentially.

[0043] Step S206: The difference between the second time point and the first time point is determined as the first execution duration of the first functional module.

[0044] Through the embodiments provided in this application, during the BIOS boot process, based on specific interfaces (such as a first interface, a second interface, etc.) embedded in the entry function of each functional module, the start time of that module (such as a first moment, a second moment, etc.) can be obtained in real time and accurately. Simultaneously, when an entry function is identified and its corresponding moment is obtained, a one-to-one correspondence between the functional module and its start execution moment can be established, allowing the execution duration of a specific functional module to be directly determined based on the successively identified entry functions. Therefore, the problem of being unable to determine the module execution duration in related technologies can be solved, achieving the effect of determining the module execution duration.

[0045] In an exemplary embodiment, when a first entry function is identified during the BIOS startup process, obtaining the first moment of starting the first functional module through a first interface in the first entry function includes: during the BIOS startup process, calling one or more files in a file set in a preset order, wherein one of the files is used to implement the function corresponding to a functional module in the BIOS startup process; when the first entry function is identified during the calling of the first file, obtaining a moment through the first interface, and determining that the first entry function is a function that calls the first functional module based on the first name of the first functional module included in the first file, wherein the first file is a file included in the file set, and the first file is used to implement the first function corresponding to the first functional module; and determining the moment obtained through the first interface as the first moment.

[0046] In an exemplary embodiment, when a second entry function is identified during the BIOS boot process, obtaining the second moment of starting the second functional module through the second interface of the second entry function includes: when the second entry function is identified during the calling of the second file, obtaining a moment through the second interface, and determining that the second entry function is a function that calls the second functional module based on the second name of the second functional module included in the second file, wherein the first file and the second file are called sequentially, the second file is a file included in the file set and whose calling time is later than that of the first file, and the second file is used to implement the second function corresponding to the second functional module; and determining the moment obtained through the second interface as the second moment.

[0047] Optionally, the entry function is the first function called by the BIOS when the functional module starts executing. The entry function is contained in a file called by the BIOS during the boot process. This file defines the name of the functional module, the entry point, and other configuration information. Specifically, this file can be a firmware module description file (Include File for Names, or INF file for short), and the file collection is a collection of INF files.

[0048] Optionally, the default order is a fixed sequence of modules or functions called by the BIOS during the boot process. This sequence is defined during the BIOS build phase and is usually controlled by configuration information in the INF file. The default order ensures the orderly progress of the BIOS boot process, avoids dependency conflicts between modules, and also helps optimize system boot efficiency.

[0049] Optionally, the first name is the name of the first functional module called during the BIOS startup process, and the second name is the name of the second functional module called during the BIOS startup process.

[0050] Optionally, the first file mentioned above is a file included in the file set, and the first file is used to implement the first function corresponding to the first functional module. The first file may be the first file called in the file set, and the corresponding first functional module is the first functional module called in the first stage of the BIOS boot process; the first file may be the second file called in the file set, and the corresponding first functional module may be the second functional module called in the first stage of the BIOS boot process.

[0051] Optionally, the second file is a file included in the file set, and the second file is used to implement the second function corresponding to the second functional module. If the first file is the first file called in the file set, and the corresponding first functional module is the first functional module called in the first stage of the BIOS boot process, then the second file can be the second file called in the file set, and the corresponding second functional module can be the second functional module called in the first stage of the BIOS boot process. If the first file is the second file called in the file set, and the corresponding first functional module can be the second functional module called in the first stage of the BIOS boot process, then the second file can be the third file called in the file set, and the corresponding second functional module can be the third functional module called in the first stage of the BIOS boot process.

[0052] Related technologies often only obtain the overall time of the BIOS boot process, but cannot break it down to the execution time of each functional module. This embodiment, by identifying the entry function (e.g., first entry function, second entry function) in the files called during the BIOS boot process (e.g., first file, second file), achieves accurate recording of the current moment through the interfaces (e.g., first entry, second entry) in the entry function. Simultaneously, by directly binding the currently obtained moment with the name of the functional module, it ensures the accurate correspondence between the obtained moment and the functional module, enabling the BIOS to automatically record the boot time of each functional module during the boot process without manual intervention, thus reducing the probability of human error.

[0053] In an exemplary embodiment, after calling one or more files from the file set in a preset order during the BIOS startup process, the method further includes: when all one or more of the files have been called, determining a target functional module based on the name of the functional module corresponding to the function implemented by the one or more of the files, wherein the target functional module is all functional modules started in the target stage, and the target stage is any stage in the BIOS startup process; and determining the sum of the execution times of the target functional modules as the startup time of the target stage.

[0054] Optionally, the target functional modules are all functional modules started within a certain stage of the BIOS boot process. The target stage can be any stage in the BIOS boot process, such as DXE, PEI, etc. Once all functional modules within a target stage of the BIOS boot process have been called, and their respective boot times have been accurately recorded through the time acquisition interface (such as ReadRtcTime()) in the entry function, the execution times of these functional modules are added together to obtain the total boot time of the target stage. For example, in the DXE stage, if UsbControllerInit takes 200 milliseconds, MemoryInit takes 500 milliseconds, and VideoInit takes 300 milliseconds, then the total boot time of the DXE stage is 1000 milliseconds.

[0055] In an exemplary embodiment, the method further includes: obtaining an initial time, wherein the initial time is the time when the processor completes the unreset state when the BIOS starts booting; obtaining a target time, wherein the target time is the time when the operating system starts booting; and determining the difference between the target time and the initial time as the boot duration of the BIOS.

[0056] Optionally, the CPU exits the reset state when the device is powered on, the BIOS begins running, and the processor recovers from its initial reset state and begins executing instructions. The reset state is a low-power, low-activity state of the processor. When the system boots, the CPU is awakened from this state and begins running the BIOS code. The initial moment is the starting point for measuring BIOS boot time, which can be obtained by calling ReadRtcTime() (or other similar functions that read the real-time clock RTC).

[0057] Optionally, the start of the operating system boot process occurs near the end of the BIOS boot process, just before entering the OS. The target time is the end point of the BIOS boot process, which typically occurs when the BIOS executes JumpToOs() or other similar functions, and can be obtained by calling ReadRtcTime() (or other similar functions that read the real-time clock RTC).

[0058] In an exemplary embodiment, before calling one or more files in the file set in a preset order during the BIOS startup process, the method further includes: adding an interface to one or more of the files respectively, wherein the interface added to each of the files is used to obtain the startup time of the functional module corresponding to the function implemented by the file during the BIOS startup process.

[0059] Optionally, interfaces are added to one or more of the aforementioned files, including adding interfaces to the entry functions of one or more of the aforementioned files, wherein the interface added to each of the aforementioned entry functions is used to obtain the startup time of the functional module corresponding to the function implemented by the aforementioned files during the BIOS startup process.

[0060] In one exemplary embodiment, the method further includes: receiving a first instruction, wherein the first instruction is used to request the display of time information during the BIOS startup process on a target interface, the time information during the BIOS startup process including at least one of the following: the startup duration of the BIOS, the startup duration of the target stage, and the first execution duration; responding to the first instruction, obtaining the time information during the BIOS startup process from a target data structure; and displaying the time information during the BIOS startup process on the target interface according to a preset display rule.

[0061] Optionally, the first command is a request issued by the user or system administrator to the BIOS system via command line, graphical interface, or other input methods, requesting the display of time information during the BIOS boot process. Specifically, this can be executed through a specific command-line interface in the shell environment after system startup, such as entering the command `show_bios_time_info` to request the display of time information during the BIOS boot process.

[0062] Optionally, the target interface is an interface that receives and displays BIOS boot time information, which can be a shell command-line interface, a system log interface, or an interface displayed remotely via a network connection.

[0063] Optionally, the target data structure is a structured data container in the BIOS used to store and manage boot process timing information. For example, it could be an array, linked list, or dictionary, where each data item records information such as the name of a functional module, its boot time, and execution duration. Specifically, the information for each functional module recorded in the target data structure is entered after the boot time of the functional module is obtained and its execution duration is determined.

[0064] The data copying method in the embodiments of this application will be explained below with reference to optional examples.

[0065] Figure 3 This is a flowchart illustrating another optional method for determining module execution time according to an embodiment of this application. Figure 1 The process for determining the execution time of this module may include the following steps:

[0066] Step S301, Begin.

[0067] Step S302: The device is powered on and the BIOS starts running.

[0068] Step S303: CPU is de-reset, and timing begins at this time to obtain RTC time N1.

[0069] Step S304: Function module A is invoked to obtain RTC time N2.

[0070] Step S305: Functional modules are called sequentially according to the code architecture. Each time a functional module is called, the corresponding RTC time is obtained and recorded as N3, N4, N5, ..., Nn-1. Specifically, the BIOS calls multiple INF files during the boot process. The Entry function is determined by the "ENTRY_POINT" in the INF file. Each INF file represents a functional module, and Entry functions include, but are not limited to, EarlyPeiEntry, InitUsbController, DxeMain, SystemPasswordInit, and BdsInitialize. An interface for obtaining the RTC time is added to each Entry function. The RTC time is obtained immediately upon each called Entry function; then, the functional module name and RTC time of the Entry function to which the time is obtained are recorded.

[0071] Each time a new functional module name and RTC time are recorded, the time difference between the new RTC time and the previous RTC time is calculated, and this time difference is matched with the new functional module name to obtain the execution time of the functional module. For example, (N3-N2) is the execution time of functional module A.

[0072] Write all the recorded one-to-one correspondences of module names and RTC time differences into a fixed data structure.

[0073] After all Entry entry functions are recorded, the execution times of all modules in the SEC, PEI, DXE, and BDS stages are summed to obtain the startup time of the four stages. The stage names and startup times of the four stages are then matched one by one and written into the data structure mentioned above.

[0074] Step S306, at the end of the BIOS boot process, about to enter the OS, obtain the RTC time Nn.

[0075] The time difference between RTC time N1 and RTC time Nn is calculated to obtain the total boot time of the BIOS boot process. The custom flag name of the total boot time, such as the total boot time of BIOS, and the total boot time value are written into the data structure mentioned above.

[0076] Step S307: Enter OS, BIOS boot process ends.

[0077] Figure 4 This is a flowchart illustrating another optional method for determining module execution time according to an embodiment of this application. Figure 2 The process of adding an interface may include the following steps:

[0078] Step S401, Begin.

[0079] Step S402: Locate the shell script call location in the source code and modify the shell script in the source code.

[0080] Step S403: Add a command-line interface for obtaining BIOS boot time.

[0081] Step S404: After upgrading the compiled BIOS program, enter the specified command line in the shell to obtain the time information during the BIOS boot process.

[0082] Figure 5 This is a flowchart illustrating another optional method for determining module execution time according to an embodiment of this application. Figure 3 The process of displaying time information during the BIOS boot process may include the following steps:

[0083] Step S501, Begin.

[0084] Step S502: The BIOS boot process ends, and the user enters the shell.

[0085] Step S503: Enter the specified command line in the shell to retrieve time information.

[0086] Step S504: Time information is displayed on the shell page. First, the total boot time of the BIOS boot process is printed, then the boot time of the four stages SEC, PEI, DXE, and BDS is printed, and finally the execution time of each module is printed in sequence. The format for displaying time information during the BIOS boot process is as follows: Figure 6 As shown.

[0087] Step S505: Determine whether the time information has been extracted. If yes, proceed to step S506; otherwise, proceed to step S507.

[0088] Step S506: Store the time information in a specific storage device, such as a USB flash drive or hard drive.

[0089] Step S507, End.

[0090] It should be noted that, for the sake of simplicity, the foregoing method embodiments are all described as a series of actions. However, those skilled in the art should understand that this application is not limited to the described order of actions, as some steps may be performed in other orders or simultaneously according to this application. Furthermore, those skilled in the art should also understand that the embodiments described in the specification are preferred embodiments, and the actions and modules involved are not necessarily essential to this application.

[0091] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods according to 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 prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as read-only memory (ROM) / random access memory (RAM), magnetic disk, optical disk), and includes several instructions to cause a terminal device (which may be a mobile phone, computer, server, or network device, etc.) to execute the methods described in the various embodiments of this application.

[0092] According to another aspect of the embodiments of this application, a module execution time determination apparatus is also provided. This module execution time determination apparatus can be used to implement the module execution time determination method provided in the above embodiments, and will not be repeated hereafter. As used below, the term "module" can be a combination of software and / or hardware that implements a predetermined function. Although the apparatus described in the following embodiments is preferably implemented in software, hardware implementation, or a combination of software and hardware, is also possible and contemplated.

[0093] Figure 7 This is a structural block diagram of an optional module execution time determination device according to an embodiment of this application, such as... Figure 7 As shown, the device includes:

[0094] The first acquisition module 702 is used to acquire the first moment of starting the first functional module through the first interface in the first entry function when the first entry function is identified during the BIOS startup process of the basic input / output system. The first entry function is used to call the first functional module.

[0095] The second acquisition module 704 is used to acquire the second moment of starting the second functional module through the second interface in the second entry function when the second entry function is identified during the BIOS startup process. The second entry function is used to call the second functional module. The first entry function and the second entry function are identified successively, and the time of identification of the first entry function is earlier than the time of identification of the second entry function.

[0096] The first determining module 706 is used to determine the difference between the second time and the first time as the first execution duration of the first functional module.

[0097] It should be noted that the first acquisition module 702 in this embodiment can be used to execute the above step S202, the second acquisition module 704 in this embodiment can be used to execute the above step S204, and the first determination module 706 in this embodiment can be used to execute the above step S206.

[0098] In an exemplary embodiment, the first acquisition module 702 includes: a first invocation submodule, configured to invoke one or more files in a file set in a preset order during the BIOS startup process, wherein one of the files is used to implement the function corresponding to a functional module in the BIOS startup process; a first identification submodule, configured to, when the first entry function is identified during the invocation of the first file, acquire a moment through the first interface, and determine that the first entry function is a function that calls the first functional module based on the first name of the first functional module included in the first file, wherein the first file is a file included in the file set, and the first file is used to implement the first function corresponding to the first functional module; and a first determination submodule, configured to determine the moment acquired through the first interface as the first moment.

[0099] In an exemplary embodiment, the second acquisition module 704 includes: a second identification submodule, configured to, when the second entry function is identified during the calling of the second file, acquire a moment through the second interface, and determine that the second entry function is a function that calls the second functional module based on the second name of the second functional module included in the second file, wherein the first file and the second file are called sequentially, the second file is a file included in the file set and whose calling time is later than that of the first file, and the second file is used to implement the second function corresponding to the second functional module; and a second determination submodule, configured to determine the moment acquired through the second interface as the second moment.

[0100] In an exemplary embodiment, the first acquisition module 702 further includes: a third determining submodule, configured to, after calling one or more files in a file set in a preset order during the BIOS startup process, determine a target functional module based on the name of the functional module corresponding to the function implemented by the one or more files, wherein the target functional module is all functional modules started in the target stage, and the target stage is any stage in the BIOS startup process; and a fourth determining submodule, configured to determine the sum of the execution times of the target functional modules as the startup time of the target stage.

[0101] In an exemplary embodiment, the apparatus further includes: a first acquisition module, configured to acquire an initial time, wherein the initial time is the time when the processor completes the unreset state when the BIOS starts booting; a second acquisition module, configured to acquire a target time, wherein the target time is the time when the operating system starts booting; and to determine the difference between the target time and the initial time as the boot duration of the BIOS.

[0102] In an exemplary embodiment, the first acquisition module 702 further includes a first addition submodule, configured to add an interface to one or more of the files in the file set before calling one or more files in the file set in a preset order during the BIOS startup process, wherein the interface added to each of the files is used to obtain the startup time of the functional module corresponding to the function implemented by the file during the BIOS startup process.

[0103] In one exemplary embodiment, the apparatus further includes: a first receiving submodule, configured to receive a first instruction, wherein the first instruction is configured to request the display of time information during the BIOS startup process on a target interface, the time information during the BIOS startup process including at least one of the following: the startup duration of the BIOS, the startup duration of the target stage, and the first execution duration; a first response submodule, configured to respond to the first instruction and obtain the time information during the BIOS startup process from a target data structure; and a first display submodule, configured to display the time information during the BIOS startup process on the target interface according to a preset display rule.

[0104] It should be noted that the above modules can be implemented by software or hardware. For the latter, they can be implemented in the following ways, but are not limited to: all the above modules are located in the same processor; or, the above modules are located in different processors in any combination.

[0105] According to another aspect of the embodiments of this application, a computer-readable storage medium is provided, the computer-readable storage medium including a stored program, wherein the program executes the steps in any of the above method embodiments when it is run.

[0106] In one exemplary embodiment, the aforementioned computer-readable storage medium may include, but is not limited to, various media capable of storing computer programs, such as USB flash drives, ROMs, RAMs, portable hard drives, magnetic disks, or optical disks.

[0107] According to another aspect of the embodiments of this application, an electronic device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor. The processor is configured to perform the steps of any of the method embodiments described above via the computer program. In an exemplary embodiment, the electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the processor, and the input / output device is connected to the processor.

[0108] Specific examples in this embodiment can be found in the examples described in the above embodiments and exemplary implementations, and will not be repeated here.

[0109] According to another aspect of the embodiments of this application, a computer program product is also provided, the computer program product including a computer program / instructions containing program code for performing the method shown in the flowchart.

[0110] Obviously, those skilled in the art should understand that the modules or steps of this application described above can be implemented using general-purpose computing devices. They can be centralized on a single computing device or distributed across a network of multiple computing devices. They can be implemented using computer-executable program code, and thus can be stored in a storage device for execution by a computing device. In some cases, the steps shown or described can be performed in a different order than those described herein, or they can be fabricated as separate integrated circuit modules, or multiple modules or steps can be fabricated as a single integrated circuit module. Thus, this application is not limited to any particular combination of hardware and software.

[0111] The above are merely preferred embodiments of this application and are not intended to limit this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the principles of this application should be included within the protection scope of this application.

Claims

1. A method for determining the execution time of a module, characterized in that, include: When the first entry function is identified during the BIOS startup process of the basic input / output system, the first moment of starting the first functional module is obtained through the first interface in the first entry function, wherein the first entry function is used to call the first functional module; When a second entry function is identified during the BIOS boot process, the second moment of starting the second functional module is obtained through the second interface in the second entry function. The second entry function is used to call the second functional module. The first entry function and the second entry function are identified successively, and the time of identification of the first entry function is earlier than the time of identification of the second entry function. The difference between the second time point and the first time point is determined as the first execution duration of the first functional module.

2. The method according to claim 1, characterized in that, When the first entry function is identified during the BIOS boot process of the basic input / output system, the first moment of starting the first functional module is obtained through the first interface in the first entry function, including: During the BIOS startup process, one or more files from a file set are called in a preset order, wherein one of the files is used to implement the function corresponding to a functional module in the BIOS startup process; If the first entry function is identified during the process of calling the first file, a moment is obtained through the first interface, and the first entry function is determined to be a function that calls the first functional module based on the first name of the first functional module included in the first file. The first file is a file included in the file set, and the first file is used to implement the first function corresponding to the first functional module. The time obtained through the first interface is determined as the first time.

3. The method according to claim 2, characterized in that, If a second entry function is identified during the BIOS boot process, the second moment of booting the second functional module is obtained through the second interface in the second entry function, including: When the second entry function is identified during the calling of the second file, a moment is obtained through the second interface, and the second entry function is determined to be the function that calls the second functional module based on the second name of the second functional module included in the second file. The first file and the second file are called successively, and the second file is a file included in the file set whose calling time is later than that of the first file. The second file is used to implement the second function corresponding to the second functional module. The time obtained through the second interface is determined as the second time.

4. The method according to claim 2, characterized in that, After calling one or more files from a file set in a preset order during the BIOS boot process, the method further includes: When one or more of the files have been called successfully, the target functional module is determined based on the name of the functional module corresponding to the function implemented by the one or more files. The target functional module is all functional modules started in the target stage, and the target stage is any stage in the BIOS boot process. The sum of the execution times of the target functional modules is determined as the start time of the target stage.

5. The method according to claim 1, characterized in that, The method further includes: Obtain the initial time, wherein the initial time is the time when the processor completes the release from the reset state when the BIOS starts up; Obtain the target time, wherein the target time is the time when the operating system starts up; The difference between the target time and the initial time is determined as the BIOS startup time.

6. The method according to claim 3, characterized in that, Before calling one or more files from a file set in a preset order during the BIOS boot process, the method further includes: An interface is added to one or more of the files, wherein the interface added to each file is used to obtain the startup time of the functional module corresponding to the function implemented by the file during the BIOS startup process.

7. The method according to any one of claims 1 to 6, characterized in that, The method further includes: Receive a first instruction, wherein the first instruction is used to request the display of time information during the BIOS startup process on a target interface, the time information during the BIOS startup process including at least one of the following: the startup duration of the BIOS, the startup duration of the target stage, and the first execution duration; In response to the first instruction, the timing information of the BIOS boot process is obtained from the target data structure; According to preset display rules, the time information during the BIOS startup process is displayed on the target interface.

8. A device for determining the execution time of a module, characterized in that, include: The first acquisition module is used to acquire the first moment of starting the first functional module through the first interface in the first entry function when the first entry function is identified during the BIOS startup process of the basic input / output system. The first entry function is used to call the first functional module. The second acquisition module is used to acquire the second moment of starting the second functional module through the second interface in the second entry function when the second entry function is identified during the BIOS startup process. The second entry function is used to call the second functional module. The first entry function and the second entry function are identified successively, and the time of identification of the first entry function is earlier than the time of identification of the second entry function. The first determining module is used to determine the difference between the second time and the first time as the first execution duration of the first functional module.

9. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program, wherein the computer program, when executed by a processor, implements the steps of the method according to any one of claims 1 to 7.