Master / backup BIOS automatic switching method, automatic switching device, and computer

The BMC-based automatic BIOS switching method addresses inefficiencies in manual BIOS switching by automatically detecting failures and switching to backup BIOS, reducing downtime and costs in server operations.

JP2026507619AActive Publication Date: 2026-03-04INSPUR SUZHOU INTELLIGENT TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
JP · JP
Patent Type
Applications
Current Assignee / Owner
Filing Date
2024-04-25
Publication Date
2026-03-04

AI Technical Summary

Technical Problem

Current methods for manually switching between master and backup BIOS in servers are inefficient, requiring constant monitoring by skilled personnel, leading to potential downtime and increased operational costs, and are impractical for large-scale deployments.

Method used

A method and device that utilize a Baseboard Management Controller (BMC) to automatically switch between master and backup BIOS by monitoring boot process information across multiple phases, determining failure based on preset time thresholds, and initiating a switch if no change is detected, eliminating the need for manual intervention.

Benefits of technology

Automated BIOS switching ensures rapid recovery from failures, reducing downtime and operational costs by accurately detecting and addressing BIOS issues without human intervention, enhancing server stability and usability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 2026507619000001_ABST
    Figure 2026507619000001_ABST
Patent Text Reader

Abstract

An embodiment of the present application provides a master / backup BIOS automatic switching method, automatic switching device, and computer, which method includes: when a computer starts up, a BMC obtains boot process information of the master BIOS, the type of the boot process information corresponds one-to-one to the boot phase and the boot process information changes as the boot phase progresses; if the boot process information does not change within a preset time, the BMC determines that the computer has failed, the preset time corresponds one-to-one to the boot phase; and the BMC controls the master BIOS and backup BIOS to switch between the master and backup BIOS, and the master / backup BIOS switching involves switching from the master BIOS to the backup BIOS for booting, thereby eliminating the need to manually determine that the computer has failed and control the switching of the master / backup BIOS, thereby overcoming the problem of reduced stability caused by inaccurate or delayed manual determination.
Need to check novelty before this filing date? Find Prior Art

Description

[Technical Field]

[0001] CROSS-REFERENCE TO RELATED APPLICATIONS This application claims priority to a Chinese patent application filed with the China Patent Office on November 7, 2023, bearing application number 202311473038.6 and entitled "Master / backup BIOS automatic switching method, automatic switching device, and computer," the entire contents of which are incorporated herein by reference.

[0002] The embodiments of the present application relate to the computer field, and more particularly to a master / backup BIOS automatic switching method, an automatic switching device, and a computer. [Background technology]

[0003] In current server design, the secure use of servers is becoming more and more important, so more and more requirements are being set for server security, whether it is the BIOS (Basic Input Output System) or the BMC (Baseboard Management Controller), to protect the secure use of the entire server and protect customer information from infringement.

[0004] If a server's BIOS is damaged by a virus attack or a failed upgrade, the BIOS parameters of the motherboard may be lost or corrupted, causing the server to fail to power on, boot, or become unstable. While server motherboard manufacturers have the ability to address these issues, most customers are unable to resolve them, leading to the emergence of BIOS security designs.

[0005] At the BIOS level, customer protection is typically achieved through two approaches: CPU (Central Processing Unit)-side protection and motherboard-side protection. CPU-side protection means that CPU manufacturers use various viruses to attack each CPU's information library and test insecure areas during use. By fixing various bugs before shipping, CPU security is achieved. Once CPUs are mass-produced and delivered to server manufacturers, in-use CPU security can be achieved by upgrading the BIOS agesa code. Motherboard-side protection can be achieved through either pure software or a combination of software and hardware. In the pure software approach, the BIOS implements write protection, preventing insecure operations in the operating system (OS) and shell from writing to BIOS information. This can be combined with a hardware jumper cap design to achieve even more secure write protection. The software and hardware combination method generally uses a dual BIOS flash design, where two BIOS chips are designed on the motherboard. If one BIOS is damaged, the other BIOS will be automatically booted randomly, eliminating problems such as the computer being unable to boot or functions being disabled.

[0006] When designing a dual BIOS flash protection scheme, it is important to pay attention to how the BIOS can determine if the current computer is down, and how to automatically switch between the master and backup BIOS via the BMC when the computer is down.

[0007] In the related technical solution, a method for manually switching the BIOS is designed so that the computer can still operate even if the current BIOS is damaged or attacked. That is, when an operation and maintenance worker detects that the current computer is down or cannot operate, an IPMI (Intelligent Platform Management Interface) command is manually sent via the BMC to switch the BIOS and restart the computer, thereby realizing safe booting of the backup BIOS.

[0008] However, the conventional method of switching between master and backup BIOS has the following problems: 1) First, this solution places strict requirements on the working hours of operation and maintenance personnel. When the computers in the client's computer room are all powered on at once, or when the computers are repeatedly started up to verify their stability, the personnel must monitor them 24 hours a day. If the personnel are unable to quickly detect that a computer cannot be started up, the computer will remain down for a long period of time, which will significantly affect the usage efficiency of the client's computer room.

[0009] 2) Secondly, for customers, if a dedicated operation and maintenance technician is required to handle the issue, a huge expense will be incurred, and since not all operation and maintenance technicians are familiar with BIOS and BMC, the technical capabilities of the operation and maintenance technicians will also be an issue, which will significantly reduce the flexible controllability and operability of the computer.

[0010] 3) Finally, whether in a customer's computer lab or on a production line, if a large number of computers go down and the BIOS of a large number of computers becomes corrupted, they will not function properly. In this case, manually switching to the master / backup BIOS is not practical. Therefore, the design of this function is intrusive and cannot function as a selling point to attract customers. Summary of the Invention [Problem to be solved by the invention]

[0011] The embodiments of the present application provide a method, an apparatus, and a computer for automatically switching between master and backup BIOS, which at least solve the problem of poor stability caused by manually controlling the switching between master and backup BIOS in the related art. [Means for solving the problem]

[0012] According to one embodiment of the present application, there is provided a master / backup BIOS automatic switching method applied to a computer, the computer including a BMC, a master BIOS, and a backup BIOS. The backup BIOS is configured to replace the master BIOS when the master BIOS fails to boot, and the BMC is configured to control the operation of the master BIOS and the backup BIOS. The master / backup BIOS automatic switching method includes: the BMC acquiring boot process information corresponding to the master BIOS in multiple boot phases, the multiple boot phases including a secure boot phase, a load phase, and an operating system entry phase; if the boot process information in any one of the boot phases does not change within a corresponding preset time, the BMC determining that the computer has failed; the preset time corresponding to the secure boot phase is a first preset time, the preset time corresponding to the load phase is a second preset time, and the preset time corresponding to the operating system entry phase is a third preset time; and the BMC controlling the master BIOS and the backup BIOS to switch between the master and backup BIOS, and the switching of the master / backup BIOS includes switching from the master BIOS to the backup BIOS for booting.

[0013] In one exemplary embodiment, the BMC obtaining boot process information corresponding to the master BIOS in multiple boot phases includes: when the master BIOS is in the secure boot phase or the load phase, the BMC uses first power-on self-test information as the boot process information, where the first power-on self-test information is detection information output by the BMC by monitoring the CPU when the master BIOS is booted and is information used to indicate whether a boot failure has occurred.

[0014] In one exemplary embodiment, determining that the BMC has shut down the computer if the boot process information does not change within a corresponding preset time in any one of the boot phases includes determining that the BMC has shut down the computer if first power-on self-test information does not change within a first preset time.

