Hard disk storage unit management method, device, equipment, medium and product

By dynamically adjusting the storage blocks of storage units in a solid-state drive (SSD) and using a pre-trained model to filter and transform storage blocks, the problem of uneven storage unit lifespan is solved, thus improving the overall lifespan of the SSD.

CN121029101BActive Publication Date: 2026-02-13INSPUR SUZHOU INTELLIGENT TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202511553820.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-10-28
Publication Date
2026-02-13
Estimated Expiration
2045-10-28

AI Technical Summary

Technical Problem

The uneven lifespan of different types of storage units in solid-state drives (SSDs) leads to a low overall lifespan.

Method used

By determining the cycle count threshold of the target hard drive, the current cycle count of the first and second storage units is detected in real time. A pre-trained storage block prediction model is used to select predicted storage blocks that meet the physical health parameters and convert them into the resource pool of the first storage unit. The storage blocks are dynamically adjusted to achieve wear leveling.

Benefits of technology

This improves the overall lifespan of solid-state drives and avoids overall performance degradation caused by premature wear of individual storage units.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121029101B_ABST
    Figure CN121029101B_ABST
Patent Text Reader

Abstract

The application discloses a hard disk storage unit management method, device, equipment, medium and product, relates to the technical field of solid state disks, and dynamically converts storage blocks of a storage unit according to real-time use conditions of the storage unit of the solid state disk, so as to realize dynamic balance of wear conditions of the storage unit, avoid a large difference between wear degrees of multiple storage units, and thus improve the overall service life of the solid state disk.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of solid state disks, and particularly relates to a management method and device of a hard disk storage unit, equipment, medium and product. BACKGROUND

[0002] A solid state disk is a storage device based on an integrated circuit, and has higher storage performance, smaller size and higher anti-shock performance compared with a mechanical hard disk.

[0003] In the related art, a plurality of types of storage units are arranged in a solid state disk to protect data of the solid state disk in an abnormal power-off scenario. However, the service life of the storage units of different types is unbalanced, which causes a problem of low overall service life of the solid state disk. SUMMARY

[0004] The present application provides a management method and device of a hard disk storage unit, equipment, medium and product to at least solve the problem of low overall service life of a hard disk in the related art.

[0005] The present application provides a management method of a hard disk storage unit, comprising: determining a cycle number threshold of a target hard disk, the target hard disk comprising a first storage unit and a second storage unit, the first storage unit being used for caching data, and the second storage unit being used for storing data; determining a first current cycle number of the first storage unit and a second current cycle number of the second storage unit; performing verification processing on a wear leveling state of the target hard disk according to the cycle number threshold, the first current cycle number and the second current cycle number to obtain a verification result, the verification result being leveling or non-leveling; in response to the verification result being non-leveling, filtering out a predicted to-be-converted storage block meeting a physical health parameter from a current storage block of the second storage unit by using a pre-trained storage block prediction model; performing a block conversion operation on the predicted to-be-converted storage block to obtain a target storage block, and adding the target storage block to a resource pool of the first storage unit.

[0006] The application further provides a management device of a hard disk storage unit, comprising: a determination module configured to determine a cycle number threshold of a target hard disk, the target hard disk comprising a first storage unit and a second storage unit, the first storage unit being configured to cache data, and the second storage unit being configured to store data; an acquisition module configured to determine a first current cycle number of the first storage unit and a second current cycle number of the second storage unit; a verification module configured to perform verification processing on a wear leveling state of the target hard disk according to the cycle number threshold, the first current cycle number and the second current cycle number to obtain a verification result, the verification result being leveling or non-leveling; a prediction module configured to, in response to the verification result being non-leveling, filter out a predicted to-be-converted storage block meeting a physical health parameter from a current storage block of the second storage unit by using a pre-trained storage block prediction model; and a conversion module configured to perform a block conversion operation on the predicted to-be-converted storage block to obtain a target storage block and add the target storage block to a resource pool of the first storage unit.

[0007] The application further provides an electronic device, comprising: a memory configured to store a computer program; and a processor configured to execute the computer program to implement the steps of any of the management methods of the hard disk storage unit.

[0008] The application further provides a non-volatile computer readable storage medium, the non-volatile computer readable storage medium storing a computer program, wherein the computer program is executed by a processor to implement the steps of any of the management methods of the hard disk storage unit.

[0009] The application further provides a computer program product, comprising a computer program, the computer program being executed by a processor to implement the steps of any of the management methods of the hard disk storage unit.

[0010] According to the application, the storage blocks of the storage unit are dynamically converted according to the real-time usage of the storage unit of the solid state disk, so that the wear leveling of the storage unit is dynamically balanced, the wear degree of the plurality of storage units is prevented from being greatly different, and the overall service life of the solid state disk is improved. BRIEF DESCRIPTION OF DRAWINGS

[0011] In order to more clearly illustrate the embodiments of the application, the drawings needed in the embodiments will be briefly introduced. Obviously, the drawings in the following description are only some embodiments of the application, and other drawings can be obtained by those skilled in the art without creative labor.

[0012] Figure 1 An application scenario diagram of the management method of the hard disk storage unit provided by the embodiments of the application is shown.

[0013] Figure 2A flowchart of a management method of a hard disk storage unit according to an embodiment of the present application is provided.

[0014] Figure 3 A flowchart of another management method of a hard disk storage unit according to an embodiment of the present application is provided.

[0015] Figure 4 A diagram of balanced verification according to an embodiment of the present application is provided.

[0016] Figure 5 A diagram of a data write path according to an embodiment of the present application is provided.

[0017] Figure 6 A diagram of modifying a mapping table according to an embodiment of the present application is provided.

[0018] Figure 7 A structural diagram of a management device of a hard disk storage unit according to an embodiment of the present application is provided.

[0019] Figure 8 A structural diagram of another management device of a hard disk storage unit according to an embodiment of the present application is provided.

[0020] Figure 9 A structural diagram of an electronic device according to an embodiment of the present application is provided. DETAILED DESCRIPTION

[0021] The technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only some of the embodiments of the present application, but not all the embodiments of the present application. Based on the embodiments in the present application, any other embodiments obtained by those skilled in the art without creative work fall within the protection scope of the present application.

[0022] It should be noted that, in the description of the present application, the terms “comprise”, “contain” or any other variant thereof are intended to cover non-exclusive inclusion, so that the process, method, article or device comprising a series of elements not only includes those elements, but also includes other elements not explicitly listed or inherent to such process, method, article or device. The terms “first”, “second” and the like in the present application are used to distinguish similar objects, and are not used to describe a specific order or sequence.

[0023] For example, with the development of NAND flash memory technology, more data can be stored in a unit area to improve the storage density of data. The storage unit of a solid state disk includes a single-level storage unit and a multi-level storage unit.

