Basic input output system flashing method, device and system
By automatically identifying the flashing mode and architecture of BIOS devices, the problem of poor compatibility of traditional flashing tools is solved, and efficient, stable and secure firmware flashing with cross-architecture compatibility is achieved.
Patent Information
- Application Number
- CN202611025331.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-10
- Publication Date
- 2026-11-10
AI Technical Summary
Traditional BIOS firmware flashing tools cannot adapt to different CPU architectures and their corresponding firmware design specifications, resulting in cumbersome operation procedures, easy errors in manual configuration, and difficulty in meeting the operation and maintenance needs of multi-architecture and multi-mode mixed deployment scenarios.
By acquiring the basic input/output system identification data and hardware architecture data of the device to be flashed, the flashing mode is identified using a preset feature matching algorithm, and a central processing unit architecture identification result is generated based on the hardware architecture. The firmware flashing operation is then automatically executed, eliminating the need for manual configuration and achieving cross-architecture adaptation.
It achieves efficient and stable multi-architecture and multi-mode firmware flashing, reduces the threshold of operation and maintenance and the failure rate of flashing, and improves the stability and security of flashing.
Smart Images

Figure CN123069467A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, and more specifically, to a basic input / output system writing method, apparatus, and system. Background Technology
[0002] The BIOS (Basic Input Output System) is the first low-level firmware program to run during the computer startup process. It undertakes the core functions of hardware initialization, self-test, and booting the operating system. The correctness and reliability of its flashing operation are directly related to the operational stability and data security of the entire device.
[0003] With the rapid development of the domestic IT innovation industry, domestically produced ARM architecture chips, represented by Kunpeng, have achieved large-scale deployment in servers, industrial control equipment, and data center clusters. The challenges of BIOS firmware flashing have expanded from the previous single x86 platform to a complex situation involving multiple hardware platforms. Specifically, the firmware design specifications of different architecture platforms differ fundamentally. The Kunpeng ARM architecture follows firmware standards based on ACPI and PSCI interfaces, while the traditional x86 architecture uses firmware standards based on UEFI specifications and ACPI. These differ significantly in firmware storage format, hardware resource description methods, boot processes, and underlying interface definitions, making flashing tools originally developed for x86 platforms incompatible with ARM platforms. Simultaneously, multiple flashing modes coexist, such as BIOSGuard (Intel's secure firmware flashing mode) and SecureFlash (a universal secure firmware flashing mode). Support for these flashing modes varies across manufacturers, and different devices under the same architecture may support different flashing protocols. The combination of these two factors presents a double challenge to BIOS firmware flashing: on the one hand, the flashing tool needs to be compatible with different CPU architectures and their corresponding firmware design specifications; on the other hand, the flashing tool also needs to be compatible with the flashing modes supported by the device and adopt the corresponding flashing protocols.
[0004] Traditional flashing methods, which rely on manual judgment and configuration, suffer from drawbacks in actual operation and maintenance. These include cumbersome procedures, frequent switching of tool versions for devices with different architectures, and errors in manual selection leading to flashing failures. These shortcomings make it difficult to meet the operational needs of current multi-architecture, multi-mode mixed deployment scenarios. Therefore, it is urgent to solve this technical problem. Summary of the Invention
[0005] In view of the above situation, this application provides a basic input / output system flashing method, apparatus and system, which aims to solve the above problems or at least partially solve the above problems.
[0006] In a first aspect, embodiments of this application provide a basic input / output system flashing method, the method comprising: Obtain the basic input / output system identification data and hardware architecture data of the device to be flashed / written; Using a preset feature matching algorithm, based on a preset flashing mode feature library and the basic input / output system identification data, the flashing mode supported by the device to be flashed is identified; Based on the hardware architecture data, generate the central processing unit architecture identification result of the device to be flashed; Based on the flashing mode and the central processing unit architecture identification result, the firmware flashing operation is performed on the device to be flashed.
[0007] Secondly, embodiments of this application also provide a basic input / output system writing device, the device comprising: The acquisition module is used to acquire the basic input / output system identification data and hardware architecture data of the device to be flashed / written; The identification module is used to identify the writing mode supported by the device to be written by using a preset feature matching algorithm, based on a preset writing mode feature library and the basic input / output system identification data. The generation module is used to generate the central processing unit architecture identification result of the device to be flashed based on the hardware architecture data. The flashing module is used to perform firmware flashing operations on the device to be flashed based on the flashing mode and the central processing unit architecture identification result.
[0008] Thirdly, this application embodiment also provides a basic input / output system flashing system, the system including: a flashing server, a device to be flashed, and an operation and maintenance platform; The flashing server is used to perform the steps of the basic input / output system flashing method as described in the first aspect; The device to be flashed is used to respond to the instructions sent by the flashing server and return execution status data; The operation and maintenance platform is used to receive and display the flashing status data, alarm messages and audit logs reported by the flashing server.
[0009] By employing the above technical solutions, the basic input / output system (BIS) flashing method, apparatus, and system provided in this application embodiment collect the BIS firmware identifier and hardware architecture data of the device to be flashed, providing a reliable underlying hardware basis for subsequent mode matching and architecture adaptation. Based on this, relying on a preset flashing mode feature library and feature matching algorithm, the flashing modes supported by the device are automatically identified, eliminating the need for manual configuration of mode parameters and avoiding flashing failures caused by human configuration errors. At the same time, based on the hardware architecture data, the central processing unit architecture is determined, and the corresponding architecture's flashing parameters and execution logic are called, achieving compatibility of a single tool with devices of different architectures, significantly reducing cross-architecture adaptation costs. Then, the firmware flashing is performed by combining the identified flashing mode and architecture results. Ultimately, this embodiment can achieve a more efficient and stable multi-architecture, multi-mode firmware flashing effect, effectively reducing the operation and maintenance threshold and the flashing failure rate.
[0010] The above description is only an overview of the technical solution of this application. In order to better understand the technical means of this application and to implement it in accordance with the contents of the specification, and to make the above and other objects, features and advantages of this application more obvious and understandable, the following are specific embodiments of this application. Attached Figure Description
[0011] The accompanying drawings, which are included to provide a further understanding of this application and form part of this application, illustrate exemplary embodiments of this application and are used to explain this application, but do not constitute an undue limitation of this application. In the drawings: Figure 1 A flowchart illustrating the basic input / output system flashing method provided in an embodiment of this application is shown; Figure 2 This paper shows a schematic diagram of the basic input / output system writing system provided in an embodiment of this application; Figure 3 A schematic diagram of the basic input / output system writing device provided in an embodiment of this application is shown; Figure 4 A schematic diagram of the structure of an electronic device provided in an embodiment of this application is shown. Detailed Implementation
[0012] To make the objectives, technical solutions, and advantages of this application clearer, the technical solutions of this application will be clearly and completely described below in conjunction with specific embodiments and corresponding drawings. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of them. Based on the embodiments in this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0013] It should be noted that similar labels and letters in the following figures indicate similar items. Therefore, once an item is defined in one figure, it does not need to be further defined and explained in subsequent figures.
[0014] It should be noted that the terms "first," "second," etc., in the specification 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 use can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the term "comprising" and its variations should be interpreted as open-ended terms meaning "including but not limited to."
[0015] As mentioned earlier, traditional flashing methods relying on manual judgment and configuration suffer from drawbacks in actual operation and maintenance, such as cumbersome operation procedures, frequent switching of tool versions for different architecture devices, and errors in manual selection leading to flashing failures. These shortcomings make it difficult to meet the operational and maintenance needs of current multi-architecture, multi-mode hybrid deployment scenarios. Therefore, this invention proposes a basic input / output system flashing method, apparatus, and system. The following detailed description of specific embodiments further illustrates this application.
[0016] To facilitate understanding of this embodiment, a basic input / output system flashing method disclosed in this application embodiment will first be described in detail. Figure 1 This paper illustrates a flowchart of a basic input / output system flashing method provided in an embodiment of this application. Figure 1 It can be seen that the embodiments of this application include at least steps S101-S104: S101: Obtain the basic input / output system identification data and hardware architecture data of the device to be flashed / written; S102: Using a preset feature matching algorithm, based on a preset flashing mode feature library and the basic input / output system identification data, identify the flashing mode supported by the device to be flashed; S103: Based on the hardware architecture data, generate the central processing unit architecture identification result of the device to be flashed; S104: Based on the flashing mode and the central processing unit architecture identification result, perform firmware flashing operation on the device to be flashed.
[0017] It should be noted that the execution entity of the basic input / output system flashing method provided in this application embodiment is generally a computer device with certain computing capabilities. This computer device can be an independent operation and maintenance management terminal, a data center management server, the internal firmware of a baseboard management controller, a cloud-based operation and maintenance platform, an industrial control host computer, an automatic testing device, a virtual machine or container environment, or a plugin or script embedded in IT operation and maintenance software. The execution entity is connected to the device to be flashed via a communication interface to achieve secure flashing of the basic input / output system of the device. In some possible implementations, this basic input / output system flashing method can be implemented by a processor calling computer-readable instructions stored in memory.
[0018] As can be seen, the automatic adaptation method for basic input / output system (BIS) flashing provided in this embodiment collects the BIS firmware identifier and hardware architecture data of the device to be flashed, providing a reliable underlying hardware basis for subsequent mode matching and architecture adaptation. Based on this, it automatically identifies the flashing modes supported by the device by relying on a preset flashing mode feature library and feature matching algorithm, eliminating the need for manual configuration of mode parameters and avoiding flashing failures caused by human configuration errors. At the same time, it determines the central processing unit (CPU) architecture based on the hardware architecture data, calls the corresponding architecture's flashing parameters and execution logic, and achieves compatibility of a single tool with devices of different architectures, significantly reducing cross-architecture adaptation costs. Then, it combines the identified flashing mode and architecture results to perform firmware flashing. Ultimately, this embodiment can achieve a more efficient and stable multi-architecture, multi-mode firmware flashing effect, effectively reducing the operational threshold and flashing failure rate.
[0019] The following provides a detailed explanation of S101-S104.
[0020] Regarding the above S101: In this application, the device to be flashed refers to a physical computer hardware device that needs to have its BIOS firmware flashed, such as a server, industrial control equipment, personal computer, or any computing device that contains a BIOS chip and needs to update its underlying firmware.
[0021] Basic Input / Output System Identifier data refers to a set of structured binary data stored in a preset offset position in the header of the BIOS firmware of the device to be flashed. It includes at least a mode identifier bit in the preset offset position in the firmware header. The mode identifier bit is characterized by a specific value to indicate the flashing mode type supported by the firmware of the device.
[0022] Hardware architecture data refers to information that can characterize the instruction set type used by the central processing unit of the device to be flashed, such as ARM64 (corresponding to domestic chips such as Kunpeng) or x86_64 (corresponding to Intel and AMD chips), which is usually represented as a CPU model string or an encoded value in the architecture register.
[0023] In practice, for example, a data query command is first sent to the baseboard management controller on the device to be flashed via a network using standard management protocols such as IPMI, Redfish, or SSH. After receiving the command, the baseboard management controller reads the complete identification data stored in the basic input / output system firmware header from the firmware storage area of the device to be flashed. The identification data includes at least the mode identifier bit at a preset offset position in the firmware header. This complete identification data is returned to the execution subject of this method as basic input / output system identification data. At the same time, the baseboard management controller obtains hardware architecture data that can characterize the instruction set type by reading the model string or architecture register code value of the central processing unit of the device to be flashed and returns it to the execution subject of this method. After receiving the returned data, the execution subject of this method temporarily stores it in local memory for subsequent automatic identification of the flashing mode and central processing unit architecture.
[0024] Regarding S102 above: After obtaining the basic input / output system identification data, a preset feature matching algorithm is used to identify the flashing mode supported by the device to be flashed, based on the preset flashing mode feature library and the basic input / output system identification data.
[0025] Specifically, in some embodiments, the step of using a preset feature matching algorithm to identify the flashing modes supported by the device to be flashed, based on a preset flashing mode feature library and the basic input / output system identifier data, includes: Extract the mode identifier bit from the basic input / output system identifier data; By matching the mode identifier with the mode identifier in the preset flashing mode feature library, the flashing modes supported by the device to be flashed are obtained.
[0026] In this embodiment, firstly, the mode identifier bit is extracted from the Basic Input / Output System Identification (BIS) data. As mentioned earlier, the BIS data here includes at least a mode identifier bit at a preset offset position in the firmware header. This mode identifier bit is a numeric field, for example, the value at offset 0x1000 is 0x01 or 0x5A. In specific implementation, a specified length of byte content can be located and read from this data according to the preset offset (defined by the firmware specification), converted into an integer value, and temporarily stored in a memory variable as input data for subsequent matching operations.
[0027] The mode identifier is then matched with the mode identifier in the preset flashing mode feature library to obtain the flashing modes supported by the device to be flashed. The preset flashing mode feature library refers to a set of configuration data stored in advance, in which the standard mode identifier values corresponding to BIOSGuard mode and SecureFlash mode are recorded respectively. For example, BIOSGuard corresponds to 0x01 and SecureFlash corresponds to 0x02.
[0028] In practice, the extracted actual pattern identifier value can be used as the query key value. The records in the feature library are traversed, and a numerical equality judgment is performed on each record. If a matching record is found, the pattern name corresponding to the record (such as "BIOSGuard" or "SecureFlash") is output as the recognition result and stored in memory. If all records do not match, a recognition failure signal is generated and the subsequent flashing process is terminated.
[0029] It is understandable that the aforementioned feature library also contains record entries corresponding to firmware identifiers for domestic ARM architecture processors (such as Kunpeng). These entries record the correspondence between the flashing mode identifier value and the flashing mode for this type of architecture device, so that the feature library can cover the identifier features of domestic ARM architecture firmware during the matching process, thereby improving the accuracy of identifying the flashing mode of this type of device.
[0030] This embodiment first extracts the mode identifier bit from the basic input / output system identifier data, directly obtaining the core mode determination features built into the firmware, reducing the collection and processing of invalid information. Then, the extracted mode identifier bit is matched and compared with the mode identifier bit in the preset flashing mode feature library to quickly determine the flashing mode supported by the device to be flashed, without the need for manual configuration of mode parameters, while ensuring the accuracy and efficiency of the recognition results. Finally, this embodiment can achieve a highly efficient and accurate flashing mode recognition effect, effectively avoiding flashing failure caused by manual configuration errors, and improving the operational stability of the pre-flashing process.
[0031] Regarding the above S103: This application embodiment also requires generating a central processing unit architecture identification result for the device to be flashed based on the hardware architecture data.
[0032] In practice, for example, hardware architecture data is parsed. If the CPU model string in the parsing result contains "Kunpeng" or the architecture register code value falls within the encoding range of the ARM architecture, an identification result indicating that the device is an ARM architecture is generated. If the CPU model string in the parsing result contains "Intel" or "AMD" or the architecture register code value falls within the encoding range of the x86 architecture, an identification result indicating that the device is an x86 architecture is generated. Finally, the central processing unit architecture identification result data is formed and temporarily stored in memory for subsequent steps to call.
[0033] Regarding S104 above: Finally, based on the flashing mode and the central processing unit architecture identification result, the firmware flashing operation is performed on the device to be flashed.
[0034] In some embodiments, performing a firmware flashing operation on the device to be flashed based on the flashing mode and the central processing unit architecture identification result includes: Based on the central processing unit architecture identification results, the corresponding hardware driver parameters are generated; Based on the flashing mode, generate the corresponding firmware transmission protocol parameters; Based on the hardware driver parameters and the firmware transmission protocol parameters, the new basic input / output system image file to be written is written to the device to be flashed.
[0035] In this embodiment, firstly, based on the central processing unit architecture identification result, corresponding hardware driver parameters are generated. Here, hardware driver parameters refer to the underlying hardware operation configuration data bound to a specific CPU architecture, specifically including the SPI controller clock frequency, command transmission timing, chip erase and write command sequence format, status register reading method, and timeout waiting time, etc.
[0036] In practice, the architecture identification result obtained in step S103 can be used as the query key to search for and read the underlying hardware operation configuration data that matches the architecture in the local preset driver configuration table, and load these configuration data into memory for use in subsequent writing steps.
[0037] Based on the flashing mode, corresponding firmware transmission protocol parameters are generated. Here, firmware transmission protocol parameters refer to data transmission rule configuration data bound to a specific flashing mode, specifically including data block size, whether an encrypted channel needs to be established before transmission, whether handshake authentication needs to be performed, and data packet encapsulation format, etc. For example, BIOSGuard mode requires enabling an encrypted channel and transmitting data in blocks according to a specific protocol data unit format, while SecureFlash mode uses a standard block transmission protocol and does not require an encrypted channel.
[0038] In specific implementation, for example, the flashing mode recognition result obtained in step S102 can be used as a query key value to search for and read the corresponding transmission parameter set in the preset protocol configuration table, and load these parameter values into memory and store them together with the hardware driver parameters.
[0039] Finally, based on the hardware driver parameters and the firmware transfer protocol parameters, the new basic input / output system image file to be written is written to the device to be flashed. Here, the new basic input / output system image file refers to the new firmware program data package to be written to the BIOS storage chip of the device to be flashed. It contains complete firmware binary code and is usually released by server manufacturers or BIOS manufacturers.
[0040] In practice, for example, the new basic input / output system image file is first read completely from local storage into a memory buffer. Then, it is divided into several data blocks according to the block size in the firmware transmission protocol parameters. Each data block is processed according to the encapsulation format required by the protocol. Then, according to the SPI operation timing in the hardware driver parameters, the data blocks are sent one by one to the baseboard management controller or BIOS interface of the device to be flashed via the network protocol. After each data block is sent, the tool waits for the device to be flashed to return a write confirmation signal. If confirmation is received, the tool continues to send the next block. If a timeout occurs or an error response is received, the failure information is recorded and the sending is terminated until all data blocks are sent and the overall write confirmation is completed.
[0041] This embodiment first generates corresponding hardware driver parameters based on the central processing unit architecture identification result, and simultaneously generates adapted firmware transmission protocol parameters based on the flashing mode identification result, ensuring hardware adaptability and protocol compatibility of the flashing link. Then, based on the above parameters, the new firmware image is transmitted to the device to be flashed, and the write status feedback of each data block is received synchronously to realize segmented real-time monitoring of the flashing process. Finally, the firmware flashing execution result is generated based on the full write feedback. Ultimately, this embodiment can obtain a more stable and controllable firmware flashing execution effect, ensuring the adaptability and process reliability of flashing operations in cross-architecture and multi-mode scenarios.
[0042] In some embodiments, before the step of performing a firmware flashing operation on the device to be flashed based on the flashing mode and the central processing unit architecture identification result, the method further includes: Obtain the new basic input / output system image file of the device to be flashed; Using the first hash algorithm, the hash value of the new basic input / output system image file is calculated, and the hash value is compared with the pre-stored standard hash value to generate an integrity verification result; If the integrity verification result is successful, the digital signature attached to the new basic input / output system image file is decrypted using the public key to obtain the first digest value; Using a second hash algorithm, the hash value of the new basic input / output system image file is calculated to obtain a second digest value; by comparing the first digest value with the second digest value, a signature verification result is generated; If the integrity verification result is unsuccessful or the signature verification result is unsuccessful, a verification failure signal is generated and the writing process is terminated. If the integrity verification result is successful and the signature verification result is successful, a verification success signal is generated, and subsequent write operations continue.
[0043] In this embodiment, the pre-stored standard hash value refers to the hash value calculated by performing a specific hash algorithm on the original image file, which is simultaneously published by the firmware publisher when releasing a new basic input / output system image file. This value is usually published on the official website or provided with the firmware package as a reference for verifying file integrity. The digital signature is an additional data block generated by the firmware publisher after encrypting the content of the image file using their own private key. It is distributed with the image file and used to prove the legitimacy of the firmware's origin. The public key is a public key paired with the publisher's private key and is pre-built into the flashing tool to decrypt the digital signature.
[0044] In practice, the binary data of the new basic input / output system image file can be read completely first and loaded into memory as the data source to be verified. Then, the first hash algorithm (such as SHA-256 or SM3) is called to calculate the hash value byte by byte of the entire image file content loaded into memory, resulting in a fixed-length hash value. This hash value is then compared bit by bit at the string or byte array level with the pre-stored standard hash value. If the two are completely consistent, a "pass" integrity verification result is generated; otherwise, a "fail" integrity verification result is generated.
[0045] If the integrity verification result is successful, the attached digital signature data block is extracted from the predetermined offset position of the image file (usually the end of the file or a specified area in the firmware header). Then, the built-in cryptography library is called to perform an asymmetric decryption operation on the digital signature using the pre-stored publisher's public key. After successful decryption, the first digest value is output. The second hash algorithm (in actual implementation, it is the same as the first hash algorithm, such as SHA-256) is used to recalculate the hash value of the image file content in memory to obtain the second digest value. Then, the first digest value and the second digest value are compared byte by byte. If they are completely consistent, a "passed" signature verification result is generated; otherwise, a "failed" signature verification result is generated.
[0046] If the integrity verification result or the signature verification result fails, a verification failure signal is generated, the corresponding error message is output, and the entire flashing process is terminated, without performing any subsequent write operations; only when both the integrity verification result and the signature verification result pass, a verification pass signal is generated, allowing the process to continue to execute subsequent permission verification and flashing operations.
[0047] This embodiment first obtains the new firmware image file to be flashed, calculates the hash value of the image file using a hash algorithm and compares it with a pre-stored standard value to complete the image integrity verification. This can accurately identify anomalies such as corrupted file transmission and malicious tampering of content. If the integrity verification passes, the digital signature attached to the image is further decrypted using a public key to obtain the corresponding digest value. The digest value of the current image is calculated simultaneously and compared to verify the legitimacy of the firmware source. If either of the double verifications fails, the flashing process is terminated, intercepting abnormal firmware at the flashing entry point. Ultimately, this embodiment achieves a more rigorous and reliable firmware flashing security protection effect, effectively resisting the underlying security risks brought about by malicious image injection and illegal firmware tampering.
[0048] In some embodiments, before the step of performing a firmware flashing operation on the device to be flashed based on the flashing mode and the central processing unit architecture identification result, the method further includes: Obtain the current operator's identity authentication information and generate operator permission level data, which includes one of the following: administrator permission, operation and maintenance personnel permission, and ordinary user permission; Based on the operator's permission level data and the write range indicated by the new basic input / output system image file, a write enable signal or a write block signal is generated; Based on the write-allow signal or write-block signal, and the device physical access verification result obtained from the baseboard management controller of the device to be written, a final operation authorization signal is generated. Based on the final operation authorization signal, determine whether to continue the flashing operation.
[0049] In this embodiment, firstly, the identity authentication information of the current operator is obtained, and operator permission level data is generated. Here, identity authentication information refers to the account credentials submitted by the operator when logging into the flashing tool (the specific software tool for implementing the method proposed in this application), such as username and password, digital certificate, or USB key. In specific implementation, for example, the user identifier of the current login session is first captured, and then, according to the preset mapping relationship between accounts and permissions, an operator permission level data representing the permission level is generated. This data is specifically an enumeration value, for example, using the number 0 to represent an administrator, 1 to represent an operations and maintenance personnel, and 2 to represent a regular user. This enumeration value is temporarily stored in memory as the basis for subsequent decisions.
[0050] Next, based on the operator's permission level data and the flash range indicated by the new basic input / output system image file, a flash enable signal or a flash block signal is generated. Here, the flash range indicated by the image file can be obtained by parsing the image file header or accompanying metadata; a complete image indicates a full flash, while a differential upgrade package or patch file indicates an incremental update.
[0051] In practice, for example, if the privilege level is administrator, a full write permission signal is generated regardless of the range indicated by the image; if the privilege level is operations and maintenance personnel, an incremental update permission signal is generated only when the image indicates an incremental update; if the privilege level is ordinary user, or if operations and maintenance personnel attempt to perform a full write, a write blocking signal is generated directly. This judgment result is stored in memory as a Boolean flag or an enumeration value for further combined judgments.
[0052] Next, based on the write-allow signal or write-block signal and the device physical access verification result obtained from the board management controller of the device to be written, a final operation authorization signal is generated.
[0053] Here, the device physical access verification result refers to a Boolean value returned by the BMC after a query request is sent to the board management controller (BMC) on the device to be flashed via the network. The BMC returns this value based on hardware sensor data, such as the chassis cover opening status and physical presence pin signals. If the chassis cover has been opened, it returns "valid"; if the chassis cover remains closed, it returns "illegal". The device physical access verification result indicates whether anyone has touched the hardware at the device site. In practice, for example, a query command for physical access status is sent to the BMC of the device to be flashed via IPMI or Redfish protocol. The system waits for the BMC to return a status code (e.g., "1" for valid, "0" for illegal). Then, this status code is logically ANDed with the signal generated in the second step. Only if the signal in the second step is a valid signal and the BMC returns a valid response is a flashing operation authorization signal generated; otherwise, an illegal operation blocking signal is generated.
[0054] Finally, based on the final operation authorization signal, it is determined whether to continue the flashing operation. Specifically, for example, if a flashing operation authorization signal is generated, subsequent image writing and other operations continue; if an illegal operation blocking signal is generated, the entire flashing process is immediately terminated, and the operator is prompted with error messages such as "insufficient permissions" or "physical access verification failed" on the interface. The blocked operation is also recorded in the log for subsequent security auditing.
[0055] This embodiment first collects the current operator's identity authentication information and classifies the corresponding permission levels to clarify the operation boundaries of different operation roles. Then, it combines the permission level with the flashing range corresponding to the new firmware image to generate a preliminary operation permission judgment, completing the first level of permission control from the operation side. On this basis, it links the physical access verification result obtained from the baseboard management controller of the device to be flashed for a second verification and supplements the legality verification from the device access side. The final operation authorization signal is generated and the flashing process is decided accordingly. In the end, this embodiment can achieve a more rigorous and comprehensive flashing permission control effect, effectively avoiding the underlying firmware security risks caused by unauthorized operations and unauthorized device access.
[0056] In practice, the UEFI secure boot module can also replace the BMC, which is more in line with the encryption specifications of domestic IT innovation scenarios.
[0057] In some embodiments, the method further includes: Based on the firmware writing progress data and hardware sensor parameter data continuously collected during the flashing process, the current flashing status feature data is generated. Based on the current write status feature data and the preset normal status threshold range, anomaly detection result data is generated, which includes a normal identifier or an anomaly identifier. When the anomaly detection result data is an anomaly identifier, an anomaly event trigger signal is generated; Based on the abnormal event trigger signal and the pre-recorded operator identity, operation time, and image file identifier, an audit log record and a real-time alarm message are generated, and the real-time alarm message is reported to the operation and maintenance platform.
[0058] In this embodiment, during the process of sending data blocks to the device to be written, the writing status is recorded after each data block is sent. At the same time, the hardware parameter values such as voltage and temperature are periodically read through the sensor data interface of the baseboard management controller. The writing progress information and hardware parameter information are summarized and packaged according to the timestamp to form a current writing status feature data containing the current writing percentage, the most recent successful writing flag, the current voltage value and temperature value, and stored in the memory buffer of the main body of this method execution.
[0059] Next, the voltage, temperature, and other parameter values in the current write status feature data are compared one by one with the preset normal state threshold ranges. The preset normal state threshold ranges are a set of predefined hardware parameter boundary values, such as the normal range of motherboard voltage being 11.8 volts to 12.2 volts and the normal range of CPU temperature being below 85 degrees Celsius. If all parameters are within the threshold range and the write progress increases normally, a normal flag is generated. If any parameter exceeds the threshold range or the write progress stalls, an abnormal flag is generated, and this flag and the specific abnormal type are temporarily stored in memory as the basis for subsequent conditional judgments.
[0060] When the anomaly detection result data is an anomaly identifier, an anomaly event trigger signal is generated. This signal will trigger subsequent audit log generation and alarm reporting actions. Finally, upon receiving the anomaly event trigger signal, the system reads context data such as the operator's identity, operation time, and image file identifier for this operation. This context data, along with the anomaly type and anomaly occurrence time, is assembled into a complete structured audit log record and stored in a local log file. Simultaneously, a formatted alarm message is generated based on the severity of the anomaly and pushed to the operations and maintenance platform via network protocol. The operations and maintenance platform then displays the alarm information on the front-end interface and triggers email or SMS notifications to operations and maintenance personnel. In specific implementations, for example, if the current operating user is admin, the image file name is HUAWEI_BIOS_V1.2.3.bin, and the anomaly type is hardware anomaly, these fields are concatenated into a JSON format log entry and written to the local audit log. At the same time, an alarm message with the content "Device IP 192.168.1.100 Voltage Anomaly" is generated and sent to the operations and maintenance platform via HTTP RESTful API.
[0061] This embodiment continuously collects firmware writing progress data and hardware sensor parameter data during the flashing process and generates current flashing status feature data. This eliminates the black-box nature of the flashing process, making it perceptible and identifiable in real time. Based on this, the current flashing status feature data is compared with a preset normal state threshold range to generate anomaly detection data. This allows for timely identification of anomalies during the flashing process, rather than waiting until the flashing is complete. When an anomaly is detected, an anomaly event trigger signal is generated based on the anomaly type, triggering audit log recording and real-time alarm messages to be reported to the operations and maintenance platform. This ensures that every anomaly event is fully recorded, and operations and maintenance personnel are aware of the anomaly immediately, rather than reactively investigating afterward. Ultimately, this embodiment provides a more proactive and fully traceable flashing security monitoring capability, effectively improving the security and controllability of the flashing process.
[0062] In batch flashing scenarios, during implementation, based on the imported list of Internet Protocol addresses of multiple devices to be flashed, the aforementioned steps of obtaining basic input / output system identification data and hardware architecture data can be performed on each device in the list. For each device, a preset feature matching algorithm is used to identify the flashing mode it supports, and a central processing unit architecture identification result is generated for each device. This allows for the independent determination of the corresponding flashing driver and firmware transmission protocol parameters for each device, and then the firmware writing operation is performed in parallel.
[0063] With the above batch flashing solution, data center operations and maintenance personnel only need to import the Internet Protocol Address list of multiple devices to be flashed at once and distribute the shared firmware image file and permission configuration. The flashing server automatically completes the entire process of architecture identification, pattern identification, security verification, and firmware writing for each device. All devices perform flashing operations in parallel without manual intervention for each device. During the flashing process, operations and maintenance personnel can view the flashing progress and final status of each device in real time through the monitoring interface. When a device malfunctions, a retry command only needs to be issued for that device, without affecting the normal operation of other devices. After all devices are flashed, the system automatically summarizes and generates a batch operations and maintenance report containing the total number of devices, the number of successes, the number of failures, and details of the malfunctions. It also supports batch exporting of flashing logs for all devices, facilitating subsequent troubleshooting and compliance auditing. Compared to the existing technology that requires manual parameter configuration and flashing of each device, this solution significantly reduces the workload of maintenance personnel. Especially when the data center cluster contains hundreds or thousands of devices, the flashing efficiency can be improved by several times. At the same time, the real-time status feedback and the individual retry mechanism for abnormal devices also significantly improve the controllability and reliability of maintenance.
[0064] In addition, a cloud-edge collaborative architecture can be used to replace the above-mentioned local batch import of Internet Protocol addresses. Specifically, the cloud-based operations and maintenance platform uniformly stores and manages the configuration information and firmware image files of all devices to be flashed, and sends flashing instructions and image data to edge nodes deployed in each data center through a secure network channel. After receiving the instructions, the edge nodes perform the flashing operation on the devices to be flashed within their local area network, and transmit the flashing progress and status back to the cloud-based operations and maintenance platform in real time. This solution is suitable for operations and maintenance scenarios of large-scale cross-regional device clusters, eliminating the need to deploy a local flashing server in each data center, further reducing the operations and maintenance deployment costs in distributed scenarios.
[0065] Research has revealed that in real-world applications, the BIOS flashing process encounters various abnormal scenarios, including mains power failure, hardware malfunction, verification failure, and transmission interruption. When these abnormalities occur, if the BIOS storage chip is in the middle of being erased or written, the chip will be unable to complete the flashing process, and the original firmware cannot be rewritten back to the chip. This ultimately leads to serious consequences such as BIOS firmware corruption and device boot failure, resulting in extremely high maintenance risks. Existing technologies lack an automatic rollback mechanism for differentiated handling of different types of abnormalities, making it difficult to ensure reliable firmware recovery under various abnormal scenarios. Therefore, in some embodiments of this application, the method further includes: During the flashing process, the flashing status and hardware parameters are continuously monitored. The flashing status includes the completion status of writing each data block, and the hardware parameters include motherboard voltage and temperature. When an abnormal write status is detected or hardware parameters exceed a preset threshold range, different rollback operations are performed based on the type of the abnormality: If the abnormality type is a power failure of the main power supply, a rollback command is sent to the baseboard management controller of the device to be flashed. The rollback command triggers the baseboard management controller to check the power supply availability status of its backup power supply. If the power supply availability status of the backup power supply is available, the baseboard management controller enables the backup power supply and performs an automatic rollback operation based on the pre-stored original firmware backup data, writing the original firmware backup data back to the basic input / output system memory chip. If the anomaly type is a non-power-loss anomaly, including hardware failure, verification failure, or transmission interruption, the automatic rollback operation is directly performed through the main power supply to write the original firmware backup data back to the basic input / output system storage chip. After the rollback operation is completed, an anomaly log record containing the anomaly type, rollback time, and rollback result is generated and reported to the operation and maintenance platform.
[0066] This embodiment describes a complete scheme for performing differentiated automatic rollback operations based on the exception type.
[0067] First, before the flashing operation is initiated, the original firmware data in the basic input / output system memory chip of the device to be flashed is read, and this original firmware data is stored as a backup of the original firmware data in the non-volatile storage medium of the baseboard management controller of the device to be flashed.
[0068] Next, during the flashing process, the flashing status and hardware parameters are continuously monitored. The flashing status includes the completion status of each data block, and hardware parameters include, for example, motherboard voltage and temperature. In specific implementation, during the process of sending data blocks to the device to be flashed, the write status is recorded after each data block is sent. At the same time, the motherboard voltage and temperature values are periodically read through the sensor data interface of the baseboard management controller. These monitoring data are summarized by timestamp and temporarily stored in a memory buffer. Then, the monitored voltage and temperature values are compared one by one with the preset normal state threshold range. If all parameters are within the threshold range and the write progress increases normally, it is determined to be a normal state. If an abnormal write status is detected or any hardware parameter exceeds the preset threshold range, an abnormality detection signal is generated.
[0069] Upon detecting an anomaly, different rollback operations are performed depending on the type of anomaly. Specifically, if the anomaly is a power outage, i.e., a power outage event detected when the power status signal polled by the board management controller or the voltage sensor reading is lower than a preset threshold, a rollback command is sent to the board management controller of the device to be flashed. This rollback command triggers the board management controller to check the availability status of its backup power supply. The availability status of the backup power supply refers to the availability status value returned by the power management module inside the board management controller after detecting the voltage and remaining capacity of its backup power input terminal (such as a button battery or supercapacitor). If the status is available, the board management controller enables the backup power supply, reads the pre-stored original firmware backup data from the non-volatile storage medium, and writes the original firmware backup data back to the basic input / output system memory chip via the SPI bus.
[0070] If the anomaly type is a non-power-loss anomaly, including hardware failure, verification failure, or transmission interruption, specifically referring to non-power-related anomalies detected during the flashing process, such as a hardware module failure on the motherboard causing writing to stall, image data integrity verification failing, or network transmission timeout, then the automatic rollback operation will be directly executed through the main power supply. In practice, for example, the main CPU or baseboard management controller of the device to be flashed will read the original firmware backup data from the non-volatile storage medium and write it back to the basic input / output system memory chip via the SPI bus.
[0071] Finally, after the rollback operation is completed, an exception log record is generated, which includes the exception type, the rollback occurrence time, and the rollback execution result (success or failure). This record is stored in a local log file and then reported to the operation and maintenance platform via network protocol for operation and maintenance personnel to view and subsequently audit.
[0072] This embodiment provides an implementation method for automatic rollback of a differentiated basic input / output system (PIS) during flashing anomalies. During the flashing process, it continuously monitors the data block write status and hardware parameters such as motherboard voltage and temperature, promptly capturing and differentiating various abnormal conditions to provide accurate judgment for subsequent targeted processing. For main power failure anomalies, it triggers the circuit board management controller to activate the backup power supply for firmware rollback, solving the problem of core hardware shutdown and inability to autonomously recover firmware after a power outage. For non-power failure anomalies such as hardware fault verification failure and transmission interruption, it directly performs the rollback operation based on the main power supply, balancing recovery feasibility and execution efficiency in different scenarios. After rollback, a log containing anomaly details is generated and reported to the operation and maintenance platform, facilitating subsequent fault investigation and compliance auditing. Ultimately, this embodiment achieves a more comprehensive and reliable fault tolerance effect for flashing anomalies, effectively reducing the risk of firmware damage and device boot failure caused by various anomalies, and improving the overall stability and traceability of underlying firmware operation and maintenance.
[0073] In some embodiments, the method further includes: Based on the query command for the current storage partition status, receive the partition status response data returned by the device to be flashed, and generate partition identifier data containing the primary partition address and the backup partition address based on the partition status response data. The step of writing the new basic input / output system image file to be written to the device to be flashed includes: Based on the backup partition address in the partition identifier data and the new basic input / output system image file, a backup partition write command is sent to the device to be flashed, and the backup partition write completion status data returned after the write is completed is received. Based on the backup partition write completion status data, send an integrity verification command for the data written to the backup partition to the device to be flashed, and receive the returned backup partition verification result data. When the backup partition verification result data is verified as passed, a main partition synchronization command is sent to the device to be flashed according to the main partition address in the partition identifier data, instructing the data already written in the backup partition to be synchronously copied to the main partition, and receiving the returned main partition synchronization completion signal; When the backup partition verification result data is a verification failure or a write error response is received, a start switching command is sent to the device to be flashed according to the main partition address in the partition identifier data. The start switching command instructs the device to be flashed to start from the original firmware stored in the main partition.
[0074] In this embodiment, firstly, based on a query command for the current storage partition status, the system receives partition status response data returned by the device to be flashed. Then, based on the partition status response data, partition identifier data containing the primary partition address and the backup partition address is generated. Here, the storage partition status query command is a management command sent by the execution entity of this method to the device to be flashed, used to obtain the current partitioning status of the BIOS storage chip. The partition status response data is a data packet returned by the device to be flashed, containing the starting addresses, sizes, and current activation status of two partitions. The partition identifier data is structured data containing the primary partition address and the backup partition address, generated after parsing the response data. The primary partition stores the currently running original firmware, and the backup partition is a free area used to receive new firmware. In practice, for example, a query command in IPMI or Redfish format is sent to the baseboard management controller of the device to be flashed via a network protocol. After receiving the command, the device to be flashed reads the partition table information from its firmware management area, encapsulates the starting address, capacity and activation flag of the two partitions into a response data packet and returns it. After parsing the data packet, the flashing tool temporarily stores the main partition address and backup partition address in memory as the addressing basis for all subsequent write and synchronization operations.
[0075] Next, based on the backup partition address in the partition identifier data and the new basic input / output system image file, a backup partition write command is sent to the device to be flashed, and a backup partition write completion status data is received after the write operation is completed. Here, the backup partition write command is a command containing the target address as the start address of the backup partition and the complete firmware binary data to be written, instructing the device to be flashed to write the firmware data to the backup partition; the backup partition write completion status data is the status information returned by the device to be flashed after completing the write operation, used to confirm that the data has been successfully transmitted and written to the storage chip. In specific implementation, the target firmware data in memory is packaged into write requests in batches according to data blocks of fixed size. After sending each data block, the device to be flashed is waited for a write success confirmation. If a confirmation is received, the next block is sent until all data is sent, and finally a status response indicating that the entire write is complete is received.
[0076] Based on the backup partition write completion status data, an integrity verification command for the data written to the backup partition is sent to the device to be flashed, and the returned backup partition verification result data is received. Here, the integrity verification command is a command that requires the device to perform a hash operation on the data written to the backup partition and compare it with the expected value; the backup partition verification result data is the comparison conclusion returned by the device to be flashed, with a value of "pass" or "fail". Specifically, for example, before sending the target firmware data, a standard hash value of the data is calculated and cached locally. When sending the verification command, this hash value is sent along with the data to the device to be flashed. The device to be flashed reads all the written data from the backup partition and performs the same hash algorithm, compares the calculation result byte-by-byte with the received standard hash value, and encapsulates the comparison result into a response packet and returns it.
[0077] When the backup partition verification result is successful, a main partition synchronization command is sent to the device to be flashed based on the main partition address in the partition identifier data. This command instructs the device to synchronously copy the written data from the backup partition to the main partition and receives a returned main partition synchronization completion signal. Here, the "main partition synchronization command" is a command requiring the device to be flashed to completely copy all the new firmware data from the backup partition to the main partition; the "main partition synchronization completion signal" is a confirmation message returned by the device to be flashed after completing the data copying. Specifically, after receiving the synchronization command, the device to be flashed reads all data from the starting address of the backup partition through its internal firmware copy function and writes it to the corresponding address range of the main partition. After writing, a quick verification is also performed on the main partition to confirm that the copying is correct. Finally, a synchronization success status message is returned to the application execution entity, at which point the main partition has been successfully updated to the new firmware.
[0078] When the backup partition verification result is a verification failure or a write error response is received, a boot switch command is sent to the device to be flashed based on the primary partition address in the partition identifier data. This boot switch command instructs the device to boot from the existing firmware stored in the primary partition. Here, "write error response" refers to abnormal responses such as timeouts, write errors, or transmission interruptions received during the writing process to the backup partition; the "boot switch command" is a management command that sets the primary partition as the preferred boot partition for the next boot. Specifically, upon receiving an abnormal response such as a verification failure or write timeout, a management command is immediately sent to the device to be flashed to set the preferred partition for the next boot. The command parameter points to the primary partition. The device writes this parameter into the boot configuration register of the baseboard management controller, terminating the flashing process without any destructive write operations. The existing firmware stored in the primary partition remains intact because it has never been erased or overwritten, allowing the device to boot normally.
[0079] This embodiment first obtains the address identifiers of the primary and backup partitions by querying the storage partition status, providing an accurate addressing basis for the flashing operation. The new firmware image is first written to the backup partition while simultaneously completing integrity verification. The quality of the new firmware write is verified without affecting the original firmware on the primary partition. Once verification is successful, the backup partition data is synchronized to the primary partition to complete the formal update. If the backup partition write fails or an anomaly occurs, the device is directly switched to the original firmware on the primary partition for booting, preventing the device from losing bootable firmware due to flashing process anomalies. Ultimately, this embodiment achieves a more stable and secure firmware flashing operation, effectively improving the fault tolerance of the flashing process and the reliability of device operation.
[0080] Based on the same concept, embodiments of this application also provide a basic input / output system flashing system. Figure 2 A schematic diagram of the basic input / output system writing system provided in an embodiment of this application is shown. See also: Figure 2 As shown, the basic input / output system flashing system 200 provided in this embodiment includes: a flashing server 201, a device to be flashed 202, and an operation and maintenance platform 203; wherein, The flashing server is used to execute the steps of the basic input / output system flashing method as described in the foregoing embodiments; The device to be flashed is used to respond to the instructions sent by the flashing server and return execution status data; The operation and maintenance platform is used to receive and display the flashing status data, alarm messages and audit logs reported by the flashing server.
[0081] The system proposed in this embodiment consists of three core entities: a flashing server, a device to be flashed, and an operation and maintenance platform. The flashing server refers to a computing device that has flashing tool software installed and is capable of communicating with the device to be flashed. It is typically a management server in a data center or a terminal device used by operation and maintenance personnel. It is used to execute all the steps of the basic input / output system flashing method described in the preceding embodiments, including acquiring the basic input / output system identification data and hardware architecture data of the device to be flashed, identifying the flashing mode and central processing unit architecture, performing firmware flashing operations, and handling anomalies and reporting audits.
[0082] A device to be flashed refers to a physical computer device that needs to update its basic input / output system firmware. Its motherboard contains a basic input / output system memory chip and a baseboard management controller, which are used to respond to various instructions sent by the flashing server and return the corresponding execution status data.
[0083] An operations and maintenance platform refers to a centralized monitoring and management system provided to operations and maintenance personnel. It is usually presented in the form of a web interface or a dedicated client. It is used to receive and display the flashing status data, alarm messages and audit logs reported by the flashing server. The flashing status data includes the flashing progress percentage and the final flashing result (success, failure or abnormal interruption) of each device to be flashed. Alarm messages include notifications of abnormal events that require the attention of operations and maintenance personnel, such as verification failure, insufficient permissions, abnormal voltage or power failure. The audit logs include complete operation records such as operator identity, operation time, image file identifier and abnormality type.
[0084] During the actual operation of the system, the flashing server first obtains the task parameters configured by the operation and maintenance personnel from the operation and maintenance platform or directly imports the list of Internet Protocol addresses and target firmware image files of the devices to be flashed from the local machine. Then, it actively establishes a communication connection with the baseboard management controller of each device to be flashed in the list through the network protocol, and sequentially performs operations such as architecture identification, pattern identification, image verification, permission verification, and flashing execution according to the steps of the aforementioned method embodiments. Throughout the execution process, the flashing server continuously reports the real-time progress and status data of each device to be flashed to the operation and maintenance platform for front-end display. At the same time, when an anomaly is detected, an alarm message is generated and pushed to the operation and maintenance platform, enabling operation and maintenance personnel to monitor the flashing status of all devices in real time on a single interface. Each device to be flashed passively responds to the various instructions sent by the flashing server and returns execution status data during the flashing process, without actively initiating any communication. After the flashing tasks of all devices are completed, the operation and maintenance platform centrally stores and displays all audit logs and batch operation and maintenance reports reported by the flashing server for operation and maintenance personnel to conduct fault diagnosis and compliance audits.
[0085] In summary, this application embodiment, based on a BIOS and baseboard management controller collaborative architecture, uses a flashing tool (i.e., the method proposed in this application embodiment) as the core and the baseboard management controller as an auxiliary, to achieve a unified flashing scheme that automatically adapts to multiple flashing modes and is compatible with multiple architectures. By constructing a feature library containing mode identifier bits and optimized matching rules for preset architecture types, and combining it with automatic identification of the central processing unit architecture, it can call the corresponding hardware drivers and firmware transmission protocols for different devices without manual configuration by the user, significantly reducing the operational threshold and cross-architecture operation and maintenance costs. At the same time, through dual verification of secure hash algorithms and digital signatures, hierarchical permission control, and physical access verification and device behavior auditing linked to the baseboard management controller, a multi-level, full-process security protection system covering image verification, permission verification, and behavior auditing is constructed to effectively prevent malicious image injection and illegal flashing attacks. In terms of anomaly handling, continuous monitoring of the flashing process is performed. Regarding status and hardware parameters, differentiated automatic rollback mechanisms are employed for main power failure and non-power failure anomalies, respectively, using the baseboard management controller's backup power rollback and main power rollback. This ensures that the original firmware can be reliably restored under various abnormal scenarios, avoiding the operational risks of device startup failure. In batch operation and maintenance scenarios, it supports parallel flashing of multiple devices, real-time status feedback, individual retries for abnormal devices, and batch operation and maintenance report and log export, significantly improving the management efficiency of data center cluster devices. The entire solution forms a closed-loop operation and maintenance system from pattern recognition, image verification, permission verification, flashing execution, anomaly handling to log reporting. It is particularly suitable for domestic ARM architecture servers, industrial control equipment, and data center cluster devices represented by Kunpeng. It can be widely used in firmware updates, security control, and operation and maintenance management in information technology application innovation scenarios, taking into account multi-flashing mode compatibility and full-process security protection, effectively improving the efficiency and reliability of underlying firmware operation and maintenance.
[0086] Those skilled in the art will understand that in the above-described method of the specific embodiments, the order in which the steps are written does not imply a strict execution order, but constitutes no limitation on the implementation process. The specific execution order of each step should be determined by its function and possible internal logic.
[0087] It should be noted that in practical applications, all the above-described possible implementation methods can be combined in any way to form possible embodiments of this application, and will not be described in detail here. The information (including but not limited to device information, user information, etc.) and data (including but not limited to data used for analysis, storage, and display) involved in this application are all information and data authorized by the user or fully authorized by all parties. The software tools or components appearing in the embodiments of this application are merely illustrative examples and do not represent actual use.
[0088] Based on the same concept, this application also provides a basic input / output system flashing device, which corresponds one-to-one with the basic input / output system flashing method in the above embodiments. Figure 3 A schematic diagram of the basic input / output system writing device provided in an embodiment of this application is shown. See also: Figure 3 As shown, the basic input / output system writing device 300 provided in this application embodiment includes: The acquisition module 301 is used to acquire the basic input / output system identification data and hardware architecture data of the device to be flashed / written. The identification module 302 is used to identify the writing mode supported by the device to be written by using a preset feature matching algorithm, based on a preset writing mode feature library and the basic input / output system identification data. The generation module 303 is used to generate the central processing unit architecture identification result of the device to be flashed based on the hardware architecture data. The flashing module 304 is used to perform firmware flashing operations on the device to be flashed according to the flashing mode and the central processing unit architecture identification result.
[0089] In some embodiments, in the above-described apparatus, the identification module 302 is specifically used for: Extract the mode identifier bit from the basic input / output system identifier data; By matching the mode identifier with the mode identifier in the preset flashing mode feature library, the flashing modes supported by the device to be flashed are obtained.
[0090] In some embodiments, in the above-described apparatus, the writing module 304 is specifically used for: Based on the central processing unit architecture identification results, the corresponding hardware driver parameters are generated; Based on the flashing mode, generate the corresponding firmware transmission protocol parameters; Based on the hardware driver parameters and the firmware transmission protocol parameters, the new basic input / output system image file to be written is written to the device to be flashed.
[0091] In some embodiments, the apparatus further includes a file verification module, which, before the step of performing firmware flashing operation on the device to be flashed based on the flashing mode and the central processing unit architecture identification result, is used to: Obtain the new basic input / output system image file of the device to be flashed; Using the first hash algorithm, the hash value of the new basic input / output system image file is calculated, and the hash value is compared with the pre-stored standard hash value to generate an integrity verification result; If the integrity verification result is successful, the digital signature attached to the new basic input / output system image file is decrypted using the public key to obtain the first digest value; Using a second hash algorithm, the hash value of the new basic input / output system image file is calculated to obtain a second digest value; by comparing the first digest value with the second digest value, a signature verification result is generated; If the integrity verification result is unsuccessful or the signature verification result is unsuccessful, a verification failure signal is generated and the writing process is terminated. If the integrity verification result is successful and the signature verification result is successful, a verification success signal is generated, and subsequent write operations continue.
[0092] In some embodiments, the apparatus further includes a permission verification module, which, before the step of performing firmware flashing operation on the device to be flashed based on the flashing mode and the central processing unit architecture identification result, is used to: Obtain the current operator's identity authentication information and generate operator permission level data, which includes one of the following: administrator permission, operation and maintenance personnel permission, and ordinary user permission; Based on the operator's permission level data and the write range indicated by the new basic input / output system image file, a write enable signal or a write block signal is generated; Based on the write-allow signal or write-block signal, and the device physical access verification result obtained from the baseboard management controller of the device to be written, a final operation authorization signal is generated. Based on the final operation authorization signal, determine whether to continue the flashing operation.
[0093] In some embodiments, the apparatus further includes an audit module for: Based on the firmware writing progress data and hardware sensor parameter data continuously collected during the flashing process, the current flashing status feature data is generated. Based on the current write status feature data and the preset normal status threshold range, anomaly detection result data is generated, which includes a normal identifier or an anomaly identifier. When the anomaly detection result data is an anomaly identifier, an anomaly event trigger signal is generated; Based on the abnormal event trigger signal and the pre-recorded operator identity, operation time, and image file identifier, an audit log record and a real-time alarm message are generated, and the real-time alarm message is reported to the operation and maintenance platform.
[0094] In some embodiments, the apparatus further includes a rollback module for: During the flashing process, the flashing status and hardware parameters are continuously monitored. The flashing status includes the completion status of writing each data block, and the hardware parameters include motherboard voltage and temperature. When an abnormal write status is detected or hardware parameters exceed a preset threshold range, different rollback operations are performed based on the type of the abnormality: If the abnormality type is a power failure of the main power supply, a rollback command is sent to the baseboard management controller of the device to be flashed. The rollback command triggers the baseboard management controller to check the power supply availability status of its backup power supply. If the power supply availability status of the backup power supply is available, the baseboard management controller enables the backup power supply and performs an automatic rollback operation based on the pre-stored original firmware backup data, writing the original firmware backup data back to the basic input / output system memory chip. If the anomaly type is a non-power-loss anomaly, including hardware failure, verification failure, or transmission interruption, the automatic rollback operation is directly performed through the main power supply to write the original firmware backup data back to the basic input / output system storage chip. After the rollback operation is completed, an anomaly log record containing the anomaly type, rollback time, and rollback result is generated and reported to the operation and maintenance platform.
[0095] In some embodiments, the apparatus further includes a query module for: Based on the query command for the current storage partition status, receive the partition status response data returned by the device to be flashed, and generate partition identifier data containing the primary partition address and the backup partition address based on the partition status response data. The writing module is specifically used for: Based on the backup partition address in the partition identifier data and the new basic input / output system image file, a backup partition write command is sent to the device to be flashed, and the backup partition write completion status data returned after the write is completed is received. Based on the backup partition write completion status data, send an integrity verification command for the data written to the backup partition to the device to be flashed, and receive the returned backup partition verification result data. When the backup partition verification result data is verified as passed, a main partition synchronization command is sent to the device to be flashed according to the main partition address in the partition identifier data, instructing the data already written in the backup partition to be synchronously copied to the main partition, and receiving the returned main partition synchronization completion signal; When the backup partition verification result data is a verification failure or a write error response is received, a start switching command is sent to the device to be flashed according to the main partition address in the partition identifier data. The start switching command instructs the device to be flashed to start from the original firmware stored in the main partition.
[0096] This invention provides a basic input / output system (BIS) flashing device. By collecting the BIS firmware identifier and hardware architecture data of the device to be flashed, it provides a reliable underlying hardware basis for subsequent mode matching and architecture adaptation. Based on this, it automatically identifies the flashing modes supported by the device using a preset flashing mode feature library and feature matching algorithm, eliminating the need for manual configuration of mode parameters and avoiding flashing failures caused by human configuration errors. At the same time, it determines the central processing unit (CPU) architecture based on the hardware architecture data, calls the corresponding architecture's flashing parameters and execution logic, and achieves compatibility of a single tool with different architecture devices, significantly reducing cross-architecture adaptation costs. Finally, it combines the identified flashing mode and architecture results to perform firmware flashing. Ultimately, this embodiment can achieve a more efficient and stable multi-architecture, multi-mode firmware flashing effect, effectively reducing the operation and maintenance threshold and the flashing failure rate.
[0097] Specific limitations regarding the Elementary Input / Output System (Elementary Input / Output System) flashing device can be found in the limitations regarding the Elementary Input / Output System flashing method described above, and will not be repeated here. Each module in the aforementioned Elementary Input / Output System flashing device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in hardware or independently of the processor in the computer device, or stored in software in the memory of the computer device, so that the processor can call and execute the corresponding operations of each module.
[0098] Figure 4 A schematic diagram of the structure of an electronic device provided in an embodiment of this application is shown. Figure 4 As shown, at the hardware level, this electronic device includes a processor, and optionally also includes an internal bus, a network interface, and memory. The memory may include main memory, such as high-speed random-access memory (RAM), or it may include non-volatile memory, such as at least one disk drive. Of course, this electronic device may also include other hardware required for other business operations.
[0099] The processor, network interface, and memory can be interconnected via an internal bus, which can be an ISA (Industry Standard Architecture) bus, a PCI (Peripheral Component Interconnect) bus, or an EISA (Extended Industry Standard Architecture) bus, etc. The bus can be divided into address bus, data bus, control bus, etc. For ease of representation, Figure 4The symbol is represented by a single double-headed arrow, but this does not mean that there is only one bus or one type of bus.
[0100] Memory is used to store programs. Specifically, programs may include program code, which includes computer operation instructions. Memory may include main memory and non-volatile memory, and provides instructions and data to the processor.
[0101] The processor reads the corresponding computer program from non-volatile memory into main memory and then runs it, forming a basic input / output system (PIS) write device at the logical level. The processor executes the program stored in memory and specifically performs the aforementioned methods.
[0102] The processor may be an integrated circuit chip with signal processing capabilities. In implementation, each step of the above method can be completed by integrated logic circuits in the processor's hardware or by instructions in software form. The processor can be a general-purpose processor, including a Central Processing Unit (CPU), a Network Processor (NP), etc.; it can also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field-Programmable Gate Array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. It can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of this application. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the methods disclosed in the embodiments of this application can be directly embodied in the execution of a hardware decoding processor, or executed by a combination of hardware and software modules in the decoding processor. The software modules can reside in random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, registers, or other mature storage media in the art. The storage medium is located in the memory, and the processor reads the information in the memory and, in conjunction with its hardware, completes the steps of the above method.
[0103] This electronic device can execute the basic input / output system flashing method provided in several embodiments of this application, and is implemented as a basic input / output system flashing device. Figure 3 The functions of the embodiments shown are not described in detail here.
[0104] This application also proposes a computer-readable storage medium that stores one or more programs, the programs including instructions that, when executed by an electronic device including multiple applications, enable the electronic device to perform the basic input / output system flashing method provided in several embodiments of this application.
[0105] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0106] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart... Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0107] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0108] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0109] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0110] Memory may include non-persistent storage in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM. Memory is an example of computer-readable media.
[0111] Computer-readable media include both permanent and non-permanent, removable and non-removable media that can store information using any method or technology. Information can be computer-readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other non-transferable medium that can be used to store information accessible by a computing device. As defined herein, computer-readable media does not include transient computer-readable media, such as modulated data signals and carrier waves.
[0112] It should also be noted that the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0113] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0114] The above are merely embodiments of this application and are not intended to limit the scope of this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the protection scope of this application.
Claims
1. A method for flashing a basic input / output system, characterized in that, The method includes: Obtain the basic input / output system identification data and hardware architecture data of the device to be flashed / written; Using a preset feature matching algorithm, based on a preset flashing mode feature library and the basic input / output system identification data, the flashing mode supported by the device to be flashed is identified; Based on the hardware architecture data, generate the central processing unit architecture identification result of the device to be flashed; Based on the flashing mode and the central processing unit architecture identification result, the firmware flashing operation is performed on the device to be flashed.
2. The basic input / output system flashing method according to claim 1, characterized in that, The step of using a preset feature matching algorithm to identify the flashing modes supported by the device to be flashed, based on a preset flashing mode feature library and the basic input / output system identification data, includes: Extract the mode identifier bit from the basic input / output system identifier data; By matching the mode identifier with the mode identifier in the preset flashing mode feature library, the flashing modes supported by the device to be flashed are obtained.
3. The basic input / output system flashing method according to claim 1, characterized in that, The step of performing firmware flashing operations on the device to be flashed based on the flashing mode and the central processing unit architecture identification result includes: Based on the central processing unit architecture identification results, the corresponding hardware driver parameters are generated; Based on the flashing mode, generate the corresponding firmware transmission protocol parameters; Based on the hardware driver parameters and the firmware transmission protocol parameters, the new basic input / output system image file to be written is written to the device to be flashed.
4. The basic input / output system flashing method according to claim 1, characterized in that, Before the step of performing firmware flashing operation on the device to be flashed based on the flashing mode and the central processing unit architecture identification result, the method further includes: Obtain the new basic input / output system image file of the device to be flashed; Using the first hash algorithm, the hash value of the new basic input / output system image file is calculated, and the hash value is compared with the pre-stored standard hash value to generate an integrity verification result; If the integrity verification result is successful, the digital signature attached to the new basic input / output system image file is decrypted using the public key to obtain the first digest value; Using a second hash algorithm, the hash value of the new basic input / output system image file is calculated to obtain a second digest value; by comparing the first digest value with the second digest value, a signature verification result is generated; If the integrity verification result is unsuccessful or the signature verification result is unsuccessful, a verification failure signal is generated and the writing process is terminated. If the integrity verification result is successful and the signature verification result is successful, a verification success signal is generated, and subsequent write operations continue.
5. The basic input / output system flashing method according to claim 4, characterized in that, Before the step of performing firmware flashing operation on the device to be flashed based on the flashing mode and the central processing unit architecture identification result, the method further includes: Obtain the current operator's identity authentication information and generate operator permission level data, which includes one of the following: administrator permission, operation and maintenance personnel permission, and ordinary user permission; Based on the operator's permission level data and the write range indicated by the new basic input / output system image file, a write enable signal or a write block signal is generated; Based on the write-allow signal or write-block signal, and the device physical access verification result obtained from the baseboard management controller of the device to be written, a final operation authorization signal is generated. Based on the final operation authorization signal, determine whether to continue the flashing operation.
6. The basic input / output system flashing method according to claim 5, characterized in that, The method further includes: Based on the firmware writing progress data and hardware sensor parameter data continuously collected during the flashing process, the current flashing status feature data is generated. Based on the current write status feature data and the preset normal status threshold range, anomaly detection result data is generated, which includes a normal identifier or an anomaly identifier. When the anomaly detection result data is an anomaly identifier, an anomaly event trigger signal is generated; Based on the abnormal event trigger signal and the pre-recorded operator identity, operation time, and image file identifier, an audit log record and a real-time alarm message are generated, and the real-time alarm message is reported to the operation and maintenance platform.
7. The basic input / output system flashing method according to claim 1, characterized in that, The method further includes: During the flashing process, the flashing status and hardware parameters are continuously monitored. The flashing status includes the completion status of writing each data block, and the hardware parameters include motherboard voltage and temperature. When an abnormal write status is detected or hardware parameters exceed a preset threshold range, different rollback operations are performed based on the type of the abnormality: If the abnormality type is a power failure of the main power supply, a rollback command is sent to the baseboard management controller of the device to be flashed. The rollback command triggers the baseboard management controller to check the power supply availability status of its backup power supply. If the power supply availability status of the backup power supply is available, the baseboard management controller enables the backup power supply and performs an automatic rollback operation based on the pre-stored original firmware backup data, writing the original firmware backup data back to the basic input / output system memory chip. If the anomaly type is a non-power-loss anomaly, including hardware failure, verification failure, or transmission interruption, the automatic rollback operation is directly performed through the main power supply to write the original firmware backup data back to the basic input / output system storage chip. After the rollback operation is completed, an anomaly log record containing the anomaly type, rollback time, and rollback result is generated and reported to the operation and maintenance platform.
8. The basic input / output system flashing method according to claim 3, characterized in that, The method further includes: Based on the query command for the current storage partition status, receive the partition status response data returned by the device to be flashed, and generate partition identifier data containing the primary partition address and the backup partition address based on the partition status response data. The step of writing the new basic input / output system image file to be written to the device to be flashed includes: Based on the backup partition address in the partition identifier data and the new basic input / output system image file, a backup partition write command is sent to the device to be flashed, and the backup partition write completion status data returned after the write is completed is received. Based on the backup partition write completion status data, send an integrity verification command for the data written to the backup partition to the device to be flashed, and receive the returned backup partition verification result data. When the backup partition verification result data is verified as passed, a main partition synchronization command is sent to the device to be flashed according to the main partition address in the partition identifier data, instructing the data already written in the backup partition to be synchronously copied to the main partition, and receiving the returned main partition synchronization completion signal; When the backup partition verification result data is a verification failure or a write error response is received, a start switching command is sent to the device to be flashed according to the main partition address in the partition identifier data. The start switching command instructs the device to be flashed to start from the original firmware stored in the main partition.
9. A basic input / output system writing device, characterized in that, The device includes: The acquisition module is used to acquire the basic input / output system identification data and hardware architecture data of the device to be flashed / written; The identification module is used to identify the writing mode supported by the device to be written by using a preset feature matching algorithm, based on a preset writing mode feature library and the basic input / output system identification data. The generation module is used to generate the central processing unit architecture identification result of the device to be flashed based on the hardware architecture data. The flashing module is used to perform firmware flashing operations on the device to be flashed based on the flashing mode and the central processing unit architecture identification result.
10. A basic input / output system flashing system, characterized in that, The system includes: a flashing server, a device to be flashed, and an operation and maintenance platform; The flashing server is used to perform the steps of the basic input / output system flashing method as described in claim 6 or 7; The device to be flashed is used to respond to the instructions sent by the flashing server and return execution status data; The operation and maintenance platform is used to receive and display the flashing status data, alarm messages and audit logs reported by the flashing server.
