Disk array hard disk replacement method and device, computer equipment and storage medium

By judging the data transmission capacity and performance parameters of the hard drive, ensuring that the new hard drive meets the requirements before adding RAID, it solves the problem of time-consuming and labor-intensive replacement of hard drives and may affect storage performance, and achieves an efficient and accurate hard drive replacement process.

CN118796128APending Publication Date: 2024-10-18INSPUR SUZHOU INTELLIGENT TECH CO LTD
View PDF 0 Cites 3 Cited by

Patent Information

Application Number
CN202410972505.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-19
Publication Date
2024-10-18

AI Technical Summary

Technical Problem

In the existing technology, when replacing a hard disk in a RAID, the operation is time-consuming, labor-intensive, and error-prone, and there is no guarantee that the storage performance of the disk array will not be affected after the new hard disk is added.

Method used

By judging whether the hard disk to be tested can transmit data and comparing it with the basic information of other hard disks, we conduct a read and write performance test to ensure that the performance parameters of the new hard disk meet the requirements before adding it to the disk array to ensure that storage performance will not be affected.

Benefits of technology

Efficient replacement of hard drives is achieved, reducing the risk of human intervention and operational errors, ensuring that the addition of new hard drives will not affect RAID storage performance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118796128A_ABST
    Figure CN118796128A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of data storage, and discloses a disk array hard disk replacement method and device, computer equipment and a storage medium, and the method comprises the steps: taking a hard disk of which the time of changing from an offline state to an online state in a disk array is greater than a preset threshold value as a to-be-detected hard disk; judging whether the to-be-detected hard disk can perform data transmission or not, and if the to-be-detected hard disk can perform data transmission, acquiring first basic information of the to-be-detected hard disk; comparing the first basic information with second basic information of other hard disks in the disk array; and if the first basic information is consistent with the second basic information, performing a read-write performance test on the to-be-detected hard disk, and if a first performance parameter in a test result is smaller than a second performance parameter of other hard disks in the disk array, adding the to-be-detected hard disk into the disk array. The problems that disk replacement operation is time-consuming and labor-consuming, errors are prone to occurring, and the storage performance of the disk array is possibly affected are solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of data storage, and in particular to a disk array hard disk replacement method, device, computer equipment and storage medium. Background Art

[0002] In the routine maintenance of Redundant Arrays of Independent Disks (RAID), if a hard disk in the RAID fails, the failed hard disk must be replaced in time and a new hard disk must be added to the RAID to ensure the integrity of the RAID and data security.

[0003] Currently, the replacement of a faulty hard disk in RAID requires gradually updating the hard disk status, manually adding it to the RAID, and then initiating RAID reconstruction, which is time-consuming, labor-intensive, and prone to errors. However, the above process can only determine that the hard disk is basically available and meets the basic requirements for adding a hard disk to RAID, but cannot guarantee that the addition of the new hard disk to the RAID will not affect the overall storage performance of the RAID.

[0004] Therefore, the related art has the problem that the disk replacement operation is time-consuming and labor-intensive, prone to errors, and may affect the storage performance of the disk array. Summary of the invention

[0005] In view of this, the present invention provides a disk array hard disk replacement method, device, computer equipment and storage medium to solve the problem that the disk replacement operation is time-consuming and labor-intensive, prone to errors, and may affect the storage performance of the disk array.

[0006] In a first aspect, the present invention provides a method for replacing a hard disk of a disk array, comprising:

[0007] The hard disks in the disk array whose time from offline state to online state is greater than a preset threshold are regarded as hard disks to be detected;

[0008] Determine whether the hard disk to be detected can perform data transmission, and if the hard disk to be detected can perform data transmission, obtain first basic information of the hard disk to be detected;

[0009] Comparing the first basic information with the second basic information of other hard disks in the disk array;

[0010] If the first basic information is consistent with the second basic information, the hard disk to be tested is tested for read and write performance. If the first performance parameter in the test result is less than the second performance parameter of other hard disks in the disk array, the hard disk to be tested is added to the disk array.

[0011] The disk array hard disk replacement method provided in this embodiment determines whether the hard disk to be tested is available by determining whether it can perform data transmission; determines whether the hard disk to be tested is consistent with other hard disks in the disk array by comparing the first basic information with the second basic information of other hard disks in the disk array; determines whether the read and write performance of the hard disk to be tested affects the storage performance of the disk array by performing a read and write performance test on the hard disk to be tested and comparing the first performance parameter and the second performance parameter. If all the above tests are passed, the hard disk to be tested is added to the disk array to achieve efficient replacement of the disk array hard disk and ensure that the newly replaced hard disk will not affect the storage performance of the disk array. The problem that the disk replacement operation is time-consuming and labor-intensive, prone to errors, and may affect the storage performance of the disk array is solved.

[0012] In some optional implementations, determining whether the hard disk to be detected is capable of data transmission includes:

[0013] Get the port status information of the hard disk to be detected;

[0014] Sending a first preset instruction to the hard disk to be detected to obtain response information of the hard disk to be detected;

[0015] If it is determined according to the port status information that the hard disk to be detected can perform data transmission, and it is determined according to the response information that the hard disk to be detected can perform data transmission, then it is determined that the hard disk to be detected can perform data transmission.

[0016] In this embodiment, whether the hard disk to be detected can perform data transmission is determined based on the port status information and corresponding information, ensuring that the hard disk to be detected is available, ensuring that the subsequent detection process proceeds smoothly and avoiding affecting the RAID storage performance due to the unavailability of the hard disk to be detected after adding the hard disk to the RAID.

[0017] In some optional implementations, performing a read / write performance test on a hard disk to be tested, and if a first performance parameter in the test result is less than a second performance parameter of other hard disks in the disk array, adding the hard disk to be tested to the disk array includes:

[0018] Obtaining a first preset number of historical read and write commands of other hard disks in the disk array and first response delays of other hard disks to the historical read and write commands, and determining a first average response delay corresponding to the first response delay, wherein the first average response delay is included in the second performance parameter;

[0019] Determine the average load parameters of historical read and write commands, and generate test read and write commands based on the average load parameters;

[0020] Repeat the preset test logic until the repeated execution time is equal to the first preset time, then stop, and determine the second average response delay of the hard disk to be tested to the test read and write command, wherein the second average response delay is included in the first performance parameter;

[0021] The preset test logic satisfies: sending a test read / write command to the hard disk to be tested, and obtaining a second response delay of the hard disk to be tested to the test read / write command, wherein the second response delay is used to obtain a second average response delay;

[0022] In the process of repeatedly executing the first test logic, a second preset number of second preset instructions are sent to the hard disk to be detected, and a third response delay of the hard disk to be detected to the second preset number of second preset instructions is obtained;

[0023] Taking the historical read / write commands of other hard disks whose first response delay is greater than the first preset threshold as the target read / write commands;