[0024] Specifically, a single-level storage unit only stores one bit of data and can only represent two voltage states: charged or uncharged. When in use, only the voltage state needs to be adjusted to a target level, so the charging process is direct and fast. Therefore, the single-level storage unit has extremely fast write speed and higher durability. The most critical and frequently accessed data can be stored in the more reliable single-level storage unit, greatly improving the stability and reliability of the solid-state disk.

[0025] A multi-level storage unit can store multiple bits of data, which increases the overall capacity of the solid-state disk and allows more data to be stored. A multi-level storage unit needs to accurately represent multiple (n) voltage states. When in use, the voltage state needs to be accurately adjusted to one of the multiple target levels, so the charging process is slower. In addition, the multiple target levels are closely adjacent, and in order to maintain the accuracy of the adjusted voltage state, multiple verification-pulse operations are required during adjustment. This increases the number of tunneling times and the pressure on the oxide layer, so the lifespan of the multi-level storage unit is relatively lower than that of the single-level storage unit.

[0026] The basic storage array of NAND flash memory is composed of multiple floating gate metal-oxide-semiconductor field-effect transistor (MOSFET) transistors connected in series in a NAND topology. This series structure makes it have the characteristics of high density and low cost.

[0027] In order to enable those skilled in the art to better understand the present application, the present application will be further described in detail below in conjunction with the drawings and specific embodiments.

[0028] In conjunction with the specific hardware architecture on which the solid-state disk detection method is executed, the specific hardware architecture is described here. Referring to Figure 1 , Figure 1 The hardware architecture of the solid-state disk detection method is shown in the figure. The solid-state disk includes single-level storage units and multi-level storage units. In the data write flow, data is first cached to the single-level storage unit and then written to the multi-level storage unit.

[0029] For example, a quad-level cell (QLC) has four bits of data, so a solid-state disk based on QLC has a higher storage capacity.

[0030] However, QLC has 16 different voltage states. During programming, the host needs to accurately control the voltage, charge the floating gate layer, and verify multiple times whether the target voltage state is reached, which takes a long time. Therefore, the speed of directly reading and writing data using QLC is slow.​

[0031] In actual application, the storage blocks of SLC and QLC are fixed. Single-level cell (SLC) is set as a cache area in a solid state disk. For frequent write operation, data is first written on SLC at high speed, at which time the user can experience the effect of high-speed writing. Then the data is moved to QLC to improve the overall write speed of the data.

[0032] However, in a QLC solid state disk, a small number of storage blocks are pre-allocated to SLC. If the proportion of sequential writing is high in the actual use scenario, the actual wear degree of SLC will increase and the SLC will be exhausted in advance. In this scenario, the remaining life of QLC is relatively high, and therefore the overall life of the solid state disk is relatively low.

[0033] Figure 2 A flowchart of a management method of a hard disk storage unit provided by an embodiment of the present application is shown in FIG. 1, and an embodiment of the present application provides a management method of a hard disk storage unit, which is described in detail as follows. Figure 2

[0034] S201, a cycle threshold of a target hard disk is determined, the target hard disk includes a first storage unit and a second storage unit, the first storage unit is used for caching data, and the second storage unit is used for storing data.

[0035] The target hard disk can be a solid state disk.

[0036] For example, the first storage unit can be a single-level storage unit, which is used for caching data, and the number of storage blocks of the first storage unit is small. The second storage unit can be a multi-level storage unit, which is used for caching data, and the number of storage blocks of the second storage unit is large.

[0037] For example, when the target hard disk is initially configured, the usage frequencies of the first storage unit and the second storage unit are counted according to a conventional scenario, and the corresponding storage blocks are allocated to the first storage unit and the second storage unit respectively, so that the actual wear degrees of the first storage unit and the second storage unit are close during use of the solid state disk.

[0038] Optionally, taking SLC as the first storage unit and QLC as the second storage unit as an example, the number of storage blocks satisfies the following formula:

[0039]

[0040] wherein, N represents the number of storage blocks of SLC, T represents the life of SLC, i.e., the nominal cycle number of SLC, N represents the number of storage blocks of QLC,​ QLC represents the life of the QLC, 4 represents the conversion coefficient QLC capacity is 4 times that of SLC, and WA represents the write amplification value, that is, the ratio of the actual data written by the solid state disk to the data required to be written by the host.

[0041] Exemplary, because the physical capacity of a QLC storage is 4 times that of an SLC block. The host writes 1GB of data, which occupies 1GB of space in SLC and only 0.25GB of space in QLC. Therefore, with the same erase and write, the amount of data that can be handled by the QLC storage block is 4 times that of the SLC storage block. By multiplying 4, the total erase and write times of QLC are converted into the erase and write times under the equivalent SLC capacity, and the equivalent conversion is performed.

[0042] In the related art, when the target hard disk is initially configured, that is, the storage blocks of the first storage unit and the second storage unit are fixed. When the actual usage frequency of the first storage unit and the second storage unit is different from the conventional scene, the problem of low overall life of the solid state disk will occur.

[0043] The application can determine whether the wear degree of the first storage unit and the second storage unit is close in real time through the cycle threshold, so as to dynamically adjust the storage blocks of the first storage unit and the second storage unit, thereby improving the life of the solid state disk.

[0044] S202, determining a first current cycle number of the first storage unit and a second current cycle number of the second storage unit.

[0045] Exemplary, the first current cycle number is the current life of the first storage unit. The second current cycle number is the same.

[0046] In combination with a scene example, by real-time detection of the first current cycle number and the second current cycle number, the actual usage of the first storage unit and the second storage unit can be determined in real time, so as to accurately dynamically adjust the storage blocks to improve the overall life of the solid state disk.

[0047] S203, verifying the wear balancing state of the target hard disk according to the cycle threshold, the first current cycle number and the second current cycle number to obtain a verification result, and the verification result is balanced or unbalanced.

[0048] Exemplary, balanced means that the wear degree of the first storage unit and the wear degree of the second storage unit are equivalent and close. Unbalanced means that the wear degree of the first storage unit and the wear degree of the second storage unit are equivalent and not close.

[0049] With reference to the scenario example, if the verification result is balanced, it indicates that the first storage unit and the second storage unit reach the life time at close time according to the current wear rate, and the first storage unit and the second storage unit can be maximized at this time. If the verification result is unbalanced, it indicates that one of the storage units reaches the life time earlier than the other storage unit for a long time, and the other storage unit is not fully utilized, resulting in low overall life of the solid state disk.

[0050] S204, in response to the verification result being unbalanced, filtering out the predicted to-be-converted storage block meeting the physical health parameter from the current storage block of the second storage unit by the pre-trained storage block prediction model.

