CN112230753B - ARM server power key shutdown method, system, terminal and storage medium - Google Patents

ARM server power key shutdown method, system, terminal and storage medium Download PDF

Info

Publication number
CN112230753B
CN112230753B CN202011109873.8A CN202011109873A CN112230753B CN 112230753 B CN112230753 B CN 112230753B CN 202011109873 A CN202011109873 A CN 202011109873A CN 112230753 B CN112230753 B CN 112230753B
Authority
CN
China
Prior art keywords
power key
monitoring event
shutdown
event
state
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202011109873.8A
Other languages
Chinese (zh)
Other versions
CN112230753A (en
Inventor
孙秀强
黄家明
乔英良
班华堂
李道童
王兵
李勋堂
艾山彬
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Suzhou Inspur Intelligent Technology Co Ltd
Original Assignee
Suzhou Inspur Intelligent Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Suzhou Inspur Intelligent Technology Co Ltd filed Critical Suzhou Inspur Intelligent Technology Co Ltd
Priority to CN202011109873.8A priority Critical patent/CN112230753B/en
Publication of CN112230753A publication Critical patent/CN112230753A/en
Application granted granted Critical
Publication of CN112230753B publication Critical patent/CN112230753B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F1/00Details not covered by groups G06F3/00 - G06F13/00 and G06F21/00
    • G06F1/26Power supply means, e.g. regulation thereof
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F1/00Details not covered by groups G06F3/00 - G06F13/00 and G06F21/00
    • G06F1/26Power supply means, e.g. regulation thereof
    • G06F1/32Means for saving power
    • G06F1/3203Power management, i.e. event-based initiation of a power-saving mode
    • G06F1/3206Monitoring of events, devices or parameters that trigger a change in power modality

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Power Sources (AREA)

Abstract

The invention provides a method, a system, a terminal and a storage medium for shutting down a power key of an ARM server, comprising the following steps: creating a monitoring event in the basic input and output system code; starting the monitoring event to monitor the state of the power key at the starting stage of the ARM server; and if the power key is in the short-press state through the monitoring event, calling a shutdown control function through the unified extensible firmware interface, and sending a shutdown instruction to the processing chip by the shutdown control function. The invention ensures that the BIOS realizes the power supply short-time shutdown function under setup and shell environments, and the realization of the function is beneficial to the ARM server to provide great convenience for the requirement of shutdown of equipment in research, development, operation and maintenance stages and also saves time loss.

Description

ARM server power key shutdown method, system, terminal and storage medium
Technical Field
The invention relates to the technical field of ARM servers, in particular to a method, a system, a terminal and a storage medium for powering off a power key of an ARM server.
Background
The power supply Powerbutton key plays a significant role in any electronic consumer product, and the power supply key is required to realize rapid operation in startup, shutdown and restart of equipment, and is particularly important in the field of servers of data centers. More than 90% of the power key functions of the servers of the global data center are defaulted to realize the startup and shutdown actions of the servers through a GPD3_ PWRBTN _ N signal of a PCH, when the power key is pressed down for a short time, namely the startup and shutdown actions are triggered, when the system is powered down, SCI interruption triggers the system kernel to perform soft shutdown actions, and when the power key is pressed down for a long time, namely the key pressing time is more than 4S, the hardware shutdown actions are triggered. When the server is in a non-operating System, a power key is pressed for a short time to trigger a System shutdown function, and the triggering mechanism at the moment triggers an SMI (System Management Interrupt) Interrupt mechanism by the BIOS according to a GPD3_ PWRBTN _ N signal, wherein the SMI Interrupt mechanism adopts a hardware Interrupt mechanism principle that the power key generates a hardware Interrupt to trigger an SMM program (System Management Mode) of the BIOS internal SMI Interrupt when pressed for a short time, the CPU needs to enter the System Management Mode in advance when the SMM program is executed, a specific operation flow is that the CPU needs a memory area SMRAM, the value of the register is stored in the SMRAM before the CPU enters the SMM, the program is jumped to SMI ENY POINT to be executed, the RSM instruction is jumped back to the original place to be executed after the processing is finished, and the value of the CPU register is restored. And after the server power supply key is pressed for a short time, the SMM program writes a shutdown value to the CPU internal register through the IO port to perform shutdown action.
For an ARM (Advanced RISC Machine) server, an SMI interrupt type is not present and is not supported in the BIOS firmware of the ARM server, so that the ARM server cannot be powered off by pressing a power key for a short time at present, which causes inconvenience in operation of the ARM server.
Disclosure of Invention
In view of the above-mentioned deficiencies of the prior art, the present invention provides a method, a system, a terminal and a storage medium for powering off an ARM server power key, so as to solve the above-mentioned technical problems.
In a first aspect, the present invention provides a method for powering off an ARM server power key, including:
creating a monitoring event in the basic input and output system code;
starting the monitoring event to monitor the state of the power key at the starting stage of the ARM server;
and if the power key is in the short-press state through the monitoring event, calling a shutdown control function through the unified extensible firmware interface, and sending a shutdown instruction to the processing chip by the shutdown control function.
Further, the creating of the monitoring event in the basic input and output system code includes:
setting the high level of a power key as a normal state and the low level of the power key as a pressed state in the monitoring event;
setting a timer in the monitoring event, wherein the timer starts to time when the power key is switched from a high level to a low level;
and setting a time threshold value in the monitoring event, and if the timing time of the timer does not exceed the time threshold value, determining that the power key is in a short-press state.
Further, the method further comprises:
and the timer in the monitoring time stops timing when the power key is converted from the low level to the high level, and outputs the timing time.
Further, the method for sending the shutdown instruction to the processing chip by the shutdown control function includes:
the shutdown control function acquires a shutdown instruction of a power management interaction protocol;
and the shutdown control function sends the shutdown instruction to a processing chip, and the processing chip executes the shutdown instruction.
Further, the method further comprises:
and after the ARM server enters an operating system from a starting stage, closing the monitoring event.
In a second aspect, the present invention provides an ARM server power key shutdown system, including:
an event creating unit configured to create a monitoring event in the bios code;
the event starting unit is configured to start the monitoring event to monitor the state of the power key at the starting stage of the ARM server;
and the shutdown execution unit is configured to call a shutdown control function through the unified extensible firmware interface if the power key is monitored to be in the short-press state through the monitoring event, and the shutdown control function sends a shutdown instruction to the processing chip.
Further, the event creating unit includes:
the state limiting module is configured to set the high level of the power key to be in a normal state and the low level of the power key to be in a pressed state in the monitoring event;
the timing setting module is configured to set a timer in the monitoring event, and the timer starts timing when the power key is converted from a high level to a low level;
and the time setting module is configured to set a time threshold value in the monitoring event, and if the timing time of the timer does not exceed the time threshold value, the power key is determined to be in a short-press state.
Further, the system further comprises:
and the event closing unit is configured to close the monitoring event after the ARM server enters the operating system from a starting stage.
In a third aspect, a terminal is provided, including:
a processor, a memory, wherein,
the memory is used for storing a computer program which,
the processor is used for calling and running the computer program from the memory so as to make the terminal execute the method of the terminal.
In a fourth aspect, a computer storage medium is provided having stored therein instructions that, when executed on a computer, cause the computer to perform the method of the above aspects.
The beneficial effect of the invention is that,
the method, the SYSTEM, the terminal and the storage medium for shutting down the power key of the ARM server provided by the invention have the advantages that the SYSTEM is shut down by creating an Event of the power key which is pressed for a short time, judging whether the power key is pressed for a short time to trigger or not by judging the state value of the power key and the condition that the timing time of a time timer is less than 3s, and executing a PSCI _ SYSTEM _ OFF instruction of a PSCI protocol of an ARM framework through an SMC function after triggering. The invention ensures that the BIOS realizes the power supply short-time shutdown function under setup and shell environments, and the realization of the function is beneficial to the ARM server to provide great convenience for the requirement of shutdown of equipment in research, development, operation and maintenance stages and also saves time loss.
In addition, the invention has reliable design principle, simple structure and very wide application prospect.
Drawings
In order to more clearly illustrate the embodiments or technical solutions in the prior art of the present invention, the drawings used in the description of the embodiments or prior art will be briefly described below, and it is obvious for those skilled in the art that other drawings can be obtained based on these drawings without creative efforts.
FIG. 1 is a schematic flow diagram of a method of one embodiment of the present invention.
FIG. 2 is a schematic block diagram of a system of one embodiment of the present invention.
Fig. 3 is a schematic structural diagram of a terminal according to an embodiment of the present invention.
Detailed Description
In order to make those skilled in the art better understand the technical solutions of the present invention, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
FIG. 1 is a schematic flow diagram of a method of one embodiment of the invention. The execution main body in fig. 1 may be an ARM server power key shutdown system.
As shown in fig. 1, the method includes:
step 110, creating a monitoring event in the basic input and output system code;
step 120, at the starting stage of the ARM server, starting the monitoring event to monitor the state of the power key;
step 130, if the power key is in the short-press state through the monitoring event, calling a shutdown control function through the unified extensible firmware interface, and sending a shutdown instruction to the processing chip by the shutdown control function.
In order to facilitate understanding of the present invention, the power key shutdown method of the ARM server provided by the present invention is further described below by using the principle of the power key shutdown method of the ARM server of the present invention and combining the process of performing power key shutdown on the ARM server in the embodiment.
Specifically, the method for powering off the power key of the ARM server comprises the following steps:
s1, creating a monitoring event in the basic input and output system code.
An Event monitoring Event is created in the BIOS code, and judgment is carried out by reading the state value of the power key in the Event monitoring Event, the high level of the default power key is in a normal state, and the low level of the default power key is in a pressed state. The timer starts to time when the power key level is changed from high level to low level, stops timing when the power key level is changed from low level to high level, and outputs the timing time. And if the time counted by the timer is less than 3s, the power key is considered to be pressed down for a short time.
And S2, starting the monitoring event to monitor the state of the power key at the starting stage of the ARM server.
And after the ARM is electrified, the ARM enters a starting stage, and a monitoring event is started in the starting stage to monitor the state of the power key.
And S3, if the power key is in the short-press state through the monitoring event, calling a shutdown control function through the unified extensible firmware interface, and sending a shutdown instruction to a processing chip by the shutdown control function.
When the power button of the monitoring event is in a short-press state, an SMC function (shutdown control function) is called through UEFI (unified extensible firmware interface), the SMC function transmits a shutdown instruction of a PSCI (power management interaction protocol), namely PSCI _ SYSTEM _ OFF, to a CPU, and the CPU executes the PSCI _ SYSTEM _ OFF instruction, so that the shutdown function of the SYSTEM under a setup interface and a Shell of the BIOS is realized.
S4, declaring the power supply short-time shutdown Event after the power supply short-time shutdown Event monitoring Event is established: because the Event does not need to be used for short-press shutdown under the OS system, the Event monitoring Event is closed when the ARM server exits the BootService service phase (service starting phase), so that the function of power supply short-press shutdown under a setup interface and a Shell of the BIOS is integrally realized.
As shown in fig. 2, the system 200 includes:
an event creating unit 210 configured to create a monitoring event in the bios code;
the event starting unit 220 is configured to start the monitoring event to monitor the state of the power key at the starting stage of the ARM server;
and a shutdown execution unit 230 configured to, if it is monitored that the power key is in a short-press state through the monitoring event, call a shutdown control function through the unified extensible firmware interface, where the shutdown control function sends a shutdown instruction to the processing chip.
Optionally, as an embodiment of the present invention, the event creating unit includes:
the state limiting module is configured to set the high level of the power key to be in a normal state and the low level of the power key to be in a pressed state in the monitoring event;
the timing setting module is configured for setting a timer in the monitoring event, and the timer starts timing when the power key is converted from a high level to a low level;
and the time setting module is configured to set a time threshold in the monitoring event, and if the timing time of the timer does not exceed the time threshold, the power key is determined to be in a short-press state.
Optionally, as an embodiment of the present invention, the system further includes:
and the event closing unit is configured to close the monitoring event after the ARM server enters the operating system from a starting stage.
Fig. 3 is a schematic structural diagram of a terminal 300 according to an embodiment of the present invention, where the terminal 300 may be configured to execute a method for powering off an ARM server power key according to the embodiment of the present invention.
Among them, the terminal 300 may include: a processor 310, a memory 320, and a communication unit 330. The components communicate via one or more buses, and those skilled in the art will appreciate that the architecture of the servers shown in the figures is not intended to be limiting, and may be a bus architecture, a star architecture, a combination of more or less components than those shown, or a different arrangement of components.
The memory 320 may be used for storing instructions executed by the processor 310, and the memory 320 may be implemented by any type of volatile or non-volatile storage terminal or combination thereof, such as Static Random Access Memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk. The executable instructions in memory 320, when executed by processor 310, enable terminal 300 to perform some or all of the steps in the method embodiments described below.
The processor 310 is a control center of the storage terminal, connects various parts of the entire electronic terminal using various interfaces and lines, and performs various functions of the electronic terminal and/or processes data by operating or executing software programs and/or modules stored in the memory 320 and calling data stored in the memory. The processor may be composed of an Integrated Circuit (IC), for example, a single packaged IC, or a plurality of packaged ICs connected with the same or different functions. For example, the processor 310 may include only a Central Processing Unit (CPU). In the embodiment of the present invention, the CPU may be a single operation core, or may include multiple operation cores.
A communication unit 330, configured to establish a communication channel so that the storage terminal can communicate with other terminals. And receiving user data sent by other terminals or sending the user data to other terminals.
The present invention also provides a computer storage medium, wherein the computer storage medium may store a program, and the program may include some or all of the steps in the embodiments provided by the present invention when executed. The storage medium may be a magnetic disk, an optical disk, a read-only memory (ROM) or a Random Access Memory (RAM).
Therefore, the invention establishes an Event of the power supply short-time press key, judges whether the power supply key is triggered by short press by judging the condition that the state value of the power supply key and the timing time of the time timer are less than 3s, and executes a PSCI _ SYSTEM _ OFF instruction of a PSCI protocol of an ARM framework through an SMC function to realize SYSTEM shutdown. The invention ensures that the BIOS realizes the power supply short-time shutdown function under setup and shell environments, the realization of the function is beneficial to an ARM server to provide great convenience conditions for the requirement of equipment shutdown in research, development, operation and maintenance stages and also saves time loss, and the technical effect which can not exceed the effect of the embodiment can be referred to the description above, and is not described herein again.
Those skilled in the art will readily appreciate that the techniques of the embodiments of the present invention may be implemented as software plus a required general purpose hardware platform. Based on such understanding, the technical solutions in the embodiments of the present invention may be substantially or partially embodied in the form of a software product, the computer software product is stored in a storage medium, such as a usb disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and various media capable of storing program codes include several instructions for enabling a computer terminal (which may be a personal computer, a server, or a second terminal, a network terminal, etc.) to execute all or part of the steps of the method in the embodiments of the present invention.
The same and similar parts among the various embodiments in this specification may be referred to each other. Especially, for the terminal embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant points can be referred to the description in the method embodiment.
In the embodiments provided in the present invention, it should be understood that the disclosed system and method can be implemented in other ways. For example, the above-described system embodiments are merely illustrative, and for example, the division of the units is only one logical functional division, and other divisions may be realized in practice, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, systems or units, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit.
Although the present invention has been described in detail in connection with the preferred embodiments with reference to the accompanying drawings, the present invention is not limited thereto. Various equivalent modifications or substitutions can be made on the embodiments of the present invention by those skilled in the art without departing from the spirit and scope of the present invention, and these modifications or substitutions are within the scope of the present invention/any person skilled in the art can easily conceive of the changes or substitutions within the technical scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.

Claims (8)

1. A method for powering off an ARM server power key is characterized by comprising the following steps:
creating a monitoring event in the basic input and output system code;
starting the monitoring event to monitor the state of the power key at the starting stage of the ARM server;
if the power key is in the short-press state through the monitoring event, calling a shutdown control function through a unified extensible firmware interface, and sending a shutdown instruction to a processing chip by the shutdown control function;
the creating of the monitoring event in the basic input and output system code comprises:
setting the high level of a power key as a normal state and the low level of the power key as a pressed state in the monitoring event;
setting a timer in the monitoring event, wherein the timer starts to time when the power key is switched from a high level to a low level;
and setting a time threshold value in the monitoring event, and if the timing time of the timer does not exceed the time threshold value, determining that the power key is in a short-press state.
2. The method of claim 1, further comprising:
and setting a timer in the monitoring event to stop timing when the power key is converted from the low level to the high level, and outputting timing time.
3. The method of claim 1, wherein the shutdown control function is configured to send a shutdown instruction to the processing chip, and comprises:
the shutdown control function acquires a shutdown instruction of a power management interaction protocol;
and the shutdown control function sends the shutdown instruction to a processing chip, and the processing chip executes the shutdown instruction.
4. The method of claim 1, further comprising:
and after the ARM server enters an operating system from a starting stage, closing the monitoring event.
5. An ARM server power key shutdown system, comprising:
an event creating unit configured to create a monitoring event in the bios code;
the event starting unit is configured to start the monitoring event to monitor the state of the power key at the starting stage of the ARM server;
the shutdown execution unit is configured to call a shutdown control function through the unified extensible firmware interface if the power key is monitored to be in a short-press state through the monitoring event, and the shutdown control function sends a shutdown instruction to the processing chip;
the event creation unit includes:
the state limiting module is configured to set the high level of the power key to be in a normal state and the low level of the power key to be in a pressed state in the monitoring event;
the timing setting module is configured to set a timer in the monitoring event, and the timer starts timing when the power key is converted from a high level to a low level;
and the time setting module is configured to set a time threshold value in the monitoring event, and if the timing time of the timer does not exceed the time threshold value, the power key is determined to be in a short-press state.
6. The system of claim 5, further comprising:
and the event closing unit is configured to close the monitoring event after the ARM server enters the operating system from the starting stage.
7. A terminal, comprising:
a processor;
a memory for storing instructions for execution by the processor;
wherein the processor is configured to perform the method of any one of claims 1-4.
8. A computer-readable storage medium, in which a computer program is stored which, when being executed by a processor, carries out the method according to any one of claims 1-4.
CN202011109873.8A 2020-10-16 2020-10-16 ARM server power key shutdown method, system, terminal and storage medium Active CN112230753B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011109873.8A CN112230753B (en) 2020-10-16 2020-10-16 ARM server power key shutdown method, system, terminal and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011109873.8A CN112230753B (en) 2020-10-16 2020-10-16 ARM server power key shutdown method, system, terminal and storage medium

Publications (2)

Publication Number Publication Date
CN112230753A CN112230753A (en) 2021-01-15
CN112230753B true CN112230753B (en) 2022-11-11

Family

ID=74117627

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011109873.8A Active CN112230753B (en) 2020-10-16 2020-10-16 ARM server power key shutdown method, system, terminal and storage medium

Country Status (1)

Country Link
CN (1) CN112230753B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113572687B (en) * 2021-07-22 2022-11-15 无锡江南计算技术研究所 High-order router self-adaptive parallel starting method based on event-driven mechanism

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103473087A (en) * 2013-08-30 2013-12-25 福建升腾资讯有限公司 Startup control method for software-operated startup and shutdown in multitask systems

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103473087A (en) * 2013-08-30 2013-12-25 福建升腾资讯有限公司 Startup control method for software-operated startup and shutdown in multitask systems

Also Published As

Publication number Publication date
CN112230753A (en) 2021-01-15

Similar Documents

Publication Publication Date Title
US20240086269A1 (en) Method, Apparatus and System for Locating Fault of Server, and Computer-readable Storage Medium
CN103425506B (en) Closedown method and starting-up method and communication terminal
CN101814035B (en) Method and system to enable fast platform restart
CN102103406B (en) The network event process that operating system is irrelevant
CN111683287B (en) Intelligent device starting method and device, intelligent device and readable storage medium
JPH0887362A (en) Power management processor for suspend system
CN111736906A (en) BIOS-based boot entry synchronous storage method, system, terminal and storage medium
CN112463239A (en) BIOS and BMC interaction option default value modification method, system, terminal and storage medium
CN114116280A (en) Interactive BMC self-recovery method, system, terminal and storage medium
JPH11288334A (en) Method and device for power down for computer system
CN112230753B (en) ARM server power key shutdown method, system, terminal and storage medium
CN215769715U (en) Recovery device for abnormal starting
CN113608930B (en) System chip and electronic device
CN109582505B (en) BIOS option default value recovery system, method and device
CN114116276A (en) BMC hang-up self-recovery method, system, terminal and storage medium
CN102567178A (en) Electronic device and method for informing remaining electricity and starting method thereof
CN112463508B (en) Server dormancy state testing method, system, terminal and storage medium
CN114416483A (en) Running state monitoring method and device for multi-processing unit, storage medium and equipment
CN113900855A (en) Active hot start method, system and device for abnormal state of switch
CN112035295A (en) Virtual machine crash event processing method, system, terminal and storage medium
CN112462922B (en) Fan energy-saving control method, system, terminal and storage medium
CN104142870A (en) Virtual BIOS (basic input /output system) booting system and virtual BIOS booting method
CN114443446B (en) Hard disk indicator lamp control method, system, terminal and storage medium
CN114116306B (en) Data backup method, system, terminal and storage medium under power failure of disk array
CN114816023B (en) Method, system, terminal and storage medium for optimizing standby power function of server

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant