BIOS (Basic Input / Output System) burning method and device, equipment and medium

By writing the BIOS file to be upgraded to the BIOS Flash to be upgraded in the updating area of ​​BIOS Flash under the boot state, the data changes caused by forced refresh under the operating system are solved, the device reliability and the security of BIOS burning are improved, and BIOS update is realized Security and efficiency of upgrades.

CN119149071APending Publication Date: 2024-12-17NINGCHANG INFORMATION TECH (HANGZHOU) CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411287201.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-13
Publication Date
2024-12-17

AI Technical Summary

Technical Problem

When the BIOS is forced to refresh under the operating system, it may cause data to change in the Flash area where the BIOS program is located, reducing device reliability.

Method used

By writing the BIOS file to be upgraded to the BIOS to be upgraded in the BIOS Flash under the boot state, avoiding destroying the BIOS data required for the operating system, and updating and upgrading the next time the computer is booted, which is divided into pre-burning and burning. Record the process to ensure data consistency and security.

Benefits of technology

It improves the reliability of the device and the security of BIOS burning, reduces the impact of BIOS updates and upgrades on the device, and ensures the security of the BIOS burning process.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119149071A_ABST
    Figure CN119149071A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a BIOS (Basic Input / Output System) burning method and device, equipment and a medium, which are used for solving the problems of data change in a Flash area where a BIOS program is located and equipment reliability reduction caused by forced refreshing under an operating system in the prior art. In the method, if a burning script is received, a BIOS file to be upgraded is obtained; and writing the to-be-upgraded BIOS file into a to-be-upgraded BIOS area in the BIOS Flash so as to update and upgrade the BIOS based on the first BIOS file stored in the to-be-upgraded BIOS area during next startup. The to-be-upgraded BIOS file is written into the to-be-upgraded BIOS area in the startup state, BIOS data needed in operation of an operating system are not damaged, and the BIOS is updated and upgraded based on the data in the first BIOS file during next startup, so that the influence of updating and upgrading of the BIOS on equipment is reduced, the reliability of the equipment is improved, and the burning safety of the BIOS is guaranteed.
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 Basic Input Output System (BIOS) burning method, device, equipment and medium. Background Art

[0002] With the popularization of cloud computing and big data technology, the number and scale of devices (such as servers) are also increasing. Regular maintenance and upgrades of devices can optimize device performance, improve device stability, and avoid catastrophic problems. Equipment maintenance and upgrades are often accompanied by BIOS updates. This also makes the workload of BIOS burning increasingly large. As the system's boot program, the hardware device system usually has high requirements for its reliability and stability. Once the BIOS program is abnormal, the device system will not be able to boot and use normally. Therefore, the reliability of BIOS updates (i.e. BIOS version refresh) is increasingly valued.

[0003] Since refreshing the BIOS using a refresh tool under the operating system (i.e., in the boot state) is a widely used refresh method, and if the refresh is forced under the operating system, it may cause data changes in the non-volatile random access memory (Flash) area where the BIOS program is located, resulting in reduced device reliability. Summary of the invention

[0004] The embodiments of the present application provide a BIOS burning method, apparatus, device and medium to solve the problem in the prior art that forced refresh under an operating system causes data changes in the Flash area where the BIOS program is located and reduces device reliability.

[0005] In a first aspect, an embodiment of the present application provides a BIOS burning method, which is applied to an electronic device, and the method includes:

[0006] If the burning script is received, the BIOS file to be upgraded is obtained;

[0007] The BIOS file to be upgraded is written into a BIOS upgrade area in a non-volatile random access memory BIOSFlash of a basic input / output system, so that the BIOS is updated and upgraded based on the first BIOS file stored in the BIOS upgrade area when the computer is powered on next time.

[0008] Through the above method, since the BIOS file to be upgraded is written into the BIOS to be upgraded area in the BIOS Flash when the computer is turned on, the BIOS data required for the operation of the operating system will not be destroyed, ensuring that the data stored in the first BIOS file in the BIOS to be upgraded area will not be changed. Therefore, the BIOS is updated and upgraded based on the data in the first BIOS file in the BIOS to be upgraded area when the computer is turned on next time, reducing the impact of BIOS update and upgrade on the device, improving device reliability, and ensuring the safety of BIOS burning.

[0009] In a possible implementation, when the computer is powered on next time, updating the BIOS based on the first BIOS file stored in the BIOS to-be-upgraded area includes:

[0010] If a power-on instruction is received, identifying whether a first BIOS file exists in the BIOS to-be-upgraded area;

[0011] If so, write the first BIOS file into the BIOS area in the BIOS Flash to complete the update and upgrade of the BIOS.

[0012] Through the above method, the BIOS refresh is divided into a pre-burning and a burning process. After the electronic device identifies that there is a first BIOS file in the BIOS to-be-upgraded area, that is, determines that the pre-burning process is completed, it executes a subsequent burning process, that is, completes the subsequent writing of the data in the first BIOS file into the BIOS area, and completes the process of updating and upgrading the BIOS, thereby ensuring the safety of burning and further reducing the impact of BIOS burning on the device.

[0013] In a possible implementation manner, after writing the to-be-upgraded BIOS file into the BIOS to-be-upgraded area in the BIOS Flash, the method further includes:

[0014] Determine whether the data in the first BIOS file stored in the BIOS to-be-upgraded area is consistent with the data in the BIOS file to be upgraded, and if so, determine that the burning execution flag is in a valid state;

[0015] The step of identifying whether there is a first BIOS file in the BIOS to-be-upgraded area includes:

[0016] Identify whether the burning execution flag is in a valid state, and if so, determine whether there is a first BIOS file in the BIOS to-be-upgraded area.