[0015] In one exemplary embodiment, before the BMC determines that the computer is down, the method further includes determining that the first power-on self-test information does not change within a first preset time if the BMC detects that the central processing unit CPU is at the same power-on self-test code within two minutes.

[0016] In one exemplary embodiment, the BMC obtaining boot process information corresponding to the master BIOS in multiple boot phases further includes: when the master BIOS is in the load phase, the BMC establishes a communication connection with the master BIOS and sets a timestamp of a first command received by the BMC as the boot process information, the first command being a command sent by the master BIOS to the BMC at every second preset time, and the timestamp being the time when the BMC received the first command.

[0017] In one exemplary embodiment, determining that the computer has gone down if the boot process information does not change within a corresponding preset time in any one of the boot phases further includes determining that the computer has gone down if the timestamp is not updated at a second preset time.

[0018] In one exemplary embodiment, the BMC obtaining boot process information corresponding to the master BIOS in multiple boot phases further includes: when the master BIOS is in a phase of entering the operating system, the BMC taking a boot success identifier of the operating system as the boot process information, and the boot success identifier is an identifier that records that the operating system has been successfully booted.

[0019] In one exemplary embodiment, if the boot process information in any one of the boot phases does not change within a corresponding preset time, the BMC determining that the computer has gone down further includes: if the boot success identifier is empty within a period when the boot time of the computer reaches a third preset time, the BMC determining that the computer has gone down.

[0020] In one exemplary embodiment, before the BMC acquires boot process information corresponding to the master BIOS in multiple boot phases, the method further includes: if a function file of the master BIOS is refreshed, the master BIOS synchronizes the refreshed function file with the backup BIOS, and the function file is used to generate instructions to realize the function of the master BIOS.

[0021] In one exemplary embodiment, the BMC controlling the master BIOS and the backup BIOS to perform master / backup BIOS switching includes, when the BMC determines that the computer has gone down, the BMC triggering a switch command to control the master BIOS and the backup BIOS to perform master / backup BIOS switching, wherein the switch command is used to control the master BIOS to stop performing boot tasks and to control the backup BIOS to start performing boot tasks.

[0022] In one exemplary embodiment, after the BMC controls the master BIOS and the backup BIOS to switch between the master and backup BIOS, the method further includes recording power-on self-test information when the switching command is triggered, where the power-on self-test information is detection information output by the BMC by monitoring the CPU and is information used to indicate whether a boot failure has occurred.

[0023] In one exemplary embodiment, after the BMC controls the master BIOS and the backup BIOS to switch between the master and backup BIOS, the method further includes the BMC obtaining a master and backup BIOS switching log, which is used to record whether the master and backup BIOS switching is successful or not; if the master and backup BIOS switching log indicates that the master and backup BIOS switching is successful, the BMC controls the backup BIOS to perform a boot task; and if the master and backup BIOS switching log indicates that the master and backup BIOS switching is unsuccessful, the BMC issues an alarm indicating that the computer is down.

[0024] In one exemplary embodiment, when the master backup BIOS switching log indicates that the master backup BIOS has been successfully switched, the BMC controls the backup BIOS to perform a boot task; when the master backup BIOS switching log indicates that the master backup BIOS has been successfully switched and the backup BIOS is in the safe boot phase or the load phase, the BMC obtains second power-on self-test information, the second power-on self-test information being detection information output by the BMC by monitoring the CPU when the backup BIOS is booted and being information used to indicate whether a boot failure has occurred; and when the second power-on self-test information does not change within a first preset time, the BMC issues alarm information indicating that the computer is in a down state.

[0025] In one exemplary embodiment, the BMC obtaining the second power-on self-test information includes the BMC detecting a current power-on self-test code of the central processing unit CPU, where if the BMC detects that the central processing unit CPU is at the same power-on self-test code within two minutes, the BMC determines that the second power-on self-test information does not change within a first preset time.

[0026] In one exemplary embodiment, when the master / backup BIOS switching log indicates that the master / backup BIOS has been successfully switched, the BMC controls the backup BIOS to perform a boot task; when the master / backup BIOS switching log indicates that the master / backup BIOS has been successfully switched and the backup BIOS is in a load phase, the BMC establishes a communication connection with the backup BIOS and receives a second command, the second command being a command that the backup BIOS sends to the BMC every second preset time; and if the second command is not received within the second preset time, the BMC issues alarm information indicating that the computer is in a down state.

[0027] In one exemplary embodiment, when the master backup BIOS switching log indicates that the master backup BIOS has been successfully switched, the BMC controls the backup BIOS to perform a boot task; when the master backup BIOS switching log indicates that the master backup BIOS has been successfully switched and the master BIOS is in the phase of entering the operating system, the BMC searches for a boot success identifier of the operating system; and if the boot success identifier is not present within a period in which the boot time of the computer reaches a third preset time, the BMC issues alarm information that the computer is in a down state.

[0028] In one exemplary embodiment, when the master / backup BIOS switching log indicates that the master / backup BIOS switching was successful and the master BIOS is in the phase of entering the operating system, the BMC searching for a boot success identifier for the operating system includes: the BMC searching for whether the boot success identifier exists from the diagnostic log, wherein the BMC is configured to poll for whether a state of a general purpose input / output (GPIO) has changed and write the boot success identifier to the diagnostic log when the BMC polls that the state of the GPIO has changed, the state of the GPIO being configured to change after the operating system has successfully booted; determining that the BMC has searched for the boot success identifier for the operating system if the BMC searches for the existence of the boot success identifier from the diagnostic log; and determining that the BMC has not searched for the boot success identifier for the operating system if the BMC cannot search for the existence of the boot success identifier from the diagnostic log.

[0029] According to another embodiment of the present application, there is provided a master / backup BIOS automatic switching device, the computer includes a BMC, a master BIOS, and a backup BIOS, the backup BIOS is configured to replace the master BIOS when the master BIOS fails to boot, the BMC is configured to control the operation of the master BIOS and the backup BIOS, the master / backup BIOS automatic switching device is applied to the BMC, and includes a first acquisition module configured to acquire boot process information corresponding to the master BIOS in a plurality of boot phases, the plurality of boot phases including a secure boot phase, a load phase, and an operating system entry phase, and a first acquisition module configured to acquire boot process information corresponding to the master BIOS in any one of the boot phases. a determination module configured to determine that the computer has gone down if operational process information does not change within a corresponding preset time, wherein the preset time corresponding to the secure boot phase is a first preset time, the preset time corresponding to the load phase is a second preset time, and the preset time corresponding to the enter operating system phase is a third preset time; and a first control module configured to control the master BIOS and the backup BIOS to perform master / backup BIOS switching, wherein the master / backup BIOS switching is performed by switching from the master BIOS to the backup BIOS and performing booting.

[0030] According to another embodiment of the present application, there is further provided a non-volatile readable storage medium having a computer program stored therein, wherein the computer program is configured to perform the steps of any one of the above method embodiments when run.

[0031] According to another embodiment of the present application, there is further provided a computer including a master BIOS, a backup BIOS, a memory, a BMC, and a computer program stored in the memory and operable on the BMC, wherein the BMC executes the computer program to perform the steps in any one of the above embodiments. [Effects of the Invention]

[0032] According to the present application, the master / backup BIOS automatic switching method obtains boot process information from the master BIOS at each boot phase, i.e., obtains information that changes with the boot process. If the boot process information does not change within a preset time, it can determine that the master BIOS boot process has stalled and the computer has crashed. The master BIOS and backup BIOS are then automatically controlled to switch between the master and backup BIOS, eliminating the need to manually determine that the computer has crashed and control the switching of the master / backup BIOS. This overcomes the problem of reduced stability caused by inaccurate or delayed manual determination, i.e., it solves the problem of poor stability caused by manually controlling the switching of the master / backup BIOS in the related art. [Brief explanation of the drawings]

[0033] [Figure 1] 1 is a block diagram showing the hardware structure of a mobile terminal that implements a master / backup BIOS automatic switching method according to an embodiment of the present application; [Figure 2] FIG. 1 shows a block diagram of a computer according to an embodiment of the present application. [Figure 3] 1 shows a flow diagram of a method for automatically switching between master and backup BIOS according to an embodiment of the present application. [Figure 4] 10 is a flow diagram illustrating another method for automatically switching between master and backup BIOS according to an embodiment of the present application. [Figure 5] 1 illustrates a block diagram of a master / backup BIOS automatic switching device according to an embodiment of the present application; DETAILED DESCRIPTION OF THE INVENTION

[0034] Hereinafter, the present invention will be described in detail with reference to the drawings and based on the examples. In addition, the terms "first," "second," etc. in the specification, claims, and drawings of this application are used to distinguish between similar objects and are not necessarily used to describe a particular order or first-come-first-served basis.

[0035] For convenience of explanation, some nouns and terms related to the embodiments of the present application will be explained below. BMC: Baseboard Management Controller, the server's baseboard management controller.

[0036] BIOS: Basic Output and Input System. It is a set of programs fixed on a ROM chip on the motherboard of a computer. It stores the computer's most important basic input / output programs, the self-check program after startup, and the system self-start program, and also contains information for reading and writing system settings.

[0037] IPMI: Intelligent Platform Management Interface. IPMI can span different operating systems, firmware, and hardware platforms, and can intelligently monitor, control, and automatically provide feedback on the operating status of a large number of servers, thereby reducing the cost of server systems.

[0038] IO: Input / Output (IO / O) is divided into two parts: IO device and IO interface. SEC: Security Phase, a verification phase in the BIOS boot process. PEI: Pre-EFI Initialization, the EFI pre-initialization phase in the BIOS boot process.

[0039] DXE: Driver Execution Environment, a driver execution environment during the BIOS startup process. BDS: Boot Device Selection, which is the selection of the boot device during the BIOS boot process. TSL: Transient System Load, the first phase executed by the operating system loader (OS Loader) in the BIOS startup process. PSP: Platform Security Processor, the platform's secure boot core.

[0040] The method embodiments provided in the present application may be implemented on a server device or a similar computing device. For example, FIG. 1 illustrates a hardware block diagram of a mobile terminal that executes the master / backup BIOS automatic switching method according to the present application, as implemented on a server device. As illustrated in FIG. 1, the server device may include one or more processors 102 (only one of which is shown in FIG. 1 ) (processor 102 may include, but is not limited to, a processing device such as a microprocessor (MCU) or a programmable logic device (FPGA)) and memory 104 configured to store data. The server device may further include a transmission device 106 and an input / output device 108 configured to have communication capabilities. As will be appreciated by those skilled in the art, the structure illustrated in FIG. 1 is merely schematic and does not limit the structure of the server device. For example, the server device may include more or fewer components than those illustrated in FIG. 1 or may have a different configuration than that illustrated in FIG. 1.

[0041] Memory 104 may be configured to store computer programs, such as application software programs and modules, such as a computer program corresponding to the master / backup BIOS automatic switching method of an embodiment of the present disclosure. Processor 102 executes the computer programs stored in memory 104 to perform various functional applications and data processing, i.e., to implement the above-described method. Memory 104 may include high-speed random memory and may further include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some embodiments, memory 104 may further include memory located remotely from processor 102, and these remote memories may be connected to a server device via a network. Examples of such networks include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0042] The transmission device 106 is configured to transmit and receive data over a network. A preferred embodiment of the network may include a wireless network provided by the carrier of the server device. In one embodiment, the transmission device 106 includes a network interface controller (NIC) that can connect to other network devices via a base station and communicate with the Internet. In one embodiment, the transmission device 106 may be a radio frequency (RF) module that is configured to communicate with the Internet wirelessly.

[0043] FIG. 2 shows a block diagram of a computer according to an embodiment of the present application. As shown in FIG. 2, the computer includes a BMC, a master BIOS, and a backup BIOS. The backup BIOS is configured to replace the master BIOS when the master BIOS fails to start. The BMC is configured to control the operation of the master BIOS and the backup BIOS. FIG. 3 shows a flow diagram of a method for automatically switching between master and backup BIOS according to an embodiment of the present application. As shown in FIG. 3, the flow includes the following steps:

[0044] Step S202: The BMC obtains boot process information corresponding to the master BIOS in multiple boot phases, where the multiple boot phases include a secure boot phase, a load phase, and an enter operating system phase.

[0045] In a preferred application, when the computer starts up, the master BIOS starts to perform a boot task and goes through multiple boot phases in sequence, the BMC obtains boot process information corresponding to the master BIOS in the multiple boot phases, the type of the boot process information corresponds one-to-one with the boot phase, and the boot process information changes as the boot phase progresses, when the boot process of the master BIOS is not stalled, i.e., the computer is not down, some information of the boot process changes, and obtains corresponding boot process information in different boot phases, the boot process information changes as the boot phase progresses, and it can be determined whether the computer is down or not based on the boot process information, wherein the secure boot phase is used to verify that secure boot is guaranteed, the load phase is used to load the boot configuration, and the enter operating system phase is used to start the operating system.

[0046] Step S204: If the boot process information does not change within a corresponding preset time in any one of the boot phases, the BMC determines that the computer is down, and the preset time corresponding to the safe boot phase is a first preset time, the preset time corresponding to the load phase is a second preset time, and the preset time corresponding to the entering the operating system phase is a third preset time.

[0047] In a preferred application, different startup process information has different update periods, and if the startup process information does not change within a corresponding preset time (update period), it indicates that the startup process has stalled in the current startup phase, and it can be determined that the computer has gone down.

[0048] Step S206: The BMC controls the master BIOS and the backup BIOS to switch between the master and backup BIOS, and the switching between the master and backup BIOS means switching from the master BIOS to the backup BIOS for booting.

[0049] In a preferred application, the computer down indicates that the master BIOS is currently unable to boot. In this case, the master BIOS and the backup BIOS are controlled to switch between the master and backup BIOS, and the backup BIOS is used for booting, ensuring the computer can boot normally.

[0050] Through the above steps, the master / backup BIOS automatic switching method obtains boot process information from the master BIOS in each boot phase, i.e., obtains information that changes along with the boot process. If the boot process information does not change within a preset time, it can determine that the master BIOS boot process has stalled and the computer has crashed, and automatically control the master BIOS and backup BIOS to switch between the master and backup BIOS. There is no need to manually determine that the computer has crashed and control the master / backup BIOS switching, which overcomes the problem of reduced stability caused by inaccurate or delayed manual determination. In other words, it solves the problem of poor stability caused by manually controlling the master / backup BIOS switching in the related art.

[0051] Here, the entity that executes the above steps may be a "server, terminal" or the like, but is not limited to these. In one exemplary embodiment, step S202 may be realized by step S2022, in which when the master BIOS is in the safe boot phase or the load phase, the BMC sets first power-on self-test information as the boot process information, where the first power-on self-test information is detection information output by the BMC by monitoring the CPU when the master BIOS is booted, and is information used to indicate whether a boot failure has occurred.

