Firmware replacement method, computer system, medium, and product

By pre-establishing a firmware storage area in the computer system and automatically acquiring and writing the target firmware using firmware replacement instructions, the problems of low firmware replacement efficiency and poor security in the existing technology are solved, and an efficient and secure firmware replacement process is realized.

CN116339792BActive Publication Date: 2026-07-21LOONGSON TECH CORP
View PDF 3 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
LOONGSON TECH CORP
Filing Date
2021-12-23
Publication Date
2026-07-21

Smart Images

  • Figure CN116339792B_ABST
    Figure CN116339792B_ABST
Patent Text Reader

Abstract

The application provides a firmware replacement method, a computer system, a medium and a product. The method comprises the following steps: receiving a firmware replacement instruction, wherein the firmware replacement instruction comprises a firmware identifier; searching for a current firmware storage area according to the firmware replacement instruction, and obtaining a target firmware corresponding to the firmware identifier, wherein a plurality of firmwares are stored in the firmware storage area; writing the target firmware into a start flash memory, and performing a restart operation to complete the firmware replacement. According to the firmware replacement scheme, when the firmware replacement is performed, a cabinet does not need to be opened or an external storage device does not need to be used, so that the efficiency of replacing the firmware can be improved while safety is ensured.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer firmware technology, and in particular to a firmware replacement method, computer system, medium, and product. Background Technology

[0002] Firmware is a set of programs embedded in the read-only memory (ROM) of an electronic device's motherboard. It is the most fundamental low-level software of the electronic device system, a small program executed before the operating system runs. It includes basic input / output programs, system settings, power-on self-test (POST) programs, and system startup programs, etc. Currently, firmware is generally divided into u-boot firmware, PMON firmware, and UEFI firmware. When a motherboard carrying a Central Processing Unit (CPU) has multiple different application scenarios—for example, some scenarios require removing all unimportant device modules during the CPU boot phase to achieve fast startup, while others require debug mode firmware—it is necessary to develop corresponding firmware for these different application scenarios. That is, the firmware is changed according to the user's needs for different application scenarios. For example, the user's application scenario may require booting with PMON firmware or UEFI firmware.

[0003] In the prior art, when firmware needs to be replaced, users can use firmware pre-stored in an external storage device to burn the pre-stored firmware into the device whose firmware needs to be replaced, thereby replacing the firmware.

[0004] However, in existing technologies, the firmware needs to be manually flashed each time it is changed, resulting in low efficiency in firmware replacement. Summary of the Invention

[0005] This application provides a firmware replacement method, computer system, medium, and product to solve the technical problem in the prior art where firmware replacement is inefficient and insecure due to user operations.

[0006] In a first aspect, embodiments of this application provide a firmware replacement method applied to a computer system, the computer system including a CPU, a bridge chip, and boot flash memory, the method comprising:

[0007] The CPU receives a firmware replacement instruction, which includes a firmware identifier.

[0008] The CPU searches for the firmware storage area according to the firmware replacement instruction; wherein, the firmware storage area contains multiple firmware files, the firmware storage area is located in the bridge chip, and the CPU is connected to the bridge chip via a bus;

[0009] The CPU retrieves the target firmware corresponding to the firmware identifier from the firmware storage area;

[0010] The CPU writes the target firmware into the boot flash memory; and

[0011] Perform a reboot operation and read the target firmware from the boot flash memory to complete the firmware replacement.

[0012] Optionally, in the method described above, before the CPU receives the firmware replacement instruction, the method further includes:

[0013] The CPU partitions the firmware storage area in the bridge chip according to the attribute information of multiple firmwares to be stored, and allocates the partitioned storage area to each firmware to be stored; wherein, the attribute information of the firmware to be stored includes at least the firmware identifier and the size of the storage space occupied by the firmware.

[0014] The CPU stores each firmware file to be stored into the corresponding storage segment in the firmware storage area.

[0015] Optionally, as described above, the attribute information of the firmware to be stored further includes firmware type; the CPU partitions the firmware storage area in the bridge chip according to the attribute information of multiple firmware to be stored, and allocates the partitioned storage area to each firmware to be stored, including: the CPU divides multiple firmware to be stored according to the firmware type of multiple firmware to be stored, and obtains the firmware to be stored corresponding to each firmware type.

[0016] For each firmware type, the CPU performs the following steps for all firmware to be stored: obtaining the common part of all firmware to be stored and the private part of each firmware to be stored; partitioning the firmware storage area in the bridge chip, and allocating the partitioned storage area to the common part of all firmware to be stored and the private part of each firmware to be stored respectively; wherein, the storage area allocated to the common part of all firmware to be stored under this firmware type is the same storage area.

[0017] The CPU stores each firmware to be stored into the corresponding storage area in the firmware storage area, including: the CPU stores the common part of the firmware to be stored corresponding to each firmware type and the private part of each firmware to be stored into the corresponding storage area.

[0018] Optionally, in the method described above, the firmware identifier in the firmware replacement instruction includes: a public part identifier and a private part identifier;

[0019] The CPU retrieves the target firmware corresponding to the firmware identifier from the firmware storage area, including: the CPU retrieves the public part of the target firmware corresponding to the public part identifier and the private part of the target firmware corresponding to the private part identifier based on the public part identifier and the private part identifier.

[0020] The CPU writes the target firmware into the boot flash memory, including:

[0021] The CPU obtains the firmware type corresponding to the common part of the target firmware. If it is consistent with the firmware type in the boot flash memory, the CPU replaces the private part corresponding to the firmware in the boot flash memory with the private part corresponding to the target firmware.

[0022] If the CPU determines that the firmware type corresponding to the common part of the target firmware is inconsistent with the firmware type in the boot flash memory, it writes the common part of the target firmware and the private part of the target firmware into the boot flash memory.

[0023] Optionally, in the method described above, the CPU partitions the firmware storage area in the bridge chip and allocates the partitioned storage areas to each firmware to be stored, including:

[0024] The CPU partitions the firmware storage area in the bridge chip, and the partitioning result includes a storage area and reserved space corresponding to each firmware to be stored; and

[0025] The CPU allocates the storage space obtained from the partitioning to each firmware to be stored, and the reserved space does not store firmware data.

[0026] Optionally, the method described above further includes: the CPU acquiring the firmware to be added and storing the firmware to be added in the reserved space.

[0027] Optionally, in the method described above, the CPU stores each firmware to be stored into the corresponding storage area in the firmware storage area, including: the CPU reading each firmware to be stored into memory; and the CPU storing each firmware to be stored in memory into the corresponding storage area in the firmware storage area.

