Server firmware recovery method and device, computer equipment and storage medium
By setting the condition determination module and triggering conditions in the server, the active recovery function of the server firmware is realized, the limitations of the existing PFR mechanism passive triggering method are solved, and the flexibility and applicability of the system are improved.
Patent Information
- Application Number
- CN202411922962.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-25
- Publication Date
- 2025-04-18
AI Technical Summary
The PFR mechanism of existing servers only relies on passive triggering methods and cannot actively choose trigger recovery, resulting in reduced flexibility and applicability.
Set up the condition determination module in the server, set one or more trigger conditions, allowing users to actively trigger the platform firmware recovery function. This module performs firmware file integrity verification when the server is powered on, and determines whether the module's opening and server information meets the triggering conditions based on the conditions, and decides whether to perform the recovery function.
The active recovery function of server firmware is realized, which improves the flexibility and applicability of the system. Users can set up a variety of trigger conditions according to their needs to meet the needs of different scenarios.
Smart Images

Figure CN119847820A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of server technology, and in particular to a server firmware recovery method, apparatus, computer equipment, and storage medium. Background Technology
[0002] Modern servers are typically equipped with PFR (Platform Firmware Resilience) functionality to protect platform assets, detect malicious or erroneous behavior such as corrupted firmware, and restore platform firmware to a good state to ensure high reliability and availability of the BIOS (Basic Input Output System) and BMC (Baseboard Manager Controller).
[0003] Currently, servers with PFR (Pre-Recovery Framework) functionality are divided into an active zone, a recovery zone, and an upgrade zone. Each time the server powers on, the active and recovery zones are verified. If the firmware in the active zone is corrupted, the image backup file in the recovery zone is used to expand and overwrite the active zone, restoring it to a healthy state. While the existing PFR mechanism provides high system recovery capabilities, its applicability and flexibility are somewhat limited. The main problem is that the current PFR process relies solely on a passive triggering method; the recovery mechanism is only triggered after the verification of the BIOS or BMC's active zone fails. It cannot actively choose to trigger recovery, significantly reducing the flexibility and applicability of this technology. Summary of the Invention
[0004] Therefore, it is necessary to provide a server firmware recovery method, apparatus, computer equipment, and storage medium that can actively trigger the platform firmware recovery function to address the above-mentioned technical problems.
[0005] On the one hand, a server firmware recovery method is provided, the method comprising:
[0006] A condition determination module is set up, and one or more trigger conditions are set in the condition determination module. The trigger conditions are used to trigger the platform firmware recovery function of the server.
[0007] In response to the server powering on, a firmware file integrity check is performed on the server, and an image file of the server firmware is obtained;
[0008] In response to a verification failure, the platform firmware recovery function of the server is executed using the image file;
[0009] In response to successful verification and the activation of the condition determination module, server information is acquired in real time, and it is determined whether the server information meets one or more triggering conditions.
[0010] In response to the fulfillment of the triggering condition, the platform firmware recovery function of the server is executed using the image file.
[0011] In one embodiment, after setting the condition determination module and setting one or more trigger conditions in the condition determination module, the method further includes:
[0012] Select the trigger mode according to the set trigger conditions. The trigger modes include single trigger and sequential trigger.
[0013] In response to the existence of a single triggering condition in the condition determination module, the triggering mode is set to single trigger;
[0014] In response to the existence of multiple triggering conditions in the condition determination module, the triggering mode is set to single triggering or sequential triggering.
[0015] In one embodiment, after performing firmware file integrity verification on the server in response to server power-on, the method further includes:
[0016] Upon successful verification, the server is started, and it is determined whether the condition determination module is enabled.
[0017] If the condition determination module is not enabled, the platform firmware recovery function of the server will not be executed.
[0018] In one embodiment, in response to successful verification and the activation of the condition determination module, server information is acquired in real time, and it is determined whether the server information meets one or more triggering conditions, including:
[0019] Obtain the triggering conditions set in the condition determination module;
[0020] The server information corresponding to the triggering condition is obtained by querying the first processor, wherein the server information includes one or more of hardware time, power status and firmware version;
[0021] In response to the hardware time reaching a set time, and / or the power state reaching a specified state, and / or the firmware version changing, it is determined that the server information meets the corresponding triggering conditions;
[0022] In response to the existence of a single trigger condition in the condition determination module, and the server information satisfying the trigger condition, a recovery signal is sent to the second processor, the recovery signal being used to execute the platform firmware recovery function;
[0023] In response to the existence of multiple triggering conditions in the condition determination module, the triggering mode corresponding to the multiple triggering conditions is obtained, and the server information is determined to meet the triggering conditions based on the triggering mode;
[0024] In response to the triggering mode being a single trigger and the existence of any type of server information satisfying the corresponding triggering condition, a recovery signal is sent to the second processor;
[0025] In response to the triggering mode being triggered sequentially, the system iterates through the multiple triggering conditions, determines whether the server information meets the triggering conditions one by one, and sends a recovery signal to the second processor when the triggering conditions are met.
[0026] In one embodiment, the method further includes:
[0027] In response to the triggering mode being a single trigger, the condition determination module is closed after the server information first satisfies any one of the triggering conditions;
[0028] In response to the triggering mode being sequential, the condition determination module is turned off after the multiple triggering conditions are met sequentially.
[0029] In one embodiment, the server includes non-volatile memory, which includes an active area, a recovery area, and an upgrade area. The active area stores the server firmware, and the recovery area stores an image file of the server firmware. After performing the platform firmware recovery function of the server using the image file, the method further includes:
[0030] Restart the server from the active zone and check if a firmware upgrade is needed;
[0031] In response to the need to upgrade the firmware version, a new firmware version is obtained from the upgrade package and stored in the upgrade area. The new firmware version is then written to the active area and the recovery area through the upgrade area to complete the firmware upgrade.
[0032] After the firmware upgrade is completed, the new image file in the active area is obtained, compressed in the upgrade area, and uploaded to the recovery area to overwrite the original image file in the recovery area.
[0033] In one embodiment, the method further includes:
[0034] In response to the activation of the condition determination module, and the absence of any type of server information that meets the corresponding triggering condition, the server is started normally, and the platform firmware recovery function of the server is not executed.
[0035] On the other hand, a server firmware recovery device is provided, the device comprising:
[0036] The setting module is used to set the condition determination module, and set one or more trigger conditions in the condition determination module. The trigger conditions are used to trigger the platform firmware recovery function of the server.
[0037] The verification module is used to perform firmware file integrity verification on the server in response to the server power-on and to obtain the image file of the server firmware;
[0038] The first recovery module is used to perform the platform firmware recovery function of the server using the image file in response to a verification failure.
[0039] The judgment module is used to respond to successful verification and the condition judgment module being activated, to obtain server information in real time, and to determine whether the server information meets one or more triggering conditions.
[0040] The second recovery module is used to perform the platform firmware recovery function of the server using the image file in response to the fulfillment of the triggering condition.
[0041] In another aspect, a computer device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to perform the following steps:
[0042] A condition determination module is set up, and one or more trigger conditions are set in the condition determination module. The trigger conditions are used to trigger the platform firmware recovery function of the server.
[0043] In response to the server powering on, a firmware file integrity check is performed on the server, and an image file of the server firmware is obtained;
[0044] In response to a verification failure, the platform firmware recovery function of the server is executed using the image file;
[0045] In response to successful verification and the activation of the condition determination module, server information is acquired in real time, and it is determined whether the server information meets one or more triggering conditions.
[0046] In response to the fulfillment of the triggering condition, the platform firmware recovery function of the server is executed using the image file.
[0047] In another aspect, a computer-readable storage medium is provided having a computer program stored thereon, which, when executed by a processor, performs the following steps:
[0048] A condition determination module is set up, and one or more trigger conditions are set in the condition determination module. The trigger conditions are used to trigger the platform firmware recovery function of the server.
[0049] In response to the server powering on, a firmware file integrity check is performed on the server, and an image file of the server firmware is obtained;
[0050] In response to a verification failure, the platform firmware recovery function of the server is executed using the image file;
[0051] In response to successful verification and the activation of the condition determination module, server information is acquired in real time, and it is determined whether the server information meets one or more triggering conditions.
[0052] In response to the fulfillment of the triggering condition, the platform firmware recovery function of the server is executed using the image file.
[0053] The aforementioned server firmware recovery method, apparatus, computer equipment, and storage medium, by adding a condition determination module within the upgrade area, activate when the user determines to initiate the proactive PFR (Proactive Pre-Failure Recovery) function. This allows users to set various trigger conditions for proactively triggering PFR as needed. For users who use the server temporarily, usage traces can be automatically cleared after use, thus better protecting information security. For long-term users, different trigger conditions can be selected to meet different scenario requirements. Attached Figure Description
[0054] Figure 1 This is a flowchart illustrating a server firmware recovery method in one embodiment;
[0055] Figure 2 This is a flowchart illustrating the server firmware recovery steps in one embodiment;
[0056] Figure 3 This is a flowchart illustrating the server firmware recovery steps in another embodiment;
[0057] Figure 4 This is a schematic diagram of the server connection relationship in one embodiment;
[0058] Figure 5 This is a structural block diagram of a server firmware recovery device in one embodiment;
[0059] Figure 6 This is an internal structural diagram of a computer device in one embodiment. Detailed Implementation
[0060] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.
[0061] In one embodiment, such as Figure 1-4 As shown, a server firmware recovery method is provided, including the following steps:
[0062] Step S1: Set up the condition determination module and set one or more trigger conditions in the condition determination module. The trigger conditions are used to trigger the platform firmware recovery function of the server.
[0063] In the PFR security architecture, FLASH memory is a non-volatile storage device divided into three parts: Active, Recovery, and Staging. BIOS (Basic Input / Output System) and BMC supporting PFR store the directly executable firmware in the Active area, the Recovery area stores compressed backup files, and the Staging area is a temporary buffer for upgrades. During server startup, PFR verifies the Active area; if verification is successful, the server boots from the Active area. If verification fails, PFR restores the image from the Recovery area to the Active area and then restarts. When system firmware is upgraded, PFR verifies the upgrade package; if verification is successful, the firmware is first placed in the Staging area, then the system restarts. After restarting, the new firmware is written to both the Active and Recovery areas.
[0064] In an optional implementation, after setting a condition determination module and setting one or more trigger conditions in the condition determination module, the method further includes:
[0065] Select the trigger mode based on the set trigger conditions. Trigger modes include single trigger and sequential trigger.
[0066] In response to the existence of a single trigger condition in the condition determination module, the trigger mode is set to single trigger;
[0067] In response to the existence of multiple triggering conditions in the condition determination module, the triggering mode is set to single trigger or sequential trigger.
[0068] Specifically, a condition determination module is set up in the upgrade area. If there is only one trigger condition in the condition determination module, the trigger mode is automatically set to single trigger. In this mode, as long as one piece of server information is detected to meet the trigger condition for the first time, it is determined that the trigger condition is met, and the platform firmware recovery function is started. If there are multiple trigger conditions in the condition determination module, the user can choose the trigger mode as single trigger or sequential trigger according to their needs. In the sequential trigger mode, the system will check whether all trigger conditions are met one by one, and start the platform firmware recovery function once when each trigger condition is detected to be met, which is suitable for staged recovery operations in complex scenarios.
[0069] Based on the above steps, by introducing a condition determination module and supporting the selection of multiple trigger modes, users can flexibly configure trigger conditions and trigger modes according to specific application scenarios and business needs, without relying on passive triggering mechanisms, thereby improving the flexibility and adaptability of server firmware recovery methods.
[0070] Step S2: In response to the server powering on, perform firmware file integrity verification on the server and obtain the server firmware image file.
[0071] In an optional implementation, after performing a firmware file integrity check on the server in response to power-on, the method further includes:
[0072] Upon successful verification, the server is started, and it is determined whether the condition determination module is enabled.
[0073] If the condition determination module is not enabled, the server's platform firmware recovery function will not be executed.
[0074] Specifically, users can choose whether to enable the condition judgment module based on specific application scenarios and business needs to achieve a more flexible and customized firmware recovery mechanism. If they choose not to enable it, the system will enter the default firmware file integrity verification process.
[0075] In an optional implementation, it further includes:
[0076] The active area, recovery area, and upgrade area are each divided into multiple sub-areas, and keywords are extracted and named for each sub-area;
[0077] In response to a failure of the active area verification, retrieve the first sub-region in the active area that failed the verification.
[0078] Find the second sub-region with the same name in the upgrade area based on the name of the first sub-region, and verify the second sub-region;
[0079] In response to the successful verification of the second sub-region, the image file in the second sub-region is replaced in the first sub-region;
[0080] In response to the failure of the second sub-region verification, the third sub-region with the same name in the recovery area is searched based on the name of the second sub-region, and the third sub-region is verified.
[0081] In response to the successful verification of the third sub-region, the image file in the third sub-region is replaced in the first sub-region.
[0082] Based on the above steps, by verifying each sub-region of the active area separately, recording the sub-regions that fail the verification, and according to the one-to-one mapping relationship of sub-regions with the same name in each region, when the verification fails, the corresponding sub-region can be quickly retrieved for corresponding recovery. This allows the recovery process to focus only on these sub-regions that fail the verification, thereby shortening the data recovery process.
[0083] Step S3: In response to the verification failure, the platform firmware recovery function of the server is executed using the image file.
[0084] Step S4: In response to successful verification and the activation of the condition determination module, server information is obtained in real time, and it is determined whether the server information meets one or more triggering conditions.
[0085] In an optional implementation, in response to successful verification and the activation of the condition determination module, server information is acquired in real time, and it is determined whether the server information meets one or more triggering conditions, including:
[0086] Get the trigger conditions set in the condition determination module;
[0087] The server information corresponding to the triggering condition is obtained by querying the first processor. The server information includes one or more of the following: hardware time, power status, and firmware version.
[0088] In response to the hardware time reaching a set time, and / or the power state reaching a specified state, and / or the firmware version changing, the server information is determined to meet the corresponding triggering conditions.
[0089] In response to the existence of a single trigger condition in the condition determination module and the server information meeting the trigger condition, a recovery signal is sent to the second processor. The recovery signal is used to execute the platform firmware recovery function.
[0090] In response to the existence of multiple triggering conditions in the condition determination module, the triggering mode corresponding to the multiple triggering conditions is obtained, and the server information is determined to meet the triggering conditions based on the triggering mode.
[0091] In response to the triggering mode being a single trigger and the existence of server information of any type that meets the corresponding triggering conditions, a recovery signal is sent to the second processor;
[0092] In response to the triggering mode being triggered sequentially, multiple triggering conditions are traversed, and the server information is checked one by one to determine whether the triggering conditions are met. When the triggering conditions are met, a recovery signal is sent to the second processor.
[0093] The first processor can be a BMC (Baseboard Manager Controller), and the second processor can be a CPLD (Complex Programmable Logic Device). After the condition determination module is started, it will obtain the server's hardware time, power status and firmware version in real time through the BMC, that is, monitor the server status in the background using commands.
[0094] For example, the recovery function can be triggered after a specified date and time are reached, such as by setting a countdown or a specific time. When the customer confirms the execution of this function, the system will use RTC to keep track of the time. When the specified time is reached, the system will actively send a recovery signal to the CPLD to perform firmware recovery on the server.
[0095] Furthermore, it can be configured to trigger the recovery function when the server's power status changes. For example, it can be configured to trigger after the system is shut down for the next time or after the system is powered on for the next time. After confirming the execution of this function, the system will detect the server's power status. When the specified status is reached, it will actively send a recovery signal to the CPLD to restore the server's firmware.
[0096] Furthermore, it can be configured to trigger the recovery function when the server's firmware version changes. After confirming the execution of this function, the system will use the current firmware version as a basis, and when the firmware version changes, it will actively send a recovery signal to the CPLD to perform firmware recovery on the server.
[0097] Based on the steps described above, the single-trigger mode is suitable for quickly responding to a single event, ensuring that the recovery function can be initiated promptly even under a single trigger condition. For example, for users temporarily using the server, the BIOS and BMC traces can be automatically cleared after use, thus better protecting their information security. The sequential trigger mode, on the other hand, provides finer control, allowing multiple trigger conditions to be executed in sequence. It is suitable for phased recovery operations in complex scenarios. For example, for long-term server users, setting proactive trigger conditions can also prevent unauthorized logins to some extent.
[0098] In an optional implementation, the method further includes: in response to a single triggering mode, closing the condition determination module after the server information first satisfies any one of the triggering conditions; and in response to a sequential triggering mode, closing the condition determination module after traversing multiple triggering conditions.
[0099] Specifically, by introducing an automatic shutdown mechanism for the condition determination module, it is immediately shut down after the triggering condition is met, reducing the possibility of false triggering and avoiding unnecessary recovery operations, thereby improving the security and stable operation capability of server firmware recovery.
[0100] Step S5: In response to the fulfillment of the triggering condition, the platform firmware recovery function of the server is executed using the image file.
[0101] In an optional implementation, after performing the server's platform firmware recovery function using the image file, the method further includes:
[0102] Restart the server from the active zone and check if a firmware upgrade is needed;
[0103] In response to the need to upgrade the firmware version, the new firmware version is obtained from the upgrade package and stored in the upgrade area. The new firmware version is then written to the active area and the recovery area through the upgrade area to complete the firmware upgrade.
[0104] After the firmware upgrade is completed, the new image file is obtained from the active area, compressed in the upgrade area, and uploaded to the recovery area to overwrite the original image file in the recovery area.
[0105] Specifically, in traditional methods, after triggering the recovery function, the BIOS and BMC versions and settings will be restored to factory settings. In this embodiment, by updating the image file after completing the firmware upgrade, user settings can be saved, so that the system always stays in the best operating state, saving the time required to upgrade the firmware version and modify settings after performing the recovery process.
[0106] In an optional implementation, the system further includes: in response to the condition determination module being enabled and the absence of any type of server information satisfying the corresponding triggering condition, the server is started normally without executing the server's platform firmware recovery function.
[0107] It should be understood that, although Figure 1-3 The steps in the flowchart are shown sequentially as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order in which these steps are executed, and they can be performed in other orders. Figure 1-3 At least some of the steps in the process may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be executed in turn or alternately with other steps or at least some of the sub-steps or stages of other steps.
[0108] In one embodiment, such as Figure 5 As shown, a server firmware recovery device is provided, comprising: a setting module, a verification module, a first recovery module, a judgment module, and a second recovery module, wherein:
[0109] The settings module is used to set the conditions judgment module, and to set one or more trigger conditions in the conditions judgment module. The trigger conditions are used to trigger the platform firmware recovery function of the server.
[0110] The verification module is used to perform firmware file integrity verification on the server in response to the server power-on and to obtain the server firmware image file;
[0111] The first recovery module is used to perform the platform firmware recovery function of the server using the image file in response to verification failure.
[0112] The judgment module is used to respond to successful verification and the condition judgment module being enabled, to obtain server information in real time, and to determine whether the server information meets one or more trigger conditions.
[0113] The second recovery module is used to perform the platform firmware recovery function of the server using the image file in response to the fulfillment of the trigger conditions.
[0114] In one embodiment, the setting module is further configured to select a trigger mode according to the set trigger conditions, the trigger modes including single trigger and sequential trigger; in response to the existence of a single trigger condition in the condition determination module, the trigger mode is set to single trigger; in response to the existence of multiple trigger conditions in the condition determination module, the trigger mode is set to single trigger or sequential trigger.
[0115] In one embodiment, the verification module is further configured to start the server in response to successful verification and determine whether the condition determination module is enabled; in response to the condition determination module not being enabled, the server's platform firmware recovery function is not executed.
[0116] In one embodiment, the judgment module is further configured to obtain the trigger conditions set in the condition judgment module; obtain the server information corresponding to the trigger conditions by querying the first processor, wherein the server information includes one or more of hardware time, power status, and firmware version; in response to the hardware time reaching a set time, and / or the power status reaching a specified state, and / or the firmware version changing, determine that the server information meets the corresponding trigger conditions; in response to the existence of a single trigger condition in the condition judgment module, and the server information meeting the trigger conditions, send a recovery signal to the second processor, the recovery signal being used to execute the platform firmware recovery function; in response to the existence of multiple trigger conditions in the condition judgment module, obtain the trigger modes corresponding to the multiple trigger conditions, and determine whether the server information meets the trigger conditions according to the trigger modes; in response to the trigger mode being a single trigger, and the existence of server information of any type meeting the corresponding trigger conditions, send a recovery signal to the second processor; in response to the trigger mode being sequential trigger, traverse multiple trigger conditions, determine whether the server information meets the trigger conditions one by one, and send a recovery signal to the second processor when the trigger conditions are met.
[0117] In one embodiment, the second recovery module is further configured to, in response to a single trigger mode, close the condition determination module after the server information first satisfies any one of the trigger conditions; and in response to a sequential trigger mode, close the condition determination module after traversing multiple trigger conditions.
[0118] In one embodiment, the server includes non-volatile memory, which includes an active area, a recovery area, and an upgrade area. The active area stores server firmware, and the recovery area stores an image file of the server firmware. The device also includes a backup module, which is used to restart the server from the active area and detect whether a firmware version upgrade is needed. In response to the need for a firmware version upgrade, the backup module obtains a new firmware version from an upgrade package and stores it in the upgrade area. The new firmware version is then written to the active area and the recovery area through the upgrade area to complete the firmware upgrade. After the firmware upgrade is completed, the backup module obtains the new image file from the active area, compresses it through the upgrade area, and uploads it to the recovery area to overwrite the original image file in the recovery area.
[0119] In one embodiment, the judgment module is further configured to respond to the condition judgment module being enabled and the absence of any type of server information satisfying the corresponding triggering condition, to start the server normally without executing the server's platform firmware recovery function.
[0120] For specific limitations regarding the server firmware recovery device, please refer to the limitations of the server firmware recovery method above, which will not be repeated here. Each module in the aforementioned server firmware recovery device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in the computer device in hardware form, or stored in the memory of the computer device in software form, so that the processor can call and execute the corresponding operations of each module.
[0121] In one embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be as follows: Figure 5 As shown, the computer device includes a processor, memory, network interface, and database connected via a system bus. The processor provides computing and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and database. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The database stores server information data. The network interface communicates with external terminals via a network connection. When executed by the processor, the computer program implements a server firmware recovery method.
[0122] Those skilled in the art will understand that Figure 6 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[0123] In one embodiment, a computer device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to perform the following steps:
[0124] Set up a condition determination module and set one or more trigger conditions in the condition determination module. The trigger conditions are used to trigger the platform firmware recovery function of the server.
[0125] In response to the server powering on, perform firmware file integrity verification on the server and obtain the server firmware image file;
[0126] In response to verification failure, the platform firmware recovery function of the server is executed using the image file;
[0127] In response to successful verification and the activation of the condition determination module, server information is obtained in real time, and it is determined whether the server information meets one or more triggering conditions.
[0128] In response to the fulfillment of the triggering conditions, the platform firmware recovery function of the server is executed using the image file.
[0129] In one embodiment, when the processor executes the computer program, it further performs the following steps: selecting a trigger mode according to a set trigger condition, the trigger mode including single trigger and sequential trigger; setting the trigger mode to single trigger in response to the existence of a single trigger condition in the condition determination module; and setting the trigger mode to single trigger or sequential trigger in response to the existence of multiple trigger conditions in the condition determination module.
[0130] In one embodiment, when the processor executes the computer program, it further performs the following steps: in response to successful verification, it starts the server and determines whether the condition determination module is enabled; in response to the condition determination module not being enabled, it does not execute the platform firmware recovery function of the server.
[0131] In one embodiment, when the processor executes the computer program, it further performs the following steps: obtaining the trigger conditions set in the condition determination module; obtaining server information corresponding to the trigger conditions by querying the first processor, wherein the server information includes one or more of hardware time, power status, and firmware version; determining that the server information meets the corresponding trigger conditions in response to the hardware time reaching a set time, and / or the power status reaching a specified state, and / or the firmware version changing; sending a recovery signal to the second processor in response to the existence of a single trigger condition in the condition determination module and the server information meeting the trigger conditions, the recovery signal being used to execute the platform firmware recovery function; obtaining the trigger modes corresponding to the multiple trigger conditions in response to the existence of multiple trigger conditions in the condition determination module, and determining whether the server information meets the trigger conditions according to the trigger modes; sending a recovery signal to the second processor in response to the trigger mode being a single trigger and any type of server information meeting the corresponding trigger conditions; and traversing multiple trigger conditions in response to the trigger mode being a sequential trigger, determining whether the server information meets the trigger conditions one by one, and sending a recovery signal to the second processor when the trigger conditions are met.
[0132] In one embodiment, when the processor executes the computer program, it further implements the following steps: in response to a single trigger mode, after the server information first satisfies any one of the trigger conditions, the condition determination module is closed; in response to a sequential trigger mode, after traversing multiple trigger conditions, the condition determination module is closed.
[0133] In one embodiment, when the processor executes the computer program, it further performs the following steps: restarting the server from the active area and detecting whether a firmware version upgrade is required; in response to the need for a firmware version upgrade, obtaining a new firmware version from the upgrade package and storing it in the upgrade area, writing the new firmware version to the active area and the recovery area through the upgrade area to complete the firmware upgrade; after the firmware upgrade is completed, obtaining a new image file from the active area, compressing it through the upgrade area, and uploading it to the recovery area to overwrite the original image file in the recovery area.
[0134] In one embodiment, when the processor executes the computer program, it further performs the following steps: in response to the condition determination module being enabled and the absence of any type of server information satisfying the corresponding triggering condition, the server is started normally without executing the server's platform firmware recovery function.
[0135] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon, the computer program performing the following steps when executed by a processor:
[0136] Set up a condition determination module and set one or more trigger conditions in the condition determination module. The trigger conditions are used to trigger the platform firmware recovery function of the server.
[0137] In response to the server powering on, perform firmware file integrity verification on the server and obtain the server firmware image file;
[0138] In response to verification failure, the platform firmware recovery function of the server is executed using the image file;
[0139] In response to successful verification and the activation of the condition determination module, server information is obtained in real time, and it is determined whether the server information meets one or more triggering conditions.
[0140] In response to the fulfillment of the triggering conditions, the platform firmware recovery function of the server is executed using the image file.
[0141] In one embodiment, when the computer program is executed by the processor, it further performs the following steps: selecting a trigger mode according to a set trigger condition, the trigger mode including single trigger and sequential trigger; setting the trigger mode to single trigger in response to the existence of a single trigger condition in the condition determination module; and setting the trigger mode to single trigger or sequential trigger in response to the existence of multiple trigger conditions in the condition determination module.
[0142] In one embodiment, when the computer program is executed by the processor, it further performs the following steps: in response to successful verification, the server is started, and it is determined whether the condition determination module is enabled; in response to the condition determination module not being enabled, the platform firmware recovery function of the server is not executed.
[0143] In one embodiment, when the computer program is executed by the processor, it further implements the following steps: obtaining the trigger conditions set in the condition determination module; obtaining server information corresponding to the trigger conditions by querying the first processor, wherein the server information includes one or more of hardware time, power status, and firmware version; determining that the server information meets the corresponding trigger conditions in response to the hardware time reaching a set time, and / or the power status reaching a specified state, and / or the firmware version changing; sending a recovery signal to the second processor in response to the existence of a single trigger condition in the condition determination module and the server information meeting the trigger conditions, the recovery signal being used to execute the platform firmware recovery function; obtaining the trigger modes corresponding to the multiple trigger conditions in response to the existence of multiple trigger conditions in the condition determination module, and determining whether the server information meets the trigger conditions according to the trigger modes; sending a recovery signal to the second processor in response to the trigger mode being a single trigger and any type of server information meeting the corresponding trigger conditions; and traversing multiple trigger conditions in response to the trigger mode being a sequential trigger, determining whether the server information meets the trigger conditions one by one, and sending a recovery signal to the second processor when the trigger conditions are met.
[0144] In one embodiment, when the computer program is executed by the processor, it further implements the following steps: in response to a single trigger mode, after the server information first satisfies any one of the trigger conditions, the condition determination module is closed; in response to a sequential trigger mode, after traversing multiple trigger conditions, the condition determination module is closed.
[0145] In one embodiment, when the computer program is executed by the processor, it further performs the following steps: restarting the server from the active area and detecting whether a firmware version upgrade is required; in response to the need for a firmware version upgrade, obtaining a new firmware version from the upgrade package and storing it in the upgrade area, writing the new firmware version to the active area and the recovery area through the upgrade area to complete the firmware upgrade; after the firmware upgrade is completed, obtaining a new image file from the active area, compressing it through the upgrade area, and uploading it to the recovery area to overwrite the original image file in the recovery area.
[0146] In one embodiment, when the computer program is executed by the processor, it further performs the following steps: in response to the condition determination module being enabled and the absence of any type of server information satisfying the corresponding triggering condition, the server is started normally without executing the server's platform firmware recovery function.
[0147] In one embodiment, a computer product is provided that stores a computer program, which, when executed by a processor, performs the following steps:
[0148] Set up a condition determination module and set one or more trigger conditions in the condition determination module. The trigger conditions are used to trigger the platform firmware recovery function of the server.
[0149] In response to the server powering on, perform firmware file integrity verification on the server and obtain the server firmware image file;
[0150] In response to verification failure, the platform firmware recovery function of the server is executed using the image file;
[0151] In response to successful verification and the activation of the condition determination module, server information is obtained in real time, and it is determined whether the server information meets one or more triggering conditions.
[0152] In response to the fulfillment of the triggering conditions, the platform firmware recovery function of the server is executed using the image file.
[0153] In one embodiment, when the computer program is executed by the processor, it further performs the following steps: selecting a trigger mode according to a set trigger condition, the trigger mode including single trigger and sequential trigger; setting the trigger mode to single trigger in response to the existence of a single trigger condition in the condition determination module; and setting the trigger mode to single trigger or sequential trigger in response to the existence of multiple trigger conditions in the condition determination module.
[0154] In one embodiment, when the computer program is executed by the processor, it further performs the following steps: in response to successful verification, the server is started, and it is determined whether the condition determination module is enabled; in response to the condition determination module not being enabled, the platform firmware recovery function of the server is not executed.
[0155] In one embodiment, when the computer program is executed by the processor, it further implements the following steps: obtaining the trigger conditions set in the condition determination module; obtaining server information corresponding to the trigger conditions by querying the first processor, wherein the server information includes one or more of hardware time, power status, and firmware version; determining that the server information meets the corresponding trigger conditions in response to the hardware time reaching a set time, and / or the power status reaching a specified state, and / or the firmware version changing; sending a recovery signal to the second processor in response to the existence of a single trigger condition in the condition determination module and the server information meeting the trigger conditions, the recovery signal being used to execute the platform firmware recovery function; obtaining the trigger modes corresponding to the multiple trigger conditions in response to the existence of multiple trigger conditions in the condition determination module, and determining whether the server information meets the trigger conditions according to the trigger modes; sending a recovery signal to the second processor in response to the trigger mode being a single trigger and any type of server information meeting the corresponding trigger conditions; and traversing multiple trigger conditions in response to the trigger mode being a sequential trigger, determining whether the server information meets the trigger conditions one by one, and sending a recovery signal to the second processor when the trigger conditions are met.
[0156] In one embodiment, when the computer program is executed by the processor, it further implements the following steps: in response to a single trigger mode, after the server information first satisfies any one of the trigger conditions, the condition determination module is closed; in response to a sequential trigger mode, after traversing multiple trigger conditions, the condition determination module is closed.
[0157] In one embodiment, when the computer program is executed by the processor, it further performs the following steps: restarting the server from the active area and detecting whether a firmware version upgrade is required; in response to the need for a firmware version upgrade, obtaining a new firmware version from the upgrade package and storing it in the upgrade area, writing the new firmware version to the active area and the recovery area through the upgrade area to complete the firmware upgrade; after the firmware upgrade is completed, obtaining a new image file from the active area, compressing it through the upgrade area, and uploading it to the recovery area to overwrite the original image file in the recovery area.
[0158] In one embodiment, when the computer program is executed by the processor, it further performs the following steps: in response to the condition determination module being enabled and the absence of any type of server information satisfying the corresponding triggering condition, the server is started normally without executing the server's platform firmware recovery function.
[0159] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium. When executed, the computer program can include the processes of the embodiments of the above methods. Any references to memory, storage, databases, or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), RAMbus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and RAMbus dynamic RAM (RDRAM), etc.
[0160] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0161] The above embodiments merely illustrate several implementation methods of this application, and while the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the invention patent. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this patent application should be determined by the appended claims.
Claims
1. A server firmware recovery method, characterized in that: include: Setting a condition determination module, and setting one or more trigger conditions in the condition determination module, wherein the trigger conditions are used to trigger a platform firmware recovery function of the server; In response to the server being powered on, performing a firmware file integrity check on the server and obtaining an image file of the server firmware; In response to a verification failure, executing a platform firmware recovery function of the server using the image file; In response to the verification being successful and the condition determination module being turned on, the server information is acquired in real time, and it is determined whether the server information satisfies the one or more trigger conditions; In response to satisfying the trigger condition, a platform firmware recovery function of the server is executed using the image file.
2. The server firmware recovery method according to claim 1, characterized in that: After the condition determination module is set and one or more trigger conditions are set in the condition determination module, the method further includes: Select a trigger mode according to the set trigger conditions, the trigger mode including single trigger and sequential trigger; In response to the existence of a single trigger condition in the condition determination module, setting the trigger mode to single trigger; In response to the presence of multiple trigger conditions in the condition determination module, the trigger mode is set to single trigger or sequential trigger.
3. The server firmware recovery method according to claim 1, characterized in that: After the server is powered on, the firmware file integrity check is performed on the server, and the following steps are further included: In response to successful verification, starting the server and determining whether the condition determination module is enabled; In response to the condition determination module not being enabled, the platform firmware recovery function of the server is not executed.
4. The server firmware recovery method according to claim 2, characterized in that: In response to the verification being successful, and the condition determination module being turned on, obtaining server information in real time, and determining whether the server information satisfies the one or more trigger conditions, includes: Obtaining the triggering condition set in the condition determination module; Acquire server information corresponding to the trigger condition by querying the first processor, wherein the server information includes one or more of hardware time, power status, and firmware version; In response to the hardware time reaching a set time, and / or the power state reaching a specified state, and / or the firmware version changing, determining that the server information meets a corresponding trigger condition; In response to the existence of a single trigger condition in the condition determination module and the server information meets the trigger condition, sending a recovery signal to the second processor, wherein the recovery signal is used to execute the platform firmware recovery function; In response to the presence of multiple trigger conditions in the condition determination module, acquiring trigger modes corresponding to the multiple trigger conditions, and judging whether the server information satisfies the trigger conditions according to the trigger modes; In response to the trigger mode being a single trigger and the existence of any type of server information satisfying a corresponding trigger condition, sending a recovery signal to the second processor; In response to the trigger mode being sequential triggering, the multiple trigger conditions are traversed, and it is determined one by one whether the server information meets the trigger conditions, and a recovery signal is sent to the second processor when the trigger conditions are met.
5. The server firmware recovery method according to claim 4, characterized in that: The method further comprises: In response to the trigger mode being a single trigger, after the server information meets any one of the trigger conditions for the first time, closing the condition determination module; In response to the trigger mode being sequential triggering, after traversing the multiple trigger conditions, the condition determination module is closed.
6. The server firmware recovery method according to claim 1, characterized in that: The server includes a non-volatile memory, the non-volatile memory includes an active area, a recovery area and an upgrade area, the active area is used to store the server firmware, the recovery area is used to store an image file of the server firmware, and after the platform firmware recovery function of the server is executed by using the image file, the following is further included: Restarting the server from the active area and detecting whether a firmware version upgrade is required; In response to the need to upgrade the firmware version, a new firmware version is obtained from the upgrade package and stored in the upgrade area, and the new firmware version is written into the active area and the recovery area through the upgrade area to complete the firmware upgrade; After completing the firmware upgrade, a new image file in the active area is obtained, and the new image file is compressed in the upgrade area and uploaded to the recovery area to overwrite the original image file in the recovery area.
7. The server firmware recovery method according to claim 1 or 4, characterized in that: The method further comprises: In response to the condition determination module being turned on and there not being any type of server information satisfying the corresponding trigger condition, the server is started normally without executing the platform firmware recovery function of the server.
8. A server firmware recovery device, characterized in that: The device comprises: A setting module, used for setting a condition determination module, and setting one or more trigger conditions in the condition determination module, wherein the trigger condition is used for triggering a platform firmware recovery function of the server; A verification module, configured to perform a firmware file integrity check on the server in response to the server being powered on, and obtain an image file of the server firmware; A first recovery module, configured to execute a platform firmware recovery function of the server using the image file in response to a verification failure; A judgment module, configured to, in response to the verification being successful and the condition judgment module being turned on, obtain server information in real time and judge whether the server information satisfies the one or more trigger conditions; The second recovery module is used to execute the platform firmware recovery function of the server by using the image file in response to satisfying the trigger condition.
9. A computer device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 7 are implemented.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.