CN109426598B - Hard disk state indicator lamp control method and device - Google Patents

Hard disk state indicator lamp control method and device Download PDF

Info

Publication number
CN109426598B
CN109426598B CN201710790553.5A CN201710790553A CN109426598B CN 109426598 B CN109426598 B CN 109426598B CN 201710790553 A CN201710790553 A CN 201710790553A CN 109426598 B CN109426598 B CN 109426598B
Authority
CN
China
Prior art keywords
delay
hard disk
data
signal
value
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.)
Active
Application number
CN201710790553.5A
Other languages
Chinese (zh)
Other versions
CN109426598A (en
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.)
Shenzhen Cec Greatwall Information Safety System Co ltd
Original Assignee
Shenzhen Cec Greatwall Information Safety System 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 Shenzhen Cec Greatwall Information Safety System Co ltd filed Critical Shenzhen Cec Greatwall Information Safety System Co ltd
Priority to CN201710790553.5A priority Critical patent/CN109426598B/en
Publication of CN109426598A publication Critical patent/CN109426598A/en
Application granted granted Critical
Publication of CN109426598B publication Critical patent/CN109426598B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/32Monitoring with visual or acoustical indication of the functioning of the machine
    • G06F11/324Display of status information
    • G06F11/325Display of status information by lamps or LED's
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/3003Monitoring arrangements specially adapted to the computing system or computing system component being monitored
    • G06F11/3037Monitoring arrangements specially adapted to the computing system or computing system component being monitored where the computing system component is a memory, e.g. virtual memory, cache
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/3055Monitoring arrangements for monitoring the status of the computing system or of the computing system component, e.g. monitoring if the computing system is on, off, available, not available

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Quality & Reliability (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computing Systems (AREA)
  • Mathematical Physics (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The invention provides a control method and a device for a hard disk state indicator lamp, wherein after values of a clock signal, a loading signal and a data output signal in a serial bus signal are read, the read values are respectively assigned to a preset clock delay variable, a preset loading delay variable and a preset data output delay variable; at each falling edge of the clock delay signal, outputting the value in the delay variable to another temporary data variable; counting the number of values of the data output delay variables contained in the temporary data variables according to the values of the loaded delay variables, and assigning the values of the temporary data variables to another data variable after the assignment of the temporary data variables is completed; and reading the value of the other data variable, grouping the values of the other data variable according to a preset strategy, analyzing the grouped data respectively to acquire the state of each hard disk, and controlling the corresponding hard disk indicator light to indicate, so that the problems of unstable and incorrect indication of the hard disk state indicator light can be solved.

Description

Hard disk state indicator lamp control method and device
Technical Field
The invention belongs to the technical field of computer hard disks, and particularly relates to a hard disk state indicator lamp control method and device.
Background
Typically, each hard disk on the back panel of the server will have two lights to indicate the status of the various functions of the hard disk. The server back plate is connected with a built-in Raid card through a connecting wire, the Raid card collects the state information of each hard disk on the back plate, the state information of each hard disk is sent to a CPLD connected with the server back plate in the form of an SGPIO BUS signal for analysis, and the CPLD controls a hard disk indicator lamp to display a corresponding functional state according to the analyzed result. However, because the SGPIO BUS signal output by the Raid card to the CPLD is not clean and has burrs due to the problems of the connection line, the Raid card and the like, the CPLD processes the received SGPIO BUS signal in a conventional SClock falling edge sampling manner, and the analyzed SDataOut data can deviate from the actual state, which can cause the state of the lamp not corresponding to the indicated hard disk or the state of the lamp to be wrong; in addition, as the CPLD reads the SLoad and SDataOut data in the SGPIO BUS signal when the SClock falls, the clock frequency of the CPLD may not match the SClock output by the Raid card during the actual control process, which may cause the CPLD to miss the SDataOut data in the SGPIO BUS signal output by the Raid card, resulting in an error in the lamp status.
Disclosure of Invention
In view of this, the embodiment of the present invention provides a method and an apparatus for controlling a state of a hard disk indicator light, so as to solve the problem in the prior art that a light state does not correspond to an indicated hard disk or the light state is wrong due to an unclean and glitch SGPIO BUS signal output by a Raid card to a CPLD; and in the actual control process, the clock frequency of the CPLD is possibly not matched with the SClock output by the Raid card, and the CPLD can miss reading SDataOut data in an SGPIO BUS signal output by the Raid card, so that the problem of lamp state error is caused.
A first aspect of an embodiment of the present invention provides a control method for a hard disk status indicator lamp, including:
receiving an SGPIO BUS signal containing hard disk state information sent by a Raid card, wherein the SGPIO BUS signal comprises an SClock signal, a SLoad signal and an SDataOut signal;
judging whether the time that the SClock signal and the SLoad signal in the SGPIO BUS signal are simultaneously in a high level is less than a preset time threshold value;
if yes, reading the values of the SClock signal, the SLoad signal and the SDataOut signal in the SGPIO BUS signal according to a preset frequency, and assigning the read values to preset variables of delay _ SClock, delay _ SLoad and delay _ SDataOut, wherein bit widths of the variables of delay _ SClock, delay _ SLoad and delay _ SDataOut are all larger than 1;
analyzing the assigned delay _ sclock [ n ], delay _ slope [ n ] and delay _ sdaout [ n ], and giving a corresponding value of one bit of delay _ sdaout [ n ] to another variable data _ temp when each falling edge of the delay _ sclock [ n ], wherein the bit width of the variable data _ temp is 12, and 12 values of delay _ sdaout [ n ] can be added; wherein, delay _ sclock [ n ], delay _ sload [ n ] and delay _ sdaout [ n ] respectively represent the nth value of the variables delay _ sclock, delay _ sload and delay _ sdaout, and n is a positive integer;
counting the number of values of delay _ sdataout [ n ] contained in the variable data _ temp according to the value of delay _ sload [ n ], and assigning the value of data _ temp to another variable rec _ data after the assignment of the variable data _ temp is completed;
reading the value of the variable rec _ data, grouping the value of the variable rec _ data according to a preset strategy, analyzing the grouped data respectively to obtain the state of each hard disk, and controlling the indication of a corresponding hard disk indicator lamp.
A second aspect of an embodiment of the present invention provides a hard disk status indicator lamp control apparatus, including:
the device comprises a signal receiving unit, a processing unit and a processing unit, wherein the signal receiving unit is used for receiving an SGPIO BUS signal which is sent by a Raid card and contains hard disk state information, and the SGPIO BUS signal comprises an SClock signal, a SLoad signal and an SDataOut signal;
the first judging unit is used for judging whether the time that the SClock signal and the SLoad signal in the SGPIO BUS signal are simultaneously in a high level is less than a preset time threshold value or not;
if so, reading the values of the SClock signal, the SLoad signal and the SDataOut signal in the SGPIO BUS signal according to a preset frequency, and assigning the read values to preset variables of delay _ SClock, delay _ SLoad and delay _ SDataOut, wherein bit widths of the variables of delay _ SClock, delay _ SLoad and delay _ SDataOut are all greater than 1;
the first assignment unit is used for analyzing the assigned delay _ sclock [ n ], delay _ slope [ n ] and delay _ sdataout [ n ], and when each delay _ sclock [ n ] falls, giving the value of one bit of delay _ sdataout [ n ] to another variable data _ temp, wherein the bit width of the variable data _ temp is 12, and 12 values of delay _ sdataout [ n ] can be put; wherein, delay _ sclock [ n ], delay _ sload [ n ] and delay _ sdaout [ n ] respectively represent the nth value of the variables delay _ sclock, delay _ sload and delay _ sdaout, and n is a positive integer;
the second assignment unit is used for counting the number of values of delay _ sdataout [ n ] contained in the variable data _ temp according to the value of delay _ sload [ n ], and assigning the value of data _ temp to another variable rec _ data after assignment of the variable data _ temp is completed;
and the hard disk state analyzing unit is used for reading the value of the variable rec _ data, grouping the value of the variable rec _ data according to a preset strategy, respectively analyzing the grouped data to acquire the state of each hard disk and control the corresponding hard disk indicator lamp to indicate.
A third aspect of embodiments of the present invention provides a terminal, including a memory, a processor, and a computer program stored in the memory and operable on the processor, wherein the processor, when executing the computer program, implements the steps of the method according to the first aspect.
A fourth aspect of embodiments of the present invention provides a computer-readable storage medium, which stores a computer program, wherein the computer program, when executed by a processor, implements the steps of the method according to the first aspect.
Compared with the prior art, the embodiment of the invention has the following beneficial effects:
according to the embodiment of the invention, after the values of the SClock signal, the SLoad signal and the SDataOut signal in the SGPIO BUS signal are read, the read values are assigned to preset variables delay _ SClock, delay _ slave and delay _ sdaout, the bit widths of the variables delay _ SClock, delay _ slave and delay _ sdaout are all larger than 1, and delay _ SClock [ n ], delay _ slave [ n ] and delay _ sdaout [ n ] are selected from the assigned variables delay _ SClock, delay _ slave and delay _ sdaout for analysis, so that the influence of burrs of the SClock signal, the SLoad signal and the SDataOut signal on the accuracy of the analyzed hard disk state can be solved; since the value of the corresponding one bit delay _ sdataout [ n ] is given to another variable data _ temp at the falling edge of each delay _ sclock [ n ], the bit width of the variable data _ temp is 12, and 12 values of delay _ sdataout [ n ] can be put; counting the number of values of delay _ sdataout [ n ] contained in the variable data _ temp according to the value of delay _ sload [ n ], and assigning the value of data _ temp to another variable rec _ data after the assignment of the variable data _ temp is completed; the method comprises the steps of reading the value of the variable rec _ data, grouping the value of the variable rec _ data according to a preset strategy, analyzing grouped data respectively to obtain the state of each hard disk, and controlling the indication of a corresponding hard disk indicator lamp, so that each SDataOut data can be read and corresponds to the number of the hard disk, and the problems of instability and inaccuracy of the indication of the hard disk state indicator lamp are solved.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings needed to be used in the embodiments or the prior art descriptions 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 to obtain other drawings based on these drawings without inventive exercise.
Fig. 1 is an external architecture diagram of a hard disk status indicator lamp control device according to an embodiment of the present invention.
Fig. 2 is a system structure diagram of a schematic flowchart of a hard disk status indicator lamp control method according to an embodiment of the present invention;
fig. 3 is a schematic diagram of a manner of sending SGPIO BUS signal data in a hard disk status indicator lamp control method according to an embodiment of the present invention;
fig. 4 is a schematic block diagram of a hard disk status indicator lamp control device according to an embodiment of the present invention;
fig. 5 is a schematic block diagram of a terminal according to an embodiment of the present invention.
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 invention. It will be apparent, however, to one skilled in the art that the present invention 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 invention with unnecessary detail.
In order to explain the technical means of the present invention, the following description will be given by way of specific examples.
Fig. 1 is an external architecture diagram of a hard disk status indicator lamp control device according to an embodiment of the present invention. Only the portions related to the present embodiment are shown for convenience of explanation.
Referring to fig. 1, an external architecture of a hard disk status indicator control device provided in an embodiment of the present invention includes a back plate 1, a raid card 3 is built in the back plate 1, a plurality of hard disk slots for placing a hard disk 2 are formed in the back plate 1, and a plurality of hard disk status indicator lamps 5 are further disposed on the back plate 1; raid card 3 through the connecting wire respectively with backplate 1 with hard disk status indicator lamp controlling means 4 electric connection, hard disk status indicator lamp controlling means 4 still with a plurality of hard disk status indicator lamps 5 electric connection, a plurality of hard disk status indicator lamps 5 respectively with a plurality of hard disk grooves of seting up on backplate 1 are corresponding for instruct the state of putting into hard disk 2 in the hard disk groove. The hard disk state indicator lamp control device 4 is a CPLD.
Based on the external architecture of the hard disk status indicator lamp control device shown in fig. 1, the method for acquiring power consumption information provided by the embodiment of the present invention is described in detail below with reference to specific embodiments:
fig. 2 shows an implementation flow of a hard disk status indicator lamp control method according to an embodiment of the present invention, and in the embodiment shown in fig. 2, an execution subject of the flow is a hard disk status indicator lamp control device in fig. 1. The implementation process of the method is detailed as follows:
step S201, receiving an SGPIO BUS signal containing hard disk state information sent by a Raid card, wherein the SGPIO BUS signal comprises an SClock signal, a SLoad signal and an SDataOut signal.
In this embodiment, the Raid card sends the SGPIO BUS signal containing the status information of the hard disks to the CPLD through the Minisas interface of the backplane, the SGPIO BUS signal of each Minisas interface constantly sends the status information of 4 hard disks, and the backplane is generally provided with 8 hard disks, so two Minisas interfaces are required to send the status information of 8 hard disks, that is, the CPLD receives two groups of SGPIO BUS signals at the same time, and the processing modes of the two groups of SGPIO BUS signals are the same, so the embodiment of the present invention mainly explains the processing mode of one group of SGPIO BUS signals.
Step S202, judging whether the time that the SClock signal and the SLoad signal in the SGPIO BUS signal are simultaneously in a high level is less than a preset time threshold value; if yes, the process proceeds to step S203, otherwise, the process ends.
In this embodiment, the preset time threshold is 64ms, and when the time that the SClock signal and the SLoad signal are both high is longer than 64ms, it represents that the SGPIO BUS function is disabled, so that it is necessary to determine this condition before reading the SGPIO BUS signal, and if the time that the SClock signal and the SLoad signal are both high is longer than 64ms, an indication flag is set to "1", and the flow ends; otherwise, setting the indication flag to "0", and proceeding to step S203, reading the SGPIO BUS signal, where the reading and analysis of the data in the SGPIO BUS signal are both performed under the condition that the indication flag is "0".
Step S203, reading values of the SClock signal, the SLoad signal, and the SDataOut signal in the SGPIO BUS signal according to a preset frequency, and assigning the read values to preset variables delay _ SClock, delay _ SLoad, and delay _ sdaout, where bit widths of the variables delay _ SClock, delay _ SLoad, and delay _ sdaout are all greater than 1.
In the present embodiment, the bit width of the variable quantities delay _ sclock, delay _ slot, and delay _ sdaout is 3. The CPLD samples with a clock frequency of 50MHZ, reads the SClock signal, the SLoad signal and the SDataOut signal transmitted to the backplane at each falling edge of the clock frequency of 50MHZ, and assigns the read values to preset variables delay _ lock, delay _ Sload and delay _ SDataout respectively. Therefore, the CPLD can subsequently and respectively select a corresponding effective numerical value from the assigned variables delay _ SClock, delay _ slope and delay _ SDataOut for analysis, and the influence of burrs of the SClock signal, the SLoad signal and the SDataOut signal on the indication accuracy of the hard disk state indicator lamp is solved.
In step S204, the assigned delay _ sclock [ n ], delay _ slope [ n ], and delay _ sdaout [ n ] are analyzed, and at each falling edge of delay _ sclock [ n ], the value of one bit of delay _ sdaout [ n ] is given to another variable data _ temp, the bit width of the variable data _ temp is 12, and the values of 12 delay _ sdaout [ n ] can be added. Wherein, delay _ sclock [ n ], delay _ sload [ n ] and delay _ sdaout [ n ] respectively represent the nth value of the variables delay _ sclock, delay _ sload and delay _ sdaout, and n is a positive integer.
In the present embodiment, since the bit widths of the variables delay _ sclock, delay _ slot, and delay _ sdaout are all 3, each variable includes 3 values. In an embodiment, after the read values are assigned to the preset variables delay _ sclock, delay _ slope, and delay _ sdataout respectively, a second value is selected from the assigned variables delay _ sclock, delay _ slope, and delay _ sdataout for analysis, that is, the assigned variables delay _ sclock [2], delay _ slope [2], and delay _ sdataout [2] are analyzed, and at each falling edge of delay _ sclock [2], the value of delay _ sdataout [2] is assigned to another variable data _ temp.
Step S205, counting the number of the values of delay _ sdataout [ n ] contained in the variable data _ temp according to the value of delay _ sload [ n ], and assigning the value of data _ temp to another variable rec _ data after the assignment of the variable data _ temp is completed.
In this embodiment, each rising edge of the SClock signal, the Raid card transmits one bit of SLoad and SDataOut data, where the high level of SLoad is the start flag bit, and the SDataOut starts transmitting data of the 0 th hard disk when the low level of SLoad is low, and each 3 bits of data is status information of one hard disk, and 4 hard disks transmit 12 bits of data in total. When SDataOut transmits the 12 th bit of data, SLoad is high, which is the start flag of the next round of transmission, and the data transmission mode can be seen in fig. 3. Further, step S205 specifically includes:
at each falling edge of delay _ sclock [ n ], judging whether the value of corresponding one bit of delay _ slope [ n ] is '1';
if yes, the number of the values of delay _ sdataout [ n ] contained in the data _ temp is counted as zero; if not, adding 1 to count the number of the values of delay _ sdataout [ n ] contained in the data _ temp;
when the count is 11, the assignment of the variable data _ temp is completed, and the value of the data _ temp is assigned to another variable rec _ data.
As can be seen from the data transmission scheme shown in fig. 3, while the value of the corresponding one bit delay _ sdataout [ n ] is assigned to the other variable data _ temp at the falling edge of delay _ sclock [ n ], it is determined whether delay _ slot [ n ] is high, which represents the start, at the falling edge of delay _ sclock [ n ], and the count is 0 at this time, and whether delay _ slot [ n ] is low, which is incremented by 1, and when the count is 11, the data _ temp value is the status data of 4 hard disks, and the data _ temp value is assigned to the other variable rec _ data.
And step S206, reading the value of the variable rec _ data, grouping the value of the variable rec _ data according to a preset strategy, analyzing the grouped data respectively to acquire the state of each hard disk, and controlling a corresponding hard disk indicator lamp to indicate.
In this embodiment, after the data _ temp value is assigned to the variable rec _ data, the CPLD may extract the state data of 4 hard disks, analyze the state data to obtain the state of each hard disk, and control the corresponding hard disk indicator lamp to indicate the state data. Further, step S206 specifically includes:
reading the value of the variable rec _ data, grouping the value of the variable rec _ data into one group according to every 3 bits of data to obtain four groups of hard disk state data, wherein each group of hard disk state data corresponds to the state information of one hard disk;
and analyzing the state data of each group of hard disks respectively to acquire the state information of each hard disk and control the indication of a corresponding hard disk indicator lamp.
In this embodiment, the hard disk states include five types, where the hard disk states represented by the respective values of the 3-bit data are: "000": a disc is arranged; "100": reading and writing; "001": reporting an error; "010": positioning; and others: and (4) reconstructing.
In the embodiment, 4 pieces of hard disk state information are collected by adopting the variable data _ temp and the variable rec _ data, and the 4 pieces of hard disk state information are analyzed after being read all at once, so that each SDataOut data can be ensured to be read and correspond to the hard disk number, and the problems of unstable and incorrect indication of a hard disk state indicating lamp are solved.
Preferably, in this embodiment, before analyzing the hard disk state data, the method may further include:
detecting whether the level of a GND pin of a hard disk slot is low;
if the level is low, analyzing the hard disk state data corresponding to the hard disk slot to acquire the state of the hard disk in the hard disk slot and control a corresponding hard disk indicator lamp to indicate;
if the level is high, the hard disk state data corresponding to the hard disk slot is not analyzed, and the hard disk indicator lamp corresponding to the hard disk slot is controlled to keep in an off state.
Because whether the hard disk slot is connected with the hard disk cannot be known through the SGPIO signal, the GND pin level of the hard disk slot is used for judging whether the slot is connected with the hard disk in the embodiment, and if the slot is connected with the hard disk, the GND pin level is a low level; if the hard disk is not connected, the GND pin belongs to a suspended high-resistance state, and the electrical level of the GND pin is high, so that when the hard disk slot does not have a hard disk, the hard disk indicator lamp corresponding to the hard disk slot is directly kept in an off state, when the hard disk is arranged in the hard disk slot, the hard disk state data corresponding to the hard disk slot is analyzed, and the hard disk state indicator lamp corresponding to the hard disk slot is controlled to indicate according to the analysis result, so that the analysis efficiency of the CPLD can be improved.
As can be seen from the above, in the hard disk state indicator lamp control method provided in this embodiment, after the values of the SClock signal, the SLoad signal, and the SDataOut signal in the SGPIO BUS signal are read, the read values are assigned to preset variables delay _ SClock, delay _ slope, and delay _ sdaout, bit widths of the variables delay _ SClock, delay _ slope, and delay _ sdaout are all greater than 1, and then the variables delay _ SClock [ n ], delay _ slope [ n ], and delay _ sdaout [ n ] are selected from the assigned variables delay _ SClock, delay _ slope, and delay _ sdaout to perform analysis, so that the influence of the SClock signal, the SLoad signal, and the SDataOut signal on the accuracy of the hard disk state obtained can be solved; since the value of the corresponding one bit delay _ sdataout [ n ] is given to another variable data _ temp at the falling edge of each delay _ sclock [ n ], the bit width of the variable data _ temp is 12, and 12 values of delay _ sdataout [ n ] can be put; counting the number of values of delay _ sdataout [ n ] contained in the variable data _ temp according to the value of delay _ sload [ n ], and assigning the value of data _ temp to another variable rec _ data after the assignment of the variable data _ temp is completed; the method comprises the steps of reading the value of the variable rec _ data, grouping the value of the variable rec _ data according to a preset strategy, analyzing grouped data respectively to obtain the state of each hard disk, and controlling the indication of a corresponding hard disk indicator lamp, so that each SDataOut data can be read and corresponds to the number of the hard disk, and the problems of instability and inaccuracy of the indication of the hard disk state indicator lamp are solved.
Fig. 4 is a schematic block diagram of a hard disk status indicator lamp control device according to an embodiment of the present invention. For convenience of explanation, only the portions related to the present embodiment are shown.
Referring to fig. 4, an embodiment of the present invention provides a hard disk status indicator lamp control apparatus 4, including:
a signal receiving unit 41, configured to receive an SGPIO BUS signal that includes hard disk state information and is sent by a Raid card, where the SGPIO BUS signal includes an SClock signal, a SLoad signal, and an SDataOut signal;
a first judging unit 42, configured to judge whether a time when the SClock signal and the SLoad signal in the SGPIO BUS signal are at a high level at the same time is less than a preset time threshold;
if yes, the delay unit 43 is configured to read values of the SClock signal, the SLoad signal, and the SDataOut signal in the SGPIO BUS signal according to a preset frequency, and assign the read values to preset variables delay _ SClock, delay _ SLoad, and delay _ sdaout, where bit widths of the variables delay _ SClock, delay _ SLoad, and delay _ sdaout are all greater than 1;
a first assigning unit 44, configured to parse the assigned delay _ sclock [ n ], delay _ slope [ n ], and delay _ sdataout [ n ], and, at each falling edge of the delay _ sclock [ n ], assign a corresponding value of one bit of delay _ sdataout [ n ] to another variable data _ temp, where the bit width of the variable data _ temp is 12, and may place the values of 12 delay _ sdataout [ n ]; wherein, delay _ sclock [ n ], delay _ sload [ n ] and delay _ sdaout [ n ] respectively represent the nth value of the variables delay _ sclock, delay _ sload and delay _ sdaout, and n is a positive integer.
A second assigning unit 45, configured to count the number of values of delay _ sdataout [ n ] included in the variable data _ temp according to the value of delay _ sload [ n ], and assign the value of data _ temp to another variable rec _ data after the assignment of the variable data _ temp is completed;
and the hard disk state analyzing unit 46 is configured to read the value of the variable rec _ data, group the values of the variable rec _ data according to a preset policy, analyze the grouped data respectively to obtain the state of each hard disk, and control a corresponding hard disk indicator light to indicate.
Optionally, the second assigning unit 45 is specifically configured to:
at each falling edge of delay _ sclock [ n ], judging whether the value of corresponding one bit of delay _ slope [ n ] is '1';
if yes, the number of the values of delay _ sdataout [ n ] contained in the data _ temp is counted as zero; if not, adding 1 to count the number of the values of delay _ sdataout [ n ] contained in the data _ temp;
when the count is 11, the assignment of the variable data _ temp is completed, and the value of the data _ temp is assigned to another variable rec _ data.
Optionally, the hard disk state analysis unit 46 is specifically configured to:
reading the value of the variable rec _ data, grouping the value of the variable rec _ data into one group according to every 3 bits of data to obtain four groups of hard disk state data, wherein each group of hard disk state data corresponds to the state information of one hard disk;
and analyzing the state data of each group of hard disks respectively to acquire the state information of each hard disk and control the indication of a corresponding hard disk indicator lamp.
Optionally, the hard disk status indicator light control device 4 further includes a hard disk detection unit 47, configured to:
detecting whether the level of a GND pin of a hard disk slot is low;
if the level is low, analyzing the hard disk state data corresponding to the hard disk slot to acquire the state of the hard disk in the hard disk slot and control a corresponding hard disk indicator lamp to indicate;
if the level is high, the hard disk state data corresponding to the hard disk slot is not analyzed, and the hard disk indicator lamp corresponding to the hard disk slot is controlled to keep in an off state.
It should be noted that, since each unit in the above-mentioned apparatus provided in the embodiment of the present invention is based on the same concept as that of the embodiment of the method of the present invention, the technical effect thereof is the same as that of the embodiment of the method of the present invention, and specific contents thereof may be referred to the description in the embodiment of the method of the present invention, and are not described herein again.
Therefore, the hard disk state indicator lamp control device provided by the embodiment of the invention can also solve the problem that the burrs of the SClock signal, the SLoad signal and the SDataOut signal have influence on the accuracy of the analyzed hard disk state; and each SDataOut data can be read and corresponds to the hard disk number, so that the problems of unstable and incorrect indication of the hard disk state indicating lamp are solved.
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 invention.
Fig. 5 is a schematic diagram of a terminal according to an embodiment of the present invention. As shown in fig. 5, the terminal 5 of this embodiment includes: a processor 50, a memory 51 and a computer program 52 stored in said memory 51 and executable on said processor 50. The processor 50, when executing the computer program 52, implements the steps in the various method embodiments described above, such as the steps S201 to S206 shown in fig. 2. Alternatively, the processor 50, when executing the computer program 52, implements the functions of the modules/units in the above-mentioned device embodiments, such as the functions of the modules 41 to 46 shown in fig. 4.
Illustratively, 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 implement the present invention. The one or more modules/units may be a series of computer program instruction segments capable of performing specific functions, which are used to describe the execution of the computer program 52 in the terminal 5. For example, the computer program 52 may be divided into the signal receiving unit 41, the first judging unit 42, the delay unit 43, the first assigning unit 44, the second assigning unit 45, and the hard disk state analyzing unit 46, and the specific functions of each unit are as follows:
a signal receiving unit 41, configured to receive an SGPIO BUS signal that includes hard disk state information and is sent by a Raid card, where the SGPIO BUS signal includes an SClock signal, a SLoad signal, and an SDataOut signal;
a first judging unit 42, configured to judge whether a time when the SClock signal and the SLoad signal in the SGPIO BUS signal are at a high level at the same time is less than a preset time threshold;
if yes, the delay unit 43 is configured to read values of the SClock signal, the SLoad signal, and the SDataOut signal in the SGPIO BUS signal according to a preset frequency, and assign the read values to preset variables delay _ SClock, delay _ SLoad, and delay _ sdaout, where bit widths of the variables delay _ SClock, delay _ SLoad, and delay _ sdaout are all greater than 1;
a first assigning unit 44, configured to parse the assigned delay _ sclock [ n ], delay _ slope [ n ], and delay _ sdataout [ n ], and, at each falling edge of the delay _ sclock [ n ], assign a corresponding value of one bit of delay _ sdataout [ n ] to another variable data _ temp, where the bit width of the variable data _ temp is 12, and may place the values of 12 delay _ sdataout [ n ]; wherein, delay _ sclock [ n ], delay _ sload [ n ] and delay _ sdaout [ n ] respectively represent the nth value of the variables delay _ sclock, delay _ sload and delay _ sdaout, and n is a positive integer;
a second assigning unit 45, configured to count the number of values of delay _ sdataout [ n ] included in the variable data _ temp according to the value of delay _ sload [ n ], and assign the value of data _ temp to another variable rec _ data after the assignment of the variable data _ temp is completed;
and the hard disk state analyzing unit 46 is configured to read the value of the variable rec _ data, group the values of the variable rec _ data according to a preset policy, analyze the grouped data respectively to obtain the state of each hard disk, and control a corresponding hard disk indicator light to indicate.
The terminal device 5 may be a desktop computer, a notebook, a palm computer, a cloud server, or other computing devices. The terminal 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 only an example of a terminal 5 and does not constitute a limitation of the terminal device 5 and may comprise more or less components than shown or some components may be combined or different components, e.g. the terminal may further comprise input output devices, network access devices, buses etc.
The Processor 50 may be a Central Processing Unit (CPU), 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, discrete hardware components, etc. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
The memory 51 may be an internal storage unit of the terminal 5, such as a hard disk or a memory of the terminal 5. The memory 51 may also be an external storage device of the terminal 5, 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 provided on the terminal 5. Further, the memory 51 may also include both an internal storage unit and an external storage device of the terminal 5. The memory 51 is used for storing the computer program and other programs and data required by the terminal. The memory 51 may also be used to temporarily store data that has been output or is to be output.
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.
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 invention.
In the embodiments provided in the present invention, it should be understood that the disclosed apparatus/terminal device and method may be implemented in other ways. For example, the above-described embodiments of the apparatus/terminal device 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 implemented, for example, a plurality of units 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 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.
In addition, functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated modules/units, if implemented in the form of software functional units and sold or used as separate products, may be stored in a computer readable storage medium. Based on such understanding, all or part of the flow of the method according to the embodiments of the present invention may also be implemented by a computer program, which may be stored in a computer-readable storage medium, and when the computer program is executed by a processor, the steps of the method embodiments may be implemented. . Wherein the computer program 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: any entity or device capable of carrying the computer program code, recording medium, usb disk, removable hard disk, magnetic disk, optical disk, computer Memory, Read-Only Memory (ROM), Random Access Memory (RAM), electrical carrier wave signals, telecommunications signals, software distribution medium, and the like. It should be noted that the computer readable medium may contain other components which may be suitably increased or decreased as required by legislation and patent practice in jurisdictions, for example, in some jurisdictions, computer readable media which may not include electrical carrier signals and telecommunications signals in accordance with legislation and patent practice.
The above-mentioned embodiments are only used for illustrating the technical solutions of the present invention, and not for limiting the same; although the present invention 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 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 invention, and are intended to be included within the scope of the present invention.

Claims (10)

1. A hard disk state indicator lamp control method is characterized by comprising the following steps:
receiving an SGPIO BUS signal containing hard disk state information sent by a Raid card, wherein the SGPIO BUS signal comprises an SClock signal, a SLoad signal and an SDataOut signal;
judging whether the time that the SClock signal and the SLoad signal in the SGPIO BUS signal are simultaneously in a high level is less than a preset time threshold value;
if yes, reading the values of the SClock signal, the SLoad signal and the SDataOut signal in the SGPIO BUS signal according to a preset frequency, and assigning the read values to preset variables of delay _ SClock, delay _ SLoad and delay _ SDataOut, wherein bit widths of the variables of delay _ SClock, delay _ SLoad and delay _ SDataOut are all larger than 1;
analyzing the assigned delay _ sclock [ n ], delay _ slope [ n ] and delay _ sdaout [ n ], and giving a corresponding value of one bit of delay _ sdaout [ n ] to another variable data _ temp when each falling edge of the delay _ sclock [ n ], wherein the bit width of the variable data _ temp is 12, and 12 values of delay _ sdaout [ n ] can be added; wherein, delay _ sclock [ n ], delay _ sload [ n ] and delay _ sdaout [ n ] respectively represent the nth value of the variables delay _ sclock, delay _ sload and delay _ sdaout, and n is a positive integer;
counting the number of values of delay _ sdataout [ n ] contained in the variable data _ temp according to the value of delay _ sload [ n ], and assigning the value of data _ temp to another variable rec _ data after the assignment of the variable data _ temp is completed;
reading the value of the variable rec _ data, grouping the value of the variable rec _ data according to a preset strategy, analyzing the grouped data respectively to obtain the state of each hard disk, and controlling the indication of a corresponding hard disk indicator lamp.
2. The hard disk status indicator lamp control method according to claim 1, wherein the counting the number of values of delay _ sdataout [ n ] included in the variable data _ temp according to the value of delay _ slope [ n ], and assigning the value of data _ temp to another variable rec _ data after assignment of the variable data _ temp is completed comprises:
at each falling edge of delay _ sclock [ n ], judging whether the value of corresponding one bit of delay _ slope [ n ] is '1';
if yes, the number of the values of delay _ sdataout [ n ] contained in the data _ temp is counted as zero; if not, adding 1 to count the number of the values of delay _ sdataout [ n ] contained in the data _ temp;
when the count is 11, the assignment of the variable data _ temp is completed, and the value of the data _ temp is assigned to another variable rec _ data.
3. The hard disk status indicator lamp control method of claim 1, wherein reading the value of the variable rec _ data, grouping the value of the variable rec _ data according to a preset strategy, analyzing the grouped data respectively to obtain the status of each hard disk, and controlling the corresponding hard disk indicator lamp to indicate comprises:
reading the value of the variable rec _ data, grouping the value of the variable rec _ data into one group according to every 3 bits of data to obtain four groups of hard disk state data, wherein each group of hard disk state data corresponds to the state information of one hard disk;
and analyzing the state data of each group of hard disks respectively to acquire the state information of each hard disk and control the indication of a corresponding hard disk indicator lamp.
4. The hard disk status indicator lamp control method of claim 3, further comprising:
detecting whether the level of a GND pin of a hard disk slot is low;
if the level is low, analyzing the hard disk state data corresponding to the hard disk slot to acquire the state of the hard disk in the hard disk slot and control a corresponding hard disk indicator lamp to indicate;
if the level is high, the hard disk state data corresponding to the hard disk slot is not analyzed, and the hard disk indicator lamp corresponding to the hard disk slot is controlled to keep in an off state.
5. A hard disk status indicator light control apparatus, comprising:
the device comprises a signal receiving unit, a processing unit and a processing unit, wherein the signal receiving unit is used for receiving an SGPIO BUS signal which is sent by a Raid card and contains hard disk state information, and the SGPIO BUS signal comprises an SClock signal, a SLoad signal and an SDataOut signal;
the first judging unit is used for judging whether the time that the SClock signal and the SLoad signal in the SGPIO BUS signal are simultaneously in a high level is less than a preset time threshold value or not;
if so, reading the values of the SClock signal, the SLoad signal and the SDataOut signal in the SGPIO BUS signal according to a preset frequency, and assigning the read values to preset variables of delay _ SClock, delay _ SLoad and delay _ SDataOut, wherein bit widths of the variables of delay _ SClock, delay _ SLoad and delay _ SDataOut are all greater than 1;
the first assignment unit is used for analyzing the assigned delay _ sclock [ n ], delay _ slope [ n ] and delay _ sdataout [ n ], and when each delay _ sclock [ n ] falls, giving the value of one bit of delay _ sdataout [ n ] to another variable data _ temp, wherein the bit width of the variable data _ temp is 12, and 12 values of delay _ sdataout [ n ] can be put; wherein, delay _ sclock [ n ], delay _ sload [ n ] and delay _ sdaout [ n ] respectively represent the nth value of the variables delay _ sclock, delay _ sload and delay _ sdaout, and n is a positive integer;
the second assignment unit is used for counting the number of values of delay _ sdataout [ n ] contained in the variable data _ temp according to the value of delay _ sload [ n ], and assigning the value of data _ temp to another variable rec _ data after assignment of the variable data _ temp is completed;
and the hard disk state analyzing unit is used for reading the value of the variable rec _ data, grouping the value of the variable rec _ data according to a preset strategy, respectively analyzing the grouped data to acquire the state of each hard disk and control the corresponding hard disk indicator lamp to indicate.
6. The hard disk status indicator light control device of claim 5, wherein the second assignment unit is specifically configured to:
at each falling edge of delay _ sclock [ n ], judging whether the value of corresponding one bit of delay _ slope [ n ] is '1';
if yes, the number of the values of delay _ sdataout [ n ] contained in the data _ temp is counted as zero; if not, adding 1 to count the number of the values of delay _ sdataout [ n ] contained in the data _ temp;
when the count is 11, the assignment of the variable data _ temp is completed, and the value of the data _ temp is assigned to another variable rec _ data.
7. The device as claimed in claim 5, wherein the hard disk status analyzing unit is specifically configured to:
reading the value of the variable rec _ data, grouping the value of the variable rec _ data into one group according to every 3 bits of data to obtain four groups of hard disk state data, wherein each group of hard disk state data corresponds to the state information of one hard disk;
and analyzing the state data of each group of hard disks respectively to acquire the state information of each hard disk and control the indication of a corresponding hard disk indicator lamp.
8. The hard disk status indicator light control device of claim 7, further comprising a hard disk detection unit for:
detecting whether the level of a GND pin of a hard disk slot is low;
if the level is low, analyzing the hard disk state data corresponding to the hard disk slot to acquire the state of the hard disk in the hard disk slot and control a corresponding hard disk indicator lamp to indicate;
if the level is high, the hard disk state data corresponding to the hard disk slot is not analyzed, and the hard disk indicator lamp corresponding to the hard disk slot is controlled to keep in an off state.
9. A terminal comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that the processor implements the steps of the method according to any of claims 1 to 4 when executing the computer program.
10. A computer-readable storage medium, in which a computer program is stored which, when being executed by a processor, carries out the steps of the method according to any one of claims 1 to 4.
CN201710790553.5A 2017-09-05 2017-09-05 Hard disk state indicator lamp control method and device Active CN109426598B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710790553.5A CN109426598B (en) 2017-09-05 2017-09-05 Hard disk state indicator lamp control method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710790553.5A CN109426598B (en) 2017-09-05 2017-09-05 Hard disk state indicator lamp control method and device

Publications (2)

Publication Number Publication Date
CN109426598A CN109426598A (en) 2019-03-05
CN109426598B true CN109426598B (en) 2021-10-26

Family

ID=65514079

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710790553.5A Active CN109426598B (en) 2017-09-05 2017-09-05 Hard disk state indicator lamp control method and device

Country Status (1)

Country Link
CN (1) CN109426598B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112328457B (en) * 2020-11-20 2023-02-28 浪潮电子信息产业股份有限公司 Hard disk RAID type display device, display method and server
CN113138951B (en) * 2021-04-01 2022-09-20 山东英信计算机技术有限公司 Method, system and medium for connecting multiple devices through SGPIO
CN113377628B (en) * 2021-06-21 2023-03-14 东莞华贝电子科技有限公司 Server UID indicator lamp control device and control method

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN200950301Y (en) * 2006-06-05 2007-09-19 粟时平 Dynamic electric energy quality monitoring and analyzing device
CN101533334A (en) * 2008-03-10 2009-09-16 英业达股份有限公司 Hard disk interface device
CN103678014A (en) * 2013-12-18 2014-03-26 浪潮(北京)电子信息产业有限公司 Method for effectively detecting and analyzing SGPIO signals
CN105260144A (en) * 2015-11-09 2016-01-20 浪潮电子信息产业股份有限公司 Design method for optimizing hard disk management
CN105912076A (en) * 2016-04-20 2016-08-31 浪潮电子信息产业股份有限公司 Hard disk backplane and hard disk indicating light control method and system

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP4969791B2 (en) * 2005-03-30 2012-07-04 株式会社日立製作所 Disk array device and control method thereof

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN200950301Y (en) * 2006-06-05 2007-09-19 粟时平 Dynamic electric energy quality monitoring and analyzing device
CN101533334A (en) * 2008-03-10 2009-09-16 英业达股份有限公司 Hard disk interface device
CN103678014A (en) * 2013-12-18 2014-03-26 浪潮(北京)电子信息产业有限公司 Method for effectively detecting and analyzing SGPIO signals
CN105260144A (en) * 2015-11-09 2016-01-20 浪潮电子信息产业股份有限公司 Design method for optimizing hard disk management
CN105912076A (en) * 2016-04-20 2016-08-31 浪潮电子信息产业股份有限公司 Hard disk backplane and hard disk indicating light control method and system

Also Published As

Publication number Publication date
CN109426598A (en) 2019-03-05

Similar Documents

Publication Publication Date Title
CN109426598B (en) Hard disk state indicator lamp control method and device
CN104239187A (en) Hard disk state indicating device
CN102739195B (en) A kind of processing method of FIR filter, device and system
CN111045881A (en) Slow disk detection method and system
CN113219320B (en) BMS circuit board checking method, system, readable storage medium and terminal equipment
CN109240802B (en) Request processing method and device
CN111104157A (en) Mass production method and device of storage equipment, storage medium and electronic equipment
CN112948233A (en) Interface testing method, device, terminal equipment and medium
CN109918221B (en) Hard disk error reporting analysis method, system, terminal and storage medium
CN106844166B (en) Data processing method and device
CN113376514B (en) FPGA chip testing method, device, system and storage medium
CN110580220A (en) method for measuring execution time of code segment and terminal equipment
CN113742182A (en) Hard disk lighting method, device, storage medium and computer program product
CN117632637A (en) Hard disk management method, hard disk management device, computer readable storage medium and electronic equipment
CN111143092A (en) Fault recording data processing method and system and terminal equipment
CN111049717A (en) Variable acquisition method and equipment
CN114443445A (en) Hard disk lighting method and device, electronic equipment and storage medium
CN111352825B (en) Data interface testing method and device and server
CN112286855A (en) Adaptive SGPIO decoder realized through logic chip and program
CN108269004B (en) Product life analysis method and terminal equipment
CN103095487A (en) Indication method and indication device for multiple-internet-access status
JP2014120161A (en) System and method for detecting programming process
CN117394945B (en) Method, device and equipment for detecting ports of optical splitters based on multivariate algorithm
CN110968397B (en) Analysis method and device for virtual machine capacity management
CN112702068B (en) Method, device, equipment and storage medium for processing coded data

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
GR01 Patent grant
GR01 Patent grant