Flash memory exception processing method and system, and storage medium
By detecting abnormal flash memory blocks and recovering data using normal data and redundant blocks to build RAID, the problem of low flash memory capacity utilization is solved, achieving more efficient data storage and protection.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- ALIBABA (CHINA) CO LTD
- Filing Date
- 2022-11-22
- Publication Date
- 2026-05-19
AI Technical Summary
In existing technologies, when a flash memory block fails, a free block needs to be reserved for replacement, resulting in low flash memory capacity utilization.
By detecting the readability of abnormal flash blocks, the data of the abnormal flash blocks is recovered using the parity data of normal data flash blocks and redundant blocks, and RAID is built for storage protection to avoid replacement of reserved free blocks.
This improves the utilization rate of flash memory capacity, reduces data migration and media write amplification, and ensures data reliability and stability.
Smart Images

Figure CN115826856B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of data storage technology, and in particular to a flash memory anomaly handling method, system, and storage medium. Background Technology
[0002] The proliferation of the Internet and e-commerce has generated massive amounts of data. Numerous storage systems and servers have been created in this field to store and access this data. Storage systems or servers may include volatile memory (e.g., dynamic random access memory) and multiple storage drives (e.g., solid-state drives). Storage drives may include non-volatile memory (e.g., NAND flash memory or flash memory) for persistent storage. Memory in a server plays a crucial role in the performance and capacity of the storage system.
[0003] Storage drives typically utilize internal data buffers as write caches to reduce write latency. It is well known that flash memory blocks may fail during data read / write operations. In existing technologies, blank flash memory blocks are often reserved for each flash memory chip. When a faulty flash memory block occurs, the reserved blank flash memory block is used to replace it. When the reserved blank flash memory blocks for a flash memory chip are exhausted, the entire flash memory chip becomes unusable, leading to a reduction in the storage drive's capacity and resulting in low flash memory capacity utilization. Summary of the Invention
[0004] This application provides a flash memory anomaly handling method, system, and storage medium to improve the utilization rate of flash memory capacity.
[0005] This application provides a flash memory fault handling method, including:
[0006] For abnormal flash memory blocks in the flash memory, detect whether the abnormal flash memory blocks are readable;
[0007] If the abnormal flash memory block is unreadable, the application data of the abnormal flash memory block is recovered based on the application data of the target flash memory block in the target superblock to which the abnormal flash memory block belongs and the verification data of the redundant block; the target flash memory block is the flash memory block in the target superblock other than the abnormal flash memory block and the redundant block;
[0008] The target flash block is configured as a first independent redundant disk array (RAID), and the verification data of the application data to be written to the first superpage of the first RAID is calculated in the application data of the abnormal flash block.
[0009] Write the application data to be written to the first super page and the corresponding verification data to be written to the first super page.
[0010] This application embodiment also provides a computing system, including: a processor and a storage driver; the storage driver includes: a controller and flash memory;
[0011] The controller includes: firmware and a channel management component; the controller communicates with the flash memory through the channel management component; and accesses the flash memory through a channel.
[0012] The firmware is used to execute the steps in the above-described flash memory exception handling method.
[0013] This application also provides a computer-readable storage medium storing computer instructions, which, when executed by one or more processors, cause the one or more processors to perform the steps in the above-described flash memory exception handling method.
[0014] In this embodiment, for a superblock without reserved free flash blocks for replacing faulty flash blocks, when an unreadable faulty superblock appears within it, the data of the faulty superblock can be recovered based on the application data of other normal data flash blocks and the verification data of redundant blocks. Then, a RAID array is constructed using the normal data flash blocks to protect the data of the faulty superblock, allowing for storage protection without compromising data reliability. Compared to the faulty flash block handling method that reserves free flash blocks for replacement, this method reuses the superblock's capacity, helping to improve the superblock's capacity utilization. Attached Figure Description
[0015] The accompanying drawings, which are included to provide a further understanding of this application and form part of this application, illustrate exemplary embodiments and are used to explain this application, but do not constitute an undue limitation of this application. In the drawings:
[0016] Figure 1 This is a schematic diagram of the structure of the computing system provided in the embodiments of this application;
[0017] Figure 2 A schematic diagram of the logic structure of a flash memory chip provided in an embodiment of this application;
[0018] Figure 3 A schematic diagram of the logical structure of the flash memory provided in an embodiment of this application;
[0019] Figure 4 A schematic diagram illustrating the faulty flash memory handling method provided by the traditional solution;
[0020] Figure 5 This is a schematic diagram of an abnormal flash memory processing method provided in an embodiment of this application;
[0021] Figure 6 This is a schematic diagram illustrating the processing method when an abnormal flash memory block becomes readable, as provided in an embodiment of this application.
[0022] Figure 7 This is a schematic diagram illustrating the handling method when an abnormal flash memory block becomes unreadable, as provided in an embodiment of this application.
[0023] Figure 8 A flowchart illustrating the abnormal flash memory processing method provided in this application embodiment;
[0024] Figure 9 This is a schematic diagram illustrating the abnormal flash memory handling method provided in the embodiments of this application;
[0025] Figure 10 This is a flowchart illustrating another abnormal flash memory processing method provided in an embodiment of this application. Detailed Implementation
[0026] To make the objectives, technical solutions, and advantages of this application clearer, the technical solutions of this application will be clearly and completely described below in conjunction with specific embodiments and corresponding drawings. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of them. Based on the embodiments in this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0027] To address the low flash memory capacity utilization problem caused by existing faulty flash memory handling methods, this application provides a management method for superblocks with no reserved free flash memory blocks for replacing faulty flash memory blocks. For faulty superblocks that are unreadable, the data of the faulty superblock is recovered based on application data from other normal data flash memory blocks and checksum data from redundant blocks. Then, a RAID array is constructed using normal data flash memory blocks to protect the data of the faulty superblock, allowing storage of the faulty flash memory data without compromising data reliability. Compared to faulty flash memory handling methods that reserve free flash memory blocks for replacement, this method reuses the superblock's capacity, helping to improve superblock capacity utilization.
[0028] The technical solutions provided by the various embodiments of this application are described in detail below with reference to the accompanying drawings.
[0029] It should be noted that the same reference numerals denote the same object in the following figures and embodiments. Therefore, once an object is defined in one figure or embodiment, it does not need to be discussed further in subsequent figures and embodiments.
[0030] Figure 1 This is a schematic diagram of the structure of a computing system provided in an embodiment of this application. Figure 1As shown, the computing system S10 may include a processor 10 and a storage drive 20. The processor 10 and the storage drive 20 are communicatively connected. The processor 10 may be implemented as a central processing unit (CPU) of a computing device. The storage drive 20 may be a solid-state drive (SSD). The number of storage drives 20 may be one or more. "Multiple" means two or more.
[0031] In some embodiments, the computing system S10 may further include: volatile memory 30. The volatile memory 30 may be random access memory (RAM) or dynamic random access memory (DRAM), etc. The volatile memory 30 may be the main memory of the computing device. Of course, the computing system S10 may also include components such as a network interface card (NIC) 40. Figure 1 The diagram only illustrates some components of the computing system and does not imply that the computing system must contain all of them. Figure 1 The inclusion of all components does not imply that a computing system can only include... Figure 1 The components are shown. In this embodiment, the computing system can be a computing system within a computing device, such as a computing system within a server. In the field of cloud storage or cloud computing, the components of the computing system may also reside in different servers.
[0032] like Figure 1 As shown, the storage drive 20 may include a controller 21 and flash memory 22. The flash memory 22 is a non-volatile storage medium. The flash memory 22 may be a NAND flash memory or a NOR flash memory, etc. The controller 21 may include an interface for docking the host and docking the flash memory 22. The interface for docking the host mainly refers to the interface of the host's processor 10. The controller 21 may also include a write buffer 211, firmware 212, and a channel management component 213. The write buffer 211 has a power-loss protection function and is used to buffer the data to be written contained in the write commands sent by the host.
[0033] Firmware 212 refers to a component used to execute the commands, instructions, and / or code described in this application. In this application, firmware 212 is used to receive a write command; write the data to be written contained in the write command to the write buffer 211; and then return a write command write success message to the processor 10. Thus, the host ( Figure 1 (Not shown in the image) indicates that the write command was successful. Firmware 212 can also asynchronously write the data to be written in write buffer 211 to flash memory 22.
[0034] like Figure 1As shown, the flash memory 22 may include multiple channels 221. Each channel has multiple flash memory chips 222. For NAND flash memory, the flash memory chips 222 may be NAND flash particles. Figure 2 This is a schematic diagram of the structure of flash memory chip 222. Figure 2 As shown, each flash memory chip 222 may include: one or more flash planes. Multiple flash planes can operate concurrently. Each flash plane may include: one or more flash blocks. A flash block is the smallest erase unit. Each flash block may include: one or more flash pages. A flash page is the smallest read / write unit of flash memory 22.
[0035] In practical use, data erasure and writing to flash memory are usually performed in units of superblocks. The concept of a superblock is explained below.
[0036] like Figure 3 As shown, the flash memory 22 includes multiple channels 221. Each channel has multiple flash memory chips 222. For details on the organization of the flash memory chips 222, please refer to the above. Figure 2 .like Figure 3 As shown, a superblock can include flash memory blocks located in multiple flash memory chips on different channels. Figure 3 A superblock is a group of flash memory blocks located in the same row within a superblock. Similarly, a superpage, also known as a page stripe, can include flash memory pages from multiple flash memory chips located on different channels; that is, a superpage is a group of flash memory pages located in the same row within a superblock. Figure 3 Medium gray filled flash pages represent physical pages that have been written to, while diagonally filled and white flash pages represent free flash pages.
[0037] During the writing of data to flash memory 22, firmware 212 can write the data to the flash memory page of the superpage in a "horizontal" manner. That is, firmware 212 can write a page of data to the first free physical page of the first-ordered flash memory chip 222 in the superpage (i.e.,... Figure 3 (Physical pages filled with diagonal lines). Then, firmware 212 can continue writing the next page of data to the first free flash page of the next sequentially ordered flash memory chip 222 ( Figure 3 (Flash pages filled with diagonal lines) The page data is written sequentially to the first free physical page of the superpage, page by page, until the check data of the superpage is written to the redundant page of the superpage.
[0038] In practical applications, flash memory 22 may contain abnormal flash memory blocks, i.e., abnormal flash memory blocks. In traditional solutions, such as Figure 4As shown, in order to handle abnormal flash memory blocks, a free flash memory block is often reserved in each flash memory chip 222. When an abnormal flash memory block occurs, the reserved free flash memory block is used to replace the abnormal flash memory block. Figure 4 In the superblock, "blk" represents a flash memory block, and flash memory blocks marked with "×" are abnormal flash memory blocks. The flash memory block that replaces the abnormal flash memory block is the reserved free flash memory block. For example... Figure 4 As shown, the abnormal flash block can be replaced by a reserved free flash block in the same channel as the abnormal flash block.
[0039] Since data has already been written to the faulty flash memory block, this data needs to be copied to a reserved free flash memory block, and the faulty flash memory block should be marked as faulty and not used again. This flash memory fault handling method requires that each flash memory chip have a reserved free flash memory block. When the reserved free flash memory blocks in a flash memory chip are exhausted, the entire flash memory chip becomes unusable, causing a rapid decrease in the capacity of storage drives (such as SSDs) and low flash memory capacity utilization.
[0040] In this application embodiment, in order to improve the utilization rate of flash memory capacity, a new flash memory anomaly handling method is provided, which is illustrated below with specific embodiments.
[0041] Figure 5 This is a schematic diagram of the structure of a storage driver without reserved free flash memory blocks provided in an embodiment of this application. Figure 5 The gray-filled portion marked with an "s" represents a reserved free flash memory block in the conventional solution. In this embodiment, the flash memory chip 222 has no reserved free flash memory blocks, i.e. Figure 5 The flash memory blocks in the gray-filled section are free to be used. Figure 5 In this context, when an abnormal flash block appears in flash memory chip 222, the superblock structure does not need to be changed. Before the next garbage collection (GC), the written data can be stored in the original superblock, which can reduce data migration and media write amplification. The following explains GC and write amplification.
[0042] GC (Collective Killer) refers to the process of moving existing data from flash memory to another flash memory location and completely erasing some useless data. Because flash memory writes data in units of flash pages, but deletes data in units of flash blocks, to delete useless data, the useful data in a flash block must first be copied to the pages of a new flash block. Only then can the useless data in the original flash block be deleted on a block-by-block basis. New data can only be written after deletion; it cannot be written before erasure.
[0043] When writing new data, if the controller 21 cannot find a flash page to write to, it will perform garbage collection (GC). The GC mechanism will merge valid data from some flash blocks into other flash blocks. Then, it will erase the invalid data in these flash blocks and write the new data into them. In this process, in addition to writing new data, it actually writes some data merged from other flash blocks, which is called write amplification.
[0044] In this embodiment, to improve the stability and security of data storage, a redundancy check algorithm can be used to store the data in flash memory. Specifically, the data can be encoded using a redundancy check algorithm to obtain the check data corresponding to the redundancy check algorithm; and the data to be written and the check data are written to flash memory 22 for storage according to the data storage format corresponding to the redundancy check algorithm. In this way, when some data is lost or corrupted, the lost or corrupted data can be recovered using the redundancy check algorithm and other correct data. In this embodiment, the specific implementation form of the redundancy check algorithm is not limited. Optionally, the redundancy check algorithm can be a parity check algorithm, an error checking and correction (ECC) algorithm, a cyclic redundancy check (CRC) algorithm, or an erasure coding check algorithm, etc.
[0045] Redundancy check algorithms can recover a limited number of bits of data. For example, the ECC algorithm can correct a 1-bit error and detect a 2-bit error. Accordingly, the bit threshold for the ECC algorithm can be set to 1.
[0046] In this embodiment, Redundant Arrays of Independent Disks (RAID) technology can be used for flash memory data storage. Superblocks within the flash memory can form a RAID array. In a RAID scenario, a superblock can include: data flash blocks and redundant blocks. Data flash blocks refer to flash blocks used to store application data. Redundant blocks refer to flash blocks used to store parity data. The number of redundant blocks is determined by the redundancy check algorithm. For example, for the ECC algorithm, a superblock can include one redundant block; the other data blocks in this superblock are the data flash blocks.
[0047] Based on the aforementioned RAID, when writing data to be written to the flash memory, firmware 212 can further divide the data to be written into data slices according to the number of data flash blocks and the capacity of flash pages; the data size of each data slice is equal to the capacity of the data flash pages in the superpage. Then, firmware 212 can use a redundancy check algorithm to calculate the check data for each data slice; and write the data slices and their check data into the RAID superblock in page units. In this embodiment, the capacity of the superblock can be flexibly set according to actual needs. Optionally, the superblock may include one flash block per channel.
[0048] Regarding the flash memory used for data storage with RAID technology mentioned above, the following section will discuss... Figure 6 and Figure 7 The flash memory anomaly handling method provided in this application embodiment is illustrated by way of example. A superblock includes M data flash memory blocks and P redundant blocks. Data flash memory blocks refer to flash memory blocks used to store application data. Redundant blocks refer to flash memory blocks used to store verification data. After N abnormal flash memory blocks occur during use, the superblock is reduced to contain (MN) data flash memory blocks and P redundant blocks. P is a positive integer, and its specific value is determined by the redundancy check algorithm. For example, for the ECC algorithm, P = 1.
[0049] In this embodiment, firmware 212 can perform status detection on the flash memory during flash memory read / write operations. For example, during a flash memory read operation, firmware 212 can detect whether a read error has occurred on the currently read flash page; if data is read from the currently read flash page, it is determined that there is no read error in the flash block containing the currently read flash page; if no data is read from the currently read flash page, it is determined that a read error has occurred in the flash block containing the currently read flash page. For abnormal flash blocks with read errors, a read error tag can be marked on the physical address of the abnormal flash block in the flash mapping layer so that the data of the abnormal flash block can be preferentially reclaimed during the next garbage collection of the target superblock.
[0050] During flash memory writing, firmware 212 can read the data written to the flash pages of flash memory 22 and compare the data written to the flash pages with the current page data stored in the page buffer. If the data written to the flash pages is the same as the current page data stored in the page buffer, it is determined that there is no write error in the current flash page. Conversely, if the data written to the flash pages is inconsistent with the current page data stored in the page buffer, it is determined that a write error has occurred in the current flash page. The flash block containing the flash page with the write error is the abnormal flash block with the write error. Of course, if firmware 212 cannot read the written data from the current flash page, it indicates that firmware 212 has encountered both read and write errors. For abnormal flash blocks with write errors, the abnormal flash blocks can be marked as read-only.
[0051] In this embodiment, for an abnormal flash memory block, firmware 212 can detect whether the abnormal flash memory block is readable. Optionally, firmware 212 can perform a read data operation on the abnormal flash memory block; if the data in the abnormal flash memory block is successfully read, it is determined that the abnormal flash memory block is readable. If the data in the abnormal flash memory block cannot be read, it is determined that the abnormal flash memory block is unreadable. Since the abnormal flash memory block that has experienced a read error cannot read data, it is therefore unreadable.
[0052] Data in an abnormal flash memory block where a write error occurred may or may not be readable. Since an abnormal flash memory block with readable data does not affect the accuracy of subsequent data reads, in this embodiment, if... Figure 6 As shown, a new RAID can be formed by other data flash blocks and redundant blocks in the superblock to which the abnormal flash block belongs; and data is written to the new RAID until the next GC. In this embodiment, for ease of description and distinction, the other flash blocks in the superblock to which the abnormal flash block belongs, excluding the abnormal flash block, are defined as the target flash block. Figure 6 In the diagram, gray-filled rectangles represent superpages where data has already been written; black-filled rectangles represent flash pages where a write error occurred, but the data is still readable. Correspondingly, the flash block to which the page with the write error belongs is the faulty flash block. The other data flash blocks besides the faulty flash blocks are the target flash blocks. Figure 6 The data flash block filled with left diagonal lines is the target flash block.
[0053] Since GC needs to reclaim valid data, after the GC operation is initiated, firmware 212 can prioritize reclaiming application data in abnormal flash memory blocks; and reclaim application data of the target flash memory block and verification data of redundant blocks. Afterwards, firmware 212 can erase the superblock containing the abnormal flash memory block and remove the abnormal flash memory block.
[0054] In other embodiments, the data in an abnormal flash memory block may be unreadable, which can affect the data read performance of the flash memory and necessitates the reclamation of the data stored in the abnormal flash memory block. Unreadable abnormal flash memory blocks may result in either read errors or write errors. Figure 7 The illustration only depicts write errors occurring in unreadable, faulty flash memory blocks, and does not constitute a limitation. Figure 7In the diagram, gray-filled areas represent superpages with written data, while black-filled areas represent flash pages that have experienced write errors and are therefore unreadable. Correspondingly, the flash block containing the black-filled pages is the faulty flash block, which is also unreadable. The grid-filled portion within a superpage with written data represents the application data stored in the written data flash pages of the faulty flash block. The left-hand diagonal-lined portion within a superpage with written data represents the checksum data (original checksum data) of that superpage.
[0055] like Figure 7 As shown, for an unreadable abnormal flash memory block, firmware 212 can read the application data and verification data of the target flash memory block in the target superblock to which the abnormal flash memory block belongs (i.e., Figure 7 (Original verification data). In various embodiments of this application, the target flash memory block refers to the flash memory block in the target superblock excluding abnormal flash memory blocks and redundant blocks, that is, the other flash memory blocks in the data flash memory block of the target superblock excluding abnormal flash memory blocks. Figure 7 Data flash block 1 and data flash block 2 are the target flash blocks.
[0056] Furthermore, firmware 212 can be based on the application data of the target flash memory block and the verification data of the redundant block (i.e., Figure 7 The firmware 212 can recover the application data of the abnormal flash memory block based on the original verification data of the target flash memory block and the verification data of the redundant block (i.e., the original verification data in the original verification data). Figure 7 The original verification data in the target superblock is used to recover the application data of the abnormal flash memory block using a redundancy check algorithm. The redundancy check algorithm is the same redundancy check algorithm used to store the application data in the target superblock. Optionally, firmware 212 can recover the application data of the abnormal flash memory block page by page. Figure 7 The flash memory blocks filled with gray grids are abnormal flash memory blocks. The data stored in these flash memory blocks is the application data of the abnormal flash memory blocks.
[0057] After recovering the application data from the faulty flash memory block, it is also necessary to store the application data from the faulty flash memory block. In this embodiment, to ensure the stability and security of the application data from the faulty flash memory block, such as... Figure 7 As shown, firmware 212 can set the target flash block as a new RAID and calculate the verification data of the application data of the super page to be written to the new RAID in the application data of the abnormal flash block.
[0058] For example, firmware 212 can employ a redundancy check algorithm to encode the application data of the abnormal flash memory block that is to be written to the superpage of the new RAID, so as to obtain the verification data of the application data to be written to the superpage. In this embodiment, for ease of description and distinction, the RAID composed of the target flash memory block is defined as the first RAID. The superpage of the first RAID refers to the page stripe composed of flash memory pages other than the abnormal flash memory page in the superpage of the target superblock. The first RAID may include: data flash memory blocks and redundant blocks. The number of redundant blocks in the first RAID is determined by the redundancy check algorithm.
[0059] For example, in Figure 7 In this configuration, data flash block 1 and data flash block 2 form the first RAID. Data flash block 1 is the data flash block for the first RAID; data flash block 2 is the redundant block for the first RAID.
[0060] Furthermore, firmware 212 can write the application data to be written to the superpage of the first RAID, and the corresponding checksum data, to the superpage of the first RAID. Firmware 212 writes the application data to be written to the superpage of the first RAID, and the corresponding checksum data, to the superpage of the first RAID, on a page-by-page basis. For example, in... Figure 7 In this process, the application data to be written to the super page of the first RAID is written to the data flash block 1 in units of flash pages, and the parity data of each super page of the first RAID is written to the corresponding flash page of the data flash block 2. Figure 7 The rectangle filled with black grid represents the first RAID flash page where application data was written to an abnormal flash block; Figure 7 The rectangle filled with vertical lines represents the checksum data corresponding to the application data written to the superpage of the first RAID.
[0061] This application provides a method for managing superblocks that do not have reserved free flash blocks for replacing faulty flash blocks. For faulty superblocks that are unreadable, the data of the faulty superblock can be recovered based on application data from other normal data flash blocks and checksum data from redundant blocks. A new RAID is then constructed using the normal data flash blocks in the faulty superblock to protect the data in the faulty superblock. This method allows for the storage of faulty flash block data without compromising data reliability. Compared to faulty flash block replacement methods that reserve free flash blocks, this method reuses the superblock's capacity, helping to improve superblock capacity utilization.
[0062] On the other hand, since the application data of the abnormal flash block is still written into the original superblock, the structure of the superblock does not need to be changed. Before the next GC of the entire superblock, the data already written to the superblock is still stored in the original superblock. Therefore, the amount of data migration and media write amplification can be reduced.
[0063] The following is combined Figure 8 The abnormal flash memory processing method provided in the embodiments of this application will be described by way of example. Figure 8 As shown, the abnormal flash memory processing method provided in this application embodiment mainly includes the following steps:
[0064] 801. For abnormal flash memory blocks in the flash memory, check whether the abnormal flash memory blocks are readable.
[0065] 802. If the abnormal flash memory block is unreadable, recover the application data of the abnormal flash memory block based on the application data of the target flash memory block in the target superblock to which the abnormal flash memory block belongs and the verification data of the redundant block; the target flash memory block is the flash memory block in the target superblock other than the abnormal flash memory block and the redundant block.
[0066] 803. Set the target flash block as the first RAID.
[0067] 804. Calculate the verification data of the application data to be written to the first superpage of the first RAID in the application data of the abnormal flash block.
[0068] 805. Write the application data to be written to the first superpage and the corresponding verification data to the first superpage. The first superpage can be any superpage of the first RAID.
[0069] The abnormal flash memory processing method provided in this application is mainly applied to the above-mentioned... Figure 1 The firmware in the controller. In this embodiment, there are no reserved free flash blocks in the flash memory chip. When an abnormal flash block appears in the flash memory chip, the structure of the superblock does not need to be changed. Before the next garbage collection (GC), the written data can be stored in the original superblock, which can reduce the amount of data migration and media write amplification.
[0070] In this embodiment, to improve the stability and security of data storage, a redundancy check algorithm can be used to store data in flash memory. This way, if some data is lost or corrupted, the redundancy check algorithm and other correct data can be used to recover the lost or corrupted data. In this embodiment, RAID technology can be used for flash memory data storage. A superblock in the flash memory can form a RAID array. In a RAID scenario, the superblock can include: a data flash block and a redundant block. The data flash block refers to the flash block used to store application data. The redundant block refers to the flash block used to store verification data. The number of redundant blocks is determined by the redundancy check algorithm.
[0071] Based on the RAID described above, when writing data to the flash memory, the data can be divided into data slices according to the number of data flash blocks and the capacity of the flash pages. The data size of each data slice is equal to the capacity of the data flash pages in the superpage. Then, a redundancy check algorithm can be used to calculate the check data for each data slice; and the data slices and their check data are written to the RAID superblock in units of pages.
[0072] Regarding the flash memory used for data storage with RAID technology mentioned above, the following section will discuss... Figures 6-9 The flash memory exception handling method provided in this application embodiment is illustrated by way of example. In this application embodiment, the flash memory status can be detected during flash memory read and write processes. For example, during flash memory read, it can be detected whether a read error has occurred in the currently read flash memory page; if data is read from the currently read flash memory page, it is determined that there is no read error in the flash memory block where the currently read flash memory page is located; if no data is read from the currently read flash memory page, it is determined that a read error has occurred in the flash memory block where the currently read flash memory page is located. For abnormal flash memory blocks with read errors, a read error label can be marked on the physical address of the abnormal flash memory block in the flash memory mapping layer so that the data of the abnormal flash memory block can be preferentially reclaimed during the next garbage collection of the target superblock.
[0073] During flash memory writing, data written to a flash page can be read and compared with the current page data stored in the page buffer. If the data written to the flash page matches the current page data stored in the page buffer, it is determined that there is no write error in the current flash page. Conversely, if the data written to the flash page does not match the current page data stored in the page buffer, it is determined that a write error has occurred in the current flash page. The flash block containing the flash page with the write error is called the abnormal flash block with the write error. Of course, if the firmware cannot read the written data from the current flash page, it indicates that a read error and a write error have occurred in the firmware. For abnormal flash blocks with write errors, the abnormal flash blocks can be marked as read-only.
[0074] In this embodiment of the application, for an abnormal flash memory block, step 801 can detect whether the abnormal flash memory block is readable. Optionally, the firmware can perform a read data operation on the abnormal flash memory block; if the data of the abnormal flash memory block is successfully read, it is determined that the abnormal flash memory block is readable. If the data of the abnormal flash memory block cannot be read, it is determined that the abnormal flash memory block is unreadable. Since the abnormal flash memory block that has experienced a read error cannot read data, it is therefore unreadable.
[0075] Data in an abnormal flash memory block where a write error occurred may or may not be readable. Since an abnormal flash memory block with readable data does not affect the accuracy of subsequent data reads, in this embodiment, if... Figure 6 As shown, a new RAID (defined as such) can be formed by other flash blocks and redundant blocks in the target superblock to which the abnormal flash block belongs; and data is written to the new RAID until the next GC. In the embodiments of this application, for ease of description and distinction, the other flash blocks in the superblock to which the abnormal flash block belongs, excluding the abnormal flash block, are defined as the target flash block.
[0076] Since garbage collection (GC) requires the reclamation of valid data, after the GC operation is initiated, application data in abnormal flash memory blocks can be reclaimed first; application data in the target flash memory block and verification data of redundant blocks can also be reclaimed. Afterwards, the superblock containing the abnormal flash memory block can be erased, and the abnormal flash memory block can be removed.
[0077] In other embodiments, the data in an abnormal flash memory block may be unreadable, which can affect the data read performance of the flash memory and necessitates the reclamation of the data stored in the abnormal flash memory block. Unreadable abnormal flash memory blocks may result in either read errors or write errors. Figure 7 The illustration only shows a write error occurring in an unreadable abnormal flash memory block, but this is not intended to be limiting.
[0078] Combination Figure 7 and Figure 8 For unreadable abnormal flash memory blocks, the firmware can read the application data and verification data of the target flash memory block in the target superblock to which the abnormal flash memory block belongs. In various embodiments of this application, the target flash memory block refers to the flash memory block in the target superblock other than the abnormal flash memory block and the redundant block, that is, the other flash memory blocks in the data flash memory block of the target superblock other than the abnormal flash memory block.
[0079] Further, in step 802, the application data of the abnormal flash memory block can be recovered based on the application data of the target flash memory block and the verification data of the redundant block. Specifically, a redundancy check algorithm can be used to recover the application data of the abnormal flash memory block based on the application data of the target flash memory block and the verification data of the redundant block. Optionally, the firmware can recover the application data of the abnormal flash memory block on a page-by-page basis.
[0080] Specifically, for any superpage A in the target superblock, where superpage A is a superpage with written data, the application data of the abnormal flash block in superpage A can be recovered using a redundancy check algorithm based on the application data of the target flash block in superpage A and the verification data of the redundant block in superpage A.
[0081] Optionally, the application data of the target flash memory block in super page A and the verification data of the redundant block in super page A can be decoded according to the decoding process corresponding to the redundancy check algorithm to obtain the application data of the abnormal flash memory block in super page A.
[0082] The above embodiment uses superpage A as an example to illustrate the process of recovering application data from an abnormal flash memory block. The same method can be used to recover the application data of each superpage in which data has already been written to the abnormal flash memory block, thus obtaining the application data of the abnormal flash memory block.
[0083] After recovering the application data from the faulty flash memory block, it is also necessary to store the application data from the faulty flash memory block. In this embodiment, to ensure the stability and security of the application data from the faulty flash memory block, combined with... Figure 7 and Figure 8 ,exist Figure 8 In step 803, the target flash memory block can be configured as a new RAID, and in step 804, the verification data of the application data to be written to the superpage of the new RAID in the application data of the abnormal flash memory block is calculated. Specifically, a redundancy check algorithm can be used to encode the application data to be written to the superpage of the new RAID in the application data of the abnormal flash memory block to obtain the verification data of the application data to be written to the superpage. In the embodiments of this application, for ease of description and distinction, the RAID composed of the target flash memory block is defined as the first RAID. The superpage of the first RAID refers to the page strip composed of flash memory pages other than the abnormal flash memory page in the superpage of the target superblock. The first RAID may include: data flash memory blocks and redundant blocks. The number of redundant blocks in the first RAID is determined by the redundancy check algorithm.
[0084] Further, in step 805, the application data to be written to the superpage of the first RAID, and the corresponding checksum data, can be written to the superpage of the first RAID. The firmware writes the application data to be written to the superpage of the first RAID, and the corresponding checksum data, to the superpage of the first RAID, on a page-by-page basis.
[0085] Specifically, the application data of abnormal flash blocks can be divided into application data slices based on the number of target flash blocks and the capacity of flash pages. There can be one or more application data slices. "Multiple" refers to two or more. The data volume of each application data slice is equal to the total capacity of the data flash pages contained in the superpage of the first RAID.
[0086] In this embodiment, it is assumed that the number of superpages to which data has been written in the target superblock is K, where K is a positive integer. The number of target flash blocks is Q, where Q ≥ 3 and is an integer. The number of redundant blocks in the first RAID is P, where 1 ≤ P ≤ (Q-2) and is an integer.
[0087] In some embodiments, K is an integer multiple of (QP), so that the application data of the abnormal flash block can be evenly divided into at least one application data slice. In some embodiments, K is not an integer multiple of (QP), then N pages of data can be filled into the application data of the abnormal flash block to obtain the filled application data. Here, R is equal to Q minus the remainder of K divided by (QP). That is, R = Q - [K % (QP)], where "%" represents the remainder. For the ECC algorithm, P = 1. Figure 6 , Figure 7 and Figure 9 The illustrations all use a single redundant block as the reference, but this is not intended to be limiting. In an embodiment with a single redundant block, the firmware can handle an abnormal flash memory block.
[0088] Furthermore, based on the number of data flash blocks and the capacity of flash pages in the first RAID, the filled application data can be divided into at least one application data slice. An application data slice is the application data to be written to the superpage of the first RAID. One application data slice is the application data to be written to one superpage of the first RAID.
[0089] After dividing the application data of the faulty flash memory block into application data slices, a redundancy check algorithm can be used to encode the application data slices to obtain their check data. Furthermore, the application data slice and its corresponding check data can be written into the superpage of the first RAID. Writing an application data slice and its corresponding check data into a superpage of the first RAID achieves both the storage of application data from the faulty flash memory block and RAID protection.
[0090] exist Figure 7 In the diagram, the black grid-filled areas represent the data flash pages of the first RAID superpage, where application data from faulty flash blocks is written. The vertical line-filled areas represent the redundant pages of the first RAID superpage, where verification data from the application data of faulty flash blocks is written.
[0091] This application provides a method for managing superblocks that do not have reserved free flash blocks for replacing faulty flash blocks. For faulty superblocks that are unreadable, the data of the faulty superblock can be recovered based on application data from other normal data flash blocks and checksum data from redundant blocks. Then, a RAID array is constructed using the normal data flash blocks in the faulty superblock to protect the data of the faulty superblock. This method allows for the storage of faulty flash block data without compromising data reliability. Compared to faulty flash block handling methods that reserve free flash blocks for replacement, this method reuses the superblock's capacity, helping to improve superblock capacity utilization.
[0092] On the other hand, since the application data of the abnormal flash block is still written into the original superblock, the structure of the superblock does not need to be changed. Before the next GC of the entire superblock, the data already written to the superblock is still stored in the original superblock. Therefore, the amount of data migration and media write amplification can be reduced.
[0093] Because the RAID protection for superpages with data already written to them in the superblock uses a redundancy check algorithm to encode the data flash pages of the superpage as check data, the check data in the superblock's redundant block storage incorporates application data from the malfunctioning flash blocks. This renders the RAID protection ineffective for superpages with already written data.
[0094] To continue RAID protection for the data already written to the superblock, it is necessary to eliminate the impact of application data from abnormal flash blocks. Based on this, combined with... Figure 7 and Figure 9 Furthermore, based on the application data of the abnormal flash memory block and the application data of the redundant blocks of the target superblock, a redundancy check algorithm can be used to determine the check data of the target flash memory block's application data, resulting in updated check data. The check data obtained in this process can strip away the application data of the abnormal flash memory block, retaining protection for other data flash memory pages besides the page containing the abnormal flash memory block; hence, this is called the offsetting effect. The offsetting effect means that RAID protection strips away the application data of the abnormal flash memory block, allowing RAID protection to continue for the data in other normal data flash memory blocks.
[0095] Specifically, such as Figure 9 As shown, for any superpage B in the target superblock that has already been written with data, the redundancy check algorithm can be used to determine the check data of the target flash block in superpage B based on the application data of the abnormal flash block in superpage B and the check data of the redundant block of the superblock in superpage B. This redundancy check data is then used as the update check data for superpage B. Figure 9 The illustration only shows the target superblock comprising M data flash blocks and 1 redundant block, and this is not intended to be limiting. Figure 9 In the process, after N abnormal flash memory blocks occur during use, the superblock is reduced to contain (MN) data flash memory blocks and 1 redundant block.
[0096] Optionally, the application data of the abnormal flash memory block in super page B and the verification data of the redundant block of the super block in super page B can be subjected to the inverse operation of the redundancy check algorithm encoding process to obtain the verification data of the target flash memory block in super page B, which can be used as the updated verification data of super page B.
[0097] For example, the redundancy check algorithm is an XOR algorithm. Figure 9 As shown, a bitwise XOR operation can be performed on the application data of the abnormal flash memory block in super page B and the verification data of the redundant block of the super block in super page B to obtain the verification data of the target flash memory block in super page B, which can then be used as the updated verification data for super page B. Figure 9 In the symbol “⊕”, “XOR” is used.
[0098] Furthermore, such as Figure 7 As shown, the checksum data corresponding to the application data of the target flash memory block can be written to the free redundant page of the original redundant block of the target superblock. That is, the updated checksum data is written to the free redundant page of the original redundant block of the target superblock. The redundant block of the target superblock is the redundant block of the original superblock, i.e. Figure 7 The redundant block stores the original verification data. Figure 7 In this process, the updated verification data is the verification data corresponding to the application data of the target flash memory block. Specifically, the verification data corresponding to the application data of the target flash memory block is written page by page to the free redundant pages of the original redundant block, starting from the first currently free redundant page.
[0099] The above embodiments, based on RAID cancellation and reconstruction, can flexibly unbind superblock combinations and release superblock capacity. For data protection before the occurrence of abnormal flash blocks, the RAID redundancy can be updated through the above RAID cancellation effect to effectively protect data written to normal flash blocks, thus reusing media capacity.
[0100] In this embodiment, after writing the application data and its verification data to the superpage of the first RAID, the target flash block and the redundant block of the target superblock can be configured into a new RAID (defined as the second RAID). Furthermore, during subsequent flash memory writes, data can be written to the second RAID until the next garbage collection (GC).
[0101] Furthermore, during GC startup targeting the target superblock, the system can respond to GC operations targeting the target superblock by reclaiming the data of the target flash memory block, the updated verification data of the original redundant block of the target superblock, and the verification data of the data written to the second RAID. The updated verification data is the verification data of the application data of the target flash memory block.
[0102] After effective data reclamation, the target superblock can be erased and abnormal flash blocks can be removed, thus achieving GC of the target superblock.
[0103] The abnormal flash memory handling method provided in this application embodiment allows for continued data reading and writing within the original superblock if the data in the abnormal flash memory block is readable. If the data in the abnormal flash memory block cannot be read, normal reading and writing can continue within the original superblock after the data of the abnormal flash memory block is migrated within the same superblock. During the migration of data from the abnormal flash memory block within the same superblock, front-end writes can still be handled by parallel open superblocks, reducing the impact on user-visible performance and improving the SSD's Quality of Service (QoS).
[0104] And the above Figure 4 The illustrated process of replacing an abnormal flash memory block requires reading the data from the abnormal superblock and rewriting it into a reserved free flash memory block. Since the abnormal flash memory block is defined as fault recovery, it has a high processing priority and needs to be processed quickly. Therefore, this type of operation consumes SSD backend resources and creates competition with frontend user requests, causing a temporary impact on the overall performance stability of the SSD. Therefore, the flash memory anomaly handling method provided in this application embodiment helps improve the performance stability and QoS of SSDs.
[0105] on the other hand, Figure 4 The abnormal flash memory block replacement scheme shown is typically discovered during the writing process through write errors. At this time, the parallel writing of multiple flash memory pages is interrupted, and the data migration and mapping update involved in replacing the abnormal flash memory block need to be completed in a timely manner. Data cache is also required to temporarily accept the input data, which puts significant pressure on the data consistency and power loss protection of the computing system.
[0106] The flash memory anomaly handling method provided in this application embodiment involves migrating the data of the abnormal flash memory block within the same superblock, which can reduce the amount of data migration, increase the data migration speed, help reduce the interruption time of parallel writing of multiple flash memory pages, and to a certain extent reduce the pressure on data consistency and power loss protection.
[0107] To better understand the flash memory exception handling method provided in the embodiments of this application, the following is combined with... Figure 10 The specific embodiments shown are illustrated by way of example. Figure 10 In this configuration, the superblock consists of M data flash memory blocks and one redundant block. The redundancy check algorithm is the XOR algorithm. Figure 10 As shown, this flash memory fault handling method mainly includes:
[0108] S1. Load the abnormal flash memory block table and select normal flash memory blocks to form a superblock based on the channel distribution. The superblock includes: M data flash memory blocks and one redundant block.
[0109] S2 and SSD perform read and write operations on the flash memory.
[0110] S3. During the read operation on the flash memory, check whether a read error has occurred. If an error has occurred, proceed to step S6; if no error has occurred, proceed to step S4.
[0111] S4. During the write operation to the flash memory, check if a write error has occurred. If it has, proceed to step S5. If not, return to step S2.
[0112] S5. Mark the abnormal flash memory block where a write error occurred as read-only.
[0113] S6. Read application data from the abnormal flash memory block.
[0114] S7. Check if the reading was successful. If successful, proceed to step S9; if unsuccessful, proceed to step S8.
[0115] S8. Perform a bitwise XOR operation on the application data of the target flash memory block and the verification data of the redundant block to recover the application data of the abnormal flash memory block. Then, execute step S10.
[0116] The number of target flash blocks is (M-1), and the target flash blocks are the other flash blocks among the M data flash blocks excluding the abnormal flash blocks.
[0117] S9. Configure (M-1) target flash memory blocks and the original redundant blocks into a second RAID; and use the free flash memory pages of the second RAID to write data. Next, execute step S16.
[0118] S10. Configure (M-1) target flash memory blocks as the first RAID. The first RAID consists of (M-2) data flash memory blocks and 1 redundant block. The superpage of the first RAID consists of (M-2) data flash memory pages and 1 redundant page.
[0119] S11. For the application data of (M-2) data flash pages to be written in the application data of the abnormal flash page, calculate the verification data of the application data of (M-2) data flash pages to be written.
[0120] S12. Write the application data and corresponding verification data to be written to (M-2) data flash pages into a super page of the first RAID.
[0121] S13. Based on the application data of the abnormal flash memory block in super page B of the super block and the verification data of the redundant block of the super block in super page B, determine the verification data of the target flash memory block in super page B and obtain the updated verification data.
[0122] S14. Write the updated check data to the free redundant page of the superblock's redundant block.
[0123] S15. Configure (M-1) target flash blocks and the existing redundant blocks into a third RAID; and use the free flash pages of the third RAID to write data. Next, execute step S16.
[0124] S16. Valid data in the GC superblock is erased, and abnormal data blocks are removed.
[0125] The valid data includes: the data of the target flash block, the updated verification data stored in the redundant block, and the verification data written in the redundant block in step S15.
[0126] S17. Add the abnormal flash block to the abnormal flash table.
[0127] S18. Determine whether the read / write operation is complete. If complete, proceed to step S19; if not complete, proceed to step S2.
[0128] S19. Write the abnormal flash block table to the persistent storage medium for loading during firmware initialization.
[0129] It should be noted that the execution subject of each step of the method provided in the above embodiments can be the same device, or the method can be executed by different devices. For example, the execution subject of steps 801 and 802 can be device A; or the execution subject of step 801 can be device A, and the execution subject of step 802 can be device B; and so on.
[0130] Furthermore, some processes described in the above embodiments and accompanying drawings include multiple operations that appear in a specific order. However, it should be clearly understood that these operations may not be executed in the order they appear herein, or they may be executed in parallel. The operation numbers, such as 801, 802, etc., are merely used to distinguish different operations and do not represent any execution order. In addition, these processes may include more or fewer operations, and these operations may be executed sequentially or in parallel.
[0131] Accordingly, embodiments of this application also provide a computer-readable storage medium storing computer instructions, which, when executed by one or more processors, cause one or more processors to perform the steps in the above-described flash memory exception handling method.
[0132] It should be noted that the terms "first" and "second" in this article are used to distinguish different messages, devices, modules, etc., and do not represent a chronological order, nor do they limit "first" and "second" to different types.
[0133] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product implemented on one or more computer-usable storage media (including, but not limited to, disk storage, compact disc read-only memory (CD-ROM), optical storage, etc.) containing computer-usable program code.
[0134] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart... Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0135] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0136] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0137] In a typical configuration, a computing device includes one or more processors (CPU, etc.), input / output interfaces, network interfaces, and memory.
[0138] Memory may include non-persistent storage in computer-readable media, such as random-access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM. Memory is an example of computer-readable media.
[0139] Computer storage media are readable storage media, also known as removable media. Removable and non-removable media can be used to store information by any method or technology. Information can be computer-readable instructions, data structures, program modules, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, Digital Video Disc (DVD) or other optical storage, magnetic tape, disk storage or other magnetic storage devices, or any other non-transferable medium that can be used to store information accessible by a computing device. As defined herein, computer-readable media does not include transient media, such as modulated data signals and carrier waves.
[0140] It should also be noted that the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article, or apparatus. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes the aforementioned element.
[0141] The above description is merely an embodiment of this application and is not intended to limit the scope of this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the scope of the claims of this application.
Claims
1. A flash memory fault handling method, characterized in that, include: For abnormal flash memory blocks in the flash memory, detect whether the abnormal flash memory blocks are readable; If the abnormal flash memory block is unreadable, the application data of the abnormal flash memory block is recovered based on the application data of the target flash memory block in the target superblock to which the abnormal flash memory block belongs and the verification data of the redundant block; the target flash memory block is the flash memory block in the target superblock other than the abnormal flash memory block and the redundant block; The target flash block is configured as a first independent redundant disk array (RAID), and the verification data of the application data to be written to the first superpage of the first RAID in the application data of the abnormal flash block is calculated. Write the application data to be written to the first super page and the corresponding verification data to be written to the first super page.
2. The method according to claim 1, characterized in that, Also includes: Based on the application data of the abnormal flash memory block and the application data of the redundant block, the redundancy check algorithm is used to determine the check data of the target flash memory block in order to obtain updated check data. The updated verification data is written to the free redundant page of the redundant block.
3. The method according to claim 2, characterized in that, The step of determining the verification data of the target flash memory block using the redundancy check algorithm based on the application data of the abnormal flash memory block and the verification data of the redundant block includes: For the second superpage in the target superblock, based on the application data of the abnormal flash memory block in the second superpage and the verification data of the redundant block in the second superpage, the redundancy check algorithm is used to determine the verification data of the target flash memory block in the second superpage; the second superpage is any superpage in the target superblock that has been written with data.
4. The method according to claim 3, characterized in that, The redundancy check algorithm is an XOR algorithm; the step of determining the verification data of the target flash memory block in the second superpage using the redundancy check algorithm based on the application data of the abnormal flash memory block in the second superpage and the verification data of the redundant block in the second superpage includes: The application data of the abnormal flash memory block in the second superpage and the verification data of the redundant block in the second superpage are XORed to obtain the verification data of the target flash memory block in the second superpage.
5. The method according to claim 1, characterized in that, The step of restoring the application data of the abnormal flash memory block based on the application data of the target flash memory block in the target superblock to which the abnormal flash memory block belongs and the verification data of the redundant block includes: For the second superpage in the target superblock, based on the application data of the target flash memory block in the second superpage and the verification data of the redundant block in the second superpage, a redundancy check algorithm is used to recover the application data of the abnormal flash memory block in the second superpage; the second superpage is any superpage in the target superblock that has been written with data.
6. The method according to claim 2, characterized in that, The verification data for calculating the application data to be written to the first superpage of the first RAID in the application data of the abnormal flash block includes: Based on the number of data flash blocks and the capacity of flash pages in the first RAID, the application data of the abnormal flash blocks is divided into at least one application data slice; the application data slice is the application data to be written to the first super page; A redundancy check algorithm is used to encode the application data slice to obtain the check data of the application data slice.
7. The method according to claim 6, characterized in that, The number of second superpages in the target superblock is K; the second superpage is a superpage in the target superblock that has already been written with data; the number of target flash blocks is Q; K is a positive integer; M≥3 and is an integer; the number of redundant blocks in the first RAID is P; 1≤P≤(Q-2) and is an integer; The step of dividing the application data of the abnormal flash block into at least one application data slice based on the number of data flash blocks and the capacity of flash pages in the first RAID includes: If K is not an integer multiple of (QP), fill the application data of the abnormal flash memory block with the data of R flash memory pages to obtain the filled application data; R is equal to Q minus the remainder of K divided by (QP); Based on the number of data flash blocks and the capacity of flash pages in the first RAID, the filled application data is divided into at least one application data slice.
8. The method according to claim 2, characterized in that, Also includes: After writing the application data to be written to the first superpage and the corresponding verification data to be written to the first superpage, the target flash block and the redundant block are set as a second RAID. Data is written to the second RAID until the next garbage collection for the target superblock occurs.
9. The method according to claim 8, characterized in that, The abnormal flash memory block is a flash memory block that has experienced a read error detected during the data reading process of the flash memory; the method further includes: In the flash memory mapping layer, the physical address of the abnormal flash memory block is marked with a read error tag so that the data of the abnormal flash memory block can be preferentially reclaimed during the next garbage collection of the target superblock.
10. The method according to claim 2, characterized in that, Also includes: If the abnormal flash memory block is readable, set the target flash memory block and the redundant block as a second RAID; Data is written to the second RAID until the next garbage collection for the target superblock occurs.
11. The method according to any one of claims 8-10, characterized in that, Also includes: In response to a garbage collection operation targeting the target superblock, the data currently written to the target flash block, the updated parity data in the redundant block, and the parity data of the second RAID are reclaimed; The target superblock is erased, and the abnormal flash memory block is removed.
12. A computing system, characterized in that, include: Processor and storage drive; The storage drive includes: a controller and flash memory; The controller includes: firmware and a channel management component; the controller communicates with the flash memory through the channel management component; and accesses the flash memory through a channel. The firmware is used to perform the steps in the method according to any one of claims 1-11.
13. A computer-readable storage medium storing computer instructions, characterized in that, When the computer instructions are executed by one or more processors, the one or more processors are caused to perform the steps of the method according to any one of claims 1-11.