Disclosure of Invention
The embodiment of the application provides a method, a device and a system for monitoring a hard disk, which can solve the problem of inaccurate monitoring of state information of the hard disk.
In a first aspect, an embodiment of the present application provides a method for monitoring a hard disk, including:
The method comprises the steps of obtaining SGPIO signals and state information of a hard disk to be detected, wherein the SGPIO signals comprise SCLK signals, SLOAD signals and SDATAOUT signals;
when the SCLK signal, SLOAD signal, and SDATAOUT signal meet a first preset condition, the status information is sent to a BMC (Baseboard Manager Controller, baseboard management controller).
In a possible implementation manner of the first aspect, the first preset condition includes:
The SCLK signal, SLOAD signal, and SDATAOUT signal satisfy a first state, and a duration of the first state reaches a first preset time, the first state being that at least one high level signal and one low level signal are present in the SCLK signal, SLOAD signal, and SDATAOUT signal.
In a possible implementation manner of the first aspect, the status information includes operation information, in-place information and dislocation information of the hard disk to be tested.
In a possible implementation manner of the first aspect, the hard disk monitoring method further includes:
and when the SCLK signal, SLOAD signal and SDATAOUT signal meet a second state, and the duration of the second state reaches a second preset time, prohibiting the state information from being sent to the BMC, wherein the second state is that the SCLK signal, SLOAD signal and SDATAOUT signal are all high level signals.
In a possible implementation manner of the first aspect, the hard disk monitoring method further includes:
acquiring a reset signal sent by the BMC, wherein the reset signal is a signal sent by the BMC when the state information is received and the hard disk to be tested is determined to be faulty according to the state information;
And controlling the hard disk to be tested to restart according to the reset signal.
In a second aspect, an embodiment of the present application provides a hard disk monitoring device, including:
The first acquisition module is used for acquiring SGPIO signals and state information of the hard disk to be detected, wherein the SGPIO signals comprise SCLK signals, SLOAD signals and SDATAOUT signals;
And the sending module is used for sending the state information to the BMC when the SCLK signal, the SLOAD signal and the SDATAOUT signal meet a first preset condition.
In a possible implementation manner of the second aspect, the first preset condition includes:
The SCLK signal, SLOAD signal, and SDATAOUT signal satisfy a first state, and a duration of the first state reaches a first preset time, the first state being that at least one high level signal and one low level signal are present in the SCLK signal, SLOAD signal, and SDATAOUT signal.
In a possible implementation manner of the second aspect, the hard disk monitoring device further includes:
The second acquisition module is used for acquiring a reset signal sent by the BMC, wherein the reset signal is a signal sent by the BMC when the state information is received and the hard disk to be tested is determined to be faulty according to the state information;
and the control module is used for controlling the hard disk to be tested to restart according to the reset signal.
In a third aspect, an embodiment of the present application provides a hard disk monitoring system, including a CPLD (Complex Programmable Logic Device ) and a BMC, where the CPLD performs the method of any one of the first aspects.
In a fourth aspect, embodiments of the present application provide a computer readable storage medium storing a computer program which, when executed by a processor, implements the method of any one of the first aspects.
In a fifth aspect, an embodiment of the application provides a computer program product for, when run on a terminal device, causing the terminal device to perform the method of any of the first aspects described above.
Compared with the prior art, the embodiment of the application has the beneficial effects that:
And acquiring SGPIO signals and state information of the hard disk to be tested, wherein the SGPIO signals comprise SCLK signals, SLOAD signals and SDATAOUT signals. When the SCLK signal, SLOAD signal and SDATAOUT signal meet a first preset condition, the hard disk to be tested is in a stable state, and state information of the hard disk to be tested in the stable state is sent to the BMC. According to the hard disk monitoring method provided by the embodiment of the application, through analyzing the signals, the accuracy of determining whether the hard disk to be monitored is in a stable state is improved, the state information of the hard disk to be monitored is ensured to be transmitted to the BMC when the hard disk to be monitored works stably, and the BMC monitors the state of the hard disk to be monitored according to the state information, so that the accuracy of monitoring the hard disk to be monitored is improved.
It will be appreciated that the advantages of the second to fifth aspects may be found in the relevant description of the first aspect, and are not described here again.
Detailed Description
In the following description, for purposes of explanation and not limitation, specific details are set forth such as the particular system architecture, techniques, etc., in order to provide a thorough understanding of the embodiments of the present application. It will be apparent, however, to one skilled in the art that the present application may be practiced in other embodiments that depart from these specific details. In other instances, detailed descriptions of well-known systems, devices, circuits, and methods are omitted so as not to obscure the description of the present application with unnecessary detail.
It should be understood that the terms "comprises" and/or "comprising," when used in this specification and the appended claims, specify the presence of stated features, integers, steps, operations, elements, and/or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and/or groups thereof.
It should also be understood that the term "and/or" as used in the present specification and the appended claims refers to any and all possible combinations of one or more of the associated listed items, and includes such combinations.
As used in the present description and the appended claims, the term "if" may be interpreted as "when..once" or "in response to a determination" or "in response to detection" depending on the context. Similarly, the phrase "if a determination" or "if a [ described condition or event ] is detected" may be interpreted in the context of meaning "upon determination" or "in response to determination" or "upon detection of a [ described condition or event ]" or "in response to detection of a [ described condition or event ]".
Furthermore, the terms "first," "second," "third," and the like in the description of the present specification and in the appended claims, are used for distinguishing between descriptions and not necessarily for indicating or implying a relative importance.
Reference in the specification to "one embodiment" or "some embodiments" or the like means that a particular feature, structure, or characteristic described in connection with the embodiment is included in one or more embodiments of the application. Thus, appearances of the phrases "in one embodiment," "in some embodiments," "in other embodiments," and the like in the specification are not necessarily all referring to the same embodiment, but mean "one or more but not all embodiments" unless expressly specified otherwise. The terms "comprising," "including," "having," and variations thereof mean "including but not limited to," unless expressly specified otherwise.
Fig. 1 is a schematic diagram of a hard disk monitoring system according to an embodiment of the application. Referring to fig. 1, the hard disk monitoring system includes a CPLD and a BMC, where the CPLD obtains an SGPIO signal and status information of a hard disk to be tested, where the SGPIO signal includes an SCLK signal, a SLOAD signal, and a SDATAOUT signal. When the SCLK signal, SLOAD signal and SDATAOUT signal meet a first preset condition, the hard disk to be tested is in a stable state, and the CPLD sends state information to the BMC. The BMC analyzes the state information to monitor the state of the hard disk to be tested, and the state information received by the BMC is a signal acquired by the CPLD when the hard disk to be tested is stable, so that the state information can truly reflect the working state of the hard disk to be tested, and the accuracy of monitoring the state of the hard disk to be tested is improved.
It should be noted that, a plurality of hard disks to be tested are installed on the backboard, and the CPLD can obtain SGPIO signals and state information of the hard disks to be tested through the backboard. The CPLD and the BMC can be in wireless communication, so that the CPLD can acquire the state information of the hard disk to be tested on site, and send the state information to the remote BMC, and the effect of the BMC in remote monitoring of the hard disk to be tested is realized.
Fig. 2 is a flow chart illustrating a method for monitoring a hard disk according to an embodiment of the application. Referring to fig. 2, the hard disk monitoring method includes steps S201 and S202.
Step S201, an SGPIO signal and status information of the hard disk to be tested are obtained, where the SGPIO signal includes an SCLK signal, a SLOAD signal and a SDATAOUT signal.
Specifically, a plurality of hard disks to be tested are installed on the backboard, and the CPLD can acquire SGPIO signals and state information of the hard disks to be tested through the backboard.
The state information includes operation information, presence information and dislocation information of the hard disk to be tested. The BMC can analyze according to the operation information, the in-place information and the dislocation information, and monitor the state information of the hard disk to be tested.
In step S202, when the SCLK signal, SLOAD signal, and SDATAOUT signal satisfy the first preset condition, the status information is sent to the BMC.
Specifically, when the SCLK signal, the SLOAD signal and the SDATAOUT signal satisfy the first preset condition, it is indicated that the hard disk to be tested is in a stable running state at this time, and the state information acquired by the CPLD can accurately reflect the working state of the hard disk to be tested. The CPLD sends the state information to the BMC, and the BMC can realize accurate monitoring of the hard disk to be tested according to the state information. According to the hard disk monitoring method provided by the embodiment of the application, through analyzing the signals, the accuracy of determining whether the hard disk to be monitored is in a stable state is improved, the state information of the hard disk to be monitored is ensured to be transmitted to the BMC when the hard disk to be monitored works stably, and the BMC monitors the state of the hard disk to be monitored according to the state information, so that the accuracy of monitoring the hard disk to be monitored is improved.
Exemplary, the first preset condition includes: the SCLK signal, SLOAD signal, and SDATAOUT signal satisfy a first state, and the duration of the first state reaches a first preset time, where at least one high level signal and one low level signal are present in the SCLK signal, SLOAD signal, and SDATAOUT signal.
Specifically, when the device is turned on, the SCLK signal, SLOAD signal, and SDATAOUT signal of the hard disk to be tested are all high level signals. When the hard disk to be tested runs stably, the SCLK signal, SLOAD signal and SDATAOUT signal can be frequently switched between a high-level state and a low-level state, so that information interaction with the CPLD is realized. Therefore, when the hard disk to be tested is in the stable working state, the SCLK signal, the SLOAD signal and the SDATAOUT signal cannot be in the high level state all the time, the SCLK signal, the SLOAD signal and the SDATAOUT signal meet the first state (at least one high level signal and one low level signal exist in the SCLK signal, the SLOAD signal and the SDATAOUT signal), and when the duration of the first state reaches the first preset time, the hard disk to be tested is in the working state of stable operation.
It should be noted that, a designer may set a specific value of the first preset time according to an actual situation.
In one embodiment of the present application, the hard disk monitoring method further includes step S203.
In step S203, when the SCLK signal, the SLOAD signal, and the SDATAOUT signal satisfy the second state and the duration of the second state reaches the second preset time, the transmission of the state information to the BMC is prohibited, and the second state is that the SCLK signal, the SLOAD signal, and the SDATAOUT signal are all high level signals.
Specifically, when the SCLK signal, the SLOAD signal and the SDATAOUT signal satisfy the second state and the duration of the second state reaches the second preset time, the hard disk to be tested is in an unstable state at this time, the state information at this time cannot truly reflect the working state of the hard disk to be tested, and the CPLD prohibits sending the state information to the BMC.
It should be noted that, the designer may set a specific value of the second preset time according to the actual situation.
Fig. 3 is a schematic flow chart of a method for monitoring a hard disk according to another embodiment of the present application. Referring to fig. 3, the hard disk monitoring method further includes step S301 and step S302.
Step S301, a reset signal sent by the BMC is obtained, wherein the reset signal is a signal sent by the BMC when the state information is received and the hard disk to be tested is determined to be faulty according to the state information.
Specifically, the BMC may determine whether the hard disk to be tested has a fault by analyzing the state information of the hard disk to be tested, and when the BMC determines that the hard disk to be tested has a fault, the BMC sends a reset signal to the CPLD.
Step S302, the hard disk to be tested is controlled to restart according to the reset signal.
Specifically, after the CPLD receives the reset signal, the hard disk to be tested is controlled to restart, so that the hard disk to be tested automatically removes faults.
It should be understood that the sequence number of each step in the foregoing embodiment does not mean that the execution sequence of each process should be determined by the function and the internal logic, and should not limit the implementation process of the embodiment of the present application.
Fig. 4 shows a schematic structural diagram of a hard disk monitoring device according to an embodiment of the present application. Referring to fig. 4, the hard disk monitoring device includes:
The first obtaining module 41 is configured to obtain an SGPIO signal and status information of a hard disk to be tested, where the SGPIO signal includes an SCLK signal, a SLOAD signal, and a SDATAOUT signal;
And a sending module 42, configured to send the status information to the BMC when the SCLK signal, the SLOAD signal, and the SDATAOUT signal satisfy a first preset condition.
In one embodiment of the present application, the first preset condition includes:
The SCLK signal, SLOAD signal, and SDATAOUT signal satisfy a first state, and a duration of the first state reaches a first preset time, the first state being that at least one high level signal and one low level signal are present in the SCLK signal, SLOAD signal, and SDATAOUT signal.
In one embodiment of the present application, the status information includes operation information, in-place information and dislocation information of the hard disk to be tested.
In one embodiment of the present application, the hard disk monitoring device further includes:
The second acquisition module is used for acquiring a reset signal sent by the BMC, wherein the reset signal is a signal sent by the BMC when the state information is received and the hard disk to be tested is determined to be faulty according to the state information;
and the control module is used for controlling the hard disk to be tested to restart according to the reset signal.
In one embodiment of the present application, the hard disk monitoring device further includes:
And the disabling module is configured to disable sending of the state information to the BMC when the SCLK signal, the SLOAD signal, and the SDATAOUT signal satisfy a second state, and a duration of the second state reaches a second preset time, where the second state is that the SCLK signal, the SLOAD signal, and the SDATAOUT signal are all high level signals.
It should be noted that, because the content of information interaction and execution process between the above devices/units is based on the same concept as the method embodiment of the present application, specific functions and technical effects thereof may be referred to in the method embodiment section, and will not be described herein.
In addition, the hard disk monitoring device shown in fig. 4 may be a software unit, a hardware unit, or a unit combining soft and hard, which are built in an existing terminal device, may be integrated into the terminal device as an independent pendant, or may exist as an independent terminal device.
It will be apparent to those skilled in the art that, for convenience and brevity of description, only the above-described division of the functional units and modules is illustrated, and in practical application, the above-described functional distribution may be performed by different functional units and modules according to needs, i.e. the internal structure of the apparatus is divided into different functional units or modules to perform all or part of the above-described functions. The functional units and modules in the embodiment may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit, where the integrated units may be implemented in a form of hardware or a form of a software functional unit. In addition, the specific names of the functional units and modules are only for distinguishing from each other, and are not used for limiting the protection scope of the present application. The specific working process of the units and modules in the above system may refer to the corresponding process in the foregoing method embodiment, which is not described herein again.
Fig. 5 is a schematic structural diagram of a terminal device according to an embodiment of the present application. As shown in fig. 5, the terminal device 5 of this embodiment may include: at least one processor 50 (only one processor 50 is shown in fig. 5), a memory 51 and a computer program 52 stored in the memory 51 and executable on the at least one processor 50, the processor 50 implementing the steps of any of the various method embodiments described above, e.g. steps S201 to S202 in the embodiment shown in fig. 2, when executing the computer program 52. Or the processor 50, when executing the computer program 52, performs the functions of the modules/units of the apparatus embodiments described above, such as the functions of the modules 41 to 42 shown in fig. 4.
By way of example, the computer program 52 may be partitioned into one or more modules/units that are stored in the memory 51 and executed by the processor 50 to complete the present invention. The one or more modules/units may be a series of instruction segments of the computer program 52 capable of performing a specific function for describing the execution of the computer program 52 in the terminal device 5.
The terminal device 5 may be a computing device such as a desktop computer, a notebook computer, a palm computer, a cloud server, etc. The terminal device 5 may include, but is not limited to, a processor 50, a memory 51. It will be appreciated by those skilled in the art that fig. 5 is merely an example of the terminal device 5 and is not meant to be limiting as the terminal device 5, and may include more or fewer components than shown, or may combine certain components, or different components, such as may also include input-output devices, network access devices, etc.
The Processor 50 may be a central processing unit (Central Processing Unit, CPU), the Processor 50 may also be other general purpose processors, digital signal processors (DIGITAL SIGNAL processors, DSP), application SPECIFIC INTEGRATED Circuit (ASIC), off-the-shelf Programmable gate array (Field-Programmable GATE ARRAY, FPGA) or other Programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, or the like. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
The memory 51 may in some embodiments be an internal storage unit of the terminal device 5, such as a hard disk or a memory of the terminal device 5. The memory 51 may in other embodiments also be an external storage device of the terminal device 5, such as a plug-in hard disk provided on the terminal device 5, a smart memory card (SMART MEDIA CARD, SMC), a Secure Digital (SD) card, a flash memory card (FLASH CARD) or the like. Further, the memory 51 may also include both an internal storage unit and an external storage device of the terminal device 5. The memory 51 is used to store an operating system, application programs, boot Loader (Boot Loader), data, other programs, etc., such as program code of the computer program 52. The memory 51 may also be used to temporarily store data that has been output or is to be output.
Embodiments of the present application also provide a computer readable storage medium storing a computer program 52, which computer program 52, when executed by a processor 50, implements steps that may be implemented in the various method embodiments described above.
Embodiments of the present application provide a computer program product which, when run on a mobile terminal, causes the mobile terminal to perform steps that enable the implementation of the method embodiments described above.
The integrated units, if implemented in the form of software functional units and sold or used as stand-alone products, may be stored in a computer readable storage medium. With this understanding, the present application may be implemented by implementing all or part of the processes in the methods of the embodiments described above, by instructing the relevant hardware by a computer program 52, where the computer program 52 may be stored in a computer readable storage medium, and where the computer program 52, when executed by the processor 50, may implement the steps of the embodiments of the methods described above. The computer program 52 comprises computer program code, which may be in source code form, object code form, executable file or some intermediate form, etc. The computer readable medium may include at least: any entity or device capable of carrying computer program code to a terminal device, a recording medium, a computer Memory, a Read-Only Memory (ROM), a random access Memory (RAM, random Access Memory), an electrical carrier signal, a telecommunications signal, and a software distribution medium. Such as a U-disk, removable hard disk, magnetic or optical disk, etc. In some jurisdictions, computer readable media may not be electrical carrier signals and telecommunications signals in accordance with legislation and patent practice.
In the foregoing embodiments, the descriptions of the embodiments are emphasized, and in part, not described or illustrated in any particular embodiment, reference is made to the related descriptions of other embodiments.
Those of ordinary skill in the art will appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware, or combinations of computer software and electronic hardware. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the solution. 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 application.
In the embodiments provided in the present application, it should be understood that the disclosed apparatus/network device and method may be implemented in other manners. For example, the apparatus/network device embodiments described above are merely illustrative, e.g., the division of the modules or units is merely a logical functional division, and there may be additional divisions in actual implementation, e.g., multiple units or components may be combined or integrated into another system, or some features may be omitted, or not performed. Alternatively, the coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection via interfaces, devices or units, which may be in electrical, mechanical or other forms.
The units described as separate units may or may not be physically separate, and units shown as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
The above embodiments are only for illustrating the technical solution of the present application, and not for limiting the same; although the application has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical scheme described in the foregoing embodiments can be modified or some technical features thereof can be replaced by equivalents; such modifications and substitutions do not depart from the spirit and scope of the technical solutions of the embodiments of the present application, and are intended to be included in the scope of the present application.
The above embodiments are only for illustrating the technical solution of the present application, and not for limiting the same; although the application has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical scheme described in the foregoing embodiments can be modified or some technical features thereof can be replaced by equivalents; such modifications and substitutions do not depart from the spirit and scope of the technical solutions of the embodiments of the present application, and are intended to be included in the scope of the present application.