[0052] In the above embodiment, as shown in FIG. 2, during the boot process of the computer, the CPU outputs some power-on self-test information from time to time through the IO port 80, and the BMC extracts this information through the IO port 80 and displays it on the BMC web. Therefore, when the master BIOS is in the safe boot phase or the load phase, the first power-on self-test information of these two phases is used as the boot process information to determine whether the computer has crashed. In the operating system entry phase, the computer can only be started when the operating system has successfully booted, and the power-on self-test information cannot be used to determine whether the computer has crashed.

[0053] In one exemplary embodiment, step S204 may be implemented by step S2042, in which if the first power-on self-test information does not change within a first preset time, the BMC determines that the computer is down.

[0054] In the above embodiment, if the first power-on self-test information does not change within a first preset time, i.e., the BMC monitors that the CPU is still in the same power-on self-test code within two minutes, the BMC determines that the current CPU has already stopped operating, i.e., the BMC automatically determines that the computer has gone down.

[0055] In one exemplary embodiment, step S202 may further be realized by step S2024, in which when the master BIOS is in the load phase, the BMC establishes a communication connection with the master BIOS and sets the timestamp of a first command received by the BMC as the boot process information, the first command being a command sent by the master BIOS to the BMC at every second preset time, and the timestamp being the time when the BMC receives the first command.

[0056] In the above embodiment, when the computer is booted and in the secure boot phase (PSP phase), this phase is located before the BIOS PEI phase, and normal communication cannot be performed between the BMC and the master BIOS. At this time, the BMC can only monitor whether the PSP phase is normal. After the computer completes the initialization of the PSP phase, it enters the BIOS load phase (SEC, PEI, DXE, BDS, etc.). As shown in Figure 2, during these load phases, the master BIOS and BMC can interact to determine whether the BIOS has started normally. During the boot process, the master BIOS sends an IPMI command to the BMC every 30 seconds. After receiving the command, the BMC sends a response command to the master BIOS, i.e., receives the first command. The time at which each first command is received is different, i.e., the timestamp is different. With the update of the first command, the recorded timestamp is also constantly updated. Therefore, during the load phase, the timestamp of the first command can be used as the boot process information.

[0057] In one exemplary embodiment, step S204 may be further implemented by step S2044, in which if the timestamp has not been updated to the second preset time, the BMC determines that the computer has gone down. In the above embodiment, if the timestamp is not updated at the second preset time, i.e., if the BMC does not receive the command sent by the master BIOS within 30 seconds, the BMC will assume that the master BIOS is currently unable to boot, i.e., the BMC will automatically determine that the computer has gone down.

[0058] In one exemplary embodiment, step S202 may further be implemented by step S2026, in which when the master BIOS is in the phase of entering the operating system, the BMC sets a boot success identifier of the operating system as the boot process information, and the boot success identifier is an identifier that records the successful boot of the operating system.

[0059] In the above embodiment, after verifying the computer's boot time multiple times, if it is full specification, the computer can boot normally and enter the operating system OS within 15 minutes. After the computer boots and enters the operating system OS, the state of a GPIO (General-Purpose Input / Output) for monitoring whether post has been completed changes. When the BMC polls for the change in the GPIO state, a boot success identifier (sel) of one Boot Up (Boot Up refers to the system boot process. The process of transitioning from a system shutdown state or reboot state to operating the operating system is called booting) is recorded in the IDL log (Inspur Diagnostics Log). Therefore, in the above-mentioned entering the operating system phase, the boot success identifier (sel) can be used as the boot process information.

[0060] In one exemplary embodiment, step S204 may further be realized by step S2046, in which if the boot success identifier is empty within a period in which the boot time of the computer reaches a third preset time, the BMC determines that the computer has gone down.

[0061] In the above embodiment, if the boot time of the computer is idle within a period that reaches a third preset time, i.e., if the BMC finds that there is no Boot Up sel in the IDL log within 15 minutes, the BMC will assume that the master BIOS is currently unable to boot, i.e., the BMC will automatically determine that the computer has failed.

[0062] In one exemplary embodiment, before step S202, the method further includes step S302, in which, if the function file of the master BIOS is refreshed, the master BIOS synchronizes the refreshed function file with the backup BIOS, and the function file is used to generate instructions for realizing the function of the master BIOS.

[0063] In the above embodiment, the function file may be a .bin file. After refreshing the flash of the master BIOS, the master BIOS will actively synchronize the BIOS .bin file with the backup BIOS to achieve the synchronization of the master and backup BIOS . The backup BIOS can take over from the master BIOS at any time to perform the corresponding boot task.

[0064] In one exemplary embodiment, step S206 may be implemented by step S2062, in which if the BMC determines that the computer has gone down, the BMC triggers a switch command to control the master BIOS and the backup BIOS to switch between master and backup BIOS, and the switch command is used to control the master BIOS to stop performing boot tasks and to control the backup BIOS to start performing boot tasks.

[0065] In the above embodiment, when the BMC determines that the computer is down, the BMC triggers a switching command (ipmi command) to control the master BIOS and the backup BIOS to switch between the master and backup BIOS, and the backup BIOS begins to perform boot tasks in place of the master BIOS, thereby avoiding a long-term computer downtime that would affect the user experience.

[0066] In one exemplary embodiment, after step S206, the method further includes step S402, in which power-on self-test information is recorded when the switching command is triggered, and the power-on self-test information is detection information output by the BMC after monitoring the CPU, and is used to indicate whether a startup failure has occurred.

[0067] In the above embodiment, the power-on self-test information is recorded when the switching command (ipmi command) is triggered, that is, the power-on self-test information when switching between the master and backup BIOS is recorded and used for research, development, and analysis. For example, in research and development, the power-on self-test failure information provided by the computer allows the CPU to determine in which phase of the PSP an error occurred.

[0068] In one exemplary embodiment, after step S206, the method further includes step S502, in which the BMC obtains a master backup BIOS switching log, and the master backup BIOS switching log is used to record whether the master backup BIOS switching was successful or not; step S504, in which the BMC controls the backup BIOS to perform the startup task if the master backup BIOS switching log indicates that the master backup BIOS switching was successful; and step S506, in which the BMC issues an alarm indicating that the computer is down if the master backup BIOS switching log indicates that the master backup BIOS switching failed.

[0069] In the above embodiment, when switching between the master and backup BIOS, a master / backup BIOS switching log is generated indicating whether the switching was successful or not. If the switching is successful, the backup BIOS is controlled to execute the startup task instead of the master BIOS. If the switching fails, an alarm is issued to indicate that the computer is down, reminding the operation and maintenance worker to perform maintenance promptly.

[0070] In one exemplary embodiment, step S504 may be implemented by step S5041, in which if the master / backup BIOS switching log indicates that the master / backup BIOS has been successfully switched and the backup BIOS is in the safe boot phase or the load phase, the BMC obtains second power-on self-test information, the second power-on self-test information being detection information output by the BMC by monitoring the CPU when the backup BIOS is booted and being information used to indicate whether a boot failure has occurred; and step S5042, in which if the second power-on self-test information does not change within a first preset time, the BMC issues the alarm information indicating that the computer is down.

[0071] In the above embodiment, after the master backup BIOS is successfully switched, if the backup BIOS is in the safe boot phase or the load phase, it can similarly determine whether the computer has failed based on the second power-on self-test information of the current phase. If the BMC monitors that the CPU is still in the same power-on self-test code within two minutes, the BMC determines that the current CPU has already stopped operating. That is, the BMC automatically determines that the computer has failed. If there is no second backup BIOS to switch to, it will issue the alarm information that the computer is in a failed state.