[0028] Optionally, in the method described above, after the CPU stores each firmware to be stored into the corresponding storage area in the firmware storage area, it further includes:

[0029] The CPU performs data verification on the firmware stored in the firmware storage area;

[0030] If the CPU data verification fails, the process returns to the step of storing each firmware to be stored in the corresponding storage area of ​​the firmware storage area or an error message is output.

[0031] Optionally, in the method described above, the CPU writes the target firmware to the boot flash memory, including:

[0032] The CPU reads the target firmware stored in the firmware storage area into memory;

[0033] The CPU writes the target firmware from memory into the boot flash memory.

[0034] Optionally, in the method described above, after the CPU writes the target firmware to the boot flash memory, it further includes:

[0035] The CPU performs data verification on the target firmware written in the boot flash memory based on the target firmware in the firmware storage area.

[0036] If the CPU data verification fails, return to the step of writing the target firmware to the boot flash memory or output an error message.

[0037] The CPU performs a restart operation, including:

[0038] If the CPU data verification is successful, a restart operation will be performed.

[0039] Secondly, embodiments of this application provide a computer system, including: a CPU, a bridge chip, and a boot flash memory; the CPU is configured to receive a firmware replacement instruction, the firmware replacement instruction including a firmware identifier; the CPU is further configured to, according to the firmware replacement instruction, locate the current firmware storage area, obtain a target firmware corresponding to the firmware identifier, the firmware storage area storing multiple firmwares, the firmware storage area being located in the bridge chip, and the CPU being connected to the bridge chip via a bus; the CPU is further configured to obtain the target firmware corresponding to the firmware identifier from the firmware storage area; the CPU is further configured to write the target firmware into the boot flash memory and perform a reboot operation to complete the firmware replacement.

[0040] Optionally, in the computer system described above, the CPU is further configured to partition the firmware storage area in the bridge chip according to the attribute information of multiple firmwares to be stored, and allocate the partitioned storage area to each firmware to be stored; wherein, the attribute information of the firmware to be stored includes at least the firmware identifier and the size of the storage space occupied by the firmware to be stored; the CPU is further configured to store each firmware to be stored into the corresponding storage area in the firmware storage area.

[0041] Optionally, in the computer system described above, the attribute information of the firmware to be stored further includes firmware type; the CPU is specifically used to divide the multiple firmware to be stored according to their firmware types to obtain the firmware to be stored corresponding to each firmware type.

[0042] For each firmware type corresponding to the firmware to be stored, the CPU performs the following steps: obtaining the common part of all firmware to be stored represented by all firmware identifiers and the private part corresponding to each of the firmware to be stored; partitioning the firmware storage area in the bridge chip, and allocating the storage area obtained by partitioning to the common part of all firmware to be stored and the private part corresponding to each of the firmware to be stored respectively; wherein, the storage area allocated to the common part of all firmware to be stored under this firmware type is the same storage area.

[0043] The CPU is specifically used to store the common part of the firmware to be stored for each firmware type and the private part of each firmware to be stored into the corresponding storage range.

[0044] Optionally, in the computer system described above, the firmware identifier in the firmware replacement instruction includes: a public part identifier and a private part identifier;

[0045] The CPU is specifically used to obtain the public part of the target firmware corresponding to the public part identifier and the private part of the target firmware corresponding to the private part identifier based on the public part identifier and the private part identifier;

[0046] The CPU is specifically used to obtain the firmware type corresponding to the common part of the target firmware. If it is consistent with the firmware type in the boot flash memory, the private part corresponding to the firmware in the boot flash memory is replaced with the private part corresponding to the target firmware.

[0047] The CPU is specifically configured to, if it is determined that the firmware type corresponding to the common part of the target firmware is inconsistent with the firmware type in the boot flash memory, write the common part of the target firmware and the private part of the target firmware into the boot flash memory.

[0048] Optionally, in the computer system described above, the CPU is specifically used to partition the firmware storage area in the bridge chip, and the partitioning result includes a storage area and reserved space corresponding to each firmware to be stored; and

[0049] The CPU is specifically used to allocate the storage space obtained from the partition to each firmware to be stored, and the reserved space does not store firmware data.

[0050] Optionally, in the computer system described above, the CPU is further configured to acquire firmware to be added and store the firmware to be added in the reserved space.

[0051] Optionally, in the computer system described above, the CPU is specifically configured to read each firmware to be stored into memory; the CPU is specifically configured to store each firmware to be stored in memory into the corresponding storage area in the firmware storage area.

[0052] Optionally, the computer system described above,

[0053] The CPU is also used to perform data verification on the firmware stored in the firmware storage area;

[0054] If the CPU data verification fails, the process returns to the step of storing each firmware to be stored in the corresponding storage area of ​​the firmware storage area or an error message is output.

[0055] Optionally, the computer system described above,

[0056] The CPU is specifically used to read the target firmware stored in the firmware storage area into memory;

[0057] The CPU is specifically used to write the target firmware from memory into the boot flash memory.

[0058] Optionally, the computer system described above,

[0059] The CPU is further configured to perform data verification on the target firmware written in the boot flash memory based on the target firmware in the firmware storage area; if the CPU data verification fails, it returns to the step of writing the target firmware into the boot flash memory or outputs an error message; if the CPU data verification succeeds, it performs a restart operation.

[0060] Thirdly, embodiments of this application provide a computer, including:

[0061] Memory, processor, and computer programs;

[0062] The processor can process instructions executed within the computer system; the computer program is stored in the memory and configured to be executed by the processor to implement the firmware replacement method as described above.

[0063] Fourthly, embodiments of this application provide a computer-readable storage medium having a computer program stored thereon, the computer program being executed by a processor to implement the firmware replacement method as described above.

[0064] Fifthly, embodiments of this application provide a computer program product, including a computer program that, when executed by a processor, implements the firmware replacement method as described above.

[0065] This application provides a firmware replacement method, computer system, medium, and product in which a firmware storage area containing multiple firmware files is pre-established. When firmware replacement is required, the corresponding target firmware can be retrieved from the firmware storage area according to the firmware identifier in the firmware replacement instruction, written to the boot flash memory, and the firmware replacement is completed by rebooting. The solution provided by this application eliminates the need for users to perform firmware burning operations based on firmware stored on external storage devices when performing firmware replacement, thereby improving the efficiency of firmware replacement.

[0066] It should be understood that the content described in the foregoing summary section is not intended to limit the key or essential features of the embodiments of this application, nor is it intended to restrict the scope of this application. Other features of this application will become readily apparent from the following description. Attached Figure Description