[0051] For example, if the verification result is unbalanced, it indicates that the wear rate of the current first storage unit is greater than that of the second storage unit, and the first storage unit will reach the life time earlier than the second storage unit.

[0052] For example, the storage block prediction model analyzes the predicted to-be-converted storage block meeting the physical health parameter from the second storage unit, and the predicted to-be-converted storage block can balance the wear degree of the first storage unit and the second storage unit after conversion.

[0053] Optionally, the storage block prediction model is trained by taking the information of the storage unit of the historical solid state disk as a sample.

[0054] S205, performing a block conversion operation on the predicted to-be-converted storage block to obtain a target storage block, and adding the target storage block to the resource pool of the first storage unit.

[0055] For example, the predicted to-be-converted storage block is a storage block in the second storage unit, and the target storage block is a storage block of the first storage unit after conversion.

[0056] For example, the programming mode of the storage block in the first storage unit and the second storage unit is different, and the conversion operation switches the programming mode of the storage block to convert the predicted to-be-converted storage block of the second storage unit into the target storage block of the first storage unit. By adding the target storage block to the resource pool of the first storage unit, the first storage unit can use the target storage block. And the predicted to-be-converted storage block is removed from the resource pool of the second storage unit, thereby adjusting the overall life of the solid state disk.

[0057] In the non-balanced state, the equivalent wear degree of the first storage unit is greater than that of the second storage unit. If the solid state disk continues to be used, the first storage unit will reach the life first, and the second storage unit will have a relatively long life. By adding the target storage block to the resource pool of the first storage unit, the life of the predicted to-be-converted storage block can be converted to the life of the first storage unit, so as to transfer the storage resource corresponding to the to-be-converted storage block from the second storage unit with relatively small demand for storage resource to the second storage unit with relatively large demand for storage resource, realize resource redistribution, and balance the wear degrees of the first storage unit and the second storage unit.

[0058] The method for managing the hard disk storage unit provided in the embodiments of the present application comprises the following steps: determining a cycle number threshold of a target hard disk, the target hard disk comprising a first storage unit and a second storage unit, the first storage unit being used for caching data, and the second storage unit being used for storing data; determining a first current cycle number of the first storage unit and a second current cycle number of the second storage unit; verifying a wear balancing state of the target hard disk according to the cycle number threshold, the first current cycle number, and the second current cycle number to obtain a verification result, the verification result being balanced or unbalanced; in response to the verification result being unbalanced, filtering out a predicted to-be-converted storage block meeting a physical health parameter from current storage blocks of the second storage unit by using a pre-trained storage block prediction model; performing a block conversion operation on the predicted to-be-converted storage block to obtain a target storage block, and adding the target storage block to a resource pool of the first storage unit. According to the real-time usage of the storage units of the solid state disk, the above scheme dynamically converts the storage blocks of the storage units, so as to realize dynamic balancing of the wear conditions of the storage units, avoid a large difference between the wear degrees of the multiple storage units, and thus improve the overall life of the solid state disk.

[0059] On the basis of any one of the above embodiments, the following will be described in combination with Figure 3 a detailed process of managing the hard disk storage unit.

[0060] Figure 3 A flowchart of another method for managing the hard disk storage unit provided in the embodiments of the present application is shown in FIG. 6. As shown in FIG. 6, the method comprises the following steps. Figure 3

[0061] S301, determining a cycle number threshold of a target hard disk, the target hard disk comprising a first storage unit and a second storage unit, the first storage unit being used for caching data, and the second storage unit being used for storing data.

[0062] It should be noted that the execution process of S301 is described in S201, which will not be repeated here.

[0063] S302, determining a first current cycle number of the first storage unit and a second current cycle number of the second storage unit.​

[0064] In an example, the first current cycle number is determined by calculating a statistical result of the plurality of first cycle numbers of the plurality of memory blocks of the first memory unit; and the second current cycle number is determined by calculating a statistical result of the plurality of second cycle numbers of the plurality of memory blocks of the second memory unit.

[0065] Optionally, the statistical result includes at least one of an arithmetic mean, a median, a minimum value, or the like.

[0066] In an example, the cycle number of the first memory unit is determined by integrating cycle numbers of the plurality of memory blocks of the first memory unit; and the cycle number of the second memory unit is determined by integrating cycle numbers of the plurality of memory blocks of the second memory unit.

[0067] In the example, the cycle number of the memory unit is determined by integrating cycle numbers of the plurality of memory blocks, which can comprehensively evaluate the usage of the memory unit, thereby improving the accuracy of the management of the memory unit.

[0068] S303, verifying a wear leveling state of the target hard disk according to the cycle number threshold, the first current cycle number, and the second current cycle number to obtain a verification result, the verification result being leveling or non-leveling.

[0069] In an example, the verification can be performed by the following method, including: determining a first remaining cycle number of the first memory unit according to the first current cycle number; determining a second remaining cycle number of the second memory unit according to the second current cycle number; determining a difference between the second remaining cycle number and the first remaining cycle number; if the difference is greater than or equal to the cycle number threshold, determining that the verification result is non-leveling; and if the difference is less than the cycle number threshold, determining that the verification result is leveling.

[0070] In an example, the difference between the nominal cycle number of the first memory unit and the first current cycle number is determined as the first remaining cycle number; and the difference between the nominal cycle number of the second memory unit and the second current cycle number is determined as the second remaining cycle number. The remaining cycle number represents how much wear the memory unit can withstand.

[0071] In an example, the difference clearly quantifies how much more life the second memory unit has than the first memory unit.

[0072] In an example, the difference and the cycle number threshold are compared to accurately quantify the difference in life of the first memory unit and the second memory unit.

[0073] In combination with the scene example, if the difference is greater than or equal to the cycle threshold, it indicates that the wear difference between the first storage unit and the second storage unit is too large, and it is determined that the first storage unit and the second storage unit are unbalanced. Otherwise, it is determined that the first storage unit and the second storage unit are balanced. If unbalanced, a subsequent block conversion operation is performed.

[0074] In the following, in combination with Figure 4 The balance verification is described.

[0075] Figure 4 The balance verification provided by the embodiments of the present application is schematically shown. As Figure 4 shown, the remaining cycle numbers of the first storage unit and the second storage unit are calculated respectively, and the difference of the remaining cycle numbers is calculated. According to the size relationship between the difference and the cycle threshold, the balance verification of the first storage unit and the second storage unit is performed.

[0076] In this feasible implementation manner, the life difference between the first storage unit and the second storage unit is accurately quantified, thereby improving the accuracy of the verification processing.

[0077] S304, determining the current storage block of the second storage unit.

[0078] For example, the current storage block should exclude occupied blocks or bad blocks.

[0079] Optionally, the number of the current storage block is at least one.

[0080] S305, determining the storage block cycle number of the current storage block and the storage block information of the current storage block.