[0072] In one exemplary embodiment, step S504 may further include step S5043, in which if the master / backup BIOS switching log indicates that the master / backup BIOS has been successfully switched and the backup BIOS is in the load phase, the BMC establishes a communication connection with the backup BIOS and receives a second command, the second command being a command that the backup BIOS sends to the BMC every second preset time; and step S5044, in which if the second command is not received within the second preset time, the BMC issues the alarm information that the computer is down.

[0073] In the above embodiment, after the master backup BIOS is successfully switched, when the backup BIOS is in the load phase, it can similarly determine whether the BIOS has started up normally through interaction between the backup BIOS and the BMC. The backup BIOS will send an IPMI command to the BMC every 30 seconds during the startup process, and after the BMC receives the command, it will send a response command to the backup BIOS. If the BMC does not receive the command sent by the master BIOS within 30 seconds, the BMC will assume that the master BIOS is currently unable to start up, that is, the BMC will automatically determine that the computer has gone down. If there is no second backup BIOS to switch to, it will issue the alarm information that the computer is in a down state.

[0074] In one exemplary embodiment, step S504 may further include step S5045, in which if the master / backup BIOS switching log indicates that the master / backup BIOS has been successfully switched and the master BIOS is in the phase of entering the operating system, the BMC searches for a boot success identifier of the operating system; and step S5046, in which if the boot success identifier does not exist within a period in which the boot time of the computer reaches a third preset time, the BMC issues the alarm information that the computer is in a down state.

[0075] In the above embodiment, after the master backup BIOS is successfully switched, the backup BIOS is in the phase of entering the operating system. Similarly, if the BMC finds that there is no Boot Up sel in the IDL log within 15 minutes, the BMC will assume that the master BIOS is currently unable to boot, that is, the BMC will automatically determine that the computer is down, and if there is no second backup BIOS to switch to, it will issue the alarm information that the computer is down.

[0076] This embodiment relates to a method for testing the stability of a device, and the computer is an AMD platform device. Figure 4 shows a flow diagram of another method for automatically switching between master and backup BIOS according to an embodiment of the present application. As shown in Figure 4, after refreshing the flash of the master BIOS, the master BIOS actively synchronizes the BIOS bin file with the backup BIOS, achieving the synchronization of the master and backup BIOS bin file in step S1. When the device is booted and in the PSP phase, this phase is located before the PEI phase of the BIOS, and normal communication cannot be performed between the BMC and the BIOS. At this time, it can only be determined by monitoring the BMC whether the PSP phase is normal. During the device boot process, the CPU periodically outputs some power-on self-test information through the IO port of 80 port, and the BMC extracts this information through 80 port and sends it to the BMC.If the BMC monitors that the CPU is still in the same PST code within 2 minutes, it will determine that the current CPU has stopped operating and automatically trigger an IPMI command to switch the master / backup BIOS. The PST information when the master / backup BIOS is switched will be recorded and used for research, development, and analysis. In research and development, the PST failure information provided by AMD will allow the CPU to determine which phase of the PSP an error occurred in (step S2). After the device completes the PSP phase initialization, the BIOS SEC, PEI, DXE, BDS, and other phases will be loaded. In these phases, the BIOS will interact with the BMC to determine whether the BIOS has started normally. During the boot process, the BIOS will send an IPMI command to the BMC every 30 seconds. After receiving the command, the BMC will send a response command to the BIOS. If the BMC does not receive the command sent by the BIOS within 30 seconds, the BMC will assume that the BIOS is currently unable to boot, and will trigger an IPMI command to switch the master / backup BIOS. The power-on self-test information when the master / backup BIOS is switched will be recorded and used for research, development, and analysis. Step S3: After multiple tests of the boot time of AMD platform devices, it was found that in the case of full specifications, the device can successfully boot and enter the OS within 15 minutes. After the device boots and enters the OS, the GPIO status for monitoring that POST has been completed will change. When the BMC polls for the change in the GPIO status, a Boot Step S4 includes recording the Up sel in the IDL log, and if the BMC finds that there is no Boot Up sel in the IDL log within 15 minutes, the BMC similarly assumes that the BIOS is currently unable to boot, triggering an ipmi command to switch the master and backup BIOS, and recording power-on self-test information at the time of switching the master and backup BIOS for research, development, and analysis.

[0077] Based on the above description of the embodiments, it will be apparent to those skilled in the art that the methods of the above embodiments can be realized by adding a general-purpose hardware platform required for software, and of course, they can also be realized by hardware, and in many cases, the former is a more preferred embodiment. Based on this understanding, the technical solution of the present application, its essential or contribution to the related art, may be expressed in the form of a software product, and the computer software product is stored in a non-volatile readable storage medium (e.g., ROM / RAM, magnetic disk, optical disk) and includes several instructions for causing a terminal device (which may be a mobile phone, computer, server, network device, etc.) to execute the above methods in each embodiment of the present application.

[0078] This embodiment further provides a master / backup BIOS automatic switching device. As shown in FIG. 2, a computer includes a BMC, a master BIOS, and a backup BIOS. The backup BIOS is configured to replace the master BIOS when the master BIOS fails to boot. The BMC is configured to control the operation of the master BIOS and the backup BIOS. The master / backup BIOS automatic switching device is applied to the BMC. This device is configured to realize the above-described embodiment and preferred embodiments, and will not be further described herein. The term "module" used below may refer to a combination of software and / or hardware that realizes a preset function. While the device described in the following embodiment is preferably realized by software, hardware or a combination of software and hardware is also possible and envisioned.

[0079] FIG. 5 shows a structural block diagram of a master / backup BIOS automatic switching device according to an embodiment of the present application. As shown in FIG. 5, the master / backup BIOS automatic switching device includes a first acquisition module 22, a determination module 24, and a first control module 26.

[0080] The first acquisition module 22 is configured to acquire boot process information corresponding to the master BIOS in the plurality of boot phases, the plurality of boot phases including a secure boot phase, a load phase, and an enter operating system phase.

[0081] In a preferred application, when the computer starts up, the master BIOS starts to perform a boot task and goes through multiple boot phases in sequence, the BMC obtains boot process information corresponding to the master BIOS in the multiple boot phases, the type of the boot process information corresponds one-to-one with the boot phase, and the boot process information changes as the boot phase progresses, when the boot process of the master BIOS is not stalled, i.e., the computer is not down, some information of the boot process changes, and obtains corresponding boot process information in different boot phases, the boot process information changes as the boot phase progresses, and it can be determined whether the computer is down or not based on the boot process information, wherein the secure boot phase is used to verify that secure boot is guaranteed, the load phase is used to load the boot configuration, and the enter operating system phase is used to start the operating system.

[0082] The determination module 24 is configured to determine that the computer is down if the boot process information does not change within a corresponding preset time in any one of the boot phases, the preset time corresponding to the secure boot phase is a first preset time, the preset time corresponding to the load phase is a second preset time, and the preset time corresponding to the enter operating system phase is a third preset time.

[0083] In a preferred application, different startup process information has different update periods, and if the startup process information does not change within a corresponding preset time (update period), it indicates that the startup process has stalled in the current startup phase, and it can be determined that the computer has gone down.

[0084] The first control module 26 is configured to control the BMC to switch between the master BIOS and the backup BIOS, and the switching between the master and backup BIOS means switching from the master BIOS to the backup BIOS and booting.