[0067] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0068] Figure 1 A flowchart of the firmware replacement method provided in Embodiment 1 of this application;

[0069] Figure 2 A flowchart of the firmware replacement method provided in Embodiment 2 of this application;

[0070] Figure 3 A schematic diagram showing the distribution of storage areas in the firmware storage area provided in this application embodiment;

[0071] Figure 4A A flowchart of the firmware replacement method provided in Embodiment 3 of this application;

[0072] Figure 4B The system architecture diagram provided for this application;

[0073] Figure 5 This is a structural diagram of a computer system provided in Embodiment 4 of this application;

[0074] Figure 6 This is a schematic diagram of the structure of a computer provided in an embodiment of this application. Detailed Implementation

[0075] Embodiments of this application will now be described in more detail with reference to the accompanying drawings. While some embodiments of this application are shown in the drawings, it should be understood that this application can be implemented in various forms and should not be construed as limited to the embodiments set forth herein. Rather, these embodiments are provided to provide a more thorough and complete understanding of this application. It should be understood that the drawings and embodiments of this application are for illustrative purposes only and are not intended to limit the scope of protection of this application.

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

[0077] To clearly understand the technical solution of this application, the solutions of the prior art will be described in detail first.

[0078] In the prior art, when replacing firmware, the user can burn the firmware stored on an external storage device (e.g., a USB flash drive) to the electronic device whose firmware needs to be replaced, thereby achieving firmware replacement.

[0079] However, in the aforementioned methods for replacing electronic device firmware, the user needs to perform a flashing operation each time firmware is replaced, which is inefficient. Furthermore, firmware stored on external storage media is easily tampered with, compromising the data security of the electronic device after the tampered firmware is written to it. Alternatively, issues may arise where the firmware stored on external storage media becomes unusable, for example, if the USB drive is infected with a virus or damaged.

[0080] To address the aforementioned technical problems, this application embodiment pre-establishes a firmware storage area containing multiple firmware versions. When firmware replacement is required, the corresponding target firmware can be determined based on the firmware identifier in the firmware replacement instruction, written to the boot flash memory, and then the firmware replacement can be completed by performing a reboot operation. The implementation of this method requires no hardware technical support or the use of external storage devices, improving the efficiency of firmware replacement while ensuring security.

[0081] The embodiments of this application are described in detail below with reference to the accompanying drawings:

[0082] Example 1

[0083] Figure 1 This is a flowchart illustrating the firmware replacement method provided in Embodiment 1 of this application. This embodiment applies to a computer system, which includes a CPU, a bridge chip, and boot flash memory. In this computer system, the CPU and the bridge chip are connected via a bus. In some embodiments, a high-speed bus, such as an HT (Hyper-Transport) bus, is used to connect the CPU and the bridge chip. Instruction / data interaction between the CPU and the bridge chip is implemented through the high-speed bus. In specific applications, the CPU, bridge chip, and boot flash memory are located on the same motherboard. The firmware replacement method provided in this embodiment includes:

[0084] Step 101: The CPU receives a firmware replacement instruction, which includes a firmware identifier.

[0085] In practical applications, the firmware replacement method of this embodiment can be implemented by a physical device that integrates or installs relevant computer programs, such as a chip. For example, the execution entity in this embodiment can be a central processing unit (CPU).

[0086] The firmware replacement instruction includes a firmware identifier so that the CPU, upon receiving the firmware replacement instruction, can determine the target firmware corresponding to the firmware identifier, thereby determining the storage area of ​​the target firmware and retrieving the target firmware from that storage area.

[0087] Optionally, the application scenarios of this embodiment are not limited. For example, the method can be triggered by a user, such as when a user needs to change the firmware, they can send a firmware change command to the CPU. Optionally, there are various forms of command sending. For example, the user can issue a change command to the CPU through a human-computer interaction interface. In scenarios with touch screen functionality, the user can operate on the touch screen interface, or combine it with devices such as a mouse and keyboard. As another example, it can also be a timed change, such as pre-setting the time when the firmware needs to be changed, and sending a firmware change command to the CPU when the set time is reached. This embodiment does not limit this.

[0088] Step 102: The CPU searches the current firmware storage area according to the firmware replacement instruction, and obtains the target firmware corresponding to the firmware identifier. The firmware storage area contains multiple firmwares, and the firmware storage area is located in the bridge chip of the computer system.

[0089] The firmware storage area is used to store multiple firmware files. In practical applications, the firmware storage area can be a component that supports data storage functions, including but not limited to hard drives, flash memory, etc. For example, the firmware storage area can be a flash memory. The number of firmware files stored in the firmware storage area can be determined according to actual needs. For example, the multiple firmware files can be different versions of the same firmware, or different firmware files applied to different scenarios; this embodiment does not limit this.

[0090] In practical applications, there are multiple ways to obtain multiple firmware files. For example, the computer system may also include external storage devices, from which multiple firmware files can be obtained. These external storage devices may include, but are not limited to, devices that support firmware storage, such as hard drives and USB flash drives. In this case, once a communication connection is established between the external device and the CPU, the CPU can access the external device to obtain multiple firmware files. Another example is that multiple firmware files can also be obtained through remote download. For instance, the CPU can receive a firmware download link input by the user, allowing the CPU to obtain the firmware by accessing that link. This embodiment does not limit the method of firmware acquisition.

[0091] To illustrate with a real-world example, when firmware needs to be changed, a firmware change command can be sent to the CPU, carrying an identifier for the firmware to be replaced. Upon receiving the firmware change command, the CPU can search for the target firmware corresponding to the required firmware identifier in the current firmware storage area, retrieve the target firmware from the firmware storage area, and then replace the firmware with the target firmware in subsequent processes.

[0092] Step 103: The CPU retrieves the target firmware corresponding to the firmware identifier from the firmware storage area.

[0093] Step 104: The CPU writes the target firmware to the boot flash memory and performs a reboot operation, reading the target firmware from the boot flash memory to complete the firmware replacement.

[0094] Optionally, there are several ways to replace the currently used firmware with the target firmware found in the firmware replacement instruction by retrieving the target firmware from the firmware storage area. In one implementation, the target firmware can be written to the boot flash memory, and the CPU can be restarted. After the CPU restarts, it reads the firmware to be enabled from the boot flash memory and uses it, thereby completing the replacement of the currently used firmware with the target firmware, and enabling the CPU to boot in the electronic device based on the selected target firmware.