[0081] For example, the storage block cycle number is the cycle number used by the storage block. The storage block information is used to evaluate the characteristics of the current storage block from multiple dimensions, so as to accurately select the predicted to-be-converted storage block from the current storage block.

[0082] In combination with the scene example, the storage block cycle number and the storage information cooperate to provide more input information for the storage block prediction model, so that the storage block prediction model accurately outputs the predicted to-be-converted storage block.

[0083] S306, determining the storage block number threshold of the first storage unit, the storage block number threshold being used to control the number of the predicted to-be-converted storage block.

[0084] For example, according to the reserved space size of the solid state disk, the extensible number threshold of the first storage unit used for caching is calculated. When performing the block conversion operation, it is ensured that the total number of blocks of the converted first storage unit does not exceed the number threshold.

[0085] Optionally, the purpose of performing the block conversion operation is to balance the lifespans of the first storage unit and the second storage unit. If too many storage blocks are converted, it will also cause the lifespan of the second storage unit to be lower than that of the first storage unit after the block conversion operation, or the number of remaining storage blocks of the second storage unit is insufficient to realize the data storage function. Therefore, it is necessary to control the number of storage blocks on which the block conversion operation is performed.

[0086] S307, input the storage block number threshold, the storage block cycle number and the storage block information into the storage block prediction model to obtain a predicted storage block to be converted.

[0087] Optionally, the storage block prediction model determines whether the storage block meets the physical health parameter according to the storage block number threshold, the storage block cycle number and the storage block information.

[0088] Optionally, the storage block number threshold, the storage block cycle number and the storage block information are respectively converted into a feature vector, and the feature vector is input into the storage block prediction model. The storage block prediction model calculates a priority score of each current storage block according to a pre-learned pattern, filters out the predicted storage block to be converted according to the priority score, and ensures that the storage block number threshold is not exceeded.

[0089] In a feasible implementation, the storage block information includes at least one of the following: a storage block load, a storage block performance or a storage block position.

[0090] For example, the storage block load represents the load degree of the current storage block, and a storage block with a lower load can be preferentially selected as the predicted storage block to be converted.

[0091] For example, if the storage block load is high, it means that the storage block has experienced frequent erasing and writing, and even if the cycle number seems not high, there may be potential instability in the storage block. Converting it to the first storage unit (a higher stress environment) may accelerate the failure of the storage block.

[0092] For example, a storage block with a higher performance can be preferentially selected as the predicted storage block to be converted to adapt to the working environment of the first storage unit.

[0093] For example, the storage block performance includes at least one of the following: an original bit error rate, an erasing and writing delay, or a data retention degree, etc. A storage block with a lower original bit error rate can be filtered out, which can improve the reliability of the first storage unit after being converted to the first storage unit mode. A storage block with a stable and short erasing and writing delay can be filtered out, which can improve the stability of the writing speed of the first storage unit. A storage block with a higher data retention degree can be filtered out, which can improve the reliability of caching important data.

[0094] Exemplarily, the position where the storage block is located can be the edge or the center of the wafer. The degree of disturbance of the storage block can be evaluated through the position of the storage block, so as to screen the storage block with less disturbance.

[0095] In combination with the scene example, if the storage block is surrounded by frequently written blocks, the risk of write disturbance of the storage block is high. If the storage block is next to the block storing important data and rarely updated, frequent programming operation on the storage block will have an impact on the adjacent block.

[0096] In this feasible implementation manner, through the plurality of storage block information, the multi-dimensional data reference can be provided for the storage block prediction model, so as to comprehensively evaluate from multiple dimensions, accurately screen the storage block meeting the physical health parameter, improve the prediction accuracy, and further improve the overall life of the solid state disk.

[0097] S308, determining the flash memory controller of the target hard disk and the storage block identifier of the predicted storage block to be converted.

[0098] Exemplarily, the flash memory controller is a tool for performing block conversion operation. The flash memory controller can perform bottom-layer communication with the NAND flash memory particle.

[0099] Exemplarily, the storage block identifier of the predicted storage block to be converted is a unique identifier of the predicted storage block to be converted, which is used for uniquely locating the predicted storage block to be converted.

[0100] S309, generating a conversion instruction according to the storage block identifier.

[0101] Exemplarily, the conversion instruction is used for instructing the flash memory controller to perform the conversion operation. Through the storage block identifier, the specific object corresponding to the conversion operation is instructed.

[0102] Optionally, an instruction template is preconfigured and stored, and the storage block identifier and the instruction template are combined, so as to improve the efficiency of generating the conversion instruction.

[0103] S310, sending the conversion instruction to the flash memory controller, so as to adjust the programming voltage threshold and the read-write timing of the predicted storage block to be converted by the flash memory controller, and obtain the target storage block.

[0104] Optionally, the conversion instruction is sent to the flash memory controller through the communication interface inside the solid state disk.

[0105] With the example of the scene, taking the first storage unit as SLC and the second storage unit as QLC as an example, the programming voltage range applied to the predicted storage block to be converted is changed from the fine and multi-step voltage adjustment (used to distinguish 16 states) required by QLC to the simple and two-step voltage adjustment required by SLC. The time control parameters used when reading and writing the predicted storage block to be converted are changed. The read and write operations in SLC mode are faster and simpler, so the required timing parameters (such as pulse width, delay time) are different from those in QLC mode.

[0106] For example, by adjusting the programming voltage threshold and read-write timing of the predicted storage block to be converted, the electrical characteristics of the predicted storage block to be converted are modified to be the same as the first storage unit, thereby obtaining the target storage block.

[0107] In a feasible implementation, the management method of the hard disk storage unit can further include: determining a target cycle number of the predicted storage block to be converted, a first nominal total cycle number of the first storage unit, and a second nominal total cycle number of the second storage unit; determining a conversion coefficient according to the first nominal total cycle number and the second nominal total cycle number; determining a relative cycle number as the product of the target cycle number and the conversion coefficient; updating the first current cycle number according to the relative cycle number to obtain a first updated cycle number; and updating the second current cycle number according to the target cycle number to obtain a second updated cycle number.

[0108] For example, after performing the block conversion operation, the cycle numbers, i.e. the lifespans, of the first storage unit and the second storage unit are updated accordingly. By calculating the updated cycle numbers, the real-time lifespan of the solid state disk is accurately represented.

[0109] Optionally, the nominal total cycle number represents the upper limit of the cycle number of the storage unit, and the conversion coefficient is determined as the ratio of the second nominal total cycle number to the first nominal total cycle number. For example, the upper limit of the cycle number of the QLC storage block is 1000 times, the upper limit of the cycle number of the TLC storage block is 30000 times, and the conversion coefficient is 1000 / 30000=1 / 30. The conversion coefficient represents that 1 TLC cycle corresponds to the QLC cycle value, i.e. in terms of wear contribution, 1 SLC cycle is equivalent to 30 TLC cycles. If the target cycle number is 300, the corresponding relative cycle number is 10. This indicates that the storage block that has been erased and written 300 times in QLC mode has a wear degree equivalent to that of an SLC block that has been erased and written 10 times.

