A solid-state drive management method, apparatus, device, and machine-readable storage medium
By configuring time and capacity thresholds in SSD management, switching to a random wear strategy, and reconstructing the data, the problem of mass SSD failures is solved, SSD lifespan is extended, and the stability of the storage system is ensured.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-06-27
- Publication Date
- 2026-03-10
AI Technical Summary
In storage systems, wear leveling strategies for solid-state drives (SSDs) can lead to mass failures in a short period of time, resulting in data loss and business downtime.
By configuring time and capacity thresholds, a random wear strategy is adopted, and a random mapping method is used to configure the mapping between logical block addresses (LBA) and physical block addresses (PBA), eliminating or replacing failed SSDs and reconstructing the data.
This extends the lifespan of SSDs, avoids mass failures in a short period of time, and ensures the stability and reliability of the storage system.
Smart Images

Figure CN115145483B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present disclosure relates to the field of communication technology, and in particular, to a solid state disk management method, device, equipment and machine readable storage medium. BACKGROUND
[0002] SSD, Solid State Drives, is a hard disk made of solid-state electronic storage chips, which has higher performance and reliability than mechanical hard disks. SSD wear leveling is a method of programming and erasing all flash memory particles in the SSD, which can prevent continuous programming and erasing of the same memory block (Block), so as to balance the service life of the entire NAND flash memory.
[0003] FTL (Flash Translation Layer), one of the functions implemented on the SSD controller, mainly completes the conversion of the logical address (LBA) of the host to the physical address (PBA) of the flash.
[0004] From the perspective of the SSD disk, implementing wear leveling of each Block in the disk is a reasonable strategy. However, from the perspective of the storage system, this will cause some problems. Commercial storage systems, whether centralized storage arrays or distributed storage systems, implement read-write data load balancing from the system perspective, and the wear degree of each SSD disk in the storage system is similar. Since the service life of the SSD disk is controlled by the number of erasing and writing times, it means that the SSD disks in the system will be damaged in batches in a short time, and the batch damage of the SSD disks in a short time may cause the data to be unable to complete reconstruction in time, thereby causing data loss and business downtime of the storage system. SUMMARY
[0005] Therefore, the present disclosure provides a solid state disk management method, device, electronic equipment and machine readable storage medium to improve the problem of batch damage of the SSD in a short time.
[0006] The specific technical solutions are as follows:
[0007] The present disclosure provides a solid state disk management method, applied to a storage device including a plurality of solid state disks, the method comprising: performing a wear leveling strategy of the solid state disks according to a default configuration, starting a timer to record running time of each solid state disk; performing a random wear strategy on the solid state disk whose running time exceeds a configurable time threshold according to the record of the timer; judging whether the available capacity of the solid state disk performing the random wear strategy is lower than a configurable capacity threshold, considering the solid state disk whose available capacity is lower than the capacity threshold as failed; the random wear strategy comprises adopting a random mapping manner to configure the mapping between LBA and PBA in the FTL algorithm; the wear leveling strategy comprises adopting a manner to configure the mapping between LBA and PBA in the FTL algorithm so that each Block has approximately the same number of erase and write times.
[0008] As a technical solution, the judgment whether the available capacity of the solid state disk performing the random wear strategy is lower than the configurable capacity threshold, considering the solid state disk whose available capacity is lower than the capacity threshold as failed, comprises: excluding the solid state disk considered as failed and reconstructing the data stored in the storage device.
[0009] As a technical solution, the judgment whether the available capacity of the solid state disk performing the random wear strategy is lower than the configurable capacity threshold, considering the solid state disk whose available capacity is lower than the capacity threshold as failed, comprises: prompting to replace the solid state disk considered as failed.
[0010] As a technical solution, the performing of the wear leveling strategy of the solid state disks according to the default configuration and the starting of the timer to record the running time of each solid state disk comprise: starting a write counter to record the data write amount of each solid state disk; the performing of the random wear strategy on the solid state disk whose running time exceeds the configurable time threshold according to the record of the timer comprises: the performing of the random wear strategy on the solid state disk whose running time exceeds the configurable time threshold and whose data write amount exceeds a configurable write threshold according to the records of the timer and the write counter.
[0011] The present disclosure also provides a solid state disk management device, applied to a storage device including a plurality of solid state disks, the device comprising: an equal wear module configured to execute an equal wear strategy of the solid state disks according to a default configuration, and start a timer to record running time of each solid state disk; a random wear module configured to execute a random wear strategy on a solid state disk whose running time exceeds a configurable time threshold according to the record of the timer; and a failure judgment module configured to judge whether the available capacity of the solid state disk executing the random wear strategy is lower than a configurable capacity threshold, and consider the solid state disk whose available capacity is lower than the capacity threshold as failed; the random wear strategy comprises adopting a random mapping manner to configure mapping between LBA and PBA in an FTL algorithm; and the equal wear strategy comprises adopting a manner of making each Block have approximately the same number of erase and write times to configure mapping between LBA and PBA in the FTL algorithm.
[0012] As a technical solution, the judging whether the available capacity of the solid state disk executing the random wear strategy is lower than the configurable capacity threshold, and considering the solid state disk whose available capacity is lower than the capacity threshold as failed, comprises: excluding the solid state disk considered as failed, and reconstructing data stored in the storage device.
[0013] As a technical solution, the judging whether the available capacity of the solid state disk executing the random wear strategy is lower than the configurable capacity threshold, and considering the solid state disk whose available capacity is lower than the capacity threshold as failed, comprises: prompting to replace the solid state disk considered as failed.
[0014] As a technical solution, the executing the equal wear strategy of the solid state disks according to the default configuration, and starting the timer to record the running time of each solid state disk, comprises: starting a write counter to record data write amount of each solid state disk; and the executing the random wear strategy on the solid state disk whose running time exceeds the configurable time threshold according to the record of the timer, comprises: the executing the random wear strategy on the solid state disk whose running time exceeds the configurable time threshold and whose data write amount exceeds a configurable write threshold according to the record of the timer and the write counter.
[0015] The present disclosure also provides an electronic device comprising a processor and a machine readable storage medium, the machine readable storage medium storing machine executable instructions capable of being executed by the processor, and the processor executes the machine executable instructions to implement the solid state disk management method.
[0016] The present disclosure also provides a machine readable storage medium storing machine executable instructions, the machine executable instructions causing the processor to implement the solid state disk management method when the machine executable instructions are invoked and executed by the processor.
[0017] The above technical solutions provided by the present disclosure bring at least the following beneficial effects:
[0018] By configuring the thresholds, the solid state disks that have been executing the equal wear strategy for a certain duration are switched to execute the random wear strategy, so that the life extension brought by the equal wear strategy is obtained, and meanwhile, the solid state disks that are switched to execute the random wear strategy are prevented from being batched out in a short time. BRIEF DESCRIPTION OF DRAWINGS
[0019] In order to more clearly illustrate the technical solutions in the embodiments of the present disclosure or the prior art, the drawings needed to be used in the description of the embodiments of the present disclosure or the prior art will be briefly introduced. Obviously, the drawings in the following description are only some embodiments described in the present disclosure, and other drawings can also be obtained by those skilled in the art according to these drawings of the embodiments of the present disclosure.
[0020] Figure 1 is a flow chart of a solid state disk management method in an embodiment of the present disclosure;
[0021] Figure 2 is a structural diagram of a solid state disk management device in an embodiment of the present disclosure;
[0022] Figure 3 is a hardware structural diagram of an electronic device in an embodiment of the present disclosure. DETAILED DESCRIPTION
[0023] The terms used in the embodiments of the present disclosure are only for the purpose of describing specific embodiments, and are not intended to limit the present disclosure. The singular forms "a", "an" and "the" used in the present disclosure and claims are intended to include plural forms, unless the context clearly indicates otherwise. It should also be understood that the term "and / or" used herein refers to any or all possible combinations of one or more associated listed items.
[0024] It should be understood that although the terms first, second, third, etc. may be used in the embodiments of the present disclosure to describe various information, these information should not be limited to these terms. These terms are only used to distinguish information of the same type from each other. For example, the first information can also be referred to as the second information, and similarly, the second information can also be referred to as the first information, without departing from the scope of the present disclosure. In addition, depending on the context, the word "if" used can be interpreted as "when" or "in response to determining" or "in response to ascertaining".
[0025] One SSD disk generally contains multiple flash memory chips, one flash memory chip (Flash Memory Package) generally contains one or more flash memory dies (Die), each Die contains multiple Planes, each Plane contains multiple Blocks, and each Block contains multiple Pages. The minimum unit of data read or written by the SSD is a Page, and the typical Page size is 4KB. The SSD cannot perform overwrite, for example, if a Page has been written with data 11001111, and it is desired to overwrite the original data with new data 11110011 on this Page, it cannot be done on the SSD. In order to enable repeated writing, the SSD needs to perform an erase operation on the already written die first, but the minimum unit of erase is not a Page, but a Block containing several Pages. A Block generally contains 128, 256 or 512 Pages.
[0026] The erase operation of the Block is time-consuming, so rewriting new data to the original Block when modifying data will result in very low write performance, so in practice, for example, assuming that Page 23 in Block 10 has been written with data, and now the data of Page 23 needs to be modified, first read the data of all Pages contained in this Block to the cache of the SSD controller, complete the modification of the data of this Page in the cache, and then write the data to a new Block.
[0027] Therefore, the SSD introduces the FTL mechanism. From the perspective of the operating system, the SSD disk is a block device, and the operating system will read and write data with the LBA address as the data position of the SSD disk. The SSD controller will dynamically map this LBA logical address to the physical address of the SSD, i.e., the PBA address. In this way, even if the upper application repeatedly modifies the data of the same LBA address, the FTL can alleviate the wear and tear problem of the PBA as long as it maps it to a different PBA address each time. In order to better achieve wear leveling in the SSD disk, a more complex wear leveling algorithm is needed to ensure that each Block in the SSD disk maintains an approximate number of wear times, so that each Block reaches the upper limit of the number of wear times at almost the same time during the life cycle of the SSD disk. However, if the same wear leveling strategy is used in the storage system, the SSD disks may be damaged in batches in a short period of time, which may cause the data to be unable to be reconstructed in time, resulting in data loss and business downtime of the storage system.
[0028] Therefore, the present disclosure provides a solid state disk management method, device, electronic equipment and machine readable storage medium to improve the problem of SSD batch damage in a short period of time.
[0029] Specifically, the technical solutions are as follows.
[0030] The present disclosure provides a solid state disk management method, applied to a storage device including a plurality of solid state disks, the method comprising: performing a balanced wear strategy of the solid state disks according to a default configuration, starting a timer to record running time of each solid state disk; performing a random wear strategy on the solid state disk whose running time exceeds a configurable time threshold according to the record of the timer; judging whether the available capacity of the solid state disk performing the random wear strategy is lower than a configurable capacity threshold, considering the solid state disk whose available capacity is lower than the capacity threshold as failed; the random wear strategy comprises adopting a random mapping manner to configure the mapping between LBA and PBA in the FTL algorithm; the balanced wear strategy comprises adopting a manner to make each Block have approximately the same number of erase-write times to configure the mapping between LBA and PBA in the FTL algorithm.
[0031] Specifically, as Figure 1 , comprising the following steps:
[0032] Step S11, performing a balanced wear strategy of the solid state disks according to a default configuration, starting a timer to record running time of each solid state disk;
[0033] Step S12, performing a random wear strategy on the solid state disk whose running time exceeds a configurable time threshold according to the record of the timer;
[0034] Step S13, judging whether the available capacity of the solid state disk performing the random wear strategy is lower than a configurable capacity threshold, considering the solid state disk whose available capacity is lower than the capacity threshold as failed.
[0035] By configuring each threshold, the solid state disk performing the balanced wear strategy for a certain period of time is converted to perform the random wear strategy, so that the life extension brought by the balanced wear strategy is obtained, and at the same time, each solid state disk converted to perform the random wear strategy avoids batch failure in a short time.
[0036] In an embodiment, the judging whether the available capacity of the solid state disk performing the random wear strategy is lower than a configurable capacity threshold, considering the solid state disk whose available capacity is lower than the capacity threshold as failed, comprises: excluding the solid state disk considered as failed and performing data reconstruction on the data stored in the storage device.
[0037] In an embodiment, the judging whether the available capacity of the solid state disk performing the random wear strategy is lower than a configurable capacity threshold, considering the solid state disk whose available capacity is lower than the capacity threshold as failed, comprises: prompting to replace the solid state disk considered as failed.
[0038] In an embodiment, the method of performing the equal wear strategy of the SSD according to the default configuration, starting a timer to record the running time of each SSD, includes: starting a write counter to record the data write amount of each SSD; and performing the random wear strategy on the SSD whose running time exceeds a configurable time threshold according to the record of the timer, includes: performing the random wear strategy on the SSD whose running time exceeds the configurable time threshold and whose data write amount exceeds a configurable write threshold according to the records of the timer and the write counter.
[0039] In an embodiment, the SSD wear strategy is configured first, and examples include: the equal wear strategy, which ensures that the erasing and writing times of each Block in the SSD are approximately the same by counting the erasing and writing times of each Block in the SSD; and the random wear strategy, which uses a random mapping method to realize the mapping between LBA and PBA in the FTL algorithm. A time threshold T and a SSD capacity threshold C are configured, the SSD uses the equal wear strategy within the specified time T, and each Block in the SSD keeps approximately the same erasing and writing times, and the random wear strategy is used after the time T is exceeded, and then when the available capacity of the SSD is less than C, the SSD is considered to be invalid. The available capacity here refers to the capacity of the SSD that can store and erase data at the hardware level, which is different from the remaining available capacity in the software system after the capacity occupied by the stored data is deducted.
[0040] The time threshold T can be any numerical value and any time unit such as month, week, day, etc., and T is 0 in a special case, i.e., the SSD does not use the equal wear strategy. The capacity threshold C can be an absolute capacity value or a capacity percentage.
[0041] In the equal wear strategy, in order to ensure that the wear times of each Block are approximately the same, the data of some Blocks with less wear times are actively moved, and the present scheme avoids such data movement to some extent, thereby increasing the erasing and writing times of the storage device as a whole.
[0042] In an embodiment, the present disclosure also provides a solid state disk management device, which includes Figure 2The application is applied to a storage device including a plurality of solid state disks, and the device includes: an equal wear module 21 configured to execute an equal wear strategy of the solid state disks according to a default configuration, and start a timer to record running time of each solid state disk; a random wear module 22 configured to execute a random wear strategy on the solid state disk whose running time exceeds a configurable time threshold according to the record of the timer; and a failure judgment module 23 configured to judge whether the available capacity of the solid state disk executing the random wear strategy is lower than a configurable capacity threshold, and consider the solid state disk whose available capacity is lower than the capacity threshold as failed. The random wear strategy includes adopting a random mapping manner to configure mapping between LBA and PBA in an FTL algorithm. The equal wear strategy includes adopting a manner to configure mapping between LBA and PBA in the FTL algorithm so that each block has approximately the same number of erasing and writing times.
[0043] In an embodiment, the judging whether the available capacity of the solid state disk executing the random wear strategy is lower than the configurable capacity threshold, and considering the solid state disk whose available capacity is lower than the capacity threshold as failed, includes: performing data reconstruction on data stored in the storage device after excluding the solid state disk considered as failed.
[0044] In an embodiment, the judging whether the available capacity of the solid state disk executing the random wear strategy is lower than the configurable capacity threshold, and considering the solid state disk whose available capacity is lower than the capacity threshold as failed, includes: prompting to replace the solid state disk considered as failed.
[0045] In an embodiment, the executing the equal wear strategy of the solid state disks according to the default configuration, and starting the timer to record the running time of each solid state disk, includes: starting a write counter to record data write amount of each solid state disk. The executing the random wear strategy on the solid state disk whose running time exceeds the configurable time threshold according to the record of the timer, includes: executing the random wear strategy on the solid state disk whose running time exceeds the configurable time threshold and whose data write amount exceeds a configurable write threshold according to the record of the timer and the write counter.
[0046] The device embodiments are the same as or similar to the corresponding method embodiments, and are not described here again.
[0047] In an embodiment, the present disclosure provides an electronic device including a processor and a machine readable storage medium storing machine executable instructions capable of being executed by the processor. The processor executes the machine executable instructions to implement the aforementioned solid state disk management method. From the hardware layer, the hardware architecture schematic diagram can be seen from Figure 3 .
[0048] In an embodiment, the disclosure provides a machine readable storage medium having stored machine executable instructions, which when invoked and executed by a processor, cause the processor to implement the aforementioned solid state disk management method.
[0049] Here, the machine readable storage medium can be any electronic, magnetic, optical, or other physical storage device that contains or stores information, such as executable instructions, data, etc. For example, the machine readable storage medium can be a RAM (Random Access Memory), a volatile memory, a non-volatile memory, a flash memory, a storage drive (e.g., a hard drive), a solid state drive, any type of storage disc (e.g., an optical disc, a dvd, etc.), or similar storage medium, or a combination thereof.
[0050] The systems, apparatuses, modules or units illustrated by the above embodiments can be specifically implemented by computer chips or entities, or by products with certain functions. A typical implementation device is a computer, and the specific form of the computer can be a personal computer, a laptop computer, a cellular phone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an e-mail device, a game console, a tablet computer, a wearable device, or a combination of any of these devices.
[0051] For the ease of description, the above apparatuses are described in various units by functions respectively. Of course, the functions of each unit can be implemented in one or more software and / or hardware in implementing the disclosure.
[0052] Those skilled in the art should understand that the embodiments of the disclosure can be provided as a method, a system, or a computer program product. Therefore, the disclosure can take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects. Moreover, the embodiments of the disclosure can take the form of a computer program product implemented on one or more computer-usable storage media (including, but not limited to, a disk memory, a CD-ROM, an optical memory, etc.) containing computer-usable program code.
[0053] The embodiments of methods, apparatuses (systems) and computer program products of the present disclosure are described with reference to the accompanying drawings, which are by way of illustration. It should be understood that each flow and / or block of the flowcharts and / or block diagrams, and combinations of flows and / or blocks in the flowcharts and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of an apparatus, such as a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus, to produce a machine, so that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowcharts and / or block diagrams block or blocks. Figure 1 one or more flows and / or blocks Figure 1 an apparatus with a means for performing the function specified in the flowchart block or blocks.
[0054] Also, these computer program instructions can also be stored in a computer readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer readable memory produce an article of manufacture including instructions which implement the flowchart flow or flows and / or block or blocks. Figure 1 one or more flows and / or blocks Figure 1 an apparatus with a means for performing the function specified in the flowchart block or blocks.
[0055] The computer program instructions can also be loaded into a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the flowchart flow or flows and / or block or blocks. Figure 1 one or more flows and / or blocks Figure 1 an apparatus with a means for performing the function specified in the flowchart block or blocks.
[0056] Those skilled in the art will appreciate that embodiments of the present disclosure can be devised for a method, a system, or a computer program product. Accordingly, the present disclosure can be embodied in the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present disclosure can take the form of a computer program product on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROMs, optical storage devices, etc.) embodying computer readable program code.
[0057] The embodiments of the present disclosure described above are merely given as non-limiting examples for implementing the present disclosure. It is understood that modifications and variations can be made by those skilled in the art in light of the foregoing description. It is therefore to be understood that within the scope of the disclosure and the principles of the present disclosure, there is a latitude of modification, altera tion or rearrangement for the disclosed embodiments. Any equivalents for carrying out the functions described herein are within the scope of the present disclosure.
Claims
1. A solid state disk management method, characterized by, The method is applied to a storage device including a plurality of solid state disks, and comprises the following steps: According to a default configuration, a wear leveling strategy of the solid state disks is executed, and a timer is started to record running time of each solid state disk; According to the record of the timer, a random wear strategy is executed on the solid state disk whose running time exceeds a configurable time threshold; It is judged whether the available capacity of the solid state disk executing the random wear strategy is lower than a configurable capacity threshold, and the solid state disk whose available capacity is lower than the capacity threshold is considered to be failed; The random wear strategy comprises configuring the mapping between LBA and PBA in the FTL algorithm in a random mapping manner; The wear leveling strategy comprises configuring the mapping between LBA and PBA in the FTL algorithm in a manner that each Block has approximately the same number of erase-write times.
2. The method of claim 1, wherein, The judging whether the available capacity of the solid state disk executing the random wear strategy is lower than the configurable capacity threshold, and the solid state disk whose available capacity is lower than the capacity threshold is considered to be failed, comprises: After the solid state disk considered to be failed is eliminated, data reconstruction is performed on the data stored in the storage device.
3. The method of claim 1, wherein, The judging whether the available capacity of the solid state disk executing the random wear strategy is lower than the configurable capacity threshold, and the solid state disk whose available capacity is lower than the capacity threshold is considered to be failed, comprises: It is prompted to replace the solid state disk considered to be failed.
4. The method of claim 1, wherein The starting the timer to record the running time of each solid state disk according to the default configuration and executing the wear leveling strategy of the solid state disks comprises: Starting a write counter to record the data write amount of each solid state disk; The executing the random wear strategy on the solid state disk whose running time exceeds the configurable time threshold according to the record of the timer comprises: The executing the random wear strategy on the solid state disk whose running time exceeds the configurable time threshold and whose data write amount exceeds a configurable write threshold according to the record of the timer and the write counter.
5. A solid state disk management apparatus, characterized by comprising: The device is applied to a storage device including a plurality of solid state disks, and comprises: A wear leveling module configured to execute a wear leveling strategy of the solid state disks according to a default configuration, and start a timer to record running time of each solid state disk; A random wear module configured to execute a random wear strategy on the solid state disk whose running time exceeds a configurable time threshold according to the record of the timer; A failure judging module configured to judge whether the available capacity of the solid state disk executing the random wear strategy is lower than a configurable capacity threshold, and consider the solid state disk whose available capacity is lower than the capacity threshold to be failed; The random wear strategy comprises configuring the mapping between LBA and PBA in the FTL algorithm in a random mapping manner; The wear leveling strategy comprises configuring the mapping between LBA and PBA in the FTL algorithm in a manner that each Block has approximately the same number of erase-write times.
6. The apparatus of claim 5, wherein, The judging whether the available capacity of the solid state disk executing the random wear strategy is lower than the configurable capacity threshold, and the solid state disk whose available capacity is lower than the capacity threshold is considered to be failed, comprises: After the solid state disk considered to be failed is eliminated, data reconstruction is performed on the data stored in the storage device.
7. The apparatus of claim 5, wherein, The method comprises the following steps: Prompting to replace the solid state disk considered as invalid.
8. The apparatus of claim 5, wherein, The method comprises the following steps: Starting a write counter to record the data write amount of each solid state disk; The method comprises the following steps: The method comprises the following steps:
9. An electronic device, comprising: The method comprises the following steps: A processor and a machine readable storage medium, the machine readable storage medium stores machine executable instructions capable of being executed by the processor, and the processor executes the machine executable instructions to implement the method of any one of claims 1-4.
10. A machine-readable storage medium, characterized in that, The machine readable storage medium stores machine executable instructions, and the machine executable instructions, when invoked and executed by a processor, cause the processor to implement the method of any one of claims 1-4.
Citation Information
Patent Citations
Management method for storage arrays, device and controller
CN103688248A