[0024] If the second response delays are all less than the second preset threshold, the target read / write command is sent to the hard disk to be detected, and a third average response delay of the hard disk to be detected to the target read / write command is determined, wherein the third average response delay is included in the first performance parameter;

[0025] Determine, according to the first response delay of the other hard disks to the target read / write command, a fourth average response delay of the other hard disks to the target read / write command, wherein the fourth average response delay is included in the second performance parameter;

[0026] If the second average response delay is less than the first average response delay and the third average response delay is less than the fourth average response delay, the hard disk to be detected is added to the disk array.

[0027] In this embodiment, a read and write performance test is performed on the hard disk to be tested, and a first performance parameter of the hard disk to be tested is determined based on the test result. By comparing the first performance parameter with the second performance parameters of other hard disks in the disk array, the hard disk to be tested with normal read and write command response delay is added to the disk array without affecting the storage performance of the disk array.

[0028] In some optional implementations, comparing the first basic information with the second basic information of other hard disks in the disk array includes:

[0029] Acquire a first medium type, a first rotation speed, and a first capacity of the hard disk to be detected from the first basic information;

[0030] Acquire the second medium type, the second rotation speed and the second capacity of the other hard disk from the second basic information;

[0031] If the first medium type is the same as the second medium type, the first rotation speed is the same as the second rotation speed, and the first capacity is the same as the second capacity, then it is determined that the first basic information is consistent with the second basic information;

[0032] Otherwise, the first prompt information is output, and the read and write performance test of the hard disk to be detected is not performed.

[0033] In this embodiment, the first basic information is compared with the second basic information to ensure that the hard disk to be detected has the same media type, rotation speed, and capacity as other hard disks, and to ensure that the storage performance of the disk array will not be affected after the hard disk to be detected is added to the disk array.

[0034] In some optional implementations, before adding the hard disk to be detected to the disk array, the method further includes:

[0035] Acquire a first moment, wherein the first moment is a moment when a hard disk in the disk array whose time from offline state to online state is greater than a preset threshold is used as a hard disk to be detected;

[0036] Obtain the second moment when the read and write performance test of the hard disk to be tested is completed;

[0037] Determine the detection duration according to the first moment and the second moment;

[0038] If the detection time is less than the second preset time, adding the hard disk to be detected to the disk array is executed;

[0039] If the detection time is greater than or equal to the second preset time, a second prompt message is output, and the hard disk to be detected is not added to the disk array.

[0040] In this embodiment, a timeout mechanism is set. If the detection time is greater than or equal to the second preset time, a second prompt message is output, and the hard disk to be detected is not added to the disk array, so as to avoid the detection process of the hard disk to be detected being stuck, resulting in a waste of system resources.

[0041] In some optional implementations, before determining whether the hard disk to be detected is capable of data transmission, the method further includes:

[0042] Determine whether the login information of the hard disk to be detected is received;

[0043] If the login information is received, it is then determined whether the hard disk to be tested is capable of data transmission;

[0044] If the login information is not received, the third prompt information is output, and the determination of whether the hard disk to be detected is capable of data transmission is not performed.

[0045] In some optional implementations, before comparing the first basic information with the second basic information of other hard disks in the disk array, the method further includes:

[0046] Format the hard disk to be tested;

[0047] If the formatting process is successful, then the first basic information is compared with the second basic information of other hard disks in the disk array;

[0048] If the formatting process fails, a fourth prompt message is output, and the comparison between the first basic information and the second basic information of other hard disks in the disk array is not performed.

[0049] In this implementation, the hard disk to be detected is formatted to facilitate subsequent detection of the hard disk to be detected and determine whether the hard disk to be detected will affect the storage performance of the disk array.

[0050] In a second aspect, the present invention provides a disk array hard disk replacement device, comprising:

[0051] A setting module, used for selecting hard disks in the disk array whose time from offline state to online state is greater than a preset threshold as hard disks to be detected;

[0052] A judgment module, used for judging whether the hard disk to be detected can perform data transmission, and if the hard disk to be detected can perform data transmission, obtaining first basic information of the hard disk to be detected;

[0053] A comparison module, used for comparing the first basic information with the second basic information of other hard disks in the disk array;

[0054] The test module is used to perform a read / write performance test on the hard disk to be tested if the first basic information is consistent with the second basic information, and to add the hard disk to be tested to the disk array if the first performance parameter in the test result is less than the second performance parameter of other hard disks in the disk array.

[0055] In a third aspect, the present invention provides a computer device, comprising: a memory and a processor, the memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the disk array hard disk replacement method of the first aspect or any corresponding embodiment thereof by executing the computer instructions.

[0056] In a fourth aspect, the present invention provides a computer-readable storage medium having computer instructions stored thereon, the computer instructions being used to enable a computer to execute the disk array hard disk replacement method of the first aspect or any corresponding embodiment thereof.

[0057] In a fifth aspect, the present invention provides a computer program product, including computer instructions, which are used to enable a computer to execute the disk array hard disk replacement method of the first aspect or any corresponding embodiment thereof. BRIEF DESCRIPTION OF THE DRAWINGS

[0058] In order to more clearly illustrate the specific embodiments of the present invention or the technical solutions in the related technologies, the drawings required for use in the specific embodiments or the related technical descriptions will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0059] Figure 1 is a schematic flow chart of a method for replacing a disk array hard disk according to an embodiment of the present invention;

[0060] Figure 2 is a schematic diagram of a hard disk automatic management process according to an embodiment of the present invention;

[0061] Figure 3 is a flow chart of a read and write performance test according to an embodiment of the present invention;

[0062] Figure 4 is a structural block diagram of a disk array hard disk replacement device according to an embodiment of the present invention;

[0063] Figure 5 It is a schematic diagram of the hardware structure of a computer device according to an embodiment of the present invention. DETAILED DESCRIPTION

[0064] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.

[0065] In the daily maintenance of storage, after a hard disk failure occurs, it is necessary to promptly replace the faulty disk with a new hard disk and add the new hard disk to the RAID to ensure the integrity of the RAID and data security. The traditional disk replacement operation requires the hard disk status to be updated step by step, and the new hard disk to be manually added to the RAID, and then the RAID reconstruction and other operations are initiated, which is time-consuming and labor-intensive, and prone to errors. In order to reduce human intervention when replacing hard disks and reduce the losses caused by human operation errors, the current hard disk automatic online management solution is adopted. The solution includes: new hard disk discovery, hard disk inspection, hard disk joining RAID, RAID reconstruction, updating hard disk status and other stages. For hard disk inspection, the common practice is to judge the basic conditions of the hard disk, check whether there is redundancy in the hard disk link, check whether the type and capacity of the new hard disk are consistent with the original hard disk of the RAID, and check whether the hard disk speed is consistent with the original hard disk of the RAID. After completing these checks, the hard disk is allowed to join the RAID. However, the above hard disk inspection can only determine that the hard disk is basically available and meets the basic requirements for the hard disk to join the RAID, but the actual IO (Input / Output) processing capacity of the hard disk cannot be detected. After a hard disk is added to a RAID group, the IO response may be slow, thereby slowing down the IO capacity of the entire RAID group, and in serious cases affecting customer services.

