BIOS program upgrade method, device and storage medium

By writing the structure of storage unit layout information in the BIOS program development stage, analyzing the old and new versions of BIOS program files to ensure that the setting information is read and saved before upgrading, solving the problem of loss of setting information during BIOS program upgrade, realizing the complete retention of setting information and normal operation of the equipment.

CN114546452BActive Publication Date: 2025-08-08ALIBABA (CHINA) CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210199346.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-03-02
Publication Date
2025-08-08
Estimated Expiration
2042-03-02

AI Technical Summary

Technical Problem

The existing BIOS program upgrade method can easily cause the setting information in the BIOS chip to be unable to be retained, affecting the normal operation of electronic devices.

Method used

In the BIOS program development stage, the structure information encapsulated with the layout information of the storage unit on the BIOS chip is written in the BIOS program file. By analyzing the structure information of the target storage unit in the old and new versions of the BIOS program file, determining whether there is enough storage space to save the setting information, and reading the setting information before upgrading, and then writing it to the BIOS chip together with the new version of the BIOS program file.

Benefits of technology

Ensure that the setting information is fully retained after the BIOS program is upgraded to ensure the normal operation of electronic devices.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114546452B_ABST
    Figure CN114546452B_ABST
Patent Text Reader

Abstract

The embodiment of the present application provides a BIOS program upgrade method, device and storage medium. In the embodiment of the present application, during the BIOS program development stage, structural information encapsulating the layout information of the storage unit on the BIOS chip is written into the BIOS program file. In this way, when the BIOS program is upgraded, the structural information of the target storage unit configured to store setting information in the new version BIOS program file and the old version BIOS program file is analyzed, and it can be accurately and quickly known whether the storage capacity of the target storage unit has changed before and after the BIOS program file version upgrade. When it is determined that the target storage unit has enough storage space after the BIOS program upgrade to store the setting information that has been saved in the BIOS chip before the BIOS program upgrade, the setting information is first read out from the BIOS chip, and then the read setting information and the new version BIOS program file are written into the BIOS chip together, thereby ensuring that the complete setting information is still retained in the BIOS chip after the program upgrade.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a BIOS program upgrade method, device, and storage medium. Background Art

[0002] A BIOS (Basic Input / Output System) chip stores the BIOS program that provides the lowest-level and most direct hardware control for electronic devices. It is primarily used to initialize and test various hardware devices during the startup process. Typical BIOS chips include, but are not limited to, ROM (Read-Only Memory), PROM (Programmable ROM), and EEPROM (Electrically Erasable Programmable Read Only Memory).

[0003] In actual applications, during the BIOS program development phase, the BIOS chip's storage space can be divided into multiple memory cells. Each memory cell has a different address range, meaning that the memory cells are arranged differently within the BIOS chip. Typically, several designated memory cells within the multiple memory cells are configured to store custom configuration information, while the remaining memory cells within the multiple memory cells are configured to store BIOS program files.

[0004] Over time, the BIOS program files in the BIOS chip need to be upgraded. The current upgrade method involves clearing only the storage cells storing the old BIOS program files, essentially erasing the old BIOS program files from the BIOS chip while retaining the settings in the BIOS chip. Next, the new BIOS program files are written to the BIOS chip to complete the BIOS program upgrade process. However, developing a new BIOS program file may change the layout of the storage cells in the BIOS chip, and this upgrade method can easily result in the BIOS chip's settings not being retained. Therefore, how to successfully retain the existing settings in the BIOS chip during a BIOS program file upgrade is an urgent issue. Summary of the Invention

[0005] Various aspects of the present application provide a BIOS program upgrade method, device, and storage medium for successfully retaining existing setting information in a BIOS chip during a BIOS program file upgrade process.

[0006] An embodiment of the present application provides a BIOS program upgrade method, comprising: in response to a BIOS program upgrade instruction, obtaining first structure information from a new version BIOS program file, the first structure information including at least first address information and a first storage capacity of a target storage unit on a BIOS chip, the target storage unit being a storage unit in the BIOS chip configured to store setting information; obtaining second structure information from an old version BIOS program file, the second structure information including at least second address information and a second storage capacity of the target storage unit on the BIOS chip; if the first storage capacity is greater than or equal to the second storage capacity, reading setting information from the target storage unit on the BIOS chip according to the second address information; and in the process of performing an upgrade on the BIOS chip according to the new version BIOS program file, rewriting the read setting information into the target storage unit on the BIOS chip according to the first address information.

[0007] An embodiment of the present application also provides an electronic device, including: a memory and a processor; the memory is used to store a computer program; the processor is coupled to the memory, and is used to execute the computer program to perform a BIOS program upgrade method.

[0008] An embodiment of the present application also provides a computer storage medium storing a computer program. When the computer program is executed by a processor, the processor can implement a BIOS program upgrade method.

[0009] In an embodiment of the present application, during the BIOS program development phase, structural information encapsulating various layout information of storage units on the BIOS chip is written into the BIOS program file. Thus, when the BIOS program is upgraded, by analyzing the structural information of the target storage units configured to store setting information in the new version BIOS program file and the old version BIOS program file, it is possible to accurately and quickly determine whether the storage capacity of the target storage units has changed before and after the BIOS program file version upgrade. Upon determining that the target storage units have sufficient storage space after the BIOS program upgrade to store the setting information already stored in the BIOS chip before the BIOS program upgrade, the setting information is first read from the BIOS chip, and then the read setting information and the new version BIOS program file are written into the BIOS chip together, thereby ensuring that the complete setting information is retained in the BIOS chip after the program upgrade, thereby ensuring the normal operation of the electronic device. BRIEF DESCRIPTION OF THE DRAWINGS

[0010] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:

[0011] Figure 1 A flowchart of a BIOS program upgrade method provided in an embodiment of the present application;

[0012] Figure 2 This is a diagram showing the address ranges of multiple blocks before and after the BIOS program file upgrade.

[0013] Figure 3 is an exemplary layout structure;

[0014] Figure 4 A flowchart of another BIOS program upgrade method provided in an embodiment of the present application;

[0015] Figure 5 A schematic diagram of the structure of a BIOS program upgrade device provided in an embodiment of the present application;

[0016] Figure 6 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0017] To make the purpose, technical solutions, and advantages of this application more clear, the technical solutions of this application will be clearly and completely described below in conjunction with the specific embodiments of this application and the corresponding drawings. Obviously, the embodiments described are only part of the embodiments of this application, not all of them. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.