[0017] Through the above method, by judging whether the data in the first BIOS file stored in the BIOS to be upgraded area is consistent with the data in the BIOS file to be upgraded, it is determined whether the pre-burning process is successfully executed and whether there is a new BIOS firmware that needs to be burned. Only after it is determined that the pre-burning is successfully executed can the subsequent burning process be continued, further ensuring the safety of BIOS burning and reducing the impact of BIOS burning on the device.

[0018] In a possible implementation manner, before completing the update and upgrade of the BIOS, the method further includes:

[0019] It is determined whether the data in the second BIOS file stored in the BIOS area is consistent with the data in the first BIOS file. If so, it is determined that the BIOS update is successful.

[0020] Through the above method, after the data in the first BIOS file stored in the BIOS to be upgraded area is written into the BIOS area, it is determined whether the data in the second BIOS file stored in the BIOS area is consistent with the data in the first BIOS file, that is, it is determined whether the data used when updating the BIOS is correct. Only after it is determined that the data used when updating the BIOS is correct, it is determined that the BIOS update is successful, and the subsequent boot process is continued, further reducing the impact of BIOS burning on the device.

[0021] In a possible implementation, after receiving the burning script, the method further includes:

[0022] Shield the power button function, making the shutdown function of the power button invalid;

[0023] After determining that the burning execution flag is in a valid state, the method further includes:

[0024] Restore the power button function.

[0025] Through the above method, after receiving the burning script, before executing the pre-burning process, the power button function is shielded to avoid the problem of BIOS refresh failure caused by using the power button to perform the shutdown operation, further ensuring the safety of BIOS burning and reducing the impact of BIOS burning on the device.

[0026] In a possible implementation manner, before writing the to-be-upgraded BIOS file into the BIOS to-be-upgraded area in the BIOS Flash, the method further includes:

[0027] Enable the write permission of the BIOS Flash through the unlock code;

[0028] After determining that the burning execution flag is in a valid state, the method further includes:

[0029] The write permission of the BIOS Flash is locked based on the encryption key.

[0030] Through the above method, if it is determined that the pre-burning process needs to be executed, the write permission of the BIOS Flash is enabled through the unlock code to ensure that the data in the BIOS file to be upgraded can be written into the BIOS to be upgraded area. When it is determined that the pre-burning process is completed, the write permission of the BIOS Flash can be locked based on the encryption key to ensure that the data in the first BIOS file stored in the BIOS to be upgraded area in the BIOS Flash is not changed, thereby further ensuring the security of BIOS burning and reducing the impact of BIOS burning on the device.

[0031] In a second aspect, the embodiment of the present application further provides a BIOS burning device, which has the function of implementing the behavior of the device in the method embodiment of the first aspect above, and the beneficial effects can be referred to the description of the first aspect and will not be repeated here. The BIOS burning device includes:

[0032] The acquisition module is used to obtain the BIOS file to be upgraded if the burning script is received;

[0033] The pre-burning module is used to write the BIOS file to be upgraded into the BIOS upgrade area in the non-volatile random access memory BIOS Flash of the basic input and output system, so that the BIOS can be updated and upgraded based on the first BIOS file stored in the BIOS upgrade area when the computer is turned on next time.

[0034] In a third aspect, an embodiment of the present application further provides an electronic device, which includes at least a processor and a memory, and the processor is used to implement the steps of the BIOS burning method as described in any one of the above items when executing a computer program stored in the memory.

[0035] In a fourth aspect, an embodiment of the present application further provides a computer-readable storage medium storing a computer program, wherein when the computer program is executed by a processor, the steps of the BIOS burning method as described in any one of the above items are implemented.

[0036] In a fifth aspect, an embodiment of the present application provides a computer program product, which includes: a computer program code, when the computer program code is run on a computer, enables the computer to execute the steps of the BIOS burning method as described in any one of the first aspects. BRIEF DESCRIPTION OF THE DRAWINGS

[0037] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0038] Figure 1 A schematic diagram of a BIOS burning process provided in an embodiment of the present application;

[0039] Figure 2 This is a schematic diagram of the current BIOS Flash structure;

[0040] Figure 3 A schematic diagram of a BIOS Flash partition provided in an embodiment of the present application;

[0041] Figure 4 A schematic diagram of a BIOS pre-burning process provided in an embodiment of the present application;

[0042] Figure 5 A schematic diagram of a BIOS burning process after pre-burning provided in an embodiment of the present application;

[0043] Figure 6 A schematic diagram of an overall BIOS burning process provided in an embodiment of the present application;

[0044] Figure 7 A schematic diagram of the structure of a BIOS burning device provided in an embodiment of the present application;

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

[0046] In order to make the purpose and implementation method of the present application clearer, the exemplary implementation method of the present application will be clearly and completely described below in conjunction with the drawings in the exemplary embodiments of the present application. Obviously, the described exemplary embodiments are only part of the embodiments of the present application, rather than all the embodiments.

[0047] It should be noted that the brief description of terms in this application is only for the convenience of understanding the embodiments described below, and is not intended to limit the embodiments of this application. Unless otherwise specified, these terms should be understood according to their common and usual meanings.

[0048] The terms "first", "second", "third", etc. in the specification and claims of this application and the above drawings are used to distinguish similar or similar objects or entities, and do not necessarily mean to limit a specific order or sequence, unless otherwise noted. It should be understood that the terms used in this way can be interchangeable under appropriate circumstances.

[0049] The terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover but not exclude inclusion, for example, a product or device comprising a list of components is not necessarily limited to all the components expressly listed but may include other components not expressly listed or inherent to such product or device.

[0050] The term "module" refers to any known or later developed hardware, software, firmware, artificial intelligence, fuzzy logic, or combination of hardware and / or software code that is capable of performing the functions associated with that element.

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

