Disclosure of Invention
The invention aims to provide a server power-on method, a system, a device and a medium, which can flexibly control the number of the power-on electronic devices according to the utilization rate of the electronic devices, thereby avoiding all the electronic devices from being in a power-on state, further avoiding unnecessary energy consumption and avoiding energy waste.
In order to solve the technical problem, the invention provides a server power-on method, which is applied to a processor in a server, wherein the server comprises N electronic devices; the method comprises the following steps:
when a power-on instruction is received, controlling M electronic devices to be powered on;
obtaining the utilization rates of M electronic devices;
judging whether the utilization rates are all larger than a first preset utilization rate;
if yes, selecting Z electronic devices from the unpowered electronic devices, and controlling the selected Z electronic devices to be powered on;
n is more than M and more than or equal to 1, N-M is more than or equal to Z and more than or equal to 1, and N, M and Z are integers.
Preferably, after controlling the M electronic devices to be powered on, the method further includes:
updating an advanced configuration and power management interface (ACPI) table to adjust power-on states of M electronic devices in the ACPI table.
Preferably, after controlling the power-on of the selected Z electronic devices, the method further includes:
and updating the ACPI table to adjust the power-on states of the Z electronic devices in the ACPI table.
Preferably, when the server is a one-way server, the electronic device is a memory bank; and when the server is a multi-path server, the electronic device is a Central Processing Unit (CPU).
Preferably, the server is a multi-path server, the electronic device is a CPU, and each CPU is correspondingly configured with a number a of the memory banks;
when a power-on instruction is received, after M electronic devices are controlled to be powered on, the method further comprises the following steps:
controlling the power-on of the i memory banks corresponding to each powered-on CPU;
after obtaining the utilization rates of the M electronic devices, the method further includes:
acquiring the utilization rate of i memory banks corresponding to each powered-on CPU;
after judging whether the utilization rates are all greater than a first preset utilization rate, the method further comprises the following steps:
judging whether the utilization rate of the i memory banks corresponding to each powered-on CPU is greater than a second preset utilization rate or not;
if the utilization rate of the i memory banks corresponding to the powered CPU is greater than the second preset utilization rate, selecting j memory banks from the unpowered memory banks correspondingly configured to the CPU, and controlling the selected j memory banks to be powered on;
a is more than i and more than or equal to 1, A-i is more than or equal to j and more than or equal to 1, and A, i and j are integers.
Preferably, after controlling the power-on of the selected Z electronic devices, the method further includes:
acquiring the number of the electronic devices which are not electrified;
and if the number is zero, sending first prompt information.
Preferably, after the sending of the first prompt message, the method further includes:
acquiring the utilization rates of all the electronic devices, and judging whether the utilization rates of all the electronic devices are greater than the first preset utilization rate;
and if so, sending second prompt information.
In order to solve the technical problem, the invention also provides a server power-on system which is applied to a processor in the server, wherein the server comprises N electronic devices; the system comprises:
the first power-on unit is used for controlling the M electronic devices to be powered on when a power-on instruction is received;
the acquisition unit is used for acquiring the utilization rates of the M electronic devices;
the judging unit is used for judging whether the utilization rates are all larger than a first preset utilization rate;
the second electrifying unit is used for selecting Z electronic devices from the unpowered electronic devices and controlling the selected Z electronic devices to be electrified when the utilization rates are all larger than the first preset utilization rate;
n is more than M and more than or equal to 1, N-M is more than or equal to Z and more than or equal to 1, and N, M and Z are integers.
In order to solve the above technical problem, the present invention further provides a server power-on device, including:
a memory for storing a computer program;
and the processor is used for realizing the server power-on method when executing the computer program.
In order to solve the above technical problem, the present invention further provides a computer-readable storage medium, where a computer program is stored, and when the computer program is executed by a processor, the steps of the server power-on method are implemented.
The application provides a server power-on method, a system, a device and a medium, when a server is powered on, a control part of electronic devices are powered on, when the utilization rate of the powered-on electronic devices reaches a first preset utilization rate or above, the powered-on electronic devices are judged to be possibly insufficient to meet the requirements of users, and at the moment, a plurality of electronic devices are selected from the unpowered electronic devices to be powered on so as to meet the requirements of the users. Therefore, the number of the electronic devices electrified can be flexibly controlled according to the utilization rate of the electronic devices, so that all the electronic devices can be prevented from being in an electrified state, unnecessary energy consumption is avoided, and energy waste is avoided. .
Detailed Description
The core of the invention is to provide a server power-on method, system, device and medium, which can flexibly control the number of the power-on electronic devices according to the utilization rate of the electronic devices, thereby avoiding all the electronic devices from being in a power-on state, further avoiding unnecessary energy consumption and avoiding energy waste.
In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer, 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 some, but not all, embodiments of the present invention. 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.
Referring to fig. 1, fig. 1 is a schematic flowchart of a server power-on method provided by the present invention, where the method is applied to a processor in a server, and the server includes N electronic devices; the method comprises the following steps:
s11: when a power-on instruction is received, controlling the M electronic devices to be powered on;
s12: obtaining the utilization rates of M electronic devices;
s13: judging whether the utilization rates are all larger than a first preset utilization rate;
s14: if yes, selecting Z electronic devices from the unpowered electronic devices, and controlling the selected Z electronic devices to be powered on;
n is more than M and more than or equal to 1, N-M is more than or equal to Z and more than or equal to 1, and N, M and Z are integers.
In consideration of the fact that the power-on mode of the server in the prior art is to control all the electronic devices to be powered on, when the load of the server is low, energy waste may be caused.
In order to solve the technical problem, the design idea of the application is as follows: the number of the electrified electronic devices is controlled according to the requirements of the user, so that the situation that when the user requirements are less (namely, the load connected with the server is lower), the unused electronic devices are also in a running state is avoided, and the energy waste is further avoided.
Based on this, when receiving a power-on instruction, the server in the application controls part of the electronic devices to be powered on (M) first, so that part of the electronic devices execute tasks of a user and the like, and then judges the utilization rate of all the powered-on electronic devices; when the utilization rates of all the electronic devices are greater than the first preset utilization rate, it is determined that the M electronic devices which are powered on are about to fail to meet the requirements of the user, or the risks of low operation speed and the like may exist, at this time, a plurality of (Z) electronic devices are selected from the electronic devices which are not powered on, and the power-on of the electronic devices is controlled to meet the requirements of the user, or the operation speed is increased.
Wherein, the first preset utilization rate may be but not limited to 50%, M and N may be but not limited to 1, and when M and N are both 1, the scheme at this time is: when the server is powered on, one electronic device is controlled to be powered on, and when the utilization rate of the electronic device is more than 50%, the other electronic device is controlled to be powered on, and the like.
It should be noted that the electronic device in the present application may be a CPU or a memory bank in a server. Specifically, when the server is a one-way server, the one-way server includes a CPU and a plurality of memory banks, and the electronic device at this time is a memory bank; when the server is a multi-path server, the multi-path server comprises a plurality of CPUs, each CPU is correspondingly provided with one or more memory banks, and the electronic device at the moment is the CPU. The specific implementation of the electronic device is not limited to the above implementation, and other implementations are also possible, and the present application is not limited thereto.
In conclusion, the number of the electronic devices electrified can be flexibly controlled according to the utilization rate of the electronic devices, so that all the electronic devices can be prevented from being in an electrified state, unnecessary energy consumption is avoided, and energy waste is avoided.
On the basis of the above-described embodiment:
as a preferred embodiment, after controlling the M electronic devices to be powered on, the method further includes:
and updating the ACPI table of the advanced configuration and power management interface to adjust the power-on states of the M electronic devices in the ACPI table.
Specifically, the ACPI table is a corresponding relationship in the server that records the configuration of each interface in the server, and after the control electronic device is powered on, the configuration of the interface corresponding to the electronic device changes, so that after the control electronic device is powered on, the ACPI table needs to be updated, so that the ACPI table can reflect the state of each interface in the server interface in real time, and a user can know the state of the interface of the server according to the ACPI table.
As a preferred embodiment, after controlling the power on of the selected Z electronic devices, the method further includes:
and updating the ACPI table to adjust the power-on states of the Z electronic devices in the ACPI table.
Similarly, after controlling the Z electronic devices to be powered on, the ACPI tables are also updated to update the status of each interface in the server in real time.
As a preferred embodiment, the server is a multi-channel server, the electronic device is a CPU, and each CPU is correspondingly configured with a memory banks;
when a power-on instruction is received, after the M electronic devices are controlled to be powered on, the method further comprises the following steps:
controlling the power-on of i memory banks corresponding to each powered-on CPU;
after obtaining the utilization rates of the M electronic devices, the method further includes:
acquiring the utilization rate of i memory banks corresponding to each powered-on CPU;
after judging whether the utilization ratio all is greater than first predetermined utilization ratio, still include:
judging whether the utilization rate of i memory banks corresponding to each powered-on CPU is greater than a second preset utilization rate;
if the utilization rate of i memory banks corresponding to the powered-on CPU is greater than a second preset utilization rate, selecting j memory banks from unpowered memory banks correspondingly configured to the CPU, and controlling the selected j memory banks to be powered on;
a is more than i and more than or equal to 1, A-i is more than or equal to j and more than or equal to 1, and A, i and j are integers.
Specifically, when the server is a multi-path server, that is, the server includes a plurality of CPUs, and each CPU corresponds to a plurality of memory banks. The power-on control of the server at this time may specifically be: and controlling M CPUs in the multi-path server to be powered on, controlling each CPU in the M CPUs, selecting i memory banks from A corresponding memory banks to be powered on, then judging the utilization rate of the memory banks, selecting j memory banks from the A-i memory banks when the utilization rate is greater than a second preset utilization rate, and controlling the j memory banks to be powered on.
The first preset utilization rate and the second preset utilization rate may be equal to or unequal to each other, and the specific application is not limited herein.
In a preferred embodiment, the second predetermined utilization rate is also 50%.
Specifically, for example, M, Z, i and j are both 1, when the server is powered on, the first CPU is first controlled to be powered on and the first memory bank corresponding to the first CPU is powered on, when the utilization rate of the memory bank corresponding to the first CPU is greater than the second preset utilization rate, the second memory bank corresponding to the first CPU is controlled to be powered on, and so on until the first memory bank is powered on. In the process, the utilization rate of the first CPU is detected simultaneously, when the utilization rate of the first CPU is larger than a first preset utilization rate, the second CPU and the first memory bank corresponding to the second CPU are controlled to be powered on, and so on until all the CPUs and all the memory banks are powered on.
Therefore, by means of the method and the system, not only can the multiple CPUs in the multi-path server be powered on, but also the memory banks corresponding to the CPUs can be powered on, and energy consumption of the multi-path server is further reduced.
As a preferred embodiment, after controlling the power on of the selected Z electronic devices, the method further includes:
acquiring the number of the electronic devices which are not electrified;
and if the number is zero, sending first prompt information.
In order to facilitate a user to know the utilization condition of the electronic devices in the server, when all the electronic devices are powered on, namely when the number of the electronic devices which are not powered on is zero, first prompt information is sent to prompt all the electronic devices to finish the power on, which means that the utilization ratio of the electronic devices in the server reaches a certain degree, at the moment, the user is prompted through the first prompt information, and after the user knows the working state of each electronic device in the server, the task amount issued to the server and the like can be considered.
As a preferred embodiment, after issuing the first prompt message, the method further includes:
acquiring the utilization rates of all electronic devices, and judging whether the utilization rates of all electronic devices are greater than a first preset utilization rate or not;
and if so, sending second prompt information.
Similarly, after all the electronic devices are powered on, the utilization rates of all the electronic devices are also obtained, when the utilization rates of all the electronic devices are greater than the first preset utilization rate, the workload of the electronic devices in the specification server reaches a certain degree, at this time, the server may be stuck or the task execution speed is slow, and at this time, second prompt information is sent to the user, so that the user adjusts the task volume or other processing of the server based on the second prompt information.
In addition, as a preferred embodiment, when an unused electronic device is detected in the powered electronic devices, that is, when an electronic device with a zero utilization rate exists, the electronic device with the zero utilization rate is controlled to be powered down, so as to save energy. Therefore, the power-on and power-off modes of the electronic device are more flexible through the embodiment.
Referring to fig. 2, fig. 2 is a block diagram of a power-on system of a server according to the present invention, the system is applied to a processor in the server, and the server includes N electronic devices; the system comprises:
the first power-on unit 21 is used for controlling the M electronic devices to be powered on when receiving a power-on instruction;
an obtaining unit 22 for obtaining utilization rates of the M electronic devices;
the judging unit 23 is configured to judge whether the utilization rates are all greater than a first preset utilization rate;
the second electrifying unit 24 is configured to select Z electronic devices from the unpowered electronic devices and control the selected Z electronic devices to be electrified when the utilization rates are all greater than the first preset utilization rate;
n is more than M and more than or equal to 1, N-M is more than or equal to Z and more than or equal to 1, and N, M and Z are integers.
For the introduction of the server power-on system, please refer to the above embodiments, which are not described herein again.
Referring to fig. 3, fig. 3 is a block diagram of a power-on device for a server according to the present invention, the power-on device includes:
a memory 31 for storing a computer program;
the processor 32 is configured to implement the server power-on method described above when executing the computer program.
When the processor in the present application includes an OS (operating System), a BIOS (Basic Input Output System), a BMC (base Management Controller), and a CPLD (Complex Programmable logic device) in the server, the execution process may specifically be: (1) when the server is started and needs to be powered on, the CPLD controls M electronic devices to be powered on (a CPU or a memory bank), and the rest memory banks are not powered on; (2) the BIOS scans the information of the electronic device, refreshes an ACPI table, and feeds back the ACPI table to the OS, and the OS starts according to the fed-back information of the electronic device; (3) the OS starts a monitoring program, monitors the utilization rate of the electronic device, and feeds back an operation instruction to the BMC (baseboard Management controller) through an IPMI (Intelligent Platform Management Interface) when the utilization rate is greater than a first preset utilization rate, and the BMC powers on the electronic device through the CPLD; (4) and the BIOS detects that the hardware resource changes, updates the ACPI table and feeds back the ACPI table to the OS.
When the server in the present application is a single-path server, the server may be, but is not limited to, an INTEL server or a single-path soar server. And when M is 1, but not limited to, powering on the memory bank with the slot position of 0 when starting up, and then sequentially controlling the powering on of the memory banks with the slot position of 1 and the slot position of 2 … with the slot position of N-1 according to the utilization rate.
In the step (2), before the BIOS reloads the OS, a timing task is started, that is, the utilization rate of the memory bank is detected once every long time, and when the time interval is short, real-time detection can be understood. And in the step (3), the OS feeds back the operation instruction to the BMC through the IPMI, the BMC sends the instruction for starting the memory bank to the CPLD through the GPIO simulation I2C, and then the CPLD powers on other memory banks. A physical link LPC (linear predictive coding) bus exists between the OS and the BMC, and the OS can directly issue a command to the BMC through the bus, where a communication command between the OS and the BMC is assumed to be impioollraw 0x3e 0x 20. When the electronic device is a CPU, that is, the server is a multi-path server, the communication command between the OS and the BMC is assumed to be impioollraw 0x3e 0x2f, the BMC and the CPLD use GPIO (General-purpose input/output) for communication, the GPIO is used to simulate an I2C signal and define an interface specification of I2C, 8 bits in total are 0x1, one bit corresponds to one CPU, 1 represents start, when the second CPU is started, the BMC sends 00000010 to the CPLD, the CPLD powers on the second CPU, and so on. 9
For other descriptions of the server power-on device, please refer to the above embodiments, which are not described herein again.
A computer-readable storage medium, on which a computer program is stored, which, when executed by a processor, implements the steps of the server power-on method described above.
It is to be noted that, in the present specification, relational terms such as first and second, and the like are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
Those of skill would further appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware, computer software, or combinations of both, and that the various illustrative components and steps have been described above generally in terms of their functionality in order to clearly illustrate this interchangeability of hardware and software. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present invention.
The previous description of the disclosed embodiments is provided to enable any person skilled in the art to make or use the present invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the invention. Thus, the present invention is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.