CN111124094A - Server hard disk power-on and power-off control method, control device and control equipment - Google Patents

Server hard disk power-on and power-off control method, control device and control equipment Download PDF

Info

Publication number
CN111124094A
CN111124094A CN201911332524.XA CN201911332524A CN111124094A CN 111124094 A CN111124094 A CN 111124094A CN 201911332524 A CN201911332524 A CN 201911332524A CN 111124094 A CN111124094 A CN 111124094A
Authority
CN
China
Prior art keywords
hard disk
processed
power
server
hard
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.)
Pending
Application number
CN201911332524.XA
Other languages
Chinese (zh)
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 CN201911332524.XA priority Critical patent/CN111124094A/en
Publication of CN111124094A publication Critical patent/CN111124094A/en
Pending legal-status Critical Current

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
    • G06F1/266Arrangements to supply power to external peripherals either directly from the computer or under computer control, e.g. supply of power through the communication port, computer controlled power-strips

Landscapes

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

Abstract

The invention discloses a method for controlling power-on and power-off of a hard disk of a server, which comprises the steps of presetting a corresponding relation between the type of index information of the hard disk and a calculation rule, calling the calculation rule according to the type of the index information of the hard disk to be processed, calculating position information of the hard disk to be processed according to the index information of the hard disk to be processed, generating a control command according to the position information of the hard disk to be processed and processing content of the hard disk to be processed, and finally writing the control command into a corresponding controller according to the position information of the hard disk to be processed. The invention also discloses a control device, control equipment and a computer readable storage medium for powering on and powering off the server hard disk, and the beneficial effects are achieved.

Description