[0052] For the convenience of explanation, the above description has been made in conjunction with specific embodiments. However, the above exemplary discussion is not intended to be exhaustive or limit the embodiments to the specific forms disclosed above. Based on the above teachings, various modifications and variations can be obtained. The selection and description of the above embodiments are to better explain the principles and practical applications, so that those skilled in the art can better use the embodiments and various different variations of the embodiments suitable for specific use considerations.

[0053] The embodiment of the present application provides a BIOS burning method, device, equipment and medium. In the method, if a burning script is received, the BIOS file to be upgraded is obtained; the BIOS file to be upgraded is written into the BIOS to be upgraded area in the BIOS Flash, so that the BIOS is updated and upgraded based on the first BIOS file stored in the BIOS to be upgraded area at the next boot. Since the BIOS file to be upgraded is written into the BIOS to be upgraded area in the BIOS Flash, the BIOS data required for the operation of the operating system is not destroyed, ensuring that the data stored in the first BIOS file in the BIOS to be upgraded area will not be changed, and the BIOS is updated and upgraded based on the data in the first BIOS file in the BIOS to be upgraded area at the next boot, reducing the impact of the BIOS update and upgrade on the device, improving the reliability of the device, and ensuring the safety of BIOS burning.

[0054] Embodiment 1:

[0055] Figure 1 A schematic diagram of a BIOS burning process provided in an embodiment of the present application, the process includes:

[0056] S101: If the burning script is received, the BIOS file to be upgraded is obtained.

[0057] The BIOS burning method provided in the embodiment of the present application is applied to an electronic device, which may be a computer (Personal Computer, PC), a server, etc.

[0058] Under the operating system of the electronic device, that is, when the electronic device is powered on and running, if the electronic device receives a burning script, the burning script is executed to control the burning tool to obtain the compiled BIOS file to be upgraded under the operating system. The burning script may be a BIOS Flash burning script. The BIOS file to be upgraded records the code data corresponding to the BIOS version after the next upgrade, so that the current BIOS can be updated based on the BIOS file to be upgraded.

[0059] Among them, the process of obtaining the BIOS file to be upgraded under the operating system is a prior art and will not be repeated here.

[0060] S102: Execute the burning script to write the BIOS file to be upgraded into the BIOS upgrade area in the BIOS Flash, so that the BIOS is updated and upgraded based on the first BIOS file stored in the BIOS upgrade area when the computer is powered on next time.

[0061] The function of the burning script is to update the file to be burned (i.e., the BIOS file to be upgraded) to the BIOS upgrade area. Therefore, in the embodiment of the present application, the electronic device executes the burning script to write the data in the BIOS file to be upgraded to the BIOS upgrade area in the BIOSFlash. After the writing is completed, the file stored in the BIOS upgrade area is called the first BIOS file, and the pre-burning process ends.

[0062] Since the current BIOS Flash only includes the BIOS area, such as Figure 2 As shown, the BIOS area stores the burning code and the BIOS file to be upgraded. During operation, the burning code is executed first and then the BIOS file to be upgraded, so that the burning tool can be controlled to update and upgrade the BIOS based on the BIOS file to be upgraded. However, in this method, in order to update and upgrade the BIOS at the next startup, it is usually necessary to store the BIOS file to be upgraded in the BIOS Flash when the electronic device is powered on. However, since the current BIOS data stored in the BIOS Flash changes when the BIOS upgrade is forced, the service of the electronic device will be affected.

[0063] Therefore, in the embodiment of the present application, in order to prevent the forced BIOS upgrade from affecting the service of the electronic device when the electronic device is powered on, the BIOS Flash is partitioned, a BIOS upgrade area is divided in the BIOS Flash, and the data in the BIOS file to be upgraded is written into the BIOS upgrade area in the BIOS Flash. Figure 3 As shown, in the embodiment of the present application, the BIOS Flash is partitioned. Specifically, the BIOS Flash is divided into a BIOS to be upgraded area, a BIOS area, a Bootloader area, and an extended area, and each area is physically isolated; it can be understood that the functions and effects of each area will be explained in subsequent embodiments and will not be repeated here.

[0064] In the embodiment of the present application, by partitioning the BIOS Flash and storing the BIOS file to be upgraded in the BIOS to be upgraded area, the data currently stored in the BIOS area will not be directly changed, the service of the current electronic device will not be affected, and the reliability of the electronic device will be improved. And when the computer is turned on next time, the electronic device can update and upgrade the BIOS based on the first BIOS file stored in the BIOS to be upgraded area to complete the BIOS burning process. For example, the electronic device can write the first BIOS file stored in the BIOS to be upgraded area to a specified location (such as the BIOS area) to update and upgrade the BIOS.

[0065] In the embodiment of the present application, since the BIOS file to be upgraded is written into the BIOS to be upgraded area in the BIOS Flash, the BIOS data required for the operation of the operating system is not destroyed, thereby ensuring that the data stored in the first BIOS file in the BIOS to be upgraded area will not be changed, and the BIOS is updated and upgraded based on the data in the first BIOS file in the BIOS to be upgraded area at the next startup, thereby reducing the impact of BIOS burning on the device, improving device reliability, ensuring the safety of BIOS burning, and meeting the needs of different operation and maintenance scenarios.

[0066] Embodiment 2:

[0067] In order to further reduce the impact of BIOS burning on the device, based on the above embodiment, in the embodiment of the present application, when the computer is powered on next time, the BIOS is updated based on the first BIOS file stored in the BIOS to be upgraded area, including:

[0068] If a power-on instruction is received, identifying whether a first BIOS file exists in the BIOS to-be-upgraded area;

[0069] If so, write the first BIOS file into the BIOS area in the BIOS Flash to complete the update and upgrade of the BIOS.

