Startup firmware recovery method and device, equipment, storage medium and program product

By obtaining and verifying the recovery verification file in the computer device, obtaining the firmware recovery file stored in other places, and restoring the startup firmware, the problem of insufficient startup firmware recovery permissions in the existing technology is solved, and the normal startup of the device is achieved.

CN119025330APending Publication Date: 2024-11-26HUAWEI TECH CO LTD
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202310613853.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-05-26
Publication Date
2024-11-26

AI Technical Summary

Technical Problem

In the prior art, the startup firmware recovery permission of computer equipment is low, and the damaged startup firmware cannot be effectively restored, resulting in the device being unable to start.

Method used

By obtaining the recovery verification file provided by the trigger, the security verification is performed. If the verification is passed, the firmware recovery file stored off-site is obtained, and the startup firmware in the target device is restored to ensure the safety and effectiveness of the recovery process.

Benefits of technology

It improves the startup stability of computer equipment, ensures that the device can be effectively restored through recovery files stored off-site when the startup firmware is tampered with or deleted, and ensures that the device can boot normally.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119025330A_ABST
    Figure CN119025330A_ABST
Patent Text Reader

Abstract

The invention discloses a boot firmware recovery method and device, equipment, a storage medium and a program product, and belongs to the field of computer equipment. The method comprises the steps of obtaining a recovery verification file provided by a trigger of firmware recovery operation in response to the firmware recovery operation of starting firmware of target equipment; based on the recovery verification file, performing security verification on the firmware recovery operation; if the safety verification result is that verification is passed, a firmware recovery file corresponding to the target equipment is obtained, and the firmware recovery file and the starting firmware are stored in different places; and based on the firmware recovery file, recovering the startup firmware. Because the firmware recovery file and the startup firmware are stored in different places, the security of the firmware recovery file is not influenced even if the startup firmware is damaged, so that the startup firmware in the target equipment is effectively recovered through the firmware recovery file stored in different places under the condition that the security verification is passed, the normal startup of the target equipment can be ensured, and the security of the target equipment is ensured. And the starting stability of the target equipment is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer equipment, and in particular to a boot firmware recovery method, apparatus, device, storage medium and program product. Background Art

[0002] The boot firmware of a computer device is stored in a flash memory. When the computer device is powered on or reset, the central processing unit (CPU) calls and executes the boot firmware from the flash memory to start the device. If the boot firmware in the flash memory is tampered with or deleted, the computer device will fail to start.

[0003] In the related art, in order to ensure the normal startup of the computer device, two flashes are usually deployed in the computer device, and the startup firmware is stored in both flashes. When the main flash (or backup flash) cannot be started due to the damage of the startup firmware, the CPU calls the startup firmware stored in the backup flash (or main flash) to realize the startup. Alternatively, the startup firmware stored in two areas of a flash is used as a backup for each other. When the startup firmware stored in the first flash area is damaged, the CPU can call the startup firmware from the second flash area to realize the startup.

[0004] However, when the boot firmware stored in the two flash blocks or two flash areas that back up each other are damaged, the above firmware recovery mechanism will lose its function, causing the computer device to fail to boot. That is, the boot firmware recovery authority in the above related technology is low, and the damaged boot firmware in the computer device cannot be effectively recovered. Summary of the invention

[0005] The present application provides a method, device, equipment, storage medium and program product for recovering the boot firmware, which can solve the problem in the related art that the boot firmware in the computer device cannot be effectively recovered. The technical solution is as follows:

[0006] In a first aspect, a method for recovering a startup firmware is provided, the method comprising: in response to a firmware recovery operation of a startup firmware of a target device, obtaining a recovery verification file provided by a trigger of the firmware recovery operation; based on the recovery verification file, performing a security check on the firmware recovery operation; if a result of the security check is that the check passes, obtaining a firmware recovery file corresponding to the target device, the firmware recovery file and the startup firmware being stored remotely; and recovering the startup firmware based on the firmware recovery file.

[0007] Among them, the firmware recovery file and the startup firmware are stored in different places to ensure that the startup firmware and the firmware recovery file do not affect each other. Even if the startup firmware is damaged, it will not affect the security of the firmware recovery file.

[0008] When the firmware recovery operation of the target device is triggered, the application performs a security check on the firmware recovery operation according to the recovery verification file provided by the triggerer of the firmware recovery operation, thereby ensuring that the firmware recovery operation of the triggerer is legal and the implementation environment of the firmware recovery operation is safe, avoiding the execution of the firmware recovery operation under the condition of false triggering or illegal identity of the triggerer, and improving the security of firmware recovery. Furthermore, if the security check passes, the startup firmware in the target device is effectively restored according to the firmware recovery file stored off-site, which can ensure the normal startup of the target device and improve the startup stability of the target device.

[0009] Optionally, the recovery verification file includes a signature algorithm, a device identifier and a file identifier; based on the recovery verification file, a security verification is performed on the firmware recovery operation, including: based on the signature algorithm, verifying whether the recovery verification file is legal; verifying whether the device identifier is the same as the identifier of the target device; based on the file identifier, verifying whether the recovery verification file is valid; if the recovery verification file is legal, the device identifier is the same as the identifier of the target device and the recovery verification file is valid, the result of the security verification is determined to be a passed verification.

[0010] Since the success of the firmware recovery operation is related to the normal booting of the target device, it is necessary to ensure that the firmware recovery operation is executed in a safe environment after being triggered by a legitimate triggerer. Based on this, after the firmware recovery operation is triggered, the firmware recovery operation is security-verified by executing file legality verification, device identification verification, and file validity verification. When the result of the security verification is verification passed, it can be confirmed that the recovery verification file is a legitimate file issued for the target device, the identity of the triggerer is legitimate, and the triggered firmware recovery operation is safe, ensuring the effective triggering of the firmware recovery operation.

[0011] Optionally, the recovery verification file also includes a file validity count, which indicates the number of effective uses of the recovery verification file; before determining that the result of the security verification is a passed verification, the method also includes: obtaining the number of firmware recovery times of the target device, which indicates the total number of firmware recovery operations that have been performed on the target device through the recovery verification file; if the recovery verification file is legal, the device identifier is the same as the identifier of the target device, and the recovery verification file is valid, then determining that the result of the security verification is a passed verification, including: if the recovery verification file is legal, the device identifier is the same as the identifier of the target device, the recovery verification file is valid, and the file validity count is greater than or equal to the number of firmware recovery times, then determining that the result of the security verification is a passed verification.

[0012] Since the recovery verification file has a valid usage count, when the valid usage count is exceeded, the recovery verification file is no longer applicable to the security verification process of the firmware recovery operation. Therefore, through the recovery count verification, when the file valid count is greater than or equal to the firmware recovery count, it can be determined that the recovery verification file is a valid verification file issued for the target device, and it can continue to perform security verification for the firmware recovery operation of the target device.

[0013] In this way, through file legality verification, device identification verification, file validity verification and recovery number verification, not only the legality of the recovery verification file is guaranteed, but also the validity of the recovery verification file is guaranteed.

[0014] Optionally, the target device includes a processor, a boot firmware recovery device and a target flash memory, the boot firmware recovery device is used to manage the recovery operation of the boot firmware, and the target flash is used to store the boot firmware; before obtaining the firmware recovery file corresponding to the target device, the method also includes: switching the path between the processor and the target flash to the path between the boot firmware recovery device and the target flash; based on the firmware recovery file, restoring the boot firmware, including: based on the firmware recovery file, restoring the boot firmware through the path between the boot firmware recovery device and the target flash.

