Brushing method and device for basic input and output system and medium
By adding module version information to the BIOS image file, determining the target program modules that need to be updated, and only performing some modules to flash, the problem of inefficient flash in the existing technology is solved, and a more efficient BIOS ROM flash is achieved.
Patent Information
- Application Number
- CN202411744928.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-29
- Publication Date
- 2025-03-14
AI Technical Summary
The existing technology adopts a solution of flashing the entire block when flashing the BIOS ROM, resulting in low flushing efficiency, especially when there are not much changes in the update of the BIOS firmware version.
By obtaining and parsing the basic input and output system image files, determine the target program modules that need to be updated based on the module version information, and only these target program modules are flushed into the BIOS ROM.
It improves the efficiency of BIOS ROM flashing and shortens the flashing time, especially in scenarios where the BIOS firmware version updates are not much changed.
Smart Images

Figure CN119621084A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of servers, and in particular to a basic input / output system flashing method, device and medium. Background Art
[0002] In the actual use scenarios of servers, computers and other devices, the Basic Input Output System (BIOS) is one of the most important programs. BIOS is generally fixed in a read-only memory (ROM) on the motherboard, and plays a vital role in the operation and use of the device. In order to adapt to the ever-changing application requirements, there is a need for version iteration of BIOS ROM. At this time, the new version of the BIOS file needs to be flashed to the BIOS ROM. At present, when refreshing the BIOS ROM, each manufacturer refreshes the entire BIOS ROM.
[0003] However, in the process of product development, it is not uncommon to modify only a few or a dozen modules among the hundreds of modules contained in the BIOS ROM when iterating the BIOS version. Especially after the product is mass-produced or shipped to the customer's room, some serious problems need to be fixed, and the changes may only involve a few modules. At this time, if the entire BIOS ROM is refreshed, the flashing efficiency will be greatly reduced.
[0004] Therefore, technicians in this field are in urgent need of a basic input and output system flashing method to solve the problem of low flashing efficiency caused by the current solution of flashing the entire block when flashing the BIOS ROM. Summary of the invention
[0005] The object of the present invention is to provide a basic input and output system flashing method, device and medium, which are used to solve the problem of low flashing efficiency caused by the current solution of flashing the entire block when flashing the BIOS ROM.
[0006] In order to solve the above technical problems, the present invention provides a basic input and output system flashing method, comprising:
[0007] Acquire and parse a basic input / output system image file; wherein the basic input / output system image file includes: a plurality of program modules and module version information corresponding to each of the program modules;
[0008] Determine a target program module that needs to be updated in each of the program modules according to the module version information;
[0009] The target program module is flashed into the basic input and output system read-only memory by a flashing tool.
[0010] In a possible embodiment, the compilation process of the basic input / output system image file includes:
[0011] After the compilation of each of the program modules is completed and there is no error in the compilation, the corresponding module version information is obtained from the source code root directory of each of the program modules; and the globally unique identifier corresponding to each of the program modules is obtained; wherein the module version information is binary data;
[0012] Convert the globally unique identifier corresponding to each of the program modules into binary data;
[0013] Integrate the module version information and the globally unique identifier corresponding to each of the program modules and remove redundant characters, and compile to obtain a module version binary file;
[0014] The program modules and the module version binary files are packaged to obtain the basic input and output system image file.
[0015] In a possible embodiment, determining a target program module that needs to be updated in each of the program modules according to the module version information includes:
[0016] Acquire and parse the basic input and output system firmware file stored in the basic input and output system read-only memory;
[0017] If the module version information corresponding to each of the program modules does not exist in the basic input / output system firmware file, determining that all of the program modules in the basic input / output system image file are the target program modules;
[0018] If the module version information corresponding to each of the program modules exists in the BIOS firmware file, determining the corresponding relationship between the BIOS firmware file and each of the program modules in the BIOS image file according to the globally unique identifier;
[0019] Taking the two corresponding program modules in the BIOS firmware file and the BIOS image file as a group, and comparing whether the module version information respectively corresponding to each group of program modules is the same;
[0020] The program module in the basic input / output system image file, whose corresponding module version information is different from that of the program modules in the same group, is determined as the target program module.
[0021] In a possible embodiment, after determining the program module in the basic input / output system image file whose corresponding module version information is different from that of the program modules in the same group as the target program module, the method further includes:
[0022] If the ratio of the number of the target program modules to the number of all the program modules in the BIOS firmware file exceeds a preset percentage threshold, all the program modules in the BIOS firmware file are determined to be new target program modules.
[0023] In a possible embodiment, after the module version information and the globally unique identifier corresponding to each program module are integrated and redundant characters are removed to compile and obtain a module version binary file, the method further includes:
[0024] Counting the size of the module version binary file to obtain file size information; counting the number of program modules to obtain module number information;
[0025] The file size information and the module number information are added to the header of the module version binary file to obtain a new module version binary file.
[0026] In a possible embodiment, when the target program module is not all the program modules in the basic input / output system firmware file, the method further includes:
[0027] Add a preset string to the update progress interface; wherein the preset string is used to indicate that this flash is a quick update different from a full update;
[0028] The percentage of the progress bar is determined according to the number of the target program modules that have been flashed and the total number of the target program modules, and is displayed in the update progress interface.
[0029] In a possible embodiment, when the flash writing tool is a baseboard management controller refresh program, before flashing the target program module to the basic input and output system read-only memory by the flash writing tool, it also includes:
[0030] Switching the access control authority of the basic input and output system read-only memory to the baseboard management controller serial peripheral interface controller through the baseboard management controller;
[0031] After the target program module is flashed into the basic input and output system read-only memory by a flashing tool, the method further includes:
[0032] The access control authority of the basic input and output system read-only memory is switched back to the central processing unit serial peripheral interface controller through the baseboard management controller.
[0033] In order to solve the above technical problems, the present invention also provides a basic input and output system flashing device, comprising:
[0034] An image acquisition module, used to acquire and parse a basic input / output system image file; wherein the basic input / output system image file includes: a plurality of program modules and module version information corresponding to each of the program modules;
[0035] An update determination module, used to determine a target program module that needs to be updated among the program modules according to the module version information;
[0036] The firmware flashing module is used to flash the target program module into the basic input and output system read-only memory through a flashing tool.
[0037] In order to solve the above technical problems, the present invention also provides a basic input and output system flashing device, comprising:
[0038] Memory for storing computer programs;
[0039] The processor is used to implement the steps of the basic input and output system flashing method as described above when executing the computer program.
[0040] In order to solve the above technical problem, the present invention also provides a non-volatile storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the steps of the basic input and output system flashing method as described above are implemented.
[0041] The present invention provides a basic input and output system flashing method, which adds corresponding module version information for each program module in the BIOS firmware during the compilation process of the BIOS image file; then in the formal BIOS ROM flashing process, the program modules in the BIOS image file with version updates (i.e., changes) can be determined according to the module version information, and used as the target program modules that need to be flashed into the BIOS ROM during this flashing process; based on this, when the BIOS firmware is flashed into the BIOS ROM through the flashing tool, only part of the program modules with version updates can be updated into the BIOS ROM, and the remaining program modules that have not been updated do not need to be flashed; thereby shortening the time required for implementing the BIOS ROM flashing, greatly improving the efficiency of the BIOS ROM flashing, and showing more obvious advantages in the scenario where the BIOS firmware version update does not change much.
[0042] The basic input / output system flashing device and non-volatile storage medium provided by the present invention correspond to the above method and have the same effects as above. BRIEF DESCRIPTION OF THE DRAWINGS
[0043] In order to more clearly illustrate the embodiments of the present invention, the following briefly introduces the drawings required for use in the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0044] Figure 1 A flowchart of a basic input and output system flashing method provided by an embodiment of the present invention;
[0045] Figure 2 A schematic diagram of an architecture for flashing BIOS on a BMC WEB terminal provided by an embodiment of the present invention;
[0046] Figure 3 A structural diagram of a basic input / output system flashing device provided by an embodiment of the present invention;
[0047] Figure 4 A structural diagram of another basic input / output system flashing device provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0048] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0049] The core of the present invention is to provide a basic input and output system flashing method, device and medium.
[0050] In order to enable those skilled in the art to better understand the solution of the present invention, the present invention is further described in detail below in conjunction with the accompanying drawings and specific implementation methods.
[0051] Currently, when flashing the Basic Input Output System (BIOS) firmware, the read-only memory (ROM) storing the BIOS firmware is usually flashed as a whole block. That is, for a BIOS ROM that may contain hundreds of program modules, all program modules need to be flashed each time.
[0052] This flashing solution does not have any obvious problems when the BIOS firmware undergoes major changes. However, it is not difficult to understand that in actual application scenarios, not every BIOS firmware update is a major update. Even in each iteration of the BIOS version, more often only a small number of program modules are changed in the BIOS firmware. For example, when some serious problems need to be fixed after the equipment is mass-produced or shipped to the customer's room, only a few program modules in the BIOS may need to be changed. However, a BIOS ROM may contain hundreds of modules. If you choose to refresh all of the BIOS ROMs at this time, it will cause a lot of unnecessary waste of resources and time.
[0053] Based on this, in order to solve the above problems, the present invention provides a basic input and output system flashing method, such as Figure 1 As shown, including:
[0054] S11: Obtain and parse the basic input and output system image file.
[0055] The basic input / output system image file includes: a plurality of program modules and module version information corresponding to each program module.
[0056] S12: Determine the target program module that needs to be updated among the program modules according to the module version information.
[0057] S13: flashing the target program module into the basic input and output system read-only memory through a flashing tool.
[0058] First, in step S11, the BIOS image file mentioned therein is the BIOS firmware that needs to be flashed into the BIOS ROM during this BIOS ROM flashing process. For the BIOS image file in the embodiment of the present invention, in particular, the BIOS image file includes not only multiple program modules, but also module version information corresponding to each program module.
[0059] It should be noted that the embodiments of the present invention do not limit the specific implementation of the module version information. The module version information is used to characterize the version of the corresponding program module. In practical applications, it can be implemented by any information that can characterize the current version of the program module. Exemplarily, in a possible implementation, the above-mentioned module version information is specifically a version number. It is easy to know that the version numbers corresponding to different versions are different.
[0060] It should also be noted that, since the general BIOS image file currently does not include the above-mentioned module version information. Therefore, when implementing a basic input and output system flashing method provided by the present invention, in the process of compiling the BIOS image file, it is necessary to add corresponding module version information for each program module in the BIOS image file to meet the implementation conditions of the present method. In addition, the parsing of the BIOS image file mentioned in step S11 is the process of parsing and obtaining the module version information corresponding to each program module in the BIOS image file. The specific parsing should be determined according to the compilation method used to add the module version information when compiling the BIOS image file, and this embodiment does not limit this.
[0061] Step S12 is a step of determining the program modules that have changed in this flashing process according to the module version information obtained in the above steps. It should be noted that, under the premise that each program module has a corresponding module version information for representing the version, the program modules that have changed in this BIOS image file can be distinguished by a variety of different schemes, and this embodiment does not limit this.
[0062] As for step S13, based on the target program module determined in step S12, the BIOS ROM flashing is completed by the flashing tool. It is easy to know that, as for the BIOS flashing step itself, step S13 is no different from the traditional BIOS flashing. The difference is that the object flashed in step S13 is the target program module, not the entire BIOS image file, that is, in this step, only part of the program modules in the BIOS ROM are flashed, not the entire BIOS ROM.
[0063] Based on the above, it is not difficult to see that the basic input and output system flashing method provided by the present invention adds module version information corresponding to each program module in the BIOS image file to characterize the version status of each program module. Furthermore, during the BIOS ROM flashing process, the target program module that has changed and the remaining program modules that have not changed in the BIOS image file can be determined based on the module version information; so that when the BIOS ROM is flashed using the flashing tool later, only the target program module that has changed can be flashed. On the one hand, the reliable update of the BIOS ROM is guaranteed, and on the other hand, the efficiency of the BIOS ROM is greatly improved. Especially in the scenario where the BIOS ROM is not changed much, the advantage of improving the flashing efficiency is more obvious, thereby improving the customer's user experience.
[0064] Furthermore, it can be seen from the above embodiments that a key to achieving the technical effect of the basic input / output system flashing method provided by the present invention is to add the module version information corresponding to each program module in the BIOS image file. However, the above embodiments do not limit how to add the module version information. Based on this, this embodiment provides a possible module version information adding scheme:
[0065] Before obtaining the BIOS image file, the BIOS image file compilation process includes:
[0066] S21: After the compilation of each program module is completed and there is no error in the compilation, the corresponding module version information is obtained from the source code root directory of each program module; and the globally unique identifier corresponding to each program module is obtained.
[0067] The module version information is binary data.
[0068] S22: Convert the globally unique identifier corresponding to each program module into binary data.
[0069] S23: Integrate the module version information and the globally unique identifier corresponding to each program module and remove redundant characters, and compile to obtain a module version binary file.
[0070] S24: Packing each program module and module version binary file to obtain a basic input and output system image file.
[0071] As can be seen from the above, this embodiment provides a method for compiling a BIOS image file, that is, in the original BIOS image file compilation process, a step of adding module version information is added. In particular, a globally unique identifier (GUID) corresponding to each program module is also added. Among them, the module version information is used to determine the target program module that needs to be updated in this flash, and the GUID is used to characterize and distinguish different program modules. When it is necessary to compare the module version information between different program modules, the setting based on the GUID can distinguish different program modules or target program modules, as well as program modules that have participated in the comparison and those that have not participated in the comparison, etc.
[0072] Furthermore, in order to make the underlying hardware recognizable, this embodiment also converts the newly added module version information and GUID into the form of binary data. Among them, since the above embodiment does not limit the specific form of the module version information, when setting the module version information, the module version information can be directly set to the form of binary data. However, for GUIDs that generally exist in the form of strings, it is necessary to perform additional conversion to binary data to meet the compilation requirements. And the module version information and the GUID converted into binary data are organized into a binary file (i.e., a BIN file), as the above-mentioned module version binary file, and participate in the compilation process of the BIOS image file.
[0073] In summary, this embodiment provides a BIOS image file compilation method to ensure that the compiled BIOS image file contains the module version information corresponding to each program module, and then in the subsequent BIOS ROM flashing process, the module version information can be used to determine the updated part of the program module, that is, the target program module, to achieve flashing for some program modules, so as to improve the flashing efficiency and improve the customer experience. In addition, in this embodiment, the GUID of the program module is also added to the BIOS image file to facilitate the distinction between different program modules when determining the target program module later.
[0074] On the other hand, in the above embodiment, there is no limitation on how to determine the target program module, and the target program module can be determined through the module version information that can characterize the newness or oldness of the version.
[0075] Exemplarily, this embodiment provides a possible target program module determination solution:
[0076] There is a corresponding relationship between the information specifically included in the module version information and the newness or oldness of the version it represents.
[0077] Correspondingly, in the same BIOS image file, the version corresponding to the module version information corresponding to the program module that has changed this time must be newer than the module version information corresponding to the program module that has not changed this time.
[0078] Then step S12 may specifically be:
[0079] S12-A: Compare the module version information of each program module in the BIOS image file, and determine that each program module with a newer version represented by the template version information is a target program module.
[0080] It is easy to understand that, as in the above example, if the version number is used as the module version information, then according to a certain naming logic, a corresponding relationship can be established between the specific value of the version number and the newness or oldness of the version it represents. For example, the larger the specific value of the version number, the newer the corresponding version. Or if the version number contains the time when this version is determined, the newness or oldness relationship between the versions can be determined based on the time in the version number.
[0081] Based on the above settings, during the compilation of the BIOS image file, the module version information of the corresponding version update can be assigned to the program module that has changed this time, so as to realize the determination requirement for the target program module in step S12. It is not difficult to understand that the target program module determination scheme provided in this embodiment has good performance in terms of ease of implementation.
[0082] On the other hand, this embodiment also provides another possible solution for determining the target program module, and the above step S12 is specifically as follows:
[0083] S121-B: Acquire and parse the BIOS firmware file stored in the BIOS ROM.
[0084] S122-B: If the module version information corresponding to each program module does not exist in the basic input and output system firmware file, all program modules in the basic input and output system image file are determined to be target program modules.
[0085] S123-B: If the BIOS firmware file contains module version information corresponding to each program module, the corresponding relationship between the BIOS firmware file and each program module in the BIOS image file is determined according to the globally unique identifier.
[0086] S124-B: The two corresponding program modules in the BIOS firmware file and the BIOS image file are grouped together, and the module version information corresponding to each group of program modules is compared to see whether they are the same.
[0087] S125-B: Determine, in the basic input and output system image file, a program module whose corresponding module version information is different from that of the program modules in the same group as the target program module.
[0088] In this embodiment, the BIOS firmware file existing in the BIOS ROM before flashing is obtained to obtain the module version information of each program module in the BIOS firmware before flashing. Then, by comparing the module version information between each program module existing in the BIOS ROM and each program module of the BIOS image file to be flashed into the BIOS ROM, it can be determined which program modules have been updated, that is, the target program modules that need to be flashed this time can be determined.
[0089] Specifically, different program modules can be distinguished according to the GUID added by the compilation in the above embodiment. Similarly, a group of two corresponding program modules in the BIOS image file and the BIOS firmware file can be determined by using the same GUID, and then the module version information of each group of program modules is compared to determine whether the group of program modules is the target program module that needs to be flashed.
[0090] It is easy to understand that the comparison of the target program module determined in this embodiment occurs between the BIOS image file to be flashed into the BIOS ROM this time and the original BIOS firmware file of the BIOS ROM. By comparing the module version information of each program module in the two, the target program module that needs to be updated in this flashing is determined. Compared with the solution provided in the previous embodiment, the target program module determination solution provided in this embodiment requires that the original program module in the BIOS ROM also has corresponding module version information, which is relatively more demanding on implementation. However, in the flashing process of the BIOS ROM with multiple version changes, this embodiment has a more accurate effect of the target program module compared with the solution of the previous embodiment. The solution of the previous embodiment requires that different module version information be used each time to distinguish the program modules that need to be updated in the BIOS image file. However, in the flashing process of the BIOS ROM with multiple version changes, there may be some program modules that remain unchanged in multiple version changes, and there may also be some program modules that have been changing in each version change or other complex version changes. At this time, the solution of the above embodiment is difficult to cope with the situation where program modules corresponding to more than two versions exist simultaneously due to multiple version updates. However, this embodiment can overcome this problem and has better performance during the BIOS ROM flashing process with multiple version updates.
[0091] On the other hand, it can be seen from the above that the traditional method of flashing the entire BIOS ROM will not have too much impact on the flashing efficiency when the BIOS firmware is greatly changed, and has better performance. Based on this, this embodiment further provides a possible implementation plan based on the above embodiment. After step S125-B, the method further includes:
[0092] S126-B: If the ratio of the number of target program modules to the number of all program modules in the BIOS firmware file exceeds a preset percentage threshold, all program modules in the BIOS firmware file are determined to be new target program modules.
[0093] It should be noted that this embodiment does not restrict the specific value of the percentage threshold mentioned above, and it can be freely determined according to actual needs, for example, 70% or 80% can be taken. It is easy to understand that the purpose of setting the percentage threshold and step S126-B is to determine whether this BIOS ROM update is an update with relatively large changes. For updates with relatively large changes, even if the entire BIOS ROM is flashed, it will not affect the efficiency too much, but may be more reliable in terms of flashing. Based on this, this embodiment uses the percentage threshold to compare the proportion of the target program module to all program modules to determine the proportion of the program modules with version changes to all program modules. If it exceeds the preset percentage threshold, it means that the change of this BIOS ROM flashing is relatively large, and full flashing can be selected, that is, at this time, all program modules in the BIOS image file are target program modules to ensure the reliability of flashing.
[0094] Furthermore, this embodiment also provides a possible implementation scheme for how to implement the comparison between the percentage of the target program module in all program modules and the preset percentage threshold in the above embodiment. The BIOS image file compilation scheme provided in the above embodiment further includes, after step S23:
[0095] S25: Counting the size of the module version binary file to obtain file size information; counting the number of program modules to obtain module number information.
[0096] S26: Add the file size information and the module number information to the header of the module version binary file to obtain a new module version binary file.
[0097] That is, in the process of compiling the BIOS image file, this embodiment counts the number of program modules in advance to obtain module number information; and stores the module number information in the module version binary file; so as to be used to directly obtain the total number of program modules in the subsequent step such as S126-B; thereby, unnecessary re-counting process can be omitted, thereby improving the efficiency of BIOS ROM flashing.
[0098] It is also easy to know that in addition to the module number information, other required information can be added to the BIOS image file in actual applications. For example, the file size information in this embodiment can be used to represent the total size of the module version information and GUID of all program modules in the module version binary file, which is beneficial to subsequent file verification, management, etc.
[0099] On the other hand, during the actual BIOS ROM flashing process, the display of the progress bar can also be set to provide real-time feedback to the customer on the current BIOS ROM flashing progress. In a possible embodiment, the progress of the progress bar is determined by the ratio of the number of currently flashed program modules to the number of all program modules. However, in the basic input and output system flashing method provided in the above embodiment of the present invention, there is a scenario in which only part of the program modules (i.e., the target program modules) are flashed. At this time, it is no longer accurate to use the number of all program modules as the basis for determining the current progress of the progress bar, so this embodiment adaptively provides a progress bar setting scheme for flashing the target program module:
[0100] When the target program module is not all the program modules in the basic input and output system firmware file, the method further includes:
[0101] S31: Add a preset string to display in the update progress interface.
[0102] The preset character string is used to indicate that this refresh is a quick update different from a full update.
[0103] S32: Determine the percentage of the progress bar according to the number of target program modules that have been flashed and the total number of target program modules, and display it in the update progress interface.
[0104] It is easy to know that the above-mentioned update progress interface is a human-computer interaction interface displayed on the client or operation and maintenance end, which is used to indicate the progress of the current BIOS ROM flashing. Since there are also relevant settings for the update progress interface to feedback the update progress during the flashing process of the BIOS ROM, this embodiment does not strictly limit this. However, it should be noted that this embodiment adds the display of a preset string to the original update progress interface. The preset string is used to characterize that this BIOS ROM flashing is a flashing of some program modules in the above-mentioned embodiment (the target program module is not all program modules), that is, this BIOS ROM is a "variable" update that is different from the original full update, and the "variable" also represents the part of all program modules that have changed (version update).
[0105] It should also be noted that the present embodiment does not limit the specific content of the preset string, as long as it can indicate that this flash is a quick update different from a full update. For example, in a possible implementation, the content of the preset string can be "quick update" or the like.
[0106] On the other hand, the flashing tool used in the present embodiment is not limited in the above embodiment, and any currently available BIOS firmware flashing tool can be selected according to actual needs. For example: when flashing the BIOS ROM, the customer can flash it under the operating system (OS) of the server or computer; or flash it under the BIOS SHELL (a part of the BIOS, a command line interaction method based on a text interface); or flash it under the web page (WEB) of the baseboard management controller (BMC).
[0107] However, it should be noted that when the BIOS ROM is flashed on the BMC's WEB terminal, different from the other two flashing methods, in order to ensure the normal flashing of the BIOS ROM and the normal operation of subsequent devices, this embodiment also provides a corresponding implementation plan:
[0108] When the flash tool is a BMC-side flash program (that is, BIOS ROM flash is performed through the BMC WEB terminal), its hardware architecture is as follows: Figure 2 As shown in the figure: BIOS ROM is connected to the central processing unit (CPU) and BMC respectively through a selection switch module (switch) and two independent serial peripheral interface (SPI) buses. The selection switch module realizes the communication switching between BIOS ROM and CPU and BMC, and the selection switch module is controlled by BMC.
[0109] Accordingly, before step S13, the method further includes:
[0110] S14: Switching the access control authority of the basic input / output system read-only memory to the baseboard management controller serial peripheral interface controller through the baseboard management controller.
[0111] After step S13, the method further includes:
[0112] S15: Switching the access control authority of the basic input and output system read-only memory back to the central processing unit serial peripheral interface controller through the baseboard management controller.
[0113] During the operation of servers, computers and other devices, the BIOS ROM is connected to the CPU by default to provide BIOS functions. However, when the BIOS ROM is flashed and the flashing tool is a refresh program on the BMC side, the communication connection of the BIOS ROM needs to be switched to the BMC to meet the flashing requirements. Furthermore, after the flashing is completed, the communication connection of the BIOS ROM needs to be switched back to the CPU to ensure that the CPU can read the BIOS program on the BIOS ROM normally and boot normally.
[0114] In the above embodiment, a basic input and output system flashing method is described in detail, and the present invention also provides a basic input and output system flashing device corresponding to the embodiment. It should be noted that the present invention describes the embodiment of the device part from two perspectives, one is based on the functional module perspective, and the other is based on the hardware perspective.
[0115] Based on the perspective of functional modules, this embodiment provides a basic input and output system flashing device, such as Figure 3 As shown, including:
[0116] The image acquisition module 11 is used to acquire and parse the basic input and output system image file; wherein the basic input and output system image file includes: a plurality of program modules and module version information corresponding to each program module;
[0117] An update determination module 12, used to determine a target program module that needs to be updated among the program modules according to the module version information;
[0118] The firmware flashing module 13 is used to flash the target program module into the basic input and output system read-only memory through a flashing tool.
[0119] Since the embodiments of the apparatus part correspond to the embodiments of the method part, please refer to the description of the embodiments of the method part for the embodiments of the apparatus part, which will not be repeated here.
[0120] Figure 4 A structural diagram of a basic input / output system flashing device provided by another embodiment of the present invention is shown as follows: Figure 4 As shown, a basic input and output system flashing device comprises: a memory 20 for storing a computer program;
[0121] The processor 21 is used to implement the steps of a basic input and output system flashing method in the above embodiment when executing a computer program.
[0122] The basic input and output system flashing device provided in this embodiment may include but is not limited to a mobile terminal, a personal computer, a workstation, etc.
[0123] Among them, the processor 21 may include one or more processing cores, such as a 4-core processor, an 8-core processor, etc. The processor 21 can be implemented in at least one hardware form of a digital signal processor (DSP), a field-programmable gate array (FPGA), and a programmable logic array (PLA). The processor 21 may also include a main processor and a coprocessor. The main processor is a processor for processing data in the awake state, also known as a central processing unit (CPU); the coprocessor is a low-power processor for processing data in the standby state. In some embodiments, the processor 21 may be integrated with a graphics processing unit (GPU), which is responsible for rendering and drawing the content to be displayed on the display screen. In some embodiments, the processor 21 may also include an artificial intelligence (AI) processor, which is used to process computing operations related to machine learning.
[0124] The memory 20 may include one or more computer-readable storage media, which may be non-transitory. The memory 20 may also include a high-speed random access memory, and a non-volatile memory, such as one or more disk storage devices, flash memory storage devices. In this embodiment, the memory 20 is at least used to store the following computer program 201, wherein, after the computer program is loaded and executed by the processor 21, it can implement the relevant steps of a basic input and output system flash writing method disclosed in any of the aforementioned embodiments. In addition, the resources stored in the memory 20 may also include an operating system 202 and data 203, etc., and the storage method may be temporary storage or permanent storage. Among them, the operating system 202 may include Windows, Unix, Linux, etc. Data 203 may include but is not limited to a basic input and output system flash writing method, etc.
[0125] In some embodiments, a basic input and output system flashing device may further include a display screen 22 , an input and output interface 23 , a communication interface 24 , a power supply 25 and a communication bus 26 .
[0126] Those skilled in the art will understand that Figure 4 The structure shown in the figure does not constitute a limitation of a basic input and output system flashing device, and may include more or less components than those shown in the figure.
[0127] A basic input / output system flashing device provided by an embodiment of the present invention includes a memory and a processor. When the processor executes a program stored in the memory, it can implement the following method: a basic input / output system flashing method.
[0128] In addition to the embodiments of a basic input / output system flashing method and device provided in the above embodiments, the present invention also provides an embodiment corresponding to a computer program product. A computer program product includes a computer program / instruction, and when the computer program / instruction is executed by a processor, the steps of the basic input / output system flashing method described in any of the above embodiments can be implemented.
[0129] Since the embodiments of the computer program product part correspond to the embodiments of the method part, please refer to the description of the embodiments of the method part for the embodiments of the computer program product part, which will not be repeated here.
[0130] Finally, the present invention also provides an embodiment corresponding to a non-volatile storage medium. The non-volatile storage medium stores a computer program, and when the computer program is executed by a processor, the steps recorded in the above method embodiment are implemented.
[0131] It is understandable that if the method in the above embodiment is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a non-volatile storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium to execute all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), disk or optical disk, etc. Various media that can store program codes.
[0132] The above is a detailed introduction to a basic input-output system flashing method, device and medium provided by the present invention. The various embodiments in the specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same and similar parts between the embodiments can be referenced to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part description. It should be pointed out that for ordinary technicians in this technical field, without departing from the principle of the present invention, several improvements and modifications can be made to the present invention, and these improvements and modifications also fall within the scope of protection of the present invention.
[0133] It should also be noted that, in this specification, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "comprise", "include" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the statement "comprises a ..." does not exclude the presence of other identical elements in the process, method, article or device including the element.
Claims
1. A basic input and output system flashing method, characterized in that: include: Acquire and parse a basic input / output system image file; wherein the basic input / output system image file includes: a plurality of program modules and module version information corresponding to each of the program modules; Determine a target program module that needs to be updated in each of the program modules according to the module version information; The target program module is flashed into the basic input and output system read-only memory by a flashing tool.
2. The basic input and output system flashing method according to claim 1, characterized in that: The compilation process of the basic input and output system image file includes: After the compilation of each of the program modules is completed and there is no error in the compilation, the corresponding module version information is obtained from the source code root directory of each of the program modules; and the globally unique identifier corresponding to each of the program modules is obtained; wherein the module version information is binary data; Convert the globally unique identifier corresponding to each of the program modules into binary data; Integrate the module version information and the globally unique identifier corresponding to each of the program modules and remove redundant characters, and compile to obtain a module version binary file; The program modules and the module version binary files are packaged to obtain the basic input and output system image file.
3. The basic input and output system flashing method according to claim 2, characterized in that: Determining the target program module that needs to be updated in each of the program modules according to the module version information includes: Acquire and parse the basic input and output system firmware file stored in the basic input and output system read-only memory; If the module version information corresponding to each of the program modules does not exist in the basic input / output system firmware file, determining that all of the program modules in the basic input / output system image file are the target program modules; If the module version information corresponding to each of the program modules exists in the BIOS firmware file, determining the correspondence between the BIOS firmware file and each of the program modules in the BIOS image file according to the globally unique identifier; The two corresponding program modules in the BIOS firmware file and the BIOS image file are grouped together, and the module version information corresponding to each group of program modules is compared to see whether they are the same; The program module in the basic input / output system image file, whose corresponding module version information is different from that of the program modules in the same group, is determined as the target program module.
4. The basic input and output system flashing method according to claim 3, characterized in that: After determining the program module in the basic input / output system image file whose corresponding module version information is different from that of the program modules in the same group as the target program module, the method further includes: If the ratio of the number of the target program modules to the number of all the program modules in the BIOS firmware file exceeds a preset percentage threshold, all the program modules in the BIOS firmware file are determined to be new target program modules.
5. The basic input and output system flashing method according to claim 4, characterized in that: After the module version information and the globally unique identifier corresponding to each program module are integrated and redundant characters are removed to compile and obtain a module version binary file, the method further includes: Counting the size of the module version binary file to obtain file size information; counting the number of program modules to obtain module number information; The file size information and the module number information are added to the header of the module version binary file to obtain a new module version binary file.
6. The basic input and output system flashing method according to claim 5, characterized in that: When the target program module is not all the program modules in the basic input and output system firmware file, the method further includes: Add a preset string to the update progress interface; wherein the preset string is used to indicate that this flash is a quick update different from a full update; The percentage of the progress bar is determined according to the number of the target program modules that have been flashed and the total number of the target program modules, and is displayed in the update progress interface.
7. The basic input and output system flashing method according to any one of claims 1 to 6, characterized in that: When the flash writing tool is a baseboard management controller refresh program, before the target program module is flashed into the basic input and output system read-only memory by the flash writing tool, the method further includes: Switching the access control authority of the basic input and output system read-only memory to the baseboard management controller serial peripheral interface controller through the baseboard management controller; After the target program module is flashed into the basic input and output system read-only memory by a flashing tool, the method further includes: The access control authority of the basic input and output system read-only memory is switched back to the central processing unit serial peripheral interface controller through the baseboard management controller.
8. A basic input and output system flashing device, characterized in that: include: An image acquisition module, used to acquire and parse a basic input / output system image file; wherein the basic input / output system image file includes: a plurality of program modules and module version information corresponding to each of the program modules; An update determination module, used to determine a target program module that needs to be updated among the program modules according to the module version information; The firmware flashing module is used to flash the target program module into the basic input and output system read-only memory through a flashing tool.
9. A basic input and output system flashing device, characterized in that: include: Memory for storing computer programs; A processor, configured to implement the steps of the basic input / output system flashing method as claimed in any one of claims 1 to 7 when executing the computer program.
10. A non-volatile storage medium, characterized in that: The non-volatile storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the basic input and output system flashing method as claimed in any one of claims 1 to 7 are implemented.
Citation Information
Cited By
BIOS (Basic Input / Output System) refreshing method and device
CN121764485A