Watchdog control method and device, equipment and medium
By creating a watchdog event in the server and associated with the human-computer interaction interface, the machine error restart problem caused by long-term human-computer interaction is solved, and the server can operate stably in non-downtime.
Patent Information
- Application Number
- CN202510386174.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-28
- Publication Date
- 2025-07-04
AI Technical Summary
In the prior art, servers are easily mistaken for a downtime when human-computer interaction stays for a long time, causing the watchdog to trigger the machine to restart abnormally.
By creating a watchdog event in the server and associating it with the target human-computer interaction interface of the unified extensible firmware interface firmware, the watchdog event handling function sends a command to close the secondary fault elastic boot watchdog to avoid the machine restarting in non-downtime.
It effectively avoids abnormal machine restart caused by long-term human-computer interaction, and ensures that the server is running stably under non-downtime.
Smart Images

Figure CN120256183A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of servers, and in particular, to a watchdog control method, device, equipment, and medium. Background Art
[0002] On a server, generally two watchdogs are set. One is the FRB-2 (i.e., secondary fault resilient boot) watchdog, which is used to monitor whether the UEFI (i.e., Unified Extensible Firmware Interface firmware) has completed startup normally; the other is the system watchdog, which generally uses the internal watchdog of the CPU and is used to monitor whether the operating system is running normally without crashing. Through these two watchdogs, the server status from startup to normal operation of the operating system can be covered. When a program gets stuck and causes the server to crash, the watchdog circuit will be triggered, and through the set watchdog policy, the server will be restarted so that the server services can run again, avoiding the situation where services stop due to crashing.
[0003] Currently, how to avoid the watchdog triggering abnormal restart of the machine is a problem that those skilled in the art need to solve. Summary of the Invention
[0004] In view of this, the purpose of the present invention is to provide a watchdog control method, device, equipment, and medium, which can avoid the watchdog triggering abnormal restart of the machine. The specific scheme is as follows:
[0005] In the first aspect, the present invention provides a watchdog control method, including:
[0006] Sending a startup command corresponding to the secondary fault resilient boot watchdog to the management controller so that the management controller starts the secondary fault resilient boot watchdog;
[0007] Creating an event corresponding to the secondary fault resilient boot watchdog based on an event creation function to obtain a watchdog event;
[0008] Associating the watchdog event with the target human-machine interface of the Unified Extensible Firmware Interface firmware;
[0009] When the Unified Extensible Firmware Interface firmware is loaded into the target human-machine interface, the watchdog event is triggered, and a target command is sent to the management controller by using the watchdog event processing function corresponding to the watchdog event, so that the management controller closes the secondary fault resilient boot watchdog based on the target command.
[0010] Optionally, the associating the watchdog event with the target human-machine interface of the Unified Extensible Firmware Interface firmware includes:
[0011] Associate the watchdog event with the setup menu interface, password input interface, and startup menu interface of the Unified Extensible Firmware Interface (UEFI) firmware.
[0012] Optionally, the step of associating the watchdog event with the setup menu interface, password input interface, and startup menu interface of the UEFI firmware includes:
[0013] Associate the watchdog event with the globally unique identifiers of the setup menu interface, password input interface, and startup menu interface of the UEFI firmware;
[0014] Correspondingly, when the UEFI firmware is loaded into the target human-machine interaction interface, trigger the watchdog event, and use the watchdog event handling function corresponding to the watchdog event to send a target command to the management controller, including:
[0015] When the UEFI firmware is loaded into the globally unique identifiers corresponding to the setup menu interface, password input interface, and startup menu interface, trigger the watchdog event, and use the watchdog event handling function corresponding to the watchdog event to send a target command to the management controller.
[0016] Optionally, before the watchdog event handling function sends a target command to the management controller, it further includes:
[0017] Query the watchdog status of the secondary fault resilient boot watchdog. If the watchdog status is the enabled state, trigger the step of sending a target command to the management controller.
[0018] Optionally, before the watchdog event handling function sends a target command to the management controller, it further includes:
[0019] Send the power-on self-test completion information corresponding to the UEFI firmware to the management controller.
[0020] Optionally, creating the event corresponding to the secondary fault resilient boot watchdog based on the event creation function to obtain the watchdog event includes:
[0021] Use the Extensible Firmware Interface (EFI) startup service component and create the event corresponding to the secondary fault resilient boot watchdog based on the event creation function to obtain the watchdog event.
[0022] Optionally, it further includes:
[0023] Create the event handling function corresponding to the watchdog event to obtain the watchdog event handling function, or obtain the pre-created watchdog event handling function;
[0024] Associate the watchdog event with the watchdog event handling function.
[0025] In a second aspect, the present invention provides a watchdog control device, comprising:
[0026] A watchdog startup module, configured to send a startup command corresponding to a secondary fault resilient boot watchdog to a management controller, so that the management controller starts the secondary fault resilient boot watchdog;
[0027] An event creation module, configured to create an event corresponding to the secondary fault resilient boot watchdog based on an event creation function to obtain a watchdog event;
[0028] An event association module, configured to associate the watchdog event with a target human-machine interaction interface of unified extensible firmware interface (UEFI) firmware;
[0029] An event trigger module, configured to trigger the watchdog event when the UEFI firmware is loaded into the target human-machine interaction interface, and send a target command to the management controller by using a watchdog event handling function corresponding to the watchdog event, so that the management controller closes the secondary fault resilient boot watchdog based on the target command.
[0030] In a third aspect, the present invention provides an electronic device, comprising:
[0031] A memory, configured to store a computer program;
[0032] A processor, configured to execute the computer program to implement the steps of the foregoing watchdog control method.
[0033] In a fourth aspect, the present invention discloses a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the steps of the foregoing watchdog control method are implemented.
[0034] In a fifth aspect, the present invention provides a computer program product, comprising a computer program / instructions, and when the computer program / instructions are executed by a processor, the steps of the foregoing disclosed watchdog control method are implemented.
[0035] As can be seen from the above solution, the present invention provides a watchdog control method, including: sending a start command corresponding to a secondary fault resilient boot watchdog to a management controller, so that the management controller starts the secondary fault resilient boot watchdog; creating an event corresponding to the secondary fault resilient boot watchdog based on an event creation function to obtain a watchdog event; associating the watchdog event with a target human-machine interaction interface of a Unified Extensible Firmware Interface (UEFI) firmware; when the UEFI firmware is loaded into the target human-machine interaction interface, triggering the watchdog event, and using a watchdog event handling function corresponding to the watchdog event to send a target command to the management controller, so that the management controller closes the secondary fault resilient boot watchdog based on the target command.
[0036] It can be seen that the beneficial effects of the present invention are as follows: after starting the secondary fault resilient boot watchdog, creating a watchdog event based on an event creation function, and associating the watchdog event with a target human-machine interaction interface of a UEFI firmware. When the UEFI firmware is loaded into the target human-machine interaction interface, triggering the watchdog event associated with this interface, and then triggering the watchdog event handling function to send a target command to the management controller, and closing the secondary fault resilient boot watchdog through the management controller. In this way, the human-machine interaction interface that may stay for a long time due to human-machine interaction is associated with the watchdog event. When loaded into the corresponding human-machine interaction interface, triggering the event handling function corresponding to the watchdog event to close the watchdog, and the machine will not restart in this non-crash situation, which can avoid the watchdog triggering the machine to restart abnormally. BRIEF DESCRIPTION OF THE DRAWINGS
[0037] In order to more clearly illustrate the embodiments of the present invention, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings in the following description are only some embodiments of the present invention. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.
[0038] Figure 1 It is a flowchart of a watchdog control method provided by an embodiment of the present invention;
[0039] Figure 2 It is a flowchart of a secondary fault resilient boot watchdog control provided by an embodiment of the present invention;
[0040] Figure 3 It is a schematic structural diagram of a watchdog control device provided by an embodiment of the present invention;
[0041] Figure 4 It is a structural diagram of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0042] Next, the technical solutions in the embodiments of the present invention will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts belong to the protection scope of the present invention.
[0043] The terms "including" and "having" in the specification of the present invention and any deformations related to "including" and "having" are intended to cover non-exclusive inclusion. For example, a process, method, system, product or device that includes a series of steps or units is not limited to the listed steps or units, but may include steps or units that are not listed.
[0044] First, the technical terms related to the present invention will be explained:
[0045] CPU: Central Processing Unit, the central processing unit, as the operation and control core of a computer system, is the final execution unit for information processing and program operation.
[0046] UEFI: Unified Extensible Firmware Interface, a kind of BIOS (i.e., Basic Input / Output System).
[0047] BMC: Baseboard Manager Controller, used to monitor the temperature, voltage, fan, power, etc. of the system and perform corresponding adjustment work to ensure that the system is in a healthy state.
[0048] FRB: Fault Resilient Booting, fault resilient booting.
[0049] IPMI: Intelligent Platform Management Interface, intelligent platform management interface.
[0050] The watchdog is a timer circuit used to prevent the server from crashing when the program enters an infinite loop or runs into an exception, and it cannot ensure the normal operation of the service. Generally, the watchdog has an input terminal and a reset terminal output to the CPU. When the CPU is working normally, it will output a signal to the input watchdog feeding terminal at regular intervals to clear the watchdog count. If the watchdog is not fed within the specified time, that is, if the set watchdog timing value is exceeded, it will give a reset signal to the CPU for reset operation.
[0051] Generally, multiple watchdog timers are integrated inside the CPU. Taking the Feiteng platform as an example, two watchdog timers are integrated inside its CPU, which are defaultly divided into a secure domain and a non-secure domain, used to control the generation of timeout interrupts and timeout resets in the secure domain and the non-secure domain respectively. The counter of the watchdog timer comes from the system counter. After the watchdog timer is initialized, an interrupt is generated after the first timeout of the counter and reported to the interrupt management module; an interrupt / reset is generated after the second timeout, and the reset request is reported to the clock reset management module. In addition to the watchdog timers inside the CPU, multiple watchdog circuits are also integrated in the BMC of the server to implement FRB levels 1, 2, and 3. If the default boot processor fails to complete the boot process, the FRB will attempt to boot using the backup processor.
[0052] The FRB-2 watchdog timer in the BMC is designed to ensure that the system completes the power-on self-test in the UEFI stage. If the entire process of the power-on self-test is not completed before the timer expires, the set watchdog policy will be executed to ensure the stability of the system. On the server, generally two watchdog timers are set. One is the FRB-2 watchdog timer, which is used to monitor whether the UEFI boots successfully; the other is the system watchdog timer, which generally uses the watchdog timer inside the CPU and is used to monitor whether the operating system runs normally without crashing. Through these two watchdog timers, the server status from startup to normal operation of the operating system can be covered. When the server freezes due to a program hang, the watchdog circuit will be triggered, and through the set watchdog policy (usually set to restart), the server will be restarted to resume the server services and avoid the situation of service interruption due to system crashes.
[0053] The watchdog timer is an effective mechanism to prevent server crashes. There are three configurable watchdog policies: shutdown, restart, and no operation. Generally, when the watchdog timer is turned on, the watchdog policy is set to restart. When a program enters a loop or freezes abnormally, the watchdog timer will start timing to detect the freeze time. When the set timeout is exceeded and there is no action to feed the dog (i.e., update the counter for re-counting), the watchdog timer will restart the server according to the restart policy to prevent the server from crashing.
[0054] To help those skilled in the art better understand the solution of the present invention, the present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments.
[0055] Next, a watchdog control method provided by an embodiment of the present invention will be introduced in detail. Figure 1 The following is a flowchart of a watchdog control method provided by an embodiment of the present invention. The watchdog control method includes:
[0056] Step S11: Send a start command corresponding to the secondary fault resilient boot watchdog to the management controller so that the management controller starts the secondary fault resilient boot watchdog.
[0057] Among them, the management controller can be one of BMC, Integrated Light-Out (iLO) system, Integrated Dell Remote Access Control (IDRAC), or a processing chip. There are multiple levels of FRB. In the embodiments of the present invention, the secondary fault resilient boot watchdog, that is, the FRB2 watchdog, is controlled.
[0058] In this embodiment, the start command includes a watchdog policy and a watchdog timing time. The watchdog policy and the watchdog timing time can be sent to the management controller through the start command. The watchdog policy can be reboot. When the program gets stuck in an abnormal situation and the watchdog counting reset has not been performed even when the watchdog timing time is reached, then the management controller will restart the server through the FRB2 watchdog.
[0059] In the embodiments of the present invention, after the server is powered on and starts to boot the UEFI firmware, it will detect the status of the FRB2 watchdog option set in the UEFI firmware. If the watchdog is enabled, it means that the watchdog needs to start working. At this time, the set watchdog policy and the set watchdog timing time will be sent to the management controller through the IPMI protocol, and the management controller will make the FRB2 watchdog start working to monitor the status of the boot firmware.
[0060] Step S12: Create an event corresponding to the secondary fault resilient boot watchdog based on an event creation function to obtain a watchdog event.
[0061] In an alternative embodiment, the extensible firmware interface startup service component can be utilized, and an event corresponding to the secondary fault resilient boot watchdog is created based on an event creation function to obtain a watchdog event.
[0062] That is, the embodiments of the present invention use the EFI_BOOT_SERVICES (i.e., the extensible firmware interface startup service) component in the UEFI specification to provide asynchronous event processing for the Event event service. After the FRB2 watchdog is turned on, a callback signal event is generated by creating an Event event.
[0063] In an alternative embodiment, an event handling function corresponding to the watchdog event can be created to obtain a watchdog event handling function, or a pre-created watchdog event handling function can be obtained; the watchdog event is associated with the watchdog event handling function.
[0064] It should be noted that obtaining the pre-created watchdog event handling function and associating it can improve the efficiency of associating the watchdog event with the watchdog event handling function.
[0065] Step S13: Associate the watchdog event with the target human-machine interaction interface of the Unified Extensible Firmware Interface (UEFI) firmware.
[0066] Among them, the target human-machine interaction interface can be understood as an interface that provides human-machine interaction services. In the embodiments of the present invention, the watchdog event is associated with the setup menu interface, password input interface, and boot menu interface of the Unified Extensible Firmware Interface (UEFI) firmware.
[0067] The setup menu interface is the Setup menu interface. The Setup menu of UEFI is the main interface for users to perform system configuration and management. This menu is usually entered by pressing a specific key when the computer starts up. In the Setup menu, users can find multiple tabs or categories, and each tab contains a series of related setting options. These tabs may include: Information: Displays basic information about the system hardware and software, such as BIOS version, processor model, memory size, etc.; Security: Allows users to set and manage the security functions of the system, such as password protection, Secure Boot, etc.; Boot: Sets the boot order of the computer, selects the device to boot from, and manages UEFI boot entries; Advanced: Provides advanced configuration options for hardware such as the processor, memory, chipset, storage device, etc.; Exit: Saves the changes and exits the UEFI Setup menu, or resets all changes to the default values.
[0068] The boot menu interface is the Boot Menu menu. The Boot Menu menu is a quick boot option interface provided by UEFI that allows users to select the device to boot from when the computer starts up. This menu is usually accessible by pressing a specific key when the computer starts up. In the Boot Menu menu, users can see a list of all available boot devices, such as hard drives, USB drives, optical discs, etc. Users can use the arrow keys to select the device they want to boot from and then press the Enter key to confirm. In addition, some UEFI implementations also allow users to adjust the boot order or add / delete boot entries.
[0069] The password input interface, which is the password interface of UEFI, is the interface for users to set and manage system passwords. In UEFI, passwords can be used to protect the Setup menu and prevent unauthorized access and changes. To set a password, users usually need to enter the security tab in the UEFI Setup menu. Here, users can find options to set the administrator password and the user password. The administrator password allows users to access and change all settings in the UEFI Setup menu, while the user password only allows users to access a restricted subset of settings. When setting a password, users need to enter the same password twice to confirm. Once the password is set successfully, the password will be required for verification every time the UEFI Setup menu is entered.
[0070] It should be noted that during the use of the server, there are various scenarios of human-computer interaction. When debugging and configuring the server on the interaction interface, if some time-consuming scenarios are entered during the startup process, such as entering the UEFI setup menu interface to modify option configurations and staying on this page for a long time, or pressing the hotkey according to the hotkey prompt on the monitor to enter the password input interface, or staying on the startup menu interface for a long time. When staying in these scenarios mentioned above for a long time and still not jumping to the stage of starting the operating system when the watchdog setting's timing time is reached, the watchdog circuit will mistakenly think that the server has crashed. At this time, the watchdog mechanism will be triggered, resulting in the server restarting abnormally. To avoid this situation where abnormal restart occurs due to non-crash conditions, the embodiment of the present invention controls the watchdog design at the software level and turns off the watchdog when the startup program enters a long-waiting interface.
[0071] Step S14: When the Unified Extensible Firmware Interface firmware is loaded into the target human-computer interaction interface, trigger the watchdog event, and use the watchdog event handling function corresponding to the watchdog event to send a target command to the management controller, so that the management controller closes the secondary fault resilient boot watchdog based on the target command.
[0072] In an alternative embodiment, the watchdog event can be associated with the globally unique identifiers of the setup menu interface, password input interface, and startup menu interface of the Unified Extensible Firmware Interface (UEFI) firmware. Correspondingly, when the UEFI firmware is loaded into the target human-machine interface, the watchdog event is triggered, and the target command is sent to the management controller by using the watchdog event handling function corresponding to the watchdog event, including: when the UEFI firmware is loaded into the globally unique identifiers corresponding to the setup menu interface, password input interface, and startup menu interface, the watchdog event is triggered, and the target command is sent to the management controller by using the watchdog event handling function corresponding to the watchdog event.
[0073] It should be noted that there are globally unique identifiers for the setup menu interface, password input interface, and startup menu interface. In the embodiment of the present invention, by associating the globally unique identifiers of the setup menu interface, password input interface, and startup menu interface with the watchdog event, the registration of the watchdog event is realized. The watchdog event is associated with a watchdog event handling function. The UEFI firmware loads each function in sequence. When loading each function, the globally unique identifier of each function is loaded. When the UEFI firmware is loaded into the globally unique identifier corresponding to the setup menu interface or password input interface or startup menu interface, the watchdog event is triggered, and the target command is sent to the management controller by using the watchdog event handling function corresponding to the watchdog event.
[0074] In an alternative embodiment, before sending the target command to the management controller, the watchdog event handling function further includes: querying the watchdog status of the secondary fault resilient boot watchdog. If the watchdog status is the enabled state, the step of triggering the sending of the target command to the management controller is triggered. If the watchdog status is the disabled state, the step of triggering the sending of the target command to the management controller is not triggered.
[0075] It should be noted that there may be a password input interface before the setup menu interface. If the password input interface is loaded, the secondary fault resilient boot watchdog has been disabled in the embodiment of the present invention. Therefore, the watchdog status of the secondary fault resilient boot watchdog is queried first, so as to avoid repeatedly sending commands to the management controller to disable the secondary fault resilient boot watchdog.
[0076] In an alternative embodiment, a first watchdog event and a second watchdog event can be created for the event-based creation function. The first watchdog event is associated with a first watchdog event creation function, and the second watchdog event is associated with a second watchdog event creation function. The first watchdog event creation function is used to send a target command to the management controller without querying the watchdog status. The second watchdog event creation function is used to query the watchdog status of the secondary fault resilient boot watchdog. If the watchdog status is the enabled state, a target command is sent to the management controller. The first watchdog event is associated with the password input interface and the startup menu interface, and the second watchdog event is associated with the settings menu interface. In this way, during loading, corresponding watchdog events can be triggered based on different globally unique identifiers, thereby triggering the watchdog event handling function, and thus efficiently and accurately implementing the control of the secondary fault resilient boot watchdog.
[0077] In an alternative embodiment, a timer can be set. The timer is used to calculate the time staying in the target human-machine interface. Then, when the Unified Extensible Firmware Interface (UEFI) firmware is loaded into the target human-machine interface, the watchdog event is triggered, thereby triggering the watchdog event handling function. The watchdog event handling function times through the timer. When the timer reaches the preset duration, a target command is sent to the management controller so that the management controller can turn off the secondary fault resilient boot watchdog based on the target command. If the timer does not reach the preset duration, no target command is sent. The timer can be cleared when exiting the target human-machine interface. In this way, event processing can be reduced and performance can be improved.
[0078] In an alternative embodiment, no timer is set. When the Unified Extensible Firmware Interface (UEFI) firmware is loaded into the target human-machine interface, the watchdog event is triggered, thereby triggering the watchdog event handling function, and a target command is directly sent to the management controller.
[0079] In an alternative embodiment, before sending the target command to the management controller, the watchdog event handling function further includes: sending the completed power-on self-test information corresponding to the Unified Extensible Firmware Interface (UEFI) firmware to the management controller so that the management controller can perform subsequent processing.
[0080] It can be seen that the beneficial effects of the embodiments of the present invention are as follows: after starting the secondary fault resilient boot watchdog, a watchdog event is created based on the event creation function, and the watchdog event is associated with the target human-machine interaction interface of the Unified Extensible Firmware Interface (UEFI) firmware. When the UEFI firmware is loaded into the target human-machine interaction interface, the watchdog event associated with this interface is triggered, and then the watchdog event handling function is triggered to send a target command to the management controller, and the secondary fault resilient boot watchdog is turned off through the management controller. In this way, the human-machine interaction interface that may stay in the human-machine interaction for a long time is associated with the watchdog event. When it is loaded into the corresponding human-machine interaction interface, the event handling function corresponding to the watchdog event is triggered to turn off the watchdog, and the machine will not restart in this non-crash situation, thus avoiding the watchdog from triggering an abnormal restart of the machine.
[0081] Further, as shown in Figure 2 shown Figure 2This is a control flow diagram of a secondary fault resilient boot watchdog provided by an embodiment of the present invention. When the machine is powered on, IPMI initialization is completed, a command is sent to the BMC to enable the FRB2 watchdog, and the CreateEvent function is used to create a watchdog event; the watchdog event is associated with an event handling function, and in the event handling function, the FRB2 watchdog is closed through an IPMI command; the RegisterProtocolNotify function is used to associate the globally unique identifier of the Setup menu with the watchdog event, associate the globally unique identifier of the BootMenu menu with the watchdog event, and associate the globally unique identifier of the password interface with the watchdog event. Triggering the watchdog event triggers the corresponding time handling function of the watchdog event, sends a signal indicating the completion of UEFI power-on self-test, sends an IPMI command to close the FRB2 watchdog, and opens the system watchdog to boot the operating system. In the embodiment of the present invention, by creating an Event event, a watchdog event is obtained by creating an event, and the watchdog event is associated with the watchdog event handling function. Asynchronous event processing can be provided for the Event event service based on the EFI_BOOT_SERVICES component in the UEFI specification. After the FRB2 watchdog is opened, a callback signal event can be generated by creating an Event event, and then the RegisterProtocolNotify (i.e., register protocol notification) protocol is used to register the event, that is, the RegisterProtocolNotify function is used to associate the watchdog event with the Setup menu, BootMenu menu, and password interface. When the UEFI firmware loads the globally unique identifier of the corresponding driver function (i.e., the driver function of the corresponding human-machine interaction interface), the watchdog event will be triggered, and then the associated watchdog event handling function will be triggered. In the function, an IPMI command is sent to the BMC to close the FRB2 watchdog to avoid continued watchdog timing during a long wait for a page.
[0082] It should be noted that after the server is powered on and starts to boot the UEFI firmware, it will detect the status of the FRB2 watchdog option set in the UEFI firmware. If the watchdog is enabled, it means that the watchdog needs to start working. At this time, the set watchdog policy and the set watchdog timing will be sent to the BMC through the IPMI protocol, and the BMC will make the FRB2 watchdog start working to monitor the status of the boot firmware. During this process, when the program gets stuck in an abnormal situation and the watchdog timing has elapsed but the watchdog count has not been reset, the BMC will restart the server through the FRB2 watchdog; when the UEFI firmware completes the initialization of the motherboard hardware and the power-on self-test process, that is, when it starts to boot and jump to load the operating system on the server, the UEFI firmware will send an IPMI command to the BMC to turn off the FRB2 watchdog before sending the power-on self-test completion signal, and at this time, the system watchdog will be turned on to monitor the status of the operating system, so as to monitor each stage on the server separately and ensure the stable operation of the server. During this process, if the UEFI setup menu interface is entered before the power-on self-test is completed, or when staying on the password input interface after setting a password, etc., such interfaces that will cause long waits. Because the FRB2 watchdog is still working normally at this time, if the count is not reset after the watchdog set timing value is reached, it will be misjudged as a downtime situation, and the FRB2 watchdog policy will be triggered to restart the server. Therefore, the embodiment of the present invention creates an Event event to handle this scenario. After the FRB2 watchdog is turned on, a callback signal event is generated by creating an Event event, and the event is registered. When the UEFI firmware loads the globally unique identifier of the corresponding driver function, the watchdog event handling function is triggered, and in the function, an IPMI command is sent to the BMC to turn off the FRB2 watchdog to avoid continuing the watchdog timing on the long-wait page.
[0083] In this way, identify the functional modules in the UEFI firmware that involve long-term human-machine interaction, and utilize the EFI_BOOT_SERVICES component in UEFI to generate a callback signal event by creating an Event event. Combine the protocol in UEFI to associate the event with the globally unique identifier corresponding to these functional modules. The watchdog function is timely turned off by the event handling function to avoid the situation where the FRB2 watchdog counter continuously counts up to the set time threshold but cannot perform the counter reset operation, that is, the "feeding the dog" operation, thus triggering an abnormal restart of the machine. This solves the problem that in the process of the watchdog monitoring circuit, in various scenarios involving human-machine interaction, when waiting for a long time on the interaction interface, because the set timing time of the watchdog is not long, the server reaches the set timing time of the watchdog but still has not jumped to the stage of starting the operating system, and will be misjudged by the watchdog circuit as having crashed, triggering the watchdog mechanism and causing an abnormal restart of the server. By adding software processing to timely turn off the watchdog for the corresponding event handling function, even if the set watchdog timing value is very short, the machine will not restart due to some human-machine interaction waiting, affecting the use of the machine. The embodiments of the present invention can be used for the productization of all ARM general computer system products, and can thus more flexibly handle the monitoring and management system, providing guarantee for the security and stability of the server.
[0084] Figure 3 FIG. 4 is a schematic structural diagram of a watchdog control device provided by an embodiment of the present invention. The watchdog control device includes:
[0085] A watchdog startup module 31, configured to send a startup command corresponding to a secondary fault resilient boot watchdog to a management controller, so that the management controller starts the secondary fault resilient boot watchdog;
[0086] An event creation module 32, configured to create an event corresponding to the secondary fault resilient boot watchdog based on an event creation function to obtain a watchdog event;
[0087] An event association module 33, configured to associate the watchdog event with a target human-machine interaction interface of the Unified Extensible Firmware Interface firmware;
[0088] An event trigger module 34, configured to trigger the watchdog event when the Unified Extensible Firmware Interface firmware is loaded into the target human-machine interaction interface, and send a target command to the management controller by using a watchdog event handling function corresponding to the watchdog event, so that the management controller turns off the secondary fault resilient boot watchdog based on the target command.
[0089] In an alternative embodiment, the event association module 33 may be configured to:
[0090] Associate the watchdog event with the setup menu interface, password input interface, and startup menu interface of the Unified Extensible Firmware Interface (UEFI) firmware.
[0091] In an alternative embodiment, the event association module 33 may be specifically configured to:
[0092] Associate the watchdog event with the globally unique identifiers of the setup menu interface, password input interface, and startup menu interface of the Unified Extensible Firmware Interface (UEFI) firmware.
[0093] Correspondingly, the event trigger module 34 may be specifically configured to:
[0094] When the Unified Extensible Firmware Interface (UEFI) firmware is loaded to the globally unique identifiers corresponding to the setup menu interface, password input interface, and startup menu interface, trigger the watchdog event, and use the watchdog event handling function corresponding to the watchdog event to send a target command to the management controller.
[0095] In an alternative embodiment, before the watchdog event handling function sends a target command to the management controller, it further includes:
[0096] Query the watchdog status of the secondary fault resilient boot watchdog. If the watchdog status is the enabled state, trigger the step of sending a target command to the management controller.
[0097] In an alternative embodiment, before the watchdog event handling function sends a target command to the management controller, it further includes:
[0098] Send the power-on self-test completion information corresponding to the Unified Extensible Firmware Interface (UEFI) firmware to the management controller.
[0099] In an alternative embodiment, the event creation module 32 may be specifically configured to start a service component using the Extensible Firmware Interface (EFI), and create an event corresponding to the secondary fault resilient boot watchdog based on an event creation function to obtain a watchdog event.
[0100] In an alternative embodiment, the device may further include:
[0101] An event handling function creation module, configured to create an event handling function corresponding to the watchdog event to obtain a watchdog event handling function; or an event handling function acquisition module, configured to acquire a pre-created watchdog event handling function;
[0102] An event handling function association module, configured to associate the watchdog event with the watchdog event handling function.
[0103] It can be seen that the beneficial effects of the embodiments of the present invention are as follows: after starting the secondary fault resilient boot watchdog, a watchdog event is created based on the event creation function, and the watchdog event is associated with the target human-machine interaction interface of the Unified Extensible Firmware Interface (UEFI) firmware. When the UEFI firmware is loaded into the target human-machine interaction interface, the watchdog event associated with the interface is triggered, and then the watchdog event handling function is triggered to send a target command to the management controller, and the secondary fault resilient boot watchdog is turned off through the management controller. In this way, the human-machine interaction interface that may stay for a long time due to human-machine interaction is associated with the watchdog event. When loaded into the corresponding human-machine interaction interface, the event handling function corresponding to the watchdog event is triggered to turn off the watchdog, and the machine will not restart in this non-crash situation, and the abnormal restart of the machine caused by the watchdog can be avoided.
[0104] Figure 3 For the description of the features in the corresponding embodiments, reference can be made to Figure 1 the relevant descriptions of the corresponding embodiments, which will not be elaborated here one by one.
[0105] Figure 4 The following is a structural diagram of an electronic device provided by an embodiment of the present invention. As Figure 4 shown, the electronic device includes: a memory 40 for storing a computer program;
[0106] a processor 41 for implementing the steps of the watchdog control method in the above embodiment when executing the computer program.
[0107] Among them, the processor 41 may include one or more processing cores, such as a 4-core processor, an 8-core processor, etc. The processor 41 may be implemented in at least one hardware form of digital signal processing (DSP), field-programmable gate array (FPGA), or programmable logic array (PLA). The processor 41 may also include a main processor and a coprocessor. The main processor is a processor for processing data in the wake state, also known as the central processing unit (CPU); the coprocessor is a low-power processor for processing data in the standby state. In some embodiments, the processor 41 may be integrated with a graphics processing unit (GPU), and the GPU is responsible for rendering and drawing the content to be displayed on the display screen. In some embodiments, the processor 41 may further include an artificial intelligence (AI) processor, and the AI processor is used to process computational operations related to machine learning.
[0108] The memory 40 may include one or more computer-readable storage media, which may be non-transitory. The memory 40 may also include high-speed random access memory, as well as non-volatile memory, such as one or more disk storage devices and flash storage devices. In this embodiment, the memory 40 is at least used to store the following computer program 401. After the computer program is loaded and executed by the processor 41, it can implement the relevant steps of the watchdog control method disclosed in any of the foregoing embodiments. In addition, the resources stored in the memory 40 may also include an operating system 402 and data 403, etc., and the storage method may be transient storage or permanent storage. Among them, the operating system 402 may include Windows, Unix, Linux, etc. The data 403 may include, but is not limited to, configuration data, etc.
[0109] In some embodiments, the electronic device may further include a display screen 42, an input / output interface 43, a communication interface 44, a power supply 45, and a communication bus 46.
[0110] Those skilled in the art can understand that Figure 4 the structure shown in does not constitute a limitation on the electronic device, and it may include more or fewer components than shown in the figure.
[0111] It can be understood that if the watchdog control method in the above embodiments is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the current technology, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and executes all or part of the steps of the methods of the various embodiments of the present invention. And the foregoing storage medium includes: USB flash drive, mobile hard disk, read-only memory (ROM), random access memory (RAM), electrically erasable programmable ROM, register, hard disk, removable disk, CD-ROM, magnetic disk or optical disk, etc., which can store program codes.
[0112] Based on this, the embodiments of the present invention also provide a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, it implements the steps of the watchdog control method as described above.
[0113] Next, a computer program product provided by the embodiments of the present invention will be introduced. A computer program product described below can be referred to each other with other embodiments described in this article.
[0114] A computer program product includes a computer program / instructions, and when the computer program / instructions are executed by a processor, the steps of the watchdog control method disclosed above are implemented.
[0115] The above has introduced in detail a watchdog control method, device, equipment and medium provided by an embodiment of the present invention. Each embodiment in the specification is described in a progressive manner. The key point of each embodiment is to illustrate the differences from other embodiments. For the same or similar parts among the embodiments, reference can be made to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and reference can be made to the description of the method part for related parts.
[0116] Those skilled in the art can further realize that the units and algorithm steps of each example described in combination with the embodiments disclosed herein can be implemented by electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described according to functions in the above description. Whether these functions are executed in a hardware or software manner depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of the present invention.
[0117] The above has introduced in detail a watchdog control method, device, equipment and medium provided by the present invention. Specific examples are used herein to elaborate on the principle and implementation manner of the present invention. The description of the above embodiments is only used to help understand the method and its core idea of the present invention. It should be noted that for those of ordinary skill in the art in this technical field, without departing from the principle of the present invention, several improvements and modifications can be made to the present invention, and these improvements and modifications also fall within the protection scope of the claims of the present invention.
Claims
1. A watchdog control method, characterized in that, Including: Sending a start command corresponding to the secondary fault resilient boot watchdog to the management controller so that the management controller starts the secondary fault resilient boot watchdog; Creating an event corresponding to the secondary fault resilient boot watchdog based on an event creation function to obtain a watchdog event; Associating the watchdog event with a target human-machine interaction interface of the Unified Extensible Firmware Interface (UEFI) firmware; When the UEFI firmware is loaded into the target human-machine interaction interface, triggering the watchdog event and using a watchdog event handling function corresponding to the watchdog event to send a target command to the management controller so that the management controller closes the secondary fault resilient boot watchdog based on the target command.
2. The watchdog control method according to claim 1, wherein The associating the watchdog event with a target human-machine interaction interface of the UEFI firmware includes: Associating the watchdog event with a settings menu interface, a password input interface, and a startup menu interface of the UEFI firmware.
3. The watchdog control method according to claim 2, wherein The associating the watchdog event with a settings menu interface, a password input interface, and a startup menu interface of the UEFI firmware includes: Associating the watchdog event with a globally unique identifier of the settings menu interface, the password input interface, and the startup menu interface of the UEFI firmware; Correspondingly, the when the UEFI firmware is loaded into the target human-machine interaction interface, triggering the watchdog event and using a watchdog event handling function corresponding to the watchdog event to send a target command to the management controller includes: When the UEFI firmware is loaded into the globally unique identifier corresponding to the settings menu interface, the password input interface, and the startup menu interface, triggering the watchdog event and using a watchdog event handling function corresponding to the watchdog event to send a target command to the management controller.
4. The watchdog control method according to claim 1, wherein Before the watchdog event handling function sends a target command to the management controller, it further includes: Querying the watchdog status of the secondary fault resilient boot watchdog, and if the watchdog status is the on state, triggering the step of sending a target command to the management controller.
5. The watchdog control method according to claim 1, characterized in that, Before the watchdog event handling function sends a target command to the management controller, it further includes: Sending the completed power-on self-test information corresponding to the UEFI firmware to the management controller.
6. The watchdog control method according to claim 1, wherein The creating an event corresponding to the secondary fault resilient boot watchdog based on an event creation function to obtain a watchdog event includes: Starting a service component using the Extensible Firmware Interface (EFI) and creating an event corresponding to the secondary fault resilient boot watchdog based on an event creation function to obtain a watchdog event.
7. The watchdog control method according to any one of claims 1 to 6, characterized in that, It further includes: Creating an event handling function corresponding to the watchdog event to obtain a watchdog event handling function, or obtaining a pre-created watchdog event handling function; Associating the watchdog event with the watchdog event handling function.
8. A watchdog control device, characterized in that, Including: A watchdog startup module for sending a start command corresponding to the secondary fault resilient boot watchdog to the management controller so that the management controller starts the secondary fault resilient boot watchdog; An event creation module, configured to create an event corresponding to the secondary fault resilient boot watchdog based on an event creation function to obtain a watchdog event; An event association module, configured to associate the watchdog event with a target human-machine interaction interface of the Unified Extensible Firmware Interface (UEFI) firmware; An event trigger module, configured to trigger the watchdog event when the UEFI firmware is loaded into the target human-machine interaction interface, and send a target command to the management controller by using a watchdog event handling function corresponding to the watchdog event, so that the management controller closes the secondary fault resilient boot watchdog based on the target command.
9. An electronic device, characterized in that, Comprising: A memory, configured to store a computer program; A processor, configured to execute the computer program to implement the steps of the watchdog control method according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that, A computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, the steps of the watchdog control method according to any one of claims 1 to 7 are implemented.