[0095] To illustrate with a practical example: After the CPU powers on, it reads the firmware currently stored in the boot flash memory and runs it, thus enabling the operating system to run. In this solution, when the computer system starts up for the first time, a default firmware can be stored in the boot flash memory. This default firmware can be determined based on various implementation methods. For example, any firmware can be randomly selected as the default, or the firmware most frequently used by the user can be selected based on usage data; there are no restrictions on this. Subsequently, after the operating system successfully runs based on this default firmware, the firmware can be changed within this operating system environment by executing the solution provided in this embodiment.

[0096] Optionally, writing the target firmware stored in the firmware storage area into the boot flash memory can be implemented in various ways. In one implementable method, based on Embodiment 1, step 104 of writing the target firmware into the boot flash memory specifically includes:

[0097] Read the target firmware stored in the firmware storage area into memory; write the target firmware in memory into the boot flash memory.

[0098] Specifically, when writing the target firmware to the boot flash memory, it can be executed through a firmware write command. The firmware write command may include an opcode, a target firmware identifier, and a storage location. The target firmware identifier identifies the target firmware to be switched to, the opcode identifies the firmware write operation to be performed, and the storage location identifies the original address information of the target firmware in the computer system. For example, the firmware write command is: "ReplaceBIOS target firmware identifier storage location," where ReplaceBIOS is the opcode; the storage range in the firmware storage area is the storage location of the target firmware within the firmware storage area. The meaning of the above firmware write command is: delete the firmware in the boot flash memory and burn the firmware stored in a certain storage range in the firmware storage area to the boot flash memory. In other words, when writing the target firmware to the boot flash memory, the original firmware in the boot flash memory needs to be erased before the target firmware is written to the boot flash memory.

[0099] Optionally, the firmware writing instruction can be the same instruction as the firmware replacement instruction, that is, the firmware replacement instruction can simultaneously implement steps 102 and 104; or, the firmware writing instruction and the firmware replacement instruction can be two instructions that implement different functions, that is, the firmware replacement instruction is used to implement step 102, and the firmware writing instruction is used to implement step 104.

[0100] To illustrate with a practical example: after obtaining the target firmware corresponding to the firmware identifier, the firmware can be replaced by first reading it into memory, and then transferring the target firmware from memory to the boot flash memory. This implementation method allows for firmware replacement, thereby enabling the computer to support the operating system environment required by the user.

[0101] To avoid initialization failure due to data errors, data verification can be performed on the firmware in the boot flash memory after writing the target firmware. In one possible implementation, based on Embodiment 1, after writing the target firmware to the boot flash memory in step 104, the following may be included:

[0102] Based on the target firmware in the firmware storage area, perform data verification on the target firmware written in the boot flash memory;

[0103] Accordingly, step 104 involves performing a restart operation, which specifically includes:

[0104] If the data verification is successful, then perform a restart operation.

[0105] Based on the above implementation methods, in one implementation method, after verifying the target firmware written in the boot flash memory according to the target firmware in the firmware storage area, the method may further include: if the data verification fails, returning to the step of writing the target firmware into the boot flash memory or outputting an error message.

[0106] To illustrate with a practical example: After the target firmware is written to the boot flash memory, the CPU performs data verification between the target firmware stored in the boot flash memory and the corresponding target firmware in the firmware storage area. The method for data verification is not limited; for example, it can be performed by comparing data byte by byte to ensure the accuracy of the firmware data stored in the boot flash memory. This implementation method allows for the verification of the accuracy of the firmware data stored in the boot flash memory, thereby ensuring the successful booting of the electronic device.

[0107] In this embodiment, a firmware storage area containing multiple firmware versions is pre-established. When firmware replacement is required, only a firmware replacement command needs to be sent to the CPU. Subsequently, the CPU determines the corresponding target firmware based on the firmware identifier in the firmware replacement command, writes the target firmware to the boot flash memory, and performs a reboot operation to complete the firmware replacement. The above firmware replacement process does not involve hardware modification or operation of the device, nor does it require writing external data to the internal system. In other words, the above process does not require hardware technical support or the use of external storage devices, thereby improving the efficiency of firmware replacement while ensuring security.

[0108] Example 2

[0109] Figure 2The flowchart of the firmware replacement method provided in Embodiment 2 of this application is as follows: Figure 2 As shown, the firmware replacement method provided in this embodiment, used to establish a firmware storage area, is a further refinement of steps 101-104 based on the firmware replacement method provided in Embodiment 1 of this application, and also includes other steps. Therefore, the firmware replacement method provided in this embodiment, based on Embodiment 1, further includes the following steps before step 101:

[0110] Step 201: The CPU partitions the firmware storage area in the bridge chip according to the attribute information of multiple firmwares to be stored, and allocates the partitioned storage area to each firmware to be stored. The attribute information of the firmware to be stored includes at least the firmware identifier and the size of the storage space occupied by the firmware.

[0111] Step 202: The CPU stores each firmware to be stored into the corresponding storage area in the firmware storage area.

[0112] In this embodiment, when partitioning the firmware storage area in the bridge chip, the CPU can divide the firmware storage area according to the attribute information corresponding to each of the multiple firmware files to be stored. Specifically, the attribute information corresponding to each firmware file to be stored includes the firmware identifier and the size of the storage space occupied by the firmware, and thus the storage area can be partitioned according to the size of the storage space corresponding to each firmware file to be stored. In addition, during partitioning, it is also possible to classify and store multiple firmware files to be stored according to firmware type, so that when replacing firmware later, multiple firmware files corresponding to the firmware type to be replaced can be found first, and then the firmware to be replaced can be further determined from the multiple firmware files, which facilitates the search.

[0113] Furthermore, there are several other ways to partition the firmware storage area. Optionally, when partitioning the current firmware storage area, the partitioning requirements can be set by the user; alternatively, the CPU can partition the firmware storage area according to a pre-defined partitioning standard, which is not limited in this embodiment. The partitioning of the firmware storage area can be completed through the above methods, and the storage space obtained from this partitioning is used to allocate to each firmware file to be stored; after the firmware storage area is partitioned, each firmware file to be stored can be stored in its corresponding storage area.

[0114] Optionally, storing the firmware to the storage partition can be implemented in several ways. In one feasible approach, based on any implementation of Embodiment 2, step 202 may specifically include:

[0115] The CPU reads each firmware file to be stored into memory;

[0116] The CPU stores each firmware file to be stored in memory into the corresponding storage area in the firmware storage area.

[0117] To illustrate with a practical example: after partitioning the firmware storage area, the firmware to be stored can be first read into memory, and then transferred from memory to the corresponding section in the firmware storage area. This allows for the creation of a firmware storage area that includes multiple firmware files. This implementation method enables the establishment of the firmware storage area, upon which subsequent firmware replacement processes can be implemented.