[0085] In a preferred application, the computer down indicates that the master BIOS is currently unable to boot. In this case, the master BIOS and the backup BIOS are controlled to switch between the master and backup BIOS, and the backup BIOS is used for booting, ensuring the computer can boot normally.

[0086] Using the above module, the master / backup BIOS automatic switching device obtains boot process information for each boot phase of the master BIOS, i.e., obtains information that changes along with the boot process. If the boot process information does not change within a preset time, it can determine that the master BIOS boot process has stalled and the computer has crashed, and automatically control the master BIOS and backup BIOS to switch between the master and backup BIOS. This eliminates the need to manually determine that the computer has crashed and control the switching of the master / backup BIOS, thereby overcoming the problem of reduced stability caused by inaccurate or delayed manual judgment. In other words, it solves the problem of poor stability caused by manually controlling the switching of the master / backup BIOS in the related art.

[0087] In one exemplary embodiment, the first acquisition module includes a first acquisition sub-module, and the first acquisition sub-module is configured such that when the master BIOS is in the safe boot phase or the load phase, the BMC uses first power-on self-test information as the boot process information, and the first power-on self-test information is detection information output by the BMC by monitoring a CPU when the master BIOS is booted and is used to indicate whether a boot failure has occurred.

[0088] In the above embodiment, as shown in FIG. 2, during the boot process of the computer, the CPU outputs some power-on self-test information from time to time through the IO port 80, and the BMC extracts this information through the IO port 80 and displays it on the BMC web. Therefore, when the master BIOS is in the safe boot phase or the load phase, the first power-on self-test information of these two phases is used as the boot process information to determine whether the computer has crashed. In the operating system entry phase, the computer can only be started when the operating system has successfully booted, and the power-on self-test information cannot be used to determine whether the computer has crashed.

[0089] In one exemplary embodiment, the determination module includes a first determination sub-module, and the first determination sub-module is configured to determine that the BMC is down if the first power-on self-test information does not change within a first preset time.

[0090] In the above embodiment, if the first power-on self-test information does not change within a first preset time, i.e., the BMC monitors that the CPU is still in the same power-on self-test code within two minutes, the BMC determines that the current CPU has already stopped operating, i.e., the BMC automatically determines that the computer has gone down.

[0091] In one exemplary embodiment, the first acquisition module further includes a second acquisition sub-module, and the second acquisition sub-module is configured such that when the master BIOS is in the load phase, the BMC establishes a communication connection with the master BIOS and sets a timestamp of a first command received by the BMC as the boot process information, the first command being a command sent by the master BIOS to the BMC at every second preset time, and the timestamp being the time when the BMC receives the first command.

[0092] In the above embodiment, when the computer is booted and in the secure boot phase (PSP phase), this phase is located before the BIOS PEI phase, and normal communication cannot be performed between the BMC and the master BIOS. At this time, the BMC can only monitor whether the PSP phase is normal. After the computer completes the initialization of the PSP phase, it enters the BIOS load phase (SEC, PEI, DXE, BDS, etc.). As shown in Figure 2, during these load phases, the master BIOS and BMC can interact to determine whether the BIOS has started normally. During the boot process, the master BIOS sends an IPMI command to the BMC every 30 seconds. After receiving the command, the BMC sends a response command to the master BIOS, i.e., receives the first command. The time at which each first command is received is different, i.e., the timestamp is different. With the update of the first command, the recorded timestamp is also constantly updated. Therefore, during the load phase, the timestamp of the first command can be used as the boot process information.

[0093] In one exemplary embodiment, the determination module further includes a second determination sub-module, and the second determination sub-module is configured to determine that the BMC has downed the computer if the timestamp has not been updated at the second preset time.

[0094] In the above embodiment, if the timestamp is not updated at the second preset time, i.e., the BMC does not receive a command sent by the master BIOS within 30 seconds, the BMC will assume that the master BIOS is currently unable to boot, i.e., the BMC will automatically determine that the computer has gone down.

[0095] In one exemplary embodiment, the first acquisition module further includes a third acquisition sub-module, and the third acquisition sub-module is configured such that when the master BIOS is in a phase of entering the operating system, the BMC sets a boot success identifier of the operating system as the boot process information, and the boot success identifier is an identifier that records the successful boot of the operating system.

[0096] In the above embodiment, the boot time of the computer was verified multiple times, and it was found that in the case of full specifications, the computer can boot normally and enter the operating system OS within 15 minutes. After the computer boots and enters the operating system OS, the state of the GPIO for monitoring that post has already been completed changes. When the BMC polls that the state of the GPIO has changed, it records the boot success identifier (sel) of one Boot Up in the IDL log, so that in the above phase of entering the operating system, the boot success identifier (sel) can be used as the boot process information.

[0097] In one exemplary embodiment, the determination module further includes a third determination sub-module, and the third determination sub-module is configured to determine that the BMC has downed the computer if the boot success identifier is empty within a period in which the boot time of the computer reaches a third preset time.

[0098] In the above embodiment, if the boot time of the computer is idle within a period that reaches a third preset time, i.e., if the BMC finds that there is no Boot Up sel in the IDL log within 15 minutes, the BMC will assume that the master BIOS is currently unable to boot, i.e., the BMC will automatically determine that the computer has failed.

[0099] In one exemplary embodiment, when the computer starts up, the device further includes a synchronization module, wherein the synchronization module is configured such that if a function file of the master BIOS is refreshed before the BMC acquires boot process information corresponding to the master BIOS in multiple boot phases, the master BIOS synchronizes the function file after being refreshed with the backup BIOS, and the function file is used to generate instructions for realizing the function of the master BIOS.

[0100] In the above embodiment, the function file may be a .bin file. After refreshing the flash of the master BIOS, the master BIOS will actively synchronize the BIOS .bin file with the backup BIOS to achieve the synchronization of the master and backup BIOS . The backup BIOS can replace the master BIOS at any time to perform the corresponding boot task.

[0101] In one exemplary embodiment, the first control module includes a control sub-module, and the control sub-module is configured such that when the BMC determines that the computer is down, the BMC triggers a switch command to control the master BIOS and the backup BIOS to switch between master and backup BIOS, and the switch command is used to control the master BIOS to stop performing boot tasks and to control the backup BIOS to start performing boot tasks.

[0102] In the above embodiment, when the BMC determines that the computer is down, the BMC triggers a switching command (ipmi command) to control the master BIOS and the backup BIOS to switch between the master and backup BIOS, and the backup BIOS begins to perform boot tasks in place of the master BIOS, thereby avoiding a long computer downtime that would affect the user experience.

[0103] In one exemplary embodiment, the device further includes a recording module, which is configured to record power-on self-test information when the BMC triggers the switching command after controlling the master BIOS and the backup BIOS to switch between master and backup BIOS, and the power-on self-test information is detection information output by the BMC after monitoring the CPU and is used to indicate whether a startup failure has occurred.

[0104] In the above embodiment, the power-on self-test information is recorded when the switching command (ipmi command) is triggered, that is, the power-on self-test information when switching between the master and backup BIOS is recorded and used for research, development, and analysis. For example, in research and development, the power-on self-test failure information provided by the computer allows the CPU to determine in which phase of the PSP the mirroring occurred.