[0070] In an embodiment of the present application, if the electronic device receives a power-on command, the electronic device identifies whether there is a first BIOS file in the BIOS to-be-upgraded area in the BIOS Flash, that is, the electronic device determines whether the BIOS pre-burning process is successful and whether a BIOS upgrade is required. The power-on command may be triggered when the user performs a power-on or restart operation.

[0071] If it is identified that there is a first BIOS file in the BIOS to-be-upgraded area, that is, it is determined that the pre-burning of the BIOS is successful, it is determined that there is a new BIOS firmware to be burned, and the BIOS is upgraded based on the first BIOS file.

[0072] In order to upgrade the BIOS, in the embodiment of the present application, Figure 3The Bootloader area in the BIOS Flash shown stores the code of the BIOS burning algorithm of the present application, so when it is determined that a new BIOS firmware needs to be burned, the Bootloader area controls the hardware batch burning tool or the baseboard management controller (Baseboard Management Controller, BMC) during the burning process, reads the first BIOS file stored in the BIOS to be upgraded area, and writes the data in the first BIOS file into the BIOS area in the BIOS Flash. In addition, since the process of writing the BIOS file into the BIOS area is also the process of updating and upgrading the BIOS, after completing the step of writing the first BIOS file into the BIOS area, it is determined that the update and upgrade of the BIOS is completed.

[0073] It can be understood that since the entry address accessed when the BIOS is updated and upgraded is a fixed address, and the fixed address is the address of the BIOS area, if the BIOS is updated and upgraded based on data from other areas, the purpose of modifying the access entry address cannot be achieved through software, and the access address entry can only be modified by modifying the hardware. Therefore, in an embodiment of the present application, in order to reduce the modification of the hardware, the data in the first BIOS file in the BIOS to be upgraded area is written into the BIOS area to update and upgrade the BIOS firmware and complete the BIOS refresh process.

[0074] After the BIOS is updated, the boot process is executed based on the data stored in the BIOS area to complete the boot process.

[0075] In an embodiment of the present application, the BIOS refresh is divided into a pre-burning and a burning process. After the electronic device recognizes that there is a first BIOS file in the BIOS to be upgraded area, that is, determines that the pre-burning process is completed, it executes a subsequent burning process, that is, completes the subsequent writing of the data in the first BIOS file into the BIOS area, and completes the process of updating and upgrading the BIOS, thereby ensuring the safety of burning and further reducing the impact of BIOS burning on the device.

[0076] Embodiment 3:

[0077] In order to further ensure the safety of BIOS burning, on the basis of the above embodiments, in the embodiment of the present application, after writing the BIOS file to be upgraded into the BIOS to-be-upgraded area in the BIOS Flash, the method further includes:

[0078] Determine whether the data in the first BIOS file stored in the BIOS to-be-upgraded area is consistent with the data in the BIOS file to be upgraded, and if so, determine that the burning execution flag is in a valid state;

[0079] The step of identifying whether there is a first BIOS file in the BIOS to-be-upgraded area includes:

[0080] Identify whether the burning execution flag is in a valid state, and if so, determine whether there is a first BIOS file in the BIOS to-be-upgraded area.

[0081] In an embodiment of the present application, after the data in the BIOS file to be upgraded is written into the BIOS to be upgraded area and the first BIOS file stored in the BIOS to be upgraded area is obtained, the electronic device determines whether the data in the first BIOS file stored in the BIOS to be upgraded area is consistent with the data in the BIOS file to be upgraded. If so, it is determined that the pre-burning is successful, and in order to facilitate the subsequent smooth start of the burning process, in an embodiment of the present application, the state of the burning execution flag stored in the extended area is determined to be a valid state.

[0082] If the data in the first BIOS file stored in the BIOS to be upgraded area is inconsistent with the data in the BIOS to be upgraded area, it is determined that the writing of the BIOS to be upgraded area has failed, the number of writing failures in the BIOS to be upgraded area is counted and recorded, and the steps of writing the data in the BIOS to be upgraded to the BIOS to be upgraded area and judging whether the data in the first BIOS file stored in the BIOS to be upgraded area is consistent with the data in the BIOS to be upgraded are repeated, until it is determined that the pre-burning is successful, or it is determined that the number of writing failures in the BIOS to be upgraded area is greater than a preset number, which can be, for example, 3 times, 5 times, etc., and can be flexibly set as needed.

[0083] For example, the preset number of times is set to 3 times. If it is determined that the number of write failures in the BIOS upgrade area is greater than 3 times, the pre-burning execution is determined to have failed. Since the subsequent burning process cannot be continued after the pre-burning execution fails, the BMC is notified to record the BIOS burning failure and feedback the burning failure report on the operating system interface, so that the user can print the burning failure report. At the same time, the state of the burning execution flag bit stored in the extended area is determined to be invalid.

[0084] During the burning process, when the electronic device receives a power-on command, it reads the status of the burning execution flag in the extended area and identifies whether the burning execution flag is in a valid state. If so, it determines that there is a first BIOS file in the BIOS to be upgraded area, and continues to execute the subsequent steps of reading the first BIOS file in the BIOS to be upgraded area and writing the data in the first BIOS file into the BIOS area.

[0085] If the burning execution flag is identified as invalid, it is determined that the first BIOS file does not exist in the BIOS to be upgraded area and no new BIOS firmware needs to be burned, so the burning process is skipped. Since the data in the BIOS area has not been changed at this time, the data in the BIOS area can be used to complete the boot process.

[0086] In an embodiment of the present application, by judging whether the data in the first BIOS file stored in the BIOS to be upgraded area is consistent with the data in the BIOS file to be upgraded, it is determined whether the pre-burning process is successfully executed and whether there is a new BIOS firmware that needs to be burned. Only after it is determined that the pre-burning is successfully executed can the subsequent burning process be continued, thereby further ensuring the safety of BIOS burning and reducing the impact of BIOS burning on the device.