[0110] For example, the statistical results of the cycle numbers and the relative cycle numbers of a plurality of storage blocks of the first storage unit are calculated to obtain a first updated cycle number of the first storage unit. The statistical results of the cycle numbers of a plurality of storage blocks of the second storage unit after the target cycle number is removed are calculated to obtain a second updated cycle number of the second storage unit.

[0111] In the feasible implementation, the number of equivalent update cycles of the transform coefficients is converted, so that the number of cycles of the first storage unit and the second storage unit is based on a unified scale, thereby accurately representing the overall life of the solid state disk.

[0112] In a feasible implementation, the method for managing the hard disk storage unit can further include: receiving a data write request, the data write request including data to be written; writing the data to be written to the first storage unit; determining a current data amount of the first storage unit and a data amount threshold; and if the current data amount is greater than or equal to the data amount threshold, writing data in the first storage unit that meets a preset condition to the second storage unit.

[0113] For example, the data write request is used to indicate writing data in the solid state disk, and the data write is performed according to a preset data write path.

[0114] In the following, the data write path is described in combination with Figure 5 The data write path is described.

[0115] Figure 5 The schematic diagram of the data write path provided by the embodiments of the present application is shown in FIG. 1. As shown in FIG. 1, the data write path includes a first storage unit 101, a second storage unit 102, and a third storage unit 103. Figure 5As shown, the data to be written is transferred from the host to the static random-access memory (SRAM) inside the solid state disk through the peripheral component interconnect express (PCIe) interface and the direct memory access (DMA) mechanism. Once the data is stored in the SRAM, the host controller immediately replies to the host to confirm, so as to reduce the response delay. The data is copied from the SRAM to the double data rate synchronous dynamic random-access memory (DDR). In the DDR, the parity of the data is calculated through the exclusive or (XOR) operation, so as to provide redundancy protection for the data. Path 1: when the data in the DDR reaches the size of a first storage cell word line, the NAND flash controller (NFC) allocates a first storage cell address and writes the data into the first storage cell cache area. If the data amount is enough for a second storage cell word line, the NFC directly allocates a second storage cell address and performs the first write (write bottom Bit). At this time, the SRAM space can be released. Then, after the other layers on the same storage cell complete the first write, the data is taken out from the DDR, the second write (write upper Bit) to the same word line is performed through the NFC, and the entire second storage cell programming operation is completed.

[0116] For example, the data amount threshold is used to trigger the writing of the data of the first storage cell into the second storage cell.

[0117] Optionally, the data amount threshold can be a high water line (for example, 80% or 85%, etc.) of the total capacity of the first storage cell. The data amount threshold is determined according to the historical write record of the first storage cell, so as to ensure that the data in the first storage cell is written into the second storage cell in time, and enough space is reserved in the first storage cell, so as to avoid that the amount of the newly written data in the first storage cell exceeds the reserved space.

[0118] Optionally, the preset condition includes, but is not limited to, at least one of the following: time sequence principle (first-in first-out), data hot and cold characteristics, or storage block alignment, etc. The time sequence principle controls the data block written into the first storage unit earliest to be migrated to the first storage unit preferentially. The data hot and cold characteristics are to monitor or predict the access frequency of the data. The hot data frequently accessed is kept in the high-speed first storage unit, while the cold data not accessed for a long time is marked as a preferential migration object, which can improve the cache hit rate. The storage block alignment is that the data in the cache of the first storage unit has reached a complete programming unit of the second storage unit (for example, the amount of data required to reach a complete word line). Through the storage block alignment, the write amplification can be reduced, the write efficiency can be improved, and the service life of the solid state disk can be prolonged.

[0119] In this feasible implementation manner, by setting the data amount threshold and actively scheduling before the cache is full, the performance directly drops to the speed of the second storage unit after the cache is used up, which avoids the situation, so that the performance curve of the solid state disk is smoother.

[0120] In a feasible implementation manner, the management method of the hard disk storage unit can further include: in response to detecting an abnormal power-off event, suspending the data write request; by modifying the address mapping table, mapping the logical address of the data in the first storage unit that has not been written into the second storage unit to the physical address of the first storage unit; recording the physical address information of the first storage unit in the log; and performing a power-off operation.

[0121] Illustratively, the data protection is performed by modifying the address mapping relationship of the data, i.e., the pointer.

[0122] In combination with a scene example, in response to detecting an abnormal power-off event, the data write request is suspended. After the power management circuit detects a voltage drop, the host is immediately notified. The host stops accepting new host write requests, and the current state of the system is "frozen" to prevent new and inconsistent data from being generated during the power-off processing.

[0123] Illustratively, by modifying the address mapping table, the logical address of the data in the first storage unit that has not been written into the second storage unit is mapped to the physical address of the first storage unit. This means that the temporary physical location of the data in the cache of the first storage unit is directly established as its permanent logical storage location.

[0124] Illustratively, the physical address information of the first storage unit is recorded in the log, and accurate data recovery can be performed according to the log when power is turned on.

[0125] In this feasible implementation manner, by modifying the address mapping relationship of the data for management, the speed of the power-off response can be improved.

[0126] In an example, the method for managing the storage units of the hard disk further includes: determining, from the address mapping table, a data stripe in the first storage unit, the data stripe having completed a first write to the second storage unit and not having completed a second write to the second storage unit; mapping, by modifying the address mapping table, a logical address of the data stripe to a physical address of the first storage unit; and recording stripe information of the data stripe in a log.

[0127] In an example, the second storage unit is QLC, and the QLC has a 2-Step Program feature. The QLC needs to distinguish 16 states. The voltage window is finely divided, and the difficulty and time consumption of one-time precise programming to a target voltage increase exponentially and are prone to errors. The first write of the 2-Step Program lifts the voltage of the storage unit to an intermediate range of a relatively coarse voltage step. The second write, on the basis of the first write, applies a finer voltage pulse to finely adjust the voltage of the storage unit to a final precise target voltage value.

[0128] In an example, the data stripe only completes the first write and is in an unstable voltage state. For the data of the data stripe, the data is rolled back to the state before the modification, that is, the logical address of the data is remapped to the physical address in the first storage unit cache where the data is originally correctly and completely written.

[0129] In an example, the stripe information (for example, stripe identification) of the data stripe affected by the rollback operation is recorded in the log, and accurate data recovery can be performed according to the log when power is turned on.