[0066] Based on the above content, the embodiment of the present invention provides a method for replacing a disk array hard disk. In the process of replacing a hard disk in RAID, in addition to checking the hard disk for basic condition compliance, a hard disk IO response detection link is added. Only after the hard disk IO response detection is passed, the new hard disk is allowed to join the RAID, ensuring that the IO response capability of each hard disk in the RAID is normal, and avoiding the slow IO response of the new hard disk from seriously affecting the RAID storage performance. In this way, the RAID hard disk can be replaced efficiently, and the new hard disk will not affect the RAID storage performance.

[0067] According to an embodiment of the present invention, a disk array hard disk replacement embodiment is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer device with data processing capabilities, such as a computer, a server, etc., and although a logical sequence is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.

[0068] In this embodiment, a disk array hard disk replacement method is provided, which can be used for the above-mentioned computer device. Figure 1 FIG. 1 is a flow chart of a method for replacing a disk array hard disk according to an embodiment of the present invention. Figure 1 As shown, the process includes the following steps:

[0069] Step S101 : A hard disk in a disk array whose time from an offline state to an online state is greater than a preset threshold is selected as a hard disk to be detected.

[0070] Specifically, the steps in the disk array hard disk replacement method are executed through three modules, which are a device management module, a hard disk management module and a RAID module.

[0071] The device management module controls the entire disk array hard disk replacement process, including: starting the process / terminating the process, reporting alarms, timeout detection, etc. The device management module will detect the hard disk in the disk array. When the hard disk in the RAID is unplugged, an offline signal will be generated and notified to the device management module. When a new hard disk is inserted, a hard disk in place signal will be automatically generated and notified to the device management module.

[0072] The device management module determines the change in hard disk status based on the offline signal and the in-place signal. If the time it takes for the hard disk to change from offline to online is greater than the preset threshold, the hard disk is considered to be a newly inserted hard disk and is treated as a hard disk to be detected. The device management module initiates an automatic management process and monitors the entire process until a prompt message is given after the hard disk is successfully managed, or an alarm is reported after management fails. The preset threshold is, for example, 10 seconds or other values.

[0073] The above process is as follows Figure 2 As shown, after the old hard disk is removed and the new hard disk is inserted, the new hard disk is used as the hard disk to be detected. In addition, the hard disk management module manages the hard disk ID, which is used as a unified identifier for the storage system to manage hard disks. After the old hard disk is removed, the ID used by the hard disk is recycled, and after the new hard disk is inserted and identified, a new ID is assigned.

[0074] Step S102, determining whether the hard disk to be detected can perform data transmission, if the hard disk to be detected can perform data transmission, obtaining first basic information of the hard disk to be detected.

[0075] Specifically, the hard disk management module is responsible for hard disk basic detection, hard disk IO response, and hard disk ID management.

[0076] The hard disk management module performs availability detection on the hard disk to be detected to ensure that the hard disk is available, that is, the hard disk can perform data transmission including data reading and data writing. If the hard disk to be detected can perform data transmission, the first basic information of the hard disk to be detected is obtained, such as the hard disk media type, hard disk rotation speed, hard disk capacity, etc. Figure 2 As shown, a basic test is performed on the hard disk to be tested to determine whether the hard disk is available. If it is not available, the hard disk to be tested cannot be added to the RAID, the management fails, and an alarm message is given.

[0077] Step S103: compare the first basic information with the second basic information of other hard disks in the disk array.

[0078] Specifically, the RAID module determines whether the hard disk can be added to the RAID. The RAID module performs a hard disk compliance test on the hard disk to be tested, and compares the first basic information with the second basic information of other hard disks in the disk array to determine whether the hard disk to be tested is consistent with the hard disks in the current RAID. For example: the first basic information includes the hard disk media type, hard disk rotation speed, and hard disk capacity, and the second basic information includes the hard disk media type, hard disk rotation speed, and hard disk capacity. The first basic information is compared with the second basic information to determine whether the media type, rotation speed, and capacity of the hard disk to be tested are consistent with those of the hard disks in the current RAID. The above process is as follows: Figure 2 As shown, the hard disk to be tested is tested for hard disk consistency to see if it is consistent with the hard disks in the RAID. If not, the hard disk to be tested cannot be added to the RAID, management fails, and an alarm message is given.

[0079] Step S104, if the first basic information is consistent with the second basic information, the hard disk to be tested is tested for read and write performance, and if the first performance parameter in the test result is less than the second performance parameter of other hard disks in the disk array, the hard disk to be tested is added to the disk array.

[0080] Specifically, if the first basic information is consistent with the second basic information, it is determined whether the hard disk to be detected is consistent with the hard disk in the current RAID. The hard disk management module performs a read and write performance test on the hard disk to be detected, for example: sending a read and write command processed by the hard disk in the current RAID to the hard disk to be detected, obtaining the first performance parameter of the hard disk to be detected for the read and write command, and comparing it with the second performance parameter of other hard disks in the disk array, for example: the first performance parameter and the second performance parameter are both response delays, if the response delay of the hard disk to be detected for the read and write command is less than the response delay of other hard disks in the disk array for the read and write command, it is considered that the IO response of the hard disk to be detected is normal, and the hard disk to be detected can be added to the disk array to trigger reconstruction / copyback and other processing.

[0081] The above process is as follows Figure 2 As shown, a slow disk test is performed on the hard disk to be tested to determine whether it meets the requirements. If it does not meet the requirements, the hard disk to be tested cannot be added to the RAID, and the management fails, and an alarm message is given. If it meets the requirements, the new hard disk, that is, the hard disk to be tested, is added to the disk array, and the configuration of the disk array removes the old disk. The hard disk to be tested is successfully managed and a prompt message is given.

[0082] The disk array hard disk replacement method provided in this embodiment determines whether the hard disk to be tested is available by determining whether it can perform data transmission; determines whether the hard disk to be tested is consistent with other hard disks in the disk array by comparing the first basic information with the second basic information of other hard disks in the disk array; determines whether the read and write performance of the hard disk to be tested affects the storage performance of the disk array by performing a read and write performance test on the hard disk to be tested and comparing the first performance parameter and the second performance parameter. If all the above tests are passed, the hard disk to be tested is added to the disk array to achieve efficient replacement of the disk array hard disk and ensure that the newly replaced hard disk will not affect the storage performance of the disk array. The problem that the disk replacement operation is time-consuming and labor-intensive, prone to errors, and may affect the storage performance of the disk array is solved.

[0083] In some optional implementations, determining whether the hard disk to be detected is capable of data transmission includes:

[0084] Get the port status information of the hard disk to be detected;

[0085] Sending a first preset instruction to the hard disk to be detected to obtain response information of the hard disk to be detected;