[0015] When the firmware recovery operation is not triggered, the processor reads the boot firmware from the target flash to realize the boot. When executing the firmware recovery operation, in order to ensure the safety of recovery and to avoid the processor from re-executing the boot program when the firmware recovery is not completed, the application reads the unfinished recovery boot firmware from the target flash, and after the firmware recovery operation is triggered, the control of the target flash is handed over to the boot firmware recovery device. The boot firmware recovery device executes the firmware recovery process through a dedicated security channel with the target flash. The recovery process is not controlled or affected by other devices such as the processor, which ensures the safety of the recovery process and allows the recovery process to be executed smoothly.

[0016] Optionally, based on the firmware recovery file, the boot firmware is recovered through a path between a boot firmware recovery device and a target flash, including: determining a storage location of the boot firmware in the target flash; based on the storage location, writing the firmware recovery file to the target flash through a path between the boot firmware recovery device and the target flash.

[0017] By writing the firmware recovery file to the target flash, the storage location of the boot firmware will not change before and after the recovery. In this way, not only can the boot firmware be accurately recovered, but it can also ensure that when the processor executes the boot process, it can still read and run the boot firmware from the target flash according to the original file reading path.

[0018] Optionally, the target device is a box-type architecture, and the target device is further connected to an external device, and the external device stores a firmware recovery file;

[0019] Obtaining a firmware recovery file corresponding to the target device includes: obtaining the firmware recovery file from an external device.

[0020] When the target device is a box-type architecture, the firmware recovery file can be provided by an external device outside the target device, that is, the firmware recovery file and the startup firmware are stored in different devices. The security of the firmware recovery file is not affected by the target device, thereby improving the security of the firmware recovery file.

[0021] Optionally, the target device is an interface board in a frame architecture, the frame architecture also includes a main control board, and the main control board stores a firmware recovery file; obtaining the firmware recovery file corresponding to the target device includes: obtaining the firmware recovery file from the main control board.

[0022] When the target device is an interface board in a frame-type architecture, the firmware recovery file can be provided by the main control board, that is, the firmware recovery file and the startup firmware are stored in different network boards. The security of the firmware recovery file is not affected by the target device, thereby improving the security of the firmware recovery file.

[0023] In a second aspect, a boot firmware recovery device is provided, which has the function of implementing the boot firmware recovery method in the first aspect. The boot firmware recovery device includes one or more modules, which are used to implement the boot firmware recovery method provided in the first aspect.

[0024] In a third aspect, a computer device is provided, which includes a flash, a processor, and a boot firmware recovery device. The flash is used to store the boot firmware; the processor is used to call and execute the boot firmware from the flash to start the computer after the computer device is powered on or reset; the boot firmware recovery device is used to perform the steps of the boot firmware recovery method provided in the first aspect above to recover the boot firmware of the computer device.

[0025] The computer device may further include a communication bus, which is used to establish a connection between the processor and the flash, and between the boot firmware recovery device and the flash.

[0026] In a fourth aspect, a computer-readable storage medium is provided, in which a computer program is stored. When a startup firmware recovery device executes the computer program, the steps of the startup firmware recovery method shown in the first aspect are implemented.

[0027] In a fifth aspect, a computer program product is provided, which includes a computer program. When a startup firmware recovery device executes the computer program, the steps of the startup firmware recovery method shown in the first aspect are implemented.

[0028] The technical effects obtained by the above-mentioned second, third, fourth and fifth aspects are similar to the technical effects obtained by the corresponding technical means in the first aspect, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS

[0029] Figure 1 It is a structural schematic diagram of a computer device with a box-type architecture provided in an embodiment of the present application;

[0030] Figure 2 It is a structural diagram of a network node of a frame-type architecture provided in an embodiment of the present application;

[0031] Figure 3 This is a system architecture diagram of a method for implementing a boot firmware recovery method through a box-type architecture provided by an embodiment of the present application;

[0032] Figure 4 This is a system architecture diagram of a method for booting firmware recovery using a frame-type architecture provided by an embodiment of the present application;

[0033] Figure 5 It is a flowchart of a method for booting firmware recovery provided by an embodiment of the present application;

[0034] Figure 6 is a schematic diagram of a recovery verification file provided by an embodiment of the present application;

[0035] Figure 7 It is a flowchart of another method for booting firmware recovery provided by an embodiment of the present application;

[0036] Figure 8 It is a structural diagram of a startup firmware recovery device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0037] In order to make the objectives, technical solutions and advantages of the embodiments of the present application clearer, the implementation methods of the present application will be further described in detail below in conjunction with the accompanying drawings.

[0038] In the scenario where the upper-layer software of a computer device is compromised, the attacker can tamper with or delete the startup firmware of the computer device through the upper-layer software. In this case, after the computer device is restarted, the startup firmware stored in the flash has been tampered with or deleted, causing the computer device to be unable to boot and work properly. Therefore, after the startup firmware is tampered with or deleted, it can be automatically restored so that the computer device can quickly resume work, which is crucial for the reliable operation of the computer device and has therefore become a common demand for security protection.

[0039] Based on the three characteristics of the resilient system (protection, detection and recovery), on the one hand, the boot firmware can be prevented from being tampered with or deleted from the protection level, that is, through secure boot, security subsystem, flash lock and other means to prevent the boot firmware from being tampered with or deleted. For example, the flash area is divided into a locked area and an unlocked area by means of write protection (WP), password lock, one time programming (OTP), etc., and the boot firmware is stored in the locked area, so that the boot firmware in the locked area will not be easily rewritten, ensuring the normal startup of the computer equipment. On the other hand, the main and backup recovery solution can also be adopted, that is, using two flashes, or two different areas of a flash, as backups for each other. When the boot firmware of one flash / a flash area is damaged, the boot firmware stored in another flash / a flash area can be used to overwrite and restore the boot firmware of the damaged area.

[0040] However, after breaking into the computer device system, the attacker can destroy the first flash / first flash area storing the boot firmware and then use the same attack method to continue to destroy the second flash / second flash area, thereby tampering with or deleting the boot firmware that backs up each other in the computer device, causing the entire recovery mechanism to fail and the computer device to be unable to start.

[0041] Based on this, an embodiment of the present application provides a method for recovering a boot firmware, which stores a boot firmware recovery file and a boot firmware remotely, so that when a boot firmware recovery operation is triggered and the security check of the firmware recovery operation passes, the boot firmware in the computer device is effectively recovered through the firmware recovery file stored remotely to ensure that the computer device can be started normally.

[0042] The boot firmware recovery method provided in the embodiment of the present application can be applied to a computer device to recover the boot firmware in a target device included in the computer device. The computer device can be a network node, a server, or other device, and the network node can be a base station, a routing device, a switch, or the like. The computer device can be a box-type architecture or a frame-type architecture. The following is an exemplary introduction to computer devices of these two different architectures.

[0043] In the case where the computer device is a box-type architecture, the computer device may also be referred to as a target device. Figure 1 The computer device 100 of the box-type architecture may include a processor 101 , a communication bus 102 , a memory 103 , a communication interface 104 , and a boot firmware recovery device 105 .

[0044] The computer device 100 may include one or more processors 101, where the processor 101 is a general-purpose central processing unit (CPU), a network processing (NP), a microprocessor, or one or more integrated circuits for implementing device startup, such as an application-specific integrated circuit (ASIC), a programmable logic device (PLD) or a combination thereof.

[0045] Optionally, the PLD is a complex programmable logic device (CPLD), a field-programmable gate array (FPGA), a generic array logic (GAL) or any combination thereof.