[0118] In practical applications, for the firmware storage area to fulfill its functions, it may involve some data processing, such as the storage of other data and data backup. Accordingly, to further improve the reliability of the firmware storage area, as one possible implementation, based on Embodiment 2, step 201 may specifically include:

[0119] The firmware storage area in the bridge chip is partitioned, resulting in a storage space and a reserved space for each firmware file to be stored. The partitioned storage space is then allocated to each firmware file to be stored and the reserved space, respectively. No firmware data is stored in the reserved space. The size of the reserved space is usually determined by a preset setting, which can be configured by the user.

[0120] When the application scenarios for the CPU need to be expanded, that is, when more firmware corresponding to the application scenarios need to be provided for the CPU to start, the CPU can obtain the firmware to be added and store the firmware to be added in the reserved space.

[0121] This implementation method can further improve the reliability of the firmware storage area, thereby improving the reliability of firmware replacement.

[0122] Taking the above-described implementation method of the CPU partitioning the firmware storage area according to the set partitioning requirements as an example, such as... Figure 3 As shown, Figure 3 This is a schematic diagram showing the distribution of storage areas in the firmware storage area. For example, assuming three firmware files need to be stored, the firmware storage area is divided as follows:

[0123] The four storage zones 0x000000~0x0FFFFF, 0x100000~0x1FFFFF, 0x200000~0x2FFFFF, and 0x300000~0x3FFFFF are reserved space, zone1, zone2, and zone3, respectively. These zones are used to store different firmware versions, with each firmware version occupying one storage zone. The size of each storage zone is the same, which can be 1Mbyte or other sizes. This embodiment does not limit this.

[0124] Optionally, to ensure data accuracy during the firmware storage area creation process, in one implementable manner, based on any embodiment in Example 2, after step 202, the following may be included:

[0125] The CPU performs data verification on the firmware stored in the firmware storage area;

[0126] If data verification fails, return to the step of storing each firmware to be stored in the corresponding storage area in the firmware storage area or output an error message.

[0127] To illustrate with a practical example: after storing each firmware file to be stored in memory into its corresponding storage area within the firmware storage region, each stored firmware data can be compared byte-by-byte with its corresponding firmware data in the external storage device to ensure high accuracy of the firmware data stored within the storage area. This implementation method allows for verification of the accuracy of the firmware data stored within the storage area, thereby ensuring the accuracy of the firmware data in subsequent firmware replacement processes.

[0128] The firmware replacement method provided in this embodiment partitions the firmware storage area and stores each firmware to be stored in the corresponding storage area within the firmware storage area. When there is a firmware replacement requirement, the required firmware can be directly obtained from the firmware storage area and replaced quickly, greatly increasing the efficiency of firmware replacement.

[0129] In some embodiments, the attribute information of the firmware to be stored also includes the firmware type; when performing steps 201 and S202, that is, when storing the firmware to be written, the following steps can also be used.

[0130] The first step is for the CPU to divide the multiple firmware files to be stored into categories based on their firmware types.

[0131] The second step involves the CPU performing the following steps for each firmware type and the corresponding firmware to be stored: obtaining the common part of all firmware to be stored represented by the identifier of all firmware to be stored and the private part of each firmware to be stored; partitioning the firmware storage area in the bridge chip and allocating the partitioned storage areas to the common part of all firmware to be stored and the private part of each firmware to be stored respectively; wherein, the storage area allocated to the common part of all firmware to be stored under this firmware type is the same storage area.

[0132] The third step is for the CPU to store the common parts of multiple firmware files to be stored, as well as the private parts corresponding to each firmware file, into the corresponding storage area.

[0133] For example, in this embodiment, when storing the written firmware, the CPU first categorizes multiple firmware files to be stored according to the firmware type in their corresponding attribute information. For example, if the firmware types include uboot firmware, PMON firmware, and UEFI firmware, then multiple firmware files can be categorized according to the aforementioned firmware types. Afterwards, one or more firmware files to be stored corresponding to each firmware type are obtained.

[0134] Next, for each firmware type, the common parts of all firmware to be stored, as represented by all firmware identifiers under that firmware type, and the private parts of each firmware to be stored under that firmware type, excluding the common parts, are first obtained. The common parts refer to the identical programs in all firmware to be stored under that firmware type; the private parts refer to the programs remaining in each firmware to be stored under that firmware type, excluding the common parts. Then, the firmware storage area in the bridge chip is partitioned to allow for the storage of the aforementioned common parts and private parts. Specifically, for each firmware type, the following steps are performed: a common area is allocated for that firmware type; a corresponding private area is allocated for each firmware corresponding to that firmware type; the common parts corresponding to each firmware type are stored in the common area; and the private parts corresponding to each firmware are stored in the private area.

[0135] Repeat the above process until all firmware corresponding to each firmware type is stored in the storage area.

[0136] For example, assuming a UEFI firmware type includes four firmware files to be stored (Firmware 1 to Firmware 4), the first step is to obtain the common portion 1 of these four firmware files, as well as their respective private portions (Private Portfolio 1 to Private Portfolio 4). The division of the common and private portions can be pre-defined manually or obtained through machine comparison. Then, the storage area can be divided into five storage zones to store the corresponding common portion 1 and private portions 1 to 4 for that firmware type.

[0137] Subsequently, when retrieving the target firmware from the firmware storage area, both the common portion corresponding to that target firmware type and the private portion stored in the storage area can be retrieved simultaneously. These are then combined to obtain the complete target firmware. Specifically, the combination of the common and private portions can be performed according to user-inputted combination rules.

[0138] In this embodiment, to avoid the large storage space occupied when storing multiple firmware in the bridge chip, the multiple firmware to be stored can first be divided according to type. Then, for each firmware type, the common part corresponding to the firmware type and the private part corresponding to the firmware type are determined and stored, thereby reducing the size of the storage space occupied by the firmware to be stored.

[0139] In some embodiments, based on the above embodiments, this embodiment provides a method for writing target firmware. The firmware identifier in the firmware replacement instruction in this embodiment includes a public part identifier and a private part identifier. The method includes the following steps:

[0140] The first step is for the CPU to obtain the public part of the target firmware corresponding to the public part identifier and the private part of the target firmware corresponding to the private part identifier, based on the public part identifier and the private part identifier.

[0141] The second step is for the CPU to obtain the firmware type corresponding to the common part of the target firmware. If it is consistent with the firmware type in the boot flash memory, the CPU will replace the private part of the firmware in the boot flash memory with the private part of the target firmware.