[0105] In one exemplary embodiment, the device further includes a second acquisition module, a second control module, and an alarm module, wherein the second acquisition module is configured to, after the BMC controls the master BIOS and the backup BIOS to switch between the master BIOS and the backup BIOS, the BMC acquires a master backup BIOS switching log, and the master backup BIOS switching log is used to record whether the master backup BIOS switching is successful or not; the second control module is configured, if the master backup BIOS switching log indicates that the master backup BIOS switching is successful, the BMC controls the backup BIOS to execute the startup task; and the alarm module is configured, if the master backup BIOS switching log indicates that the master backup BIOS switching is unsuccessful, the BMC issues alarm information that the computer is in a down state.

[0106] In the above embodiment, when switching between the master and backup BIOS, a master / backup BIOS switching log is generated to indicate whether the switching was successful or not. If the switching is successful, the backup BIOS is controlled to execute the startup task instead of the master BIOS. If the switching fails, an alarm is issued to indicate that the computer is down, reminding the operation and maintenance worker to perform maintenance promptly.

[0107] In one exemplary embodiment, the second control module includes a fourth acquisition sub-module and a first alarm sub-module, wherein the fourth acquisition sub-module is configured to: when the master / backup BIOS switching log indicates that the master / backup BIOS has been successfully switched and the backup BIOS is in the safe boot phase or the load phase, the BMC acquires second power-on self-test information, the second power-on self-test information being detection information output by the BMC by monitoring the CPU when the backup BIOS is started and being used to indicate whether a boot failure has occurred; and the first alarm sub-module is configured to: when the second power-on self-test information does not change within a first preset time, the BMC issue the alarm information indicating that the computer is down.

[0108] In the above embodiment, after the master backup BIOS is successfully switched, if the backup BIOS is in the safe boot phase or the load phase, it can similarly determine whether the computer has failed based on the second power-on self-test information of the current phase. If the BMC monitors that the CPU is still in the same power-on self-test code within two minutes, the BMC determines that the current CPU has already stopped operating, that is, the BMC automatically determines that the computer has failed. If there is no second backup BIOS to switch to, it will issue the alarm information that the computer is in a failed state.

[0109] In one exemplary embodiment, the second control module includes a receiving sub-module and a second alarm sub-module, wherein the receiving sub-module is configured such that when the master / backup BIOS switching log indicates that the master / backup BIOS has been successfully switched and the backup BIOS is in the load phase, the BMC establishes a communication connection with the backup BIOS and receives a second command, the second command being a command sent by the backup BIOS to the BMC every second preset time; the second control module includes a fourth acquisition sub-module and a first alarm sub-module, wherein the second alarm sub-module is configured such that if the second command is not received within the second preset time, the BMC issues the alarm information indicating that the computer is in a down state.

[0110] In the above embodiment, after the master backup BIOS is successfully switched, when the backup BIOS is in the load phase, it can similarly determine whether the BIOS has started up normally through interaction between the backup BIOS and the BMC. The backup BIOS will send an IPMI command to the BMC every 30 seconds during the startup process, and after the BMC receives the command, it will send a response command to the backup BIOS. If the BMC does not receive the command sent by the master BIOS within 30 seconds, the BMC will assume that the master BIOS is currently unable to start up, that is, the BMC will automatically determine that the computer has gone down. If there is no second backup BIOS to switch to, it will issue the alarm information that the computer is in a down state.

[0111] In one exemplary embodiment, the second control module includes a searching sub-module and a third alarm sub-module, wherein the searching sub-module is configured to: when the master / backup BIOS switching log indicates that the master / backup BIOS has been successfully switched and the master BIOS is in the phase of entering the operating system, the BMC searches for a boot success identifier of the operating system; and the third alarm sub-module is configured to: when the boot success identifier does not exist within a period in which the boot time of the computer reaches a third preset time, the BMC issues the alarm information that the computer is in a down state.

[0112] In the above embodiment, after the master backup BIOS is successfully switched, the backup BIOS is in the phase of entering the operating system. Similarly, if the BMC finds that there is no Boot Up sel in the IDL log within 15 minutes, the BMC assumes that the master BIOS is currently unable to boot, that is, the BMC automatically determines that the computer is down, and if there is no second backup BIOS to switch to, it issues the alarm information that the computer is down.

[0113] Each of the above modules may be realized by software or hardware, and in the latter case, may be realized by a system in which all of the above modules are located on the same processor, or by a system in which each of the above modules is located on different processors in any combination, but is not limited to these.

[0114] An embodiment of the present application further provides a non-volatile readable storage medium having stored thereon a computer program configured, when running, to implement the steps of any one of the method embodiments above.

[0115] In one exemplary embodiment, the non-volatile readable storage medium may include, but is not limited to, various media capable of storing computer programs, such as a USB flash disk, a read-only memory (abbreviated as ROM), a random access memory (abbreviated as RAM), a removable hard disk, a magnetic disk, or an optical disk.

[0116] An embodiment of the present application further provides a computer, including a master BIOS, a backup BIOS, a memory, a BMC, and a computer program stored in the memory and operable on the BMC, wherein the BMC executes the computer program to perform the steps in any one of the above method embodiments.

[0117] In one exemplary embodiment, the computer may further include a transmission device and an input / output device, where the transmission device is connected to the processor and the input / output device is connected to the processor.

[0118] For preferred examples of this embodiment, please refer to the examples described in the above examples and exemplary embodiments, and this embodiment will not be further described here.

[0119] As will be apparent to those skilled in the art, each module or step of the present application described above may be implemented by a general-purpose computing device, centralized in a single computing device, or distributed across a network of multiple computing devices, or implemented by program code executable by a computing device, thereby storing the modules in a storage device and executing the modules, and in some cases, executing the steps shown or described in an order different from that shown or described herein, or implementing the modules or steps as individual integrated circuit modules, or implementing multiple modules or steps as a single integrated circuit module. Thus, the present application is not limited to any particular combination of hardware and software.

[0120] The above is merely a preferred embodiment of the present application, and is not intended to limit the present application. Those skilled in the art may have various modifications and variations to the present application. Any modifications, equivalent replacements, improvements, etc. made without departing from the spirit of the present application shall be included in the protection scope of the present application.

Claims

1. A master / backup BIOS automatic switching method applied to a computer, the computer including a baseboard management controller (BMC), a master basic input / output system (master BIOS), and a backup BIOS, the backup BIOS being configured to replace the master BIOS when the master BIOS fails to start, and the BMC being configured to control the operation of the master BIOS and the backup BIOS; The method for automatically switching between the master and backup BIOS includes: The BMC obtains boot process information corresponding to the master BIOS in a plurality of boot phases, the plurality of boot phases including a secure boot phase, a load phase, and an enter operating system phase; If the boot process information does not change within a corresponding preset time in any one of the boot phases, the BMC determines that the computer is down, and the preset time corresponding to the secure boot phase is a first preset time, the preset time corresponding to the load phase is a second preset time, and the preset time corresponding to the enter operating system phase is a third preset time; The BMC controls the master BIOS and the backup BIOS to switch between the master and backup BIOS, and the switching of the master and backup BIOS includes switching from the master BIOS to the backup BIOS and booting.

2. The BMC acquires boot process information corresponding to the master BIOS in a plurality of boot phases, 2. The method of claim 1, wherein when the master BIOS is in the secure boot phase or the load phase, the BMC uses first power-on self-test information as the boot process information, the first power-on self-test information being detection information output by the BMC by monitoring a central processing unit (CPU) when the master BIOS is booting, and being information used to indicate whether a boot failure has occurred.