Server hard disk power-on and power-off control method, control device and control equipment
Technical Field
The invention relates to the technical field of servers, in particular to a method, a device and equipment for controlling power-on and power-off of a server hard disk and a computer readable storage medium.
Background
With the development and progress of server technology, some servers will have tens of large-capacity hard disks for storing a large amount of data, and the power consumption of each hard disk is generally about 12 watts, so that in a data storage server, the power consumption of the hard disk accounts for most of the power consumption of the whole server. In the operation process of the server, if some hard disk fails and cannot be normally used, the failed hard disk needs to be powered off under the premise of not influencing the use of other hard disks, so that the aim of saving energy is fulfilled. After the failed hard disk is replaced, the replacement hard disk needs to be powered on.
The hard disks of the server are disposed on different backplanes, each backplane is provided with a corresponding Controller for performing hard disk Management, such as a Complex Programmable Logic Device (CPLD), and a Baseboard Management Controller (BMC) of the server reads and writes a register for correspondingly controlling the power on and power off of the hard disk in different CPLDs through I2C bus communication, so as to implement the power on and power off of the corresponding hard disk. Because different CPLDs may be on different I2C buses, and each register for controlling the power on and off of the hard disk in different CPLDs controls the power on and off of the hard disk in different slot positions, when controlling the power on and off of one or some hard disks, a worker needs to determine the position of the hard disk through complex calculation, edit a control command, and then use an I2c-test tool to edit the control command to write the control command into the corresponding register in the corresponding CPLD, so that the process not only consumes manpower, but also is easy to make mistakes, and the power on and off of the hard disk fails.
Disclosure of Invention
The invention aims to provide a method, a device and equipment for controlling the power-on and power-off of a server hard disk and a computer readable storage medium, which are used for conveniently and accurately controlling the power-on and power-off of the server hard disk.
In order to solve the technical problem, the invention provides a method for controlling the power on and power off of a server hard disk, which comprises the following steps:
receiving index information of a hard disk to be processed and processing content of the hard disk to be processed;
calling a calculation rule corresponding to the type of the index information, and calculating the position information of the hard disk to be processed according to the index information of the hard disk to be processed;
generating a control command for the hard disk to be processed according to the position information of the hard disk to be processed and the processing content of the hard disk to be processed;
writing a control command for the hard disk to be processed into a controller corresponding to the hard disk to be processed according to the position information of the hard disk to be processed;
wherein, the processing content is power-on processing or power-off processing.
Optionally, the controller is specifically a CPLD.
Optionally, the index information of the hard disk to be processed is specifically a serial number of the hard disk to be processed in a serial number sequence formed by labeling all hard disks of a server where the hard disk to be processed is located from small to large according to a back plate, a number of rows located on the back plate, and a number of columns located on the number of rows;
correspondingly, the calling a calculation rule corresponding to the type of the index information, and calculating the position information of the hard disk to be processed according to the index information of the hard disk to be processed specifically includes:
calculating the total number of the hard disks in each row in all the hard disks of the server;
calculating a first quotient of the serial number of the hard disk to be processed divided by the total number of the hard disks in each row, and rounding up the first quotient to obtain the row number a of the hard disk to be processed;
performing remainder calculation on the serial number of the hard disk to be processed and the total number of the hard disks in each row to obtain the number b of columns of the hard disks to be processed in the whole hard disks;
calculating a second quotient of the number of columns of the hard disks to be processed in the whole hard disks divided by the number of columns of the hard disks on each backboard of the server, and rounding up the second quotient to obtain a serial number c of the backboard where the hard disks to be processed are located;
performing remainder calculation on the number of columns of the hard disks to be processed in the whole hard disks and the number of columns of the hard disks on each backboard of the server to obtain the number d of the columns of the hard disks on the backboard;
and taking the number a of rows of the hard disk to be processed, the serial number c of the backboard of the hard disk to be processed and the number d of columns of the hard disk on the backboard as the position information of the hard disk to be processed.
Optionally, the generating a control command for the to-be-processed hard disk according to the position information of the to-be-processed hard disk and the processing content of the to-be-processed hard disk specifically includes:
when the processing content is the power-on processing, reading first control data in an a-th register of a controller of a c-th backboard of the server, shifting BIT0 of the a-th register to the left by d to obtain second control data, and performing BIT AND operation on the first control data and the second control data to obtain a power-on control command for the hard disk to be processed;
and when the processing content is the power-off processing, reading the first control data, performing left BIT shift d on BIT0 of the a-th register and inverting the BIT shift d to obtain third control data, and performing BIT AND operation on the first control data and the third control data to obtain a power-off control command for the hard disk to be processed.
Optionally, the writing the control command for the hard disk to be processed into the controller corresponding to the hard disk to be processed according to the position information of the hard disk to be processed specifically includes:
writing the control command to an a-th register of a controller of a c-th backplane of the server.
Optionally, the generating a control command for the to-be-processed hard disk according to the position information of the to-be-processed hard disk and the processing content of the to-be-processed hard disk specifically includes:
and generating an IPMI control command for the hard disk to be processed according to the position information of the hard disk to be processed and the processing content of the hard disk to be processed.
Optionally, the method further includes:
and recording the time for receiving the index information of the hard disk to be processed and the processing content of the hard disk to be processed, the index information of the hard disk to be processed and a control command of the hard disk to be processed to a log.
In order to solve the above technical problem, the present invention further provides a device for controlling power on and power off of a server hard disk, including:
the device comprises a receiving unit, a processing unit and a processing unit, wherein the receiving unit is used for receiving index information of a hard disk to be processed and processing contents of the hard disk to be processed;
the computing unit is used for calling a computing rule corresponding to the type of the index information and computing the position information of the hard disk to be processed according to the index information of the hard disk to be processed;
the generating unit is used for generating a control command for the hard disk to be processed according to the position information of the hard disk to be processed and the processing content of the hard disk to be processed;
the writing unit is used for writing a control command of the hard disk to be processed into a controller corresponding to the hard disk to be processed according to the position information of the hard disk to be processed;
wherein, the processing content is power-on processing or power-off processing.
In order to solve the above technical problem, the present invention further provides a device for controlling power on and power off of a hard disk of a server, including:
the memory is used for storing instructions, and the instructions comprise the steps of the power-on and power-off control method of any one of the server hard disks;
a processor to execute the instructions.
In order to solve the above technical problem, the present invention further provides a computer-readable storage medium, on which a computer program is stored, wherein the computer program, when executed by a processor, implements the steps of the method for controlling power on and power off of a hard disk of a server according to any one of the above.
The method for controlling the power-on and power-off of the hard disk of the server, provided by the invention, has the advantages that through presetting the corresponding relation between the type of the index information of the hard disk and the calculation rule, calling a calculation rule according to the type of the index information of the hard disk to be processed, calculating the position information of the hard disk to be processed according to the index information of the hard disk to be processed, generating a control command according to the position information of the hard disk to be processed and the processing content (power-on processing or power-off processing) of the hard disk to be processed, and finally writing the control command into a controller corresponding to the hard disk to be processed according to the position information of the hard disk to be processed, wherein the power-on or power-off control of the hard disk to be processed can be realized by a user only needing to input the index information and the processing content of the hard disk to be processed without complicated calculation, therefore, the operation of the power-on and power-off control of the hard disk is simplified, and the problem of power-on and power-off failure of the hard disk caused by calculation errors of a user is avoided. The invention also provides a control device for powering on and powering off the hard disk of the server, control equipment and a computer readable storage medium, which have the beneficial effects and are not described herein again.
Drawings
In order to more clearly illustrate the embodiments or technical solutions of the present invention, the drawings used in the description of the embodiments or the prior art will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, 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 flowchart of a method for controlling power on and power off of a server hard disk according to an embodiment of the present invention;
fig. 2 is a flowchart illustrating an embodiment of step S102 in fig. 1 according to the present invention;
fig. 3 is a schematic structural diagram of a control device for powering on and powering off a hard disk of a server according to an embodiment of the present invention;
fig. 4 is a schematic structural diagram of a control device for powering on and powering off a hard disk of a server according to an embodiment of the present invention.
Detailed Description
The core of the invention is to provide a control method, a control device, control equipment and a computer readable storage medium for powering on and powering off a server hard disk, which are used for conveniently and accurately powering on and powering off the server hard disk.
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 flowchart of a method for controlling power on and power off of a server hard disk according to an embodiment of the present invention.
As shown in fig. 1, a method for controlling power on and power off of a hard disk of a server according to an embodiment of the present invention includes:
s101: and receiving the index information of the hard disk to be processed and the processing content of the hard disk to be processed.
Wherein, the processing content is power-on processing or power-off processing.
In practical application, the identification information corresponding to the hard disk of the server includes a slot number of the hard disk, disk identifier information allocated to the hard disk, and the like, one of the identification information is selected as index information of the hard disk, and a calculation rule from the index information of the hard disk to position information of the hard disk is established according to the type of the index information. Furthermore, various types of index information can be selected to respectively establish corresponding calculation rules.
In a specific implementation, step S101 may specifically be to receive, on the user interaction interface, the input index information of the hard disk to be processed and the processing content of the hard disk to be processed. Step S101 may also be implemented by communicating with a hard disk failure monitoring process of the server to obtain index information of a failed hard disk that needs to be powered off, and determining that the processing content is power off processing.
S102: and calling a calculation rule corresponding to the type of the index information, and calculating the position information of the hard disk to be processed according to the index information of the hard disk to be processed.
And calling a corresponding calculation rule according to the type of the index information, thereby calculating the position information of the hard disk to be processed according to the index information of the hard disk to be processed.
S103: and generating a control command of the hard disk to be processed according to the position information of the hard disk to be processed and the processing content of the hard disk to be processed.
In the prior art, when a user controls the hard disk to power on and power off, the user needs to calculate the location information of the hard disk and edit a control command to control the hard disk to power on and power off, and usually calls an i2c-test tool provided in the BMC to write the control command into a register of a controller corresponding to the hard disk to be processed. In the scheme, a command for calling the i2c-test tool to write the control command of the hard disk to be processed into the controller can be generated according to the position information of the hard disk to be processed and the processing content of the hard disk to be processed, and in this way, the logic in the BMC needs to be changed more, which is more complex to implement.
Therefore, a better implementation is to set up a script outside the BMC for implementing the above steps. For the convenience of implementation, step S103 is specifically:
and generating an IPMI control command of the hard disk to be processed according to the position information of the hard disk to be processed and the processing content of the hard disk to be processed.
An IPMI (Intelligent Platform Management Interface) is an industrial standard used for managing peripheral devices used in an enterprise system based on an Intel structure, and a user can monitor physical health characteristics of a server, such as temperature, voltage, a fan working state, a power supply state and the like, by using the IPMI, can develop an IPMI command of the user to control and set other device modules on the server, and can perform read-write operation on devices on an I2C bus on a mainboard inside a BMC.
In the embodiment of the invention, the IPMI command is developed, so that the function of automatically controlling the power on and power off of a single hard disk can be realized by only sending one command by a user.
S104: and writing the control command of the hard disk to be processed into the controller corresponding to the hard disk to be processed according to the position information of the hard disk to be processed.
And writing the control command of the hard disk to be processed into a controller corresponding to the hard disk to be processed according to the position information of the hard disk to be processed, wherein the controller is usually a CPLD (complex programmable logic device) and can also be other types of controllers.
Further, the method for controlling power on and power off of the hard disk of the server provided by the embodiment of the present invention further includes:
and recording the time for receiving the index information of the hard disk to be processed and the processing content of the hard disk to be processed, the index information of the hard disk to be processed and the control command of the hard disk to be processed to a log.
The relevant information of the hard disk to be processed is recorded in the log file, so that the power-on and power-off control of the hard disk is well documented.
The method for controlling the power-on and power-off of the hard disk of the server provided by the embodiment of the invention can be used for controlling the power-on and power-off of the hard disk of the server by presetting the corresponding relation between the type of the index information of the hard disk and the calculation rule, calling a calculation rule according to the type of the index information of the hard disk to be processed, calculating the position information of the hard disk to be processed according to the index information of the hard disk to be processed, generating a control command according to the position information of the hard disk to be processed and the processing content (power-on processing or power-off processing) of the hard disk to be processed, and finally writing the control command into a controller corresponding to the hard disk to be processed according to the position information of the hard disk to be processed, wherein the power-on or power-off control of the hard disk to be processed can be realized by a user only needing to input the index information and the processing content of the hard disk to be processed without complicated calculation, therefore, the operation of the power-on and power-off control of the hard disk is simplified, and the problem of power-on and power-off failure of the hard disk caused by calculation errors of a user is avoided.
Fig. 2 is a flowchart illustrating a specific implementation manner of step S102 in fig. 1 according to an embodiment of the present invention.
On the basis of the above embodiments, the method for controlling power on and power off of a hard disk of a server according to the embodiments of the present invention provides a type of index information of the hard disk, so as to facilitate an explanation of an actual application of the present solution.
In the method for controlling power on and power off of the server hard disk provided by the embodiment of the invention, the index information of the hard disk to be processed is specifically the serial number of the hard disk to be processed in the serial number sequence formed by labeling all the hard disks of the server from small to large according to the back plate, the number of rows on the back plate and the number of columns on the number of rows.
Assuming that the server shares N backplanes, and the hard disk array on each backplane is m rows by N columns, each backplane corresponds to a controller on the I2C bus in the server. Taking the controller as a CPLD as an example, the register data of the CPLD is one byte, i.e., 8 bits, and can control the power on and off of 8 hard disks at most, so that n is less than or equal to 8.
In the embodiment of the present invention, the arrangement numbers of the hard disks are as follows:
1 st backboard:
Figure BDA0002330050630000071
2, a back plate:
Figure BDA0002330050630000072
and (3) a back plate:
Figure BDA0002330050630000073
4, a back plate:
Figure BDA0002330050630000074
……
the Nth backboard:
Figure BDA0002330050630000075
correspondingly, the step S102 calls a calculation rule corresponding to the type of the index information, and calculates the position information of the hard disk to be processed according to the index information of the hard disk to be processed, which specifically includes:
s201: and calculating the total number of hard disks in each row in the whole hard disks of the server.
Assuming that the serial number of the hard disks to be processed is k (k is equal to or greater than 1 and equal to or less than m × N), the total number of hard disks in each row in the entire hard disks of the server is ω — N × N according to the above definition.
S202: and calculating a first quotient of the serial number of the hard disk to be processed divided by the total number of the hard disks in each row, and rounding up the first quotient to obtain the row number a of the hard disk to be processed.
Step S202 may be expressed using the formula: a ═ k ÷ ω.
S203: and performing remainder calculation on the serial number of the hard disk to be processed and the total number of the hard disks in each row to obtain the number b of the columns of the hard disks to be processed in the whole hard disk.
Step S203 can be expressed by the formula: b ═ k% ω.
S204: and calculating a second quotient of the number of the columns of the hard disks to be processed in the whole hard disks divided by the number of the columns of the hard disks on each backboard of the server, and rounding up the second quotient to obtain the serial number c of the backboard where the hard disks to be processed are located.
Step S204 can be expressed by the formula: c ═ b ÷ n.
S205: and performing remainder calculation on the number of columns of the hard disks to be processed in the whole hard disks and the number of columns of the hard disks on each backboard of the server to obtain the number d of columns of the hard disks on the backboard.
Step S205 can be expressed by the formula: d ═ b% n.
S206: and taking the number a of the rows of the hard disks to be processed, the serial number c of the back plate where the hard disks to be processed are located and the number d of the columns of the hard disks on the back plate as the position information of the hard disks to be processed.
In the above steps, the order relationship between S202 and S203 may be reversed, and the order relationship between S204 and S205 may be reversed.
On this basis, the step S103 generates a control command for the hard disk to be processed according to the position information of the hard disk to be processed and the processing content of the hard disk to be processed, and specifically includes:
when the processing content is power-on processing, reading first control data in an a-th register of a controller of a c-th backboard of the server, shifting BIT0 of the a-th register by d BITs to the left to obtain second control data, and performing BIT AND operation on the first control data and the second control data to obtain a power-on control command of the hard disk to be processed;
and when the processing content is power-off processing, reading the first control data, shifting the BIT0 of the a-th register to the left by d BITs, inverting the BIT to obtain third control data, and performing BIT AND operation on the first control data and the third control data to obtain a power-off control command of the hard disk to be processed.
In step S104, the control command of the hard disk to be processed is written into the controller corresponding to the hard disk to be processed according to the position information of the hard disk to be processed, which specifically includes:
the control command is written to the a-th register of the controller of the c-th backplane of the server.
On the basis of the embodiment of the present invention, if other arrangement modes or other labeling rules are adopted to set the index information of the hard disk, the calculation rules may be correspondingly set by referring to the modes provided by the embodiment of the present invention, which all belong to the protection scope of the embodiment of the present invention.
On the basis of the above detailed description of the various embodiments corresponding to the control method for powering on and powering off the server hard disk, the invention also discloses a control device, a control device and a computer readable storage medium for powering on and powering off the server hard disk corresponding to the above method.
Fig. 3 is a schematic structural diagram of a control device for powering on and powering off a hard disk of a server according to an embodiment of the present invention.
As shown in fig. 3, the apparatus for controlling power on and power off of a hard disk of a server according to an embodiment of the present invention includes:
a receiving unit 301, configured to receive index information of a hard disk to be processed and processing content of the hard disk to be processed;
a calculating unit 302, configured to invoke a calculation rule corresponding to the type of the index information, and calculate position information of the hard disk to be processed according to the index information of the hard disk to be processed;
a generating unit 303, configured to generate a control command for the hard disk to be processed according to the position information of the hard disk to be processed and the processing content of the hard disk to be processed;
the writing unit 304 is configured to write a control command of the hard disk to be processed into a controller corresponding to the hard disk to be processed according to the position information of the hard disk to be processed;
wherein, the processing content is power-on processing or power-off processing.
Further, the device for controlling power on and power off of the hard disk of the server provided by the embodiment of the present invention further includes:
and the recording unit is used for recording the time for receiving the index information of the hard disk to be processed and the processing content of the hard disk to be processed, the index information of the hard disk to be processed and the control command of the hard disk to be processed to the log.
Since the embodiments of the apparatus portion and the method portion correspond to each other, please refer to the description of the embodiments of the method portion for the embodiments of the apparatus portion, which is not repeated here.
Fig. 4 is a schematic structural diagram of a control device for powering on and powering off a hard disk of a server according to an embodiment of the present invention.
As shown in fig. 4, the apparatus for controlling power on and power off of a hard disk of a server according to an embodiment of the present invention includes:
a memory 410, configured to store instructions, where the instructions include the steps of the method for controlling powering on and powering off a hard disk of a server according to any one of the above embodiments;
a processor 420 for executing the instructions.
Among other things, processor 420 may include one or more processing cores, such as a 3-core processor, an 8-core processor, and so forth. The processor 420 may be implemented in at least one hardware form of a DSP (Digital Signal Processing), an FPGA (Field-Programmable Gate Array), and a PLA (Programmable Logic Array). Processor 420 may also include a main processor and a coprocessor, where the main processor is a processor for processing data in the wake state, and is also called a Central Processing Unit (CPU); a coprocessor is a low power processor for processing data in a standby state. In some embodiments, the processor 420 may be integrated with a GPU (Graphics Processing Unit), which is responsible for rendering and drawing the content that the display screen needs to display. In some embodiments, processor 420 may further include an AI (Artificial Intelligence) processor for processing computational operations related to machine learning.
Memory 410 may include one or more computer-readable storage media, which may be non-transitory. Memory 410 may also include high speed random access memory, as well as non-volatile memory, such as one or more magnetic disk storage devices, flash memory storage devices. In this embodiment, the memory 410 is at least used for storing the following computer program 411, wherein after the computer program 411 is loaded and executed by the processor 420, the relevant steps in the method for controlling the power on and off of the server hard disk disclosed in any of the foregoing embodiments can be implemented. In addition, the resources stored by the memory 410 may also include an operating system 412, data 413, and the like, and the storage may be transient storage or permanent storage. Operating system 412 may be Windows, among others. The data 413 may include, but is not limited to, data involved in the above-described methods.
In some embodiments, the control device for powering on and off the server hard disk may further include a display 430, a power supply 440, a communication interface 450, an input/output interface 460, a sensor 470, and a communication bus 480.
Those skilled in the art will appreciate that the configuration shown in fig. 4 does not constitute a limitation of the control device powering up and down the server hard disk, and may include more or fewer components than those shown.
The control device for powering on and powering off the server hard disk provided by the embodiment of the application comprises the memory and the processor, and the processor can realize the control method for powering on and powering off the server hard disk when executing the program stored in the memory, and the effect is the same as that of the control method for powering on and powering off the server hard disk.
It should be noted that the above-described embodiments of the apparatus and device are merely illustrative, for example, the division of modules is only one division of logical functions, and there may be other divisions when actually implementing, for example, a plurality of modules 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, devices or modules, and may be in an electrical, mechanical or other form. Modules described as separate parts may or may not be physically separate, and parts displayed as modules may or may not be physical modules, may be located in one place, or may be distributed on a plurality of network modules. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the present embodiment.
In addition, functional modules in the embodiments of the present application may be integrated into one processing module, or each of the modules may exist alone physically, or two or more modules are integrated into one module. The integrated module can be realized in a hardware mode, and can also be realized in a software functional module mode.
The integrated module, if implemented in the form of a software functional module and sold or used as a separate product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium and performs all or part of the steps of the methods according to the embodiments of the present invention, or all or part of the technical solution.
To this end, an embodiment of the present invention further provides a computer-readable storage medium, where a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, the computer program implements the steps of the control method for powering on and powering off a hard disk of a server.
The computer-readable storage medium may include: various media capable of storing program codes, 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.
The computer program contained in the computer-readable storage medium provided in this embodiment can implement the steps of the above-described method for controlling power on and power off of the server hard disk when being executed by the processor, and the effects are the same as above.
The above detailed description describes a method, a device and a computer readable storage medium for controlling power on and power off of a server hard disk according to the present invention. The embodiments are described in a progressive manner in the specification, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments are referred to each other. The device, the apparatus and the computer-readable storage medium disclosed in the embodiments correspond to the method disclosed in the embodiments, so that the description is simple, and the relevant points can be referred to the description of the method. It should be noted that, for those skilled in the art, it is possible to make various improvements and modifications to the present invention without departing from the principle of the present invention, and those improvements and modifications also fall within the scope of the claims of the present invention.
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.