[0142] Third step: If the CPU determines that the firmware type corresponding to the common part of the target firmware is inconsistent with the firmware type in the boot flash memory, then it writes the common part and the private part of the target firmware into the boot flash memory.

[0143] For example, in this embodiment, the target firmware is obtained by searching the firmware storage area using the public and private identifiers in the firmware replacement instruction. After obtaining the public and private parts of the target firmware, the firmware type of the target firmware can be further compared with the firmware type of the firmware currently stored in the boot flash memory. When the comparison results match, the private part corresponding to the firmware in the boot flash memory is directly replaced with the private part corresponding to the target firmware, that is, the private part corresponding to the firmware in the boot flash memory is erased and then the private part of the target firmware is written. If they do not match, it can be considered to completely erase the boot flash memory and then write the public and private parts of the target firmware into the boot flash memory.

[0144] In one example, when performing firmware type comparison, the common part of the target firmware can be compared with the firmware in the boot flash memory. If the boot flash memory includes the common part of the target firmware, the comparison is consistent; otherwise, the comparison is inconsistent.

[0145] In one example, when comparing firmware types, the firmware type identifier in the received firmware replacement instruction can be compared with the firmware type identifier corresponding to the current firmware stored in the boot flash memory. If the identifiers match, it indicates that the firmware types are consistent; otherwise, it indicates that the firmware types are inconsistent.

[0146] In one example, the first and second steps in the above process can also be executed in the opposite order. That is, after confirming consistency, the private part of the target firmware is directly obtained based on the private identifier. If inconsistency is confirmed, both the public and private parts of the target firmware are obtained.

[0147] In this embodiment, when writing the target firmware to the boot flash memory, the firmware in the boot flash memory and the target firmware are first compared to see if their firmware types are consistent. If they are consistent, only the private part of the firmware in the boot flash memory needs to be erased, and the private part of the target firmware needs to be written. If they are inconsistent, then the boot flash memory needs to be completely erased.

[0148] Example 3

[0149] Figure 4A The flowchart of the firmware replacement method provided in Embodiment 3 of this application is as follows: Figure 4A As shown, the firmware replacement method provided in this embodiment is an example implementation, and can be based on, for example, Figure 4B The system architecture diagram shown is used for implementation. Therefore, the firmware replacement method provided in this embodiment specifically includes the following steps.

[0150] Step 301: Compile multiple firmware files to be stored and store them to an external storage device.

[0151] In this embodiment, multiple firmware files to be stored are compiled from source code, namely Firmware A, Firmware B, and Firmware C, and then stored in an external storage device. In this step, to achieve the initial system boot, a default firmware, such as Firmware A, is also determined and written to the boot flash memory. Specifically, the multiple firmware files stored in the external storage device can be firmware obtained by compiling source code. The source code consists of all the code required by the CPU during startup. Specifically, when compiling code corresponding to different firmware versions, one firmware's source code can be selected as a common source code, and subsequent firmware versions' code can be added to, deleted from, or modified based on this common source code.

[0152] Step 302: The CPU partitions the firmware storage area.

[0153] In this embodiment, the firmware storage area is divided into at least four storage zones, one of which is reserved space and not used to store firmware data. Combined with... Figure 4BFor example, the firmware storage area can be set in the bridge chip, so that the CPU can easily obtain the target firmware that needs to be replaced. As shown in the figure, the firmware storage area includes reserved space, firmware A, firmware B, firmware C, firmware D and other firmware storage areas.

[0154] Step 303: The CPU stores each firmware to be stored into the corresponding storage area in the firmware storage area.

[0155] In this embodiment, a CPU is mounted on the motherboard of the computer system. The CPU is connected to both the boot flash memory and the bridge chip. The storage space inside the bridge chip can be used to store the boot firmware; this area is the aforementioned firmware storage area. Furthermore, the motherboard also has an interface to which the CPU connects. External media can connect to the motherboard through this interface, enabling the CPU to communicate with external storage media via the motherboard's interface.

[0156] In practical applications, when the board powers on, the CPU executes firmware A from the boot flash memory, entering the human-machine interface of firmware A. Specifically, after the motherboard powers on, the CPU can start the operation of firmware A in the flash memory based on the pre-stored boot flash memory identifier in the CPU. The user can operate in this interface to send backup commands to the CPU. After receiving the backup command, the CPU reads firmware A from the external storage device into memory. After reading, it stores the firmware A to be stored in the corresponding storage area in the firmware storage area. After executing three backup commands, each firmware to be stored (firmware B, firmware C, and firmware D) in the external storage device is stored in the corresponding storage area in the firmware storage area. After the three backups are completed, the external storage device can be removed. During CPU backup, the backup command received by the CPU includes a backup command opcode, the source storage location of the firmware to be backed up, and the destination storage location of the firmware to be backed up. For example, the command received by the CPU could be: "BackupBios Firmware X path in external storage medium bridge chip Flash area X", where BackupBios is the backup command opcode, the path of firmware X in the external storage medium is the source storage location of the firmware X to be backed up, and bridge chip Flash area X is the destination storage location of the firmware X to be backed up. This backup command writes firmware X to the X storage area of ​​the bridge chip. For example, the command to back up firmware A is "BackupBios / dev / fs / fat@usb0 / gzrom-a.bin zone1", where / dev / fs / fat@usb0 / gzrom-a.bin is the path of firmware A in the external storage medium, and zone1 is the storage zone identifier of firmware A in the firmware storage area.

[0157] After each backup is completed, data verification can be performed on the firmware stored in the firmware storage area. Specifically, the CPU can control the data verification module to perform data verification by comparing each stored firmware data with the corresponding firmware data in the external storage device byte by byte. If the data verification fails, the backup command is returned and executed again or an error message is output. Alternatively, in some embodiments, the CPU can perform the comparison and verification process.

[0158] The data verification module is stored together with each firmware to be stored, and its lifecycle is the entire process from power-on to power-off of the host board during the process of storing each firmware to be stored in the corresponding storage area in the firmware storage area.

[0159] Step 304: The CPU receives a firmware replacement instruction, which includes a firmware identifier.

[0160] Specifically, in this embodiment, after the backup is completed, the board is restarted and powered on, entering the human-machine interface of firmware A. The user can perform corresponding operations to send a firmware replacement command to the CPU, and the CPU can receive the firmware replacement command.

[0161] Step 305: The CPU searches the current firmware storage area according to the firmware replacement instruction and obtains the target firmware corresponding to the firmware identifier. The firmware storage area contains multiple firmwares.