[0130] In this example, by identifying the data stripe that only completes the first write, the system is fundamentally prevented from reading the storage unit in the second storage unit in an unstable voltage state after power is turned on, so that reading errors are avoided and the accuracy of power failure recovery is improved.

[0131] In an example, the method for managing the storage units of the hard disk further includes: in response to detecting a power failure recovery event, writing data in the first storage unit that has modified physical addresses to the second storage unit; and performing an erase process on a storage block of the first storage unit.

[0132] In an example, when the solid state disk is powered on again, the host firmware performs an initialization process and triggers a data recovery process.

[0133] In an example, the data whose physical address is modified at the time of power failure is written to the second storage unit again. After the write is completed, the corresponding storage block in the first storage unit is in an idle state, and the storage block is erased to recover to a blank storage block.

[0134] In the feasible implementation, in the power failure recovery, the data is transferred from the temporary first storage unit to the permanent second storage unit to improve the safety of the data.

[0135] In a feasible implementation, the second storage unit can be written by a method including: performing identification processing on the log to determine whether the log includes data strip information in a partially completed state at the time of abnormal power failure; if yes, marking the data strip corresponding to the data strip information as invalid data; recording the invalid data in a strip invalid table; determining an invalid data amount according to the strip invalid table; performing a decrement operation on the valid data frame count using a queue decrement mechanism according to the invalid data amount to update data validity metadata; determining valid data from a storage block of the first storage unit, the valid data being data that is logically valid due to modification of a physical address but has not been written into the second storage unit; performing recovery processing on the valid data of the first storage unit and writing the valid data into the second storage unit.

[0136] For example, the power-on recovery process starts with analyzing the log recorded at the time of abnormal power failure, aiming to accurately identify the data strip in the "partially completed state" due to power failure (i.e., only the first write is completed but the second write is not completed). The identified data strip is marked as invalid data, and the invalid data is recorded in a special strip invalid table for isolation to avoid subsequent operations reading unstable invalid data and causing data errors or system crashes.

[0137] For example, the system accurately decrements the valid data frame count VDFC using a queue decrement maintenance mechanism according to the total amount of invalid data counted by the strip invalid table. This ensures that the metadata recording the validity of the data inside the solid state disk is consistent with the actual state of the physical medium, avoiding storage space leakage and garbage collection mechanism failure caused by inconsistent metadata.

[0138] For example, the user data that is protected due to modification of the address mapping table at the time of power failure, is logically valid but has not been written into the second storage unit, is located from the first storage unit, and these data are safely and completely written into the second storage unit through the garbage collection process to realize the final landing of the data. The first storage unit storage block that has completed data migration is erased to recycle it to the idle resource pool, thereby releasing the cache space and making the entire system fully recover to the normal working state.

[0139] Next, the power-on recovery process will be described in detail. Figure 6 The modification of the mapping table will be described.

[0140] Figure 6 The schematic diagram of the modification of the mapping table provided by the embodiments of the present application is shown in FIG. 4. As shown in FIG. 4, the mapping table is a table for recording the mapping relationship between the logical address and the physical address. Figure 6As shown, the first step of the modification mapping table operation is locked to determine that the modification process is an atomic operation, avoiding data competition or metadata confusion in a multi-threaded or multi-tasking environment. It is determined whether the data is valid. If the data is invalid, the data is recorded for recycling processing. If the data is valid, it is determined whether the twice writing is completed. If the twice writing is completed, the logical address of the data is mapped to the second storage unit. If the twice writing is not completed, the valid data is mapped to the physical address of the first storage unit, and the rollback is realized.

[0141] In this feasible implementation, by pre-identifying and isolating part of the data strip, system errors caused by reading unstable data after power-on are avoided, thereby improving the stability of power-off recovery.

[0142] Through the description of the above embodiments, those skilled in the art can clearly understand that the method according to the above embodiments can be realized by means of software and the necessary general hardware platform, of course, it can also be realized by hardware, but in many cases the former is a better implementation.

[0143] Figure 7 The structural schematic diagram of the hard disk storage unit management device provided by the embodiments of the present application is shown in FIG. 1. Figure 7 As shown, the embodiments of the present application also provide a hard disk storage unit management device 70, which can include a determination module 71, an acquisition module 72, a verification module 73, a prediction module 74, and a conversion module 75.

[0144] The determination module 71 is configured to determine a cycle number threshold of a target hard disk, the target hard disk including a first storage unit and a second storage unit, the first storage unit being configured to cache data, and the second storage unit being configured to store data.

[0145] The acquisition module 72 is configured to determine a first current cycle number of the first storage unit and a second current cycle number of the second storage unit.

[0146] The verification module 73 is configured to perform verification processing on a wear leveling state of the target hard disk according to the cycle number threshold, the first current cycle number, and the second current cycle number to obtain a verification result, the verification result being leveling or non-leveling.

[0147] The prediction module 74 is configured to, in response to the verification result being non-leveling, filter out a predicted to-be-converted storage block that meets a physical health parameter from a current storage block of the second storage unit by using a pre-trained storage block prediction model.

[0148] The conversion module 75 is configured to perform a block conversion operation on the predicted to-be-converted storage block to obtain a target storage block, and add the target storage block to a resource pool of the first storage unit.

[0149] Optionally, the determining module 71 can perform Figure 2 S201 in the embodiments.

[0150] Optionally, the obtaining module 72 can perform Figure 2 S202 in the embodiments.

[0151] Optionally, the verifying module 73 can perform Figure 2 S203 in the embodiments.

[0152] Optionally, the predicting module 74 can perform Figure 2 S204 in the embodiments.

[0153] Optionally, the converting module 75 can perform Figure 2 S205 in the embodiments.

[0154] It should be noted that the management apparatus of the hard disk storage unit shown in the embodiments of the present application can perform the technical solutions shown in the above method embodiments, and the implementation principles and beneficial effects are similar, which will not be repeated here.

[0155] In a possible implementation, the obtaining module 72 is specifically configured to:

[0156] determine a plurality of first cycle numbers corresponding to a plurality of storage blocks of the first storage unit;

[0157] calculate a statistical result of the plurality of first cycle numbers to obtain a first current cycle number;

[0158] determine a plurality of second cycle numbers corresponding to a plurality of storage blocks of the second storage unit;

[0159] calculate a statistical result of the plurality of second cycle numbers to obtain a second current cycle number.

[0160] In a possible implementation, the verifying module 73 is specifically configured to:

[0161] determine a first remaining cycle number of the first storage unit according to the first current cycle number;

[0162] determine a second remaining cycle number of the second storage unit according to the second current cycle number;

[0163] determine a difference between the second remaining cycle number and the first remaining cycle number;

[0164] if the difference is greater than or equal to the cycle number threshold, determine that the verification result is unbalanced;

[0165] if the difference is less than the cycle number threshold, determine that the verification result is balanced.

