Package option default value configuration method and electronic device
By integrating all default configuration items into a single BIOS file and dynamically updating parameters, the memory usage problem caused by the increase in the number of packages was solved, and the configuration process was simplified and costs were reduced.
Patent Information
- Application Number
- CN202511216758.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-28
- Publication Date
- 2025-11-21
- Estimated Expiration
- 2045-08-28
AI Technical Summary
As the number of packages increases, BIOS memory usage increases, leading to higher project costs and increased complexity in configuration management.
All default configuration items are integrated into a single BIOS file. The parameters of the original default configuration package are modified by obtaining the selected configuration package, avoiding the need to develop multiple BIOS file versions for different packages. The configuration parameters are dynamically updated by using firmware variable read and set functions.
It simplifies the BIOS option default configuration process, reduces memory resource usage, lowers project costs, and improves user experience.
Smart Images

Figure CN120723320B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of computers, and in particular to a package option default value configuration method and electronic device. BACKGROUND
[0002] At present, in order to realize different default parameter configurations in a Basic Input Output System (BIOS for short) system and reduce development cost and maintenance difficulty, a plurality of package option default values are usually integrated in a single BIOS file, and a user can quickly switch to a corresponding default configuration according to own demand or use scenario, thereby simplifying a BIOS configuration process.
[0003] However, with an increase in the number of packages, memory occupied by the packages in the BIOS also increases, thereby increasing project cost. SUMMARY
[0004] The present application provides a package option default value configuration method and electronic device, to at least solve the problem of increasing BIOS memory occupation due to an increase in the number of packages in the related art.
[0005] The present application provides a package option default value configuration method, comprising: obtaining a selected configuration package; the selected configuration package refers to a set of predefined default configuration packages of a basic input output system; the selected configuration package corresponds to a plurality of specified configuration items; a specified configuration item in the plurality of specified configuration items comprises a specified configuration item name and a specified configuration parameter; and according to the plurality of specified configuration items, modifying default configuration parameters corresponding to an original default configuration package of the basic input output system stored in a basic input output system file; the basic input output system file stores a plurality of default configuration items corresponding to the basic input output system under the original default configuration package.
[0006] The present application also provides a package option default value configuration device, comprising: a first execution unit configured to obtain a selected configuration package; the selected configuration package refers to a set of predefined default configuration packages of a basic input output system; the selected configuration package corresponds to a plurality of specified configuration items; a specified configuration item in the plurality of specified configuration items comprises a specified configuration item name and a specified configuration parameter; and a second execution unit configured to modify, according to the plurality of specified configuration items, default configuration parameters corresponding to an original default configuration package of the basic input output system stored in a basic input output system file; the basic input output system file stores a plurality of default configuration items corresponding to the basic input output system under the original default configuration package.
[0007] The application further provides an electronic device, comprising a memory for storing a computer program, and a processor for executing the computer program to implement the steps of any of the methods.
[0008] The application further provides a computer readable storage medium, which stores a computer program, wherein the computer program is executed by a processor to implement the steps of any of the methods.
[0009] The application further provides a computer program product, which comprises a computer program, and the computer program is executed by a processor to implement the steps of any of the methods.
[0010] According to the application, one set of all default configuration items is integrated in a single BIOS file, that is, the default configuration parameters of all default configuration items are stored in the single BIOS file. When the default configuration package is replaced, the selected configuration package is obtained, and only the default configuration parameters corresponding to the original default configuration package of the basic input output system stored in the basic input output system file are modified according to the selected configuration package. Multiple BIOS file versions do not need to be developed for different default configuration packages, and all default configuration items corresponding to multiple default configuration packages do not need to be stored in one BIOS file. The same BIOS file can support different model package default value options, the BIOS option default value configuration process is simplified, user experience is improved, memory resources occupied by the default configuration package are reduced, and the problem of increasing BIOS memory occupation due to the increase in the number of packages in the related art is solved. BRIEF DESCRIPTION OF DRAWINGS
[0011] In order to more clearly illustrate the embodiments of the application, the drawings needed in the embodiments will be briefly introduced. Obviously, the drawings in the following description are only some embodiments of the application, and other drawings can be obtained by those skilled in the art without creative labor.
[0012] Figure 1 FIG. 1 is a schematic diagram of an application scenario of a package option default value configuration method according to an embodiment of the application.
[0013] Figure 2 FIG. 2 is a schematic diagram of a flow of an optional package option default value configuration method according to an embodiment of the application.
[0014] Figure 3 FIG. 3 is a schematic diagram of a flow of another optional package option default value configuration method according to an embodiment of the application.
[0015] Figure 4 FIG. 4 is a schematic diagram of an NVAR data structure of an optional package option default value configuration method according to an embodiment of the application.
[0016] Figure 5 is a structural block diagram of an optional package option default value configuration device according to an embodiment of the present application. DETAILED DESCRIPTION
[0017] The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all the embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by a person of ordinary skill in the art without creative work fall within the protection scope of the present application.
[0018] It should be noted that, in the description of the present application, the terms “comprise”, “contain” or any other variants thereof are intended to cover non-exclusive inclusion, so that the process, method, article or device comprising a series of elements not only includes those elements, but also includes other elements not explicitly listed or inherent to such process, method, article or device. The terms “first”, “second” and the like in the present application are used to distinguish similar objects, and are not used to describe a specific order or sequence.
[0019] In order for those skilled in the art to better understand the technical solutions of the present application, the present application will be further described in detail below with reference to the drawings and specific embodiments.
[0020] According to an aspect of an embodiment of the present application, a package option default value configuration method is provided. Optionally, in the present embodiment, the above-mentioned package option default value configuration method can be but is not limited to applied in a hardware environment as shown in the figure comprising a terminal device 102 and a server 104. The server 104 can be connected with the terminal device 102 through a network, and can be used to provide services (for example, application services, etc.) for the terminal device 102 or a client installed on the terminal device 102, and a database can be set on the server 104 or independently of the server 104, used to provide data storage services for the server 104. Figure 1 The above-mentioned network can include but is not limited to at least one of the following: a wired network, a wireless network. The above-mentioned wired network can include but is not limited to at least one of the following: a wide area network, a metropolitan area network, a local area network, and the above-mentioned wireless network can include but is not limited to at least one of the following: Wireless Fidelity (WIFI), Bluetooth. The terminal device 102 can be but is not limited to a personal computer (PC), a mobile phone, a tablet computer, etc. The server 104 can be but is not limited to a cloud server, a server cluster or other server types.
[0021]
[0022] The package option default value configuration method of the embodiments of the present application can be executed by the server 104, or by the terminal device 102, or by the server 104 and the terminal device 102 jointly. The terminal device 102 executing the package option default value configuration method of the embodiments of the present application can also be executed by a client installed thereon.
[0023] Taking the server 104 executing the package option default value configuration method in the embodiments as an example, Figure 2 is a flow diagram of an optional package option default value configuration method according to the embodiments of the present application, as shown in the figure, the flow of the method can include the following steps S202 to S204. Figure 2
[0024] Step S202, a selected configuration package is obtained; the selected configuration package refers to a set of predefined default configuration packages of the basic input and output system; the selected configuration package corresponds to a plurality of specified configuration items; the specified configuration item in the plurality of specified configuration items includes a specified configuration item name and a specified configuration parameter.
[0025] Step S204, according to the plurality of specified configuration items, the original default configuration parameters corresponding to the original default configuration package of the basic input and output system stored in the basic input and output system file are modified; the basic input and output system file stores a plurality of default configuration items corresponding to the basic input and output system under the original default configuration package.
[0026] The package option default value configuration method in the embodiments of the present application can be applied to the field of computer technology, and applied to the scene of configuring the BIOS option default value of the basic input and output system. The BIOS system is a kind of firmware, integrated on the motherboard of the computer, responsible for performing initialization and self-checking process in the startup process, and providing basic services before running for the operating system, BIOS is one of the earliest running software when starting a personal computer. BIOS option default value is a set of configuration values preset by the manufacturer, aiming to provide a safe and compatible system startup environment for most users, BIOS option default value may vary due to motherboard model, manufacturer and BIOS version. In order to realize different business requirements, it is necessary to modify the BIOS option default value.
[0027] In the existing computer BIOS system, the BIOS file usually only contains a set of fixed default configuration parameters. This single default value setting method has many limitations: on the one hand, for different types of user groups, such as ordinary office users, game players, professional designers, etc., their needs for computer hardware performance, function enablement, etc. are quite different, and fixed default values cannot meet the optimal use experience of all types of users; on the other hand, for the same user in different use scenarios, such as daily office scenarios and large software running scenarios, different BIOS default configurations are also needed to optimize computer performance and resource allocation; in addition, for Internet cloud computing centers, in order to adapt to different business scenarios, many different models of machines are customized, and the default configurations of each model are not the same.
[0028] Currently, in order to realize different default configurations, different versions of BIOS files need to be developed for different default configuration packages, and each BIOS file stores all default configuration items under a configuration package, which not only increases development cost and maintenance difficulty, but also may lead to BIOS file management confusion, and also brings inconvenience to users. Machine operation and maintenance need to manually adjust a large number of parameters in the BIOS setting interface according to their own needs, which is complex and prone to misoperation. Therefore, there is an urgent need for a solution to solve the above problems, and a same BIOS file can support the needs of different model package default value options.
[0029] In view of the above-mentioned needs, the current effective solution (i.e. in the related art) is to integrate multiple package option default values in a single BIOS file, that is, multiple default configuration packages are stored in a single BIOS file, and each default configuration package contains all default configuration items of the BIOS system. Users can quickly switch to the corresponding default configuration according to their own needs or use scenarios, thereby simplifying the BIOS configuration process. However, this solution has certain drawbacks. With the increase in the number of packages, the number of StdDefault variables (used to store all default configuration items of the corresponding BIOS system in a default configuration package) that save default configuration items of default configuration parameters will also increase, which results in the size of the Non-Volatile Random Access Memory (NVRAM) firmware volume in the entire BIOS Serial Peripheral Interface Read-Only Memory (SPI ROM) increasing, and even a larger SPI ROM is needed to support, thereby increasing the project cost.
[0030] To at least partially solve the above technical problems, in the embodiment, all the default configuration items in a BIOS system are integrated in a single BIOS file, i.e., the single BIOS file stores the default configuration parameters of all the default configuration items in the BIOS system. When the default configuration package is replaced, only the default configuration parameters corresponding to the original default configuration package stored in the BIOS system need to be modified, and there is no need to develop multiple BIOS file versions for different requirements, and there is no need to set multiple default configuration packages in a BIOS file, thereby avoiding configuring a separate StdDefault variable for each type of package in a BIOS file and reducing the memory occupied by the basic input / output system.
[0031] The default configuration package refers to a set of configuration parameters preset by the BIOS before being adjusted by a user or a management tool. The default configuration package includes all the default configuration items of the BIOS system. The default configuration item refers to a series of hardware and system setting items enabled by default during firmware initialization. Optionally, the default configuration item includes configuration items of various hardware functions and system services such as processor frequency, memory speed, startup sequence, and security settings. The default configuration item includes a default configuration item name and a default configuration parameter. The default configuration item name is used to uniquely identify the default configuration item, and the default configuration parameter refers to the default value of the BIOS option.
[0032] The selected configuration package can refer to a set of predefined default configuration packages of the basic input / output system. The selected configuration package corresponds to multiple specified configuration items of the BIOS system. It can be understood that the multiple specified configuration items can be all the default configuration items of the BIOS system. The original default configuration package refers to the preset configuration set in the BIOS without being changed by a user. Optionally, the original default configuration package can be a set of default configuration parameters without being modified by any user or management operation, or can be a historically used default configuration package. The original default configuration package includes all the default configuration items of the BIOS system. The selected configuration package and the original default configuration package are two different default configuration packages. The selected configuration package is consistent with the type and quantity of the default configuration items included in the default configuration package, i.e., each specified configuration item in the selected configuration package can find a matching default configuration item in the original default configuration package. The default configuration parameter of the specified configuration item and the matching default configuration item in the original default configuration package can be different or the same, which is determined according to the specific default configuration package.
[0033] Optionally, each of the plurality of specified configuration items is a specified BIOS configuration item included under the selected configuration package; the specified configuration item in the plurality of specified configuration items includes a specified configuration item name and a specified configuration parameter, the specified configuration item name is a unique name for identifying the specified configuration item, and optionally, the specified configuration item name can be represented in text form, and each specified configuration item can have a name. The specified configuration parameter can be a specific numerical value set for the specified configuration item. Optionally, the plurality of specified configuration items can be recorded in the form of a package configuration table.
[0034] Optionally, one default configuration package corresponds to one package configuration table, and the package configuration table includes all default configuration items in the BIOS system, and each default configuration item has a default configuration item name and a default configuration parameter.
[0035] Optionally, at system startup, the current hardware configuration and environmental conditions (such as processor type, memory capacity, heat dissipation system state, etc.) are automatically identified through a built-in detection mechanism, and the most suitable selected configuration package is obtained based on these information.
[0036] Through the embodiments of the present application, all default configuration items are integrated in a single BIOS file, that is, the single BIOS file stores the default configuration parameters of all default configuration items. When the default configuration package is replaced, the selected configuration package is obtained, and only the default configuration parameters corresponding to the original default configuration package of the basic input output system stored in the basic input output system file need to be modified according to the selected configuration package. Multiple BIOS file versions do not need to be developed for different default configuration packages, and all default configuration items corresponding to multiple default configuration packages do not need to be stored in a BIOS file. The same BIOS file can support different model package default value options, simplifying the BIOS option default value configuration process, improving user experience, reducing the memory resources occupied by the default configuration package, and solving the problem of increasing BIOS memory occupation due to the increase in the number of packages in the related art.
[0037] In an example embodiment, a default configuration parameter set variable is stored in a basic input output system file, wherein one basic input output system file corresponds to one default configuration parameter set variable; the default configuration parameter set variable is used to store multiple default configuration items of the basic input output system. That is, one default configuration parameter set variable stores all default configuration items of the basic input output system, and the default configuration parameter set variable refers to a set variable defined in the basic input output system file in advance and containing all default configuration items of the basic input output system. In this way, corresponding one basic input output system file to one default configuration parameter set variable can effectively reduce the space occupied by the default configuration parameter set variable in the basic input output system file. Optionally, the default configuration parameter set variable can be a StdDefault variable, and the StdDefault variable stores all default configuration items of the basic input output system. The StdDefault is a preset configuration parameter set stored in the NVRAM (Non-Volatile Random Access Memory), contains the default value when the BIOS is shipped or the standard configuration defined by the manufacturer, is a special variable for storing standard default configuration parameters, and mainly functions to restore the initial state of the firmware when the system configuration is abnormal, or when the user manually modifies the BIOS parameters to cause the system to be unstable (such as frequency failure or startup sequence disorder), the StdDefault variable is called to overwrite the current configuration through the "load default setting" function. The NVRAM (Non-Volatile Random Access Memory) is a memory that can retain data after power off, supports read and write operations, and is used to store key parameters of system startup and hardware configuration. Optionally, the default configuration parameter set variable (StdDefault variable) is stored in the NVRAM, so that the default configuration parameter set variable can be retained even after power off.
[0038] In some embodiments, the default configuration parameters of the multiple target default configuration items stored in the basic input output system file are modified according to the multiple specified configuration items, including:
[0039] The default configuration parameter set variable is obtained through a firmware variable reading function, the default configuration parameter set variable is traversed, the target positions of the multiple target default configuration items in the default configuration parameter set variable that match the specified configuration item names of the multiple specified configuration items are determined, and the default configuration parameters of the multiple target default configuration items in the default configuration parameter set variable are modified according to the target positions of the multiple target default configuration items through a firmware variable setting function.
[0040] Here, the firmware variable reading function is a function for obtaining the default configuration parameter set variable, and optionally, the firmware variable reading function is GetVariable, which is a function provided by the Unified Extensible Firmware Interface (UEFI) for reading UEFI variables. GetVariable is like a key that can extract the stored data for system use. When the system needs to read the current default configuration item of a default configuration parameter set variable, the GetVariable function is called, and by passing the name of the default configuration item, GetVariable can return the related data and attributes of the default configuration item. In this embodiment, the system obtains the default configuration parameter set variable through the firmware variable reading function, traverses the default configuration parameter set variable, and then determines the target positions of the multiple target default configuration items in the default configuration parameter set variable that match the specified configuration item names of the multiple specified configuration items.
[0041] The target positions of the multiple target default configuration items refer to the specific storage positions of the multiple target default configuration items in the default configuration parameter set variable. The target positions of the multiple target default configuration items are used to locate the specific positions of the target default configuration items in the default configuration parameter set variable, so as to modify the default configuration parameters of the multiple target default configuration items in the default configuration parameter set variable through the firmware variable setting function.
[0042] After determining the target positions of the multiple target default configuration items in the default configuration parameter set variable that match the specified configuration item names of the multiple specified configuration items, the default configuration parameters of the multiple target default configuration items in the default configuration parameter set variable are modified according to the target positions of the multiple target default configuration items through the firmware variable setting function. The firmware variable setting function is a function for modifying the default configuration parameters of the multiple target default configuration items in the default configuration parameter set variable. Optionally, the firmware variable setting function is SetVariable, which allows setting a specified configuration item. SetVariable is structured data stored in non-volatile memory (such as NVRAM) for variables, which is used to save system configuration, startup parameters, security settings, and other key information. SetVariable is a core function (API) of BIOS, which is used to implement the following operations on variables: creating a new variable (when the variable does not exist, a new variable is generated and written to NVRAM); modifying an existing variable (updating the data or attributes of an existing variable (such as modifying the startup order)); deleting a variable (implementing logical deletion by writing empty data or using a specific attribute marker).
[0043] In an alternative embodiment, the "StdDefault" variable is found in the NVRAM by GetVariable and the data information of the "StdDefault" variable is obtained, and the names and default values of all options are saved in the "StdDefault" variable.
[0044] In this embodiment, without increasing the number of StdDefault variables, a solution is implemented from the software level to support different default values of the BIOS file for different packages, which can effectively reduce the size of the NVRAM firmware volume and thus reduce the project cost.
[0045] When the computer is started and the preliminary initialization is completed, it enters the Driver Execution Environment (DXE) stage, which is a key stage in the UEFI startup process and plays an extremely important role in the platform initialization process. The DXE module is responsible for loading and executing various drivers, which are mainly used to initialize hardware devices such as motherboard chipsets, memory controllers, storage controllers, graphics cards, etc. By loading these drivers, DXE can identify and configure the hardware components in the system, making them ready to support the subsequent startup and operation of the operating system. In this embodiment, in the early UEFI DXE, the StdDefault variable is updated by SetVariable to dynamically support different default value configurations under the premise of only one StdDefault variable, thereby simplifying the BIOS option default value configuration process, improving user experience, and this solution is a standard module defined by UEFI, which can be used as a general solution and transplanted to any platform (such as Intel / AMD) project, thereby reducing the development and maintenance cost of engineers.
[0046] Through this embodiment, one default configuration parameter set variable is used to store all default configuration items of the BIOS system, and even if new package options are added, no additional variable space is needed, thereby saving storage space, reducing cost, and simplifying the configuration management of the BIOS; and the target position is determined by the firmware variable reading function, and the default configuration parameters are modified by the firmware variable setting function and the target position, which can quickly and accurately locate the position of the default configuration item and accurately modify the corresponding default configuration parameters.
[0047] In an example embodiment, the default configuration parameter set variable includes a plurality of firmware variable storage structures; at least one of the plurality of default configuration items is stored in a firmware variable storage structure of the plurality of firmware variable storage structures. The firmware variable storage structure is a structure for storing a firmware configuration variable in a non-volatile random access memory, and optionally, the firmware variable storage structure is a Variable structure (such as a NVAR structure), which is a binary data format for storing a firmware variable.
[0048] The firmware variable storage structure of the plurality of firmware variable storage structures includes header information and body information, the header information of the firmware variable storage structure of the plurality of firmware variable storage structures includes a default configuration item name of the default configuration item, and the body information of the firmware variable storage structure of the plurality of firmware variable storage structures includes a default configuration parameter of the default configuration item.
[0049] Here, the header information of the firmware variable storage structure is the front end part of the firmware variable storage structure, and the header information contains the key metadata of the default configuration parameter set variable, such as the variable name (stored in Unicode encoding for cross-language and platform recognition), the variable data length (indicating the number of bytes of the subsequent data part), and the variable attribute flag (such as whether it is non-volatile, whether it is accessible in the startup service stage, whether it is read-only, etc.). The variable data body information is immediately after the header information, and the body information is the main component of the firmware variable storage structure, which is used to store the actual content of the variable, for example, the signature information signature (NVAR), the size of the data or data structure (variable size), the variable name (name), and the variable data.
[0050] In some embodiments, the default configuration parameter set variable is traversed to determine the target positions of the target default configuration items in the default configuration parameter set variable that match the specified configuration item names of the plurality of specified configuration items, including:
[0051] The specified configuration item of the plurality of specified configuration items is taken as the current specified configuration item, and the following traversal operation is performed until the current specified configuration item is the last specified configuration item in the plurality of specified configuration items, to obtain the target positions of the target default configuration items: confirming a first offset of the target firmware variable storage structure in the default configuration parameter set variable; the target firmware variable storage structure refers to the firmware variable storage structure of the plurality of firmware variable storage structures, in which the header information stores the default configuration item name matching the specified configuration item name of the current specified configuration item; determining a second offset of the default configuration parameter of the target default configuration item matching the current specified configuration item in the body information of the target firmware variable storage structure; and determining the target position of the target default configuration item matching the current specified configuration item according to the first offset and the second offset.
[0052] Optionally, starting from the start address of the default configuration parameter set variable, the header information in the target firmware variable storage structure containing the current specified configuration item name is searched. In the case where the default configuration item name stored in the header information in the multiple firmware variable storage structures is found to match the specified configuration item name of the current specified configuration item (i.e., the header information of the target firmware variable storage structure matches the specified configuration item name of the current specified configuration item), the system records the offset of the target firmware variable storage structure relative to the start address of the default configuration parameter set variable as a first offset.
[0053] Optionally, after the target firmware variable storage structure is found, the system further traverses the body information of the target firmware variable storage structure to find a configuration item matching the current specified configuration item name. The byte position of the configuration item relative to the start address of the body information of the target firmware variable storage structure is recorded as a second offset.
[0054] After the first offset and the second offset are obtained, the target position of the target default configuration item matching the current specified configuration item is determined according to the first offset and the second offset.
[0055] For example, the StdDefault variable is traversed to confirm the first offset of the target firmware variable storage structure in the StdDefault variable, and the default configuration parameter of the target default configuration item matching the current specified configuration item is determined to be at the second offset in the body information of the target firmware variable storage structure. After the first offset and the second offset are found, the target position of the target default configuration item matching the current specified configuration item is determined according to the first offset and the second offset. According to the actual option configuration requirement, the data values indicated by the first offset and the second offset are modified by the SetVariable function and the StdDefault variable is updated, so as to achieve the purpose of modifying the configuration default value according to the requirement.
[0056] An exemplary Figure 3 is a flowchart of another optional package option default value configuration method according to an embodiment of the present application, as shown in Figure 3As shown, the flow of the package option default value configuration method is as follows: obtaining the current package type of the selected configuration package, if the obtaining fails, ending directly; if the current package type is obtained successfully, obtaining the default configuration parameter set variable (such as the StdDefault variable value); if the obtaining fails, ending directly; if the obtaining is successful, traversing multiple specified configuration items of the selected configuration package, finding the target firmware variable storage structure (such as the NVAR variable) corresponding to the current specified configuration item in the StdDefault variable, then further determining the first offset of the target firmware variable storage structure in the default configuration parameter set variable, and the second offset of the default configuration parameter of the target default configuration item matched with the current specified configuration item in the main body information of the target firmware variable storage structure, judging whether the current specified configuration item is the last one, if yes, configuring the default configuration parameter set variable (the StdDefault variable) through the SetVariable function, and ending the flow; if not, returning to the step of traversing the package configuration table again, and continuing to repeat the foregoing steps until the current specified configuration item is the last one.
[0057] Through the embodiment, by dividing the firmware variable storage structure in the multiple firmware variable storage structures into the head information and the main body information, different configuration items can be clearly stored, the configuration parameter searching efficiency and modification accuracy are improved, the configuration flexibility and system response speed are further enhanced; and the first offset is confirmed, which is helpful for quickly positioning the position of the target firmware variable storage structure in the default configuration parameter set variable, and the second offset is determined, which can accurately find the position of the default configuration parameter in the main body information of the target firmware variable storage structure, so as to modify the default configuration parameter of the target default configuration item.
[0058] In an exemplary embodiment, as known from the above embodiment, the default configuration parameter set variable (such as the StdDefault variable) is stored in the NVRAM, and the data of all variables saved in the NVRAM exists through a Non-Volatile Attribute Record (NVAR) structure data, and the data structure thereof is similar to a chain table structure defined as a standard structure for UEFI, and one variable information ends and another variable starts. The Non-Volatile Attribute Record (NVAR) is a binary data structure, and contains a series of Attribute-Value Pairs for describing configuration information (such as a startup sequence, a security setting, a hardware state, etc.) required for firmware running, and is a structured data format for storing firmware configuration parameters, user settings and state information. Therefore, in the embodiment, the plurality of firmware variable storage structures are connected in a head-to-tail manner to form a first Non-Volatile Attribute Record chain table, the first Non-Volatile Attribute Record chain table is a chain table formed by connecting the plurality of firmware variable storage structures in a head-to-tail manner, and is used for storing and managing the default configuration parameter set variable corresponding to the basic input output system. Optionally, the first Non-Volatile Attribute Record chain table is an NVAR chain table. The first Non-Volatile Attribute Record chain table allows dynamic addition and deletion of configuration items, and does not need to reserve a fixed storage space for each configuration. Each firmware variable storage structure only occupies the actual required memory, and is connected through a pointer to form a chain table, thereby saving the additional overhead caused by the fixed size of an array. In addition, the chain structure supports efficient searching and updating of a specific configuration, avoids redundant data storage, and maximizes the use of the limited storage resources of the NVRAM.
[0059] For example, the "StdDefault" variable contains the data of all default configuration items in the BIOS system, and the data of the plurality of default configuration items in the BIOS system also exists in the "StdDefault" variable in the form of an NVAR data structure. Among them, Figure 4 is a schematic diagram of an NVAR data structure of an optional package option default value configuration method according to an embodiment of the present application, as shown in Figure 4 The data of all default configuration parameter set variables (i.e., the StdDefault variable) saved in the NVRAM exists through an NVAR structure data, and the data structure of the NVAR structure thereof is similar to a chain table structure defined as a standard structure for UEFI, and one variable information ends and another variable starts. For example, Figure 4The shown default configuration parameter set variable includes a plurality of firmware variable storage structures; each firmware variable storage structure is connected at the head and tail to form a linked list, wherein each firmware variable storage structure includes head information and body information, the head information includes a default configuration item name (i.e., variable name) of a default configuration item, variable data size, signature information, etc., and the body information includes variable data of the default configuration item.
[0060] In some embodiments, the first offset of the target firmware variable storage structure in the default configuration parameter set variable is determined, including:
[0061] Starting from the starting address of the first non-volatile attribute record linked list, the head information of the firmware variable storage structure in the plurality of firmware variable storage structures is read in sequence, and the default configuration item name of the default configuration item stored in the read head information is matched with the specified configuration item name of the current specified configuration item, the target firmware variable storage structure matched with the specified configuration item name of the current specified configuration item is found, and the first offset is determined according to the distance between the target firmware variable storage structure and the starting address of the first non-volatile attribute record linked list.
[0062] After the selected configuration package is obtained, that is, the corresponding plurality of specified configuration items are selected, starting from the starting address of the first non-volatile attribute record linked list, the head information of the firmware variable storage structure in the plurality of firmware variable storage structures is read in sequence, in the case that the default configuration item name of the default configuration item stored in the read head information matches the specified configuration item name of the current specified configuration item, the target firmware variable storage structure matched with the specified configuration item name of the current specified configuration item is found, and the distance between the target firmware variable storage structure and the starting address of the first volatile attribute record linked list is calculated, and the first offset is determined according to the distance between the target firmware variable storage structure and the starting address of the first volatile attribute record linked list.
[0063] Through the embodiment, by traversing the first non-volatile attribute record linked list, the target firmware variable storage structure matched with the specified configuration item name of the current specified configuration item can be quickly found, full search is avoided, the efficiency of configuration update is significantly improved, and by determining the first offset, the position of the target firmware variable storage structure can be directly accessed, unnecessary data reading is reduced, and at the same time, the plurality of firmware variable storage structures are connected at the head and tail to form the first non-volatile attribute record linked list, which can be beneficial to compactly storing the plurality of firmware variable storage structures in the NVRAM and efficiently utilizing the space.
[0064] In an exemplary embodiment, the subject information in the target firmware variable storage structure is concatenated to form a second non-volatile attribute record linked list; the second non-volatile attribute record linked list is a linked list formed by concatenating the subject information in the target firmware variable storage structure. In this way, the subject information in the target firmware variable storage structure is concatenated to form the second non-volatile attribute record linked list, which can allow compact storage of configuration parameter data, avoid excessive redundancy of data, and quickly locate the target position through the second non-volatile attribute record linked list without reorganizing the entire variable data, thereby enhancing the flexibility and response speed of configuration management. Optionally, the second non-volatile attribute record linked list can be an NVAR linked list in the Variable structure.
[0065] In some embodiments, determining the second offset of the default configuration parameter of the target default configuration item matching the current specified configuration item in the subject information of the target firmware variable storage structure includes:
[0066] Starting from the start address of the second non-volatile attribute record linked list, the subject information of the target firmware variable storage structure is read in sequence, and the default configuration item name corresponding to the default configuration parameter stored in the read subject information is matched with the specified configuration item name of the current specified configuration item, the target default configuration parameter matching the specified configuration item name of the current specified configuration item is found, and the second offset is determined according to the distance between the target default configuration parameter and the start address of the second non-volatile attribute record linked list.
[0067] After determining the target firmware variable storage structure, the system starts from the start address of the second non-volatile attribute record linked list, reads the subject information of the target firmware variable storage structure in sequence, finds the default configuration item name matching the specified configuration item name, finds the target default configuration parameter matching the specified configuration item name, calculates the distance between the target default configuration parameter and the start address of the second non-volatile attribute record linked list, and determines the second offset according to the distance between the target default configuration parameter and the start address of the second non-volatile attribute record linked list.
[0068] In an alternative embodiment, the embodiment is implemented as a standalone UEFI DXE module. Because the StdDefault variable needs to be updated according to the BoardId of the motherboard after the NVRAM initialization is completed, the module has a very high execution priority in the DXE stage of the BIOS execution phase, i.e., the function module is arranged in the order next to the NvramDxe module region in the FV_MAIN firmware volume. For example, the flow of the package option default value configuration method of the embodiment implemented in different configurations of the "Quiet Boot" option. The "StdDefault" variable contains the data of all default configuration items of the BIOS system, and the data of all default configuration items of the BIOS system also exists in the "StdDefault" variable in the form of a NVAR data structure (i.e., the "StdDefault" variable contains multiple NVAR records, and each NVAR record represents one or more configuration options of the BIOS). According to the linked list structure of the StdDefault data, "StdDefault" is traversed to find the Variable "AMITSESetup" where "Quiet Boot" is located. According to the NVAR data structure, the data of the "Setup" variable in the "StdDefault" data is found, i.e., the first offset is determined, and then the default value data of the "QuietBoot" option is located through the first offset and the second offset through the position of the "QuietBoot" in the "Setup" variable (i.e., the second offset), and the value of the corresponding data of the "QuietBoot" in the "Setup" is modified according to the type of the selected configuration package, and the "StdDefault" variable is reset through SetVariable, thereby realizing the setting of the default value of the "Quiet Boot" option required for the model.
[0069] Through the embodiment, the target default configuration parameter matching the specified configuration item name can be quickly found by traversing from the start address of the second non-volatile attribute record linked list, the reading of the target default configuration parameter is simplified, and the second offset can be more accurately determined; the main body information in the target firmware variable storage structure body is connected at both ends to form the second non-volatile attribute record linked list, which can allow compact storage of configuration parameter data, avoid excessive redundancy of data, and quickly locate the target position through the second non-volatile attribute record linked list without the need to reorganize the entire variable data, thereby enhancing the flexibility and response speed of configuration management.
[0070] In an exemplary embodiment, the firmware variable setting function is used to modify the default configuration parameters of the multiple target default configuration items in the default configuration parameter set variable according to the target positions of the multiple target default configuration items, including:
[0071] constructing a data block corresponding to the specified configuration item in the plurality of specified configuration items; the data block corresponding to the specified configuration item in the plurality of specified configuration items comprises a specified configuration parameter of the corresponding specified configuration item;
[0072] writing, by the firmware variable setting function, the data block corresponding to the specified configuration item in the plurality of specified configuration items into a corresponding position in the default configuration parameter set variable according to a target position of the plurality of target default configuration items, to overwrite the default configuration parameters of the plurality of target default configuration items.
[0073] In this embodiment, the data block corresponding to the specified configuration item in the plurality of specified configuration items refers to a data unit of the specified configuration parameter corresponding to the specified configuration item. The constructed data block is written into the target position of the plurality of target default configuration items in the default configuration parameter set variable by the firmware variable setting function, so as to overwrite the original default configuration parameters of the plurality of target default configuration items.
[0074] In an optional embodiment, taking the target default configuration item "Quiet Boot" as an example, the system identifies the target default configuration item, determines that "Quiet Boot" is the target default configuration item to be updated, and the corresponding specified configuration parameter is "Enabled"; a data block corresponding to the specified configuration item in the plurality of specified configuration items is constructed, which can include the name of "Quiet Boot", the binary value corresponding to "Enabled", the data length (indicating the number of bytes occupied by the parameter), and the attribute flag (non-volatile, writable, etc.). Then, the target position of "Quiet Boot" in the StdDefault variable (default configuration parameter set variable) is located, and the data block is written into the target position of the default configuration parameter set by the SetVariable function (firmware variable setting function), so as to overwrite the default configuration parameters of the plurality of target default configuration items, form new configuration parameters, for example, the SetVariable function writes the data block into the target position, directly overwrites the original "Disabled" parameter, and completes the update of the default configuration parameters.
[0075] By this embodiment, the data block corresponding to the specified configuration item in the plurality of specified configuration items is constructed, the firmware variable setting function is used to realize the quick update of the parameters, the data processing time is reduced, the efficiency of the configuration modification is improved, and the data block writing and overwriting mechanism is used to ensure that the new configuration parameters can accurately replace the old configuration parameters, so as to avoid errors and conflicts in the configuration update.
[0076] In an example embodiment, the data block corresponding to the target default configuration item in the plurality of target default configuration items is constructed by comparing the default configuration parameter of the target default configuration item in the plurality of target default configuration items with the specified configuration parameter of the corresponding specified configuration item, determining at least one target default configuration item having a difference, and constructing the data block corresponding to the at least one target default configuration item.
[0077] The system can check each default configuration parameter in the plurality of target default configuration items one by one, compare the current default configuration parameter with the specified configuration parameter of the corresponding specified configuration item, and determine the configuration parameter that needs to be updated. For at least one target default configuration item having a difference, the system can construct the data block corresponding to the at least one target default configuration item, so that only the changed configuration parameter needs to be updated, avoiding scanning and updating all configuration parameters, and updating the changed parameter, reducing the number of write operations.
[0078] For example, the selected configuration package contains two groups of specified configuration items, one of which is "QuietBoot" and the corresponding specified configuration parameter is "Enabled", and the other is "USB Controller" and the corresponding specified configuration parameter is "Enabled". In the default configuration parameter set variable, the current default configuration parameter corresponding to the target default configuration item "Quiet Boot" is "Disabled", and the current default configuration parameter corresponding to the target default configuration item "USB Controller" is "Enabled". The system compares the configuration parameters of the above target default configuration items with the above specified configuration items, determines that "Quiet Boot" is a difference configuration item that needs to be updated, constructs the data block corresponding to the target default configuration item "Quiet Boot", which contains the Unicode name of "Quiet Boot", the binary value corresponding to the specified configuration parameter "Enabled", etc. Since "USB Controller" has no difference, it does not construct the data block corresponding thereto. Finally, the data block of "Quiet Boot" is written into the target position of the target default configuration item "Quiet Boot" in the default configuration parameter set by using the SetVariable function, and the original "Disabled" parameter is overwritten.
[0079] Through this embodiment, the difference is determined by comparison, avoiding indiscriminate update operation on all configuration items, and the data block of the difference configuration item is constructed and updated, reducing the complexity of data processing and improving the update efficiency.
[0080] In one exemplary embodiment, after modifying the default configuration parameters of the target default configuration items stored in the basic input output system file according to the specified configuration items, the package option default value configuration method further comprises: verifying whether the modified default configuration parameter set variable is correctly updated by a firmware variable reading function; in the case that the default configuration parameter set variable is not correctly updated, returning to the step of modifying the default configuration parameters of the target default configuration items stored in the basic input output system file according to the specified configuration items, and repeatedly executing the step until the default configuration parameter set variable is correctly updated.
[0081] After modifying the default configuration parameters in the basic input output system file, the system reads and checks the default configuration parameter set variable (such as the StdDefault variable) by a firmware variable reading function (such as the GetVariable function) to verify whether the default configuration parameter set variable modified by the firmware variable setting function (the SetVariable function) is correctly updated.
[0082] If the default configuration parameter set variable is not correctly updated by the firmware variable reading function, the system returns to the configuration updating step (i.e., the step of modifying the default configuration parameters of the target default configuration items stored in the basic input output system file according to the specified configuration items), and repeatedly executes the process of modifying the default configuration parameters of the target default configuration items stored in the basic input output system file until it is confirmed that all the specified configuration parameters are correctly written and the default configuration parameter set variable is correctly updated.
[0083] In an optional embodiment, after modifying the default configuration parameters of the plurality of target default configuration items stored in the basic input output system file according to the plurality of specified configuration items, the modified default configuration parameter set variable is obtained through the firmware variable reading function, and the following verification is performed: the current value of the target default configuration item is read, and it is verified whether the default configuration parameters of the modified target default configuration item are correctly updated; if the default configuration parameters of the target default configuration item are correctly updated, the checksum after the write data block of the target default configuration item is compared with the checksum before the write data block of the target default configuration item, wherein the checksum is used to verify the data integrity; if the checksums do not match, it indicates that the default configuration parameters of the target default configuration item may be damaged or encounter unknown errors in the process of writing the target default configuration item, at this time it is determined that the update of the default configuration parameters of the target default configuration item fails, and the failure reason is recorded, if the modified default configuration parameters of the target default configuration item are correctly updated but the checksums do not match, it is determined as a verification failure; the failure reason (such as checksum mismatch), failure time and retry count (such as initial value 0) in the basic input output system file are recorded; according to the failure reason, a short interval retry strategy (such as interval 100 ms) is used to re-execute the modification operation of rebuilding the data block and writing; after retrying, the above verification is performed again, if the default configuration parameters are correctly updated and the checksums before and after the write data block of the target default configuration item are passed, it is determined as a verification success; if the continuous 3 times of retrying all fail, the log is recorded and the prompt "hardware storage exception, please check NVRAM" is given.
[0084] Through the embodiment, the firmware variable reading function is used to verify whether the modified default configuration parameter set variable is correctly updated, ensuring that the new configuration parameters are correctly written into the default configuration parameter set variable, preventing any errors or omissions in the configuration update process, improving the reliability of the configuration modification, and the cyclic update mechanism avoids the incomplete configuration parameter update, ensures that the data in the default configuration parameter set variable is consistent with the expected configuration, and prevents problems caused by inconsistent configurations during system operation.
[0085] In an exemplary embodiment, obtaining the selected configuration package includes: identifying the current mainboard model of the server mainboard, and determining the default configuration package matched with the current mainboard model according to a predefined correspondence table, and determining the default configuration package corresponding to the current mainboard model as the selected configuration package; the correspondence table stores the correspondence between different mainboard models and different default configuration packages.
[0086] Among them, the server mainboard supports multiple default configuration packages, and different default configuration packages are actually optimized settings of available hardware resources and functions on the server mainboard to adapt to different use scenarios or user needs.
[0087] The current mainboard model refers to an identifier assigned by firmware (such as BIOS / UEFI) or an operating system according to hardware identification logic, which represents the specific attributes and function set of the server mainboard in software configuration. The current mainboard model reflects the characteristics of the mainboard at the software level, such as supported processor types, memory specifications, I / O interface capabilities, etc., and is not directly equivalent to the physical model of the hardware. It is determined during the firmware startup phase as the basis for selecting and applying different default configuration packages, ensuring that system parameters match the actual hardware performance and purpose, thereby optimizing system operation efficiency and user experience. Users can change the "current mainboard model" at the software level by modifying register parameters, and the system will read the register values during startup and use them as the basis for identifying the model. When the current mainboard model is modified, the system recognizes that the current mainboard model has been modified. At this time, the system can find the configuration package corresponding to the modified current mainboard model. Once a matching configuration package is found, the system confirms it as the selected configuration package, changes the default configuration package corresponding to the previous mainboard model to the selected configuration package corresponding to the modified current mainboard model, and modifies the default configuration parameters of the multiple target default configuration items stored in the basic input / output system file according to the parameters of the selected configuration package.
[0088] Optionally, the system can read the current mainboard model of the server mainboard and determine the default configuration package matching the current mainboard model according to a predefined reference table, and determine the default configuration package corresponding to the current mainboard model as the selected configuration package.
[0089] In some embodiments, after the selected configuration package is set, if the user still needs to modify the specified configuration parameters in the selected configuration package, the current value of the specified configuration parameter can be manually modified in the SETUP menu of the BIOS, and the manually modified current value is stored in another file instead of modifying the default configuration parameter stored in the StdDefault variable. The SETUP menu is also known as the BIOS setup program or BIOS interface, which is an interactive configuration interface provided by computer firmware (BIOS / UEFI) for managing core parameters such as hardware bottom layer settings, startup options, security policies, etc. It is a bridge for users to communicate with computer hardware firmware, allowing custom configuration of hardware behavior before system startup.
[0090] Optionally, the system will find the configuration package corresponding to the current mainboard model according to the identified current mainboard model. Once a matching configuration package is found, the system confirms it as the selected configuration package, and modifies the default configuration parameters of the multiple target default configuration items stored in the basic input / output system file according to the parameters of the selected configuration package.
[0091] Through the embodiment, the current mainboard model is identified and matched with the corresponding configuration package, the applicability and optimization of the configuration parameters are ensured, and the overall performance and stability of the system are improved. Different user groups and different use scenarios can be satisfied, so that the computer hardware can run in the best state in various situations, and the overall performance and adaptability of the system are improved.
[0092] In other embodiments, a user self-defined module and a parameter association and verification module can also be set. The user self-defined module provides a personalized configuration space for the user, and the parameter association and verification module ensures the stability and compatibility of the system. In addition, if new use scenarios or user requirements appear subsequently, new package option default value parameter sets can be conveniently added in the package parameter storage module, and good flexibility and scalability are achieved.
[0093] It should be noted that, for the foregoing method embodiments, in order to simply describe, they are all expressed as a series of action combinations, but those skilled in the art should know that the present application is not limited to the action sequence described, because according to the present application, certain steps can be performed in other sequences or simultaneously. Secondly, those skilled in the art should know that the embodiments described in the specification all belong to preferred embodiments, and the actions and modules involved are not necessarily necessary for the present application.
[0094] Through the description of the above embodiments, those skilled in the art can clearly understand that the method according to the above embodiments can be realized by means of software and a general hardware platform as necessary, and of course, it can also be realized by hardware, but in many cases, the former is a better embodiment. Based on such understanding, the technical solutions of the present application can be embodied in the form of a software product, which is stored in a storage medium (such as a read-only memory (ROM) / random access memory (RAM), a magnetic disk, an optical disk), and includes a plurality of instructions for causing a terminal device (which can be a mobile phone, a computer, a server, or a network device) to execute the method described in each embodiment of the present application.
[0095] According to another aspect of the embodiments of the present application, a package option default value configuration device is also provided, Figure 5 is a structural block diagram of a package option default value configuration device according to an embodiment of the present application, like Figure 5As shown, the apparatus comprises: a first execution unit 502 configured to acquire a selected configuration package; the selected configuration package refers to a set of predefined default configuration packages of a basic input / output system; the selected configuration package corresponds to a plurality of specified configuration items; a specified configuration item in the plurality of specified configuration items comprises a specified configuration item name and a specified configuration parameter; and a second execution unit 504 configured to modify, according to the plurality of specified configuration items, a default configuration parameter corresponding to an original default configuration package of the basic input / output system stored in a basic input / output system file; the basic input / output system file stores a plurality of default configuration items corresponding to the basic input / output system under the original default configuration package.
[0096] It should be noted that the first execution unit 502 in this embodiment can be configured to perform the above step S202, and the second execution unit 504 in this embodiment can be configured to perform the above step S204.
[0097] According to the embodiments of the present application, a selected configuration package is acquired, that is, a set of predefined default configuration packages of a basic input / output system is selected, the selected configuration package corresponds to a plurality of specified configuration items, each specified configuration item comprises a specified configuration item name and a specified configuration parameter, a predefined configuration package can be quickly selected and applied, and the configuration process of the basic input / output system is simplified; according to the configuration parameters of the plurality of specified configuration items, the default configuration parameters of a plurality of target default configuration items stored in a basic input / output system file are directly modified; after the specified configuration package is selected, the plurality of configuration parameters do not need to be adjusted, the default configuration parameters of the target default configuration items can be quickly and accurately modified according to the selected configuration package, and it is avoided to configure a separate configuration item for each type of package, thereby reducing the occupation of the memory of the basic input / output system.
[0098] In one example embodiment, the basic input / output system file stores a default configuration parameter set variable; the default configuration parameter set variable is configured to store a plurality of default configuration items.
[0099] The second execution unit is further configured to acquire the default configuration parameter set variable through a firmware variable reading function, to traverse the default configuration parameter set variable, to determine target positions of a plurality of target default configuration items in the default configuration parameter set variable that match the specified configuration item names of the plurality of specified configuration items, and to modify, according to the target positions of the plurality of target default configuration items, the default configuration parameters of the plurality of target default configuration items in the default configuration parameter set variable through a firmware variable setting function.
[0100] In an example embodiment, the default configuration parameter set variable includes a plurality of firmware variable storage structures; at least one of the plurality of default configuration items is stored in a firmware variable storage structure of the plurality of firmware variable storage structures; the firmware variable storage structure of the plurality of firmware variable storage structures includes header information and body information, the header information of the firmware variable storage structure of the plurality of firmware variable storage structures includes a default configuration item name of the default configuration item, and the body information of the firmware variable storage structure of the plurality of firmware variable storage structures includes a default configuration parameter of the default configuration item.
[0101] The second execution unit is further configured to perform the following traversal operation with a specified configuration item of the plurality of specified configuration items as a current specified configuration item until the current specified configuration item is the last specified configuration item of the plurality of specified configuration items, to obtain a target position of the plurality of target default configuration items: confirming a first offset of a target firmware variable storage structure in the default configuration parameter set variable; the target firmware variable storage structure refers to a firmware variable storage structure of the plurality of firmware variable storage structures, in which the header information stores a default configuration item name matching the specified configuration item name of the current specified configuration item; determining a second offset of the default configuration parameter of the target default configuration item matching the current specified configuration item in the body information of the target firmware variable storage structure; and determining the target position of the target default configuration item matching the current specified configuration item according to the first offset and the second offset.
[0102] In an example embodiment, the plurality of firmware variable storage structures are connected head to tail to form a first non-volatile attribute record linked list.
[0103] The second execution unit is further configured to start traversal from a starting address of the first non-volatile attribute record linked list, to sequentially read the header information of the firmware variable storage structure of the plurality of firmware variable storage structures, and to match the default configuration item name of the default configuration item stored in the read header information with the specified configuration item name of the current specified configuration item, to find the target firmware variable storage structure matching the specified configuration item name of the current specified configuration item, and to determine the first offset according to a distance between the target firmware variable storage structure and the starting address of the first non-volatile attribute record linked list.
[0104] In an example embodiment, the subject information in the target firmware variable storage structure is connected at the beginning and the end to form a second non-volatile attribute record linked list; the second execution unit is further configured to traverse from a starting address of the second non-volatile attribute record linked list, read the subject information of the target firmware variable storage structure in sequence, and match a default configuration item name corresponding to a default configuration parameter stored in the read subject information with a specified configuration item name of a current specified configuration item, find a target default configuration parameter matching the specified configuration item name of the current specified configuration item, and determine a second offset according to a distance between the target default configuration parameter and the starting address of the second non-volatile attribute record linked list.
[0105] In an example embodiment, the second execution unit is further configured to construct a data block corresponding to a specified configuration item in the plurality of specified configuration items; the data block corresponding to the specified configuration item in the plurality of specified configuration items includes a specified configuration parameter of the corresponding specified configuration item.
[0106] The firmware variable setting function is used to write the data block corresponding to the specified configuration item in the plurality of specified configuration items into a corresponding position in the default configuration parameter set variable according to the target position of the plurality of target default configuration items, to overwrite the default configuration parameters of the plurality of target default configuration items.
[0107] In an example embodiment, the second execution unit is further configured to compare the default configuration parameters of a target default configuration item in the plurality of target default configuration items with the specified configuration parameters of the corresponding specified configuration item, determine at least one target default configuration item having a difference, and construct a data block corresponding to the at least one target default configuration item.
[0108] In an example embodiment, the second execution unit is further configured to, after modifying the default configuration parameters of the plurality of target default configuration items stored in the basic input output system file according to the plurality of specified configuration items, verify whether the modified default configuration parameter set variable is correctly updated by using a firmware variable reading function; in a case where the default configuration parameter set variable is not correctly updated, continue to execute the step of modifying the default configuration parameters of the plurality of target default configuration items stored in the basic input output system file according to the plurality of specified configuration items until the default configuration parameter set variable is correctly updated.
[0109] In an example embodiment, the first execution unit is further configured to identify a current mainboard model of the server mainboard, determine a default configuration package matching the current mainboard model according to a predefined reference table, and determine the default configuration package corresponding to the current mainboard model as the selected configuration package; the reference table stores a correspondence between different mainboard models and different default configuration packages.
[0110] The embodiment of the present application further provides an electronic device, comprising a memory and a processor, the memory stores a computer program, and the processor is configured to execute the computer program to perform the steps in any of the above-mentioned package option default value configuration method embodiments.
[0111] According to another aspect of the embodiment of the present application, a computer readable storage medium is provided, which comprises a stored program, wherein the program performs the steps in any of the above-mentioned method embodiments when executed.
[0112] In an exemplary embodiment, the above-mentioned computer readable storage medium can include, but is not limited to, a U disk, a ROM, a RAM, a mobile hard disk, a magnetic or optical disk, and various computer program storage media.
[0113] According to another aspect of the embodiment of the present application, an electronic device is provided, which comprises a memory, a processor, and a computer program stored in the memory and executable on the processor, and the processor is configured to perform the steps in any of the above-mentioned method embodiments through the computer program. In an exemplary embodiment, the above-mentioned electronic device can further comprise a transmission device connected to the processor and an input and output device connected to the processor.
[0114] The specific examples in the embodiment can refer to the examples described in the above-mentioned embodiments and exemplary implementation manners, and the embodiment will not be described here again.
[0115] The embodiment of the present application further provides a computer program product, which comprises a computer program, and the computer program performs the steps in any of the above-mentioned package option default value configuration method embodiments when executed by a processor.
[0116] The embodiment of the present application further provides another computer program product, which comprises a non-volatile computer readable storage medium, and the non-volatile computer readable storage medium stores a computer program, and the computer program performs the steps in any of the above-mentioned package option default value configuration method embodiments when executed by a processor.
[0117] The skilled person can further realize that the units and algorithm steps of the examples described in conjunction with the embodiments disclosed herein can be realized by electronic hardware, computer software or a combination of both. In order to clearly illustrate the interchangeability of hardware and software, the components and steps of the examples have been described in general terms in the above description. Whether the functions are realized in hardware or software depends on the specific application and design constraints of the technical solution. The skilled person can use different methods to realize the described functions for each specific application, but such implementation should not be considered beyond the scope of the present application.
[0118] The above describes in detail a package option default value configuration method and an electronic device provided by the present application. The principles and implementation manners of the present application are described by applying specific examples, and the above description of the embodiments is only applicable to helping understand the method of the present application and the core idea thereof. It should be pointed out that, for those skilled in the art, without departing from the principles of the present application, the present application can be improved and modified in several ways, and these improvements and modifications also fall within the protection scope of the claims of the present application.
Claims
1. A method for configuring default values for package options, characterized in that, include: Get the selected configuration package; The selected configuration package refers to a predefined default configuration package for a basic input / output system; the selected configuration package corresponds to multiple specified configuration items; the specified configuration items among the multiple specified configuration items include a specified configuration item name and specified configuration parameters; The default configuration parameter set variable stored in the basic input / output system file is obtained through the firmware variable reading function; the basic input / output system file stores multiple default configuration items corresponding to the basic input / output system under the original default configuration package; the default configuration parameter set variable is used to store multiple default configuration items of the basic input / output system; the default configuration parameter set variable includes multiple firmware variable storage structures; the firmware variable storage structure in the multiple firmware variable storage structures stores at least one default configuration item among the multiple default configuration items. The firmware variable storage structure in the plurality of firmware variable storage structures includes header information and body information. The header information in the firmware variable storage structure in the plurality of firmware variable storage structures includes the default configuration item name of the default configuration item, and the body information in the firmware variable storage structure in the plurality of firmware variable storage structures includes the default configuration parameters of the default configuration item. Taking the specified configuration item of the plurality of specified configuration items as the current specified configuration item, the following traversal operation is performed until the current specified configuration item is the last specified configuration item among the plurality of specified configuration items, to obtain the target positions of the plurality of target default configuration items in the default configuration parameter set variable that match the specified configuration item names of the plurality of specified configuration items: confirming the first offset of the target firmware variable storage structure in the default configuration parameter set variable; the target firmware variable storage structure refers to the firmware variable storage structure in the header information of the plurality of firmware variable storage structures whose default configuration item names match the specified configuration item names of the current specified configuration item; determining the second offset of the default configuration parameters of the target default configuration item that matches the current specified configuration item in the body information of the target firmware variable storage structure; and determining the target position of the target default configuration item that matches the current specified configuration item based on the first offset and the second offset. By using the firmware variable setting function, the default configuration parameters of the multiple target default configuration items in the default configuration parameter set variable are modified according to the target positions of the multiple target default configuration items.
2. The method according to claim 1, characterized in that, The plurality of firmware variable storage structures are linked end-to-end to form a first non-volatile attribute record linked list; the first offset of the confirmed target firmware variable storage structure in the default configuration parameter set variables includes: Starting from the beginning address of the first non-volatile attribute record linked list, the system traverses sequentially, reading the header information of each of the plurality of firmware variable storage structures. It then matches the default configuration item name of the default configuration item stored in the read header information with the specified configuration item name of the currently specified configuration item, finding the target firmware variable storage structure that matches the specified configuration item name of the currently specified configuration item. Finally, it determines the first offset based on the distance between the target firmware variable storage structure and the beginning address of the first non-volatile attribute record linked list.
3. The method according to claim 1, characterized in that, The main information in the target firmware variable storage structure is linked end-to-end to form a second non-volatile attribute record linked list; the determination of the default configuration parameter of the target default configuration item matching the currently specified configuration item by the second offset in the main information of the target firmware variable storage structure includes: Starting from the beginning address of the second non-volatile attribute record linked list, the system traverses the main information of the target firmware variable storage structure sequentially, and matches the default configuration item name corresponding to the default configuration parameter stored in the read main information with the specified configuration item name of the currently specified configuration item to find the target default configuration parameter that matches the specified configuration item name of the currently specified configuration item. The second offset is then determined based on the distance between the target default configuration parameter and the beginning address of the second non-volatile attribute record linked list.
4. The method according to claim 1, characterized in that, The step of modifying the default configuration parameters of the multiple target default configuration items in the default configuration parameter set variable according to the target position of the multiple target default configuration items through the firmware variable setting function includes: Construct a data block corresponding to a specified configuration item among the plurality of specified configuration items; the data block corresponding to the specified configuration item among the plurality of specified configuration items includes the specified configuration parameters of the specified configuration item; By using the firmware variable setting function, according to the target position of the multiple target default configuration items, the data block corresponding to the specified configuration item among the multiple specified configuration items is written into the corresponding position in the default configuration parameter set variable, thereby overwriting the default configuration parameters of the multiple target default configuration items.
5. The method according to claim 4, characterized in that, The construction of the data block corresponding to the target default configuration item among the plurality of target default configuration items includes: The default configuration parameters of the target default configuration items among the plurality of target default configuration items are compared with the specified configuration parameters of the corresponding specified configuration items to determine at least one target default configuration item with differences, and a data block corresponding to the at least one target default configuration item is constructed.
6. The method according to any one of claims 2 to 5, characterized in that, After modifying the default configuration parameters of the multiple target default configuration items in the default configuration parameter set variable according to the target position of the multiple target default configuration items through the firmware variable setting function, the method further includes: The firmware variable reading function is used to verify whether the modified default configuration parameter set variables have been updated correctly. If the default configuration parameter set variable is not updated correctly, return to the step of obtaining the default configuration parameter set variable stored in the basic input / output system file through the firmware variable reading function and continue execution until the default configuration parameter set variable is updated correctly.
7. The method according to claim 1, characterized in that, The process of obtaining the selected configuration package includes: Identify the current motherboard model of the server motherboard, and determine the default configuration package that matches the current motherboard model according to a predefined lookup table. Then, determine the default configuration package corresponding to the current motherboard model as the selected configuration package. The lookup table stores the correspondence between different motherboard models and different default configuration packages.
8. An electronic device, characterized in that, include: Memory, used to store computer programs; A processor, configured to implement the steps of the default configuration method for package options as described in any one of claims 1 to 7 when executing the computer program.
Citation Information
Patent Citations
Server configuration method and computing device
CN117687864A
Package configuration method and device, equipment and storage medium
CN119739431A