[0162] Specifically, in this embodiment, after receiving a firmware replacement instruction, the CPU searches for the firmware in the current firmware storage area based on the firmware identifier. Assuming the firmware replacement instruction contains the identifier of firmware B, firmware B is found in the firmware storage area as the target firmware to be switched to.

[0163] Step 306: The CPU writes the target firmware to the boot flash memory and performs a reboot operation to complete the firmware replacement.

[0164] Since the firmware stored in the current boot flash memory is firmware A, before writing the target firmware B into the boot flash memory, the CPU controls the reading of firmware A from the current boot flash memory into memory, thus clearing the current boot flash memory, and then the firmware replacement operation can be performed.

[0165] Specifically, in this embodiment, the target firmware B is first read into memory, then the target firmware B in memory is written into the boot flash memory, and then a reboot operation is performed. During this reboot, the CPU executes firmware B from the boot flash memory, thus completing the firmware replacement.

[0166] After writing the target firmware to the boot flash memory, data verification can be performed on the target firmware already stored in the boot flash memory. Specifically, data verification is performed by comparing the target firmware stored in the boot flash memory with the corresponding target firmware in the firmware storage area byte by byte. If the data verification fails, the firmware replacement command will be re-executed or an error message will be output.

[0167] The firmware replacement method provided in this embodiment performs data verification on each firmware and target firmware stored in the corresponding storage area of ​​the firmware storage area, which can ensure the accuracy of the stored firmware data; and sets a reserved space to ensure the normal operation of the firmware storage area.

[0168] Example 4

[0169] Figure 5 The following is a structural diagram of a computer system provided in Embodiment 4 of this application. As shown in the figure, the computer system includes: a CPU, a bridge chip, and a boot flash memory; the CPU is used to receive a firmware replacement instruction, which includes a firmware identifier; the CPU is also used to locate the current firmware storage area according to the firmware replacement instruction, and obtain the target firmware corresponding to the firmware identifier. The firmware storage area stores multiple firmwares and is located in the bridge chip. The CPU and the bridge chip are connected via a bus; the CPU is also used to obtain the target firmware corresponding to the firmware identifier from the firmware storage area; the CPU is also used to write the target firmware into the boot flash memory and perform a reboot operation to complete the firmware replacement.

[0170] Optionally, in the computer system described above, the CPU is further configured to partition the firmware storage area in the bridge chip according to the attribute information of multiple firmwares to be stored, and allocate the partitioned storage area to each firmware to be stored; wherein, the attribute information of the firmware to be stored includes at least the firmware identifier and the size of the storage space occupied by the firmware to be stored; the CPU is further configured to store each firmware to be stored into the corresponding storage area in the firmware storage area.

[0171] Optionally, in the computer system described above, the attribute information of the firmware to be stored also includes firmware type; the CPU is specifically used to divide the multiple firmware to be stored according to their firmware types to obtain the firmware to be stored corresponding to each firmware type.

[0172] For each firmware type corresponding to the firmware to be stored, the CPU performs the following steps: obtain the common part of all firmware to be stored represented by all firmware identifiers and the private part of each firmware to be stored; partition the firmware storage area in the bridge chip, and allocate the storage area obtained by partitioning to the common part of all firmware to be stored and the private part of each firmware to be stored respectively; wherein, the storage area allocated to the common part of all firmware to be stored under this firmware type is the same storage area.

[0173] The CPU is specifically used to store the common part of the firmware to be stored for each firmware type and the private part of each firmware to be stored into the corresponding storage range.

[0174] Optionally, in the above-mentioned computer system, the firmware identifier in the firmware replacement instruction includes: a public part identifier and a private part identifier;

[0175] The CPU is specifically used to obtain the public part of the target firmware corresponding to the public part identifier and the private part of the target firmware corresponding to the private part identifier based on the public part identifier and the private part identifier.

[0176] The CPU is specifically used to obtain the firmware type corresponding to the common part of the target firmware. If it is consistent with the firmware type in the boot flash, the private part corresponding to the firmware in the boot flash is replaced with the private part corresponding to the target firmware.

[0177] The CPU is specifically used to write the common part and the private part of the target firmware into the boot flash if it is determined that the firmware type corresponding to the common part of the target firmware is inconsistent with the firmware type in the boot flash.

[0178] Optionally, in the computer system described above, the CPU is specifically used to partition the firmware storage area in the bridge chip, and the partitioning result includes the storage area and reserved space corresponding to each firmware to be stored; and

[0179] The CPU is specifically used to allocate the storage space obtained from the partition to each firmware to be stored, and to reserve space where firmware data is not stored.

[0180] Optionally, in the computer system described above, the CPU is also used to acquire the firmware to be added and store the firmware to be added in reserved space.

[0181] Optionally, in the computer system described above, the CPU is specifically used to read each firmware to be stored into memory; the CPU is specifically used to store each firmware to be stored in memory into the corresponding storage area in the firmware storage area.

[0182] Alternatively, the computer system described above,

[0183] The CPU is also used to verify the data of the firmware stored in the firmware storage area.

[0184] If CPU data verification fails, return to the step of storing each firmware to be stored in the corresponding storage area in the firmware storage area or output an error message.

[0185] Alternatively, the computer system described above,

[0186] The CPU is specifically used to read the target firmware stored in the firmware storage area into memory.

[0187] The CPU is specifically used to write the target firmware from memory into the boot flash memory.

[0188] Alternatively, the computer system described above,

[0189] The CPU is also used to perform data verification on the target firmware written in the boot flash memory based on the target firmware in the firmware storage area; if the CPU data verification fails, it returns to the step of writing the target firmware to the boot flash memory or outputs an error message; if the CPU data verification succeeds, it performs a reboot operation.

[0190] like Figure 6 The diagram shown is a structural schematic of a computer provided according to an embodiment of this application. The computer can be various forms of digital computer, such as laptop computers, desktop computers, workstations, servers, blade servers, mainframe computers, and other suitable computers. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present application described and / or claimed herein.

[0191] like Figure 6 As shown, the computer includes: a memory 501, a processor 502, and a computer program.

[0192] The computer program is stored in a memory and configured to be executed by a processor to implement the firmware replacement method as provided in Embodiment 1 or Embodiment 2.

[0193] The memory 501 and the processor 502 are interconnected via circuitry. Specifically, the various components are interconnected via a bus and can be mounted on a common motherboard or otherwise installed as needed. The processor can process instructions that execute within the computer system.