[0166] In a possible implementation, the predicting module 74 is specifically configured to:

[0167] determining a current storage block of the second storage unit;

[0168] determining a storage block cycle number of the current storage block and storage block information of the current storage block;

[0169] inputting the storage block cycle number and the storage block information into a storage block prediction model to obtain a predicted storage block to be converted.

[0170] In a possible implementation, the prediction module 74 is specifically configured to:

[0171] determining a storage block quantity threshold of the first storage unit, the storage block quantity threshold being used to control a quantity of the predicted storage block to be converted;

[0172] inputting the storage block quantity threshold, the storage block cycle number, and the storage block information into the storage block prediction model to obtain the predicted storage block to be converted.

[0173] In a possible implementation, the storage block information includes at least one of the following: a storage block load, a storage block performance, or a storage block position.

[0174] In a possible implementation, the conversion module 75 is specifically configured to:

[0175] determining a flash memory controller of the target hard disk and a storage block identifier of the predicted storage block to be converted;

[0176] generating a conversion instruction according to the storage block identifier;

[0177] sending the conversion instruction to the flash memory controller, so that the flash memory controller adjusts a programming voltage threshold and a read-write timing of the predicted storage block to be converted to obtain a target storage block.

[0178] Figure 8 Another structural schematic diagram of a hard disk storage unit management apparatus provided by an embodiment of the present application is provided. In the Figure 7 embodiment shown in the figure, the hard disk storage unit management apparatus 70 further includes an update module 76, a write-in module 77, a recovery module 78, a modification module 79, and an execution module 710. Figure 8 The update module 76 is configured to: determine a target cycle number of the predicted storage block to be converted, a first nominal total cycle number of the first storage unit, and a second nominal total cycle number of the second storage unit.

[0179] determine a conversion coefficient according to the first nominal total cycle number and the second nominal total cycle number;

[0180] determine a product of the target cycle number and the conversion coefficient as a relative cycle number;

[0181] determine a product of the target cycle number and the conversion coefficient as a relative cycle number;

[0182] According to the relative cycle number, the first current cycle number is updated to obtain a first updated cycle number.

[0183] According to the target cycle number, the second current cycle number is updated to obtain a second updated cycle number.

[0184] The writing module 77 is configured to receive a data writing request, the data writing request comprising to-be-written data.

[0185] The to-be-written data is written into the first storage unit.

[0186] The current data amount of the first storage unit and a data amount threshold are determined.

[0187] If the current data amount is greater than or equal to the data amount threshold, data in the first storage unit that satisfies a preset condition is written into the second storage unit.

[0188] The recovery module 78 is configured to, in response to detecting an abnormal power-off event, suspend processing of the data writing request.

[0189] The address mapping table is modified to map a logical address of data in the first storage unit that has not been written into the second storage unit to a physical address of the first storage unit.

[0190] The physical address information of the first storage unit is recorded in a log.

[0191] A power-off operation is performed.

[0192] The modification module 79 is configured to determine, from the first storage unit, a data strip through the address mapping table, the data strip having completed a first writing into the second storage unit and not having completed a second writing into the second storage unit.

[0193] The address mapping table is modified to map a logical address of the data strip to a physical address of the first storage unit.

[0194] Strip information of the data strip is recorded in a log.

[0195] The execution module 710 is configured to, in response to detecting a power-off recovery event, write data in the first storage unit that has a modified physical address into the second storage unit.

[0196] The storage blocks of the first storage unit are erased.

[0197] In a possible implementation, the execution module 710 is specifically configured to:

[0198] The log is identified to determine whether the log comprises strip information of a data strip in a partially completed state at the time of the abnormal power-off.

[0199] If yes, the data stripe corresponding to the data stripe information is marked as invalid data;

[0200] Invalid data is recorded in the stripe invalid table;

[0201] According to the stripe invalid table, the amount of invalid data is determined;

[0202] According to the amount of invalid data, the valid data frame count using the queue decrement mechanism is decremented to update the data validity metadata;

[0203] From the storage block of the first storage unit, valid data is determined, which is logically valid due to physical address modification but not written into the second storage unit;

[0204] The valid data of the first storage unit is recycled, and the valid data is written into the second storage unit.

[0205] The features of the embodiments corresponding to the management device of the hard disk storage unit can be referred to the related description of the embodiments corresponding to the management method of the hard disk storage unit, which will not be repeated here.

[0206] Figure 9 The structure schematic diagram of the electronic device provided in the present application is shown in the figure. Figure 9 As shown in the figure, the electronic device 90 provided in the present embodiment includes at least one processor 901 and a memory 902. Optionally, the electronic device 90 further includes a communication component 903. Wherein, the processor 901, the memory 902 and the communication component 903 are connected through a bus.

[0207] In the specific implementation process, the at least one processor 901 executes the computer execution instructions stored in the memory 902, so that the at least one processor 901 executes the above-mentioned management method embodiments of the hard disk storage unit.

[0208] The specific implementation process of the processor 901 can be referred to the above-mentioned method embodiments, which has similar implementation principles and technical effects, and will not be repeated here.

[0209] In the above embodiments, it should be understood that the processor can be a central processing unit (CPU), and can also be other general-purpose processors, digital signal processors (DSP), application specific integrated circuits (ASIC), etc. The general-purpose processor can be a microprocessor or any conventional processor, etc. The steps of the method disclosed in the application can be directly embodied as hardware processor execution, or executed by a combination of hardware and software modules in the processor.

[0210] The memory can include a random access memory (RAM), and can also include a non-volatile memory (NVM), such as at least one disk memory.

[0211] The bus can be an industry standard architecture (ISA) bus, a peripheral component (PCI) bus, an extended industry standard architecture (EISA) bus, etc. The bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, the bus in the drawings of the present application does not limit to only one bus or one type of bus.

[0212] The embodiments of the present application also provide a non-volatile computer readable storage medium, which stores a computer program, and the computer program is configured to execute the steps in the above-mentioned any one of the management method embodiments of the hard disk storage unit when running.

[0213] In an exemplary embodiment, the above-mentioned non-volatile computer readable storage medium can include, but is not limited to: a U disk, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk, and various media that can store computer programs.

[0214] The embodiments of the present application also provide a computer program product, which includes a computer program, and the computer program is executed by a processor to implement the steps in the above-mentioned any one of the management method embodiments of the hard disk storage unit.

[0215] The embodiment of the present application further provides another computer program product, comprising a nonvolatile computer readable storage medium, the nonvolatile computer readable storage medium stores a computer program, the computer program is executed by a processor to implement the steps in the management method embodiments of the hard disk storage unit.