[0086] If it is determined according to the port status information that the hard disk to be detected can perform data transmission, and it is determined according to the response information that the hard disk to be detected can perform data transmission, then it is determined that the hard disk to be detected can perform data transmission.

[0087] Specifically, the hard disk management module performs availability detection on the hard disk to be detected, determines whether the hard disk to be detected can perform data transmission, and ensures that the hard disk is available.

[0088] The hard disk management module monitors the port status information of the hard disk to be detected, such as the login status of the hard disk port. If the hard disk is able to transmit data, it must "log in" to the host to indicate that it is ready and can be identified and used. This process includes several steps: discovery, the device is detected by the controller or host; negotiation, the device negotiates communication parameters such as transmission rate and protocol version with the controller or host; authentication, in some cases, the device may need to go through the authentication process to ensure that only authorized devices can access the network; ready, once the above steps are completed, the "login" status of the device indicates that it is ready for normal read and write operations.

[0089] The hard disk management module sends a first preset instruction to the hard disk to be detected to obtain response information of the hard disk to be detected. The first preset instruction is, for example, a SCSI (Small Computer System Interface) TUR (test unit ready) instruction. The TUR instruction is used to query whether a SCSI device (such as a hard disk, a tape drive, an optical drive, etc.) is ready for data transmission.

[0090] If it is determined according to the port status information that the hard disk to be detected can perform data transmission, and it is determined according to the response information that the hard disk to be detected can perform data transmission, the hard disk management module determines that the hard disk to be detected can perform data transmission.

[0091] In this embodiment, whether the hard disk to be detected can perform data transmission is determined based on the port status information and corresponding information, ensuring that the hard disk to be detected is available, ensuring that the subsequent detection process proceeds smoothly and avoiding affecting the RAID storage performance due to the unavailability of the hard disk to be detected after adding the hard disk to the RAID.

[0092] In some optional implementations, performing a read / write performance test on a hard disk to be tested, and if a first performance parameter in the test result is less than a second performance parameter of other hard disks in the disk array, adding the hard disk to be tested to the disk array includes:

[0093] Obtaining a first preset number of historical read and write commands of other hard disks in the disk array and first response delays of other hard disks to the historical read and write commands, and determining a first average response delay corresponding to the first response delay, wherein the first average response delay is included in the second performance parameter;

[0094] Determine the average load parameters of historical read and write commands, and generate test read and write commands based on the average load parameters;

[0095] Repeat the preset test logic until the repeated execution time is equal to the first preset time, then stop, and determine the second average response delay of the hard disk to be tested to the test read and write command, wherein the second average response delay is included in the first performance parameter;

[0096] The preset test logic satisfies: sending a test read / write command to the hard disk to be tested, and obtaining a second response delay of the hard disk to be tested to the test read / write command, wherein the second response delay is used to obtain a second average response delay;

[0097] In the process of repeatedly executing the first test logic, a second preset number of second preset instructions are sent to the hard disk to be detected, and a third response delay of the hard disk to be detected to the second preset number of second preset instructions is obtained;

[0098] Taking the historical read / write commands of other hard disks whose first response delay is greater than the first preset threshold as the target read / write commands;

[0099] If the second response delays are all less than the second preset threshold, the target read / write command is sent to the hard disk to be detected, and a third average response delay of the hard disk to be detected to the target read / write command is determined, wherein the third average response delay is included in the first performance parameter;

[0100] Determine, according to the first response delay of the other hard disks to the target read / write command, a fourth average response delay of the other hard disks to the target read / write command, wherein the fourth average response delay is included in the second performance parameter;

[0101] If the second average response delay is less than the first average response delay and the third average response delay is less than the fourth average response delay, the hard disk to be detected is added to the disk array.

[0102] Specifically, the hard disk management module will perform IO response detection on the hard disk to be detected to ensure that all IOs are responded to correctly and the IO response delay is normal.

[0103] Combination Figure 3 This embodiment is explained, and an IO response test is performed on the hard disk to be tested, that is, a slow disk test is performed on the new hard disk. The average IO pressure model of other hard disks to be added to the RAID is used as the test IO model, and a basic pressure test is performed on the new hard disk for no less than n minutes, where n can be 10 minutes or other time lengths that meet actual needs. It is determined whether the average delay is less than the historical average delay of other hard disks. If not, the slow disk test fails and is not allowed to go online. Specifically, it includes: obtaining the first preset number of historical read and write commands of other hard disks in the RAID and the first response delay of other hard disks to the historical read and write commands, and determining the first average response delay corresponding to the first response delay. The first preset number represents multiple, and no specific number limit is made here. Determine the average load parameters of the historical read and write commands, such as the average block size and IOPS calculated based on the historical read and write commands. According to the average load parameters, generate test read and write commands, and use the test read and write commands to test the read and write performance of the hard disk to be tested.

[0104] Set the preset test logic, for example: send the test read / write command to the hard disk to be tested, and obtain the second response delay of the hard disk to be tested to the test read / write command. Repeat the preset test logic until the repeated execution time is equal to the first preset time, then stop, and determine the second average response delay of the hard disk to be tested to the test read / write command, where the first preset time is n.

[0105] like Figure 3As shown, while performing a basic stress test on the new hard disk, use m consecutive TUR instructions with order attributes to detect the new hard disk and record the hard disk response delay. Determine whether each OTUR delay is less than the threshold, and the OTUR delay represents the delay of the hard disk to be detected responding to the TUR instruction. Select the 10 IOs with the longest response from other hard disks in the RAID group, and test the new hard disk for no less than h rounds, where h can be 10 rounds or other values ​​that meet actual needs. Determine whether the average delay is less than the historical average delay of other hard disks. If the average delay is less than the historical average delay, the slow disk detection passes and the upper limit is allowed, otherwise, the slow disk detection fails and the upper limit is not allowed. Specifically, it includes: in the process of repeatedly executing the first test logic, sending a second preset number of second preset instructions to the hard disk to be detected, and obtaining the third response delay of the hard disk to be detected to the second preset number of second preset instructions, the second preset number represents multiple, and no specific number limit is made here. The second preset instruction is, for example, a TUR instruction with an order attribute, and the order attribute is usually related to the sequential control of I / O operations. The historical read-write commands of other hard disks whose first response delay is greater than the first preset threshold are used as target read-write commands. The first preset threshold is used to filter out the 10 target read-write commands with the longest first response delay of other hard disks from the historical read-write commands. If the second response delay is less than the second preset threshold, the target read-write command is sent to the hard disk to be detected, and the third average response delay of the hard disk to be detected to the target read-write command is determined. The second preset threshold is, for example, 500ms for the second preset threshold of the mechanical hard disk and 100ms for the second preset threshold of the solid-state hard disk. According to the first response delay of other hard disks to the target read-write command, the fourth average response delay of other hard disks to the target read-write command is determined. If the second average response delay is less than the first average response delay and the third average response delay is less than the fourth average response delay, it is considered that the IO response of the hard disk to be detected is normal, and the hard disk to be detected is added to the disk array to start reconstruction / copyback.