3. If the boot process information does not change within a corresponding preset time in any one of the boot phases, the BMC determines that the computer has gone down; 3. The method of claim 2, further comprising: if the first power-on self-test information does not change within the first preset time, the BMC determining that the computer is down.

4. Before the BMC determines that the computer is down, the method further comprises:

4. The method of claim 3, further comprising: determining that the first power-on self-test information does not change within the first preset time if the BMC detects that the central processing unit CPU is in the same power-on self-test code within two minutes.

5. The BMC acquires boot process information corresponding to the master BIOS in a plurality of boot phases, 2. The method of claim 1, further comprising: when the master BIOS is in the load phase, the BMC establishes a communication connection with the master BIOS and sets a timestamp of a first command received by the BMC as the boot process information, the first command being a command that the master BIOS sends to the BMC every second preset time, and the timestamp being the time when the BMC received the first command.

6. If the boot process information does not change within a corresponding preset time in any one of the boot phases, the BMC determines that the computer has gone down; 6. The method of claim 5, further comprising: if the timestamp is not updated at the second preset time, the BMC determining that the computer has gone down.

7. The BMC acquires boot process information corresponding to the master BIOS in a plurality of boot phases, 2. The method of claim 1, further comprising: when the master BIOS is in the phase of entering the operating system, the BMC sets a boot success identifier of the operating system as the boot process information, and the boot success identifier is an identifier that records that the operating system has been successfully booted.

8. If the boot process information does not change within a corresponding preset time in any one of the boot phases, the BMC determines that the computer has gone down; 8. The method of claim 7, further comprising: if the boot success identifier is empty within a period of time in which the boot time of the computer reaches the third preset time, the BMC determines that the computer has gone down.

9. Before the BMC acquires boot process information corresponding to the master BIOS in the plurality of boot phases, the method further comprises:

2. The method of claim 1, further comprising: when a functional file of the master BIOS is refreshed, the master BIOS synchronizes the refreshed functional file with the backup BIOS, and the functional file is used to generate instructions for implementing the function of the master BIOS.

10. The BMC controls the master BIOS and the backup BIOS to switch between the master and backup BIOS. The method according to any one of claims 1 to 9, further comprising: when the BMC determines that the computer has gone down, the BMC triggers a switching command to control the master BIOS and the backup BIOS to switch between the master and backup BIOS, wherein the switching command is used to control the master BIOS to stop performing boot tasks and to control the backup BIOS to start performing boot tasks.

11. After the BMC controls the master BIOS and the backup BIOS to perform master / backup BIOS switching, the method includes:

11. The method of claim 10, further comprising: recording power-on self-test information when the switching command is triggered, the power-on self-test information being detection information output by the BMC by monitoring a central processing unit CPU and being information used to indicate whether a startup failure has occurred.

12. After the BMC controls the master BIOS and the backup BIOS to perform master / backup BIOS switching, the method includes: The BMC acquires a master / backup BIOS switching log, and the master / backup BIOS switching log is used to record whether the master / backup BIOS switching is successful or not; If the master / backup BIOS switching log indicates that the master / backup BIOS has been successfully switched, the BMC controls the backup BIOS to execute the boot task; 11. The method of claim 10, further comprising: if the master backup BIOS switching log indicates that the master backup BIOS switching has failed, the BMC issues an alarm indicating that the computer is down.

13. If the master / backup BIOS switching log indicates that the master / backup BIOS has been successfully switched, the BMC controls the backup BIOS to execute the boot task. When the master / backup BIOS switching log indicates that the master / backup BIOS has been successfully switched and the backup BIOS is in the safe boot phase or the load phase, the BMC obtains second power-on self-test information, the second power-on self-test information being detection information output by the BMC while monitoring the central processing unit CPU when the backup BIOS is booting, and being information used to indicate whether a boot failure has occurred; 13. The method of claim 12, further comprising: if the second power-on self-test information does not change within a first preset time, the BMC issues the alarm information that the computer is in a down state.

14. The BMC obtaining second power-on self-test information includes:

14. The method of claim 13, further comprising: the BMC detecting a current power-on self-test code of a central processing unit CPU; and, if the BMC detects that the central processing unit CPU is at the same power-on self-test code within two minutes, determining that the second power-on self-test information does not change within the first preset time.

15. If the master / backup BIOS switching log indicates that the master / backup BIOS has been successfully switched, the BMC controls the backup BIOS to execute the boot task. When the master / backup BIOS switching log indicates that the master / backup BIOS has been successfully switched and the backup BIOS is in the loading phase, the BMC establishes a communication connection with the backup BIOS and receives a second command, the second command being a command that the backup BIOS sends to the BMC at every second preset time; 13. The method of claim 12, further comprising: if the second command is not received within the second preset time, the BMC issues the alarm information that the computer is in a down state.

16. If the master / backup BIOS switching log indicates that the master / backup BIOS has been successfully switched, the BMC controls the backup BIOS to execute the boot task. When the master / backup BIOS switching log indicates that the master / backup BIOS has been successfully switched and the master BIOS is in the phase of entering the operating system, the BMC searches for the operating system's boot success identifier; 13. The method of claim 12, further comprising: if the boot success identifier is not present within a period in which the boot time of the computer reaches a third preset time, the BMC issues the alarm information that the computer is in a down state.

17. When the master backup BIOS switching log indicates that the master backup BIOS has been successfully switched and the master BIOS is in the phase of entering the operating system, the BMC searches for the operating system boot success identifier; the BMC retrieving the boot success identifier from a diagnostic log, wherein the BMC is configured to poll for a change in a state of a general purpose input / output (GPIO) and write the boot success identifier to the diagnostic log when the BMC polls that the state of the GPIO has changed, the GPIO state being configured to change after the operating system has successfully booted; determining that the BMC has retrieved the operating system's boot success identifier if the BMC retrieves from the diagnostic log that the boot success identifier exists; 17. The method of claim 16, further comprising: if the BMC is unable to retrieve from a diagnostic log that the successful boot identifier exists, determining that the BMC was unable to retrieve the successful boot identifier for the operating system.

18. A master / backup BIOS automatic switching device, the computer including a BMC, a master BIOS, and a backup BIOS, the backup BIOS being configured to replace the master BIOS when the master BIOS fails to start, the BMC being configured to control the operation of the master BIOS and the backup BIOS, the master / backup BIOS automatic switching device being applied to the BMC, a first acquisition module configured to acquire boot process information corresponding to the master BIOS in a plurality of boot phases, the plurality of boot phases including a secure boot phase, a load phase, and an enter operating system phase; a determination module configured to determine that the computer has gone down if the boot process information does not change within a corresponding preset time in any one of the boot phases, wherein the preset time corresponding to the secure boot phase is a first preset time, the preset time corresponding to the load phase is a second preset time, and the preset time corresponding to the enter operating system phase is a third preset time; a first control module configured to control the master BIOS and the backup BIOS to switch between the master and backup BIOS, wherein the switching of the master and backup BIOS is performed by switching from the master BIOS to the backup BIOS and booting.

19. A non-volatile readable storage medium having stored thereon a computer program which, when executed by a processor, implements the steps of the method according to any one of claims 1 to 17.

20. 1. A computer including a master BIOS, a backup BIOS, a memory, a BMC, and a computer program stored in said memory and operable on said BMC, A computer characterized in that, when the BMC executes the computer program, it implements the steps of the method according to any one of claims 1 to 17.

Citation Information

Patent Citations

  • Computer, system management aiding device and management method

    JP2001325124A

  • Information processing device, automatic recovery method from startup fault, and automatic recovery program from startup fault

    JP2014170306A