Claims (10)

1. A method for controlling power on and power off of a server hard disk is characterized by comprising the following steps:
receiving index information of a hard disk to be processed and processing content of the hard disk to be processed;
calling a calculation rule corresponding to the type of the index information, and calculating the position information of the hard disk to be processed according to the index information of the hard disk to be processed;
generating a control command for the hard disk to be processed according to the position information of the hard disk to be processed and the processing content of the hard disk to be processed;
writing a control command for the hard disk to be processed into a controller corresponding to the hard disk to be processed according to the position information of the hard disk to be processed;
wherein, the processing content is power-on processing or power-off processing.
2. Control method according to claim 1, characterized in that the controller is in particular a CPLD.
3. The control method according to claim 1, wherein the index information of the hard disk to be processed is a serial number of the hard disk to be processed in a serial number sequence formed by labeling all hard disks of a server where the hard disk to be processed is located from small to large according to a back plate, a number of rows located on the back plate, and a number of columns located on the number of rows;
correspondingly, the calling a calculation rule corresponding to the type of the index information, and calculating the position information of the hard disk to be processed according to the index information of the hard disk to be processed specifically includes:
calculating the total number of the hard disks in each row in all the hard disks of the server;
calculating a first quotient of the serial number of the hard disk to be processed divided by the total number of the hard disks in each row, and rounding up the first quotient to obtain the row number a of the hard disk to be processed;
performing remainder calculation on the serial number of the hard disk to be processed and the total number of the hard disks in each row to obtain the number b of columns of the hard disks to be processed in the whole hard disks;
calculating a second quotient of the number of columns of the hard disks to be processed in the whole hard disks divided by the number of columns of the hard disks on each backboard of the server, and rounding up the second quotient to obtain a serial number c of the backboard where the hard disks to be processed are located;
performing remainder calculation on the number of columns of the hard disks to be processed in the whole hard disks and the number of columns of the hard disks on each backboard of the server to obtain the number d of the columns of the hard disks on the backboard;
and taking the number a of rows of the hard disk to be processed, the serial number c of the backboard of the hard disk to be processed and the number d of columns of the hard disk on the backboard as the position information of the hard disk to be processed.
4. The method according to claim 3, wherein the generating of the control command for the to-be-processed hard disk according to the position information of the to-be-processed hard disk and the processing content of the to-be-processed hard disk specifically includes:
when the processing content is the power-on processing, reading first control data in an a-th register of a controller of a c-th backboard of the server, shifting BIT0 of the a-th register to the left by d to obtain second control data, and performing BIT AND operation on the first control data and the second control data to obtain a power-on control command for the hard disk to be processed;
and when the processing content is the power-off processing, reading the first control data, performing left BIT shift d on BIT0 of the a-th register and inverting the BIT shift d to obtain third control data, and performing BIT AND operation on the first control data and the third control data to obtain a power-off control command for the hard disk to be processed.
5. The control method according to claim 3, wherein the writing of the control command for the to-be-processed hard disk into the controller corresponding to the to-be-processed hard disk according to the location information of the to-be-processed hard disk specifically includes:
writing the control command to an a-th register of a controller of a c-th backplane of the server.
6. The control method according to claim 1, wherein the generating of the control command for the to-be-processed hard disk according to the position information of the to-be-processed hard disk and the processing content of the to-be-processed hard disk specifically includes:
and generating an IPMI control command for the hard disk to be processed according to the position information of the hard disk to be processed and the processing content of the hard disk to be processed.
7. The control method according to claim 1, characterized by further comprising:
and recording the time for receiving the index information of the hard disk to be processed and the processing content of the hard disk to be processed, the index information of the hard disk to be processed and a control command of the hard disk to be processed to a log.
8. The utility model provides a controlling means of power on-off of server hard disk which characterized in that includes:
the device comprises a receiving unit, a processing unit and a processing unit, wherein the receiving unit is used for receiving index information of a hard disk to be processed and processing contents of the hard disk to be processed;
the computing unit is used for calling a computing rule corresponding to the type of the index information and computing the position information of the hard disk to be processed according to the index information of the hard disk to be processed;
the generating unit is used for generating a control command for the hard disk to be processed according to the position information of the hard disk to be processed and the processing content of the hard disk to be processed;
the writing unit is used for writing a control command of the hard disk to be processed into a controller corresponding to the hard disk to be processed according to the position information of the hard disk to be processed;
wherein, the processing content is power-on processing or power-off processing.
9. A control device for powering on and powering off a hard disk of a server, comprising:
a memory for storing instructions, the instructions comprising the steps of the method for controlling the power on and off of the server hard disk according to any one of claims 1 to 7;
a processor to execute the instructions.
10. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the steps of the method for controlling powering on and off a server hard disk according to any one of claims 1 to 7.
CN201911332524.XA 2019-12-22 2019-12-22 Server hard disk power-on and power-off control method, control device and control equipment Pending CN111124094A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911332524.XA CN111124094A (en) 2019-12-22 2019-12-22 Server hard disk power-on and power-off control method, control device and control equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911332524.XA CN111124094A (en) 2019-12-22 2019-12-22 Server hard disk power-on and power-off control method, control device and control equipment