[0018] In actual applications, in order to make full use of the BIOS chip, in addition to storing the BIOS program files, the BIOS chip also stores the more critical setting information required by the electronic device. The setting information includes, but is not limited to, third-party firmware files and system configuration information. Taking the setting information as the system configuration information, usually, the setting subroutine is encapsulated in the BIOS program, and the system configuration information is managed by the setting subroutine. The setting subroutine provides a setting interface for the user to configure the system configuration information, and stores the system configuration information configured by the user in the storage unit specified in the BIOS chip. Among them, the system configuration parameters that can be configured by the user include, but are not limited to: basic parameters such as the system clock, display type and the way to handle self-test errors at startup, disk drive setting parameters, memory setting parameters and power management setting parameters, etc. After the system configuration information is stored in the storage unit specified in the BIOS chip in advance, the electronic device reads the system configuration information stored in the BIOS chip when it is turned on to perform system configuration and related hardware control, thereby ensuring the normal operation of the electronic device.

[0019] Over time, the BIOS program files in the BIOS chip need to be upgraded. The current upgrade method involves clearing only the storage cells containing the old BIOS program files, essentially erasing the old BIOS program files from the BIOS chip while retaining the settings in the BIOS chip. Next, the new BIOS program files are written to the BIOS chip to complete the BIOS program upgrade process. However, the development of a new BIOS program file may change the layout of the storage cells in the BIOS chip, and this upgrade method can easily result in the BIOS chip's settings not being retained.

[0020] In response to the above technical problems, the embodiments of the present application provide a BIOS program upgrade method, device and storage medium. In the embodiments of the present application, during the BIOS program development stage, structural information encapsulating various layout information of storage units on the BIOS chip is written into the BIOS program file. In this way, when the BIOS program is upgraded, the structural information of the target storage unit configured to store setting information in the new version BIOS program file and the old version BIOS program file is analyzed, and it can be accurately and quickly known whether the storage capacity of the target storage unit has changed before and after the BIOS program file version upgrade. When it is determined that the target storage unit has enough storage space to store the setting information that has been saved in the BIOS chip before the BIOS program upgrade after the BIOS program upgrade, the setting information is first read out from the BIOS chip, and then the BIOS writes the read setting information and the new version BIOS program file into the BIOS chip together, thereby ensuring that the complete setting information is still retained in the BIOS chip after the program upgrade, thereby ensuring the normal operation of the electronic device.

[0021] The following describes in detail the technical solutions provided by various embodiments of the present application in conjunction with the accompanying drawings.

[0022] Figure 1 This is a flow chart of a BIOS program upgrade method provided in an embodiment of the present application. The method can be executed by a BIOS program upgrade device, which can be implemented by software and / or hardware and can generally be integrated into an electronic device. Figure 1 , the method may include the following steps:

[0023] 101. In response to a BIOS program upgrade instruction, obtain first structure information from a new version BIOS program file, where the first structure information includes at least first address information and a first storage capacity of a target storage unit on a BIOS chip. The target storage unit is a storage unit in the BIOS chip configured to store setting information.

[0024] 102. Obtain second structure information from an old version BIOS program file, where the second structure information at least includes second address information and a second storage capacity of a target storage unit on a BIOS chip.

[0025] 103. If the first storage capacity is greater than or equal to the second storage capacity, read the setting information BIOS from the target storage unit on the BIOS chip according to the second address information.

[0026] 104. During the upgrade process of the BIOS chip according to the new version BIOS program file, the read setting information is rewritten into the target storage unit on the BIOS chip according to the first address information.

[0027] In practice, over time, application requirements change, leading to the need for a BIOS upgrade. For example, the need to write more system configuration information to the BIOS chip to control more hardware in an electronic device may necessitate a BIOS upgrade. Another example is the need to expand BIOS functionality, which may necessitate a BIOS upgrade.

[0028] For ease of understanding, the BIOS program files are divided according to the order of BIOS program upgrades. The BIOS program files before the upgrade are called old version BIOS program files, and the BIOS program files after the upgrade are called new version BIOS program files. The new version BIOS program files can be developed based on the old version BIOS program files. Specifically, the source code in the old version BIOS program files is updated based on the program upgrade requirements to obtain new source code, and a new version BIOS program file is generated based on the new source code. In the process of developing a new version of the BIOS program file, the layout information of each storage unit on the BIOS chip may be changed. Among them, the layout information of the storage unit mainly refers to the address range of the storage unit in the BIOS chip. Different storage units have different address ranges in the BIOS chip. The address range specifically refers to the storage address range from the starting address of the storage unit in the BIOS chip to the starting address of the storage unit in the BIOS chip. For ease of understanding, Figure 2 The address ranges of multiple blocks shown in the figure before and after the BIOS program file upgrade are used as an example to illustrate. Figure 2 In the BIOS, the address range of the entire BIOS chip is [0,1000]. The BIOS chip is divided into multiple blocks such as Block1, Block2, Block3, Block4, etc. Figure 2Each block in the BIOS chip represents a storage unit. In the old BIOS program file, the address range of Block 1 is configured to be [0, 100), the address range of Block 2 is configured to be [100, 300), the address range of Block 3 is configured to be [300, 800), and the address range of Block 4 is configured to be [800, 1000]. In the new BIOS program file, the address range of Block 1 is configured to be [0, 100), the address range of Block 2 is configured to be [100, 500), the address range of Block 3 is configured to be [500, 900), and the address range of Block 4 is configured to be [900, 1000]. The address ranges of Block 2, Block 3, and Block 4 have all changed. Continuing with the example of setting the system configuration information as the setting information, if Block 3 and Block 4 are blocks specifically used to store the system configuration information, according to the existing BIOS program upgrade method, part of the system configuration information stored in Block 3 and Block 4 will be cleared during the program upgrade process and cannot be retained. This will cause the system configuration information in the BIOS chip to be incomplete, affecting the normal operation of the electronic device.

[0029] In this embodiment, the layout information of each storage unit on the BIOS chip can be added to the BIOS program file. In this way, before upgrading the BIOS chip, the layout information of each storage unit in the new version BIOS program file and the old version BIOS program file can be compared to accurately identify whether the layout of the storage units in the BIOS chip has changed.

[0030] Further, optionally, to facilitate the management of storage unit layout information, a structure consisting of multiple fields can be defined to encapsulate various storage unit layout information. Optionally, the fields in the structure recording storage unit layout information include, but are not limited to, an identification field, a starting address field, an ending address field, an address range field, a storage capacity field, a type field, and a reserved field. The identification field records the storage unit's identifier (which can be globally unique); the starting address field records the storage unit's starting address in the BIOS chip; the ending address field records the storage unit's ending address in the BIOS chip; the address range field records the address range of the storage unit in the BIOS chip; and the type field identifies the storage unit's type. Storage unit types can be categorized based on the content stored in the storage unit. For example, storage units can be categorized into data storage units for storing various configuration information, such as system configuration information, code storage units, or other types of storage units, depending on the content stored. A data storage unit can refer to a storage unit for storing various configuration information, such as system configuration information. A code storage unit can refer to a storage unit for storing BIOS program code. Other storage units are used to store information other than setup information and BIOS program code. The reserved field is used to record information that is subsequently added to the storage unit.

[0031] For example, the structure recording the layout information of the storage unit can be defined as:

[0032] typedef struct{

[0033] EFI_GUID Guid; / / The EFI_GUID Guid field is an identification field;

[0034] UINT32 Offset; / / UINT32 represents an unsigned integer, and the Offset field refers to the starting address field;

[0035] UINT32 Size; / / Size field refers to the storage capacity field;

[0036] UINT32 Type; / / Type field refers to the type field

[0037] UINT32 Reserved; / / The Reserved field refers to the reserved field;

[0038] }BLOCK_AREA / / BLOCK_AREA represents the structure information reflecting the layout information of the storage unit.

[0039] In this embodiment, the storage unit on the BIOS chip that is configured to store configuration information is referred to as the target storage unit. Storage units on the BIOS chip other than the target storage unit are referred to as other storage units. It is worth noting that, after a target storage unit is configured to store configuration information, it can only be used to store configuration information. Thus, during the development of a new version of the BIOS program file, the function of the target storage unit cannot be changed; that is, the target storage unit cannot be used to store information other than configuration information.

[0040] In this embodiment, the BIOS program upgrade instruction can be manually triggered by the user or automatically triggered. After the BIOS program upgrade instruction is triggered, the structure information of the target storage unit is obtained from the new version BIOS program file and the old version BIOS program file respectively according to the identifier of the target storage unit. For ease of understanding and distinction, the structure information of the target storage unit in the new version BIOS program file is referred to as first structure information. The structure information of the target storage unit in the old version BIOS program file is referred to as second structure information.

[0041] In this embodiment, after obtaining first structure information of a target storage unit from a new version BIOS program file and second structure information of the target storage unit from an old version BIOS program file, the first structure information and the second structure information are analyzed to identify whether the layout information of the target storage unit has changed before and after the BIOS program file version upgrade. In this embodiment, the key is to analyze whether the storage capacity of the target storage unit has changed before and after the BIOS program file version upgrade. Specifically, the size relationship between the first storage capacity in the first structure information and the second storage capacity in the second structure information is analyzed. If the first storage capacity is greater than or equal to the second storage capacity, it indicates that the address range of the target storage unit on the BIOS chip remains unchanged or increases after the BIOS program upgrade relative to before the BIOS program upgrade. In this case, the target storage unit has sufficient storage space to store the settings information stored in the BIOS chip before the BIOS program upgrade. If the first storage capacity is less than the second storage capacity, it indicates that the address range of the target storage unit on the BIOS chip has decreased after the BIOS program upgrade relative to before the BIOS program upgrade. In this case, the target storage unit does not have sufficient storage space to store the settings information stored in the BIOS chip before the BIOS program upgrade. Based on the above, the BIOS program upgrade operation is performed only when it is determined that the first storage capacity is greater than or equal to the second storage capacity, so as to ensure that the setting information can be completely stored in the BIOS chip.

[0042] In this embodiment, when determining to perform a BIOS program upgrade operation on a BIOS chip, the configuration information stored in the target storage unit on the BIOS chip is first read out. Then, during the upgrade process for the BIOS chip according to the new version of the BIOS program file, the read configuration information is rewritten to the target storage unit on the BIOS chip according to the first address information. Furthermore, during the upgrade process, a clear operation is first performed on the BIOS chip, that is, data on the BIOS chip is cleared, and then the read configuration information is rewritten to the target storage unit on the BIOS chip, and the new version of the BIOS program file is written to other storage units on the BIOS chip, thereby completing the BIOS program upgrade.

[0043] It is worth noting that when reading the configuration information stored in the target storage unit on the BIOS chip, the configuration information can be read from the target storage unit on the BIOS chip based on the second address information of the target storage unit. The second address information may include the starting address and / or ending address of the target storage unit on the BIOS chip. It should be understood that when the second address information only includes the starting address or the ending address, the address range of the target storage unit can be determined in combination with the second storage capacity, and the configuration information can be read from the target storage unit on the BIOS chip based on the address range of the target storage unit.

[0044] It is worth noting that when the read setting information is rewritten into the target storage unit on the BIOS chip, the setting information can be rewritten into the target storage unit on the BIOS chip based on the first address information of the target storage unit. The first address information can include the starting address and / or ending address of the target storage unit on the BIOS chip. It should be understood that when the first address information only includes the starting address or the ending address, the address range of the target storage unit can be determined in combination with the first storage capacity, and the setting information can be rewritten into the target storage unit on the BIOS chip based on the address range of the target storage unit.

[0045] Similarly, when writing a new version of the BIOS program file into other storage units on the BIOS chip, the new version of the BIOS program file can be written into the other storage units on the BIOS chip based on the address information of the other storage units.

[0046] Furthermore, to ensure data security of the configuration information, during the BIOS program upgrade process, the configuration information read from the BIOS chip can be backed up before the backed-up configuration information is written to a target storage unit on the BIOS chip. Thus, one implementation method for rewriting the read configuration information to the target storage unit on the BIOS chip based on the first address information is to write the read configuration information to a backup file, and then write the backup file to the target storage unit on the BIOS chip based on the first address information.

[0047] Further optionally, when the first storage capacity is greater than the second storage capacity, when backing up the configuration information read from the BIOS chip, the configuration information may be padded with data, and the padded configuration information may be written to a backup file. Thus, in one optional implementation, when the first storage capacity is greater than the second storage capacity, writing the read configuration information to the backup file specifically includes: calculating the capacity difference between the first and second storage capacities; padded with padding data matching the capacity difference to obtain padded configuration information; and writing the padded configuration information to the backup file. The padded data may be set based on actual needs, such as a binary digit 0 or 1. For example, if the capacity difference between the first and second storage capacities is 1 kB (kilobyte), 1000 bytes of data may be padded after the read configuration information, so that the storage capacity required for the padded configuration data equals the first storage capacity.

[0048] After completing the program upgrade of the BIOS chip, the target storage unit on the BIOS chip currently stores the setting information. In actual applications, because the application requirements have changed, it is necessary to add more setting information to the target storage unit. Therefore, further optionally, after completing the BIOS program upgrade, the newly added setting information can also be written into the target area in the BIOS chip in response to the operation of adding the setting information. The target area is the storage space in the target storage unit corresponding to the fill data. It is worth noting that the target area is a storage space specifically used to write the newly added setting information. When the newly added setting information is written to the target area, the fill data originally written to the target area is cleared. Taking the setting information as system configuration information as an example, the setting subroutine encapsulated by the BIOS program can provide a setting interface to the user. In response to the user's operation of adding system configuration information on the setting interface, the setting subroutine obtains the newly added system configuration information and stores it in the target area in the target storage unit of the BIOS chip to complete the operation of adding the system configuration information in the target storage unit.