[0194] The memory 501, as a computer-readable storage medium, can be used to store non-transitory software programs, non-transitory computer-executable programs, and modules, such as the program instructions / modules corresponding to the firmware replacement method in the embodiments of this application. The processor 502 executes various functional applications and data processing of the server by running the non-transitory software programs, instructions, and modules stored in the memory 501, thereby implementing the firmware replacement method in the above method embodiments.

[0195] This application also provides a computer program product, including computer instructions that, when executed by a processor, implement the firmware replacement method provided in this application.

[0196] Other embodiments of the present application will readily occur to those skilled in the art upon consideration of the specification and practice of the application disclosed herein. This application is intended to cover any variations, uses, or adaptations of the embodiments of this application that follow the general principles of the embodiments of this application and include common knowledge or customary techniques in the art not disclosed in the embodiments of this application. The specification and embodiments are to be considered exemplary only, and the true scope and spirit of the embodiments of this application are indicated by the following claims.

[0197] It should be understood that the embodiments of this application are not limited to the precise structures described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from their scope. The scope of the embodiments of this application is limited only by the appended claims.

Claims

1. A firmware replacement method, characterized in that, Applied to a computer system, the computer system including a CPU, a bridge chip, and boot flash memory, the method includes: The CPU partitions the firmware storage area located in the bridge chip according to the attribute information of multiple firmwares to be stored, and allocates the partitioned storage area to each firmware to be stored; wherein, the CPU and the bridge chip are connected via a bus; the attribute information of the firmware to be stored includes at least the firmware identifier, the size of the storage space occupied by the firmware, and the firmware type; The CPU stores the common part of the firmware to be stored for each firmware type and the private part of each firmware to be stored into the corresponding storage area; wherein, for each firmware type, the storage area allocated to the common part of all firmware to be stored under that firmware type is the same storage area. The CPU receives a firmware replacement instruction, which includes a firmware identifier. The CPU searches the firmware storage area according to the firmware replacement instruction and retrieves the target firmware corresponding to the firmware identifier from the firmware storage area; The CPU writes the target firmware into the boot flash memory; and Perform a reboot operation and read the target firmware from the boot flash memory to complete the firmware replacement.

2. The method according to claim 1, characterized in that, The CPU partitions the firmware storage area in the bridge chip according to the attribute information of multiple firmware files to be stored, including: The CPU divides the multiple firmware to be stored into multiple firmware types according to the firmware type, and obtains the firmware to be stored corresponding to each firmware type. For each firmware type, the CPU performs the following steps for all firmware to be stored: obtaining the common part of all firmware to be stored and the private part corresponding to each firmware; partitioning the firmware storage area in the bridge chip, and allocating the storage area obtained from the partitioning to the common part of all firmware to be stored and the private part corresponding to each firmware.

3. The method according to claim 2, characterized in that, The firmware identifier in the firmware replacement instruction includes: a public part identifier and a private part identifier; The CPU retrieves the target firmware corresponding to the firmware identifier from the firmware storage area, including: the CPU retrieves the public part of the target firmware corresponding to the public part identifier and the private part of the target firmware corresponding to the private part identifier based on the public part identifier and the private part identifier. The CPU writes the target firmware into the boot flash memory, including: The CPU obtains the firmware type corresponding to the common part of the target firmware. If it is consistent with the firmware type in the boot flash memory, the CPU replaces the private part corresponding to the firmware in the boot flash memory with the private part corresponding to the target firmware. If the CPU determines that the firmware type corresponding to the common part of the target firmware is inconsistent with the firmware type in the boot flash memory, it writes the common part of the target firmware and the private part of the target firmware into the boot flash memory.

4. The method according to claim 1, characterized in that, The partitioning result obtained after performing partitioning also includes the storage range and reserved space corresponding to each firmware to be stored, wherein firmware data is not stored in the reserved space.

5. The method according to claim 4, characterized in that, The method further includes: The CPU acquires the firmware to be added and stores the firmware to be added in the reserved space.

6. The method according to any one of claims 1-5, characterized in that, The CPU stores each firmware file to be stored into the corresponding storage area in the firmware storage area, including: The CPU reads each firmware file to be stored into memory; The CPU stores each firmware file to be stored in memory into the corresponding storage area in the firmware storage area.

7. The method according to claim 6, characterized in that, After the CPU stores each firmware file to be stored into the corresponding storage area in the firmware storage area, it also includes: The CPU performs data verification on the firmware stored in the firmware storage area; If the CPU data verification fails, the process returns to the step of storing each firmware to be stored in the corresponding storage area of ​​the firmware storage area or an error message is output.

8. The method according to any one of claims 1-5, characterized in that, The CPU writes the target firmware into the boot flash memory, including: The CPU reads the target firmware stored in the firmware storage area into memory; The CPU writes the target firmware from memory into the boot flash memory.

9. The method according to any one of claims 1-5, characterized in that, After the CPU writes the target firmware to the boot flash memory, it also includes: The CPU performs data verification on the target firmware written in the boot flash memory based on the target firmware in the firmware storage area. If the CPU data verification fails, return to the step of writing the target firmware to the boot flash memory or output an error message. The CPU performs a restart operation, including: If the CPU data verification is successful, a restart operation will be performed.

10. A computer system, characterized in that, It includes a CPU, a bridge chip, and a boot flash memory; the CPU is used to receive firmware replacement instructions, the firmware replacement instructions including a firmware identifier; The CPU is used to partition the firmware storage area located in the bridge chip according to the attribute information of multiple firmwares to be stored, and allocate the partitioned storage area to each firmware to be stored; wherein, the CPU and the bridge chip are connected via a bus; the attribute information of the firmware to be stored includes at least the firmware identifier, the size of the storage space occupied by the firmware, and the firmware type. The CPU is used to store the common part of the firmware to be stored for each firmware type and the private part of each firmware to be stored to the corresponding storage area; wherein, for each firmware type, the storage area allocated to the common part of all firmware to be stored under that firmware type is the same storage area. The CPU is also used to locate the current firmware storage area according to the firmware replacement instruction, and to retrieve the target firmware corresponding to the firmware identifier from the firmware storage area; The CPU is also used to write the target firmware into the boot flash memory and perform a reboot operation to complete the firmware replacement.

11. A computer, characterized in that, include: Memory, processor, and computer programs; The processor can process instructions executed within the computer system; The computer program is stored in the memory and configured to be executed by the processor to implement the firmware replacement method as described in any one of claims 1-9.

12. A computer-readable storage medium, characterized in that, It stores a computer program, which is executed by a processor to implement the firmware replacement method as described in any one of claims 1-9.

13. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by the processor, it implements the firmware replacement method as described in any one of claims 1-9.