[0106] If the second average response delay is not less than the first average response delay or the third average response delay is not less than the fourth average response delay, it is considered that the IO response detection of the hard disk to be detected is abnormal, the management is stopped, and a prompt is given to replace a hard disk.

[0107] In this embodiment, a read and write performance test is performed on the hard disk to be tested, and a first performance parameter of the hard disk to be tested is determined based on the test result. By comparing the first performance parameter with the second performance parameters of other hard disks in the disk array, the hard disk to be tested with normal read and write command response delay is added to the disk array without affecting the storage performance of the disk array.

[0108] In some optional implementations, there are other ways to perform read and write performance tests on the hard disk to be tested, including steps A1 to A4.

[0109] Step A1, configuring test parameters for the hard disk to be tested, and calling the corresponding test execution file package based on the test parameters.

[0110] Specifically, firstly, a Python environment is deployed in the control machine for testing the hard disk to be detected, and a test script is run in the Python environment. For example, the test script is:

[0111] Python.exe Stability Py-h ip-mode-type-disk-c cycle-b base.

[0112] Among them, ip refers to the IP (Internet Protocol) address of the test machine's in-band system, which is used for the test machine to communicate with the control machine, such as 1.1.1.1, and the test machine is a device with a hard disk to be tested. mode: refers to the type of test to be performed on the hard disk, generally including sequential read and write test and random read and write test. mode=0 means sequential read and write test, and the script will perform sequential write test, sequential read test, and sequential read and write test on the hard disk in sequence. mode=1 means random read and write test, and the script will perform random write test, random read test, and random read and write test on the hard disk in sequence. type indicates the hard disk type of the hard disk to be tested. In the same test type, different scripts will be called due to different hard disk types. disk indicates the hard disk to be tested. cycle: refers to whether each test model is tested with a fixed time or a fixed capacity. cycle=0 means that each test model is tested with a fixed time, and cycle=1 means that each test model is tested with a fixed capacity. The above test parameters need to be configured.

[0113] After configuring the test parameters, we need to build a test model for testing the read and write performance of the hard disk to be tested. For example, when the hard disk is tested for sequential reads, we can combine the values ​​of bs (how much data is read and written at a time, that is, how much data is read and written for each io request, generally 4K, 16K, 64k, 128k, etc.) and iodepth (how many I / Os are accessing at the same time, generally 1, 32, 64, 128, etc.), so that multiple test models can be matched. Therefore, when performing sequential reads on the hard disk, bs=4k, iodepth=1 is one of the test models.

[0114] The above test scripts and test models are aggregated to obtain a test execution file package.

[0115] Step A2: Send the test execution file package to the test machine where the hard disk to be tested is located, so that the test script in the test execution file package executes the test on the test machine.

[0116] Specifically, after the control machine executes the test script, for example, after executing the test script, the control machine will communicate with the test machine with IP 1.1.1.1, send the test script required for the sequential read test to the test machine, and perform a read and write performance test on the hard disk to be tested. The control machine installs tools on the test machine and deploys scripts. After detecting the information of the disk to be tested and clearing the OS log, the test machine starts to execute the stress test script.

[0117] Step A3: generating a progress monitoring thread for the hard disk to be tested based on the test parameters, and calculating the remaining test time of the hard disk to be tested through the progress monitoring thread.

[0118] Specifically, the cyclic test standard in the test parameters is parsed; if the cyclic test standard is a fixed time mode, the set time parameters are extracted, and the timer is used to count when the test start time feedback from the test machine is received, and the difference between the time parameter and the timing duration is output as the remaining test time; if the cyclic test standard is a fixed capacity mode, the test time required for the test model is estimated based on the test model parameter influencing factors, environmental influencing factors, fixed capacity and bandwidth, and the test time required for the unexecuted test models in the test script is accumulated to obtain the remaining test time.

[0119] Step A4, receiving the test data fed back by the test script, and summarizing the test data when the remaining test time is zero.

[0120] Specifically, the test script is set in advance to upload the test data of each test model to the control machine when the execution is completed, so that the control machine can obtain the test data obtained by each test model in time; the test data is classified and screened and plotted into a chart. After the test machine completes each test model, it first uploads the test data to the control machine, and then starts the next test model. The test data includes key data such as iops (read and write times per second) of the hard disk to be tested, bw (bandwidth, throughput per second), and latency of read and write commands.

[0121] After obtaining the test data of the hard disk to be tested, because the hard disk needs to be tested in the same way each time it is added to RAID, the current hard disks in the RAID have corresponding test data. The test data of the hard disk to be tested is compared with the test data of the current hard disks in the RAID to determine whether the read and write performance of the hard disk to be tested is better than that of the current hard disk in the RAID or consistent with that of the current hard disk in the RAID. If satisfied, the hard disk to be tested can be added to the RAID.

[0122] In this embodiment, by classifying and managing hard disk test scripts and tools, targeted distribution, execution and progress monitoring of test scripts and tools are achieved, thereby realizing test execution and test data collection and processing for automated batch testing of different types of hard disks, greatly improving hard disk test efficiency and automation. The design principle is reliable, the structure is simple, and the application range is wide.

[0123] In some optional implementations, comparing the first basic information with the second basic information of other hard disks in the disk array includes:

[0124] Acquire a first medium type, a first rotation speed, and a first capacity of the hard disk to be detected from the first basic information;

[0125] Acquire the second medium type, the second rotation speed and the second capacity of the other hard disk from the second basic information;

[0126] If the first medium type is the same as the second medium type, the first rotation speed is the same as the second rotation speed, and the first capacity is the same as the second capacity, then it is determined that the first basic information is consistent with the second basic information;

[0127] Otherwise, the first prompt information is output, and the read and write performance test of the hard disk to be detected is not performed.

[0128] Specifically, the RAID module determines whether the hard disk can be added to the RAID. The RAID module performs a hard disk compliance test on the hard disk to be tested, and compares the first basic information with the second basic information of other hard disks in the disk array to ensure that the hard disk to be tested is consistent with other hard disks in the RAID. First, the hard disk to be tested and other hard disks must be of the same media type. Solid-state drives and mechanical hard disks are not allowed to be placed in the same RAID group due to inconsistent characteristics; secondly, the rotation speed of the hard disk to be tested must be consistent with that of other hard disks. Mechanical hard disks have different rotation speeds and performance. Putting them in the same RAID group will slow down the performance of the entire RAID; finally, the capacity of the hard disk to be tested must be consistent with that of other hard disks to ensure that the available space of each hard disk in the RAID is consistent.

[0129] The first medium type, the first rotation speed and the first capacity of the hard disk to be detected are obtained from the first basic information. The second medium type, the second rotation speed and the second capacity of other hard disks are obtained from the second basic information.

[0130] If the first medium type is the same as the second medium type, the first rotation speed is the same as the second rotation speed, and the first capacity is the same as the second capacity, it is determined that the first basic information is consistent with the second basic information.