[0049] In actual application, the first storage capacity of the target storage unit recorded in the new version BIOS program file may be smaller than the first storage capacity of the target storage unit recorded in the old version BIOS program file. The reason for this situation may be a mistake in program development or the new version BIOS program file has been illegally tampered with, but is not limited to these reasons. In order to ensure the reliability of the BIOS program upgrade, further optional, such as Figure 1 As shown, the above method may further include: step 105, if the first storage capacity is smaller than the second storage capacity, outputting a prompt message, the prompt message being used to prompt the modification of the new version BIOS program file with the goal of increasing the storage capacity of the target storage unit.

[0050] It is worth noting that there is no restriction on the order of executing step 101 and step 102, and they can be executed sequentially or in parallel.

[0051] The BIOS program upgrade method provided by the embodiment of the present application, during the BIOS program development phase, writes structural information encapsulating various layout information of storage units on the BIOS chip into the BIOS program file. In this way, when the BIOS program is upgraded, the structural information of the target storage unit configured to store setting information in the new version BIOS program file and the old version BIOS program file is analyzed, and it can be accurately and quickly determined whether the storage capacity of the target storage unit has changed before and after the BIOS program file version upgrade. When it is determined that the target storage unit has sufficient storage space after the BIOS program upgrade to store the setting information that was already stored in the BIOS chip before the BIOS program upgrade, before clearing the data in the BIOS chip, the setting information is first read from the BIOS chip, and then the BIOS writes the read setting information and the new version BIOS program file into the BIOS chip, thereby ensuring that the BIOS chip after the program upgrade still retains the complete setting information, thereby ensuring the normal operation of the electronic device.

[0052] In some optional embodiments, a global structure can be defined to facilitate global control of the layout information of the entire BIOS chip. For ease of distinction, the layout information of the entire BIOS chip is referred to as global layout information, and the structure that records the global layout information of the entire BIOS chip is referred to as a layout structure. Optionally, the fields of the global layout structure include, but are not limited to, a layout structure identification field, a search flag field, a verification information field, a program version field, a storage unit quantity field, and a storage unit description field. The layout identification field is used to record the layout structure identification corresponding to the BIOS chip's layout information (this identification can be a globally unique identification); the search flag field is used to indicate the search entry for the layout information. The verification information field is used to record relevant information for verifying the BIOS chip's layout information. The program version field is used to record the version information of the BIOS program file. The storage unit quantity field is used to record the number of storage units in the BIOS chip. The storage unit description field is used to record the structure information of at least one storage unit on the BIOS chip.

[0053] For example, the layout structure that records the global layout information of the entire BIOS chip can be defined as:

[0054] typedef struct{

[0055] EFI_GUID Guid; / / EFI_GUID Guid refers to the globally unique layout structure identifier;

[0056] UINT32 Signature; / / The Signature field refers to the search flag field, and the field value of the search flag field is fixed to "_RL_" for example;

[0057] UINT32 CheckSum; / / The CheckSum field is a checksum information field. The field value of the CheckSum field can be a checksum.

[0058] UINT32 Version; / / The Version field refers to the program version field;

[0059] UINT32 NumberOfBlock; / / NumberOfBlock field refers to the number of storage units field;

[0060] BLOCK_AREA Descriptors[0]; / / BLOCK_AREA Descriptors[0] field refers to the storage unit description field

[0061] }ROM_LAYOUT; / / ROM_LAYOUT represents the structure information reflecting the global layout information of the entire BIOS chip.