[0087] Embodiment 4:

[0088] In order to further reduce the impact of BIOS burning on the device, based on the above embodiments, in the embodiment of the present application, before completing the update and upgrade of the BIOS, the method further includes:

[0089] It is determined whether the data in the second BIOS file stored in the BIOS area is consistent with the data in the first BIOS file. If so, it is determined that the BIOS update is successful.

[0090] When writing the data in the first BIOS file stored in the BIOS to be upgraded area into the BIOS area, because it is uncertain whether the file stored in the BIOS area after writing is consistent with the first BIOS file, in the embodiment of the present application, the file stored in the BIOS area after writing is called the second BIOS file. The electronic device determines whether the data in the second BIOS file stored in the BIOS area is consistent with the data in the first BIOS file. If so, it is determined that the data used when updating the BIOS is correct, and the subsequent boot process is executed.

[0091] It can be understood that after the BIOS is updated based on the data in the second BIOS file stored in the BIOS area, the state of the burning execution flag in the extended area is changed from a valid state to an invalid state.

[0092] If the data in the second BIOS area file stored in the BIOS area is inconsistent with the data in the first BIOS file, it is determined that the writing of this BIOS area has failed, the number of BIOS area writing failures is counted and recorded, and the steps of writing the data in the first BIOS file stored in the BIOS to be upgraded area to the BIOS area and judging whether the data in the second BIOS file stored in the BIOS area is consistent with the data in the first BIOS file are repeated, until it is determined that the data used when updating the BIOS is correct, or it is determined that the number of BIOS area writing failures is greater than a preset number, which can be, for example, 3 times, 5 times, etc., and can be flexibly set as needed.

[0093] For example, the preset number of times is set to 3 times. If it is determined that the number of BIOS area write failures is greater than 3 times, the burning execution is determined to have failed, and the BMC is notified to record the BIOS burning failure. At the same time, the state of the burning execution flag bit in the extended area is changed from a valid state to an invalid state.

[0094] In a possible implementation, if it is determined that the BIOS burning fails, in order to reduce the impact of the BIOS burning failure on the device, the booting operation of the device may be suspended.

[0095] In an embodiment of the present application, after the data in the first BIOS file stored in the BIOS to be upgraded area is written into the BIOS area, it is determined whether the data in the second BIOS file stored in the BIOS area is consistent with the data in the first BIOS file, that is, it is determined whether the data used when updating the BIOS is correct. Only after it is determined that the data used when updating the BIOS is correct, it is determined that the BIOS update is successful, and the subsequent boot process is continued, further reducing the impact of BIOS burning on the device.

[0096] Embodiment 5:

[0097] In order to further ensure the security of BIOS burning, on the basis of the above embodiments, in the embodiment of the present application, after receiving the burning script, the method further includes:

[0098] Shield the power button function, making the shutdown function of the power button invalid;

[0099] After determining that the burning execution flag is in a valid state, the method further includes:

[0100] Restore the power button function.

[0101] In an embodiment of the present application, after receiving the burning script, the electronic device blocks the power button function before executing the pre-burning process. Since the current electronic device is in a running state, that is, the current electronic device is in a turned-on state, after blocking the power button function, the shutdown function of the power button will be invalid, that is, the power button cannot be used to perform a shutdown operation, thereby avoiding the problem of BIOS refresh failure due to using the power button to perform a shutdown operation.

[0102] After determining that the burn execution flag is in a valid state, the burn result returned in the burn script is usually recognized, and the pre-burn process is determined to be completed. After determining that the pre-burn process is completed, using the power button to perform a shutdown operation will not cause the BIOS refresh to fail, so the electronic device restores the power button function.

[0103] In an embodiment of the present application, after receiving the burning script, before executing the pre-burning process, the power button function is shielded to avoid the problem of BIOS refresh failure due to using the power button to perform a shutdown operation, further ensuring the safety of BIOS burning and reducing the impact of BIOS burning on the device.

[0104] Embodiment 6:

[0105] In order to further ensure the safety of BIOS burning, on the basis of the above embodiments, in the embodiment of the present application, before writing the BIOS file to be upgraded into the BIOS to-be-upgraded area in the BIOS Flash, the method further includes:

[0106] Enable the write permission of the BIOS Flash through the unlock code;

[0107] After determining that the burning execution flag is in a valid state, the method further includes:

[0108] The write permission of the BIOS Flash is locked based on the encryption key.

[0109] In the embodiment of the present application, in order to ensure that the data stored in the BIOS Flash does not change, the write permission of the BIOS Flash is usually controlled to be in a locked state, that is, under normal circumstances, it is impossible to directly perform a write operation on the BIOS Flash.

[0110] Therefore, upon receiving the burning script, it is determined that the pre-burning process needs to be performed at this time, and before the BIOS file to be upgraded is written into the BIOS to be upgraded area in the BIOS Flash, an unlock code is written, and the write permission of the BIOS Flash is enabled by the unlock code to ensure that the BIOS file to be upgraded can be written into the BIOS to be upgraded area in the BIOS Flash.

[0111] The unlock code may be preset and agreed upon with the BIOS Flash, and is not specifically limited here.

[0112] In addition, in order to ensure the security of data in the BIOS Flash, if it is determined that the burning execution flag is in a valid state, that is, it is determined that the pre-burning process is completed, before the power button function is restored, a preset encryption key is obtained, and the write permission of the BIOS Flash is locked based on the encryption key. Since the BIOS to be upgraded area of ​​the BIOS Flash is only used to store the BIOS file to be upgraded, and the write permission of the BIOS to be upgraded area is locked, after the BIOS file to be upgraded is written into the BIOS to be upgraded area, if the write permission of the BIOS to be upgraded area is not unlocked, it will not involve the modification of the data in the BIOS to be upgraded area. Therefore, by writing the BIOS file to be upgraded into the BIOS to be upgraded area of ​​the BIOS Flash, it can be ensured that the data stored in the first BIOS file in the BIOS to be upgraded area will not be changed.

[0113] In an embodiment of the present application, if it is determined that the pre-burning process needs to be executed, the write permission of the BIOS Flash is enabled through an unlock code to ensure that the data in the BIOS file to be upgraded can be written into the BIOS to be upgraded area. When it is determined that the pre-burning process is completed, the write permission of the BIOS Flash can be locked based on the encryption key to ensure that the data in the first BIOS file stored in the BIOS to be upgraded area in the BIOS Flash is not changed, thereby further ensuring the security of BIOS burning and reducing the impact of BIOS burning on the device.

[0114] Embodiment 7:

[0115] Based on the above embodiments, the present application embodiment provides a schematic diagram of a BIOS pre-burning process, such as Figure 4 As shown, the process includes:

[0116] Step 1: Receive the burning script, obtain the BIOS file to be upgraded, shield the power button function, and disable the shutdown function of the power button.

[0117] Step 2: Write the decoding lock and use the decoding lock to enable the write permission of BIOS Flash.

[0118] Step three, writing the to-be-upgraded BIOS file into the BIOS to-be-upgraded area, and obtaining the first BIOS file stored in the BIOS to-be-upgraded area after the writing is completed.

[0119] Step 4, determining whether the data in the first BIOS file stored in the BIOS to-be-upgraded area is consistent with the data in the BIOS file to be upgraded, if so, executing step 5, if not, executing step 6.

[0120] Step 5: determine the state of the burn execution flag in the extended area as a valid state, and execute step 9.

[0121] Step 6: Determine that the writing of the BIOS to-be-upgraded area has failed, count and record the number of times the writing of the BIOS to-be-upgraded area has failed, and execute step 7.

[0122] Step 7, determine whether the number of write failures in the BIOS to-be-upgraded area is greater than three times, if so, execute step 8, if not, execute step 3.

[0123] Step eight, determining the state of the burn execution flag bit in the extended area as an invalid state, notifying the BMC to record the BIOS burn failure, feeding back a burn failure report on the operating system interface, and executing step nine.

[0124] Step 9: Lock the write permission of BIOS Flash based on the encryption key and restore the power button function.

[0125] Based on the above embodiments, the present application embodiment provides a schematic diagram of a BIOS burning process after pre-burning, such as Figure 5 As shown, the process includes:

[0126] Step 1: Receive a power-on command.

[0127] Step 2: Read the burn execution flag in the extended area.

[0128] Step 3, determine whether the burning execution flag is in a valid state, if so, execute step 4, if not, execute step 11.

[0129] Step 4: read the first BIOS file stored in the BIOS to-be-upgraded area, write the data in the first BIOS file into the BIOS area, obtain the second BIOS file stored in the BIOS area after the writing is completed, and execute step 5.

[0130] It is understandable that after identifying that the burn execution flag is in a valid state, before writing the data in the first BIOS file into the BIOS area, the write permission of the BIOS Flash is unlocked by the unlock code. And after writing the data in the first BIOS file into the BIOS area, the write permission of the BIOS Flash is locked based on the encryption key.

[0131] Step 5, determining whether the data in the second BIOS file stored in the BIOS area is consistent with the data in the first BIOS file, if so, executing step 6, if not, executing step 7.

[0132] Step 6: Confirm that the BIOS burning is complete and proceed to step 10.

[0133] The completion of BIOS burning is determined, that is, the completion of BIOS updating and upgrading is determined.

[0134] Step 7: Determine that the current BIOS area write fails, count and record the number of BIOS area write failures, and proceed to step 8.

[0135] Step 8, determine whether the number of BIOS area write failures is greater than three times, if so, execute step 9, if not, execute step 4.

[0136] Step 9: Notify the BMC to record the BIOS burning failure and proceed to step 10.

[0137] Step ten, modify the burn execution flag in the extended area from a valid state to an invalid state, and execute step eleven.

[0138] Step 11, continue the boot process and complete the boot operation.

[0139] The electronic device performs a boot operation based on the data currently stored in the BIOS area.

[0140] Based on the above embodiments, the present application embodiment provides a schematic diagram of an overall BIOS burning process, such as Figure 6 As shown, the process includes:

[0141] Step 1: Receive the burning script, obtain the BIOS file to be upgraded, shield the power button function, and disable the shutdown function of the power button.

[0142] Step 2: Write the decoding lock and use the decoding lock to enable the write permission of BIOS Flash.

[0143] Step three, writing the to-be-upgraded BIOS file into the BIOS to-be-upgraded area, and obtaining the first BIOS file stored in the BIOS to-be-upgraded area after the writing is completed.

[0144] Step 4, determining whether the data in the first BIOS file stored in the BIOS to-be-upgraded area is consistent with the data in the BIOS file to be upgraded, if so, executing step 5, if not, executing step 6.

[0145] Step 5: determine the state of the burn execution flag in the extended area as a valid state, and execute step 9.

[0146] Step 6: Determine that the writing of the BIOS to-be-upgraded area has failed, count and record the number of times the writing of the BIOS to-be-upgraded area has failed, and execute step 7.

[0147] Step 7, determine whether the number of write failures in the BIOS to-be-upgraded area is greater than three times, if so, execute step 8, if not, execute step 3.

[0148] Step eight, determining the state of the burn execution flag bit in the extended area as an invalid state, notifying the BMC to record the BIOS burn failure, feeding back a burn failure report on the operating system interface, and executing step nine.

[0149] Step 9: Lock the write permission of BIOS Flash based on the encryption key and restore the power button function.

[0150] Step 10: receiving the power-on command.

