CN115292110A - Hard disk test method, device, equipment and storage medium - Google Patents
Hard disk test method, device, equipment and storage medium Download PDFInfo
- Publication number
- CN115292110A CN115292110A CN202211061732.2A CN202211061732A CN115292110A CN 115292110 A CN115292110 A CN 115292110A CN 202211061732 A CN202211061732 A CN 202211061732A CN 115292110 A CN115292110 A CN 115292110A
- Authority
- CN
- China
- Prior art keywords
- hard disk
- pressurization
- test
- target
- list
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000010998 test method Methods 0.000 title claims description 18
- 238000000034 method Methods 0.000 claims abstract description 125
- 238000012360 testing method Methods 0.000 claims abstract description 113
- 239000011159 matrix material Substances 0.000 claims abstract description 56
- 238000013112 stability test Methods 0.000 claims abstract description 31
- 238000004590 computer program Methods 0.000 claims description 17
- 238000011084 recovery Methods 0.000 claims description 9
- 230000002159 abnormal effect Effects 0.000 abstract description 11
- 238000004891 communication Methods 0.000 description 6
- 238000010586 diagram Methods 0.000 description 5
- 238000012430 stability testing Methods 0.000 description 2
- 239000000725 suspension Substances 0.000 description 2
- 230000005540 biological transmission Effects 0.000 description 1
- 238000012217 deletion Methods 0.000 description 1
- 230000037430 deletion Effects 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 238000012545 processing Methods 0.000 description 1
- 230000000750 progressive effect Effects 0.000 description 1
- 230000001052 transient effect Effects 0.000 description 1
- 230000001960 triggered effect Effects 0.000 description 1
- 238000012795 verification Methods 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/22—Detection or location of defective computer hardware by testing during standby operation or during idle time, e.g. start-up testing
- G06F11/2205—Detection or location of defective computer hardware by testing during standby operation or during idle time, e.g. start-up testing using arrangements specific to the hardware being tested
- G06F11/2221—Detection or location of defective computer hardware by testing during standby operation or during idle time, e.g. start-up testing using arrangements specific to the hardware being tested to test input/output devices or peripheral units
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/22—Detection or location of defective computer hardware by testing during standby operation or during idle time, e.g. start-up testing
- G06F11/2273—Test methods
Landscapes
- Engineering & Computer Science (AREA)
- General Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Computer Hardware Design (AREA)
- Quality & Reliability (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Test And Diagnosis Of Digital Computers (AREA)
Abstract
The application discloses a hard disk testing method, a device, equipment and a storage medium, which relate to the technical field of computers and comprise the following steps: identifying the model and the in-place information of the hard disk in the current system, and generating a corresponding hard disk list according to the model and the in-place information; determining the pressurization rate corresponding to each hard disk in the hard disk list based on the preset pressurization percentage and the theoretical reading and writing rate of the hard disk; generating a corresponding target matrix by using the pressurization rate and other target parameters; and performing pressurization test on each hard disk in the hard disk list by using a preset pressurization tool based on the target matrix, and interrupting the process of the pressurization test to finish the stability test on each hard disk. According to the method and the device, the hard disks in the generated hard disk list are subjected to the pressurization test based on the target matrix generated by utilizing the pressurization rate and other target parameters, the process of the pressurization test is subjected to the interruption test, and if the hard disks can be proved to be high in stability through the test, the hard disks are prevented from being subjected to abnormal phenomena such as disk falling in the using process.
Description
Technical Field
The present invention relates to the field of computer technologies, and in particular, to a hard disk test method, apparatus, device, and storage medium.
Background
At present, a hard disk is used as a server storage device, if the hard disk is abnormal in the using process, verification conditions such as service interruption, data loss and the like can be caused, under normal conditions, a pressure test on the hard disk can always perform reading or writing on the hard disk according to an arrangement and combination sequence set by a data block and other parameters, and the actual reading or writing rate of the hard disk cannot be influenced by selecting the size of the read-write data block; for hard disk stability testing, it is also essential to briefly stress the hard disk during a restart or restart in the usual manner. However, in an actual use scenario, the hard disk does not always have a full pressure state, and in most cases, reading and writing are always in a relatively low pressure state and have an intermittent idle state, so that the stability test of the hard disk in the working state cannot be covered in the pressure test process, and abnormal phenomena such as disk dropping and the like occur in the actual use process of a client.
Disclosure of Invention
In view of the above, an object of the present invention is to provide a hard disk testing method, apparatus, device and storage medium, which can prevent the hard disk from being dropped during the use process, thereby improving the stability of the hard disk. The specific scheme is as follows:
in a first aspect, the present application discloses a hard disk test method, including:
identifying the model and the in-place information of a hard disk in the current system, and generating a corresponding hard disk list according to the model and the in-place information;
determining the pressurization rate corresponding to each hard disk in the hard disk list based on the preset pressurization percentage and the theoretical reading and writing rate of the hard disks;
generating a corresponding target matrix using the pressurization rate and other target parameters;
and performing pressurization test on each hard disk in the hard disk list by using a preset pressurization tool based on the target matrix, and interrupting the process of the pressurization test to finish the stability test on each hard disk.
Optionally, before determining the pressurization rate corresponding to each hard disk in the hard disk list based on the preset pressurization percentage and the theoretical read-write rate of the hard disk, the method further includes:
and randomly generating a preset pressurization percentage corresponding to each hard disk in the hard disk list according to a preset pressurization percentage range.
Optionally, the performing, by using a preset pressing tool, a pressing test on each hard disk in the hard disk list based on the target matrix includes:
and performing pressurization test with preset pressurization test duration on each hard disk in the hard disk list by using a fio tool based on the target matrix.
Optionally, the hard disk test method further includes:
creating a target array, and determining the element number of the target array according to the acquired numjods number of the fio tool operation;
looking up each current pressurizing process, and storing the command sheet numbers intercepted from each pressurizing process into the target array until the number of the command sheet numbers in the target array meets the element number;
and creating a corresponding loop body according to the command sheet number in the target array.
Optionally, the creating a corresponding loop body according to the command sheet number in the target array includes:
and creating a while loop body according to the command sheet number in the target array.
Optionally, the interrupting the process of the pressure test to complete the stability test on each hard disk includes:
judging whether the pressurizing process corresponding to the current command order number is finished or not;
and if the pressurizing process corresponding to the current command sheet number is not finished, performing pause operation on the pressurizing process in the loop body according to a predetermined interrupt duration, and performing recovery operation on the pressurizing process in a pause state according to a predetermined running time to finish the stability test on each hard disk.
Optionally, after determining whether the pressurization process corresponding to the current command order number is finished, the method further includes:
and if the pressurization process corresponding to the current command list number is finished, deleting the current command list number in the target array.
In a second aspect, the present application discloses a hard disk testing device, comprising:
the hard disk identification module is used for identifying the model and the in-place information of the hard disk in the current system;
the hard disk list generating module is used for generating a corresponding hard disk list according to the model and the in-place information;
the pressurization rate determining module is used for determining the pressurization rate corresponding to each hard disk in the hard disk list based on the preset pressurization percentage and the theoretical read-write rate of the hard disk;
a target matrix generation module for generating a corresponding target matrix using the pressurization rate and other target parameters;
the hard disk pressurization testing module is used for performing pressurization testing on each hard disk in the hard disk list by using a preset pressurization tool based on the target matrix;
and the pressurizing process interruption module is used for interrupting the pressurizing test process so as to finish the stability test of each hard disk.
In a third aspect, the present application discloses an electronic device, comprising:
a memory for storing a computer program;
and the processor is used for executing the computer program to realize the steps of the hard disk testing method disclosed in the foregoing.
In a fourth aspect, the present application discloses a computer readable storage medium for storing a computer program; wherein the computer program realizes the steps of the hard disk test method disclosed in the foregoing when being executed by a processor.
Therefore, the application provides a hard disk test method, which comprises the following steps: identifying the model and the in-place information of a hard disk in the current system, and generating a corresponding hard disk list according to the model and the in-place information; determining the pressurization rate corresponding to each hard disk in the hard disk list based on the preset pressurization percentage and the theoretical reading and writing rate of the hard disk; generating a corresponding target matrix using the pressurization rate and other target parameters; and performing pressurization test on each hard disk in the hard disk list by using a preset pressurization tool based on the target matrix, and interrupting the process of the pressurization test to finish the stability test on each hard disk. Therefore, the hard disks in the identification system generate the corresponding hard disk lists, the determined pressurizing rate and other target parameters are used for generating the target matrix, then, the pressurizing test is carried out on the hard disks in the hard disk lists by using the preset pressurizing tool based on the target matrix, the process of the pressurizing test is interrupted to finish the stability test on the hard disks, if the hard disks can be tested, the stability of the hard disks is high, and the abnormal phenomena of disk falling and the like in the use process of the hard disks can be avoided.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the provided drawings without creative efforts.
FIG. 1 is a flow chart of a hard disk testing method disclosed in the present application;
FIG. 2 is a flow chart of a specific hard disk testing method disclosed in the present application;
FIG. 3 is a flow chart of a specific hard disk testing method disclosed in the present application;
FIG. 4 is a flowchart of a specific hard disk test method disclosed in the present application;
FIG. 5 is a schematic structural diagram of a hard disk test apparatus disclosed in the present application;
fig. 6 is a block diagram of an electronic device disclosed in the present application.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Currently, a pressure test on a hard disk always reads or writes the hard disk according to the data block and other parameter setting permutation and combination sequence, and the selection of the size of the read-write data block does not influence the actual read-write speed of the hard disk; for hard disk stability testing, it is also essential to briefly stress the hard disk during a restart or restart in the usual manner. However, in an actual use scenario, the hard disk does not always have a full pressure state, and in most cases, reading and writing are always in a relatively low pressure state and have an intermittent idle state, so that the stability test of the hard disk in the working state cannot be covered in the pressure test process, and abnormal phenomena such as disk dropping and the like occur in the actual use process of a client. Therefore, the application provides a hard disk test scheme, abnormal phenomena such as a disk falling phenomenon in the use process of the hard disk can be avoided, and the stability of the hard disk is improved.
The embodiment of the invention discloses a hard disk testing method, which is shown in figure 1 and comprises the following steps:
step S11: identifying the model and the in-place information of the hard disk in the current system, and generating a corresponding hard disk list according to the model and the in-place information.
In this embodiment, when a program starts to run, the model and the in-place information of a hard disk in a current system are identified, so that a corresponding hard disk list is generated according to the model and the in-place information, the interface rate of the hard disk can also be confirmed, then a Controller connected to the hard disk is confirmed, a smart log of the hard disk is checked in a corresponding manner, the sam log is stored in a corresponding storage space, and logs in the current system and a Baseboard Management Controller (BMC) are cleared. It is understood that the hard disk list records the information of each hard disk existing in the current system.
Step S12: and determining the pressurization rate corresponding to each hard disk in the hard disk list based on the preset pressurization percentage and the theoretical reading and writing rate of the hard disk.
In this embodiment, the pressurization rate corresponding to each hard disk in the hard disk list is determined, that is, the pressurization rate is determined by referring to the obtained theoretical read-write rate of the hard disk, that is, the pressurization rate corresponding to the hard disk list is determined based on the preset pressurization percentage and the read-write rate of the hard disk. It can be understood that, multiplying the hard disk read/write speed by the preset pressurization percentage to obtain a corresponding product result, and rounding the product result to obtain a corresponding pressurization speed, for example, the pressurization speed rate =1mb,500kb, i.e. the read limiting speed is 1MB/s, and the write limiting speed is 500KB/s; in this way, the low pressure use of the hard disk in practical use is simulated, and the rate parameter, i.e. the pressurization rate, is only one parameter of the fio running program.
Step S13: a corresponding target matrix is generated using the pressurization rate and other target parameters.
In this embodiment, during the determination of the pressurization rate, that is, the rate parameter, corresponding to each hard disk in the hard disk list, other target parameters need to be determined, where the other target parameters may include, but are not limited to bs, rw, iodeps, numjods, and the like, for example, bs =1k,2k,4k,8k,16k,32k,64k,128k,256k,512k, 4k,2048k; rw = read, write, randread, randwrite, randrw; the numjobs is the number of processes that will be generated when fio is operated, and the like, and then the pressurizing rate and other target parameters are used to generate a corresponding target matrix, that is, the parameters are arranged and combined to obtain the target matrix, and each individual combination is used as a pressure test item when the parameters are arranged and combined.
Step S14: and performing pressurization test on each hard disk in the hard disk list by using a preset pressurization tool based on the target matrix, and interrupting the process of the pressurization test to finish the stability test on each hard disk.
In this embodiment, after the corresponding target matrix is generated by using the pressurization rate and other target parameters, a pressurization test may be performed on each hard disk in the hard disk list by using a preset pressurization tool based on the target matrix. It can be understood that the pressurization rates and the other target parameters are arranged and combined to obtain a target matrix, and each individual combination is used as a pressure test item, and the preset pressurization test tool is used to perform a pressurization test on each hard disk in the hard disk list, that is, a related pressurization command is executed on each hard disk in the hard disk list, and then the process of the pressurization test is interrupted to complete the stability test on each hard disk, that is, after the pressurization command corresponding to each pressure test item is executed, whether the corresponding hard disk has a read-write process or not can be determined, and the process of the pressurization test is interrupted to complete the stability test on each hard disk.
It can be seen that, in the embodiment of the present application, a corresponding hard disk list is generated by identifying a hard disk in a system, a target matrix is generated by using the determined pressurization rate and other target parameters, and then a pressurization test is performed on each hard disk in the hard disk list by using a preset pressurization tool based on the target matrix, and the process of the pressurization test is interrupted to complete the stability test on each hard disk, if the hard disk can be tested, the stability of the hard disk is high, so that abnormal phenomena such as disk dropping and the like in the use process of the hard disk can be avoided.
Referring to fig. 2, the embodiment of the present invention discloses a specific hard disk test method, and compared with the previous embodiment, the present embodiment further describes and optimizes the technical solution.
Step S21: identifying the model and the in-place information of the hard disk in the current system, and generating a corresponding hard disk list according to the model and the in-place information.
Step S22: and randomly generating a preset pressurization percentage corresponding to each hard disk in the hard disk list according to a preset pressurization percentage range.
In this embodiment, a corresponding hard disk list is generated according to the identified model and in-place information of the hard disk in the current system, and then the preset pressurization percentage corresponding to each hard disk in the hard disk list may be randomly generated according to the preset pressurization percentage range. It is understood that the preset pressurization percentage corresponding to each hard disk in the hard disk list is generated within the preset pressurization percentage range.
Step S23: and determining the pressurization rate corresponding to each hard disk in the hard disk list based on the preset pressurization percentage and the theoretical reading and writing rate of the hard disk.
Step S24: a corresponding target matrix is generated using the pressurization rate and other target parameters.
Step S25: and performing pressurization test on each hard disk in the hard disk list by using a preset pressurization tool based on the target matrix, and interrupting the process of the pressurization test to finish the stability test on each hard disk.
For the specific contents of the step S21 and the steps S23 to S25, reference may be made to the corresponding contents disclosed in the foregoing embodiments, and details are not repeated herein.
It can be seen that, in the embodiment of the present application, a corresponding hard disk list is generated by identifying a hard disk in a system, a target matrix is generated by using the determined pressurization rate and other target parameters, and then a pressurization test is performed on each hard disk in the hard disk list by using a preset pressurization tool based on the target matrix, and the process of the pressurization test is interrupted to complete the stability test on each hard disk, if the hard disk can be tested, the stability of the hard disk is high, so that abnormal phenomena such as disk dropping and the like in the use process of the hard disk can be avoided.
Referring to fig. 3, the embodiment of the present invention discloses a specific hard disk test method, and compared with the previous embodiment, the present embodiment further describes and optimizes the technical solution.
Step S31: identifying the model and the in-place information of the hard disk in the current system, and generating a corresponding hard disk list according to the model and the in-place information.
Step S32: and determining the pressurization rate corresponding to each hard disk in the hard disk list based on the preset pressurization percentage and the theoretical reading and writing rate of the hard disks.
Step S33: a corresponding target matrix is generated using the pressurization rate and other target parameters.
Step S34: and performing pressurization test on each hard disk in the hard disk list for a preset pressurization test duration by using a fio tool based on the target matrix, and interrupting the process of the pressurization test to finish the stability test on each hard disk.
In this embodiment, after the corresponding target matrix is generated by using the pressurization rate and other target parameters, a pressurization test may be performed on each hard disk in the hard disk list by using a fio tool based on the target matrix. It can be understood that the pressurization rates and the other target parameters are arranged and combined to obtain a target matrix, each individual combination is used as a pressure test item, then the fio tool is used to perform a pressurization test on each hard disk in the hard disk list according to a preset pressurization test duration, that is, a fio pressurization command is run on each disk in the hard disk list, and the hard disk is pressurized for the preset pressurization test duration, that is, after the fio pressurization command corresponding to each pressure test item is run, whether a read-write process exists on the corresponding hard disk can be judged, and the process of the pressurization test is interrupted to complete the stability test on each hard disk.
For the specific contents of the above steps S31 to S33, reference may be made to the corresponding contents disclosed in the foregoing embodiments, and details are not repeated herein.
It can be seen that, in the embodiment of the present application, a corresponding hard disk list is generated by identifying a hard disk in a system, a target matrix is generated by using the determined pressurization rate and other target parameters, and then a pressurization test is performed on each hard disk in the hard disk list by using a preset pressurization tool based on the target matrix, and the process of the pressurization test is interrupted to complete the stability test on each hard disk, if the hard disk can be tested, the stability of the hard disk is high, so that abnormal phenomena such as disk dropping and the like in the use process of the hard disk can be avoided.
Referring to fig. 4, the embodiment of the present invention discloses a specific hard disk test method, and compared with the previous embodiment, the present embodiment further describes and optimizes the technical solution.
Step S41: identifying the model and the in-place information of the hard disk in the current system, and generating a corresponding hard disk list according to the model and the in-place information.
Step S42: and determining the pressurization rate corresponding to each hard disk in the hard disk list based on the preset pressurization percentage and the theoretical reading and writing rate of the hard disk.
Step S43: a corresponding target matrix is generated using the pressurization rate and other target parameters.
Step S44: and performing pressurization test on each hard disk in the hard disk list for a preset pressurization test time length by using a fio tool based on the target matrix.
Step S45: and creating a target array, and determining the element number of the target array according to the acquired numjods number of the fio tool operation.
In this embodiment, in the process of performing a pressurization test on each hard disk in the hard disk list for a preset pressurization test duration by using the fio tool based on the target matrix, the process of the pressurization test is interrupted to complete the stability test on each hard disk, specifically, a target array is created, and the number of elements of the target array is determined according to the numjods obtained by acquiring the operation of the fio tool. It can be understood that the interruption of the process of the pressurization test is performed after the hard disk is successfully pressurized, for example, a target array pid is created, numjods of the operation of the fio tool are acquired, and the number of elements corresponding to the target array pid to be created is determined according to the numjods, that is, the acquired number of elements of the operation of the fio tool determines the number of elements of the target array pid.
Step S46: and looking up the current pressurizing processes, and storing the command sheet numbers intercepted from the pressurizing processes into the target array until the number of the command sheet numbers in the target array meets the number of the elements.
In this embodiment, the current pressurizing processes can be checked, the states of the pressurizing processes can be checked by using ps commands, and the command sheet numbers intercepted from the pressurizing processes are stored in the target array until the number of the command sheet numbers in the target array meets the number of the elements. It can be understood that the element in the target array is a command order number corresponding to each process. For example, a ps command is used to view the status of a fio process, a second number is intercepted for each process, and the second number is stored in a target array pid, where the second number is a command order number, that is, the command order number is stored in the target array pid, that is, each element of the target array pid is an acquired command order number, and the related instructions are as follows:
ps aux|grep fio|awk‘{print$2}’
it is noted that the target array may use a link array for addition and deletion.
Step S47: and creating a corresponding loop body according to the command sheet number in the target array.
In this embodiment, the creation of the target array is completed, and the command sheet numbers intercepted from the respective pressurization processes are stored in the target array, until the number of the command sheet numbers in the target array satisfies the number of the elements, a corresponding loop body is created according to the command sheet numbers in the target array. As can be appreciated, a corresponding loop is created for the command sheet number in each target array pid. For example, a while loop body is created according to the command sheet number in the target array, that is, the created loop body may be a while loop body.
Step S48: and judging whether the pressurizing process corresponding to the current command sheet number is finished or not.
In this embodiment, a corresponding loop body is created according to the command sheet number in the target array, and then whether the pressurization process corresponding to the current command sheet number is finished is determined, which can be understood as whether the judgment of the loop body is based on whether the pressurization process corresponding to the current command sheet number is finished.
Step S49: and if the pressurizing process corresponding to the current command sheet number is not finished, performing pause operation on the pressurizing process in the loop body according to a predetermined interrupt duration, and performing recovery operation on the pressurizing process in a pause state according to a predetermined running time to finish the stability test on each hard disk.
In this embodiment, when determining whether the pressurization process corresponding to the current command sheet is finished, if it is determined that the pressurization process corresponding to the current command sheet is not finished, a pause operation is performed on the pressurization process in the loop body according to a predetermined interrupt duration, and a recovery operation is performed on the pressurization process in a pause state according to a predetermined running time, so as to complete the stability test on each hard disk. And if the pressurizing process corresponding to the current command sheet number is finished, deleting the current command sheet number in the target array. For example, if it is determined that the pressurization process corresponding to the current command single number is not finished, entering the loop body, sequentially performing process suspension and process recovery, wherein the kill-STOP command is used to suspend the process, and the command for performing process suspension is as follows:
kill–STOP pid(x);
sleep$((RANDOM%($Haltrange)));
the procedure is resumed using the kill-CONT command, and the command to perform the procedure resumption is as follows:
kill–CONT pid(x);
sleep$((RANDOM%($Processrange)));
and when the current loop is ended, returning to the while statement to judge whether the current process is ended or not.
It should be noted that, in the case of restarting a new stress test item in a stress test, the process interruption is triggered to be restarted each time a new stress test item is restarted, since the end of the previous stress test item would cause the process to end, and thus the run involving the process interruption would also end. After all the pressure test items are finished, checking the in-place state of each hard disk in the hard disk list and the smart log information of each hard disk, if the hard disk has a disk-dropping condition, or comparing the acquired smart log with the smart log before testing, and then comparing the error number of the smart log before and after testing, if the error number is increased, judging that the current testing fails, and if the system log or the BMC log has a hard disk related error report, also judging that the current testing fails.
For the specific contents of the above steps S41 to S44, reference may be made to the corresponding contents disclosed in the foregoing embodiments, and details are not repeated herein.
It can be seen that, in the embodiment of the present application, a corresponding hard disk list is generated by identifying a hard disk in a system, a target matrix is generated by using the determined pressurization rate and other target parameters, and then a pressurization test is performed on each hard disk in the hard disk list by using a preset pressurization tool based on the target matrix, and the process of the pressurization test is interrupted to complete the stability test on each hard disk, if the hard disk can be tested, the stability of the hard disk is high, so that abnormal phenomena such as disk dropping and the like in the use process of the hard disk can be avoided.
Correspondingly, the embodiment of the present application further discloses a hard disk testing apparatus, as shown in fig. 5, the apparatus includes:
the hard disk identification module 11 is used for identifying the model and the in-place information of a hard disk in the current system;
a hard disk list generating module 12, configured to generate a corresponding hard disk list according to the model and the in-place information;
a pressurization rate determination module 13, configured to determine a pressurization rate corresponding to each hard disk in the hard disk list based on a preset pressurization percentage and a theoretical read-write rate of the hard disk;
a target matrix generation module 14 for generating a corresponding target matrix using the pressurization rate and other target parameters;
a hard disk pressurization testing module 15, configured to perform pressurization testing on each hard disk in the hard disk list by using a preset pressurization tool based on the target matrix;
and the pressurizing process interruption module 16 is used for interrupting the pressurizing test process so as to complete the stability test of each hard disk.
In this embodiment, the hard disk identification module 11 identifies the model and the in-place information of the hard disk in the current system, the hard disk list generation module 12 generates a corresponding hard disk list according to the model and the in-place information, and may also determine the interface rate of the hard disk, then determine the controller to which the hard disk is connected, view the smart log of the hard disk in a corresponding manner, store the samrt log in a corresponding storage space, and simultaneously clear the current logs in the system and the BMC. It is understood that the hard disk list records the information of each hard disk existing in the current system. The pressurization rate determining module 13 determines the pressurization rate corresponding to each hard disk in the hard disk list, that is, the pressurization rate determining module 13 determines the pressurization rate by referring to the obtained theoretical read-write rate of the hard disk, and the pressurization rate determining module 13 determines the pressurization rate corresponding to the hard disk list based on the preset pressurization percentage and the read-write rate of the hard disk. It is understood that, the pressurization rate determination module 13 multiplies the hard disk read/write rate and the preset pressurization percentage to obtain a corresponding product result, and performs rounding processing on the product result to obtain a corresponding pressurization rate, for example, the pressurization rate =1MB,500kb, i.e., the limited read rate is 1MB/s, and the limited write rate is 500KB/s; in this way, the low pressure use of the hard disk in practical use is simulated, and the rate parameter, i.e. the pressurization rate, is only one parameter of the fio running program. The target matrix generation module 14 generates corresponding target matrices by using the pressurization rate and other target parameters, that is, the target matrix generation module 14 performs permutation and combination on the parameters to obtain the target matrix, and when the parameters are permutated and combined, each individual combination is used as a pressure test item. The pressurization rate and the other target parameters are arranged and combined to obtain a target matrix, each individual combination is used as a pressure test item, each hard disk in the hard disk list is subjected to pressurization test by using the preset pressurization test tool through the hard disk pressurization test module 15, namely, each disk in the hard disk list is subjected to a related pressurization command, then the process of the pressurization test is interrupted through the pressurization process interruption module 16 to complete the stability test on each hard disk, namely, after the pressurization command corresponding to each pressure test item runs, whether the corresponding hard disk has a read-write process or not can be judged, and the process of the pressurization test is interrupted to complete the stability test on each hard disk.
Therefore, in the embodiment of the application, the corresponding hard disk list is generated by identifying the hard disks in the system, the determined pressurizing rate and other target parameters are used for generating the target matrix, the pressurizing test is performed on each hard disk in the hard disk list by using the preset pressurizing tool based on the target matrix, the process of the pressurizing test is interrupted to complete the stability test on each hard disk, and if the hard disk can be tested, the stability of the hard disk is high, so that the abnormal phenomena such as disk falling and the like in the use process of the hard disk can be avoided.
In some specific embodiments, the hard disk test apparatus may specifically include:
and the pressurization percentage generating module is used for randomly generating preset pressurization percentages corresponding to the hard disks in the hard disk list according to a preset pressurization percentage range.
In some specific embodiments, the hard disk pressurization testing module 15 may specifically include:
and the hard disk pressurization testing unit is used for carrying out pressurization testing on each hard disk in the hard disk list for a preset pressurization testing time length by using a fio tool based on the target matrix.
In some specific embodiments, the hard disk test apparatus may specifically include:
the array creating module is used for creating a target array;
the element number determining module is used for determining the element number of the target array according to the acquired numjods of the fio tool operation;
the pressurizing process checking module is used for checking each current pressurizing process;
a command order number storage module, configured to store the command order numbers intercepted from each of the pressurization processes in the target array until the number of command order numbers in the target array satisfies the number of elements;
and the loop body creating module is used for creating a corresponding loop body according to the command sheet number in the target array.
In some specific embodiments, the loop body creating module may specifically include:
and the loop body creating unit is used for creating a while loop body according to the command sheet number in the target array.
In some specific embodiments, the pressurized process interruption module 16 may specifically include:
the judging module is used for judging whether the pressurizing process corresponding to the current command order number is finished or not;
and the process interruption and recovery module is used for performing pause operation on the pressurization process in the loop body according to a predetermined interruption duration and performing recovery operation on the pressurization process in a pause state according to a predetermined running time to finish the stability test on each hard disk when the pressurization process corresponding to the current command order number is not finished.
And the command list number deleting module is used for deleting the current command list number in the target array when the pressurizing process corresponding to the current command list number is finished.
For example, the whole hard disk test system may include a pressurizing unit and an interruption unit, wherein the pressurizing unit simulates the low pressure use condition of the hard disk in practical application by setting a rate parameter, i.e. a pressurizing rate, and controlling the rate in the hard disk pressurizing process, and the rate parameter is generated according to the acquired theoretical read-write rate of the hard disk and a preset percentage randomly generated in a preset pressurizing range. The interruption unit randomly interrupts and recovers the fio process, randomly generates corresponding interruption time and recovery time, judges whether the fio process is circularly performed or not in the interruption and recovery process, and finally performs basic check on the log related to the hard disk.
Further, the embodiment of the application also provides electronic equipment. FIG. 6 is a block diagram illustrating an electronic device 20 according to an exemplary embodiment, and the contents of the diagram should not be construed as limiting the scope of use of the present application in any way.
Fig. 6 is a schematic structural diagram of an electronic device 20 according to an embodiment of the present disclosure. The electronic device 20 may specifically include: at least one processor 21, at least one memory 22, a power supply 23, a communication interface 24, an input output interface 25, and a communication bus 26. The memory 22 is configured to store a computer program, and the computer program is loaded and executed by the processor 21 to implement relevant steps in the hard disk testing method disclosed in any of the foregoing embodiments. In addition, the electronic device 20 in the present embodiment may be specifically an electronic computer.
In this embodiment, the power supply 23 is configured to provide an operating voltage for each hardware device on the electronic device 20; the communication interface 24 can create a data transmission channel between the electronic device 20 and an external device, and a communication protocol followed by the communication interface is any communication protocol that can be applied to the technical solution of the present application, and is not specifically limited herein; the input/output interface 25 is configured to acquire external input data or output data to the outside, and a specific interface type thereof may be selected according to specific application requirements, which is not specifically limited herein.
In addition, the storage 22 is used as a carrier for storing resources, and may be a read-only memory, a random access memory, a magnetic disk or an optical disk, etc., and the resources stored thereon may include an operating system 221, a computer program 222, etc., and the storage manner may be a transient storage manner or a permanent storage manner.
The operating system 221 is used for managing and controlling each hardware device on the electronic device 20 and the computer program 222, and may be Windows Server, netware, unix, linux, or the like. The computer program 222 may further include a computer program that can be used to perform other specific tasks in addition to the computer program that can be used to perform the hard disk test method performed by the electronic device 20 disclosed in any of the foregoing embodiments.
Further, an embodiment of the present application further discloses a computer-readable storage medium, where a computer program is stored in the computer-readable storage medium, and when the computer program is loaded and executed by a processor, the steps of the hard disk testing method disclosed in any of the foregoing embodiments are implemented.
The embodiments are described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same or similar parts among the embodiments are referred to each other. The device disclosed by the embodiment corresponds to the method disclosed by the embodiment, so that the description is simple, and the relevant points can be referred to the method part for description.
Finally, it should also be noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrases "comprising one of 8230; \8230;" 8230; "does not exclude the presence of additional like elements in a process, method, article, or apparatus that comprises the element.
The hard disk test method, device, equipment and storage medium provided by the invention are described in detail, specific examples are applied in the text to explain the principle and the implementation of the invention, and the description of the above embodiments is only used to help understanding the method and the core idea of the invention; meanwhile, for a person skilled in the art, according to the idea of the present invention, there may be variations in the specific embodiments and the application scope, and in summary, the content of the present specification should not be construed as a limitation to the present invention.
Claims (10)
1. A hard disk test method is characterized by comprising the following steps:
identifying the model and the in-place information of a hard disk in the current system, and generating a corresponding hard disk list according to the model and the in-place information;
determining the pressurization rate corresponding to each hard disk in the hard disk list based on the preset pressurization percentage and the theoretical reading and writing rate of the hard disks;
generating a corresponding target matrix using the pressurization rate and other target parameters;
and performing pressurization test on each hard disk in the hard disk list by using a preset pressurization tool based on the target matrix, and interrupting the process of the pressurization test to finish the stability test on each hard disk.
2. The method of claim 1, wherein before determining the stress rate corresponding to each hard disk in the hard disk list based on the preset stress percentage and the theoretical read-write rate of the hard disk, the method further comprises:
and randomly generating a preset pressurization percentage corresponding to each hard disk in the hard disk list according to a preset pressurization percentage range.
3. The hard disk test method of claim 1, wherein the pressure test of each hard disk in the hard disk list by using a preset pressure tool based on the target matrix comprises:
and performing pressurization test on each hard disk in the hard disk list for a preset pressurization test time length by using a fio tool based on the target matrix.
4. The hard disk test method of claim 3, further comprising:
creating a target array, and determining the element number of the target array according to the acquired numjods number of the fio tool operation;
looking up each current pressurizing process, and storing the command sheet numbers intercepted from each pressurizing process into the target array until the number of the command sheet numbers in the target array meets the number of the elements;
and creating a corresponding loop body according to the command sheet number in the target array.
5. The hard disk test method of claim 4, wherein the creating a corresponding loop body according to the command sheet number in the target array comprises:
and creating a while loop body according to the command sheet number in the target array.
6. The hard disk test method according to any one of claims 1 to 5, wherein the step of interrupting the process of the pressure test to complete the stability test of each hard disk comprises the steps of:
judging whether the pressurizing process corresponding to the current command order number is finished or not;
and if the pressurizing process corresponding to the current command sheet is not finished, performing pause operation on the pressurizing process in the circulation body according to a predetermined interrupt duration, and performing recovery operation on the pressurizing process in a pause state according to a predetermined running time to finish the stability test on each hard disk.
7. The method of claim 6, wherein after determining whether the pressurization process corresponding to the current command ticket number is finished, the method further comprises:
and if the pressurizing process corresponding to the current command sheet number is finished, deleting the current command sheet number in the target array.
8. A hard disk testing device, comprising:
the hard disk identification module is used for identifying the model and the in-place information of the hard disk in the current system;
the hard disk list generating module is used for generating a corresponding hard disk list according to the model and the in-place information;
the pressurization rate determining module is used for determining the pressurization rate corresponding to each hard disk in the hard disk list based on the preset pressurization percentage and the theoretical read-write rate of the hard disk;
the target matrix generation module is used for generating a corresponding target matrix by using the pressurization rate and other target parameters;
the hard disk pressurization testing module is used for performing pressurization testing on each hard disk in the hard disk list by using a preset pressurization tool based on the target matrix;
and the pressurizing process interruption module is used for interrupting the pressurizing test process so as to finish the stability test of each hard disk.
9. An electronic device, comprising:
a memory for storing a computer program;
a processor for executing said computer program for carrying out the steps of the hard disk testing method according to any one of claims 1 to 7.
10. A computer-readable storage medium for storing a computer program; wherein the computer program realizes the steps of the hard disk testing method according to any one of claims 1 to 7 when executed by a processor.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202211061732.2A CN115292110A (en) | 2022-08-31 | 2022-08-31 | Hard disk test method, device, equipment and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202211061732.2A CN115292110A (en) | 2022-08-31 | 2022-08-31 | Hard disk test method, device, equipment and storage medium |
Publications (1)
Publication Number | Publication Date |
---|---|
CN115292110A true CN115292110A (en) | 2022-11-04 |
Family
ID=83832265
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202211061732.2A Pending CN115292110A (en) | 2022-08-31 | 2022-08-31 | Hard disk test method, device, equipment and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN115292110A (en) |
-
2022
- 2022-08-31 CN CN202211061732.2A patent/CN115292110A/en active Pending
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US7162408B2 (en) | Subscriber identification module (SIM) emulator | |
CN111414389B (en) | Data processing method and device, electronic equipment and storage medium | |
CN104834602B (en) | A kind of program dissemination method, device and program delivery system | |
CN103164523A (en) | Inspection method, device and system of data consistency inspection | |
CN103198122B (en) | Restart the method and apparatus of memory database | |
CN112148542A (en) | Reliability test method, device and system for distributed storage cluster | |
CN108475201A (en) | A kind of data capture method in virtual machine start-up course and cloud computing system | |
CN112650676A (en) | Software testing method, device, equipment and storage medium | |
US20240419354A1 (en) | Disk processing method and system, and electronic device | |
CN107479823A (en) | Data verification method and device in the test of random read-write file | |
CN107329914A (en) | It is a kind of that the out of order method and device of hard disk is detected based on linux system | |
CN109933479B (en) | Fault simulation and emulation method and related equipment | |
CN108874611A (en) | A kind of construction method and device of test data | |
CN110291505A (en) | Reduce the recovery time of application | |
CN105022663B (en) | Power system monitoring and control system | |
CN113268206B (en) | Network target range resource hot plug implementation method and system | |
CN109741786A (en) | A kind of solid state hard disk monitoring method, device and equipment | |
CN115292110A (en) | Hard disk test method, device, equipment and storage medium | |
US20240037009A1 (en) | Techniques for Data Log Processing, Retention, and Storage | |
CN114895879B (en) | Management system design scheme determining method, device, equipment and storage medium | |
CN116414722A (en) | Fuzz test processing method, device, fuzz test system and storage medium | |
CN112306954B (en) | File system testing method and device | |
CN111045891B (en) | Monitoring method, device, equipment and storage medium based on java multithreading | |
CN113835912B (en) | Crash information processing method and device for application program | |
CN111367731A (en) | Method and equipment for testing low delay of storage performance |
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 |