Publications (1)

Publication Number Publication Date
CN111124094A true CN111124094A (en) 2020-05-08

Family

ID=70500904

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911332524.XA Pending CN111124094A (en) 2019-12-22 2019-12-22 Server hard disk power-on and power-off control method, control device and control equipment

Country Status (1)

Country Link
CN (1) CN111124094A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112269347A (en) * 2020-12-24 2021-01-26 深圳市鼎阳科技股份有限公司 Power-on and power-off time sequence control device
CN113835505A (en) * 2021-08-16 2021-12-24 苏州浪潮智能科技有限公司 System and method for controlling server hard disk to power on and off in batches
CN116302844A (en) * 2023-05-16 2023-06-23 苏州浪潮智能科技有限公司 Method and device for acquiring hard disk information, computer equipment and storage medium

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109116962A (en) * 2018-08-15 2019-01-01 郑州云海信息技术有限公司 A kind of method and system controlling hard disk power-on and power-off by I2C using BMC
CN109240869A (en) * 2018-09-21 2019-01-18 郑州云海信息技术有限公司 A kind of method and apparatus of determining target hard disk backboard
CN110502376A (en) * 2019-07-18 2019-11-26 苏州浪潮智能科技有限公司 A kind of hard disk electric test method and device up and down

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109116962A (en) * 2018-08-15 2019-01-01 郑州云海信息技术有限公司 A kind of method and system controlling hard disk power-on and power-off by I2C using BMC
CN109240869A (en) * 2018-09-21 2019-01-18 郑州云海信息技术有限公司 A kind of method and apparatus of determining target hard disk backboard
CN110502376A (en) * 2019-07-18 2019-11-26 苏州浪潮智能科技有限公司 A kind of hard disk electric test method and device up and down

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112269347A (en) * 2020-12-24 2021-01-26 深圳市鼎阳科技股份有限公司 Power-on and power-off time sequence control device
CN112269347B (en) * 2020-12-24 2021-03-16 深圳市鼎阳科技股份有限公司 Power-on and power-off time sequence control device
CN113835505A (en) * 2021-08-16 2021-12-24 苏州浪潮智能科技有限公司 System and method for controlling server hard disk to power on and off in batches
CN113835505B (en) * 2021-08-16 2023-06-16 苏州浪潮智能科技有限公司 Control system and method for batch powering-on and powering-off of server hard disk
CN116302844A (en) * 2023-05-16 2023-06-23 苏州浪潮智能科技有限公司 Method and device for acquiring hard disk information, computer equipment and storage medium
CN116302844B (en) * 2023-05-16 2023-08-08 苏州浪潮智能科技有限公司 Method and device for acquiring hard disk information, computer equipment and storage medium