[0151] Step 11: read the burn execution flag bit in the extended area.

[0152] Step 12, determine whether the burning execution flag is in a valid state, if so, execute step 13, if not, execute step 20.

[0153] Step thirteen, read the first BIOS file stored in the BIOS to-be-upgraded area, write the data in the first BIOS file into the BIOS area, obtain the second BIOS file stored in the BIOS area after the writing is completed, and execute step fourteen.

[0154] It is understandable that after identifying that the burn execution flag is in a valid state, before writing the data in the first BIOS file into the BIOS area, the write permission of the BIOS Flash is unlocked by the unlock code. And after writing the data in the first BIOS file into the BIOS area, the write permission of the BIOS Flash is locked based on the encryption key.

[0155] Step 14, determining whether the data in the second BIOS file stored in the BIOS area is consistent with the data in the first BIOS file, if so, executing step 15, if not, executing step 16.

[0156] Step 15: confirm that the BIOS burning is complete and proceed to step 19.

[0157] The completion of BIOS burning is determined, that is, the completion of BIOS updating and upgrading is determined.

[0158] Step 16: Determine that the current BIOS area write fails, count and record the number of BIOS area write failures, and execute step 17.

[0159] Step 17, determine whether the number of BIOS area write failures is greater than three times, if so, execute step 18, if not, execute step 13.

[0160] Step 18: Notify the BMC to record the BIOS burning failure and execute step 19.

[0161] Step 19: Change the burn execution flag in the extended area from a valid state to an invalid state, and execute step 20.

[0162] Step 20, continue the boot process and complete the boot operation.

[0163] Embodiment 8:

[0164] Based on the same technical concept, on the basis of the above embodiments, the present application provides a BIOS burning device. Figure 7 A schematic diagram of the structure of a BIOS burning device provided in an embodiment of the present application is shown in FIG. Figure 7 As shown, the device comprises:

[0165] The acquisition module 701 is used to acquire the BIOS file to be upgraded if the burning script is received;

[0166] The pre-burning module 702 is used to write the BIOS file to be upgraded into the BIOS upgrade area in the non-volatile random access memory BIOS Flash of the basic input and output system, so that the BIOS can be updated based on the first BIOS file stored in the BIOS upgrade area when the computer is turned on next time.

[0167] In a possible implementation, the BIOS burning device further includes a burning module;

[0168] The burning module 703 is used to identify whether there is a first BIOS file in the BIOS to-be-upgraded area if a power-on instruction is received; if so, write the first BIOS file into the BIOS area in the BIOS Flash to complete the update and upgrade of the BIOS.

[0169] In a possible implementation manner, the pre-burning module 702 is further configured to, after writing the BIOS file to be upgraded into the BIOS to be upgraded area in the BIOS Flash, determine whether the data in the first BIOS file stored in the BIOS to be upgraded area is consistent with the data in the BIOS file to be upgraded, and if so, determine that the burning execution flag is in a valid state;

[0170] The burning module 703 is specifically used to identify whether the burning execution flag is in a valid state, and if so, determine whether there is a first BIOS file in the BIOS to-be-upgraded area.

[0171] In a possible implementation, the burning module 703 is also used to determine whether the data in the second BIOS file stored in the BIOS area is consistent with the data in the first BIOS file before updating and upgrading the BIOS based on the data in the second BIOS file stored in the BIOS area. If so, it is determined that the BIOS update and upgrade is successful.

[0172] In a possible implementation, the pre-burning module 702 is further configured to shield the power button function after receiving the burning script, so that the shutdown function of the power button is invalid; and restore the power button function after determining that the burning execution flag is in a valid state.

[0173] In a possible implementation, the pre-burning module 702 is also used to enable the write permission of the BIOS Flash through an unlock code before writing the BIOS file to be upgraded into the BIOS to be upgraded area in the BIOS Flash; after determining that the burning execution flag is in a valid state, the write permission of the BIOS Flash is locked based on an encryption key.

[0174] Embodiment 9:

[0175] Based on the same technical concept, the present application also provides an electronic device, Figure 8 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application is shown in FIG. Figure 8 As shown, it includes: a processor 801, a communication interface 802, a memory 803 and a communication bus 804, wherein the processor 801, the communication interface 802, and the memory 803 communicate with each other through the communication bus 804;

[0176] The memory 803 stores a computer program. When the program is executed by the processor 801, the processor 801 performs the following steps:

[0177] If the burning script is received, the BIOS file to be upgraded is obtained;

[0178] The BIOS file to be upgraded is written into a BIOS upgrade area in a non-volatile random access memory BIOSFlash of a basic input / output system, so that the BIOS is updated and upgraded based on the first BIOS file stored in the BIOS upgrade area when the computer is powered on next time.

[0179] In a possible implementation, the processor 801 is specifically configured to, if a power-on instruction is received, identify whether a first BIOS file exists in the BIOS to-be-upgraded area; if so, write the first BIOS file into the BIOS area in the BIOSFlash to complete the update of the BIOS.

[0180] In a possible implementation, the processor 801 is further configured to, after writing the BIOS file to be upgraded into the BIOS to be upgraded area in the BIOS Flash, determine whether the data in the first BIOS file stored in the BIOS to be upgraded area is consistent with the data in the BIOS file to be upgraded, and if so, determine that the burning execution flag is in a valid state;

[0181] The processor 801 is specifically configured to identify whether the burn execution flag is in a valid state, and if so, determine whether there is a first BIOS file in the BIOS to-be-upgraded area.

[0182] In a possible implementation, the processor 801 is also used to determine whether the data in the second BIOS file stored in the BIOS area is consistent with the data in the first BIOS file before updating or upgrading the BIOS based on the data in the second BIOS file stored in the BIOS area. If so, it is determined that the BIOS update or upgrade is successful.