[0062] For ease of understanding, Figure 3 The layout structure shown is used as an example for explanation. Figure 3 The figure shows that in a BIOS ROM file (also known as a BIOS program file) with a data size of 64M, a ROM_LAYOUT layout structure is added to the BIOS ROM file. According to the globally unique layout structure identifier ( Figure 3 (GUID is the layout structure identifier.) You can find the ROM_LAYOUT layout structure in the BIOS ROM file. This ROM_LAYOUT layout structure records the identifiers and structure information of three storage units. The identifiers of the three storage units are GUID1, GUID2, and GUID3. Figure 3 The four data items in the row containing the search flag "_RL_" are the search flag "_RL_", verification information (0x1276111), program version information (0x00000000), and the number of storage units (0x00000003). The four data items in the row below the row containing storage unit GUID1 are the structure information for storage unit GUID1. These items are, in order, the starting address (0x00000000), storage capacity (0x00010000), type information (0x00000000), and the reserved field value (0x00000000). Similarly, the four data items in the row below the row containing storage unit GUID2 are the structure information for storage unit GUID2; and the four data items in the row below the row containing storage unit GUID3 are the structure information for storage unit GUID3.

[0063] For ease of understanding and distinction, the global layout information recorded by the layout structure in the new version BIOS program file is referred to as first global layout information, and the global layout information recorded by the layout structure in the old version BIOS program file is referred to as second global layout information. Based on the first and second global layout information, it is also possible to accurately and quickly determine whether the storage capacity of the target storage unit has changed before and after the BIOS program file version upgrade, thereby determining whether to perform the BIOS program upgrade operation. Based on this, embodiments of the present application provide another BIOS program upgrade method. Figure 4 This is a flow chart of another BIOS program upgrade method provided by an embodiment of the present application. This method can be executed by a BIOS program upgrade device, which can be implemented by software and / or hardware and can generally be integrated into an electronic device. Figure 4, the method may include the following steps:

[0064] 401. In response to a BIOS program upgrade instruction, obtain first global layout information from a new version of the BIOS program file, where the first global layout information includes at least an identifier of each storage unit on the BIOS chip and its corresponding structure information. Based on an identifier of a target storage unit included in the BIOS upgrade instruction, obtain structure information corresponding to the target storage unit from the first global layout information as first structure information.

[0065] 402. Obtain second global layout information from the old version BIOS program file, where the second global layout information includes at least an identifier of each storage unit on the BIOS chip and its corresponding structure information. Based on the identifier of the target storage unit included in the BIOS upgrade instruction, obtain the structure information corresponding to the target storage unit from the second global layout information as the second structure information.

[0066] 403. If the first storage capacity is greater than or equal to the second storage capacity, read the setting information BIOS from the target storage unit on the BIOS chip according to the second address information.

[0067] 404. During the upgrade process of the BIOS chip according to the new version BIOS program file, the read setting information is rewritten into the target storage unit on the BIOS chip according to the first address information.

[0068] It is worth noting that there is no restriction on the order of executing step 401 and step 402, and they can be executed sequentially or in parallel.

[0069] In this embodiment, the new version BIOS program file can be obtained by modifying the old version BIOS program file. Therefore, in an optional implementation, before responding to the BIOS program upgrade instruction, the process further includes: obtaining the old version BIOS program file, the old version BIOS program file including the old version source code, the old version source code including the second global layout information; modifying at least the second global layout information in the old version source code based on the program upgrade requirements to obtain the new version source code; and generating the new version BIOS program file based on the new version source code.

[0070] In this embodiment, first global layout information can be queried from the new version BIOS program file based on the globally unique layout structure identifier. The first global layout information includes at least the identifier of each storage unit on the BIOS chip and its corresponding structure information. The first structure information of the target storage unit is obtained from the first global layout information based on the identifier of the target storage unit. Similarly, second global layout information can be queried from the old version BIOS program file based on the globally unique layout structure identifier. The second global layout information includes at least the identifier of each storage unit on the BIOS chip and its corresponding structure information. The second structure information of the target storage unit is obtained from the second global layout information based on the identifier of the target storage unit.

[0071] In this embodiment, after obtaining the first structure information of the target storage unit from the new version BIOS program file and the second structure information of the target storage unit from the old version BIOS program file, the target storage unit is analyzed to determine whether the storage capacity has changed before and after the BIOS program file version upgrade. If it is determined that the first storage capacity is greater than or equal to the second storage capacity, steps 403 and 404 are executed. The specific implementation of steps 403 and 404 can be found in steps 103 and 104 of the aforementioned embodiment, respectively, and will not be repeated here.

[0072] In specific applications, after obtaining the first global layout information from the new version of the BIOS program file, the first structure information of the target storage unit can be directly obtained from the first global layout information. Further optionally, in order to perform the BIOS program upgrade more safely, before obtaining the first structure information of the target storage unit from the first global layout information, the data security of the first global layout information can also be verified. Therefore, in an optional implementation method, before obtaining the structure information corresponding to the target storage unit as the first structure information from the first global layout information according to the identifier of the target storage unit contained in the BIOS upgrade instruction, it is also possible to: generate second verification information based on the basic information in the first global layout information and / or the structure information corresponding to the selected storage unit; if the first verification information and the second verification information are the same, execute the step of obtaining the structure information corresponding to the target storage unit as the first structure information from the first global layout information according to the identifier of the target storage unit contained in the BIOS upgrade instruction.

[0073] Specifically, the first global layout information also includes first verification information and basic information, and the basic information includes at least one of the program version information of the new version BIOS program file and the number of storage units on the BIOS chip. It is worth noting that the first verification information is generated during the program development phase of the new version BIOS program file based on the basic information of the first global layout information and / or the structural information corresponding to the selected storage unit, and is written into the new version BIOS program file. The second verification information is generated during the program upgrade phase of the new version BIOS program file based on the basic information of the first global layout information and / or the structural information corresponding to the selected storage unit in order to ensure the security of the BIOS program upgrade. It should be understood that the information involved in calculating the first verification information can be selected according to the actual situation and is not limited to the program version information of the new version BIOS program file, the number of storage units on the BIOS chip, and the structural information corresponding to the selected storage unit. Of course, the information involved in calculating the first verification information should also be applied to calculating the second verification information.

[0074] In this embodiment, the generation method of the first verification information and the second verification information is not limited. For example, the first verification information and the second verification information may be checksum information obtained by processing the basic information and / or the structural information corresponding to the selected storage unit using a checksum algorithm. For another example, the first verification information and the second verification information may be verification information obtained by processing the basic information and / or the structural information corresponding to the selected storage unit using a longitudinal redundancy check (LRC) algorithm. For another example, the first verification information and the second verification information may be verification information obtained by processing the basic information and / or the structural information corresponding to the selected storage unit using a cyclic redundancy check (CRC) algorithm.

[0075] In this embodiment, after obtaining the first verification information from the first global layout information and generating the second verification information based on the basic information in the first global layout information and / or the structural information corresponding to the selected storage unit, the data security of the first global layout information is verified based on the comparison result of the first verification information and the second verification information. If the first verification information and the second verification information are the same, it means that the first global layout information in the new version BIOS program file to be upgraded to the BIOS chip has not been illegally tampered with and the data security is good. At this time, the step of obtaining the structural information corresponding to the target storage unit from the first global layout information as the first structural information according to the identifier of the target storage unit contained in the BIOS upgrade instruction can be executed. If the first verification information and the second verification information are the same, it means that the first global layout information in the new version BIOS program file to be upgraded to the BIOS chip is likely to have been illegally tampered with and the data security is poor. There is a security risk in continuing the BIOS program upgrade. At this time, a risk warning message can be output to remind the person responsible for the BIOS program upgrade that there is a security risk in the current BIOS program upgrade. The person responsible for the BIOS program upgrade can decide whether to continue the BIOS program upgrade based on the risk warning information.

[0076] Further optionally, to improve the accuracy and efficiency of the BIOS program upgrade, the configuration information read from the BIOS chip and the new version BIOS program file can be merged, and the merged file can be written as a whole to the BIOS chip to complete the BIOS program upgrade. As an optional implementation, the implementation process of step 404 is as follows: based on the structural information corresponding to each storage unit included in the first global layout information, the relative position relationship between the target storage unit and other storage units is determined; based on the relative position relationship, the configuration information read and the new version BIOS program file are merged to obtain a target file; a clear operation is performed on the BIOS chip, and the target file is directly written to the cleared BIOS chip to complete the BIOS program upgrade.

[0077] Optionally, when determining the relative positional relationship between the target storage unit and other storage units based on the structural information corresponding to each storage unit included in the first global layout information, the structural information corresponding to the other storage units can be obtained from the first global layout information, and the structural information corresponding to the other storage units at least includes the address information of the other storage units on the BIOS chip; based on the first address information and the address information of the other storage units on the BIOS chip, the relative positional relationship between the target storage unit and the other storage units is determined.

[0078] Specifically, the relative position relationship of each storage unit on the BIOS chip can be determined based on the address information of each storage unit on the BIOS chip, and the relative position relationship can reflect the order in which data is written to the storage unit on the BIOS chip. Figure 2 For example, the BIOS chip includes multiple blocks such as Block 1, Block 2, Block 3, and Block 4 in sequence. Data is written to Block 1, Block 2, Block 3, Block 4, and so on in sequence according to the data writing order. Therefore, when merging the read setting information and the new version BIOS program file, first, the storage units corresponding to the multiple sub-files in the new version BIOS program file are determined based on the new version BIOS program file, as well as the storage units corresponding to the read setting information. Then, based on the relative positional relationship between the multiple storage units, the data writing order of the multiple sub-files and the read setting information is determined, and the multiple sub-files in the new version BIOS program file and the read setting information are merged in sequence according to the data writing order. Finally, the merged target file is directly written to the cleared BIOS chip. At this point, the data stored in each storage unit of the BIOS chip is consistent with the data stored in each storage unit required by the new version BIOS program file.

[0079] Further optional, such as Figure 4 As shown, the above method may further include: Step 405: if the first storage capacity is smaller than the second storage capacity, outputting a prompt message, the prompt message being used to prompt the user to modify the new version of the BIOS program file with the goal of increasing the storage capacity of the target storage unit. The specific implementation of Step 405 can be found in Step 105 of the above embodiment, and will not be repeated here.

[0080] The BIOS program upgrade method provided by the embodiment of the present application writes the global layout information of the entire BIOS chip into the BIOS program file during the BIOS program development phase. In this way, when the BIOS program is upgraded, the structural information corresponding to the target storage unit configured to store setting information can be extracted from the global layout information of the new version BIOS program file and the global layout information of the old version BIOS program file. By analyzing the structural information of the target storage unit in the new version BIOS program file and the old version BIOS program file, it is possible to accurately and quickly determine whether the storage capacity of the target storage unit has changed before and after the BIOS program file version upgrade. When it is determined that the target storage unit has sufficient storage space after the BIOS program upgrade to store the setting information that has been saved in the BIOS chip before the BIOS program upgrade, before clearing the data in the BIOS chip, the setting information is first read from the BIOS chip, and the read setting information and the new version BIOS program file are written into the BIOS chip together. In this way, it can be ensured that the BIOS chip after the BIOS program upgrade still retains complete setting information, thereby ensuring the normal operation of the electronic device.

[0081] It should be noted that the execution entity of each step of the method provided in the above embodiment can be the same device, or the method can be executed by different devices. For example, the execution entity of steps 101 to 105 can be device A; for another example, the execution entity of steps 101 and 102 can be device A, and the execution entity of steps 103 to 105 can be device B; and so on.

[0082] In addition, some of the processes described in the above embodiments and the accompanying drawings include multiple operations that appear in a specific order, but it should be clearly understood that these operations may not be executed in the order in which they appear in this article or may be executed in parallel. The serial numbers of the operations, such as 101, 102, etc., are only used to distinguish between different operations, and the serial numbers themselves do not represent any order of execution. In addition, these processes may include more or fewer operations, and these operations may be executed in sequence or in parallel. It should be noted that the descriptions of "first", "second", etc. in this article are used to distinguish different messages, devices, modules, etc., and do not represent a sequential order, nor do they limit "first" and "second" to different types.

[0083] Figure 5 This is a schematic diagram of the structure of a BIOS program upgrade device provided in an embodiment of the present application. Figure 5 As shown, the device includes an acquisition module 51 , a reading module 52 and a writing module 53 .

[0084] The acquisition module 51 is configured to obtain first structure information from the new version BIOS program file in response to a BIOS program upgrade instruction, wherein the first structure information includes at least first address information and a first storage capacity of a target storage unit on the BIOS chip, where the target storage unit is a storage unit in the BIOS chip configured to store setting information;

[0085] The acquisition module 51 is further configured to acquire second structure information from the old version BIOS program file, where the second structure information at least includes second address information and second storage capacity of the target storage unit on the BIOS chip;

[0086] a reading module 52 configured to read the setting information BIOS from a target storage unit on the BIOS chip according to the second address information if the first storage capacity is greater than or equal to the second storage capacity;

[0087] The writing module 53 is used to rewrite the read setting information into the target storage unit on the BIOS chip according to the first address information during the process of performing an upgrade on the BIOS chip according to the new version BIOS program file.

[0088] Further optionally, when the acquisition module 51 obtains the first structure information from the new version of the BIOS program file in response to a BIOS program upgrade instruction, it is specifically used to: obtain first global layout information from the new version of the BIOS program file in response to the BIOS program upgrade instruction, the first global layout information at least including the identifier of each storage unit on the BIOS chip and its corresponding structure information; and obtain the structure information corresponding to the target storage unit from the first global layout information as the first structure information according to the identifier of the target storage unit contained in the BIOS upgrade instruction.

[0089] Further optionally, the first global layout information further includes first verification information and basic information, where the basic information includes at least one of program version information of the new version BIOS program file and the number of storage units on the BIOS chip;

[0090] Before the acquisition module 51 acquires the structural information corresponding to the target storage unit from the first global layout information as the first structural information based on the identifier of the target storage unit contained in the BIOS upgrade instruction, the acquisition module 51 is further configured to: generate second verification information based on the basic information in the first global layout information and / or the structural information corresponding to the selected storage unit; and if the first verification information and the second verification information are the same, execute the step of acquiring the structural information corresponding to the target storage unit from the first global layout information as the first structural information based on the identifier of the target storage unit contained in the BIOS upgrade instruction.

[0091] Further optionally, when the writing module 53 is performing an upgrade on the BIOS chip according to the new version of the BIOS program file, and rewrites the read setting information into the BIOS in the target storage unit on the BIOS chip according to the first address information, it is specifically used to: determine the relative position relationship between the target storage unit and other storage units according to the structure information corresponding to each storage unit included in the first global layout information; merge the read setting information and the new version of the BIOS program file according to the relative position relationship to obtain a target file; perform a clear operation on the BIOS chip, and write the target file directly into the cleared BIOS chip to complete the BIOS program upgrade.

[0092] Further optionally, when the write module 53 determines the relative positional relationship between the target storage unit and the other storage units based on the structural information corresponding to each storage unit included in the first global layout information, it is specifically used to: obtain the structural information corresponding to the other storage units from the first global layout information, where the structural information corresponding to the other storage units at least includes the address information of the other storage units on the BIOS chip; and determine the relative positional relationship between the target storage unit and the other storage units based on the first address information and the address information of the other storage units on the BIOS chip.

[0093] Further optionally, when the writing module 53 rewrites the read setting information into the target storage unit on the BIOS chip according to the first address information, it is specifically used to: write the read setting information into a backup file, and write the backup file into the target storage unit on the BIOS chip according to the first address information.

[0094] Further optionally, when the first storage capacity is greater than the second storage capacity, the writing module 53 writes the read setting information into the backup file, specifically for: calculating the capacity difference between the first storage capacity and the second storage capacity; filling in the setting information with filling data that matches the capacity difference to obtain the filled setting information; and writing the filled setting information into the backup file.

[0095] Further optionally, the above-mentioned device also includes: an adding module, which is used to write the newly added setting information into the target area in the BIOS chip in response to the setting information adding operation after completing the BIOS program upgrade, and the target area is the storage space in the target storage unit corresponding to the fill data.

[0096] Further optionally, before responding to the BIOS program upgrade instruction, the acquisition module 51 is also used to: obtain an old version BIOS program file, the old version BIOS program file includes an old version source code, and the old version source code includes second global layout information; based on the program upgrade requirements, at least modify the second global layout information in the old version source code to obtain a new version source code, and generate a new version BIOS program file based on the new version source code.

[0097] Further optionally, the above-mentioned device also includes a prompt module, which is used to output a prompt message if the first storage capacity is smaller than the second storage capacity, and the prompt message is used to prompt to modify the new version of the BIOS program file with the goal of increasing the storage capacity of the target storage unit.

[0098] Figure 5 The BIOS upgrade device can be executed Figure 1 or Figure 4 The implementation principle and technical effects of the BIOS program upgrade method of the embodiment shown are not described in detail. The specific manner in which each module and unit performs operations in the BIOS program upgrade device of the above embodiment has been described in detail in the embodiment of the method, and will not be elaborated here.

[0099] Figure 6 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. Figure 6 As shown, the device includes: a memory 61 and a processor 62;

[0100] The memory 61 is used to store computer programs and can be configured to store various other data to support operations on the computing platform. Examples of such data include instructions for any application or method operating on the computing platform, contact data, phone book data, messages, pictures, videos, etc.

[0101] The memory 61 can be implemented by any type of volatile or non-volatile memory device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk.

[0102] The processor 62 is coupled to the memory 61 and is used to execute the computer program in the memory 61, so as to: obtain first structure information from the new version BIOS program file in response to a BIOS program upgrade instruction, the first structure information including at least first address information and first storage capacity of a target storage unit on the BIOS chip, the target storage unit being a storage unit in the BIOS chip configured to store setting information; obtain second structure information from the old version BIOS program file, the second structure information including at least second address information and second storage capacity of the target storage unit on the BIOS chip; if the first storage capacity is greater than or equal to the second storage capacity, read the setting information BIOS from the target storage unit on the BIOS chip according to the second address information; and in the process of performing an upgrade on the BIOS chip according to the new version BIOS program file, rewrite the read setting information into the BIOS in the target storage unit on the BIOS chip according to the first address information.

[0103] Further optionally, when the processor 62 obtains the first structure information from the new version of the BIOS program file in response to the BIOS program upgrade instruction, it is specifically used to: obtain first global layout information from the new version of the BIOS program file in response to the BIOS program upgrade instruction, the first global layout information at least including the identifier of each storage unit on the BIOS chip and its corresponding structure information; and obtain the structure information corresponding to the target storage unit from the first global layout information as the first structure information according to the identifier of the target storage unit contained in the BIOS upgrade instruction.

[0104] Further optionally, the first global layout information further includes first verification information and basic information, where the basic information includes at least one of program version information of the new version BIOS program file and the number of storage units on the BIOS chip;

[0105] Before obtaining, from the first global layout information, the structure information corresponding to the target storage unit as the first structure information according to the identifier of the target storage unit included in the BIOS upgrade instruction, the processor 62 is further configured to:

[0106] Second verification information is generated based on basic information in the first global layout information and / or structural information corresponding to the selected storage unit; if the first verification information and the second verification information are the same, a step of obtaining structural information corresponding to the target storage unit from the first global layout information as the first structural information based on an identifier of the target storage unit included in the BIOS upgrade instruction is executed.

[0107] Further optionally, when the processor 62 is performing an upgrade on the BIOS chip according to the new version of the BIOS program file, and rewrites the read setting information into the BIOS in the target storage unit on the BIOS chip according to the first address information, it is specifically used to: determine the relative position relationship between the target storage unit and other storage units according to the structural information corresponding to each storage unit included in the first global layout information; merge the read setting information and the new version of the BIOS program file according to the relative position relationship to obtain a target file; and write the target file directly into the cleared BIOS chip to complete the BIOS program upgrade.

[0108] Further optionally, when the processor 62 determines the relative positional relationship between the target storage unit and other storage units based on the structural information corresponding to each storage unit included in the first global layout information, it is specifically used to: obtain the structural information corresponding to other storage units from the first global layout information, where the structural information corresponding to other storage units at least includes address information of other storage units on the BIOS chip; and determine the relative positional relationship between the target storage unit and other storage units based on the first address information and the address information of the other storage units on the BIOS chip.

[0109] Further optionally, when the processor 62 rewrites the read setting information into the target storage unit on the BIOS chip according to the first address information, it is specifically used to: write the read setting information into a backup file, and write the backup file into the target storage unit on the BIOS chip according to the first address information.

[0110] Further optionally, when the first storage capacity is greater than the second storage capacity, the processor 62 writes the read setting information into the backup file, specifically for: calculating the capacity difference between the first storage capacity and the second storage capacity; filling in the setting information with filling data that matches the capacity difference to obtain the filled setting information; and writing the filled setting information into the backup file.

[0111] Further optionally, after completing the BIOS program upgrade, it also includes: in response to the setting information adding operation, writing the newly added setting information into the target area in the BIOS chip, the target area being the storage space corresponding to the fill data in the target storage unit.

[0112] Further optionally, before responding to the BIOS program upgrade instruction, the processor 62 is also used to: obtain an old version BIOS program file, the old version BIOS program file includes an old version source code, and the old version source code includes second global layout information; based on the program upgrade requirements, at least modify the second global layout information in the old version source code to obtain a new version source code, and generate a new version BIOS program file based on the new version source code.

[0113] Further optionally, the processor 62 is further configured to: if the first storage capacity is smaller than the second storage capacity, output a prompt message, where the prompt message is configured to prompt the user to modify the new version of the BIOS program file with the goal of increasing the storage capacity of the target storage unit.

[0114] Further, if Figure 6 As shown, the electronic device also includes: a BIOS chip 60, a communication component 63, a display 64, a power component 65, an audio component 66 and other components. Figure 6 Only some components are shown schematically, which does not mean that the electronic device only includes Figure 6 In addition, Figure 6 The components in the dotted box are optional components, not mandatory components, and the specific configuration depends on the product form of the production scheduling equipment. The electronic device of this embodiment can be implemented as a terminal device such as a desktop computer, a laptop computer, a smart phone or an IOT device, or as a server-side device such as a conventional server, a cloud server or a server array. If the electronic device of this embodiment is implemented as a terminal device such as a desktop computer, a laptop computer, a smart phone, etc., it can include Figure 6 If the electronic device of this embodiment is implemented as a conventional server, cloud server or server array and other server-side devices, it may not include Figure 6 Components within the dotted box.

[0115] The detailed implementation process of the processor executing each action can be found in the relevant description in the aforementioned method embodiment or device embodiment, and will not be repeated here.

[0116] Accordingly, an embodiment of the present application further provides a computer-readable storage medium storing a computer program, which, when executed, can implement the steps that can be performed by the electronic device in the above method embodiment.

[0117] Accordingly, an embodiment of the present application also provides a computer program product, including a computer program / instruction. When the computer program / instruction is executed by a processor, the processor is enabled to implement the steps in the above method embodiment that can be performed by an electronic device.

[0118] The above-mentioned communication component is configured to facilitate wired or wireless communication between the device where the communication component is located and other devices. The device where the communication component is located can access a wireless network based on a communication standard, such as WiFi, 2G, 3G, 4G / LTE, 5G and other mobile communication networks, or a combination thereof. In an exemplary embodiment, the communication component receives a broadcast signal or broadcast-related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component also includes a near field communication (NFC) module to facilitate short-range communication. For example, the NFC module can be implemented based on radio frequency identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology and other technologies.

[0119] The display includes a screen, which may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, it may be implemented as a touch screen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touches, slides, and gestures on the touch panel. The touch sensors can detect not only the boundaries of a touch or slide action, but also the duration and pressure associated with the touch or slide operation.

[0120] The power supply assembly provides power to various components of the device in which the power supply assembly is located. The power supply assembly may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power to the device in which the power supply assembly is located.

[0121] The above-mentioned audio component can be configured to output and / or input audio signals. For example, the audio component includes a microphone (MIC), and when the device where the audio component is located is in an operating mode, such as call mode, recording mode, and voice recognition mode, the microphone is configured to receive external audio signals. The received audio signal can be further stored in the memory or sent via the communication component. In some embodiments, the audio component also includes a speaker for outputting audio signals.

[0122] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware. Furthermore, the present application may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to magnetic disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0123] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 a process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0124] These computer program instructions may also be stored in a computer readable memory that can direct a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 a process or multiple processes and / or boxes Figure 1 The function specified in one or more boxes.

