Power-off strategy execution method, device, equipment, storage medium and program product
By obtaining CPU and power status signals in the workstation, using CPLD and MCU to judge the AC power outage event, generating control signals to control CPU operations, the problem of policy failure caused by AC lightning break is solved, the monitoring accuracy and effectiveness of policy execution are improved, and the BIOS complexity and resource consumption are reduced.
Patent Information
- Application Number
- CN202111615424.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-27
- Publication Date
- 2025-08-29
- Estimated Expiration
- 2041-12-27
AI Technical Summary
In the case where AC power failure is restored, the power outage strategy is invalid, which cannot meet the requirements of the AC Loss strategy. The existing solution is complex and has strong platform limitations.
By obtaining the CPU status signal and power status signal of the workstation, the AC power outage event is judged by using the CPLD and the MCU, especially the recovery situation of AC flash, and generate a control signal to control the CPU to perform corresponding operations, avoid relying on BIOS and reduce design complexity.
It improves the monitoring accuracy of AC power outage events and the effectiveness of policy execution, reduces resource consumption, reduces BIOS maintenance costs, and solves the problem of policy failure caused by AC flash breaking, that is, recovery.
Smart Images

Figure CN114461447B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a power-off strategy execution method, apparatus, device, storage medium, and program product. Background Art
[0002] With the rapid development of the internet, the hardware supporting it is constantly being updated and upgraded. Workstations, as high-end, general-purpose microcomputers, offer users more powerful performance than personal computers and are widely used in scientific and engineering computing, software development, computer-aided analysis, computer-aided manufacturing, engineering design and applications, graphics and image processing, process control, and information management.
[0003] In the workstation field, AC power loss (AC Loss) policy is a commonly used function. It mainly means that when the AC power is cut off during normal operation or standby mode, the workstation can automatically perform three actions according to the BIOS settings after AC power is restored: always power on (Always ON), always power off (Always OFF), or maintain the system state before AC loss (Last State).
[0004] In the prior art, corresponding functions are developed for the BIOS, and the BIOS controls the CPU-related registers to monitor the auxiliary power (Auxiliary Power, AUX power) of the CPU and records the AC disconnection event of the workstation after it drops to a certain threshold, and sets the relevant real-time clock register (RTC register). When the AC is reconnected to the motherboard, the relevant RTC register operates the CPU to issue corresponding actions according to the AC Loss strategy set by the BIOS, and controls the system to power on or maintain the current state. Alternatively, the BIOS controls the SuperIO to monitor the voltage of the AUX power on the motherboard, and when the voltage is lower than a certain threshold, records the AC disconnection event of the workstation and sets the relevant RTC register. When the AC is reconnected to the motherboard, the SuperIO controls the AC Loss strategy set in the BIOS to issue corresponding instructions to the CPU, and controls the system to power on or maintain the current state.
[0005] However, in the above-mentioned prior art, when the AC power is restored after a flash outage, the automatic power-on policy after AC Loss set after the flash outage is likely to become invalid, and the requirement for executing the AC Loss policy cannot be met. Summary of the Invention
[0006] Based on this, it is necessary to provide a power-off strategy execution method, device, equipment, storage medium and program product that can meet the AL Loss strategy execution in situations such as AC flash failure and immediate recovery to address the above technical problems.
[0007] In a first aspect, the present application provides a power-off policy execution method, which is applied to a workstation, and the method includes:
[0008] Acquire a first state signal of a central processing unit (CPU) of the workstation and a second state signal of a power supply;
[0009] After determining that an AC power failure event occurs in the workstation based on the first status signal and the second status signal, generating a control signal according to a system status of the workstation and an AC power failure policy;
[0010] The CPU is controlled to perform corresponding operations according to the control signal.
[0011] In this solution, whether an AC power loss event occurs is determined by using a first state signal of the CPU and a second state signal of the power supply. In particular, based on the sensitivity of the first state signal and the second state signal, an AC power loss event in which the AC power is interrupted and then restored can be detected, thereby executing a corresponding AC power loss strategy. This solves the problem in the prior art of monitoring AC power loss events by voltage values but being unable to perceive AC power loss events that are interrupted and then restored, resulting in failure of the AC power loss strategy execution. This improves the accuracy of AC power loss event monitoring and the effectiveness of the AC power loss strategy.
[0012] In one optional embodiment, the method further includes:
[0013] When the first state signal is at a high level, if the second state signal undergoes a level jump, it is determined that an AC power failure event occurs in the workstation.
[0014] By using CPLD to monitor the ATX power supply POWER OK signal and the CPU SleepS5_N signal to determine AC Loss events, the existing solution avoids the problem of the system failing to implement the strategy after AC loss due to monitoring at specific voltage values.
[0015] In one optional embodiment, the workstation includes a first controller and a second controller; obtaining a first status signal of a central processing unit (CPU) of the workstation and a second status signal of a power supply includes:
[0016] The first controller obtains a first status signal of a central processing unit (CPU) of the workstation and a second status signal of a power supply;
[0017] After determining that an AC power failure event occurs in the workstation based on the first status signal and the second status signal, generating a control signal according to the system status of the workstation and the AC power failure strategy includes:
[0018] After the first controller determines that an AC power failure event occurs at the workstation based on the first status signal and the second status signal, the first controller sends the AC power failure event and the system status to the second controller;
[0019] The second controller generates a control signal according to the system status of the workstation and the AC power-off strategy, and sends the control signal to the first controller.
[0020] In this embodiment, the AC Loss policy is transmitted via the IIC interface between the CPU and MCU, eliminating the need for BIOS-based AC Loss policy implementation and reducing solution design complexity. Furthermore, the CPLD monitors the ATX power supply's POWER OK signal and the CPU's SleepS5_N signal to determine AC Loss events. This avoids the problem in existing solutions where specific voltage values are used for monitoring, resulting in the policy failing after an AC power outage. The UART interface and GPIO level status between the MCU and CPLD are used to transmit AC Loss events and control the execution of the relevant AC Loss policy. Furthermore, the MCU stores the AC Loss policy, AC Loss event, and system status in the RTC register, ensuring that this information is not lost after an MCU power outage.
[0021] In one optional embodiment, the second controller includes an RTC register; the RTC register is used to store an AC power failure event, a system state, and an AC power failure strategy.
[0022] In this embodiment, the AC power-off event, system status and AC power-off policy are stored in the RTC register. Based on the property that the power-off data of the RTC register will not be lost, it is ensured that when the workstation loses power, the AC power-off event, system status and AC power-off policy in the RTC register will not be lost.
[0023] In one optional embodiment, the method further includes:
[0024] The second controller starts a preset timer after receiving the AC power failure event;
[0025] If the preset timer is executed, the steps of generating a control signal according to the system state of the workstation and the AC power-off strategy and sending the control signal to the first controller are performed.
[0026] In this embodiment, a timer is set in the second controller, and the execution status of the timer is used to determine whether the AC Loss event generated by the workstation is an AC flash-off and recovery event, thereby determining whether the first controller needs to re-handshake the connection with the second controller. In the event of an AC flash-off and recovery event, the first controller and the second controller do not need to re-handshake the communication, which reduces the interaction between the first controller and the second controller, reduces resource consumption, and meets the requirement that the first controller and the second controller can still execute the AC Loss strategy in the event of an AC flash-off and recovery event.
[0027] In one optional embodiment, the method further includes:
[0028] If the preset timer has not been executed, after detecting that the workstation is powered on, a communication connection request initiated by the first controller is received. After establishing a connection with the first controller, a control signal is generated according to the system status of the workstation and the AC power-off strategy, and the control signal is sent to the first controller.
[0029] In this embodiment, a timer is set in the second controller, and the execution status of the timer is used to determine whether the AC Loss event generated by the workstation is an AC flash loss and recovery event, thereby determining whether the first controller needs to re-handshake and connect with the second controller. If the AC flash loss and recovery event does not occur, the first controller and the second controller re-handshake and communicate. After the connection is established, the first controller and the second controller can still execute the requirements of the AC Loss policy.
[0030] In one optional embodiment, the first controller is a complex programmable logic device (CPLD); the second controller is a micro control unit (MCU).
[0031] In a second aspect, the present application further provides a power-off strategy execution device, the device comprising:
[0032] An acquisition module, configured to acquire a first status signal of a central processing unit (CPU) of a workstation and a second status signal of a power supply;
[0033] a determination module, configured to generate a control signal according to a system state of the workstation and an AC power failure policy after determining that an AC power failure event has occurred in the workstation based on the first state signal and the second state signal;
[0034] The control module is used to control the CPU to perform corresponding operations according to the control signal.
[0035] In a third aspect, the present application further provides a computer device comprising a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the method provided in the first aspect is implemented.
[0036] In a fourth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the method provided in the first aspect.
[0037] In a fifth aspect, the present application further provides a computer program product, comprising a computer program, which implements the method provided in the first aspect when executed by a processor.
[0038] The above-mentioned power-off strategy execution method, apparatus, device, storage medium, and program product obtain a first status signal of the workstation's central processing unit (CPU) and a second status signal of the power supply; after determining that an AC power-off event has occurred in the workstation based on the first status signal and the second status signal, generate a control signal based on the workstation's system status and the AC power-off strategy; and control the CPU to perform corresponding operations based on the control signal. In this solution, whether an AC power-off event has occurred is determined by the first status signal of the CPU and the second status signal of the power supply. In particular, based on the sensitivity of the first status signal and the second status signal, an AC power-off event that is restored after a flash interruption can be detected, thereby executing a corresponding AC power-off strategy. This solves the problem in the prior art of monitoring AC power-off events through voltage values but failing to detect AC power-off and restoration events, resulting in failure of AC power-off strategy execution, thereby improving the accuracy of AC power-off event monitoring and the effectiveness of AC power-off strategies. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] Figure 1 A diagram illustrating an application environment of a power-off strategy execution method according to an embodiment;
[0040] Figure 2 1 is a flow chart of a method for executing a power-off strategy in one embodiment;
[0041] Figure 3 1 is a flow chart of a method for executing a power-off strategy according to another embodiment;
[0042] Figure 4 A schematic diagram of a workstation structure in one embodiment;
[0043] Figure 5 Schematic diagram of a flow chart of a power-off strategy execution method in another embodiment;
[0044] Figure 6 Schematic diagram of a flow chart of a power-off strategy execution method in another embodiment;
[0045] Figure 7 Schematic diagram of a flow chart of a power-off strategy execution method in another embodiment;
[0046] Figure 8 is a structural block diagram of a power-off strategy execution device in one embodiment;
[0047] Figure 9 FIG. 4 is a structural block diagram of a power-off strategy execution device in another embodiment. DETAILED DESCRIPTION
[0048] In order to make the purpose, technical solutions and advantages of this application more clear, the following further describes this application in detail with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain this application and are not intended to limit this application.
[0049] With the rapid development of the internet, the hardware supporting it is constantly being updated and upgraded. Workstations, as high-end, general-purpose microcomputers, offer users more powerful performance than personal computers and are widely used in scientific and engineering computing, software development, computer-aided analysis, computer-aided manufacturing, engineering design and applications, graphics and image processing, process control, and information management.
[0050] In the workstation field, AC Loss policy is a commonly used function. It mainly means that when the AC power is cut off during normal operation or standby mode, the workstation can automatically perform three actions according to the policy set in the BIOS: always power on (Always ON), always power off (Always OFF), and maintain the system state before AC Loss (Last State).
[0051] There are two main technical solutions to achieve this function:
[0052] The first solution is direct BIOS control. This involves developing a BIOS function that controls CPU registers to monitor the CPU's AUX power level. When the power drops below a certain threshold, it registers an AC loss event and sets the relevant RTC registers. When AC is restored to the motherboard, the RTC registers, based on the AC loss policy configured in the BIOS, trigger the CPU to initiate appropriate actions, either powering on or maintaining the system's current state.
[0053] However, this solution for monitoring AC loss events on the motherboard relies on the CPU-related registers detecting that the CPU's AUX power is below a certain threshold. However, in outdoor environments such as security and monitoring, the power consumption environment is unstable, and AC power outages and subsequent recovery often occur. At this time, the motherboard's AUX power will not change rapidly due to the effect of the load capacitance, resulting in the failure of the automatic power-on policy set after AC loss after the flash. In addition, the working mechanism of some CPUs requires that the AC loss policy can only be written again to the CPU-related control registers after the BIOS POST is completed when the AC is disconnected and restarted. As a result, if an AC loss situation occurs during the POST stage, the set policy cannot be executed normally on the next restart, which has certain platform limitations. In addition, this solution increases the complexity of BIOS development, increases the amount of code development, and has a long development and debugging cycle. The large number of BIOS iterations also brings inconvenience to the maintenance of the entire workstation.
[0054] The second solution is SuperIO control. The BIOS controls SuperIO to monitor the motherboard's AUX voltage. When the voltage falls below a certain threshold, it registers an AC loss event and sets the relevant RTC register. When AC is restored, SuperIO, based on the AC loss policy configured in the BIOS, issues instructions to the CPU, controlling whether the system should power on or maintain its current state.
[0055] However, this solution has similar problems to the first one with the direct BIOS control solution: the automatic power-on policy fails after AC loss. Furthermore, this solution also requires BIOS engineers to delve into the process and modify the BIOS to adapt to SuperIO, resulting in a long development cycle.
[0056] In order to solve the above problems, the present invention provides a method for executing a power-off strategy, which can be applied to Figure 1 In one embodiment, a computer device is provided, which may be a terminal, and its internal structure diagram may be as shown in FIG. Figure 1As shown. The computer device includes a processor, a memory, a communication interface, a display screen and an input device connected via a system bus. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The communication interface of the computer device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner can be achieved through WIFI, a mobile cellular network, NFC (near field communication) or other technologies. When the computer program is executed by the processor, a power-off strategy execution method is implemented. The display screen of the computer device can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device can be a touch layer covering the display screen, or a button, trackball or touchpad provided on the computer device housing, or an external keyboard, touchpad or mouse.
[0057] Those skilled in the art will understand that Figure 1 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than shown in the figure, or combine certain components, or have a different component arrangement.
[0058] In one embodiment, Figure 2 As shown, a power-down strategy execution method is provided, which is applied to Figure 1 The following steps are used as an example to illustrate the workstation in the example:
[0059] Step 201: Acquire a first status signal of a central processing unit (CPU) of a workstation and a second status signal of a power supply.
[0060] Optionally, the power supply can be an ATX power supply of a workstation, which is used to convert the AC 220V power supply into DC 5V for use inside the workstation. Here, the workstation can also be understood as a computer, server and other equipment. The first status signal can be the SleepS5_N signal output by the CPU. The SleepS5_N signal is at a high level, indicating that the workstation system is in a normal power-on state. Optionally, the SleepS5_N signal can be obtained through the GPIO pin. The second status signal can be the POWER OK signal output by the ATX power supply. The POWER OK signal indicates the working status of the ATX power supply. Similarly, the POWER OK signal can be obtained through the GPIO pin. Here, based on the waveform changes of the SleepS5_N signal and the POWER OK signal, the AC Loss event generated by the workstation can be accurately obtained.
[0061] Step 202 : After determining that an AC power failure event occurs in the workstation based on the first status signal and the second status signal, generate a control signal according to the system status of the workstation and the AC power failure policy.
[0062] Determining whether an AC power loss event has occurred in the workstation based on the first status signal and the second status signal. Optionally, when the first status signal is at a high level, indicating that the workstation is in a powered-on state, and the second status signal is at a high level, indicating that the workstation is operating in a powered-on state, if the second status signal undergoes a level jump while the first status signal is at a high level, then determining that an AC loss event has occurred in the workstation. For example, the second status signal undergoes a level jump from a high level to a low level.
[0063] Optionally, when the first state signal is at a low level indicating that the workstation is in a powered-on state, and the second state signal is at a low level indicating that the workstation is operating in a powered-on state, if the second state signal undergoes a level jump while the first state signal is at a low level, it is determined that an AC Loss event has occurred in the workstation. For example, the second state signal undergoes a level jump from a low level to a high level.
[0064] After determining that an AC Loss event has occurred at the workstation based on the first status signal and the second status signal, the AC Loss policy execution action corresponding to the current AC Loss event is determined based on a pre-stored AC Loss policy, the AC Loss event, and the workstation's system status, and a corresponding control signal is generated based on the AC Loss policy execution action. Optionally, the AC Loss policy includes a mapping relationship between the AC Loss policy execution action, the AC Loss event, and the workstation's system status.
[0065] Step 203: Control the CPU to perform corresponding operations according to the control signal.
[0066] In this embodiment, after generating the control signal, exemplarily, the control signal can be output to the CPU to enable the CPU to perform a corresponding operation, such as the CPU performing a power-on wake-up operation according to the received control signal; or, exemplarily, after generating the control signal, the CPU is controlled to perform a power-on wake-up operation.
[0067] Optionally, other related firmware involved in the workstation may be controlled based on the control signal to perform corresponding operations, such as controlling other VR chips in the workstation to perform power-on operations, which is not limited in this embodiment.
[0068] In the above-mentioned power-off strategy execution method, a first status signal of the central processing unit (CPU) of the workstation and a second status signal of the power supply are obtained; after determining that an AC power-off event has occurred in the workstation based on the first status signal and the second status signal, a control signal is generated according to the system status of the workstation and the AC power-off strategy; and the CPU is controlled to perform corresponding operations according to the control signal. In this solution, whether an AC power-off event has occurred is determined by the first status signal of the CPU and the second status signal of the power supply. In particular, based on the sensitivity of the first status signal and the second status signal, an AC power-off event in which the AC power is interrupted and then restored can be detected, thereby executing the corresponding AC power-off strategy. This solves the problem in the prior art of monitoring AC power-off events by voltage values but being unable to detect AC power-off and restoration events, resulting in failure of AC power-off strategy execution, thereby improving the accuracy of AC power-off event monitoring and the effectiveness of AC power-off strategies.
[0069] In one optional embodiment, the workstation includes a first controller and a second controller, and the first controller and the second controller respectively perform corresponding operations to implement the execution of the AC Loss strategy after the AC Loss event occurs in the workstation, such as Figure 3 As shown, the above-mentioned acquisition of the first state signal of the central processing unit CPU of the workstation and the second state signal of the power supply includes:
[0070] Step 301: A first controller obtains a first status signal of a central processing unit (CPU) of a workstation and a second status signal of a power supply.
[0071] For example, the structural diagram of the workstation can be referred to Figure 4 As shown, the workstation includes a first controller, a second controller, a central processing unit (CPU), and an ATX power supply. Optionally, the first controller and the second controller can be any logic processor such as a field programmable gate array (FPGA), a programmable logic device (PLD), a complex programmable logic device (CPLD), or a microcontroller unit (MCU). Figure 4 For example, the first controller may be a CPLD and the second controller may be an MCU.
[0072] In this embodiment, the CPLD obtains a first status signal output by the CPU of the workstation. Exemplarily, the first status signal may be a SleepS5_N signal. Optionally, the CPLD may obtain the SleepS5_N signal through a GPIO pin. The CPLD obtains a second status signal of the ATX power supply of the workstation. Exemplarily, the second status signal may be a POWER OK signal. Optionally, the CPLD may obtain the POWER OK signal through a GPIO pin.
[0073] Step 302: After determining that an AC power failure event occurs at the workstation based on the first status signal and the second status signal, the first controller sends the AC power failure event and the system status to the second controller.
[0074] In this embodiment, after the CPLD obtains the SleepS5_N signal from the CPU and the POWER OK signal from the ATX power supply, it determines whether an AC Loss event has occurred in the workstation based on these two signals. For example, when the workstation is in a normal power-on state, both the SleepS5_N signal and the POWER OK signal should be high. If the CPLD detects that the SleepS5_N signal remains high while the POWER OK signal undergoes a level change—for example, the POWER OK signal transitions from a high level to a low level—the CPLD determines that an AC Loss event has occurred in the workstation. Optionally, the CPLD can send the AC Loss event information and the workstation's system status to the MCU via the UART interface.
[0075] Step 303: The second controller generates a control signal according to the system status of the workstation and the AC power-off strategy, and sends the control signal to the first controller.
[0076] In this embodiment, after receiving the AC Loss event information and the system status of the workstation, the MCU can optionally store the AC Loss event and the system status of the workstation in the RTC register to prevent the loss of information such as the AC Loss event and the system status of the workstation after the MCU is powered off.
[0077] Optionally, the AC power-off strategy stored in the MCU can be obtained through the user interaction interface of the workstation BIOS. For example, the specific execution actions of the AC Loss strategy set by the user are obtained through the relevant functional area of the BIOS graphical interface. For example, the execution actions include always automatically turning on (Always ON), always shutting down (Always OFF), and maintaining the system state before AC Loss (Last State). The CPU obtains the AC Loss strategy by interacting with the BIOS and sends the AC Loss strategy to the MCU through the IIC interface. Optionally, after receiving the AC Loss strategy, the MCU stores it in the RTC register to prevent the loss of information such as the AC Loss strategy after the MCU is powered off.
[0078] The MCU reads the AC Loss policy, AC Loss event, and workstation system status from the RTC register. Based on the mapping relationship between the AC Loss event, system status, and execution action in the AC Loss policy, it generates a control signal corresponding to the execution action of the AC Loss policy corresponding to the current AC Loss event. Optionally, the MCU can transmit the control signal to the CPLD by controlling the level of the GPIO. For example, the MCU controls the level of the GPIO, and the CPLD monitors the level of the GPIO between the MCU and the MCU, indicating the AC Loss policy. Based on the GPIO status, it determines whether to generate a control instruction to wake up the CPU. For example, the CPLD can simulate a low-pulse POWER BUTTON signal and send it to the CPU to cause the CPU to execute the power-on wake-up action, thereby completing the execution action in response to the AC Loss policy.
[0079] Optionally, if no AC Loss policy is set in the MCU after the CPLD establishes a connection with the MCU, the MCU may control the GPIO level interacting with the CPLD to remain in a default state. Optionally, the default state of the GPIO level may be a high level.
[0080] In this embodiment, the AC Loss policy is transmitted via the IIC interface between the CPU and MCU, eliminating the need for BIOS-based AC Loss policy implementation and reducing solution design complexity. Furthermore, the CPLD monitors the ATX power supply's POWER OK signal and the CPU's SleepS5_N signal to determine AC Loss events. This avoids the problem in existing solutions where specific voltage values are used for monitoring, resulting in the policy failing after an AC power outage. The UART interface and GPIO level status between the MCU and CPLD are used to transmit AC Loss events and control the execution of the relevant AC Loss policy. Furthermore, the MCU stores the AC Loss policy, AC Loss event, and system status in the RTC register, ensuring that this information is not lost after an MCU power outage.
[0081] When an AC Loss event occurs in a workstation, both the first controller and the second controller may be in a power-off state. When the workstation is powered on again, the first controller and the second controller need to re-handshake and communicate. However, there is also a situation where, when the workstation has an AC flash-off and then recovery, the MCU and the CPLD may be in a powered-on state. In this case, there is no need to re-handshake and communicate. How to determine whether the generated AC Loss event is an AC flash-off and then recovery event? For example, in one of the optional embodiments, Figure 5 As shown, the method further includes:
[0082] Step 401: After receiving an AC power failure event, the second controller starts a preset timer.
[0083] Optionally, based on the fact that the AC power is restored after a short interruption, the second controller can determine whether to enter a power-off state by counting down or timing after receiving the AC Loss event. For example, taking the second controller as an MCU, after receiving the AC Loss event, the MCU can first store the AC Loss event in the RTC register to prevent the AC Loss event from being lost after the MCU is powered off. After storing the AC Loss event in the RTC register, the MCU can start a preset timer for timing. Optionally, the preset timer can be a countdown or countup, and the timing duration can be 3 seconds, 5 seconds, or 10 seconds, which is not limited in this embodiment.
[0084] Step 402 : If the preset timer is executed, then a step of generating a control signal according to the system status of the workstation and the AC power-off strategy and sending the control signal to the first controller is executed.
[0085] Taking the first controller being a CPLD and the second controller being an MCU as an example, if the preset timer is executed to completion, that is, the countdown or countdown is completed, in this case, it means that the MCU is always in the power-on state, that is, the AC Loss event received by the MCU is an AC flash-break and recovery event, and the AC flash-break generated by this event is not sufficient to affect the power-on state of the MCU and CPLD. The MCU and the CPLD are always in a connected state. In this state, after the timer set by the MCU is completed, the MCU can directly execute the operation of the above-mentioned step 303, which is not described in detail in this embodiment.
[0086] Step 403: If the preset timer has not been executed, after detecting that the workstation is powered on, a communication connection request initiated by the first controller is received. After establishing a connection with the first controller, a control signal is generated according to the system status of the workstation and the AC power-off strategy, and the control signal is sent to the first controller.
[0087] Taking the first controller being a CPLD and the second controller being an MCU as an example, if the preset timer is not executed to completion, that is, the MCU has not completed the countdown or countdown, in this case, it means that the workstation AC Loss event affects the MCU to be in a power-off state, that is, the AC Loss event received by the MCU is a common AC Loss event. The AC power failure generated by this event has affected the MCU and CPLD to be in a power-off state. The MCU and the CPLD will be disconnected in the power-off state. In this case, the MCU receives the communication connection request initiated by the CPLD. After establishing a connection with the CPLD, the MCU can directly execute the operation of the above-mentioned step 303, which is not described in detail in this embodiment.
[0088] In this embodiment, a timer is set in the second controller, and the execution status of the timer is used to determine whether the AC Loss event generated by the workstation is an AC flash-off and recovery event, thereby determining whether the first controller needs to re-handshake with the second controller. This meets the requirement that the first controller and the second controller can still execute the AC Loss strategy when an AC flash-off and recovery event occurs.
[0089] In order to better illustrate the above method, Figure 6 As shown, this embodiment provides a power-off strategy execution method, which specifically includes:
[0090] S101, obtaining an AC power-off policy based on a BIOS user interface of a workstation;
[0091] S102, the second controller of the workstation receives the AC power-off strategy and stores it in the RTC register;
[0092] S103: A first controller of the workstation obtains a first status signal of a central processing unit (CPU) of the workstation and a second status signal of a power supply;
[0093] S104. After determining that an AC power failure event occurs at the workstation based on the first status signal and the second status signal, the first controller sends the AC power failure event and the system status to the second controller.
[0094] S105, the second controller stores the AC power failure event and the system status in the RTC register and starts a preset timer; if the preset timer is executed, step 106 is executed; if the preset timer is not executed, step 107 is executed;
[0095] S106. The second controller generates a control signal according to the system status of the workstation and the AC power-off strategy, and sends the control signal to the first controller;
[0096] S107, after detecting that the workstation is powered on, receiving a communication connection request initiated by the first controller, and after establishing a connection with the first controller, executing step 106;
[0097] S108: The first controller controls the CPU to perform corresponding operations according to the received control signal.
[0098] For example, the first controller is a CPLD and the second controller is an MCU. The AC Loss policy is stored in the RTC register of the MCU.
[0099] When the CPLD is powered on, it monitors whether an AC Loss event has occurred in the workstation through the POWER OK signal of the workstation's ATX power supply and the SleepS5_N signal of the CPU. If the POWER OK signal transitions from high to low while the SleepS5_N signal remains high, an AC Loss event is determined to have occurred in the workstation. In this case, the CPLD sends the AC Loss event information to the MCU through the UART interface.
[0100] After receiving the AC Loss event, the MCU stores the AC Loss event in the RTC register and uses a preset timer to count down for 5 seconds. If the 5-second countdown is completed, it means that the workstation has experienced an AC loss and then a recovery within 5 seconds. At this time, the MCU will control the GPIO level state interacting with the CPLD according to the stored AC Loss policy after the countdown is completed, thereby notifying the CPLD to execute the corresponding AC Loss policy. If the 5-second countdown is not completed, it means that the AC power of the workstation has been completely cut off. In this case, the MCU waits for the AC power to be restored. After the AC power is restored, the MCU and CPLD are powered on again and the code is loaded for initialization. The CPLD sends a handshake signal to the MCU through the UART interface to establish a communication connection. After the connection is established, the MCU controls the GPIO level state interacting with the CPLD according to the stored AC Loss policy, thereby notifying the CPLD to execute the corresponding AC Loss policy. If the AC Loss policy is not set in the MCU, the GPIO level controlled by the MCU to interact with the CPLD remains in the default state. Optionally, the default state of the GPIO level here can be a high level. For reference Figure 7 shown.
[0101] In this embodiment, whether an AC power loss event occurs is determined by using a first status signal of the CPU and a second status signal of the power supply. In particular, based on the sensitivity of the first status signal and the second status signal, an AC power loss event in which the AC power is interrupted and then restored can be detected, thereby executing a corresponding AC power loss strategy. This solves the problem in the prior art of monitoring AC power loss events by voltage values but being unable to perceive AC power loss events that are interrupted and then restored, resulting in failure of the AC power loss strategy execution. This improves the accuracy of AC power loss event monitoring and the effectiveness of the AC power loss strategy.
[0102] Alternatively, the CPU, in conjunction with the CPLD and MCU, can effectively detect system AC Loss events and execute appropriate startup actions based on the configured AC Loss policy. This eliminates the need for BIOS to execute the AC Loss policy, reducing BIOS code complexity and lowering BIOS maintenance costs. Furthermore, by using the IIC interface between the CPU and MCU to transmit AC Loss policy content and using the MCU's RTC registers to store the policy, the platform limitations of existing solutions are avoided.
[0103] The implementation principle and technical effects of the power-off strategy execution method provided in the above embodiment are similar to those of the above method embodiment, and will not be repeated here.
[0104] It should be understood that, although the various steps in the flowcharts involved in the various embodiments described above are displayed in sequence according to the instructions of the arrows, these steps are not necessarily executed in sequence in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order restriction on the execution of these steps, and these steps can be executed in other orders. Moreover, at least a portion of the steps in the flowcharts involved in the various embodiments described above can include multiple steps or multiple stages, and these steps or stages are not necessarily executed and completed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a portion of steps or stages in other steps.
[0105] Based on the same inventive concept, embodiments of the present application also provide a power-off policy execution device for implementing the aforementioned power-off policy execution method. The implementation solution provided by this device is similar to the implementation solution described in the aforementioned method. Therefore, the specific limitations of one or more power-off policy execution device embodiments provided below can be found in the above-mentioned limitations of the power-off policy execution method and will not be repeated here.
[0106] In one embodiment, Figure 8 As shown, a power-off strategy execution device is provided, comprising:
[0107] An acquisition module 01 is configured to acquire a first status signal of a central processing unit (CPU) of a workstation and a second status signal of a power supply;
[0108] Determination module 02, configured to generate a control signal according to a system state of the workstation and an AC power failure policy after determining that an AC power failure event has occurred in the workstation based on the first state signal and the second state signal;
[0109] The control module 03 is used to control the CPU to perform corresponding operations according to the control signal.
[0110] In one optional embodiment, the determination module 02 is further configured to determine that an AC power failure event occurs in the workstation if a level jump occurs in the second state signal when the first state signal is at a high level.
[0111] In one optional embodiment, the workstation includes a first controller and a second controller; the acquisition module 01 is configured to acquire a first status signal of a central processing unit (CPU) of the workstation and a second status signal of a power supply through the first controller;
[0112] Determining module 02, configured to send the AC power failure event and the system status to the second controller after determining, through the first controller, that the AC power failure event occurs in the workstation based on the first status signal and the second status signal;
[0113] The determination module 02 is configured to generate a control signal through the second controller according to the system status of the workstation and the AC power-off strategy, and send the control signal to the first controller.
[0114] In one optional embodiment, the second controller includes an RTC register; the RTC register is used to store an AC power failure event, a system state, and an AC power failure strategy.
[0115] In one of the optional embodiments, the device further includes a timing module 04;
[0116] The timing module 04 is used to start a preset timer after receiving an AC power failure event through the second controller; if the preset timer is executed, a control signal is generated according to the system status of the workstation and the AC power failure strategy, and the control signal is sent to the first controller.
[0117] In one of the optional embodiments, Figure 9 As shown, the timing module 04 is also used to initiate a communication connection request to the first controller after detecting that the workstation is powered on if the preset timer has not been executed. After establishing a connection with the first controller, it generates a control signal according to the system status of the workstation and the AC power-off strategy, and sends the control signal to the first controller.
[0118] In one optional embodiment, the first controller is a complex programmable logic device (CPLD); the second controller is a micro control unit (MCU).
[0119] Each module in the power-off strategy execution device can be implemented in whole or in part through software, hardware, or a combination thereof. Each module can be embedded in or independent of a processor in a computer device in hardware form, or can be stored in a memory in the computer device in software form, so that the processor can call and execute the corresponding operations of each module.
[0120] In one embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and when the processor executes the computer program, the following steps are implemented:
[0121] Acquire a first state signal of a central processing unit (CPU) of the workstation and a second state signal of a power supply;
[0122] After determining that an AC power failure event occurs in the workstation based on the first status signal and the second status signal, generating a control signal according to a system status of the workstation and an AC power failure policy;
[0123] The CPU is controlled to perform corresponding operations according to the control signal.
[0124] The implementation principle and technical effects of the computer device provided in the above embodiment are similar to those of the above method embodiment and will not be repeated here.
[0125] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the following steps are implemented:
[0126] Acquire a first state signal of a central processing unit (CPU) of the workstation and a second state signal of a power supply;
[0127] After determining that an AC power failure event occurs in the workstation based on the first status signal and the second status signal, generating a control signal according to a system status of the workstation and an AC power failure policy;
[0128] The CPU is controlled to perform corresponding operations according to the control signal.
[0129] The computer-readable storage medium provided in the above embodiment has similar implementation principles and technical effects to those of the above method embodiment, and will not be described in detail here.
[0130] In one embodiment, a computer program product is provided, comprising a computer program, which, when executed by a processor, implements the following steps:
[0131] Acquire a first state signal of a central processing unit (CPU) of the workstation and a second state signal of a power supply;
[0132] After determining that an AC power failure event occurs in the workstation based on the first status signal and the second status signal, generating a control signal according to a system status of the workstation and an AC power failure policy;
[0133] The CPU is controlled to perform corresponding operations according to the control signal.
[0134] The computer program product provided in the above embodiment has similar implementation principles and technical effects to those of the above method embodiment, and will not be described in detail here.
[0135] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties.
[0136] Those skilled in the art will appreciate that all or part of the processes in the above-mentioned embodiment methods can be implemented by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, database or other media used in the embodiments provided in this application may include at least one of non-volatile and volatile memory. Non-volatile memory may include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory may include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in the various embodiments provided herein may include at least one of a relational database and a non-relational database. Non-relational databases may include, but are not limited to, distributed databases based on blockchains. The processor involved in the various embodiments provided herein may be, but are not limited to, a general-purpose processor, a central processing unit, a graphics processing unit, a digital signal processor, a programmable logic unit, a data processing logic unit based on quantum computing, and the like.
[0137] The technical features of the above embodiments can be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0138] The above-described embodiments merely represent several implementation methods of the present application. While the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the present application. It should be noted that a person of ordinary skill in the art may make various modifications and improvements without departing from the spirit of the present application, and these modifications and improvements fall within the scope of protection of the present application. Therefore, the scope of protection of the present application shall be determined by the appended claims.
Claims
1. A method for executing a power-off strategy, characterized in that: Applied in a workstation, the workstation includes a first controller and a second controller; the method includes: The first controller obtains a first status signal of a central processing unit (CPU) of the workstation and a second status signal of a power supply; After determining that an AC power failure event occurs at the workstation based on the first status signal and the second status signal, the first controller sends the AC power failure event and the system status of the workstation to the second controller; the second controller generates a control signal based on the AC power failure event, the system status of the workstation, and an AC power failure policy, and sends the control signal to the first controller; The CPU is controlled to perform corresponding operations according to the control signal.
2. The method according to claim 1, characterized in that The method further comprises: When the first status signal is at a high level, if the second status signal undergoes a level jump, it is determined that the AC power failure event occurs in the workstation.
3. The method according to claim 1, characterized in that The second controller includes an RTC register; the RTC register is used to store the AC power failure event, the system state and the AC power failure strategy.
4. The method according to claim 1, wherein The method further comprises: The second controller starts a preset timer after receiving the AC power failure event; If the preset timer is executed, the step of generating a control signal according to the system status of the workstation and the AC power-off strategy and sending the control signal to the first controller is performed.
5. The method according to claim 4, characterized in that The method further comprises: If the preset timer has not been executed to completion, after detecting that the workstation is powered on, a communication connection request initiated by the first controller is received. After establishing a connection with the first controller, the step of generating a control signal based on the system status of the workstation and the AC power-off strategy, and sending the control signal to the first controller is executed.
6. The method according to claim 1, characterized in that The first controller is a complex programmable logic device (CPLD); the second controller is a microcontroller unit (MCU).
7. The method according to claim 1, characterized in that The AC power-off strategy includes a mapping relationship among an AC power-off strategy execution action, the AC power-off event, and the system status of the workstation.
8. A power-off strategy execution device, characterized in that: Applied in a workstation, the workstation includes a first controller and a second controller; the device includes: An acquisition module, configured for the first controller to acquire a first status signal of a central processing unit (CPU) of the workstation and a second status signal of a power supply; a determination module configured to, after the first controller determines that an AC power failure event has occurred in the workstation based on the first status signal and the second status signal, send the AC power failure event and the system status of the workstation to the second controller; and the second controller generates a control signal based on the AC power failure event, the system status of the workstation, and an AC power failure policy, and send the control signal to the first controller; The control module is used to control the CPU to perform corresponding operations according to the control signal.
9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 7 are implemented.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.
Citation Information
Patent Citations
Method and device for realizing rapid start
CN1641573A