[0131] Otherwise, the compliance test of the hard disk to be tested fails, the test process is stopped, the step of "performing a read and write performance test on the hard disk to be tested" is not executed, and the first prompt information is output. The first prompt information is, for example: replace the hard disk to be tested and make sure it is the same model as other hard disks in the RAID.

[0132] In this embodiment, the first basic information is compared with the second basic information to ensure that the hard disk to be detected has the same media type, rotation speed, and capacity as other hard disks, and to ensure that the storage performance of the disk array will not be affected after the hard disk to be detected is added to the disk array.

[0133] In some optional implementations, before adding the hard disk to be detected to the disk array, the method further includes:

[0134] Acquire a first moment, wherein the first moment is a moment when a hard disk in the disk array whose time from offline state to online state is greater than a preset threshold is used as a hard disk to be detected;

[0135] Obtain the second moment when the read and write performance test of the hard disk to be tested is completed;

[0136] Determine the detection duration according to the first moment and the second moment;

[0137] If the detection time is less than the second preset time, adding the hard disk to be detected to the disk array is executed;

[0138] If the detection time is greater than or equal to the second preset time, a second prompt message is output, and the hard disk to be detected is not added to the disk array.

[0139] Specifically, the device management module sets a timeout mechanism. If the detection of the hard disk to be detected times out, the detection of the hard disk to be detected will be stopped and the management will be considered unsuccessful. For example, the hard disk to be detected is required to complete the management within 20 minutes, otherwise the management process is forcibly terminated, the management is considered to have failed, the hard disk is unavailable, and an alarm is reported.

[0140] The device management module obtains the first moment when the hard disk in the disk array that changes from an offline state to an online state for a time greater than a preset threshold is used as the hard disk to be detected. The second moment when the read and write performance test of the hard disk to be detected is obtained. The detection duration is calculated by subtracting the first moment from the second moment. The second preset duration can be, for example, 20 minutes, 25 minutes or other values. If the detection duration is less than the second preset duration, the hard disk to be detected is added to the disk array. If the detection duration is greater than or equal to the second preset duration, the detection times out, and the device management module outputs a second prompt message, ends the detection process, and does not add the hard disk to be detected to the disk array. The second prompt message can be, for example, a prompt to be managed again or to try to restart the system. The above process is as follows: Figure 2As shown, before performing basic detection to determine whether the hard disk is available, a 20-minute timer is started. If the 20 minutes times out, the management is unsuccessful and an alarm message is given.

[0141] In this embodiment, a timeout mechanism is set. If the detection time is greater than or equal to the second preset time, a second prompt message is output, and the hard disk to be detected is not added to the disk array, so as to avoid the detection process of the hard disk to be detected being stuck, resulting in a waste of system resources.

[0142] In some optional implementations, before determining whether the hard disk to be detected is capable of data transmission, the method further includes:

[0143] Determine whether the login information of the hard disk to be detected is received;

[0144] If the login information is received, it is then determined whether the hard disk to be tested is capable of data transmission;

[0145] If the login information is not received, the third prompt information is output, and the determination of whether the hard disk to be detected is capable of data transmission is not performed.

[0146] Specifically, the device management module monitors the entire managed process, ie, the detection process of the hard disk to be detected, controls the direction of the managed process, and gives warning information and operation suggestions in a timely manner.

[0147] After the hard disk is inserted, the device management module determines whether the login information of the hard disk to be detected is received. If the login information is received, the step of "determining whether the hard disk to be detected can perform data transmission" and subsequent steps in the detection process are continued.

[0148] If the login information is not received, the detection process is stopped, the step of "determining whether the hard disk to be detected can perform data transmission" is not executed, and the third prompt information is output. The third prompt information, for example, prompts to re-plug or replace a hard disk.

[0149] In some optional implementations, before comparing the first basic information with the second basic information of other hard disks in the disk array, the method further includes:

[0150] Format the hard disk to be tested;

[0151] If the formatting process is successful, then the first basic information is compared with the second basic information of other hard disks in the disk array;

[0152] If the formatting process fails, a fourth prompt message is output, and the comparison between the first basic information and the second basic information of other hard disks in the disk array is not performed.

[0153] Specifically, after obtaining the first basic information of the hard disk to be detected and before comparing the first basic information with the second basic information of other hard disks in the disk array, the hard disk management module formats the hard disk according to the requirements of the storage system, for example, setting the hard disk T10 DIF (Data Integrity Field) mode, hard disk log level and other hard disk behavior options. T10 DIF mode is a technology used for data protection in hard disk storage systems. DIF mode appends additional fields after the data block to store checksums, application tags and reference tags to enhance data integrity and traceability.

[0154] If the formatting process is successful, you can continue to test the hard disk to be tested, and continue to perform the step "comparing the first basic information with the second basic information of other hard disks in the disk array" and subsequent steps in the testing process.

[0155] The hard disk formatting fails, the management stops, the detection process stops, the step "comparing the first basic information with the second basic information of other hard disks in the disk array" is not executed, and the fourth prompt information is output. The fourth prompt information is, for example: try manual formatting first, and then manually trigger management.

[0156] In this implementation, the hard disk to be detected is formatted to facilitate subsequent detection of the hard disk to be detected and determine whether the hard disk to be detected will affect the storage performance of the disk array.

[0157] In this embodiment, a disk array hard disk replacement device is also provided, which is used to implement the above embodiments and preferred implementations, and the descriptions that have been made will not be repeated. As used below, the term "module" can be a combination of software and / or hardware that implements a predetermined function. Although the device described in the following embodiments is preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceivable.

[0158] This embodiment provides a disk array hard disk replacement device, such as Figure 4 As shown, including:

[0159] A setting module 401 is used to select hard disks in the disk array whose time from offline state to online state is greater than a preset threshold as hard disks to be detected;

[0160] The judging module 402 is used to judge whether the hard disk to be detected can perform data transmission, and if the hard disk to be detected can perform data transmission, obtain the first basic information of the hard disk to be detected;

[0161] A comparison module 403, used to compare the first basic information with the second basic information of other hard disks in the disk array;

[0162] The testing module 404 is used to perform a read / write performance test on the hard disk to be tested if the first basic information is consistent with the second basic information, and add the hard disk to be tested to the disk array if the first performance parameter in the test result is less than the second performance parameter of other hard disks in the disk array.

[0163] In some optional implementations, the determination module 402 determines whether the hard disk to be detected is capable of data transmission, including:

[0164] Get the port status information of the hard disk to be detected;

[0165] Sending a first preset instruction to the hard disk to be detected to obtain response information of the hard disk to be detected;

[0166] If it is determined according to the port status information that the hard disk to be detected can perform data transmission, and it is determined according to the response information that the hard disk to be detected can perform data transmission, then it is determined that the hard disk to be detected can perform data transmission.

[0167] In some optional implementations, the testing module 404 performs a read / write performance test on the hard disk to be tested, and if a first performance parameter in the test result is less than a second performance parameter of other hard disks in the disk array, the hard disk to be tested is added to the disk array, including:

[0168] Obtaining a first preset number of historical read and write commands of other hard disks in the disk array and first response delays of other hard disks to the historical read and write commands, and determining a first average response delay corresponding to the first response delay, wherein the first average response delay is included in the second performance parameter;

[0169] Determine the average load parameters of historical read and write commands, and generate test read and write commands based on the average load parameters;

[0170] Repeat the preset test logic until the repeated execution time is equal to the first preset time, then stop, and determine the second average response delay of the hard disk to be tested to the test read and write command, wherein the second average response delay is included in the first performance parameter;

[0171] The preset test logic satisfies: sending a test read / write command to the hard disk to be tested, and obtaining a second response delay of the hard disk to be tested to the test read / write command, wherein the second response delay is used to obtain a second average response delay;

[0172] In the process of repeatedly executing the first test logic, a second preset number of second preset instructions are sent to the hard disk to be detected, and a third response delay of the hard disk to be detected to the second preset number of second preset instructions is obtained;

[0173] Taking the historical read / write commands of other hard disks whose first response delay is greater than the first preset threshold as the target read / write commands;

[0174] If the second response delays are all less than the second preset threshold, the target read / write command is sent to the hard disk to be detected, and a third average response delay of the hard disk to be detected to the target read / write command is determined, wherein the third average response delay is included in the first performance parameter;

[0175] Determine, according to the first response delay of the other hard disks to the target read / write command, a fourth average response delay of the other hard disks to the target read / write command, wherein the fourth average response delay is included in the second performance parameter;

[0176] If the second average response delay is less than the first average response delay and the third average response delay is less than the fourth average response delay, the hard disk to be detected is added to the disk array.

[0177] In some optional implementations, the comparison module 403 compares the first basic information with the second basic information of other hard disks in the disk array, including:

[0178] Acquire a first medium type, a first rotation speed, and a first capacity of the hard disk to be detected from the first basic information;

[0179] Acquire the second medium type, the second rotation speed and the second capacity of the other hard disk from the second basic information;

[0180] If the first medium type is the same as the second medium type, the first rotation speed is the same as the second rotation speed, and the first capacity is the same as the second capacity, then it is determined that the first basic information is consistent with the second basic information;

[0181] Otherwise, the first prompt information is output, and the read and write performance test of the hard disk to be detected is not performed.

[0182] In some optional implementations, before adding the hard disk to be detected to the disk array, the device is used to:

[0183] Acquire a first moment, wherein the first moment is a moment when a hard disk in the disk array whose time from offline state to online state is greater than a preset threshold is used as a hard disk to be detected;

[0184] Obtain the second moment when the read and write performance test of the hard disk to be tested is completed;

[0185] Determine the detection duration according to the first moment and the second moment;

[0186] If the detection time is less than the second preset time, adding the hard disk to be detected to the disk array is executed;

[0187] If the detection time is greater than or equal to the second preset time, a second prompt message is output, and the hard disk to be detected is not added to the disk array.

[0188] In some optional implementations, before determining whether the hard disk to be detected is capable of data transmission, the device is further configured to:

[0189] Determine whether the login information of the hard disk to be detected is received;

[0190] If the login information is received, it is then determined whether the hard disk to be tested is capable of data transmission;

[0191] If the login information is not received, the third prompt information is output, and the determination of whether the hard disk to be detected is capable of data transmission is not performed.

[0192] In some optional implementations, before comparing the first basic information with the second basic information of other hard disks in the disk array, the device is further used to:

[0193] Format the hard disk to be tested;

[0194] If the formatting process is successful, then the first basic information is compared with the second basic information of other hard disks in the disk array;

[0195] If the formatting process fails, a fourth prompt message is output, and the comparison between the first basic information and the second basic information of other hard disks in the disk array is not performed.

[0196] The further functional description of each of the above modules and units is the same as that of the above corresponding embodiments and will not be repeated here.

[0197] The disk array hard disk replacement device in this embodiment is presented in the form of a functional unit, where the unit refers to an ASIC (Application Specific Integrated Circuit) circuit, a processor and memory that executes one or more software or fixed programs, and / or other devices that can provide the above functions.

[0198] The embodiment of the present invention also provides a computer device having the above Figure 4 The disk array hard disk replacement device shown.

[0199] See also Figure 5 , Figure 5 is a schematic diagram of the structure of a computer device provided by an optional embodiment of the present invention, such as Figure 5As shown, the computer device includes: one or more processors 10, a memory 20, and interfaces for connecting various components, including high-speed interfaces and low-speed interfaces. Various components are connected to each other using different buses for communication, and can be installed on a common mainboard or installed in other ways as needed. The processor can process the instructions executed in the computer device, including instructions stored in or on the memory to display the graphical information of the GUI on an external input / output device (such as, a display device coupled to the interface). In some optional embodiments, if necessary, multiple processors and / or multiple buses can be used together with multiple memories and multiple memories. Similarly, multiple computer devices can be connected, and each device provides some necessary operations (for example, as a server array, a group of blade servers, or a multi-processor system). Figure 5 A processor 10 is taken as an example.

[0200] The processor 10 may be a central processing unit, a network processor or a combination thereof. The processor 10 may further include a hardware chip. The hardware chip may be a dedicated integrated circuit, a programmable logic device or a combination thereof. The programmable logic device may be a complex programmable logic device, a field programmable gate array, a general purpose array logic or any combination thereof.

[0201] The memory 20 stores instructions executable by at least one processor 10, so that at least one processor 10 executes the method shown in the above embodiment.

[0202] The memory 20 may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function; the data storage area may store data created according to the use of the computer device, etc. In addition, the memory 20 may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some optional embodiments, the memory 20 may optionally include a memory remotely arranged relative to the processor 10, and these remote memories may be connected to the computer device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0203] The memory 20 may include a volatile memory, such as a random access memory; the memory may also include a non-volatile memory, such as a flash memory, a hard disk or a solid state drive; the memory 20 may also include a combination of the above types of memory.

[0204] The computer device further comprises a communication interface 30 for the computer device to communicate with other devices or a communication network.

[0205] The embodiment of the present invention also provides a computer-readable storage medium. The method according to the embodiment of the present invention can be implemented in hardware, firmware, or can be implemented as a computer code that can be recorded in a storage medium, or can be implemented as a computer code that is originally stored in a remote storage medium or a non-temporary machine-readable storage medium and will be stored in a local storage medium through a network download, so that the method described herein can be stored in such software processing on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. Among them, the storage medium can be a magnetic disk, an optical disk, a read-only storage memory, a random access memory, a flash memory, a hard disk or a solid-state hard disk, etc.; further, the storage medium can also include a combination of the above types of memories. It can be understood that a computer, a processor, a microprocessor controller, or programmable hardware includes a storage component that can store or receive software or computer code. When the software or computer code is accessed and executed by a computer, a processor, or hardware, the method shown in the above embodiment is implemented.