[0125] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operational steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing the instructions executed on the computer or other programmable device for implementing the process. Figure 1 a process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.

[0126] In a typical configuration, a computing device includes one or more processors (CPUs), input / output interfaces, network interfaces, and memory.

[0127] Memory may include non-permanent storage in a computer-readable medium, in the form of random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM. Memory is an example of a computer-readable medium.

[0128] Computer-readable media includes both permanent and non-permanent, removable and non-removable media that can be implemented using any method or technology to store information. Information can be computer-readable instructions, data structures, program modules, or other data. Examples of computer storage media include, but are not limited to, phase-change RAM (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, compact disc read-only memory (CD-ROM), digital versatile disc (DVD) or other optical storage, magnetic cassettes, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer-readable media does not include transitory computer-readable media such as modulated data signals and carrier waves.

[0129] It should also be noted that the terms "comprises," "includes," or any other variations thereof are intended to encompass non-exclusive inclusion, such that a process, method, commodity, or apparatus that includes a series of elements includes not only those elements but also other elements not explicitly listed, or includes elements inherent to such process, method, commodity, or apparatus. In the absence of further limitations, an element defined by the phrase "comprises a ..." does not exclude the presence of other identical elements in the process, method, commodity, or apparatus that includes the element.

[0130] The above are merely embodiments of the present application and are not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of the present application should all be included within the scope of the claims of the present application.

Claims

1. A BIOS program upgrade method, characterized in that: include: In response to a BIOS program upgrade instruction, obtaining first structure information from a new version of the BIOS program file, the first structure information including at least first address information and first storage capacity of a target storage unit on the BIOS chip, the target storage unit being a storage unit in the BIOS chip configured to store setting information; wherein the first structure information encapsulates layout information of the target storage unit using a plurality of fields; Acquire second structure information from an old version BIOS program file, where the second structure information at least includes second address information and second storage capacity of the target storage unit on the BIOS chip; If the first storage capacity is greater than or equal to the second storage capacity, the setting information is read from the target storage unit on the BIOS chip according to the second address information, and during the upgrade process for the BIOS chip according to the new version of the BIOS program file, the read setting information is rewritten into the BIOS in the target storage unit on the BIOS chip according to the first address information.

2. The method according to claim 1, characterized in that In response to a BIOS program upgrade instruction, obtaining first structure information from a new version BIOS program file includes: In response to a BIOS program upgrade instruction, obtaining first global layout information from the new version BIOS program file, the first global layout information at least including an identifier of each storage unit on the BIOS chip and corresponding structure information; According to the identifier of the target storage unit included in the BIOS upgrade instruction, the structure information corresponding to the target storage unit is obtained from the first global layout information as the first structure information.

3. The method according to claim 2, characterized in that The first global layout information further includes first verification information and basic information, wherein the basic information includes at least one of program version information of the new version BIOS program file and the number of storage units on the BIOS chip; Before obtaining, according to the identifier of the target storage unit included in the BIOS upgrade instruction, the structure information corresponding to the target storage unit from the first global layout information as the first structure information, the method further includes: generating second verification information according to the basic information in the first global layout information and / or the structure information corresponding to the selected storage unit; If the first verification information and the second verification information are the same, a step of obtaining structure information corresponding to the target storage unit from the first global layout information as the first structure information is performed according to the identifier of the target storage unit included in the BIOS upgrade instruction.

4. The method according to claim 2, characterized in that During the upgrade process for the BIOS chip according to the new version BIOS program file, rewriting the read setting information into the target storage unit on the BIOS chip according to the first address information includes: determining a relative positional relationship between the target storage unit and other storage units according to the structure information corresponding to each storage unit included in the first global layout information; Merging the read setting information and the new version BIOS program file according to the relative position relationship to obtain a target file; A clearing operation is performed on the BIOS chip, and the target file is directly written into the cleared BIOS chip to complete the BIOS program upgrade.

5. The method according to claim 4, characterized in that Determining a relative positional relationship between the target storage unit and the other storage units according to the structure information corresponding to each storage unit included in the first global layout information includes: Acquire structural information corresponding to other storage units from the first global layout information, where the structural information corresponding to the other storage units at least includes address information of the other storage units on the BIOS chip; The relative position relationship between the target storage unit and the other storage units is determined according to the first address information and the address information of the other storage units on the BIOS chip.

6. The method according to claim 1, characterized in that Rewriting the read setting information into a target storage unit on the BIOS chip according to the first address information includes: The read setting information is written into a backup file, and the backup file is written into a target storage unit on the BIOS chip according to the first address information.

7. The method according to claim 6, characterized in that In a case where the first storage capacity is greater than the second storage capacity, writing the read setting information into a backup file includes: calculating a capacity difference between the first storage capacity and the second storage capacity; Filling the setting information with filling data matching the capacity difference to obtain filled setting information; The filled setting information is written into the backup file.

8. The method according to claim 7, characterized in that After completing the BIOS upgrade, it also includes: In response to the adding operation of the setting information, the newly added setting information is written into a target area in the BIOS chip, where the target area is a storage space in the target storage unit corresponding to the filling data.

9. The method according to any one of claims 1 to 8, characterized in that Before responding to the BIOS program upgrade instruction, the method further includes: Obtaining the old version BIOS program file, wherein the old version BIOS program file includes an old version source code, and the old version source code includes second global layout information; Based on program upgrade requirements, at least the second global layout information in the old version of the source code is modified to obtain a new version of the source code, and a new version of the BIOS program file is generated according to the new version of the source code.

10. The method according to any one of claims 1 to 8, characterized in that Also includes: If the first storage capacity is smaller than the second storage capacity, a prompt message is output, wherein the prompt message is used to prompt the user to modify the new version BIOS program file with the goal of increasing the storage capacity of the target storage unit.

11. An electronic device, characterized in that: include: memory and processor; The memory is used to store computer programs; The processor is coupled to the memory and configured to execute the computer program to perform the steps of the method according to any one of claims 1 to 10.

12. A computer storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the processor is enabled to implement the steps of the method according to any one of claims 1 to 10.

Citation Information

Patent Citations

  • BIOS upgrading method and device and computer readable storage medium

    CN110377300A

  • Method and system for detecting the validity of and recovering configuration data

    US20040268106A1