Disclosure of Invention
The application aims to provide a hard disk operation control method, a hard disk operation control device, electronic equipment and a computer readable storage medium, when a hard disk in a current hard disk area is powered on, hard disks in other hard disk areas are not started or are in a low power consumption mode, the temperature in the whole server is lower due to the fact that the hard disk areas are powered on, a fan operates in a low rotating speed mode, the power consumption of the fan is reduced, the whole server is guaranteed to be in the low power consumption mode, the cost is reduced, meanwhile, the fault rate of the hard disks is reduced to a certain extent, and the product quality and the product competitiveness are improved.
In order to solve the above technical problem, the present application provides a hard disk operation control method, including:
dividing all hard disks in a storage server to obtain N hard disk areas, wherein each hard disk area comprises M hard disks, and N and M are positive integers;
when the storage server is started, forbidding all the hard disks to be powered on until the upper-layer software normally runs;
sequentially executing the following operations on each hard disk region through the upper layer software:
controlling each hard disk in the hard disk area to be powered on;
and after the electrification is finished, controlling each hard disk of the hard disk area to operate in a low power consumption mode.
Preferably, the hard disk operation control method further includes:
receiving a user instruction, wherein the user instruction comprises hard disk information;
and awakening the target hard disk corresponding to the hard disk information so as to operate the target hard disk.
Preferably, after controlling each hard disk in the hard disk region to be powered on, the hard disk operation control method further includes:
judging whether each hard disk in the hard disk area is in place;
and if so, judging that the power-on is finished.
Preferably, the process of prohibiting all the hard disks from being powered on specifically includes:
forbidding all the hard disks to be powered on through the CPLD;
correspondingly, the process of controlling the power-on of each hard disk in the hard disk area specifically includes:
and controlling each hard disk in the hard disk area to be powered on through the CPLD.
Preferably, the process of controlling each hard disk of the hard disk area to operate in the low power consumption mode specifically includes:
controlling each hard disk of the hard disk area to operate in a low power consumption mode through an SAS control chip;
correspondingly, the process of waking up the target hard disk corresponding to the hard disk information specifically includes:
and awakening the target hard disk corresponding to the hard disk information through the SAS control chip.
Preferably, the process of dividing all the hard disks in the storage server specifically includes:
acquiring the overall power consumption of the storage server;
and dividing all hard disks in the storage server according to the overall power consumption of the storage server.
In order to solve the above technical problem, the present application further provides a hard disk operation control device, including:
the dividing module is used for dividing all hard disks in the storage server to obtain N hard disk areas, each hard disk area comprises M hard disks, and N and M are positive integers;
the monitoring module is used for forbidding all the hard disks to be electrified when the storage server is started until the upper-layer software normally runs;
a control module, configured to sequentially execute the following operations on each hard disk region through the upper layer software:
controlling each hard disk in the hard disk area to be powered on;
and after the electrification is finished, controlling each hard disk of the hard disk area to operate in a low power consumption mode.
Preferably, the hard disk operation control device further includes:
the receiving module is used for receiving a user instruction, and the user instruction comprises hard disk information;
correspondingly, the control module is further configured to wake up a target hard disk corresponding to the hard disk information, so as to operate the target hard disk.
In order to solve the above technical problem, the present application further provides an electronic device, including:
a memory for storing a computer program;
a processor for implementing the steps of the hard disk operation control method as described in any one of the above items when executing the computer program.
In order to solve the above technical problem, the present application further provides a computer-readable storage medium, on which a computer program is stored, and the computer program, when executed by a processor, implements the steps of the hard disk operation control method according to any one of the above.
The application provides a hard disk operation control method, dividing all hard disks in a storage server into N hard disk regions, when the storage server is started, firstly prohibiting all hard disks from being electrified until upper layer software normally operates so as to electrify the hard disks in the hard disk regions by the upper layer software, after the current hard disk region is electrified, controlling each hard disk in the hard disk regions to be in a low power consumption mode so as to reduce the power consumption of each hard disk in the hard disk region, then electrifying the hard disks in the next hard disk region, ensuring that when the hard disks in the current hard disk region are electrified, the hard disks in other hard disk regions are not started or are in the low power consumption mode, electrifying the hard disk regions so that the temperature in the whole server is lower, and a fan can operate in the low rotating speed mode so as to reduce the power consumption of the fan, further ensuring that the whole server is in the low power consumption mode so as to reduce the cost, the hard disk drive is in a low power consumption mode and is not always in a working state, so that the fault rate of the hard disk drive can be reduced to a certain extent, and the product quality and the product competitiveness are improved. The application also provides a hard disk operation control device, electronic equipment and a computer readable storage medium, and the hard disk operation control device, the electronic equipment and the computer readable storage medium have the same beneficial effects as the hard disk operation control method.
Detailed Description
The core of the application is to provide a hard disk operation control method and device, an electronic device and a computer readable storage medium, when a hard disk in a current hard disk area is powered on, hard disks in other hard disk areas are not started or are in a low power consumption mode, the temperature in the whole server is lower due to the fact that the hard disk areas are powered on, a fan runs in a low rotating speed mode, the power consumption of the fan is reduced, the whole server is guaranteed to be in the low power consumption mode, the cost is reduced, meanwhile, the fault rate of the hard disks is reduced to a certain extent, and the product quality and the product competitiveness are improved.
In order to make the objects, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are some embodiments of the present application, but not all 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 application.
To facilitate understanding of the hard disk operation control method provided by the present application, a system to which the hard disk operation control method is applied is described below, please refer to fig. 1, and fig. 1 is a schematic structural diagram of a hard disk operation control system provided in an embodiment of the present application.
As shown in fig. 1, the hard disk operation control system provided in this embodiment includes a terminal for carrying upper layer software, a CPU/PCH (Platform Controller Hub) 01, a BMC (Baseboard management Controller) 02, a CPLD (Complex Programmable Logic Device) 03, an SAS control chip 04, and the BMC 02 and the CPLD03 are connected through an I2C, the CPU/PCH01 is connected with the SAS control chip 04 through a PCIE (Peripheral Component Interconnect Express, high speed serial computer expansion bus standard), and each output port of the SAS control chip 04 is connected with each hard disk in a one-to-one correspondence. After the upper layer software normally runs, if the hard disk needs to be subjected to power-on/power-off operation, the upper layer software sends an power-on/power-off control command, the power-on/power-off control command is finally sent to the CPLD03 through the CPU/PCH01 and the BMC 02, and the CPLD03 controls the level of an enabling pin of a power control module in the hard disk to control the power-on/power-off of the hard disk. The operation modes of the hard disk include, but are not limited to, a low power consumption mode and a working mode, respectively, the power consumption of the low power consumption mode is lower than that of the working mode, and a mode control command can be output through upper software, and is output to the SAS control chip 04 through the CPU/PCH01, and then is output to the corresponding hard disk through an output port corresponding to the SAS control chip 04, so as to adjust the operation mode of the hard disk.
Referring to fig. 2, fig. 2 is a flowchart illustrating steps of a hard disk operation control method according to the present application, where the hard disk operation control method includes:
s101: dividing all hard disks in a storage server to obtain N hard disk areas, wherein each hard disk area comprises M hard disks, and N and M are positive integers;
specifically, the storage server in this embodiment may specifically refer to a high-density storage server, and when the storage server is collocated with a power supply with relatively low power, in order to avoid the occurrence of a situation that the power supply cannot meet the power requirement for simultaneously powering on all modules at the time of starting up and the work is abnormal, all hard disks in the storage server may be divided according to the parameters of the power supply matched with the storage server to obtain a plurality of hard disk regions, each hard disk region includes M hard disks, and in the starting up process, each hard disk region is powered on to reduce the power consumption. Therefore, the power supply can be matched with various power output power supplies, and the universality is high. As a preferred embodiment, the overall power consumption of the storage server can be firstly obtained, and then all hard disks in the storage server are divided according to the overall power consumption of the storage server, so that the power supply can meet the overall power consumption requirement at the moment of starting the storage server.
Of course, the number of hard disk regions and the number of hard disks in each hard disk region need to be determined according to actual engineering requirements, and the application is not specifically limited.
S102: when the storage server is started, forbidding all hard disks to be powered on until the upper-layer software normally runs;
specifically, when the whole computer is initially started, the CPLD forbids the hard disks of all the hard disk regions from being powered on by default so as to control the hard disks of all the hard disk regions in the following process, only the main board integrated with the CPU, the BMC and other key chips is powered on to access the operating system, and after the upper software runs normally, the hard disk operation is controlled through the upper software.
S103: and sequentially executing the following operations on each hard disk area through upper-layer software:
controlling each hard disk in the hard disk area to be powered on;
and after the electrification is finished, controlling each hard disk of the hard disk area to operate in a low power consumption mode.
Specifically, assuming that hard disks in the hard disk area are divided into a first hard disk area, a second hard disk area, … … and an Nth hard disk area, after upper software normally runs, the CPU notifies the BMC that a hard disk power-on operation can be executed on the first hard disk area, the BMC sends a power-on command to the CPLD through an I2C channel, the CPLD starts to start the first hard disk area after receiving the command, and after the first hard disk area is powered on and run, the upper software can normally identify each hard disk in the first hard disk area, that is, after the upper software can detect in-place signals of each hard disk in the first hard disk area, it is determined that the power-on of the first hard disk area is ended. And the upper layer software sends a deep sleep command to each hard disk in the first hard disk area through the CPU and the SAS control chip, so that the hard disks in the first hard disk area enter deep sleep, namely a low power consumption mode. After the first hard disk area enters the low power consumption mode, the upper layer software informs the BMC through the CPU that the hard disk electrifying operation can be executed on the second hard disk area until all the hard disks are started normally and enter the low power consumption mode, and at the moment, the whole computer is in the low power consumption mode.
It can be seen that, in this embodiment, all hard disks in the storage server are divided into N hard disk regions, when the storage server is powered on, first, power on of all hard disks is prohibited until upper layer software normally operates, so as to power on the hard disks in the hard disk regions in a partitioned manner by the upper layer software, after the power on of the current hard disk region is completed, each hard disk in the hard disk regions is controlled to be in a low power consumption mode to reduce power consumption of each hard disk in the hard disk region, then, the hard disk in the next hard disk region is powered on, so as to ensure that when the hard disk in the current hard disk region is powered on, the hard disks in other hard disk regions are not started or are in the low power consumption mode, the power on of the hard disk partitions makes the temperature in the whole server lower, and the fan can operate in the low rotation speed mode to reduce power consumption of the fan, thereby ensuring that the whole server is, the hard disk drive is not always in a working state, so that the failure rate of the hard disk drive can be reduced to a certain extent, and the product quality and the product competitiveness are improved.
On the basis of the above-described embodiment:
as a preferred embodiment, the hard disk operation control method further includes:
receiving a user instruction, wherein the user instruction comprises hard disk information;
and awakening the target hard disk corresponding to the hard disk information so as to operate the target hard disk.
Specifically, when a customer service is in normal use, if a certain hard disk in a certain hard disk area needs to be read and written, a corresponding user instruction is generated, after the upper-layer software receives the user instruction, the SAS control chip wakes up the specific hard disk, after waking up, the hard disk runs in a working mode, data can be read and written in real time, and other hard disks except the woken up hard disk are still in a low-power-consumption mode, so that the condition that the whole server can also be in the low-power-consumption mode after normal operation is ensured, the power consumption of the whole server is low, a power supply with low cost can be selected, the power consumption cost of a machine room can be saved, and the product competitiveness is.
Referring to fig. 3, fig. 3 is a schematic structural diagram of a hard disk operation control device provided in the present application, including:
the dividing module 11 is configured to divide all hard disks in the storage server to obtain N hard disk areas, where each hard disk area includes M hard disks, and N and M are positive integers;
the monitoring module 12 is used for prohibiting all hard disks from being powered on when the storage server is started up until the upper-layer software normally runs;
the control module 13 is configured to sequentially execute the following operations on each hard disk area through upper layer software:
controlling each hard disk in the hard disk area to be powered on;
and after the electrification is finished, controlling each hard disk of the hard disk area to operate in a low power consumption mode.
It can be seen that, in this embodiment, all hard disks in the storage server are divided into N hard disk regions, when the storage server is powered on, first, power on of all hard disks is prohibited until upper layer software normally operates, so as to power on the hard disks in the hard disk regions in a partitioned manner by the upper layer software, after the power on of the current hard disk region is completed, each hard disk in the hard disk regions is controlled to be in a low power consumption mode to reduce power consumption of each hard disk in the hard disk region, then, the hard disk in the next hard disk region is powered on, so as to ensure that when the hard disk in the current hard disk region is powered on, the hard disks in other hard disk regions are not started or are in the low power consumption mode, the power on of the hard disk partitions makes the temperature in the whole server lower, and the fan can operate in the low rotation speed mode to reduce power consumption of the fan, thereby ensuring that the whole server is, the hard disk drive is not always in a working state, so that the failure rate of the hard disk drive can be reduced to a certain extent, and the product quality and the product competitiveness are improved.
As a preferred embodiment, the hard disk operation control device further includes:
the receiving module is used for receiving a user instruction, and the user instruction comprises hard disk information;
correspondingly, the control module 13 is further configured to wake up the target hard disk corresponding to the hard disk information, so as to operate the target hard disk.
As a preferred embodiment, the hard disk operation control device further includes:
and the judging module is used for judging whether each hard disk in the hard disk area is in place or not, and if so, judging that the electrification is finished.
As a preferred embodiment, the process of prohibiting all hard disks from being powered on specifically includes:
forbidding all hard disks to be electrified through the CPLD;
correspondingly, the process of controlling the power-on of each hard disk in the hard disk area specifically includes:
and controlling the power-on of each hard disk in the hard disk area through the CPLD.
As a preferred embodiment, the process of controlling each hard disk of the hard disk area to operate in the low power consumption mode specifically includes:
controlling each hard disk of the hard disk area to operate in a low power consumption mode through an SAS control chip;
correspondingly, the process of waking up the target hard disk corresponding to the hard disk information specifically includes:
and awakening the target hard disk corresponding to the hard disk information through the SAS control chip.
As a preferred embodiment, the dividing module 11 includes:
the acquisition unit is used for acquiring the overall power consumption of the storage server;
and the dividing unit is used for dividing all hard disks in the storage server according to the overall power consumption of the storage server.
On the other hand, the present application also provides an electronic device, as shown in fig. 4, which shows a schematic structural diagram of an electronic device according to an embodiment of the present application, where the electronic device 2100 according to the embodiment may include: a processor 2101 and a memory 2102.
Optionally, the electronic device may further comprise a communication interface 2103, an input unit 2104 and a display 2105 and a communication bus 2106.
The processor 2101, the memory 2102, the communication interface 2103, the input unit 2104, the display 2105, and the like communicate with each other via the communication bus 2106.
In the embodiment of the present application, the processor 2101 may be a Central Processing Unit (CPU), an application specific integrated circuit (asic), a digital signal processor, an off-the-shelf programmable gate array (fpga) or other programmable logic device (plc).
The processor may call a program stored in the memory 2102. Specifically, the processor may perform operations performed on the electronic device side in the following embodiments of the hard disk operation control method.
The memory 2102 stores one or more programs, which may include program codes including computer operating instructions, and in this embodiment, at least one program for implementing the functions of any of the above embodiments is stored in the memory.
It can be seen that, in this embodiment, all hard disks in the storage server are divided into N hard disk regions, when the storage server is powered on, first, power on of all hard disks is prohibited until upper layer software normally operates, so as to power on the hard disks in the hard disk regions in a partitioned manner by the upper layer software, after the power on of the current hard disk region is completed, each hard disk in the hard disk regions is controlled to be in a low power consumption mode to reduce power consumption of each hard disk in the hard disk region, then, the hard disk in the next hard disk region is powered on, so as to ensure that when the hard disk in the current hard disk region is powered on, the hard disks in other hard disk regions are not started or are in the low power consumption mode, the power on of the hard disk partitions makes the temperature in the whole server lower, and the fan can operate in the low rotation speed mode to reduce power consumption of the fan, thereby ensuring that the whole server is, the hard disk drive is not always in a working state, so that the failure rate of the hard disk drive can be reduced to a certain extent, and the product quality and the product competitiveness are improved.
In one possible implementation, the memory 2102 may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application program required for at least one function (such as a power-on function, etc.), and the like; the storage data area may store data created according to the use of the computer.
Further, the memory 2102 may include high speed random access memory, and may also include non-volatile memory, such as at least one disk storage device or other volatile solid state storage device.
The communication interface 2103 may be an interface of a communication module, such as an interface of a GSM module.
The present application may also include a display 2104 and an input unit 2105, among others.
Of course, the structure of the internet of things device shown in fig. 4 does not constitute a limitation on the internet of things device in the embodiment of the present application, and in practical applications, the electronic device may include more or less components than those shown in fig. 4, or some components in combination.
In another aspect, the present application further provides a computer-readable storage medium, on which a computer program is stored, and the computer program, when executed by a processor, implements the hard disk operation control method as described in any one of the above embodiments.
For the introduction of a computer-readable storage medium provided in the present application, please refer to the above embodiments, which are not described herein again.
The computer-readable storage medium provided by the application has the same beneficial effects as the hard disk operation control method.
It is further 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.
The previous description of the disclosed embodiments is provided to enable any person skilled in the art to make or use the present application. 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 application. Thus, the present application 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.