[0216] Those skilled in the art will further appreciate that the units and algorithm steps of the examples described in connection with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or both, and that the interchangeability of hardware and software methods is contemplated. Accordingly, the examples described herein are presented for purposes of illustration and not limitation. The steps of the examples are not necessarily limited to the order described, and the steps of the examples can be implemented in any order.

[0217] The above describes in detail the management method, device, equipment, medium and product of the hard disk storage unit provided by the present application. The principles and implementation modes of the present application are described by applying specific examples. The above description of the examples is only applicable to help understand the method and core idea of the present application. It should be pointed out that, for those skilled in the art, without departing from the principles of the present application, some improvements and modifications can be made to the present application, and these improvements and modifications also fall within the protection scope of the claims of the present application.

Claims

1. A method for managing hard disk storage units, characterized in that, include: Determine the cycle count threshold for the target hard disk, which includes a first storage unit and a second storage unit, wherein the first storage unit is used to cache data and the second storage unit is used to store data; Determine the first current cycle number of the first storage unit and the second current cycle number of the second storage unit; The wear leveling status of the target hard disk is verified based on the cycle number threshold, the first current cycle number, and the second current cycle number to obtain a verification result, which is either leveled or unleveled. In response to the verification result being unbalanced, a pre-trained storage block prediction model is used to select predicted storage blocks to be converted from the current storage blocks of the second storage unit that meet the physical health parameters. Perform a block conversion operation on the predicted storage block to be converted to obtain the target storage block, and add the target storage block to the resource pool of the first storage unit; Determine the target cycle number of the predicted storage block to be converted, the first nominal total cycle number of the first storage unit, and the second nominal total cycle number of the second storage unit; The conversion coefficient is determined based on the first nominal total number of cycles and the second nominal total number of cycles; The product of the target loop number and the conversion coefficient is determined as the relative loop number; The first current cycle number is updated based on the relative cycle number to obtain the first updated cycle number; Based on the target loop number, the second current loop number is updated to obtain the second updated loop number.

2. The method for managing a hard disk storage unit according to claim 1, characterized in that, Determining the first current cycle number of the first storage unit and the second current cycle number of the second storage unit includes: Determine multiple first cycle numbers corresponding to multiple storage blocks of the first storage unit; Calculate the statistical results of the plurality of first loop numbers to obtain the first current loop number; Determine multiple second cycle numbers corresponding to multiple storage blocks of the second storage unit; Calculate the statistical results of the multiple second cycle numbers to obtain the second current cycle number.

3. The method for managing a hard disk storage unit according to claim 1, characterized in that, Based on the cycle count threshold, the first current cycle count, and the second current cycle count, the wear leveling status of the target hard drive is verified to obtain a verification result, including: Based on the first current cycle number, determine the first remaining cycle number of the first storage unit; Based on the second current cycle number, determine the second remaining cycle number of the second storage unit; Determine the difference between the second remaining cycle number and the first remaining cycle number; If the difference is greater than or equal to the number of cycles threshold, then the verification result is determined to be unbalanced. If the difference is less than the number of cycles threshold, then the verification result is determined to be balanced.

4. The method for managing a hard disk storage unit according to claim 1, characterized in that, Using a pre-trained storage block prediction model, predictable storage blocks to be converted that meet the physical health parameters are selected from the current storage blocks of the second storage unit, including: Determine the current storage block of the second storage unit; Determine the storage block cycle number and the storage block information of the current storage block; The storage block cycle number and the storage block information are input into the storage block prediction model to obtain the predicted storage block to be converted.

5. The method for managing a hard disk storage unit according to claim 4, characterized in that, The storage block cycle count and the storage block information are input into the storage block prediction model to obtain the predicted storage block to be converted, including: Determine a threshold for the number of storage blocks in the first storage unit, wherein the threshold for the number of storage blocks is used to control the number of predicted storage blocks to be converted; The storage block quantity threshold, the storage block cycle count, and the storage block information are input into the storage block prediction model to obtain the predicted storage blocks to be converted.

6. The method for managing a hard disk storage unit according to claim 1, characterized in that, Performing a block conversion operation on the predicted storage block to be converted to obtain the target storage block includes: Determine the flash memory controller of the target hard disk and the memory block identifier of the predicted storage block to be converted; Generate conversion instructions based on the storage block identifier; The conversion command is sent to the flash memory controller to cause the flash memory controller to adjust the programming voltage threshold and read / write timing of the predicted memory block to be converted, thereby obtaining the target memory block.

7. The method for managing a hard disk storage unit according to claim 1, characterized in that, The method further includes: Receive a data write request, the data write request including data to be written; Write the data to be written into the first storage unit; Determine the current data volume and data volume threshold of the first storage unit; If the current data volume is greater than or equal to the data volume threshold, then the data in the first storage unit that meets the preset conditions is written into the second storage unit.

8. The method for managing a hard disk storage unit according to any one of claims 1-7, characterized in that, The method further includes: In response to the detection of an abnormal power failure event, the data write request is suspended. By modifying the address mapping table, the logical address of data in the first storage unit that has not been written to the second storage unit is mapped to the physical address of the first storage unit; Record the physical address information of the first storage unit in the log; Perform the power-off operation.

9. The method for managing a hard disk storage unit according to claim 8, characterized in that, The method further includes: The data stripe is determined from the first storage unit through the address mapping table. The data stripe has completed its first write to the second storage unit but has not completed its second write to the second storage unit. By modifying the address mapping table, the logical address of the data stripe is mapped to the physical address of the first storage unit; The stripe information of the data stripes is recorded in the log.

10. The method for managing a hard disk storage unit according to claim 8, characterized in that, The method further includes: In response to the detection of a power failure recovery event, the data with the modified physical address in the first storage unit is written to the second storage unit; The storage block of the first storage unit is erased.

11. The method for managing a hard disk storage unit according to claim 10, characterized in that, Writing the data with modified physical addresses from the first storage unit to the second storage unit includes: The log is processed for identification to determine whether it contains data stripe information that was in a partially completed state during an abnormal power outage. If so, the data stripe corresponding to the data stripe information is marked as invalid data; Record the invalid data in the strip failure table; The amount of invalid data is determined based on the strip failure table. Based on the amount of invalid data, the count of valid data frames using the queue accumulation mechanism is decremented to update the data validity metadata. Valid data is determined from the storage block of the first storage unit. The valid data is data that is logically valid due to the physical address modification but has not been written to the second storage unit. The valid data in the first storage unit is recycled, and the valid data is written to the second storage unit.

12. An electronic device, characterized in that, include: Memory, used to store computer programs; A processor, configured to implement the steps of the management method for a hard disk storage unit as described in any one of claims 1 to 11 when executing the computer program.

Citation Information

Patent Citations

  • Hard disk management method and device, hard disk equipment and storage medium

    CN113703681A

  • Hard disk management method, electronic equipment, storage medium and program product

    CN120540610A