Similar Documents

Publication Publication Date Title
CN111124094A (en) Server hard disk power-on and power-off control method, control device and control equipment
CN109683696A (en) Fault of server power supply detection system, method, apparatus, equipment and medium
CN103995577B (en) The maximum working voltage of dynamic control processor
CN102057344A (en) Sleep processor
US20160267883A1 (en) Technologies for low-power standby display refresh
CN111142644A (en) Hard disk operation control method and device and related components
CN104781794A (en) In-place change between transient and persistent state for data structures in non-volatile memory
CN104156234A (en) Multi-core processor starting and bootloader big-little endian mode adapting method device
CN103403689A (en) Resource failure management method, device and system
CN104932933A (en) Spin lock acquisition method and apparatus
WO2024103829A1 (en) Port configuration method, component, and hard disk expansion apparatus
CN104424122A (en) Electronic equipment and memory dividing method
CN113672340A (en) Incremental backup method, system and device of virtual machine and readable storage medium
CN110704334B (en) Method, system and equipment for important product data management
US11150886B2 (en) Automatic probabilistic upgrade of tenant devices
CN109117418A (en) A kind of programmable system on chip
CN105739982A (en) System hibernation method and apparatus
CN103927215A (en) kvm virtual machine scheduling optimization method and system based on memory disk and SSD disk
US8806254B2 (en) System and method for creating and dynamically maintaining system power inventories
CN109901664A (en) Method, apparatus, system, equipment and the readable storage medium storing program for executing of clock signal are provided
CN114995770B (en) Data processing method, device, equipment, system and readable storage medium
CN109542351B (en) Power consumption control method of solid state disk and solid state disk
US20230143568A1 (en) Intelligent table suggestion and conversion for text
CN115756322A (en) Data storage method and device, electronic equipment and storage medium
US11119921B1 (en) State machine generation for multi-buffer electronic systems

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
RJ01 Rejection of invention patent application after publication

Application publication date: 20200508

RJ01 Rejection of invention patent application after publication