[0046] The communication bus 102 is used to transmit information between the above components. Optionally, the communication bus 102 is divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 1 Only one thick line is used in the diagram, but this does not mean that there is only one bus or only one type of bus.

[0047] The memory 103 is a read-only memory (ROM), a random access memory (RAM), a flash, an electrically erasable programmable read-only memory (EEPROM), an optical disc (including a compact disc read-only memory (CD-ROM), a compressed optical disc, a laser disc, a digital versatile disc, a Blu-ray disc, etc.), a magnetic disk storage medium or other magnetic storage device, or any other medium that can be used to carry or store the desired program code in the form of instructions or data structures and can be accessed by the server, but is not limited to this.

[0048] Optionally, the memory 103 may exist independently and be connected to the processor 101 via the communication bus 102 ; or, the memory 103 and the processor 101 may be integrated together.

[0049] The computer device 100 may include one or more communication interfaces 104, which use any transceiver or other device for communicating with other devices or communication networks. The communication interface 104 may include a wired communication interface and / or a wireless communication interface.

[0050] Among them, the wired communication interface is, for example, an Ethernet interface, which is an optical interface, an electrical interface or a combination thereof; the wireless communication interface is a wireless local area network (WLAN) interface, a cellular network communication interface or a combination thereof.

[0051] The boot firmware recovery device 105 may be an independent security chip, such as a micro controller unit (MCU) chip with a higher security level, or a secure field programmable gate array (FPGA) chip; the boot firmware recovery device may also be a part of the function integrated in a system on chip (SOC) or a processor. The embodiment of the present application does not limit the configuration method of the boot firmware recovery device 105 in the computer device 100.

[0052] In some embodiments, the flash is used to store the boot firmware; the processor 101 is used to call and execute the boot firmware from the flash to start the computer after the computer device 100 is powered on or reset; the memory 103 is used to store the program code for executing the boot firmware recovery method provided in the embodiment of the present application, and the program code includes one or more software modules, and the boot firmware recovery device 105 is used to execute the program code stored in the memory 103, using the following Figure 5 The boot firmware recovery method shown is used to recover the boot firmware of the computer device 100.

[0053] It should be noted that the boot firmware is usually stored in the flash of the computer device 100, but it can also be partially or completely stored in other memories. The embodiment of the present application only takes storage in the flash as an example for explanation. For the case where the boot firmware is stored in other memories, the boot firmware recovery method provided in the embodiment of the present application is also applicable.

[0054] Optionally, the computer device 100 may include multiple processors. Each of these processors is a single-core processor or a multi-core processor. Optionally, the processor here refers to one or more devices, circuits, and / or processing cores for processing data (such as computer program instructions).

[0055] Optionally, the computer device 100 further includes an output device 106 and an input device 107. The output device 106 communicates with the processor 101 and can display information in a variety of ways. For example, the output device 106 is a liquid crystal display (LCD), a light emitting diode (LED) display device, a cathode ray tube (CRT) display device or a projector. The input device 107 communicates with the processor 101 and can receive user input in a variety of ways. For example, the input device 107 is a mouse, a keyboard, a touch screen device or a sensor device.

[0056] In the case where the computer device is a frame-type architecture, the target device can be a component / chip in the computer device. Taking the computer device as a network node as an example, the target device can be any interface board in the network node. Figure 2 The network node 200 of the frame-type architecture includes: a main control board 210, an interface board 230 and an interface board 240. In the case where the network node 200 includes multiple interface boards, the network node 200 may also include a switching network board ( Figure 2 The switching network board is used to complete data exchange between interface boards (interface boards are also called line cards or service boards).

[0057] The main control board 210 is used to complete functions such as system management, equipment maintenance, and protocol processing. The interface board 230 and the interface board 240 are used to provide various business interfaces (for example, POS interface, GE interface, ATM interface, etc.) and realize the forwarding of data streams. The main control board 210 mainly includes three types of functional units: system management control unit, system clock unit, and system maintenance unit. The main control board 210, the interface board 230, and the interface board 240 are connected to the system backplane through the system bus to realize intercommunication. The interface board 230 includes one or more processors 231. The processor 231 is used to control and manage the interface board and communicate with the central processing unit on the main control board, and is used for forwarding processing of data streams. The memory 232 on the interface board 230 is used to store forwarding table items, and the processor 231 forwards the data stream by searching the forwarding table items stored in the memory 232.

[0058] The interface board 230 includes one or more network interfaces 233 for receiving data streams or other information sent by a terminal or other network device, and processing these data streams or data according to the instructions of the processor 231. The specific implementation process will not be described one by one here.

[0059] It is understandable that if Figure 2 As shown, the embodiment of the present application includes multiple interface boards and adopts a distributed forwarding mechanism. Under this mechanism, the operation on the interface board 240 is basically similar to the operation on the interface board 230, and for the sake of brevity, it will not be repeated.

[0060] Furthermore, it is understandable that Figure 2 The processor 231 in the interface board 230 and / or the processor 241 in the interface board 240 may be dedicated hardware or chips, such as a network processor or an application specific integrated circuit (application specific integrated circuit) to implement the above functions. This implementation method is what is commonly referred to as the forwarding plane using dedicated hardware or chip processing.

[0061] Optionally, the processor 231 and / or the processor 241 may also adopt a general-purpose processor, such as a general-purpose CPU, to implement the functions described above.

[0062] In addition, it should be noted that there may be one or more main control boards, and when there are multiple boards, they may include a main main control board and a standby main control board. There may be one or more interface boards. The stronger the data processing capability of the device, the more interface boards are provided. In the case of multiple interface boards, the multiple interface boards can communicate with each other through one or more switching network boards, and when there are multiple boards, they can jointly realize load sharing and redundant backup. Under the centralized forwarding architecture, the device may not need a switching network board, and the interface board is responsible for the processing function of the service data of the entire system. Under the distributed forwarding architecture, the device includes multiple interface boards, and data exchange between multiple interface boards can be realized through the switching network board, providing large-capacity data exchange and processing capabilities. Therefore, the data access and processing capabilities of the network nodes of the distributed architecture are greater than those of the devices of the centralized architecture. Which architecture to adopt depends on the specific networking deployment scenario, and no limitation is made here.

[0063] The memory 232 may be a read-only memory (ROM), a random access memory (RAM), a flash, an electrically erasable programmable read-only memory (EEPROM), an optical disk including (compact disc read-only memory (CD-ROM), a compressed optical disk, a laser disk, a digital versatile disk, a Blu-ray disk, etc.), a disk storage medium or other magnetic storage device, or any other medium that can be used to carry or store the desired program code in the form of instructions or data structures and can be accessed by a computer, but is not limited thereto. The memory 232 may exist independently and be connected to the processor 231 via a communication bus. The memory 232 may also be integrated with the processor 231.

[0064] The network interface 233 may be a device using any transceiver type for communicating with other devices or communication networks, such as Ethernet, radio access network (RAN), wireless local area networks (WLAN), etc. The network interface 233 includes a wired network interface and may also include a wireless network interface. Among them, the wired network interface may be, for example, an Ethernet interface. The Ethernet interface may be an optical interface, an electrical interface, or a combination thereof. The wireless network interface may be a WLAN interface, a cellular network communication interface, or a combination thereof, etc. When the network node acts as any network node in the domain, the network interface 233 is used to forward data messages to other network nodes.

[0065] Optionally, the network node 200 may include multiple processors, each of which may be a single-core processor or a multi-core processor. The processor here may refer to one or more devices, circuits, and / or processing cores for processing data (such as computer program instructions).

[0066] In some embodiments, the interface board 230 also includes a boot firmware recovery device 234, which can be an independent security chip, such as a micro controller unit (MCU) chip with a higher security level, or a secure field programmable gate array (FPGA) chip; the boot firmware recovery device 234 can also be a part of the function integrated in a system on chip (SOC) or a processor. The embodiment of the present application does not limit the setting method of the boot firmware recovery device in the interface board 230.

[0067] In some embodiments, the flash is used to store the boot firmware; the processor 231 is used to call and execute the boot firmware from the flash to boot after the interface board 230 is powered on or reset; the memory 232 is used to store the program code for executing the boot firmware recovery method provided in the embodiment of the present application, and the program code includes one or more software modules, and the boot firmware recovery device 234 is used to execute the program code stored in the memory 232, using the following Figure 5 The boot firmware recovery method shown is used to recover the boot firmware of the interface board 230 .

[0068] It should be noted that the startup firmware is usually stored in the flash of the interface board, but it can also be partially or completely stored in other memories. The embodiment of the present application only takes storage in flash as an example for explanation. For the case where the startup firmware is stored in other memories, the startup firmware recovery method provided in the embodiment of the present application is also applicable.

[0069] Based on the above description, the computer device can be a box-type architecture or a frame-type architecture. When the boot firmware recovery method provided by the embodiment of the present application is implemented under different architectures, the interaction objects and implementation processes are slightly different, but the overall technical concept and implementation logic are the same. Next, the details of implementing the boot firmware recovery of these two architectures are introduced.

[0070] Please refer to Figure 3In the case where the computer device is a box-type architecture (i.e., the target device is a box-type architecture), the system architecture for implementing the boot firmware recovery method includes a target device and an external device. The target device includes a processor, a switch, a target flash, a boot firmware recovery device, a recovery interface, and a recovery switch. The target flash is used to store the boot firmware of the target device, and the external device is mainly responsible for providing a firmware recovery file.

[0071] The processor is connected to the target flash through a serial peripheral interface (SPI) bus and a switch, connected to the recovery interface through a universal serial bus (USB) bus and a switch, and connected to the RJ45 (Registered Jack 45, a network connection interface) management serial port through an RS232 (a serial communication interface standard) bus and a switch. The boot firmware recovery device is connected to the target flash through the SPI bus and a switch, connected to the recovery interface through the USB bus and a switch, connected to the RJ45 management serial port through the RS232 bus and a switch, and the boot firmware recovery device is also connected to the recovery switch.

[0072] The external device can be a removable storage device such as a USB flash drive or a mobile hard disk. The external device can be connected to the startup firmware recovery device in the target device through a recovery interface, so that the startup firmware recovery device can read the firmware recovery file stored in the external device to restore the startup firmware in the target flash.

[0073] It should be noted that Figure 3 The connection method of the various components is only an example. In actual applications, they can also be connected through other methods or other buses, and the embodiments of the present application do not limit this.

[0074] In some embodiments, the firmware recovery operation can be triggered by a recovery switch. The recovery switch can be a physical switch in the target device, which is manually turned on by the triggerer of the firmware recovery operation on the target device; the recovery switch can also be a virtual switch, which is triggered by the triggerer of the firmware recovery operation through a preset computer instruction; the recovery switch can also be automatically triggered by the system according to certain conditions, that is, when it is monitored that the system of the target device meets certain conditions, the firmware recovery operation is automatically triggered. The embodiment of the present application does not limit the form of the recovery switch and the triggering method of the firmware recovery operation.

[0075] In the case where the firmware recovery operation is not triggered in the target device, the processor is connected to the target flash through a switching switch, so that when the processor is powered on, it can read the boot firmware from the target flash to realize the power-on of the target device. In the case where the firmware recovery operation is triggered, the boot firmware recovery device is connected to the target flash through a switching switch, and the boot firmware recovery device takes over the control of the target flash, executes the boot firmware recovery method provided in the embodiment of the present application, and recovers the boot firmware stored in the target flash.

[0076] As an example, the recovery interface may be a USB interface, or may be another form of interface, such as a network port, etc., and this embodiment of the present application does not impose any limitation on this.

[0077] In some embodiments, the switch may be a bus switch / multiplexer (MUX). Of course, it may also be a switch in other forms, which is not limited in the embodiments of the present application.

[0078] The RJ45 management serial port is used to warn of abnormal situations in the firmware recovery process when the firmware recovery device is started. In the embodiment of the present application, the management serial port is an RJ45 management serial port as an example for introduction. In actual applications, other types of management serial ports can also be used to warn of abnormal situations.

[0079] It should be noted that the toggle switch for the recovery interface connection and the toggle switch for the RJ45 management serial port connection can be provided with relevant functions by the startup firmware recovery device alone, or by the processor, and the embodiment of the present application does not limit this.

[0080] Please refer to Figure 4 In the case where the computer device is a frame-type architecture (i.e., the target device is an interface board in the frame-type architecture), the system architecture for implementing the boot firmware recovery method includes a target device and a main control board, and the target device is used as an interface board and is connected to the main control board through a backplane. The target device includes a processor, a switch, a target flash, and a boot firmware recovery device; the target flash is used to store the boot firmware of the target device, and the main control board is responsible for providing a firmware recovery file.

[0081] The processor in the target device is connected to the startup firmware recovery device and the target flash respectively. When executing the startup firmware recovery method provided in the embodiment of the present application, the startup firmware recovery device obtains the firmware recovery file from the main control board to restore the startup firmware in the target flash.

[0082] The connection and disconnection of the path between the processor and the target flash, and the path between the boot firmware recovery device and the target flash, can be achieved by switching a switch. As an example, the switch can be a MUX.

[0083] Optionally, the recovery bus in the frame architecture is a backplane bus, such as a controller area network bus (CANBUS) bus, a universal asynchronous receiver / transmitter (UART), Ethernet, etc.

[0084] Optionally, the target device further includes a UART as a communication interface with an external device, which can convert data transmitted between the target device and the external device between serial communication and parallel communication.

[0085] Optionally, when the frame-type architecture includes multiple main control boards, the trigger of the firmware recovery operation may be the main main control board or any standby main control board.

[0086] Based on the above Figure 3 The box architecture shown and Figure 4 In the frame architecture shown, when a firmware recovery operation is triggered on a target device, the embodiment of the present application obtains a recovery verification file provided by the triggerer of the firmware recovery operation by starting the firmware recovery device, and performs a security verification on the firmware recovery operation based on the recovery verification file. After the verification passes, the firmware recovery device is started to restore the startup firmware in the target device based on the obtained firmware recovery file.

[0087] For target devices under the box architecture, the triggerer provides the recovery verification file and obtains the firmware recovery file through an external device; for target devices under the frame architecture, the main control board acts as the trigger and provides the recovery verification file and the firmware recovery file.

[0088] It should be understood that the above-mentioned example device structure, system architecture, and firmware recovery scenario are intended to more clearly illustrate the technical solution of the embodiments of the present application, and do not constitute a limitation on the technical solution provided by the embodiments of the present application. Ordinary technicians in this field can know that with the evolution of the system architecture and the emergence of new firmware recovery scenarios, the technical solution provided by the embodiments of the present application is also applicable to similar technical problems.

[0089] Figure 5 is a flowchart of a method for booting firmware recovery provided by an embodiment of the present application, and the method is applied to the above Figure 3 or Figure 4 The following example shows how to start the firmware recovery device in the target device shown in the figure. Figure 5As shown, the method comprises the following steps:

[0090] Step 501: In response to a firmware recovery operation of a startup firmware of a target device, a recovery verification file provided by a triggerer of the firmware recovery operation is obtained.

[0091] Among them, the boot firmware, as a part of the computer system, is the underlying code that connects the hardware and the operating system when the computer starts. Usually, the boot firmware includes the system boot file (i.e. boot, a small program that automatically runs before the device is turned on and the device's operating system runs), the basic input output system (BIOS), the installation package configuration file (i.e. OS pkg, which is the core part of making the Symbian OS installation program), etc.

[0092] It should be understood that after the target device is powered on, the processor in the target device first calls and runs the program file corresponding to the boot firmware, and after the boot firmware completes the startup, the target device completes the startup. When the firmware recovery operation is triggered in the target device, in response to the firmware recovery operation, the firmware recovery device executes steps 501 to 504 to recover the boot firmware in the target device.

[0093] Since the boot firmware is closely related to the operating system of the target device and is related to whether the target device can be normally powered on, the security of the firmware recovery operation must be guaranteed to avoid damaging the operating system of the target device again during the firmware recovery process. Based on this, in response to the firmware recovery operation of the boot firmware of the target device, the firmware recovery operation is firstly security-verified based on the recovery verification file provided by the triggerer.

[0094] In a possible implementation, the implementation process of step 501 may be: when the firmware recovery operation in the target device is triggered, the firmware recovery device is started to obtain the recovery verification file provided by the triggerer to perform a security verification on the firmware recovery operation.

[0095] Referring to the previous description, based on the different architectures of the target device, the recovery verification file can be obtained from an external device connected to the target device, or from a main control board connected to the target device. The embodiment of the present application does not limit the storage location of the recovery verification file, and the storage location is determined and provided by the triggerer of the firmware recovery operation.

[0096] When the target device is a box frame, the trigger of the firmware recovery operation can be a provider of an external device, and the recovery verification file can be stored in the external device together with the firmware recovery file. In this way, the firmware recovery device can be started to obtain the recovery verification file from the external device.

[0097] When the target device is an interface board in a frame-type architecture, the trigger of the firmware recovery operation may be the main control board, and the recovery verification file may be stored in the main control board together with the firmware recovery file. In this way, the firmware recovery device can be started to obtain the recovery verification file from the main control board.

[0098] Step 502: Perform a security check on the firmware recovery operation based on the recovery verification file.

[0099] In some embodiments, the recovery verification file includes an algorithm identifier, a signature value, a device identifier, and a file identifier. The algorithm identifier and the signature value are used to verify whether the recovery verification file is a legally issued file, the device identifier is used to verify whether the recovery verification file is a verification file issued for the target device, and the file identifier is used to verify whether the recovery file is valid.

[0100] Based on this, the implementation process of step 502 can be: starting the firmware recovery device to verify whether the recovery verification file is legal based on the signature algorithm and signature value indicated by the algorithm identifier; starting the firmware recovery device to verify whether the device identifier is the same as the identifier of the target device; starting firmware recovery based on the file identifier, verifying whether the recovery verification file is valid; if the recovery verification file is legal, the device identifier is the same as the identifier of the target device and the recovery verification file is valid, then starting the firmware recovery to determine that the result of the security verification is verification passed.

[0101] In some embodiments, the boot firmware recovery device stores a signature public key, a target device identifier, and an expected file identifier. In this way, the boot firmware recovery device calculates the signature value of the recovery verification file based on the signature public key stored in itself through the signature algorithm indicated by the algorithm identifier, and compares the calculated signature value with the signature value in the recovery verification file. If the two signature values ​​are the same, the recovery verification file is determined to be legal; if the two signature values ​​are different, the recovery verification file is determined to be illegal. The device identifier in the recovery verification file is compared with the device identifier stored in itself to determine whether the two device identifiers are the same. The file identifier in the recovery verification file is compared with the expected file identifier stored in the firmware recovery device. If the two file identifiers are the same, the recovery verification file is determined to be valid. If the two file identifiers are different, the recovery verification file is determined to be invalid.

[0102] When executing the above security verification process, the signature verification, device identification verification, and file identification verification can be performed in parallel, and the results of the three verifications can be combined to determine the result of the security verification. The signature verification, device identification verification, and file identification verification can also be performed in sequence. If the result of one of the verifications is a verification failure, the verification is terminated, and the result of the security verification is determined to be a verification failure. That is, first verify whether the recovery verification file is legal. If the recovery verification file is legal, continue to verify the device identification. If the device identification is the same as the target device identification, then verify whether the recovery verification file is valid, thereby obtaining the result of the security verification.

[0103] It should be noted that the order of device identification verification and file identification verification can be adjusted, and the embodiments of the present application do not limit this. That is, when verifying the legality of the recovery verification file, you can first verify whether the device identification is the same as the target device identification, and then verify whether the recovery verification file is valid; you can also first verify whether the recovery verification file is valid, and then verify whether the device identification is the same as the target device identification.

[0104] In some other embodiments, the recovery verification file may also include a file validity count, which indicates the number of valid uses of the recovery verification file. In this way, the firmware recovery number of the target device may be obtained by starting the firmware recovery device, which indicates the total number of firmware recovery operations that have been performed on the target device through the recovery verification file, and determines whether the file validity count is greater than or equal to the firmware recovery number; if the recovery verification file is legal, the device identifier is the same as the identifier of the target device, the recovery verification file is valid, and the file validity count is greater than or equal to the firmware recovery number, then the result of the security verification is determined to be a passed verification.

[0105] It should be understood that since the file valid count is the number of valid uses of the recovery verification file, when the file valid count is greater than or equal to the number of firmware recovery times, it means that the recovery verification file is still applicable in the target device and the firmware recovery operation triggered on the target device can be security verified; when the file valid count is less than the number of firmware recovery times, it means that the recovery verification file has expired and the firmware recovery operation triggered on the target device cannot be security verified.

[0106] Optionally, the method for obtaining the number of firmware recovery times can be: a monotonic count is set in the startup firmware recovery device, and when the startup firmware recovery device receives the recovery verification file provided by the triggerer for the first time, the file valid count of the recovery verification file is set as the initial value of the monotonic counter, and each subsequent security check is performed according to the recovery verification file, and when the result of the security check is that the check passes, the value of the monotonic counter is reduced by one to reduce the number of recoverable times of the target device by one. In this way, the startup firmware recovery device can determine the difference between the file valid count and the monotonic counter value as the number of firmware recovery times of the target device.

[0107] The above is an example of determining whether the recovery verification file can continue to verify the firmware recovery operation in the target device. In actual applications, it can also be judged in other ways. For example, it is determined whether the recovery verification file can continue to verify the firmware recovery operation in the target device based on whether the value of the monotonic counter set in the startup firmware recovery device is 0. That is, if the value of the monotonic counter is greater than 0, it means that the file valid count is greater than the number of firmware recovery times; if the value of the monotonic counter is 0, it means that the file valid count is equal to the number of firmware recovery times. Therefore, when the value of the monotonic counter is greater than or equal to 0, if the recovery verification file is legal, the device identifier is the same as the identifier of the target device, and the recovery verification file is valid, then the result of the security verification is determined to be a passed verification.

[0108] It should be noted that the order of determining whether the file validity count is greater than or equal to the number of firmware recovery times can be before or after any of the above-mentioned signature verification, device identification verification, and file identification verification. In other words, the embodiment of the present application does not limit the order of the above-mentioned four verifications. Moreover, if any of the above-mentioned four verification methods fails, the result of the security verification can be considered as a failure to pass the verification.

[0109] The above-mentioned recovery verification file can be an X509 certificate, or a certificate in other formats or a custom format certificate. The embodiment of the present application does not limit the format and content items of the recovery verification file.

[0110] Please refer to Figure 6 Taking X509 certificate as an example, the recovery verification file may include version, serial number, algorithm identifier, issuer, validity period, user information, certificate public key information, SID hash, certificate count, certificate unique identifier, signature value and other information. Among them, user information includes device identifier; certificate unique identifier is the above file identifier; certificate count indicates the number of valid uses of the certificate, that is, the above file valid count.

[0111] If the result of the above security check is that the check is passed, the startup firmware recovery device enters the recovery mode and executes the contents of the following steps 503 and 504 to restore the startup firmware in the target device; if the result of the above security check is that the check is not passed, the startup firmware recovery device does not enter the recovery mode and the startup firmware recovery process terminates.

[0112] Optionally, when the security check fails, the startup firmware recovery device can issue an alarm through the management serial port or the panel indicator light to inform the triggerer that the recovery verification file verification fails and the firmware recovery operation is not performed.

[0113] Step 503: If the result of the security check is that the check is passed, the firmware recovery file corresponding to the target device is obtained, and the firmware recovery file is stored remotely from the startup firmware.

[0114] The firmware recovery file and the boot firmware are stored off-site, which means that the firmware recovery file is stored in a device other than the target device. As described above, the target device can be an independent device in a box-type architecture or an interface board in a frame-type architecture. The target device includes a processor, a boot firmware recovery device, and a target flash. The boot firmware recovery device is used to manage the recovery operation of the boot firmware, and the target flash is used to store the boot firmware. Therefore, "off-site storage" can include the following two situations:

[0115] (1) If the target device is a box-type architecture, the boot firmware is stored in the target flash in the target device, and the firmware recovery file is stored in an external device connected to the target device.

[0116] (2) If the target device is an interface board in a frame-type architecture, the boot firmware is stored in a target flash in the target device, and the firmware recovery file is stored in a main control board connected to the target device.

[0117] The target flash may be a whole flash or a specified area in a flash, and this application does not impose any restrictions on this.

[0118] The implementation process of step 503 may include the following two situations:

[0119] (1) If the target device is a box-type structure, the target device is also connected to an external device, and the external device stores a firmware recovery file. Therefore, starting the firmware recovery device can obtain the firmware recovery file of the target device from the external device.

[0120] That is, after determining that the result of the security check is that the check is passed, the startup firmware recovery device obtains the firmware recovery file from the external device to recover the startup firmware in the target flash.

[0121] (2) If the target device is an interface board in a frame-type architecture, the main control board in the frame-type architecture stores a firmware recovery file. Therefore, starting the firmware recovery device can obtain the firmware recovery file of the target device from the main control board.

[0122] As an example, after determining that the result of the security check is a check pass, the boot firmware recovery device sends a check pass message to the main control board. After receiving the check pass message, the main control board sends a firmware recovery file to the boot firmware recovery device to instruct the boot firmware recovery device to use the firmware recovery file to recover the boot firmware in the target flash.

[0123] Optionally, after obtaining the firmware recovery file, the boot firmware recovery device may first perform an integrity check on the firmware recovery file, and if the result of the integrity check is that the file is complete, the operation of writing the firmware recovery file is performed through the following step 504. In this way, the validity and integrity of the firmware recovery file can be guaranteed, thereby effectively restoring the boot firmware in the target device, and ensuring that the target device can be normally powered on after the boot firmware is restored.

[0124] Among them, the integrity check can be implemented by existing hash algorithms, content management system (CMS) signature algorithms, etc., which will not be explained in detail here.

[0125] Optionally, the boot firmware recovery device may also pre-store a signature public key for verifying the recovery firmware, so that the boot firmware recovery device may perform integrity verification on the firmware recovery file using a corresponding algorithm based on the signature public key for verifying the recovery firmware.

[0126] Step 504: Restore the startup firmware based on the firmware recovery file.

[0127] In some embodiments, when the firmware recovery operation is triggered, the control right of the target flash can be first handed over to the boot firmware recovery device, and the boot firmware in the target flash can be recovered by the boot firmware recovery device. Therefore, before executing the above step 503, the boot firmware recovery device can first switch the path between the processor and the target flash to the path between the boot firmware recovery device and the target flash, and then when executing the step 504, the boot firmware can be recovered through the path between the boot firmware recovery device and the target flash. In this way, the boot firmware recovery device executes the firmware recovery process through a dedicated security path between the boot firmware recovery device and the target flash. The recovery process is not controlled or affected by other devices such as the processor, which ensures the security of the recovery process and allows the recovery process to be executed smoothly.

[0128] In a possible implementation, the implementation process of step 504 may be: the boot firmware recovery device determines the storage location of the boot firmware in the target flash; based on the storage location, the firmware recovery file is written to the target flash through the path between the boot firmware recovery device and the target flash.

[0129] It should be understood that if the boot firmware in the target flash is tampered with, after executing the write firmware recovery file operation, the newly written boot firmware can overwrite the original damaged boot firmware, thereby completing the firmware recovery. If the boot firmware in the target flash is deleted, executing the write firmware recovery file operation is to rewrite the boot firmware in the target flash to complete the firmware recovery.

[0130] Among them, the storage location of the boot firmware in the target flash can be an access address of a flash block, or an access address of a specified area in a flash block, and the embodiment of the present application does not limit this.

[0131] In some embodiments, after the boot firmware recovery is completed, the boot firmware recovery device may also switch the path between the boot firmware recovery device and the target flash to the path between the processor and the target flash, that is, disconnect the connection between the boot firmware recovery device and the target flash, return the control of the target flash to the processor, and wait for the target device to restart.

[0132] As an example, after the startup firmware recovery is completed, the startup firmware recovery device can also prompt through a preset management serial port or panel indicator light to inform the administrator of the target device under the monitoring box architecture, or the main control board connected to the target device that the firmware recovery process is completed.

[0133] Further, in response to a restart operation of the target device, the processor reads and runs the startup firmware from the target flash to power on the target device.

[0134] Among them, the restart operation can be triggered manually or by instructions of an administrator, and can also be automatically triggered after a preset time interval after the firmware recovery is completed. The embodiments of the present application do not limit this.

[0135] Optionally, in the above firmware recovery process, corresponding log information can be generated based on the security check result and the firmware recovery result to facilitate information storage and data query by management personnel. In other words, regardless of whether the security check result is passed or not, and whether the firmware recovery is successful or not, log information can be generated, so that in the case of a security check failure and / or a firmware recovery failure, it is convenient for management personnel to know the reasons for the security check failure and / or the reasons for the firmware recovery failure.

[0136] As an example, the log information may include trigger information, trigger time, security check results, firmware recovery results, etc. If the security check result fails, the log information may also include the reason for the failure of the check. If the firmware recovery fails, the log information may also include the reason for the firmware recovery failure. The embodiments of the present application do not limit this.

[0137] In summary, in an embodiment of the present application, the boot firmware recovery device responds to the firmware recovery operation of the boot firmware of the target device, first obtains the recovery verification file provided by the trigger of the firmware recovery operation, and performs a security check on the firmware recovery operation. When the result of the security check is that the check passes, the firmware recovery file corresponding to the target device is obtained, and based on the firmware recovery file, the boot firmware is restored, so that the restored boot firmware can achieve the normal startup of the target device. Since the firmware recovery file and the boot firmware are stored in different places, the security of the boot firmware and the security of the firmware recovery file are independent of each other. In the case that the boot firmware is tampered with or deleted, it can be effectively restored through the firmware recovery file, which improves the startup stability of the target device and enables the target device to start normally.

[0138] Next, through Figure 7 The boot firmware recovery method provided in the embodiment of the present application is exemplarily introduced. Figure 7 After the triggerer triggers the firmware recovery operation through the recovery switch or recovery instruction, the firmware recovery device is started to obtain the recovery verification file provided by the triggerer for security verification, that is, to verify whether the recovery verification file is legal, whether the recovery verification file is valid, whether the device identifier is the same as the target device identifier, and whether the verification file valid count is greater than or equal to the number of firmware recovery times.

[0139] If the recovery verification file is legal, the recovery verification file is valid, the device identifier is the same as the target device identifier, and the file valid count is greater than or equal to the number of firmware recovery times, that is, if the above verification results are all "yes", the value of the monotonic counter in the firmware recovery device will be reduced by one to update the number of recoverable times of the target device. If the verification result of any of the above items is "no" during the security verification process, the security verification problem will be reported to the triggerer through an alarm and the security verification process will be terminated.

[0140] If the security check passes, the firmware recovery device is started to enter the recovery mode, obtain the firmware recovery file, and verify the integrity of the firmware recovery file. If it is determined that the firmware recovery file is complete, the startup firmware in the target device is restored based on the firmware recovery file.

[0141] In this way, the boot firmware recovery device responds to the firmware recovery operation of the boot firmware of the target device, and first performs a security check on the firmware recovery operation based on the recovery verification file to ensure that the firmware recovery operation is implemented in a safe environment. If the result of the security check is that the check passes, the boot firmware is effectively restored based on the firmware recovery file, so that the restored boot firmware can realize the normal startup of the target device.

[0142] Please refer to Figure 8 The embodiment of the present application provides a boot firmware recovery device 800. The device 800 includes a first acquisition module 801, a security verification module 802, a second acquisition module 803 and a recovery module 804.

[0143] The first acquisition module 801 is used to respond to the firmware recovery operation of the startup firmware of the target device and obtain the recovery verification file provided by the trigger of the firmware recovery operation; please refer to the relevant content in the above step 501 for the detailed implementation process, which will not be repeated here.

[0144] The security verification module 802 is used to perform security verification on the firmware recovery operation based on the recovery verification file; for the detailed implementation process, please refer to the relevant content in the above step 502, which will not be repeated here.

[0145] The second acquisition module 803 is used to obtain the firmware recovery file corresponding to the target device if the result of the security check is passed. The firmware recovery file and the startup firmware are stored remotely. Please refer to the relevant content in the above step 503 for the detailed implementation process, which will not be repeated here.

[0146] The recovery module 804 is used to recover the boot firmware based on the firmware recovery file. Please refer to the relevant content in the above step 504 for the detailed implementation process, which will not be repeated here.

[0147] Optionally, the recovery verification file includes an algorithm identifier, a signature value, a device identifier, and a file identifier;

[0148] The safety verification module 802 includes:

[0149] A legal verification unit, used to verify whether the restored verification file is legal based on the signature algorithm and signature value indicated by the algorithm identifier;

[0150] A device verification unit, used to verify whether the device identification is the same as the target device identification;

[0151] A file verification unit, used to verify whether the recovery verification file is valid based on the file identifier;

[0152] The first determination unit is used to determine that the result of the security verification is verification passed if the recovery verification file is legal, the device identifier is the same as the identifier of the target device, and the recovery verification file is valid.

[0153] Optionally, the recovery verification file further includes a file validity count, where the file validity count indicates the number of valid uses of the recovery verification file;

[0154] The safety verification module 802 further includes:

[0155] A statistical unit, used to obtain a firmware recovery number of a target device, where the firmware recovery number indicates a total number of times a firmware recovery operation has been performed on the target device by restoring a verification file;

[0156] The first determining unit is further configured to:

[0157] If the recovery verification file is legal, the device identification is the same as the identification of the target device, the recovery verification file is valid, and the file validity count is greater than or equal to the firmware recovery times, the result of the security verification is determined to be verification passed.

[0158] Optionally, the target device includes a processor, a boot firmware recovery device and a target flash memory, the boot firmware recovery device is used to manage the recovery operation of the boot firmware, and the target flash memory is used to store the boot firmware;

[0159] The boot firmware recovery device 800 further includes:

[0160] A path switching module is used to switch the path between the processor and the target flash to the path between the boot firmware recovery device and the target flash;

[0161] The above recovery module 804 is also used for:

[0162] Based on the firmware recovery file, the boot firmware is restored through a path between the boot firmware recovery device and the target flash.

[0163] Optionally, the recovery module 804 includes:

[0164] A second determining unit is used to determine the storage location of the boot firmware in the target flash;

[0165] The file writing unit is used to write the firmware recovery file into the target flash by starting the path between the firmware recovery device and the target flash based on the storage location.

[0166] Optionally, the target device is a box-type architecture, and the target device is further connected to an external device, and the external device stores a firmware recovery file;

[0167] The second acquisition module 803 is specifically used for:

[0168] Get the firmware recovery file from an external device.

[0169] Optionally, the target device is an interface board in a frame-type architecture, the frame-type architecture further includes a main control board, and the main control board stores a firmware recovery file;

[0170] The second acquisition module 803 is specifically used for:

[0171] Obtain the firmware recovery file from the main control board.

[0172] In summary, in an embodiment of the present application, the boot firmware recovery device responds to the firmware recovery operation of the boot firmware of the target device, first obtains the recovery verification file provided by the trigger of the firmware recovery operation, and performs a security check on the firmware recovery operation. When the result of the security check is that the check passes, the firmware recovery file corresponding to the target device is obtained, and based on the firmware recovery file, the boot firmware is restored, so that the restored boot firmware can achieve the normal startup of the target device. Since the firmware recovery file and the boot firmware are stored in different places, the security of the boot firmware and the security of the firmware recovery file are independent of each other. In the case that the boot firmware is tampered with or deleted, it can be effectively restored through the firmware recovery file, which improves the startup stability of the target device and enables the target device to start normally.

[0173] It should be noted that the boot firmware recovery device provided in the above embodiment only uses the division of the above functional modules as an example when executing the above boot firmware recovery process. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above. In addition, the boot firmware recovery device provided in the above embodiment and the boot firmware recovery method embodiment belong to the same concept. The specific implementation process is detailed in the method embodiment and will not be repeated here.

[0174] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer instructions are loaded and executed on the computer, the process or function according to the embodiment of the present application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network or other programmable device. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from a website site, computer, server or data center by wired (for example: coaxial cable, optical fiber, data user line (digital subscriber line, DSL)) or wireless (for example: infrared, wireless, microwave, etc.) mode to another website site, computer, server or data center. The computer-readable storage medium can be any available medium that can be accessed by the computer, or a data storage device such as a server or data center that contains one or more available media integrated. The available medium may be a magnetic medium (e.g., a floppy disk, a hard disk, a magnetic tape), an optical medium (e.g., a digital versatile disc (DVD)), or a semiconductor medium (e.g., a solid state disk (SSD)), etc. It is worth noting that the computer-readable storage medium mentioned in the embodiment of the present application may be a non-volatile storage medium, in other words, a non-transient storage medium.

[0175] It should be understood that the "at least one" mentioned herein refers to one or more, and "multiple" refers to two or more. In the description of the embodiments of the present application, unless otherwise specified, " / " means or, for example, A / B can mean A or B; "and / or" in this article is only a description of the association relationship of the associated objects, indicating that there can be three relationships, for example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. In addition, in order to facilitate the clear description of the technical solutions of the embodiments of the present application, in the embodiments of the present application, the words "first", "second" and the like are used to distinguish the same items or similar items with basically the same functions and effects. Those skilled in the art can understand that the words "first", "second" and the like do not limit the quantity and execution order, and the words "first", "second" and the like do not limit them to be necessarily different.

[0176] It should be noted that the information (including but not limited to user device information, user personal information, etc.), data (including but not limited to data used for analysis, stored data, displayed data, etc.) and signals involved in the embodiments of this application are all authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with the relevant laws, regulations and standards of the relevant countries and regions. For example, the files and data involved in the embodiments of this application are all obtained with full authorization.

[0177] The above are embodiments provided for the present application and are not intended to limit the present application. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application should be included in the protection scope of the present application.

Claims

1. A method for restoring a startup firmware, characterized in that: The method comprises: In response to a firmware recovery operation of the startup firmware of the target device, obtaining a recovery verification file provided by a triggerer of the firmware recovery operation; Based on the recovery verification file, performing a security verification on the firmware recovery operation; If the result of the security check is that the check passes, a firmware recovery file corresponding to the target device is obtained, and the firmware recovery file is stored remotely from the startup firmware; The boot firmware is restored based on the firmware recovery file.

2. The method according to claim 1, characterized in that The recovery verification file includes an algorithm identifier, a signature value, a device identifier and a file identifier; The performing a security check on the firmware recovery operation based on the recovery check file includes: Based on the signature algorithm indicated by the algorithm identifier and the signature value, verifying whether the recovery verification file is legal; Verifying whether the device identification is the same as the target device identification; Based on the file identifier, verifying whether the recovery verification file is valid; If the recovery verification file is legal, the device identification is the same as the identification of the target device, and the recovery verification file is valid, then it is determined that the result of the security verification is verification passed.

3. The method according to claim 2, characterized in that The recovery verification file also includes a file validity count, and the file validity count indicates the number of valid uses of the recovery verification file; Before determining that the result of the security check is a check pass, the method further includes: Acquire a firmware recovery count of the target device, where the firmware recovery count indicates a total number of times a firmware recovery operation has been performed on the target device through the recovery verification file; If the recovery verification file is legal, the device identifier is the same as the identifier of the target device, and the recovery verification file is valid, determining that the result of the security verification is a verification pass includes: If the recovery verification file is legal, the device identification is the same as the identification of the target device, the recovery verification file is valid and the file validity count is greater than or equal to the firmware recovery times, then the result of the security verification is determined to be verification passed.

4. The method according to claim 1, characterized in that The target device comprises a processor, a boot firmware recovery device and a target flash memory, wherein the boot firmware recovery device is used to manage the recovery operation of the boot firmware, and the target flash memory is used to store the boot firmware; Before obtaining the firmware recovery file corresponding to the target device, the method further includes: Switching the path between the processor and the target flash to the path between the boot firmware recovery device and the target flash; The restoring the boot firmware based on the firmware recovery file includes: Based on the firmware recovery file, the boot firmware is restored through a path between the boot firmware recovery device and the target flash.

5. The method according to claim 4, characterized in that The method of restoring the boot firmware based on the firmware recovery file through a path between the boot firmware recovery device and the target flash includes: Determine the storage location of the boot firmware in the target flash; Based on the storage location, the firmware recovery file is written into the target flash through a path between the boot firmware recovery device and the target flash.

6. The method according to any one of claims 1 to 5, characterized in that The target device is a box-type structure, and the target device is also connected to an external device, and the external device stores the firmware recovery file; The obtaining of the firmware recovery file corresponding to the target device includes: The firmware recovery file is obtained from the external device.

7. The method according to any one of claims 1 to 5, characterized in that The target device is an interface board in a frame-type architecture, the frame-type architecture further includes a main control board, and the main control board stores the firmware recovery file; The obtaining of the firmware recovery file corresponding to the target device includes: The firmware recovery file is obtained from the main control board.

8. A boot firmware recovery device, characterized in that: The device comprises: A first acquisition module, configured to, in response to a firmware recovery operation of a startup firmware of a target device, obtain a recovery verification file provided by a triggerer of the firmware recovery operation; A security verification module, used to perform a security verification on the firmware recovery operation based on the recovery verification file; A second acquisition module is used to acquire a firmware recovery file corresponding to the target device if the result of the security check is that the check is passed, and the firmware recovery file is stored remotely from the startup firmware; A recovery module is used to recover the startup firmware based on the firmware recovery file.

9. The device according to claim 8, characterized in that The recovery verification file includes an algorithm identifier, a signature value, a device identifier and a file identifier; The safety verification module comprises: A legal verification unit, used to verify whether the recovery verification file is legal based on the signature algorithm indicated by the algorithm identifier and the signature value; A device verification unit, used to verify whether the device identification is the same as the identification of the target device; A file verification unit, used to verify whether the recovery verification file is valid based on the file identifier; The first determination unit is configured to determine that a result of the security verification is a passed verification if the recovery verification file is legal, the device identifier is the same as an identifier of the target device, and the recovery verification file is valid.

10. The device according to claim 9, characterized in that The recovery verification file also includes a file validity count, and the file validity count indicates the number of valid uses of the recovery verification file; The safety verification module further includes: a statistical unit, configured to obtain a number of firmware recovery times of the target device, wherein the number of firmware recovery times indicates a total number of times firmware recovery operations have been performed on the target device through the recovery verification file; The first determining unit is further configured to: If the recovery verification file is legal, the device identification is the same as the identification of the target device, the recovery verification file is valid and the file validity count is greater than or equal to the firmware recovery times, then the result of the security verification is determined to be verification passed.

11. The device according to claim 8, characterized in that The target device comprises a processor, the boot firmware recovery device and a target flash memory, wherein the boot firmware recovery device is used to manage the recovery operation of the boot firmware, and the target flash memory is used to store the boot firmware; The boot firmware recovery device further comprises: A path switching module, used for switching the path between the processor and the target flash to the path between the boot firmware recovery device and the target flash; The recovery module is further used for: Based on the firmware recovery file, the boot firmware is restored through a path between the boot firmware recovery device and the target flash.

12. The device according to claim 11, characterized in that The recovery module comprises: A second determining unit, used to determine a storage location of the boot firmware in the target flash; The file writing unit is used to write the firmware recovery file into the target flash through the path between the startup firmware recovery device and the target flash based on the storage location.

13. The device according to any one of claims 8 to 12, characterized in that The target device is a box-type structure, and the target device is also connected to an external device, and the external device stores the firmware recovery file; The second acquisition module is specifically used for: The firmware recovery file is obtained from the external device.

14. The device according to any one of claims 8 to 12, characterized in that The target device is an interface board in a frame-type architecture, the frame-type architecture further includes a main control board, and the main control board stores the firmware recovery file; The second acquisition module is specifically used for: The firmware recovery file is obtained from the main control board.

15. A computer device, characterized in that: The computer device includes a flash, a processor and a boot firmware recovery device; The flash is used to store the boot firmware; The processor is used to call and execute the startup firmware from the flash to start the computer after the computer device is powered on or reset; The boot firmware recovery device is used to execute the steps of the method described in any one of claims 1 to 7 to recover the boot firmware of the computer device.

16. A computer-readable storage medium, characterized in that: The storage medium stores a computer program, which implements the steps of any one of the methods described in claims 1 to 7 when the firmware recovery device is started and executed.

17. A computer program product, characterized in that The computer program product comprises a computer program, and when the computer program is executed by a startup firmware recovery device, the steps of the method according to any one of claims 1 to 7 are implemented.

Citation Information

Cited By

  • Information determination method, electronic device, storage medium and program product

    CN120429206A

  • Firmware starting method and device, electronic equipment and machine readable medium

    CN120448189A