[0206] A part of the present invention may be applied as a computer program product, such as a computer program instruction, which, when executed by a computer, can call or provide the method and / or technical solution according to the present invention through the operation of the computer. Those skilled in the art should understand that the existence of the computer program instruction in a computer-readable medium includes, but is not limited to, a source file, an executable file, an installation package file, etc., and accordingly, the way in which the computer program instruction is executed by the computer includes, but is not limited to: the computer directly executes the instruction, or the computer compiles the instruction and then executes the corresponding compiled program, or the computer reads and executes the instruction, or the computer reads and installs the instruction and then executes the corresponding installed program. Here, the computer-readable medium may be any available computer-readable storage medium or communication medium accessible to the computer.

[0207] Although the embodiments of the present invention have been described in conjunction with the accompanying drawings, those skilled in the art may make various modifications and variations without departing from the spirit and scope of the present invention, and such modifications and variations are all within the scope defined by the appended claims.

Claims

1. A method for replacing a disk array hard disk, characterized in that: The method comprises: The hard disks in the disk array whose time from offline state to online state is greater than a preset threshold are regarded as hard disks to be detected; Determine whether the hard disk to be detected can perform data transmission, and if the hard disk to be detected can perform data transmission, obtain first basic information of the hard disk to be detected; Comparing the first basic information with second basic information of other hard disks in the disk array; If the first basic information is consistent with the second basic information, the read and write performance of the hard disk to be tested is tested, and if the first performance parameter in the test result is less than the second performance parameter of other hard disks in the disk array, the hard disk to be tested is added to the disk array.

2. The method according to claim 1, characterized in that The determining whether the hard disk to be detected is capable of data transmission includes: Obtaining the port status information of the hard disk to be detected; Sending a first preset instruction to the hard disk to be detected to obtain response information of the hard disk to be detected; If it is determined according to the port status information that the hard disk to be detected is capable of data transmission, and if it is determined according to the response information that the hard disk to be detected is capable of data transmission, then it is determined that the hard disk to be detected is capable of data transmission.

3. The method according to claim 1, characterized in that The step of performing a read / write performance test on the hard disk to be tested, and if a first performance parameter in the test result is less than a second performance parameter of other hard disks in the disk array, adding the hard disk to be tested to the disk array comprises: Obtaining a first preset number of historical read and write commands of other hard disks in the disk array and a first response delay of the other hard disks to the historical read and write commands, and determining a first average response delay corresponding to the first response delay, wherein the first average response delay is included in the second performance parameter; Determine the average load parameter of the historical read and write commands, and generate a test read and write command according to the average load parameter; Repeating the preset test logic until the repeated execution time is equal to the first preset time, then stopping, and determining a second average response delay of the hard disk to be tested to the test read and write command, wherein the second average response delay is included in the first performance parameter; The preset test logic satisfies: sending the test read / write command to the hard disk to be tested, and obtaining a second response delay of the hard disk to be tested to the test read / write command, wherein the second response delay is used to obtain the second average response delay; In the process of repeatedly executing the first test logic, a second preset number of second preset instructions are sent to the hard disk to be detected, and a third response delay of the hard disk to be detected to the second preset number of second preset instructions is obtained; Taking the historical read / write commands of the other hard disks whose first response delay is greater than a first preset threshold as target read / write commands; If the second response delays are all less than the second preset threshold, the target read / write command is sent to the hard disk to be detected, and a third average response delay of the hard disk to be detected to the target read / write command is determined, wherein the third average response delay is included in the first performance parameter; Determine, according to the first response delay of the other hard disks to the target read / write command, a fourth average response delay of the other hard disks to the target read / write command, wherein the fourth average response delay is included in the second performance parameter; If the second average response delay is smaller than the first average response delay and the third average response delay is smaller than the fourth average response delay, the hard disk to be detected is added to the disk array.

4. The method according to claim 1, characterized in that: The comparing the first basic information with the second basic information of other hard disks in the disk array includes: Acquire a first medium type, a first rotation speed, and a first capacity of the hard disk to be detected from the first basic information; Acquire the second medium type, the second rotation speed and the second capacity of the other hard disk from the second basic information; If the first medium type is the same as the second medium type, the first rotation speed is the same as the second rotation speed, and the first capacity is the same as the second capacity, then determining that the first basic information is consistent with the second basic information; Otherwise, the first prompt information is output, and the read and write performance test of the hard disk to be detected is not performed.

5. The method according to claim 1, characterized in that Before adding the hard disk to be detected to the disk array, the method further includes: Acquire a first moment, wherein the first moment is a moment when a hard disk in the disk array whose time from offline state to online state is greater than a preset threshold is used as a hard disk to be detected; Acquire a second moment when the read and write performance test of the hard disk to be tested is completed; Determine a detection duration according to the first moment and the second moment; If the detection time is less than the second preset time, adding the hard disk to be detected to the disk array is executed; If the detection time is greater than or equal to the second preset time, a second prompt message is output, and adding the hard disk to be detected to the disk array is not performed.

6. The method according to claim 1, characterized in that Before determining whether the hard disk to be detected is capable of data transmission, the method further includes: Determining whether the login information of the hard disk to be detected is received; If the login information is received, determining whether the hard disk to be detected is capable of data transmission is executed; If the login information is not received, the third prompt information is output, and the step of determining whether the hard disk to be detected is capable of data transmission is not performed.

7. The method according to claim 1, characterized in that Before comparing the first basic information with the second basic information of other hard disks in the disk array, the method further includes: Formatting the hard disk to be detected; If the formatting process is successful, then performing the step of comparing the first basic information with the second basic information of other hard disks in the disk array; If the formatting process fails, a fourth prompt message is output, and the step of comparing the first basic information with the second basic information of other hard disks in the disk array is not performed.

8. A disk array hard disk replacement device, characterized in that: The device comprises: A setting module, used for selecting hard disks in the disk array whose time from offline state to online state is greater than a preset threshold as hard disks to be detected; A judging module, used for judging whether the hard disk to be detected can perform data transmission, and if the hard disk to be detected can perform data transmission, obtaining first basic information of the hard disk to be detected; A comparison module, used for comparing the first basic information with second basic information of other hard disks in the disk array; A testing module is used to perform a read and write performance test on the hard disk to be tested if the first basic information is consistent with the second basic information, and to add the hard disk to be tested to the disk array if a first performance parameter in the test result is less than a second performance parameter of other hard disks in the disk array.

9. A computer device, characterized in that: include: A memory and a processor, wherein the memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the disk array hard disk replacement method according to any one of claims 1 to 7 by executing the computer instructions.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a computer to execute the disk array hard disk replacement method according to any one of claims 1 to 7.

Citation Information

Cited By

  • Memory and firmware down-refreshing time test method of memory

    CN119541610A

  • Pressure testing method, device and equipment and storage medium

    CN119961068A

  • A pressure testing method, device, apparatus and storage medium

    CN119961068B