[0183] In a possible implementation, the processor 801 is further configured to, after receiving the burning script, shield the power button function to disable the shutdown function of the power button; and restore the power button function after determining that the burning execution flag is in a valid state.

[0184] In a possible implementation, the processor 801 is also used to enable the write permission of the BIOS Flash through an unlock code before writing the BIOS file to be upgraded into the BIOS to be upgraded area in the BIOS Flash; after determining that the burning execution flag is in a valid state, the write permission of the BIOS Flash is locked based on the encryption key.

[0185] The communication bus mentioned in the above electronic device can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The communication bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus.

[0186] The communication interface 802 is used for communication between the above electronic device and other devices.

[0187] The memory may include a random access memory (RAM) or a non-volatile memory (NVM), such as at least one disk memory. Optionally, the memory may also be at least one storage device located away from the aforementioned processor.

[0188] The above-mentioned processor can be a general-purpose processor, including a central processing unit, a network processor (Network Processor, NP), etc.; it can also be a digital signal processing processor (Digital Signal Processing, DSP), an application-specific integrated circuit, a field programmable gate array or other programmable logic device, a discrete gate or transistor logic device, a discrete hardware component, etc.

[0189] Embodiment 10:

[0190] Based on the same technical concept, an embodiment of the present application provides a computer-readable storage medium, which stores a computer program that can be executed by an electronic device. When the program runs on the electronic device, the electronic device implements any of the above embodiments when executing.

[0191] The above-mentioned computer-readable storage medium can be any available medium or data storage device that can be accessed by the processor in the electronic device, including but not limited to magnetic storage such as floppy disks, hard disks, magnetic tapes, magneto-optical disks (MO), etc., optical storage such as CD, DVD, BD, HVD, etc., and semiconductor storage such as ROM, EPROM, EEPROM, non-volatile memory (NANDFLASH), solid-state drive (SSD), etc.

[0192] Based on the same technical concept, the embodiment of the present application also provides a computer program product, which includes: computer program code, when the computer program code is run on a computer, the computer executes any of the above embodiments. Since the principle of solving the problem by the above computer program product is similar to that of the BIOS burning method, the implementation of the above computer program product can refer to the implementation of the method, and the repeated parts will not be repeated.

[0193] 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 adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.

[0194] 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 present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes 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.

[0195] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate 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 A function specified in one or more boxes.

[0196] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps of the functions specified in one or more boxes. Obviously, those skilled in the art can make various changes and modifications to the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is also intended to include these modifications and variations.

Claims

1. A method for burning a basic input / output system BIOS, characterized in that: The method comprises: If the burning script is received, the BIOS file to be upgraded is obtained; The BIOS file to be upgraded is written into a BIOS upgrade area in a non-volatile random access memory BIOS Flash of a basic input / output system, so that the BIOS is updated and upgraded based on the first BIOS file stored in the BIOS upgrade area when the computer is powered on next time.

2. The method according to claim 1, characterized in that The method of updating the BIOS based on the first BIOS file stored in the BIOS to-be-upgraded area at the next startup includes: If a power-on instruction is received, identifying whether a first BIOS file exists in the BIOS to-be-upgraded area; If so, write the first BIOS file into the BIOS area in the BIOS Flash to complete the update and upgrade of the BIOS.

3. The method according to claim 2, characterized in that After writing the to-be-upgraded BIOS file into the BIOS to-be-upgraded area in the BIOSFlash, the method further comprises: Determine whether the data in the first BIOS file stored in the BIOS to-be-upgraded area is consistent with the data in the BIOS file to be upgraded, and if so, determine that the burning execution flag is in a valid state; The step of identifying whether there is a first BIOS file in the BIOS to-be-upgraded area includes: Identify whether the burning execution flag is in a valid state, and if so, determine whether there is a first BIOS file in the BIOS to-be-upgraded area.

4. The method according to claim 2, characterized in that: Before completing the update and upgrade of the BIOS, the method further includes: It is determined whether the data in the second BIOS file stored in the BIOS area is consistent with the data in the first BIOS file. If so, it is determined that the BIOS update is successful.

5. The method according to claim 3, characterized in that: After receiving the burning script, the method further includes: Shield the power button function, making the shutdown function of the power button invalid; After determining that the burning execution flag is in a valid state, the method further includes: Restore the power button function.

6. The method according to claim 1, characterized in that Before writing the BIOS file to be upgraded into the BIOS to-be-upgraded area in the BIOS Flash, the method further comprises: Enable the write permission of the BIOS Flash through the unlock code; After determining that the burning execution flag is in a valid state, the method further includes: The write permission of the BIOS Flash is locked based on the encryption key.

7. A BIOS burning device, characterized in that: The device comprises: The acquisition module is used to obtain the BIOS file to be upgraded if the burning script is received; The pre-burning module is used to write the BIOS file to be upgraded into the BIOS upgrade area in the non-volatile random access memory BIOS Flash of the basic input and output system, so that the BIOS can be updated and upgraded based on the first BIOS file stored in the BIOS upgrade area when the computer is turned on next time.

8. The device according to claim 7, characterized in that The device also includes a burning module; The burning module is used to identify whether there is a first BIOS file in the BIOS to-be-upgraded area if a power-on instruction is received; if so, write the first BIOS file into the BIOS area in the BIOS Flash to complete the update and upgrade of the BIOS.

9. An electronic device, characterized in that: The electronic device comprises at least a processor and a memory, and the processor is used to implement the steps of the BIOS burning method according to any one of claims 1 to 6 when executing a computer program stored in the memory.

10. A computer storage medium, characterized in that: It stores a computer program executable by an electronic device. When the program runs on the electronic device, the electronic device executes the steps of the BIOS burning method according to any one of claims 1 to 6.