Power supply control method and device of server, equipment and medium
By monitoring the user's operating indicator signal of the user's power button and determining whether the power is turned on according to the pre -set configuration information, the problem of accident shutdown of the server is solved, and the stability and reliability of the server are improved.
Patent Information
- Application Number
- CN202411408311.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-09
- Publication Date
- 2025-01-21
AI Technical Summary
In large-scale data centers or enterprise service application environments, unexpected shutdown of the server is caused by the staff's misoperation of power buttons, resulting in business interruption and data loss.
By monitoring the user's operating indicator signal corresponding to the power button of the target server, and control the configuration information based on the pre -set power control, judge whether to control the power of the server, including the configuration information of the power button shielding function to prevent accidental shutdown caused by error touch.
It effectively prevents accidental server shutdown caused by accidentally touching the power button, ensures the stable operation of the server, and improves the reliability and stability of the server.
Smart Images

Figure CN119336142A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of electrical technology, and in particular to a power control method, device, equipment and medium for a server. Background Art
[0002] In large-scale data centers or enterprise service application environments, the stability and reliability of servers are crucial to the normal operation of the business, and servers require staff to perform maintenance. However, during the server operation and maintenance process or during transportation, the staff may accidentally operate the power button or accidentally touch the power button, which may cause the running server to shut down unexpectedly, resulting in server business interruption and data loss. Summary of the invention
[0003] The embodiments of the present application provide a power control method, device, equipment and medium for a server, which are used to prevent accidental shutdown of the server caused by accidentally touching the power button, thereby ensuring the stable operation of the server and improving the reliability and stability of the server.
[0004] An embodiment of the present application provides a power control method for a server, comprising:
[0005] Monitoring a user operation indication signal corresponding to a power button of a target server, wherein the user operation indication signal is used to indicate that a user presses the power button of the target server, or that a user releases the power button of the target server;
[0006] When the user operation indication signal is monitored and is an indication signal for indicating that the user presses the power button of the target server, it is determined whether to control the target server to be powered off based on pre-set power control configuration information, wherein the pre-set power control configuration information includes configuration information about the power button shielding function of the target server.
[0007] The power control method of a server provided in an embodiment of the present application monitors a user operation indication signal corresponding to a power button of a target server, wherein the user operation indication signal is used to indicate that the user presses the power button of the target server, or the user releases the power button of the target server. When the user operation indication signal is monitored and is an indication signal for indicating that the user presses the power button of the target server, it can be determined whether to control the target server to be powered off based on pre-set power control configuration information, wherein the pre-set power control configuration information includes configuration information about a power button shielding function of the target server. Thus, by pre-setting the configuration information about the power button shielding function of the target server, it is possible to prevent an accidental shutdown of the server caused by accidentally touching the power button (which may be a short press or a long press, etc.), thereby ensuring the stable operation of the server and improving the reliability and stability of the server.
[0008] In some embodiments, the configuration information about the power button shielding function of the target server includes:
[0009] Configuration information about whether a short press shutdown shielding function of the power button of the target server is activated.
[0010] Therefore, by setting the configuration information about whether to start the short-press shutdown shielding function of the power button of the target server, it is possible to prevent the server short-press shutdown event caused by the user accidentally touching the power button.
[0011] In some embodiments, judging whether to control the target server to be powered off according to the preset power control configuration information includes:
[0012] Reading configuration information about whether a short-press shutdown shielding function of a power button of the target server is activated;
[0013] If the short-press shutdown shielding function of the power button of the target server is in an activated state, starting a preset timer;
[0014] If a user operation indication signal indicating that the user has released the power button of the target server is received within the timing duration of the preset timer, the timer is reset and the user operation indication signal corresponding to the power button of the target server is continuously monitored.
[0015] Thus, when the short-press shutdown shielding function of the power button of the target server is in the started state, by starting the preset timer, if a user operation indication signal indicating that the user releases the power button of the target server is received within the timing duration of the preset timer, the timer is reset, that is, the timer is used to determine that the user operation type of the power button of the server is a short press, thereby further determining that the current user operation of the server power button is a case of the user accidentally touching the power switch. Therefore, there is no need to power off the server, and the timer is reset and the user operation indication signal corresponding to the power button of the target server continues to be monitored.
[0016] In some embodiments, the determining whether to control the target server to be powered off according to the preset power control configuration information further includes:
[0017] If no user operation indication signal indicating that the user releases the power button of the target server is received within the timing duration of the preset timer, the target server is controlled to perform a forced shutdown operation.
[0018] Thus, when the short-press shutdown shielding function of the power button of the target server is in the activated state, by starting the preset timer, if within the timing duration of the preset timer, if the user operation indication signal that the user releases the power button of the target server is not received, the target server is controlled to perform a forced shutdown operation, that is, the timer is used to determine whether the user operation type of the server's power button is a long press, thereby determining that the current user operation of the server power button is not a case of the user accidentally touching the power switch, but that the target server needs to be controlled to perform a forced shutdown operation.
[0019] In some embodiments, the determining whether to control the target server to be powered off according to the preset power control configuration information further includes:
[0020] If the short-press shutdown shielding function of the power button of the target server is in a closed state, the target server is controlled to perform a shutdown operation according to the operation type of the power button of the target server by the user.
[0021] Therefore, when the short-press shutdown shielding function of the power button of the target server is in a closed state, it means that there is no need to shield the short-press shutdown of the power button of the target server, and normal power control can be performed.
[0022] In some embodiments, the user operation indication signal corresponding to the power button of the target server is an interrupt signal issued by a universal input / output interface of the power button of the target server.
[0023] Therefore, the user operation indication signal corresponding to the power button of the target server can be obtained by monitoring the interrupt signal sent by the universal input and output interface of the power button of the target server.
[0024] An embodiment of the present application provides a power control device for a server, comprising:
[0025] A power button detection unit, used to monitor a user operation indication signal corresponding to a power button of a target server, wherein the user operation indication signal is used to indicate that a user presses the power button of the target server, or that a user releases the power button of the target server;
[0026] An event judgment unit is used to judge whether to control the target server to power off according to pre-set power control configuration information when the user operation indication signal is monitored, which is an indication signal for indicating that the user presses the power button of the target server, wherein the pre-set power control configuration information includes configuration information about the power button shielding function of the target server.
[0027] Therefore, an embodiment of the present application provides a power control device that can prevent the occurrence of unexpected server shutdown events caused by accidentally touching the power button, by monitoring the user operation indication signal corresponding to the power button of the target server, wherein the user operation indication signal is used to indicate that the user presses the power button of the target server, or the user releases the power button of the target server, so that when the user operation indication signal is monitored and is an indication signal for indicating that the user presses the power button of the target server, it can be determined whether to control the target server to power off according to pre-set power control configuration information, wherein the pre-set power control configuration information includes configuration information about the power button shielding function of the target server, so that, through the pre-set configuration information about the power button shielding function of the target server, the occurrence of unexpected server shutdown events caused by accidentally touching the power button (which may be a short press or a long press, etc.) can be prevented, thereby ensuring the stable operation of the server and improving the reliability and stability of the server.
[0028] In some embodiments, the configuration information about the power button shielding function of the target server includes: configuration information about whether the short press shutdown shielding function of the power button of the target server is activated;
[0029] The device also includes:
[0030] The shielding function configuration unit is used for allowing the user to configure whether the short press shutdown shielding function is activated.
[0031] Therefore, the embodiment of the present application further provides a power control device that allows users to configure whether the short-press shutdown shielding function of the target server is activated, thereby making it more convenient for users to flexibly set whether to activate the short-press shutdown shielding function for the target server according to their actual needs.
[0032] Another embodiment of the present application provides an electronic device, which includes a memory and a processor, wherein the memory is used to store program instructions, and the processor is used to call the program instructions stored in the memory and execute any of the above methods according to the obtained program.
[0033] Therefore, the embodiment of the present application further provides an electronic device that can prevent the accidental shutdown of the server caused by the accidental touch of the power button, such as a BMC, and the BMC can be used to shield the accidental touch of the power button of the target server. Specifically, by monitoring the user operation indication signal corresponding to the power button of the target server, wherein the user operation indication signal is used to indicate that the user presses the power button of the target server, or the user releases the power button of the target server, so that when the user operation indication signal is monitored, it is used to indicate that the user presses the power button of the target server. When the indication signal is used to indicate that the user presses the power button of the target server, it can be determined whether to control the power off of the target server according to the pre-set power control configuration information, wherein the pre-set power control configuration information includes configuration information about the power button shielding function of the target server, so that, through the pre-set configuration information about the power button shielding function of the target server, it is possible to prevent the accidental shutdown of the server caused by the accidental touch of the power button (which may be a short press or a long press, etc.), thereby ensuring the stable operation of the server and improving the reliability and stability of the server.
[0034] Another embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer-executable instructions, and the computer-executable instructions are used to enable the computer to execute any of the above methods.
[0035] Therefore, the embodiment of the present application also provides a computer-readable storage medium that can prevent the occurrence of an unexpected server shutdown event caused by accidentally touching the power button. By executing the computer executable instructions stored in the computer-readable storage medium provided by the embodiment of the present application, the following process is implemented: monitoring the user operation indication signal corresponding to the power button of the target server, wherein the user operation indication signal is used to indicate that the user presses the power button of the target server, or the user releases the power button of the target server, so that when the user operation indication signal is monitored and is an indication signal for indicating that the user presses the power button of the target server, it can be determined whether to control the target server to power off according to the pre-set power control configuration information, wherein the pre-set power control configuration information includes configuration information about the power button shielding function of the target server, so that, through the pre-set configuration information about the power button shielding function of the target server, it is possible to prevent the occurrence of an unexpected server shutdown event caused by accidentally touching the power button (which may be a short press or a long press, etc.), thereby ensuring the stable operation of the server and improving the reliability and stability of the server. BRIEF DESCRIPTION OF THE DRAWINGS
[0036] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0037] Figure 1 A schematic diagram of the overall flow of a power control method for a server provided in an embodiment of the present application;
[0038] Figure 2 A schematic diagram of a specific flow chart of a power supply control method for a server provided in an embodiment of the present application;
[0039] Figure 3 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application;
[0040] Figure 4 A schematic diagram of the structure of a power supply control device for a server provided in an embodiment of the present application;
[0041] Figure 5 A schematic diagram of the structure of a power supply control device for a second server provided in an embodiment of the present application;
[0042] Figure 6 A schematic diagram of the structure of a power control device for a third server provided in an embodiment of the present application;
[0043] Figure 7 A schematic diagram of the structure of a power control device for a fourth server provided in an embodiment of the present application. DETAILED DESCRIPTION
[0044] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0045] The embodiments of the present application provide a power control method, device, equipment and medium for a server, which are used to prevent accidental shutdown of the server caused by accidentally touching the power button, thereby ensuring the stable operation of the server and improving the reliability and stability of the server.
[0046] Among them, the method and the device, equipment, and medium are based on the same application concept. Since the principles of solving problems by the method and the device, equipment, and medium are similar, the implementation of the device, equipment, medium, and method can refer to each other, and the repeated parts will not be repeated.
[0047] The terms "first", "second", etc. (if any) in the specification and claims of the embodiments of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments described herein can be implemented in an order other than the content illustrated or described here. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0048] The following examples and embodiments are to be understood as illustrative examples only. Although this specification may refer to "one", "an" or "some" examples or embodiments in several places, this does not mean that each such reference relates to the same example or embodiment, nor does it mean that the feature applies only to a single example or embodiment. Individual features of different embodiments may also be combined to provide other embodiments. In addition, terms such as "including" and "comprising" should be understood as not limiting the described embodiments to only those features that have been mentioned; such examples and embodiments may also include features, structures, units, modules, etc. that are not specifically mentioned.
[0049] The following is a detailed description of each embodiment of the present application in conjunction with the accompanying drawings. It should be noted that the display order of the embodiments of the present application only represents the order of the embodiments, and does not represent the advantages and disadvantages of the technical solutions provided by the embodiments.
[0050] See also Figure 1 , a power control method of a server provided in an embodiment of the present application includes:
[0051] S101, monitoring a user operation indication signal corresponding to a power button of a target server, wherein the user operation indication signal is used to indicate that a user presses the power button of the target server, or that a user releases the power button of the target server;
[0052] The target server described in the embodiment of the present application may be one or more servers, and there is no restriction on the type of server.
[0053] In some embodiments, the method provided in the embodiments of the present application can be implemented through a baseboard management controller (BMC), that is, by shielding the server power button shutdown through the BMC, it can effectively prevent accidental shutdown events caused by accidental touches, ensure the stable operation of the server, and improve the reliability and stability of the system.
[0054] The user operation indication signal corresponding to the power button of the target server may be any form of signal, used to indicate that the user presses the power button of the target server, or that the user releases the power button of the target server, thereby realizing real-time detection of the pressing and releasing operations of the power button of the target server.
[0055] S102. When the user operation indication signal is monitored and is an indication signal for indicating that the user presses the power button of the target server, determine whether to control the target server to be powered off according to pre-set power control configuration information, wherein the pre-set power control configuration information includes configuration information about a power button shielding function of the target server.
[0056] The preset power control configuration information (also referred to as configuration information) may include configuration information about the power button shielding function of the target server, and of course may also include other configuration information about server power control, which may be configured according to actual needs.
[0057] Furthermore, the configuration information about the power button shielding function of the target server may include the configuration information about the short press shielding function of the power button of the target server, and may also include the configuration information about the long press shielding function of the power button of the target server, and may be specifically configured according to actual needs.
[0058] For example, an administrator (or user) can configure whether the target server enables the short-press shutdown shielding function through a configuration file or an Intelligent Platform Management Interface (IPMI) command, and ensure that the configuration information remains valid after the server is powered off. Among them, IPMI is an open hardware management interface standard. Through the IPMI protocol, users can monitor the physical health characteristics of the server, such as temperature, voltage, fan working status, power status, etc.
[0059] For example, the user can set in the configuration file whether to enable the short-press shutdown shielding function, or dynamically set the server to enable the short-press shutdown shielding function through IPMI instructions.
[0060] In some embodiments, the shielding configuration information about whether to enable the short-press shutdown shielding function for the server can be stored in a persistent storage device, such as an electrically erasable programmable read-only memory (EEPROM), so that each time the server is powered on, the configuration information is read from the storage device, and the BMC decides whether to shield the short-press shutdown function of the server power button based on the configuration information. Among them, EEPROM is a non-volatile memory that can erase existing information and reprogram on a computer or a dedicated device, and can be modified without taking it out of the computer.
[0061] Of course, it should be noted that the embodiments of the present application are not limited to storing the configuration information in the EEPROM. Any type of storage device can be used to store the configuration information. The storage device can be located in the baseboard management controller (Baseboard Management Controller, BMC) or outside the BMC. For example, it can be a hard disk peripheral to the BMC, thereby preventing the loss of configuration files due to power failure of the BMC.
[0062] In some embodiments, the configuration information about the power button shielding function of the target server includes:
[0063] Configuration information about whether a short press shutdown shielding function of the power button of the target server is activated.
[0064] In some embodiments, judging whether to control the target server to be powered off according to the preset power control configuration information includes:
[0065] Reading configuration information about whether a short-press shutdown shielding function of a power button of the target server is activated;
[0066] If the short-press shutdown shielding function of the power button of the target server is in an activated state, starting a preset timer;
[0067] Within the timing duration of the preset timer (for example, 4 seconds), if a user operation indication signal is received that the user releases the power button of the target server, indicating that the current user's operation type for the power button of the server is short press to shut down, the timer is reset (i.e., the timer is reset to zero), and the user operation indication signal corresponding to the power button of the target server continues to be monitored.
[0068] In an embodiment of the present application, the type of key operation can be determined by starting a timer with a preset duration, for example: if a signal that the power button of the server is released is received within the expiration time of the timer, then the type of key operation on the server power button is determined to be a short press; otherwise, the type of key operation on the server power button is determined to be a long press.
[0069] In some embodiments, the determining whether to control the target server to be powered off according to the preset power control configuration information further includes:
[0070] If no user operation indication signal is received during the timing of the preset timer indicating that the user has released the power button of the target server, indicating that the current user's operation type for the power button of the server is long press to shut down, the target server is controlled to perform a forced shutdown operation.
[0071] In some embodiments, the determining whether to control the target server to be powered off according to the preset power control configuration information further includes:
[0072] If the short press shutdown shielding function of the power button of the target server is in the off state, it means that there is currently no need to shield the user operation of the server's power button. In this case, the target server is controlled to perform the shutdown operation according to the user's operation type on the power button of the target server, that is, normal power control is performed without considering the power button shielding function.
[0073] In some embodiments, the user operation indication signal corresponding to the power button of the target server is an interrupt signal sent by a general purpose input output (GPIO) interface of the power button of the target server.
[0074] GPIO is a general-purpose input / output interface that allows users to freely use pins through programming. These pins can be configured as input or output, or support both input and output at the same time as needed.
[0075] For example, when the BMC is started, in order to detect the state change of the server's power button, the GPIO interface connected to the server's power button can be registered as a hardware interrupt and set to edge trigger mode to detect two events: pressing and releasing. Thus, when the user presses the power button, the GPIO pin level changes, triggering a press interrupt signal (i.e., a user operation indication signal for indicating that the user presses the target server's power button); when the user releases the power button, the GPIO pin level changes again, triggering a release interrupt signal (i.e., a user operation indication signal for indicating that the user releases the target server's power button).
[0076] The following takes the short press shielding of the power button of the server as an example to provide an example of a specific process of power control of the server.
[0077] See also Figure 2 , a power control method of a server provided in an embodiment of the present application specifically includes:
[0078] S200, registering the GPIO of the power button of the target server as an interrupt;
[0079] S201, monitoring an interrupt signal sent by a GPIO interface of a power button of a target server;
[0080] S202, reading configuration information about whether a short press shutdown shielding function of a power button of a target server is activated;
[0081] S203, receiving a press interrupt signal sent by the GPIO interface of the power button of the target server;
[0082] That is, a user operation indication signal for indicating that the user presses the power button of the target server is received.
[0083] S204, determining whether the short-press shutdown function of the power button of the target server is shielded, if yes, executing step S205; otherwise, executing step S209;
[0084] That is to say, when a user operation indication signal is monitored, which is an indication signal for indicating that the user presses the power button of the target server, it is determined whether to control the target server to power off based on the pre-set configuration information about the short press shielding function of the power button of the target server.
[0085] S205, start the preset timer;
[0086] That is, if the short-press shutdown shielding function of the power button of the target server is in an activated state, the preset timer is started;
[0087] S206, determining whether a release interrupt signal sent by the GPIO interface of the power button is received before the timer times out, if yes, executing step S208; otherwise, executing step S207;
[0088] That is, if a user operation indication signal is received during the preset timer period that the user releases the power button of the target server, it means that the current user's operation type of the server power button is short press shutdown, which needs to be shielded, that is, there is no need to power off the server, so the timer needs to be reset. Otherwise, if a user operation indication signal is not received during the preset timer period that the user releases the power button of the target server, it means that the current user's operation type of the server power button is long press shutdown, and the target server needs to be controlled to perform a forced shutdown operation.
[0089] S207, controlling the target server to perform a forced shutdown operation;
[0090] S208, resetting the timer;
[0091] And, the process returns to step S201, that is, continues to monitor the user operation indication signal corresponding to the power button of the target server.
[0092] S209: Control the target server to perform a shutdown operation according to the operation type of the power button of the target server by the user.
[0093] And, the process returns to step S201, that is, continues to monitor the user operation indication signal corresponding to the power button of the target server.
[0094] In summary, the embodiment of the present application can implement the power button short press shielding function for the target server through devices such as BMC, and has the following significant effects:
[0095] (1) Improve system flexibility and configurability: The server power button anti-mistouch mode can be flexibly enabled or disabled through, for example, IPMI instructions and configuration files, thus improving the flexibility and efficiency of system management.
[0096] (2) Simplify the difficulty of technical upgrades: Through an out-of-band management system (such as BMC) that is independent of the server hardware, its firmware upgrade is unrelated to the business operation of the server. The out-of-band system can be restarted at any time for upgrade to avoid affecting the server's business.
[0097] (3) No reliance on hardware design: Even if the function is not considered in the initial hardware design, the function can be easily expanded or modified by updating the firmware outside the server, such as the BMC. This not only reduces the risk of hardware revision, but also saves R&D resources and costs.
[0098] (4) Improved compatibility and applicability: It is not dependent on a specific operating system and hardware platform and is suitable for power control of various types of servers and data center environments.
[0099] The following is an introduction to the equipment or device provided in the embodiments of the present application, in which the explanations or examples of technical features that are the same or corresponding to those described in the above method will not be repeated later.
[0100] An electronic device provided in an embodiment of the present application may be, for example, a baseboard management controller (BMC). The BMC is a device independent of a server and capable of remote out-of-band management of the server, including remote management, monitoring, installation, restart, etc. of the server. Figure 3 , the electronic device provided in the embodiment of the present application includes, for example:
[0101] The processor 300 is used to read the program in the memory 320 and execute the following process:
[0102] Monitoring a user operation indication signal corresponding to a power button of a target server, wherein the user operation indication signal is used to indicate that a user presses the power button of the target server, or that a user releases the power button of the target server;
[0103] When the user operation indication signal is monitored and is an indication signal for indicating that the user presses the power button of the target server, it is determined whether to control the target server to be powered off based on pre-set power control configuration information, wherein the pre-set power control configuration information includes configuration information about the power button shielding function of the target server.
[0104] In some embodiments, the configuration information about the power button shielding function of the target server includes:
[0105] Configuration information about whether a short press shutdown shielding function of the power button of the target server is activated.
[0106] In some embodiments, judging whether to control the target server to be powered off according to the preset power control configuration information includes:
[0107] Reading configuration information about whether a short-press shutdown shielding function of a power button of the target server is activated;
[0108] If the short-press shutdown shielding function of the power button of the target server is in an activated state, starting a preset timer;
[0109] If a user operation indication signal indicating that the user has released the power button of the target server is received within the timing duration of the preset timer, the timer is reset and the user operation indication signal corresponding to the power button of the target server is continuously monitored.
[0110] In some embodiments, the determining whether to control the target server to be powered off according to the preset power control configuration information further includes:
[0111] If no user operation indication signal indicating that the user releases the power button of the target server is received within the timing duration of the preset timer, the target server is controlled to perform a forced shutdown operation.
[0112] In some embodiments, the determining whether to control the target server to be powered off according to the preset power control configuration information further includes:
[0113] If the short-press shutdown shielding function of the power button of the target server is in a closed state, the target server is controlled to perform a shutdown operation according to the operation type of the power button of the target server by the user.
[0114] In some embodiments, the user operation indication signal corresponding to the power button of the target server is an interrupt signal issued by a universal input / output interface of the power button of the target server.
[0115] The transceiver 310 is configured to receive and send data under the control of the processor 300 .
[0116] Among them, Figure 3In the embodiment, the bus architecture may include any number of interconnected buses and bridges, specifically one or more processors represented by processor 300 and various circuits of memory represented by memory 320 are linked together. The bus architecture may also link together various other circuits such as peripherals, voltage regulators, and power management circuits, which are well known in the art and are therefore not further described herein. The bus interface provides an interface. The transceiver 310 may be a plurality of components, namely, a transmitter and a receiver, providing a unit for communicating with various other devices on a transmission medium, including wireless channels, wired channels, optical cables, and other transmission media. For different user devices, the user interface 330 may also be an interface capable of externally and internally connecting required devices, and the connected devices include but are not limited to a keypad, a display, a speaker, a microphone, a joystick, and the like.
[0117] The processor 300 is responsible for managing the bus architecture and general processing, and the memory 320 can store data used by the processor 300 when performing operations.
[0118] In some embodiments, the processor 300 may be a CPU (central processing unit), an ASIC (Application Specific Integrated Circuit), an FPGA (Field-Programmable Gate Array) or a CPLD (Complex Programmable Logic Device), and the processor may also adopt a multi-core architecture.
[0119] The processor calls the computer program stored in the memory to execute any of the methods provided in the embodiments of the present application according to the obtained executable instructions. The processor and the memory can also be arranged physically separately.
[0120] It should be noted here that the above-mentioned device provided in the embodiment of the present application can implement all the method steps implemented in the above-mentioned method embodiment, and can achieve the same technical effect. The parts and beneficial effects of this embodiment that are the same as those in the method embodiment will not be described in detail here.
[0121] See also Figure 4 , a power control device for a server provided in an embodiment of the present application includes:
[0122] A power button detection unit 401 is used to monitor a user operation indication signal corresponding to a power button of a target server, wherein the user operation indication signal is used to indicate that a user presses the power button of the target server, or that a user releases the power button of the target server;
[0123] The main function of the power button detection unit 401 is to detect the pressing and releasing operations of the server power button in real time, and then send the operation event to the event judgment unit 402 .
[0124] In some embodiments, the user operation indication signal corresponding to the power button of the target server is an interrupt signal issued by a universal input / output interface of the power button of the target server.
[0125] For example, in order to detect the state change of the power button of the server, the power button detection unit 401 needs to register the GPIO interface connected to the power button of the server as a hardware interrupt at startup and set it to edge trigger mode to detect two events: pressing and releasing. When the user presses the power button, the GPIO pin level changes, triggering a pressing interrupt signal, thereby the power button pressing event is detected by the power button detection unit 401; when the user releases the power button, the GPIO pin level changes again, triggering a releasing interrupt signal, thereby the power button releasing event is detected by the power button detection unit 401.
[0126] The event judgment unit 402 is used to judge whether to control the target server to power off according to pre-set power control configuration information when the user operation indication signal is monitored, which is an indication signal for indicating that the user presses the power button of the target server, wherein the pre-set power control configuration information includes configuration information about the power button shielding function of the target server.
[0127] In some embodiments, the configuration information about the power button shielding function of the target server includes: configuration information about whether the short press shutdown shielding function of the power button of the target server is activated;
[0128] See also Figure 5 , the device further comprises:
[0129] The shielding function configuration unit 501 is used for allowing the user to configure whether the short press shutdown shielding function is activated.
[0130] The shielding function configuration unit 501 allows the administrator to decide whether to enable the short-press shutdown shielding function through a configuration file or an IPMI instruction, and the shielding function configuration unit 501 is still valid after the server is powered off.
[0131] The shielding function configuration unit 501 can set whether to enable the short-press shutdown shielding function in the configuration file, or dynamically set whether to enable the short-press shutdown shielding function through IPMI instructions, and store it in a persistent storage device (such as EEPROM). For example, each time the server is powered on, the shielding configuration is read from the storage device, and it is determined whether to shield the short-press shutdown of the server power button according to the shielding configuration. The shielding function configuration unit 501 will pass the configuration result (configuration information on whether to enable the short-press shutdown shielding function for the server) to the event judgment unit 401.
[0132] In some embodiments, the configuration information about the power button shielding function of the target server includes:
[0133] Configuration information about whether a short press shutdown shielding function of the power button of the target server is activated.
[0134] In some embodiments, judging whether to control the target server to be powered off according to the preset power control configuration information includes:
[0135] Reading configuration information about whether a short-press shutdown shielding function of a power button of the target server is activated;
[0136] If the short-press shutdown shielding function of the power button of the target server is in an activated state, starting a preset timer;
[0137] If a user operation indication signal indicating that the user has released the power button of the target server is received within the timing duration of the preset timer, the timer is reset and the user operation indication signal corresponding to the power button of the target server is continuously monitored.
[0138] In some embodiments, the determining whether to control the target server to be powered off according to the preset power control configuration information further includes:
[0139] If no user operation indication signal indicating that the user releases the power button of the target server is received within the timing duration of the preset timer, the target server is controlled to perform a forced shutdown operation.
[0140] In some embodiments, the determining whether to control the target server to be powered off according to the preset power control configuration information further includes:
[0141] If the short-press shutdown shielding function of the power button of the target server is in a closed state, the target server is controlled to perform a shutdown operation according to the operation type of the power button of the target server by the user.
[0142] In summary, the main function of the event judgment unit 402 is to analyze and judge the key events captured by the power button detection unit 401, and to judge whether a shutdown operation needs to be performed in combination with the shielding configuration of whether the short-press shutdown shielding function is enabled for the server obtained from the shielding function configuration unit 501. Through the event judgment unit 402, the type of key operation on the server power button (short press or long press) can be determined and sent to Figure 6 The event execution unit 601 shown is used to execute related operations.
[0143] For example:
[0144] The event judgment unit 402 first receives a key event sent from the power button detection unit 401. After detecting the interrupt signal of the power button being pressed, it first determines whether the short press shutdown shielding function is enabled for the server by checking the shielding configuration regarding whether the short press shutdown shielding function is enabled for the server.
[0145] If the short press shutdown function is not enabled, then:
[0146] The currently detected interrupt signal of the server power button being pressed can be ignored, and the power button detection unit 401 continues to monitor the interrupt signal corresponding to the server power button, that is, there is no need to control the power off of the server.
[0147] Alternatively, the shielding state (ie, the short-press shutdown shielding function is not enabled for the server) and the key operation type (ie, the type of short press or long press) are directly sent to the event execution unit 601.
[0148] If the short press shutdown function is enabled, then:
[0149] A preset timer is started, the timing time is 4 seconds, for example, and an interrupt signal from the server's power button being released is waited for within the timing time. If an interrupt signal from the power button being released is received within the timing time, the type of the button operation is determined to be a short press. If an interrupt signal from the power button being released is received outside the timing time, the type of the button operation is determined to be a long press.
[0150] Finally, the shielding state and key operation type of the short-press shutdown shielding function enabled for the server are sent to the event execution unit 601 .
[0151] In some embodiments, see Figure 6 , the device further comprises:
[0152] The event execution unit 601 is used to execute corresponding operations according to the analysis result of the event determination unit 402.
[0153] For example, the event execution unit 601 decides whether to execute a shutdown operation on the server based on whether the short press shutdown shielding function is enabled for the server power button and the button operation type (short press or long press) notified by the event judgment unit 401. If the short press shutdown shielding function is not enabled, the short press shutdown button type indication information is sent to the server's operating system, so that the server performs a soft operation of short press shutdown; if the short press shutdown shielding function is enabled and the button operation type is a short press, the event is ignored and the shutdown operation is not executed on the server; if the short press shutdown shielding function is enabled and the button operation type is a long press, the long press shutdown button type indication information is sent to the server, so that the server performs a forced shutdown operation.
[0154] In some embodiments, see Figure 7 , the device further comprises: an event resource cleaning unit 701;
[0155] After the event execution unit 601 completes the operation, it calls the event resource cleaning unit 701 .
[0156] The main function of the event resource cleaning unit 701 is to ensure that system resources are released and cleaned up in time after the event execution unit 601 completes processing of the response to the event judgment unit. The event resource cleaning unit 701 ensures that after each key event is processed, the BMC system can be restored to the initial state (i.e., the timer is reset) to prepare for the next event processing.
[0157] Specifically, for example, after the event execution unit 601 processes the key event, if the event execution unit 601 uses a timer during the processing, the event resource cleaning unit 701 needs to ensure that the timer is reset. After the cleaning operation is completed, the event resource cleaning unit 701 can notify other units of the BMC system that the cleaning operation has been completed and the next round of power button monitoring for the server can be started.
[0158] In addition, the shielding function configuration unit 501 can also be set at the same time Figure 6 , Figure 7 In the structure shown, the details are not repeated.
[0159] It should be noted that the division of units in the embodiments of the present application is schematic and is only a logical function division. There may be other division methods in actual implementation. In addition, each functional unit in each embodiment of the present application may be integrated into a processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0160] If the integrated unit 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 this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) or a processor (processor) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (Read-Only Memory, ROM), random access memory (Random Access Memory, RAM), disk or optical disk and other media that can store program codes.
[0161] Any of the devices or apparatuses provided in the embodiments of the present application may specifically be a desktop computer, a portable computer, a smart phone, a tablet computer, a personal digital assistant (PDA), etc. It may include a central processing unit (CPU), a memory, an input / output device, etc. The input device may include a keyboard, a mouse, a touch screen, etc. The output device may include a display device, such as a liquid crystal display (LCD), a cathode ray tube (CRT), etc.
[0162] The memory may include a read-only memory (ROM) and a random access memory (RAM), and provides the processor with program instructions and data stored in the memory. In an embodiment of the present application, the memory may be used to store the program of any of the methods provided in the embodiments of the present application.
[0163] The processor calls the program instructions stored in the memory, and the processor is used to execute any of the methods provided in the embodiments of the present application according to the obtained program instructions.
[0164] The present application embodiment also provides a computer program product or computer program, which includes a computer instruction, which is stored in a computer-readable storage medium. The processor of the computer device reads the computer instruction from the computer-readable storage medium, and the processor executes the computer instruction so that the computer device executes any of the methods described in the above embodiments. The program product can use any combination of one or more readable media. The readable medium can be a readable signal medium or a readable storage medium. The readable storage medium can be, for example, - but not limited to - an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of readable storage media (non-exhaustive list) include: an electrical connection with one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above.
[0165] The embodiment of the present application provides a computer-readable storage medium for storing computer program instructions used by the apparatus provided in the embodiment of the present application, which includes a program for executing any of the methods provided in the embodiment of the present application. The computer-readable storage medium may be a non-transitory computer-readable medium.
[0166] The computer-readable storage medium can be any available medium or data storage device that can be accessed by a computer, including but not limited to magnetic storage (such as floppy disks, hard disks, magnetic tapes, magneto-optical disks (MO), etc.), optical storage (such as CD, DVD, BD, HVD, etc.), and semiconductor storage (such as ROM, EPROM, EEPROM, non-volatile memory (NANDFLASH), solid-state drive (SSD)), etc.
[0167] It should be understood that:
[0168] The access technology through which entities in the communication network transmit traffic can be any suitable current or future technology, such as WLAN (Wireless Local Access Network), WiMAX (Worldwide Interoperability for Microwave Access), LTE, LTE-A, 5G, Bluetooth, infrared, etc.; in addition, the embodiments can also apply wired technology, for example, IP-based access technology, such as a wired network or a fixed line.
[0169] Embodiments suitable for being implemented as software code or a portion thereof and running using a processor or processing functionality are independent of the software code and may be specified using any known or future developed programming language, such as a high-level programming language such as objective-C, C, C++, C#, Java, Python, Javascript, other scripting languages, etc., or a low-level programming language such as machine language or assembler.
[0170] The implementation of the embodiments is hardware independent and may be implemented using any known or future developed hardware technology or any mixture thereof, such as a microprocessor or CPU (central processing unit), MOS (metal oxide semiconductor), CMOS (complementary MOS), BiMOS (bipolar MOS), BiCMOS (bipolar CMOS), ECL (emitter coupled logic) and / or TTL (transistor-transistor logic).
[0171] Embodiments may be implemented as separate devices, apparatuses, units, components, or functions, or in a distributed manner, for example, one or more processors or processing functions may be used or shared in a process, or one or more processing segments or processing portions may be used and shared in a process, wherein one physical processor or more than one physical processor may be used to implement one or more processing portions dedicated to a specific process as described.
[0172] The device may be implemented by a semiconductor chip, a chipset, or a (hardware) module including such a chip or chipset.
[0173] The embodiments may also be implemented as any combination of hardware and software, such as ASIC (Application Specific IC (Integrated Circuit)) components, FPGA (Field Programmable Gate Array) or CPLD (Complex Programmable Logic Device) components or DSP (Digital Signal Processor) components.
[0174] The embodiments may also be implemented as a computer program product including a computer usable medium having computer readable program code embodied therein, the computer readable program code being adapted to perform the processes as described in the embodiments, wherein the computer usable medium may be a non-transitory medium.
[0175] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage and optical storage, etc.) that contain computer-usable program code.
[0176] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0177] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0178] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0179] Obviously, those skilled in the art can make various changes and modifications to the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is also intended to include these modifications and variations.
Claims
1. A power control method for a server, characterized in that: The method comprises: Monitoring a user operation indication signal corresponding to a power button of a target server, wherein the user operation indication signal is used to indicate that a user presses the power button of the target server, or that a user releases the power button of the target server; When the user operation indication signal is monitored and is an indication signal for indicating that the user presses the power button of the target server, it is determined whether to control the target server to be powered off based on pre-set power control configuration information, wherein the pre-set power control configuration information includes configuration information about the power button shielding function of the target server.
2. The method according to claim 1, characterized in that: The configuration information about the power button shielding function of the target server includes: Configuration information about whether a short press shutdown shielding function of the power button of the target server is activated.
3. The method according to claim 2, characterized in that The determining whether to control the target server to be powered off according to the preset power control configuration information includes: Reading configuration information about whether a short-press shutdown shielding function of a power button of the target server is activated; If the short-press shutdown shielding function of the power button of the target server is in an activated state, starting a preset timer; If a user operation indication signal indicating that the user has released the power button of the target server is received within the timing duration of the preset timer, the timer is reset and the user operation indication signal corresponding to the power button of the target server is continuously monitored.
4. The method according to claim 3, characterized in that: The determining whether to control the target server to be powered off according to the preset power control configuration information further includes: If no user operation indication signal indicating that the user releases the power button of the target server is received within the timing duration of the preset timer, the target server is controlled to perform a forced shutdown operation.
5. The method according to claim 3, characterized in that: The determining whether to control the target server to be powered off according to the preset power control configuration information further includes: If the short-press shutdown shielding function of the power button of the target server is in a closed state, the target server is controlled to perform a shutdown operation according to the operation type of the power button of the target server by the user.
6. The method according to claim 1, characterized in that The user operation indication signal corresponding to the power button of the target server is an interrupt signal sent by the universal input and output interface of the power button of the target server.
7. A power control device for a server, characterized in that: The device comprises: A power button detection unit, used to monitor a user operation indication signal corresponding to a power button of a target server, wherein the user operation indication signal is used to indicate that a user presses the power button of the target server, or that a user releases the power button of the target server; An event judgment unit is used to judge whether to control the target server to power off according to pre-set power control configuration information when the user operation indication signal is monitored, which is an indication signal for indicating that the user presses the power button of the target server, wherein the pre-set power control configuration information includes configuration information about the power button shielding function of the target server.
8. The device according to claim 7, characterized in that The configuration information about the power button shielding function of the target server includes: configuration information about whether the short press shutdown shielding function of the power button of the target server is activated; The device also includes: The shielding function configuration unit is used for allowing the user to configure whether the short press shutdown shielding function is activated.
9. An electronic device, characterized in that: include: A memory for storing program instructions; A processor, configured to call the program instructions stored in the memory, and execute the method according to any one of claims 1 to 7 according to the obtained program.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions, and the computer-executable instructions are used to enable the computer to execute the method according to any one of claims 1 to 7.
Citation Information
Cited By
Power supply control method and device, startup and shutdown management system, server and medium
CN120560485A
Power supply control method, device, power on / off management system, server and medium
CN120560485B