Hard disk management method and device, computer equipment and storage medium
By dynamically adjusting the moving threshold of the hard disk, the problems of low management efficiency and data reliability caused by the fixed moving threshold in the prior art are solved, and more efficient hard disk management and data protection are achieved.
Patent Information
- Application Number
- CN202311645067.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-04
- Publication Date
- 2025-06-06
AI Technical Summary
In the existing hard disk management methods, fixed moving thresholds are difficult to adapt to the use of different hard disks, resulting in low management efficiency and data reliability problems.
By issuing a moving situation reading command to the target hard disk, obtaining the moving results, and dynamically adjusting the target moving threshold based on the total number of moving times and attribute information, and updating the current moving threshold of the hard disk.
This method can adjust the moving threshold according to the specific usage of the hard disk, reduce management burden, improve hard disk management efficiency, and ensure data integrity and reliability.
Smart Images

Figure CN120104035A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of hard disk technology, and in particular to a hard disk management method, device, computer equipment, storage medium and computer program product. Background Art
[0002] The longer the data in the solid-state drive (hereinafter referred to as the hard drive) is static, the greater the probability of data errors. The hard drive is set with an uncorrectable threshold, which is used to determine whether the data in the hard drive is lost. In order to avoid data loss, on the basis of the uncorrectable threshold, a moving threshold that is less than the uncorrectable threshold is set in the hard drive.
[0003] In the current hard disk management method, the hard disk will inspect the data in the hard disk for errors according to the preset time period. When the number of bit errors in the data in the hard disk exceeds the migration threshold, the ECC (Error Correction Code) mechanism will be triggered to correct the data in the hard disk and rewrite the corrected data into the hard disk to complete the data migration.
[0004] However, the current hard disk management method is to set a fixed migration threshold for the hard disk. When the migration threshold is set too high or too low, the burden of managing the hard disk will increase and the efficiency of the hard disk management method will be reduced. Summary of the invention
[0005] Based on this, it is necessary to provide a hard disk management method, device, computer equipment, computer-readable storage medium and computer program product to address the above technical issues.
[0006] In a first aspect, the present application provides a hard disk management method, the method being applied to a storage array, the method comprising:
[0007] Sending a migration status read command to a target hard disk, and receiving a migration result corresponding to the migration status read command returned by the target hard disk;
[0008] Determine the total number of migrations of the target hard disk according to the migration result, and determine the target migration threshold of the target hard disk according to the total number of migrations and attribute information of the target hard disk;
[0009] The target migration threshold is sent to the target hard disk; the target migration threshold is used to update the current migration threshold of the target hard disk.
[0010] In the above hard disk management method, the migration result of the target hard disk is obtained by reading the migration status command, and the total number of migrations is determined according to the migration result, and the current usage of the target hard disk is clarified. Then, the target migration threshold is determined according to the total number of migrations and the attribute information, and the target migration threshold is sent to the target hard disk, and the current migration threshold of the target hard disk is updated, so that the current migration threshold of the target hard disk is consistent with the usage and attributes of the target hard disk, reducing the burden of managing the target hard disk and improving the efficiency of the hard disk management method.
[0011] In one embodiment, the migration result is whether the migration occurs, and sending a migration status read command to the target hard disk and receiving the migration result corresponding to the migration status read command returned by the target hard disk includes:
[0012] Sending a data read command to the target hard disk; the data read command includes a migration status read command;
[0013] Receive the target data corresponding to the data read command and whether the migration occurs corresponding to the migration status read command returned by the target hard disk.
[0014] In this embodiment, by sending a migration status reading command to the target hard disk and receiving a response from the target hard disk indicating whether migration has occurred, the migration status of the target hard disk is clarified, which facilitates the subsequent determination of the usage of the target hard disk and further adjustment of the migration threshold.
[0015] In one embodiment, the migration result is the number of migrations; sending a migration status read command to the target hard disk, and receiving the migration result corresponding to the migration status read command returned by the target hard disk, includes:
[0016] According to the preset time period, a migration status reading command is sent to the target hard disk;
[0017] Receive the number of moves corresponding to the move status read command returned by the target hard disk; the number of moves is the number of moves performed by the target hard disk within a current time period.
[0018] In this embodiment, by sending a migration status reading command to the target hard disk and receiving the migration number returned by the target hard disk, the migration status of the target hard disk is clarified, which facilitates the subsequent determination of the usage of the target hard disk and further adjustment of the migration threshold.
[0019] In one embodiment, determining the total number of migrations of the target hard disk according to the migration result includes:
[0020] If the migration result is that migration has occurred, the historical migration times of the target hard disk are adjusted upward to obtain the total migration times of the target hard disk;
[0021] If the migration result is that no migration has occurred, determining the historical migration times of the target hard disk as the total migration times;
[0022] If the migration result is the migration times, the historical migration times of the target hard disk and the migration times are added to obtain the total migration times of the target hard disk.
[0023] In this embodiment, the total number of moves of the target hard disk is determined by the move result and the historical number of moves of the target hard disk, and the usage of the target hard disk is clarified, so that the move threshold of the target hard disk can be adjusted according to the total number of moves. In addition, by adjusting the move threshold of the target hard disk, the solid-state hard disks in the same group can be at different wear speeds, thereby avoiding the situation where multiple disks reach life warning at the same time, thereby ensuring the integrity of the data.
[0024] In one embodiment, determining the target migration threshold of the target hard disk according to the total migration times and attribute information of the target hard disk includes:
[0025] Acquire the attribute information and threshold adjustment range of the target hard disk, and determine the expected total number of migrations of the target hard disk according to the attribute information; the attribute information includes each attribute field and the attribute change value corresponding to each attribute field;
[0026] Determining an initial adjustment value according to the impact ratio corresponding to each attribute field, each attribute change value and the threshold adjustment range;
[0027] Determine a difference in the number of moves between the expected total number of moves and the total number of moves, and determine a target adjustment value according to an adjustment ratio corresponding to the difference in the number of moves and the initial adjustment value;
[0028] Data processing is performed on the target adjustment value and the current migration threshold of the target hard disk to obtain the target migration threshold of the target hard disk.
[0029] In this embodiment, the target migration threshold of the target hard disk is determined by the total number of migrations and attribute information of the target hard disk, so that the current migration threshold of the target hard disk can be adjusted based on the target migration threshold, so that the target migration threshold is consistent with the current usage of the target hard disk, thereby improving the efficiency of hard disk management. In addition, when the current migration threshold is too low, the utilization value of the solid-state hard disk is increased by raising the migration threshold. When the current migration threshold is too high, the data consistency margin interval is increased by lowering the migration threshold, thereby improving data reliability.
[0030] In a second aspect, the present application provides a hard disk management method, which is applied to a target hard disk, and the method includes:
[0031] receiving a migration status reading command sent by the storage array, and determining a migration result corresponding to the migration status reading command;
[0032] The migration result is sent to the storage array.
[0033] In this embodiment, by receiving and executing the migration status reading command and feeding back the migration result to the storage array, the storage array can adjust the migration threshold according to the migration result.
[0034] In one embodiment, the migration result is a migration type, and the receiving a migration status read command sent by the storage array and determining the migration result corresponding to the migration status read command includes:
[0035] Receiving a data read command sent by a storage array; the data read command includes a migration status read command;
[0036] Executing the data read command to obtain target data corresponding to the data read command, and determining whether the number of bit errors exceeds a preset uncorrectable threshold;
[0037] If the number of bit errors does not exceed the uncorrectable threshold, determining whether the number of bit errors exceeds a current migration threshold, and obtaining a determination result;
[0038] The migration type corresponding to the migration status read command is determined according to the judgment result, and the migration type and the target data are sent to the storage array.
[0039] In this embodiment, the target hard disk determines the migration result while determining the target data, and feeds back the migration result and the target data to the storage array at the same time, thereby reducing the number of communications between the storage array and the target hard disk, reducing the burden of managing the target hard disk, and improving the efficiency of hard disk management.
[0040] In a third aspect, the present application further provides a hard disk management device, including:
[0041] A first sending module is used to send a migration status reading command to a target hard disk, and receive a migration result corresponding to the migration status reading command returned by the target hard disk;
[0042] A determination module, configured to determine the total number of migrations of the target hard disk according to the migration result, and determine the target migration threshold of the target hard disk according to the total number of migrations and attribute information of the target hard disk;
[0043] The second sending module is used to send the target migration threshold to the target hard disk; the target migration threshold is used to update the current migration threshold of the target hard disk.
[0044] In a fourth aspect, the present application further provides a hard disk management device, including:
[0045] A first receiving module is used to receive a migration status reading command sent by the storage array, and determine a migration result corresponding to the migration status reading command;
[0046] A third sending module is used to send the migration result to the storage array.
[0047] In a fifth aspect, the present application further provides a computer device, comprising a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the following steps are implemented:
[0048] Sending a migration status read command to a target hard disk, and receiving a migration result corresponding to the migration status read command returned by the target hard disk;
[0049] Determine the total number of migrations of the target hard disk according to the migration result, and determine the target migration threshold of the target hard disk according to the total number of migrations and attribute information of the target hard disk;
[0050] The target migration threshold is sent to the target hard disk; the target migration threshold is used to update the current migration threshold of the target hard disk.
[0051] In a sixth aspect, the present application further provides a computer device, comprising a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the following steps are implemented:
[0052] Receiving a migration status reading command sent by the storage array, and determining a migration result corresponding to the migration status reading command;
[0053] The migration result is sent to the storage array.
[0054] In a seventh aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the following steps are implemented:
[0055] Sending a migration status read command to a target hard disk, and receiving a migration result corresponding to the migration status read command returned by the target hard disk;
[0056] Determine the total number of migrations of the target hard disk according to the migration result, and determine the target migration threshold of the target hard disk according to the total number of migrations and attribute information of the target hard disk;
[0057] The target migration threshold is sent to the target hard disk; the target migration threshold is used to update the current migration threshold of the target hard disk.
[0058] In an eighth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the following steps are implemented:
[0059] receiving a migration status reading command sent by the storage array, and determining a migration result corresponding to the migration status reading command;
[0060] The migration result is sent to the storage array.
[0061] In a ninth aspect, the present application further provides a computer program product, including a computer program, which implements the following steps when executed by a processor:
[0062] Sending a migration status read command to a target hard disk, and receiving a migration result corresponding to the migration status read command returned by the target hard disk;
[0063] Determine the total number of migrations of the target hard disk according to the migration result, and determine the target migration threshold of the target hard disk according to the total number of migrations and attribute information of the target hard disk;
[0064] The target migration threshold is sent to the target hard disk; the target migration threshold is used to update the current migration threshold of the target hard disk.
[0065] In a tenth aspect, the present application further provides a computer program product, including a computer program, which implements the following steps when executed by a processor:
[0066] receiving a migration status reading command sent by the storage array, and determining a migration result corresponding to the migration status reading command;
[0067] The migration result is sent to the storage array.
[0068] The hard disk management method, device, computer equipment, storage medium and computer program product send a move status read command to the target hard disk, and receive the move result corresponding to the move status read command returned by the target hard disk; determine the total number of moves of the target hard disk according to the move result, and determine the target move threshold of the target hard disk according to the total number of moves and attribute information of the target hard disk; send the target move threshold to the target hard disk; the target move threshold is used to update the current move threshold of the target hard disk. With this method, the move result of the target hard disk is obtained through the move status read command, and the total number of moves is determined according to the move result, and the current usage of the target hard disk is clarified. Then, the target move threshold is determined according to the total number of moves and attribute information, and the target move threshold is sent to the target hard disk, and the current move threshold of the target hard disk is updated, so that the current move threshold of the target hard disk is consistent with the usage and attributes of the target hard disk, reducing the burden of managing the target hard disk and improving the efficiency of the hard disk management method. BRIEF DESCRIPTION OF THE DRAWINGS
[0069] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the related technologies, the drawings required for use in the embodiments or the related technical descriptions are briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0070] Figure 1 A diagram of an application environment of a hard disk management method in an embodiment;
[0071] Figure 2 is a diagram showing the relationship between data static time and the number of error bits in one embodiment;
[0072] Figure 3 A schematic diagram of a flow chart of a storage array executing a hard disk management method in one embodiment;
[0073] Figure 4 A schematic diagram of a flow chart of determining whether a moving step occurs in one embodiment;
[0074] Figure 5 A schematic diagram of a flow chart of a step of determining the number of moves in one embodiment;
[0075] Figure 6 A schematic diagram of a flow chart of a step of determining the total number of moves in one embodiment;
[0076] Figure 7 A schematic diagram of a flow chart of a step of determining a target moving threshold in an embodiment;
[0077] Figure 8A schematic diagram of a basis for adjusting a migration threshold of a storage array in one embodiment;
[0078] Fig. 9 A schematic diagram of a flow chart of a target hard disk executing a hard disk management method in one embodiment;
[0079] Fig.10 A schematic diagram of a flow chart of a step of returning a migration result in one embodiment;
[0080] Fig.11 A schematic diagram of a process of connecting a new hard disk to a storage array in one embodiment;
[0081] Fig.12 A schematic diagram of a process for adjusting a moving threshold in real time in one embodiment;
[0082] Fig.13 A schematic diagram of a flow chart of regularly adjusting a moving threshold in an embodiment;
[0083] Fig.14 is a structural block diagram of a hard disk management device in an embodiment;
[0084] Fig.15 is a structural block diagram of a hard disk management device in another embodiment;
[0085] Fig.16 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION
[0086] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0087] The hard disk management method provided in the embodiment of the present application can be applied to Figure 1 The hard disk management system 100 shown in FIG. 1 includes a host 110, a storage array 120, and solid state hard disks (hereinafter referred to as hard disks) 130. The host 110 and the storage array are in communication connection, and the storage array 120 and each hard disk 130 are in communication connection. The host 110 exchanges data with each hard disk 130 through the storage array.
[0088] In order to make the purpose, technical solution and advantages of the present application clearer, the technical background of the present application is described in more detail. Specifically, when the storage array 120 (hereinafter referred to as the storage array) uses the hard disk 130 (hereinafter referred to as the hard disk), that is, when the storage array reads data in the hard disk, the reading result corresponding to each read command sent by the storage array to the hard disk is mainly a read success or a read failure. If the read failure includes a medium error, it means that a medium error occurs inside the hard disk and the data stored on the hard disk is no longer credible.
[0089] When a read failure includes a media error, the storage array needs to recover data based on its own fault tolerance mechanism, including recovery through RAID (Redundant Arrays of Independent Disks) or recovery through multiple copies. However, the recovery process will inevitably increase the time consumption of the entire process. If the storage array itself does not have a data fault tolerance mechanism, or the number of errors exceeds the capacity of the fault tolerance mechanism, data inconsistency will occur.
[0090] The media error of SSD is determined by the characteristics of NAND Flash (NAND-based flash memory, a type of non-volatile memory) in the SSD. The probability of media error of SSD is much higher than that of mechanical hard disk. Figure 2 FIG. 4 is a diagram showing the relationship between the data static time and the number of error bits in one embodiment. Figure 2 As shown, for solid-state drives, the probability of medium errors increases with the increase of data static time.
[0091] In order to cope with this characteristic of flash memory, the solid-state drive uses the ECC mechanism to protect the data stored on the solid-state drive. There is an uncorrectable threshold TH0. When the number of bit errors in the protected data does not exceed the uncorrectable threshold, it can be corrected through the ECC mechanism and the correct data can be transmitted back to the host (i.e., the storage array). The host does not know what happened inside the hard drive. If the number of bits in the protected data exceeds the uncorrectable threshold TH0, it means that the ECC error correction capability has been exceeded and the group of data cannot be corrected. At this time, it is necessary to reply to the host with a media error. This error is also called UNC (Uncorrectable Error, uncorrectable data error).
[0092] For most SSDs, there is a threshold value TH1 which is less than TH0, which can be called the migration threshold. When the SSD finds that the number of bit errors exceeds TH1, it will start the migration, that is, read the data from the current location, correct it through the ECC mechanism, and write it to the new NAND Flash location. At this time, the number of bit errors in the group of data is cleared, and then gradually increases over time.
[0093] Although the SSD can set a value TH1 that is less than the uncorrectable error threshold as the migration threshold, when the migration threshold is exceeded, the data will be moved and rewritten. However, this operation will bring a new problem, which is to consume the life of the NAND Flash in the hard disk. The life of NAND Flash is measured in P / E (Program / Erase) times. When the specified P / E times are reached, it means that the data retention ability of Nand Flash will not meet the standard. At this time, the entire SSD is usually set to read-only and a new SSD needs to be replaced. For storage arrays using SSDs, it is also necessary to restore the valid data in the SSD to the new SSD.
[0094] In the current technical solution, a solid state drive generally sets a fixed migration threshold TH1. After the migration threshold TH1 is fixed, the following problems occur:
[0095] 1. If the interval between the migration threshold TH1 and the uncorrectable threshold TH0 does not meet the data reliability requirements of the storage array, the data array needs to shorten the internal background data consistency inspection cycle so that the bit error number can be read before reaching TH0, thereby triggering the internal data migration of the solid-state drive to eliminate the data risk. In this case, the storage array needs to shorten its internal background data consistency inspection cycle, which will increase the background read bandwidth, squeeze the read and write bandwidth provided to the host, and also increase power consumption, thereby reducing the efficiency of hard disk management.
[0096] 2. If the interval between the migration threshold TH1 and the uncorrectable threshold TH0 is greater than the data reliability requirement of the storage array, more migration actions will be generated. Since each migration will increase new writing, more NAND Flash life will be consumed.
[0097] 3. At the same time, since the solid-state hard disk uses a fixed migration threshold TH1, under the effect of the storage array balancing function, all solid-state hard disks will be in a relatively even wear state. It is very likely that multiple solid-state hard disks in the same group will alarm at the same time due to the NAND Flash life. At this time, multiple hard disks may fail, resulting in data loss on multiple hard disks.
[0098] Based on the above-mentioned traditional technology, the embodiment of the present application provides a hard disk management method, which obtains the target hard disk's migration result through the migration status reading command, and determines the total number of migrations based on the migration result, and clarifies the current usage of the target hard disk. Then, the target migration threshold is determined based on the total number of migrations and attribute information, and the target migration threshold is sent to the target hard disk, and the current migration threshold of the target hard disk is updated, so that the current migration threshold of the target hard disk is consistent with the usage and attributes of the target hard disk, reducing the burden of managing the target hard disk and improving the efficiency of the hard disk management method.
[0099] It should be noted that the beneficial effects brought about by the embodiments of the present application or the technical problems solved are not limited to this one, but may also include other implicit or related problems. For details, please refer to the description of the following embodiments.
[0100] In an exemplary embodiment, Figure 3 As shown, a hard disk management method is provided, which is applied to Figure 1 The storage array 120 in FIG. 1 (hereinafter, the reference numeral is omitted and referred to as the storage array) is used as an example to illustrate the method, which includes the following steps 302 to 306. Among them:
[0101] Step 302: Send a migration status read command to the target hard disk, and receive a migration result corresponding to the migration status read command returned by the target hard disk.
[0102] In implementation, the storage array communicates with the target hard disk according to the communication protocol. Therefore, on the basis of following the communication protocol, the storage array generates a migration status read command. Then, the storage array sends the migration status read command to the target hard disk. The target hard disk receives the migration status read command and determines the migration result corresponding to the migration status read command. Then, the target hard disk sends the migration result to the storage array based on the communication protocol. The storage array receives the migration result.
[0103] Step 304: determine the total number of migrations of the target hard disk according to the migration result, and determine the target migration threshold of the target hard disk according to the total number of migrations and attribute information of the target hard disk.
[0104] In implementation, the storage array pre-stores the historical number of moves of the target hard disk. The storage array processes the move result and the historical number of moves of the target hard disk to obtain the total number of moves of the target hard disk. Then, the storage array obtains the attribute information of the target hard disk, and determines the initial adjustment value and the expected number of moves according to the attribute information of the target hard disk. Then, the storage array processes the initial adjustment value according to the difference in the number of moves between the expected number of moves and the total number of moves of the target hard disk to obtain the target adjustment value. The storage array performs addition processing on the target adjustment value and the target move threshold to obtain the target move threshold of the target hard disk.
[0105] Step 306: Send the target migration threshold to the target hard disk.
[0106] The target migration threshold is used to update the current migration threshold of the target hard disk.
[0107] In implementation, the storage array sends the target migration threshold to the target hard disk based on the communication protocol. The target hard disk receives the target migration threshold and determines the target migration threshold as the current migration threshold of the target hard disk.
[0108] In the above hard disk management method, the migration result of the target hard disk is obtained by reading the migration status command, and the total number of migrations is determined according to the migration result, and the current usage of the target hard disk is clarified. Then, the target migration threshold is determined according to the total number of migrations and the attribute information, and the target migration threshold is sent to the target hard disk, and the current migration threshold of the target hard disk is updated, so that the current migration threshold of the target hard disk is consistent with the usage and attributes of the target hard disk, reducing the burden of managing the target hard disk and improving the efficiency of the hard disk management method.
[0109] In an exemplary embodiment, Figure 4 As shown, the migration result is whether the migration occurs, and the specific processing process of step 302 includes steps 402 to 404. Among them:
[0110] Step 402: Send a data read command to the target hard disk.
[0111] The data read command includes a movement status read command.
[0112] In implementation, when the host needs to read data, the host sends an initial data read command to the storage array. The storage array receives the initial data read command, then generates a migration status read command, and constructs a data read command based on the initial data read command and the migration status read command. Then, the storage array sends the data read command to the target hard disk.
[0113] Step 404, receiving the target data corresponding to the data read command and the migration status read command corresponding to whether migration has occurred, which are returned by the target hard disk.
[0114] In implementation, the target hard disk determines the target data corresponding to the data read command and whether the migration status read command has been migrated. Then, the target hard disk sends the target data and whether the migration has occurred to the storage array based on the communication connection. The storage array receives the target data and whether the migration has occurred.
[0115] In this embodiment, by sending a migration status reading command to the target hard disk and receiving a response from the target hard disk indicating whether migration has occurred, the migration status of the target hard disk is clarified, which facilitates the subsequent determination of the usage of the target hard disk and further adjustment of the migration threshold.
[0116] In an exemplary embodiment, Figure 5 As shown, the moving result is the moving times, and the specific processing process of step 302 includes steps 502 to 504. Among them:
[0117] Step 502: Send a migration status read command to the target hard disk according to a preset time period.
[0118] In implementation, a time period is preset in the storage array. The storage array generates a migration status read command according to the preset time period and sends the migration status read command to the target hard disk.
[0119] Optionally, the time period can be set to 1 day or 2 days, which is determined based on the attribute information of the target hard disk and the inspection cycle. The embodiment of the present application does not limit the time period.
[0120] Step 504, receiving the number of moves corresponding to the move status read command returned by the target hard disk.
[0121] The number of migrations is the number of migrations performed by the target hard disk within the current time period.
[0122] In implementation, the target hard disk receives a migration status read command and determines the number of migrations performed in the current time period. Then, the target hard disk returns the number of migrations corresponding to the migration status read command to the storage array.
[0123] In this embodiment, by sending a migration status reading command to the target hard disk and receiving the migration number returned by the target hard disk, the migration status of the target hard disk is clarified, which facilitates the subsequent determination of the usage of the target hard disk and further adjustment of the migration threshold.
[0124] In an exemplary embodiment, Figure 6 As shown, the specific process of determining the total number of migrations of the target hard disk according to the migration result in step 304 includes steps 602 to 606. Among them:
[0125] Step 602: If the migration result is that migration has occurred, the historical migration times of the target hard disk are adjusted upward to obtain the total migration times of the target hard disk.
[0126] In implementation, if the migration result is that migration occurs, the storage array adds the historical migration times of the target hard disk and 1 to obtain the total migration times of the target hard disk.
[0127] Step 604: If the migration result is that no migration has occurred, determine the historical migration times of the target hard disk as the total migration times.
[0128] In implementation, if the migration result is that migration has not occurred, the storage array determines the historical migration times of the target hard disk as the total migration times of the target hard disk.
[0129] Step 606: If the migration result is the migration count, add the historical migration count and the migration count of the target hard disk to obtain the total migration count of the target hard disk.
[0130] In implementation, if the migration result is the migration count, the storage array performs an addition operation on the historical migration count of the target hard disk and the migration count in the current time period to obtain the total migration count of the target hard disk.
[0131] In this embodiment, the total number of moves of the target hard disk is determined by the move result and the historical number of moves of the target hard disk, and the usage of the target hard disk is clarified, so that the move threshold of the target hard disk can be adjusted according to the total number of moves. In addition, by adjusting the move threshold of the target hard disk, the solid-state hard disks in the same group can be at different wear speeds, thereby avoiding the situation where multiple disks reach life warning at the same time, thereby ensuring the integrity of the data.
[0132] In an exemplary embodiment, Figure 7 As shown, the specific process of determining the target migration threshold of the target hard disk according to the total migration times and attribute information of the target hard disk in step 304 includes steps 702 to 708. Among them:
[0133] Step 702: Acquire the attribute information and threshold adjustment range of the target hard disk, and determine the expected total number of migrations of the target hard disk according to the attribute information.
[0134] The attribute information includes each attribute field and the attribute change value corresponding to each attribute field. The attribute field includes data reliability requirements, the health status of the solid state drive in this group, the background data consistency inspection cycle and other factors that can be considered.
[0135] In implementation, the storage array obtains the threshold adjustment range and each attribute field of the target hard disk. Then, the storage array obtains the attribute change value and current attribute value corresponding to each attribute field. The storage array constructs the attribute information of the target hard disk according to each attribute field and the attribute change value and current attribute value corresponding to each attribute field. The storage array processes the current attribute value of each attribute according to the preset expected total number of migration times algorithm to obtain the expected total number of migration times of the target hard disk.
[0136] Optionally, other factors that may be considered may be the capacity of the hard disk, the number of P / E times, etc. The embodiments of the present application do not limit other factors that may be considered.
[0137] Optionally, the threshold adjustment range is generally half of the uncorrectable threshold, which is determined based on the attribute information of the target disk. The embodiment of the present application does not limit the threshold adjustment range.
[0138] Step 704: Determine an initial adjustment value according to the impact ratio corresponding to each attribute field, each attribute change value and the threshold adjustment range.
[0139] In implementation, the storage array is pre-set with the impact ratio corresponding to each attribute field. For each attribute field, the storage array determines the product of the threshold adjustment range, the impact ratio corresponding to the attribute field, and the attribute change value to obtain the adjustment value corresponding to the attribute field. Then, the storage array performs addition operation on the adjustment values corresponding to each attribute field to obtain the initial adjustment value.
[0140] Optionally, the impact ratio of data reliability requirements in the attribute field, the health status of this group of solid-state hard drives, the background data consistency inspection cycle and other considerable factors can be set to 25% (percent), or can be set according to storage requirements. The embodiment of the present application does not limit the impact ratio corresponding to each attribute field.
[0141] Step 706, determining the difference in the number of moves between the expected total number of moves and the total number of moves, and determining the target adjustment value according to the adjustment ratio corresponding to the difference in the number of moves and the initial adjustment value.
[0142] In implementation, a correspondence between the difference in the number of moves and the adjustment ratio is pre-set in the storage array. The storage array calculates the difference between the expected total number of moves and the total number of moves to obtain the difference in the number of moves. The storage array determines the adjustment ratio corresponding to the difference in the number of moves based on the correspondence between the difference in the number of moves and the adjustment ratio. Then, the storage array determines the product of the adjustment ratio and the initial adjustment value as the target adjustment value.
[0143] Step 708: Process the target adjustment value and the current migration threshold of the target hard disk to obtain the target migration threshold of the target hard disk.
[0144] In implementation, the storage array performs an addition operation on the target adjustment value and the current migration threshold of the target hard disk to obtain the target migration threshold of the target hard disk.
[0145] In an exemplary embodiment, Figure 8 A diagram showing the basis for adjusting the migration threshold for a storage array. Figure 8In the process, the storage array obtains the threshold adjustment range and each attribute field of the target hard disk, and obtains the attribute change value and current attribute value corresponding to each attribute field. Among them, the attribute field includes the attribute field containing data reliability requirements, the health status of the solid state hard disk of this group, the background data consistency inspection cycle and other factors that can be considered. The storage array determines the expected total number of migrations (expected number of migrations) according to the attribute change value corresponding to each attribute field. Then, the storage array determines the initial adjustment value according to the impact ratio corresponding to each attribute field, each attribute change value and the threshold adjustment range. The storage array determines the adjustment ratio according to the total number of migrations input by the feedback input (the number of migrations fed back by the solid state hard disk) and the expected number of migrations, and determines the target adjustment value according to the adjustment ratio and the initial adjustment value. Then, the storage array determines whether the current migration threshold of the target hard disk needs to be adjusted according to the target adjustment value. In the case where the current migration threshold of the target hard disk needs to be adjusted, the target migration threshold is determined according to the target adjustment value and the current migration threshold of the target hard disk, and the target migration threshold is sent to the target hard disk.
[0146] In an optional embodiment, assuming that the interval from the current migration threshold TH1 of the target hard disk to the uncorrectable threshold TH0 is 20, the write amplification factor is 2.0 (i.e., if the host writes 1GB of data, 2GB of data needs to be written on the NAND Flash). If the current migration threshold TH1 is increased by 10 to obtain the target migration threshold, the migration action will be reduced, and the write amplification system can be reduced to 1.7 (i.e., if the host writes 1GB of data, 1.7GB of data needs to be written on the NAND Flash). To calculate from another dimension, assuming that the allowable write amount of the NAND Flash on the target hard disk is 3000TB, the amount of data that can be written to the target hard disk before adjusting TH1 (the migration threshold of the target hard disk is the current migration threshold) is 1500TB. After increasing TH1 (the migration threshold of the target hard disk is the target migration threshold), the amount of data that can be written to the target hard disk is 1764TB. The amount of writes that the target hard disk can accommodate from the host has increased by 17%, that is, the use value has increased by 17%.
[0147] In an optional embodiment, assuming that the interval from the current move threshold TH1 of the target hard disk to the uncorrectable threshold TH0 is 10, the static time for data inconsistency to occur is greater than 6 months. Then the current move threshold TH1 is lowered by 10 to obtain the target move threshold TH1, and the static time for data inconsistency to occur will be greater than 12 months.
[0148] In an optional embodiment, it is assumed that the reasonable current migration threshold TH1 and the uncorrectable threshold TH0 of the solid state drive group to which the target hard disk belongs are separated by 10. Then, after the remaining life of the target hard disk is less than 20%, the current migration threshold of the target hard disk can be increased by 10. Then, due to the increase in the number of migrations, the target hard disk will inevitably issue a life warning and require replacement earlier than other hard disks, thereby avoiding the situation where multiple hard disks issue life warnings at the same time.
[0149] In this embodiment, the target migration threshold of the target hard disk is determined by the total number of migrations and attribute information of the target hard disk, so that the current migration threshold of the target hard disk can be adjusted based on the target migration threshold, so that the target migration threshold is consistent with the current usage of the target hard disk, thereby improving the efficiency of hard disk management. In addition, when the current migration threshold is too low, the utilization value of the solid-state hard disk is increased by raising the migration threshold. When the current migration threshold is too high, the data consistency margin interval is increased by lowering the migration threshold, thereby improving data reliability.
[0150] In an exemplary embodiment, Fig. 9 As shown, a hard disk management method is provided, which is applied to Figure 1 Taking any hard disk 130 in the target hard disk as an example (hereinafter referred to as the target hard disk 130), the method includes the following steps 902 to 904. Among them:
[0151] Step 902, receiving a migration status read command sent by the storage array, and determining a migration result corresponding to the migration status read command;
[0152] In implementation, the target hard disk receives a migration status read command sent by the storage array, executes the migration status read command, and obtains a migration result corresponding to the migration status read command.
[0153] Step 904: Send the migration result to the storage array.
[0154] In implementation, the target hard disk sends the migration result to the storage array based on the communication connection, and the storage array determines the target migration threshold of the target hard disk based on the migration result.
[0155] In this embodiment, by receiving and executing the migration status reading command and feeding back the migration result to the storage array, the storage array can adjust the migration threshold according to the migration result.
[0156] In one embodiment, the move result is a move type, such as Fig.10 As shown, the specific processing process in step 902 includes steps 1002 to 1008. Among them:
[0157] Step 1002: Receive a data read command sent by a storage array.
[0158] The data read command includes a movement status read command.
[0159] In implementation, when the storage array needs to read data, the storage array generates a data read command and sends the data read command to the target hard disk. The target hard disk receives the data read command through a communication connection and determines the move status read command in the data read command.
[0160] Step 1004 , execute the data read command, obtain the target data corresponding to the data read command, and determine whether the number of bit errors exceeds a preset uncorrectable threshold.
[0161] In implementation, the target hard disk executes a data read command to obtain target data corresponding to the data read command. Then, the target hard disk determines whether the current number of bit errors exceeds a preset uncorrectable threshold.
[0162] In an optional embodiment, if the number of bit errors exceeds the uncorrectable threshold, the target hard disk determines the medium error as the read result of the data read command, and sends the read result to the storage array.
[0163] Step 1006: If the number of bit errors does not exceed the uncorrectable threshold, determine whether the number of bit errors exceeds the current migration threshold and obtain a determination result.
[0164] In implementation, if the number of bit errors does not exceed the uncorrectable threshold, the target hard disk determines whether the number of bit errors exceeds the current migration threshold. If the number of bit errors exceeds the current migration threshold, the target hard disk performs data migration according to the ECC mechanism. Then, the target hard disk determines that the judgment result is that the number of bit errors exceeds the current migration threshold. If the number of bit errors does not exceed the current migration threshold, the target hard disk determines that the judgment result is that the number of bit errors does not exceed the current migration threshold.
[0165] Step 1008: Determine the migration type corresponding to the migration status read command according to the judgment result, and send the migration type and target data to the storage array.
[0166] In implementation, if the judgment result is that the number of bit errors exceeds the current migration threshold, the target hard disk determines the migration type as migration occurs. If the judgment result is that the number of bit errors exceeds the current migration threshold, the target hard disk determines the migration type as no migration occurs.
[0167] In this embodiment, the target hard disk determines the migration result while determining the target data, and feeds back the migration result and the target data to the storage array at the same time, thereby reducing the number of communications between the storage array and the target hard disk, reducing the burden of managing the target hard disk, and improving the efficiency of hard disk management.
[0168] When a new hard disk needs to be connected, the storage array needs to determine the initial migration threshold of the new hard disk and send the initial migration threshold to the new hard disk. The embodiment of the present application provides a method for connecting a new hard disk to a storage array, such as Fig.11 shown. Fig.11 Schematic diagram of the process of connecting a new hard disk to a storage array. Fig.11 The storage array and the new SSD to be connected are included in the process of connecting the storage array to the new SSD:
[0169] Step 1101, receiving a hard disk access request.
[0170] In implementation, when a new hard disk needs to be connected, the new hard disk will initiate an access request to the storage array. The storage array receives the access request of the new hard disk and obtains the attribute information of the new hard disk.
[0171] Step 1102, setting an initial migration threshold TH1 for the hard disk.
[0172] In implementation, the storage array determines the initial migration threshold TH1 of the new hard disk according to the attribute information of the new hard disk. Then, the storage array sends the initial migration threshold TH1 to the new hard disk.
[0173] Step 1103, confirm the initial migration threshold TH1 and save it.
[0174] In implementation, the new hard disk receives the initial migration threshold TH1, and confirms that the initial migration threshold TH1 is the current migration threshold. The new hard disk saves the current migration threshold.
[0175] The host will set different management methods for the target hard disk according to the properties of the target hard disk. For example, if the performance of the target hard disk is low, in order to avoid increasing the communication burden between the storage array and the target hard disk, the target hard disk's migration threshold adjustment strategy will be determined as real-time adjustment of the migration threshold. If the target hard disk's P / E times are small, the host will determine the target hard disk's migration threshold adjustment strategy as timed adjustment of the migration threshold. Of course, the setting conditions for these two migration threshold adjustments are not restricted and can be set according to actual needs. The following is a detailed introduction to these two migration threshold adjustment strategies, the first of which is real-time adjustment of the migration threshold. An embodiment of the present application provides a method for real-time adjustment of the migration threshold, such as Fig.12 As shown. Fig.12 In the example, array refers to the storage array and hard disk refers to the target hard disk. Fig.12 A flowchart for adjusting the moving threshold in real time, including:
[0176] Step 1201: The array issues a read command.
[0177] In implementation, the read command is a data read command. When the storage array needs to read data, the storage array sends a data read command to the target hard disk. The data read command includes a migration status read command.
[0178] Step 1202: The hard disk executes a read command.
[0179] In implementation, the target hard disk receives a data read command and executes the data read command to obtain target data.
[0180] Step 1203: The hard disk determines whether the number of errors exceeds an uncorrectable threshold.
[0181] In implementation, the number of errors is the number of bit errors. The target hard disk determines whether the number of bit errors exceeds a preset uncorrectable threshold. If the number of bit errors exceeds the uncorrectable threshold, the target hard disk executes step 1204. If the number of bit errors does not exceed the uncorrectable threshold, the target hard disk executes step 1206.
[0182] Step 1204, the hard disk returns a UNC error.
[0183] In implementation, the target hard disk determines a UNC error (Uncorrectable Error, also called a medium error) as a read result corresponding to the data read command, and then sends the read result to the storage array.
[0184] Step 1205: the array performs data recovery.
[0185] In implementation, the storage array receives the read result and performs data recovery.
[0186] Step 1206, the hard disk determines whether the number of errors exceeds the migration threshold.
[0187] In implementation, the target hard disk determines whether the number of bit errors exceeds the current migration threshold of the target hard disk. If the number of bit errors exceeds the current migration threshold, the target hard disk executes step 1207 and then executes step 1208. If the number of bit errors does not exceed the current migration threshold, the target hard disk directly executes step 1208.
[0188] Step 1207, the hard disk moves data to other NAND Flash.
[0189] In implementation, the target hard disk reads data from the NAND Flash, corrects the data based on the ECC mechanism, and obtains corrected data. Then, the target hard disk writes the corrected data into other NAND Flashes.
[0190] Step 1208, the hard disk returns the data and informs whether it has been moved.
[0191] In implementation, the target hard disk determines whether to perform the migration, that is, the target hard disk determines whether to perform the above step 1207. Then, the target hard disk returns the target data and whether to perform the migration to the storage array.
[0192] Step 1209: the array counts the number of migrations and performs strategy matching.
[0193] In implementation, the storage array determines the total number of migrations of the target hard disk according to whether the migration is performed, and then determines the target migration threshold according to the total number of migrations and the attribute information of the target hard disk.
[0194] Step 1210: The array determines whether the migration threshold needs to be adjusted.
[0195] In implementation, the storage array determines whether the target migration threshold is consistent with the current migration threshold of the target hard disk. If the target migration threshold is consistent with the current migration threshold, the storage array determines that the migration threshold does not need to be adjusted, and executes step 1213. If the target migration threshold is inconsistent with the current migration threshold, the storage array determines that the migration threshold needs to be adjusted, and executes step 1211.
[0196] Step 1211: The array sends a new migration threshold.
[0197] During implementation, the storage array sends the target migration threshold to the target hard disk.
[0198] Step 1212, the hard disk receives the new threshold.
[0199] In implementation, the target hard disk receives the target move threshold and updates the current move threshold based on the target move threshold.
[0200] Step 1213: the array read command ends.
[0201] In implementation, the storage array determines that the process of the data read command is finished.
[0202] Another method is to adjust the moving threshold at a fixed time. The present application embodiment provides a method for adjusting the moving threshold at a fixed time, such as Fig.13 As shown. Fig.13 In the example, array refers to the storage array and hard disk refers to the target hard disk. Fig.13 A flowchart for adjusting the moving threshold at a fixed time, including:
[0203] Step 1301: The array issues a read command.
[0204] In implementation, the read command is a data read command. When the storage array needs to read data, the storage array sends a data read command to the target hard disk.
[0205] Step 1302: The hard disk executes the read command.
[0206] In implementation, the target hard disk receives a data read command and executes the data read command to obtain target data.
[0207] Step 1303: The hard disk determines whether the number of errors exceeds an uncorrectable threshold.
[0208] In implementation, the number of errors is the number of bit errors. The target hard disk determines whether the number of bit errors exceeds a preset uncorrectable threshold. If the number of bit errors exceeds the uncorrectable threshold, the target hard disk executes step 1304. If the number of bit errors does not exceed the uncorrectable threshold, the target hard disk executes step 1306.
[0209] Step 1304, the hard disk returns a UNC error.
[0210] In implementation, the target hard disk determines the UNC error as a read result corresponding to the data read command, and then sends the read result to the storage array.
[0211] Step 1305: the array performs data recovery.
[0212] In implementation, the storage array receives the read result and performs data recovery.
[0213] Step 1306: The hard disk determines whether the number of errors exceeds the migration threshold.
[0214] In implementation, the target hard disk determines whether the number of bit errors exceeds the current migration threshold of the target hard disk. If the number of bit errors exceeds the current migration threshold, the target hard disk executes step 1307 and then executes step 1308. If the number of bit errors does not exceed the current migration threshold, the target hard disk directly executes step 1308.
[0215] Step 1307, the hard disk moves data to other NAND Flash.
[0216] In implementation, the target hard disk reads data from the NAND Flash, corrects the data based on the ECC mechanism, and obtains corrected data. Then, the target hard disk writes the corrected data into other NAND Flashes.
[0217] Step 1308, the hard disk returns the data and informs whether it has been moved.
[0218] In implementation, the target hard disk returns the target data to the storage array.
[0219] Step 1309, record the number of moves.
[0220] In implementation, the target hard disk updates the number of migrations in the current time period according to whether migration is performed, that is, according to whether the target hard disk performs the above step 1307.
[0221] Step 1310: The array read command ends.
[0222] In implementation, the storage array determines that the process of the data read command is finished.
[0223] Step 1311: The array periodically initiates a command to obtain the number of moves.
[0224] In implementation, the storage array sends a migration status reading command to the target hard disk according to a preset time period to obtain the migration count of the target disk within the current time.
[0225] Step 1312, the hard disk executes the command and reports the number of moves.
[0226] In implementation, the target hard disk reads the migration status command to obtain the migration count in the current time period, and then the target hard disk sends the migration count to the storage array.
[0227] Step 1313: the array counts the number of migrations and performs strategy matching.
[0228] In implementation, the storage array determines the total number of migrations of the target hard disk according to whether the migration is performed, and then determines the target migration threshold according to the total number of migrations and the attribute information of the target hard disk.
[0229] Step 1314: The array determines whether the moving threshold needs to be adjusted.
[0230] In implementation, the storage array determines whether the target migration threshold is consistent with the current migration threshold of the target hard disk. If the target migration threshold is consistent with the current migration threshold, the storage array determines that the migration threshold does not need to be adjusted, and executes step 1317. If the target migration threshold is inconsistent with the current migration threshold, the storage array determines that the migration threshold needs to be adjusted, and executes step 1315.
[0231] Step 1315: The array sends a new migration threshold.
[0232] During implementation, the storage array sends the target migration threshold to the target hard disk.
[0233] Step 1316, the hard disk receives the new threshold.
[0234] In implementation, the target hard disk receives the target move threshold and updates the current move threshold based on the target move threshold.
[0235] Step 1317, the array clears the disk move count.
[0236] In implementation, the storage array sends a command to clear the number of moves to the target hard disk, and the target hard disk executes the command to clear the number of moves, so that the number of moves is reset to zero.
[0237] Step 1318, the array read command ends.
[0238] In implementation, the storage array determines that the process of the data read command is finished.
[0239] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.
[0240] Based on the same inventive concept, the embodiment of the present application also provides a hard disk management device for implementing the hard disk management method involved above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method, so the specific limitations in one or more hard disk management device embodiments provided below can refer to the limitations of the hard disk management method above, and will not be repeated here.
[0241] In an exemplary embodiment, Fig.14 As shown, a hard disk management device 1400 is provided, including: a first sending module 1401, a determining module 1402, and a second sending module 1403, wherein:
[0242] The first sending module 1401 is used to send a migration status reading command to the target hard disk, and receive a migration result corresponding to the migration status reading command returned by the target hard disk.
[0243] The determination module 1402 is used to determine the total number of migrations of the target hard disk according to the migration result, and determine the target migration threshold of the target hard disk according to the total number of migrations and attribute information of the target hard disk.
[0244] The second sending module 1403 is used to send the target migration threshold to the target hard disk; the target migration threshold is used to update the current migration threshold of the target hard disk.
[0245] In an exemplary embodiment, the migration result is whether the migration occurs, and the first sending module 1401 includes:
[0246] The first sending submodule is used to send a data read command to the target hard disk; the data read command includes a migration status read command.
[0247] The first receiving submodule is used to receive target data corresponding to the data read command and whether the migration occurs corresponding to the migration status read command returned by the target hard disk.
[0248] In an exemplary embodiment, the transfer result is the number of transfers, and the first sending module 1401 includes:
[0249] The second sending submodule is used to send a migration status reading command to the target hard disk according to a preset time period.
[0250] The second receiving submodule is used to receive the number of moves corresponding to the move status reading command returned by the target hard disk; the number of moves is the number of moves executed by the target hard disk within the current time period.
[0251] In an exemplary embodiment, the determination module 1402 includes a first determination submodule and a second determination submodule. The first determination submodule includes:
[0252] The first processing submodule is used for, if the migration result is that migration has occurred, to increase the historical migration times of the target hard disk to obtain the total migration times of the target hard disk.
[0253] The third determining submodule is used to determine the historical migration times of the target hard disk as the total migration times if the migration result is that no migration has occurred.
[0254] The first operation submodule is used for, if the migration result is the migration number, performing an addition operation on the historical migration number and the migration number of the target hard disk to obtain the total migration number of the target hard disk.
[0255] In an exemplary embodiment, the determination module 1402 includes a first determination submodule and a second determination submodule. The second determination submodule includes:
[0256] The third determination submodule is used to obtain the attribute information and threshold adjustment range of the target hard disk, and determine the expected total number of migrations of the target hard disk according to the attribute information; the attribute information includes each attribute field and the attribute change value corresponding to each attribute field.
[0257] The fourth determination submodule is used to determine the initial adjustment value according to the influence ratio corresponding to each attribute field, each attribute change value and the threshold adjustment range.
[0258] The fifth determination submodule is used to determine the difference in the number of moves between the expected total number of moves and the total number of moves, and determine the target adjustment value according to the adjustment ratio corresponding to the difference in the number of moves and the initial adjustment value.
[0259] The second processing submodule is used to perform data processing on the target adjustment value and the current migration threshold of the target hard disk to obtain the target migration threshold of the target hard disk.
[0260] In an exemplary embodiment, Fig.15 As shown, a hard disk management device 1500 is provided, comprising: a first receiving module 1501 and a third sending module 1502, wherein
[0261] The first receiving module 1501 is used to receive a migration status reading command sent by the storage array, and determine a migration result corresponding to the migration status reading command.
[0262] The third sending module 1502 is used to send the migration result to the storage array.
[0263] In an exemplary embodiment, the first receiving module 1501 includes:
[0264] The third receiving submodule is used to receive a data read command sent by the storage array; the data read command includes a migration status read command.
[0265] The first judgment submodule is used to execute a data read command, obtain target data corresponding to the data read command, and judge whether the number of bit errors exceeds a preset uncorrectable threshold.
[0266] The second judgment submodule is used to judge whether the number of bit errors exceeds the current migration threshold if the number of bit errors does not exceed the uncorrectable threshold, and obtain a judgment result.
[0267] The third sending submodule is used to determine the move type corresponding to the move status read command according to the judgment result, and send the move type and target data to the storage array.
[0268] Each module in the hard disk management device can be implemented in whole or in part by software, hardware, or a combination thereof. Each module can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute operations corresponding to each module.
[0269] In an exemplary embodiment, a computer device is provided. The computer device may be a terminal, and its internal structure diagram may be as shown in FIG. Fig.16As shown. The computer device includes a processor, a memory, an input / output interface, a communication interface, a display unit and an input device. The processor, the memory and the input / output interface are connected via a system bus, and the communication interface, the display unit and the input device are connected to the system bus via the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner can be implemented through WIFI, a mobile cellular network, NFC (near field communication) or other technologies. When the computer program is executed by the processor, a hard disk management method is implemented. The display unit of the computer device is used to form a visually visible picture, which can be a display screen, a projection device or a virtual reality imaging device. The display screen can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device can be a touch layer covering the display screen, or a button, trackball or touchpad set on the computer device shell, or an external keyboard, touchpad or mouse.
[0270] Those skilled in the art will understand that Fig.16 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0271] In one embodiment, a computer device is further provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the steps in the above method embodiments when executing the computer program.
[0272] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps in the above-mentioned method embodiments are implemented.
[0273] In one embodiment, a computer program product is provided, including a computer program, which implements the steps in the above method embodiments when executed by a processor.
[0274] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., but are not limited to this.
[0275] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0276] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.
Claims
1. A hard disk management method, It is characterized in that The method is applied to a storage array, and the method comprises: Sending a migration status read command to a target hard disk, and receiving a migration result corresponding to the migration status read command returned by the target hard disk; Determine the total number of migrations of the target hard disk according to the migration result, and determine the target migration threshold of the target hard disk according to the total number of migrations and attribute information of the target hard disk; The target migration threshold is sent to the target hard disk; the target migration threshold is used to update the current migration threshold of the target hard disk.
2. The method according to claim 1, It is characterized in that The migration result is whether the migration occurs, and sending a migration status reading command to the target hard disk and receiving the migration result corresponding to the migration status reading command returned by the target hard disk include: Sending a data read command to the target hard disk; the data read command includes a migration status read command; Receive the target data corresponding to the data read command and whether the migration occurs corresponding to the migration status read command returned by the target hard disk.
3. The method according to claim 1, It is characterized in that The migration result is the number of migrations; the sending of a migration status reading command to the target hard disk and receiving the migration result corresponding to the migration status reading command returned by the target hard disk includes: According to the preset time period, a migration status reading command is sent to the target hard disk; Receive the number of moves corresponding to the move status read command returned by the target hard disk; the number of moves is the number of moves performed by the target hard disk within a current time period.
4. The method according to claim 1, It is characterized in that Determining the total number of migrations of the target hard disk according to the migration result includes: If the migration result is that migration has occurred, the historical migration times of the target hard disk are adjusted upward to obtain the total migration times of the target hard disk; If the migration result is that no migration has occurred, determining the historical migration times of the target hard disk as the total migration times; If the migration result is the migration times, the historical migration times of the target hard disk and the migration times are added to obtain the total migration times of the target hard disk.
5. The method according to claim 1, It is characterized in that The step of determining the target migration threshold of the target hard disk according to the total migration times and the attribute information of the target hard disk includes: Acquire the attribute information and threshold adjustment range of the target hard disk, and determine the expected total number of migrations of the target hard disk according to the attribute information; the attribute information includes each attribute field and the attribute change value corresponding to each attribute field; Determining an initial adjustment value according to the impact ratio corresponding to each attribute field, each attribute change value and the threshold adjustment range; Determine a difference in the number of moves between the expected total number of moves and the total number of moves, and determine a target adjustment value according to an adjustment ratio corresponding to the difference in the number of moves and the initial adjustment value; Data processing is performed on the target adjustment value and the current migration threshold of the target hard disk to obtain the target migration threshold of the target hard disk.
6. A hard disk management method, It is characterized in that The method is applied to a target hard disk, and the method comprises: receiving a migration status reading command sent by the storage array, and determining a migration result corresponding to the migration status reading command; The migration result is sent to the storage array.
7. The method according to claim 6, It is characterized in that The migration result is a migration type, and the receiving of a migration status reading command sent by the storage array and determining the migration result corresponding to the migration status reading command includes: Receiving a data read command sent by a storage array; the data read command includes a migration status read command; Executing the data read command to obtain target data corresponding to the data read command, and determining whether the number of bit errors exceeds a preset uncorrectable threshold; If the number of bit errors does not exceed the uncorrectable threshold, determining whether the number of bit errors exceeds a current migration threshold, and obtaining a determination result; The migration type corresponding to the migration status read command is determined according to the judgment result, and the migration type and the target data are sent to the storage array.
8. A hard disk management device, It is characterized in that The device comprises: A first sending module is used to send a migration status reading command to a target hard disk, and receive a migration result corresponding to the migration status reading command returned by the target hard disk; A determination module, configured to determine the total number of migrations of the target hard disk according to the migration result, and determine the target migration threshold of the target hard disk according to the total number of migrations and attribute information of the target hard disk; The second sending module is used to send the target migration threshold to the target hard disk; the target migration threshold is used to update the current migration threshold of the target hard disk.
9. A computer device comprising a memory and a processor, wherein the memory stores a computer program. It is characterized in that When the processor executes the computer program, the steps of the method of any one of claims 1 to 5 or claims 6 to 7 are implemented.
10. A computer-readable storage medium having a computer program stored thereon, It is characterized in that When the computer program is executed by a processor, the steps of the method of any one of claims 1 to 5 or claims 6 to 7 are implemented.