Disclosure of Invention
The embodiment of the application provides a hard disk monitoring method, a hard disk monitoring device and a hard disk monitoring system, which can solve the problem of inaccurate monitoring of hard disk state information.
In a first aspect, an embodiment of the present application provides a hard disk monitoring method, including:
obtaining an SGPIO signal and state information of a hard disk to be tested, wherein the SGPIO signal comprises an SCLK signal, an SLOAD signal and an SDATAOUT signal;
and when the SCLK signal, the SLOAD signal and the SDATAOUT signal meet a first preset condition, transmitting the state information to a BMC (Baseboard management Controller).
In a possible implementation manner of the first aspect, the first preset condition includes:
the SCLK signal, the SLOAD signal and the SDATAOUT signal satisfy a first state, and the duration of the first state reaches a first preset time, wherein the first state is that at least one high level signal and one low level signal exist in the SCLK signal, the SLOAD signal and the SDATAOUT signal.
In a possible implementation manner of the first aspect, the state information includes operation information, in-place information, and misalignment 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, the SLAAD signal and the SDATAOUT signal meet a second state and the duration time of the second state reaches a second preset time, forbidding sending the state information to the BMC, wherein the second state is that the SCLK signal, the SLAAD signal and the 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 hard disk to be tested fails according to the state information after the BMC receives 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 apparatus, including:
the device comprises a first acquisition module, a second acquisition module and a third acquisition module, wherein the first acquisition module is used for acquiring an SGPIO signal and state information of a hard disk to be detected, and the SGPIO signal comprises an SCLK signal, an SLOAD signal and an SDATAOUT signal;
and the sending module is used for sending the state information to the BMC when the SCLK signal, the SLAAD 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, the SLOAD signal and the SDATAOUT signal satisfy a first state, and the duration of the first state reaches a first preset time, wherein the first state is that at least one high level signal and one low level signal exist in the SCLK signal, the SLOAD signal and the SDATAOUT signal.
In a possible implementation manner of the second aspect, the hard disk monitoring apparatus 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 hard disk to be tested fails according to the state information after the BMC receives the state information;
and the control module is used for controlling the restart of the hard disk to be tested according to the reset signal.
In a third aspect, an embodiment of the present application provides a hard disk monitoring system, which includes a CPLD (Complex Programmable Logic Device) and a BMC, where the CPLD executes the method of any one of the first aspects.
In a fourth aspect, the present application provides a computer-readable storage medium, which stores a computer program, and when the computer program is executed by a processor, the computer program implements the method of any one of the first aspect.
In a fifth aspect, the present application provides a computer program product, which when run on a terminal device, causes the terminal device to execute the method of any one of the above first aspects.
Compared with the prior art, the embodiment of the application has the advantages that:
and acquiring an SGPIO signal and state information of the hard disk to be tested, wherein the SGPIO signal comprises an SCLK signal, an SLOAD signal and an SDATAOUT signal. When the SCLK signal, the SLAAD signal and the 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 plurality of signals, the accuracy of determining whether the hard disk to be detected is in a stable state is improved, the state information of the hard disk to be detected is transmitted to the BMC when the hard disk to be detected works stably, the BMC monitors the state of the hard disk to be detected according to the state information, and the accuracy of monitoring the hard disk to be detected is further improved.
It is understood that the beneficial effects of the second aspect to the fifth aspect can be referred to the related description of the first aspect, and are not described herein again.
Detailed Description
In the following description, for purposes of explanation and not limitation, specific details are set forth, such as particular system structures, 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 will 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 this specification and the appended claims refers to and includes any and all possible combinations of one or more of the associated listed items.
As used in this specification and the appended claims, the term "if" may be interpreted contextually as "when", "upon" or "in response to" determining "or" in response to detecting ". Similarly, the phrase "if it is determined" or "if a [ described condition or event ] is detected" may be interpreted contextually to mean "upon determining" or "in response to determining" or "upon detecting [ described condition or event ]" or "in response to detecting [ described condition or event ]".
Furthermore, in the description of the present application and the appended claims, the terms "first," "second," "third," and the like are used for distinguishing between descriptions and not necessarily for describing or implying relative importance.
Reference throughout this 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 present application. Thus, appearances of the phrases "in one embodiment," "in some embodiments," "in other embodiments," or the like, in various places throughout this specification are not necessarily all referring to the same embodiment, but rather "one or more but not all embodiments" unless specifically stated otherwise. The terms "comprising," "including," "having," and variations thereof mean "including, but not limited to," unless expressly specified otherwise.
Fig. 1 shows a schematic diagram of a hard disk monitoring system according to an embodiment of the present application. Referring to fig. 1, the hard disk monitoring system includes a CPLD and a BMC, where the CPLD obtains an SGPIO signal and state information of a hard disk to be tested, and the SGPIO signal includes an SCLK signal, an SLOAD signal, and an SDATAOUT signal. When the SCLK signal, the SLOAD signal and the SDATAOUT signal meet a first preset condition, the hard disk to be tested is in a stable state, and the CPLD sends the state information to the BMC. The BMC analyzes the state information to realize the monitoring of 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 backplane, and the CPLD may obtain the SGPIO signal and the state information of the hard disk to be tested through the backplane. The CPLD and the BMC can be in wireless communication, so that the CPLD can collect the state information of the hard disk to be tested on site and send the state information to the remote BMC, and the BMC can remotely monitor the hard disk to be tested.
Fig. 2 shows a flowchart of a hard disk monitoring method according to an embodiment of the present application. Referring to fig. 2, the hard disk monitoring method includes steps S201 and S202.
Step S201, obtaining an SGPIO signal and state information of the hard disk to be tested, wherein the SGPIO signal comprises an SCLK signal, an SLAAD signal and an SDATAOUT signal.
Specifically, a plurality of hard disks to be tested are installed on the back plate, and the CPLD can acquire the SGPIO signal and the state information of the hard disks to be tested through the back plate.
Illustratively, the state information includes operation information, in-place information and dislocation information of the hard disk to be tested. The BMC can analyze the operation information, the in-place information and the dislocation information to realize monitoring of the state information of the hard disk to be tested.
Step S202, when the SCLK signal, the SLOAD signal and the SDATAOUT signal meet a first preset condition, the state information is sent to the BMC.
Specifically, when the SCLK signal, SLOAD signal, and SDATAOUT signal satisfy the first preset condition, it indicates that the hard disk to be tested is in a stable operating state, and the state information acquired by the CPLD can accurately reflect the operating state of the hard disk to be tested. And the CPLD sends the state information to the BMC, and the BMC can realize accurate monitoring on 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 plurality of signals, the accuracy of determining whether the hard disk to be detected is in a stable state is improved, the state information of the hard disk to be detected is transmitted to the BMC when the hard disk to be detected works stably, the BMC monitors the state of the hard disk to be detected according to the state information, and the accuracy of monitoring the hard disk to be detected is further improved.
Illustratively, the first preset condition includes: the SCLK signal, the SLOAD signal and the SDATAOUT signal satisfy a first state, and the 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 exist in the SCLK signal, the SLOAD signal and the 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. And when the hard disk to be tested operates stably, the SCLK signal, the SLOAD signal and the SDATAOUT signal can be switched between a high level state and a low level state frequently so as to realize information interaction with the CPLD. Therefore, when the hard disk to be tested is in the stable working state, the SCLK signal, SLOAD signal and SDATAOUT signal cannot be in the high level state all the time, and the SCLK signal, SLOAD signal and SDATAOUT signal satisfy the first state (at least one high level signal and one low level signal exist in the SCLK signal, SLOAD signal and SDATAOUT signal), and when the duration of the first state reaches the first preset time, it indicates that the hard disk to be tested is in the stable working state.
It should be noted that, the designer may set the specific value of the first preset time according to the actual situation.
In an embodiment of the present application, the hard disk monitoring method further includes step S203.
Step S203, when the SCLK signal, SLOAD signal, and SDATAOUT signal satisfy the second state, and the duration of the second state reaches a second preset time, prohibiting sending the state information to the BMC, where the second state is that the SCLK signal, SLOAD signal, and 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 a second preset time, the hard disk to be tested is in an unstable state, 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 the specific value of the second preset time according to the actual situation.
Fig. 3 shows a flowchart of a hard disk monitoring method 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, and the reset signal is a signal sent by the BMC when the hard disk to be tested is determined to be in fault according to the state information after the BMC receives the state information.
Specifically, the BMC may determine whether the hard disk to be tested fails by analyzing the state information of the hard disk to be tested, and when determining that the hard disk to be tested fails, the BMC sends a reset signal to the CPLD.
And step S302, controlling the hard disk to be tested 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 gets rid of the fault.
It should be understood that, the sequence numbers of the steps in the foregoing embodiments do not imply an execution sequence, and the execution sequence of each process should be determined by its function and inherent logic, and should not constitute any limitation to the implementation process of the embodiments of the present application.
Fig. 4 shows a schematic structural diagram of a hard disk monitoring apparatus provided in an embodiment of the present application. Referring to fig. 4, the hard disk monitoring apparatus includes:
the first obtainingmodule 41 is configured to obtain an SGPIO signal and state information of a hard disk to be tested, where the SGPIO signal includes an SCLK signal, an SLOAD signal, and an SDATAOUT signal;
a sendingmodule 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 an embodiment of the present application, the first preset condition includes:
the SCLK signal, the SLOAD signal and the SDATAOUT signal satisfy a first state, and the duration of the first state reaches a first preset time, wherein the first state is that at least one high level signal and one low level signal exist in the SCLK signal, the SLOAD signal and the SDATAOUT signal.
In an embodiment of the present application, the state information includes operation information, in-place information, and misalignment information of the hard disk to be tested.
In an embodiment of the present application, the hard disk monitoring apparatus 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 hard disk to be tested fails according to the state information after the BMC receives the state information;
and the control module is used for controlling the restart of the hard disk to be tested according to the reset signal.
In an embodiment of the present application, the hard disk monitoring apparatus further includes:
and the forbidding module is used for forbidding to send the state information to the BMC when the SCLK signal, the SLAAD signal and the SDATAOUT signal meet a second state and the duration of the second state reaches a second preset time, wherein the second state is that the SCLK signal, the SLAAD signal and the SDATAOUT signal are all high-level signals.
It should be noted that, for the information interaction, execution process, and other contents between the above-mentioned devices/units, the specific functions and technical effects thereof are based on the same concept as those of the embodiment of the method of the present application, and specific reference may be made to the part of the embodiment of the method, which is not described herein again.
In addition, the hard disk monitoring apparatus shown in fig. 4 may be a software unit, a hardware unit, or a combination of software and hardware unit that is built in the 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-mentioned division of the functional units and modules is illustrated, and in practical applications, the above-mentioned function distribution may be performed by different functional units and modules according to needs, that is, the internal structure of the apparatus is divided into different functional units or modules to perform all or part of the above-mentioned functions. Each functional unit and module in the embodiments may be integrated in one processing unit, or each unit may exist alone physically, or two or more units are integrated in one unit, and the integrated unit may be implemented in a form of hardware, or in a form of software functional unit. In addition, specific names of the functional units and modules are only for convenience of distinguishing from each other, and are not used for limiting the protection scope of the present application. The specific working processes of the units and modules in the system may refer to the corresponding processes in the foregoing method embodiments, and are 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, theterminal device 5 of this embodiment may include: at least one processor 50 (only oneprocessor 50 is shown in fig. 5), amemory 51, and acomputer program 52 stored in thememory 51 and operable on the at least oneprocessor 50, wherein theprocessor 50 implements the steps in any of the various method embodiments described above, such as the steps S201 to S202 in the embodiment shown in fig. 2, when executing thecomputer program 52. Alternatively, theprocessor 50, when executing thecomputer program 52, implements the functions of the modules/units in the above-described device embodiments, such as the functions of themodules 41 to 42 shown in fig. 4.
Illustratively, thecomputer program 52 may be partitioned into one or more modules/units that are stored in thememory 51 and executed by theprocessor 50 to implement the present invention. The one or more modules/units may be a series of instruction segments of thecomputer program 52 capable of performing specific functions, which are used to describe the execution process of thecomputer program 52 in theterminal device 5.
Theterminal device 5 may be a desktop computer, a notebook, a palm computer, a cloud server, or other computing devices. Theterminal device 5 may include, but is not limited to, aprocessor 50 and amemory 51. Those skilled in the art will appreciate that fig. 5 is only an example of theterminal device 5, and does not constitute a limitation to theterminal device 5, and may include more or less components than those shown, or combine some components, or different components, such as an input-output device, a network access device, and the like.
TheProcessor 50 may be a Central Processing Unit (CPU), and theProcessor 50 may be other general purpose Processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), an off-the-shelf Programmable Gate Array (FPGA) or other Programmable logic device, discrete Gate or transistor logic device, discrete hardware component, etc. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
Thememory 51 may in some embodiments be an internal storage unit of theterminal device 5, such as a hard disk or a memory of theterminal device 5. Thememory 51 may also be an external storage device of theterminal device 5 in other embodiments, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), and the like, which are provided on theterminal device 5. Further, thememory 51 may also include both an internal storage unit and an external storage device of theterminal device 5. Thememory 51 is used for storing an operating system, an application program, a Boot Loader (Boot Loader), data, and other programs, such as program codes of thecomputer program 52. Thememory 51 may also be used to temporarily store data that has been output or is to be output.
The present application further provides a computer-readable storage medium, which stores acomputer program 52, and when thecomputer program 52 is executed by theprocessor 50, the steps in the above-mentioned method embodiments can be implemented.
The embodiments of the present application provide a computer program product, which when running on a mobile terminal, enables the mobile terminal to implement the steps in the above method embodiments when executed.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, all or part of the processes in the methods of the embodiments described above can be implemented by acomputer program 52 to instruct related hardware, where thecomputer program 52 can be stored in a computer readable storage medium, and when thecomputer program 52 is executed by theprocessor 50, the steps of the methods of the embodiments described above can be implemented. Wherein thecomputer program 52 comprises computer program code, which may be in the form of source code, object code, an executable file or some intermediate form, etc. The computer readable medium may include at least: any entity or apparatus capable of carrying computer program code to a terminal device, recording medium, computer Memory, Read-Only Memory (ROM), Random-Access Memory (RAM), electrical carrier wave signals, telecommunications signals, and software distribution medium. Such as a usb-disk, a removable hard disk, a magnetic or optical disk, etc. In certain jurisdictions, computer-readable media may not be an electrical carrier signal or a telecommunications signal in accordance with legislative and patent practice.
In the above embodiments, the descriptions of the respective embodiments have respective emphasis, and reference may be made to the related descriptions of other embodiments for parts that are not described or illustrated in a certain embodiment.
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 implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present 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 ways. For example, the above-described apparatus/network device embodiments are merely illustrative, and for example, the division of the modules or units is only one logical division, and there may be other divisions when actually implementing, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not implemented. 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 units, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
The above-mentioned embodiments are only used for illustrating the technical solutions of the present application, and not for limiting the same; although the present application has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; such modifications and substitutions do not substantially depart from the spirit and scope of the embodiments of the present application and are intended to be included within the scope of the present application.
The above-mentioned embodiments are only used for illustrating the technical solutions of the present application, and not for limiting the same; although the present application has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; such modifications and substitutions do not substantially depart from the spirit and scope of the embodiments of the present application and are intended to be included within the scope of the present application.