Raid card adaptive fault-tolerant optimization method and system based on erasure codes
By using adaptive erasure coding technology in the Raid card to dynamically adjust the error correction level and fault tolerance, it solves the shortcomings of traditional RAID in handling complex errors in SSD, improves the performance and efficiency of data storage, and adapts to the challenges in the SSD life cycle. Failure rate changes.
Patent Information
- Application Number
- CN202410857776.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-28
- Publication Date
- 2024-09-27
- Estimated Expiration
- 2044-06-28
AI Technical Summary
Traditional RAID technology encounters limitations in capacity expansion and performance improvement in large-scale data processing, and cannot effectively handle complex errors in SSDs, such as page faults and chip failures. Existing erasure coding solutions do not consider the failure rate of SSDs before and after use. The differences lead to low application efficiency in data centers and cloud computing environments.
The Raid card adaptive fault-tolerance optimization method based on erasure coding is used to dynamically adjust the error correction level by real-time monitoring of the wear status of flash memory blocks in the storage device, use HLS tools to optimize the encoding and decoding process, and adopt double linked list partition management and left symmetry Strategies to adaptively adjust the fault tolerance of erasure codes.
It improves the performance efficiency and fault tolerance of data storage, reduces computational complexity, can effectively handle errors in storage media at different stages of its life cycle, and improves application performance in data centers and cloud computing environments.
Smart Images

Figure CN118708121A
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of computer storage, and in particular to a Raid card adaptive fault-tolerant optimization method and system based on erasure codes. Background Art
[0002] In data center and cloud computing environments, the reliability and efficiency of data storage systems are key research areas. Traditional Redundant Array of Independent Disks (RAID) technology enhances data reliability and access speed by implementing mirroring, striping, and their combination (such as etc.). However, with the increase in large-scale data processing needs, these traditional methods have encountered significant limitations in capacity expansion and performance improvement.
[0003] Erasure coding technology, as an advanced fault-tolerant coding mechanism, provides data protection capabilities that go beyond traditional RAID technology. Through a complex encoding and decoding process, erasure coding can restore the original data in the case of multiple data corruptions, thereby providing a higher level of data protection. Nevertheless, the application of erasure coding technology is restricted by its high computational complexity and corresponding performance overhead. In particular, in the application scenario of solid-state drives (SSDs), the challenges faced by traditional RAID schemes are more prominent. Although traditional RAID can correct bit errors within a page, it cannot effectively handle more complex problems such as page errors, block errors, or chip failures. For example, RAID 5 and RAID 6 schemes can only tolerate 1 and 2 failure points, respectively. This fixed error tolerance may cause unnecessary redundancy overhead in the early life of the SSD, and may not be able to handle multiple errors in a stripe in the later life. In addition, existing erasure coding schemes within SSDs usually do not take into account the difference in failure rates before and after the use of SSDs, which limits their effectiveness in dynamic data storage environments. Therefore, a new RAID storage fault tolerance scheme is needed that can adaptively adjust its error tolerance to match the specific needs of SSDs and other storage media at different stages of their life cycle, and optimize their application performance and efficiency in data centers and cloud computing environments. Summary of the invention
[0004] In order to solve the efficiency and data protection problems in the existing storage technology, the present invention proposes a RAID card adaptive fault-tolerant optimization method and system based on erasure codes. By real-time monitoring the wear condition of the flash memory blocks in the storage device, the erasure codes of the error correction level are dynamically adjusted according to the number of high-wear blocks in each super block. The error tolerance capability can be adaptively adjusted, and errors occurring in the storage medium at different stages of its life can be effectively processed, while reducing the computational complexity and improving performance efficiency.
[0005] The purpose of the present invention can be achieved by adopting the following technical solutions:
[0006] A Raid card adaptive fault tolerance optimization method based on erasure code includes the following steps:
[0007] S1. Construct a coding matrix based on the Vandermonde matrix form, perform coding operations on the original data to generate check data, and use the encoding and decoding process of the optimized instruction-based erasure code provided by the HLS tool;
[0008] S2, striping is performed based on super pages, and a left-symmetric strategy is implemented in each super block;
[0009] S3. Regularly detect the number of high-wear blocks in the super block, and dynamically adjust the fault tolerance of the erasure code used based on the number of high-wear blocks;
[0010] S4. Adopt a write cache management strategy based on double linked list partitions, trigger the erasure code encoder to generate verification data under preset conditions, and synchronously organize the user data and verification data into one stripe;
[0011] S5. Create a recovery node and read flash memory operation, obtain all read sub-requests and execute corresponding read flash memory operations, start the erasure code decoder to recover the data of the error page to obtain the recovered data, and re-layout the recovered data.
[0012] Specifically, the step S1 includes:
[0013] Construct a coding matrix A based on the Vandermonde matrix form and select a generator polynomial in the Galois field;
[0014] Divide the data to be encoded into multiple blocks, the size of each block is adapted to the requirements of erasure coding, and encode each data block on the Galois field based on the coding matrix A;
[0015] The optimization instructions provided by the HLS tool are used to optimize the encoding and decoding process of erasure codes.
[0016] Specifically, the optimization instructions provided by the HLS tool are used to optimize the encoding and decoding process of the erasure code, including: using the optimization instructions provided by the HLS tool to optimize the storage method of the global array, the expansion and pipelining of the loop, the parallelism of the input / output interface, and the function call;
[0017] The optimization instruction provided by the HLS tool is used to optimize the storage mode of the global array, including: specifying the global array as a dual-end ROM;
[0018] The optimization of the parallelism of the input / output interface by using the optimization instructions provided by the HLS tool includes: dividing the array into multiple independent parts through instructions to achieve parallel access, and the division method includes block, loop or complete method.
[0019] Specifically, the step S2 includes:
[0020] Define and organize stripes, organize one or more pages with fixed physical addresses into a physical stripe, and arrange the pages in order of physical addresses to form a basic unit for storing data and check information;
[0021] For stripe data update processing, when a data page in a stripe needs to be updated, the updated data page and the subsequent write data are organized into a new physical stripe;
[0022] The garbage collection process is performed based on the super block granularity. When the data in a physical stripe needs to be erased or reorganized, the entire super block will participate in the garbage collection process;
[0023] A left-symmetric parity layout is used in all stripes within each superblock.
[0024] Specifically, step S3 includes:
[0025] Construct a wear block table to record the number of high-wear blocks in each super block; define a wear threshold W to distinguish between normal use blocks and high-wear blocks. When the wear level of a storage block is lower than the threshold W, the block is considered a normal block; otherwise, it is considered a high-wear block.
[0026] Select a suitable erasure coding scheme and use a reasonable distribution strategy to evenly distribute data blocks and parity blocks to different storage nodes or devices;
[0027] According to the number of high-wear blocks recorded in the wear block table, the fault tolerance capability of the erasure code used in each super block is dynamically adjusted.
[0028] Specifically, step S4 includes:
[0029] S41, dividing the write request sent by the host into multiple write sub-requests;
[0030] S42, receiving a write sub-request, and checking whether the corresponding write sub-request is hit in the data cache area;
[0031] S43, when the write sub-request hits in the data cache area, further check whether each sector in the data cache area request also hits in the cache node; for the hit sectors, directly update in the cache node, and adjust the cache node to the head of the least recently used LRU queue of the data cache area; for the missed sectors, determine whether these sectors can be completely accommodated by the data cache area; if these sectors can be completely accommodated by the data cache area, add these sectors to the cache node, and also move the node to the head of the LRU queue; if the data cache area cannot completely accommodate these sectors, execute step S45;
[0032] S44, when the write sub-request does not hit in the data cache area, determine whether the write sub-request can be completely cached by the data cache area; if it can be completely cached, then create a new cache node to store the write sub-request, and place the newly created cache node at the top of the least recently used LRU queue of the data cache area; if the data cache area cannot completely cache the write sub-request, execute step S45;
[0033] S45. Obtain the erasure code applied to the super block to be written by querying the wear block table, replace the k nodes at the tail of the LRU queue of the data cache area with the data verification cache area, start the encoder of the erasure code, cache the generated verification page to the data verification cache area, create a write flash memory sub-request corresponding to the data page and the verification page, and hang it in the corresponding channel write sub-request queue.
[0034] Specifically, step S5 includes:
[0035] S51, create a recovery node, and set the flag bit of the flash memory page in the stripe required for recovery; create the flash memory read operation required for recovery; create all read sub-requests required for recovery, set the read sub-request type, add the read sub-request to the corresponding channel read sub-request queue, and add the recovery node to the tail of the recovery queue;
[0036] S52, obtaining a read sub-request from the channel read sub-request queue and executing a corresponding flash memory read operation;
[0037] S53 sets the flag bit of the flash memory read operation. If the flash memory read operation is a flash memory read operation required for passive recovery, poll the recovery node to find the corresponding recovery operation, set the read operation completion flag and set the flag bit corresponding to the read operation in the read operation completion flag to 1; otherwise, go to step S52 to execute other read sub-requests in the channel;
[0038] S54, judging the completion status of the flash memory read operation, when all the flash memory read operations required for the recovery operation are completed, proceed to step S55; otherwise, go to step S52 to process other read sub-requests;
[0039] S55, start the erasure code decoder to recover the data of the error page, and re-layout the recovered data.
[0040] A Raid card adaptive fault-tolerant optimization system based on erasure code is implemented based on the above-mentioned Raid card adaptive fault-tolerant optimization method based on erasure code, including:
[0041] The erasure code encoding / decoding acceleration module is used to construct a coding matrix based on the Vandermonde matrix, perform encoding operations on the original data to generate check data, and perform erasure code encoding and decoding processes through the optimization instructions provided by the HLS tool;
[0042] The stripe organization module is used to perform stripe division based on super pages and implement a left-symmetric strategy in each super block.
[0043] The adaptive fault-tolerance module is used to periodically detect the number of high-wear blocks in the super block and dynamically adjust the fault-tolerance capability of the RS erasure code used based on the number of high-wear blocks.
[0044] The write cache module of the double-linked list partition management is used to adopt the write cache management strategy based on the double-linked list partition, trigger the erasure code encoder to generate verification data under preset conditions, and synchronously organize the user data and the verification data into one stripe;
[0045] The data recovery and reconstruction module is used to create recovery nodes and read flash memory operations, obtain all read sub-requests and execute corresponding read flash memory operations, start the RS code decoder to recover the data of the error page to obtain the recovered data, and re-layout the recovered data.
[0046] Compared with the prior art, the present invention has the following advantages and beneficial effects:
[0047] The present invention provides a method and system for optimizing the adaptive fault tolerance of a RAID card based on erasure codes. The method generates verification data by performing encoding operations on original data and provides an encoding and decoding process of optimized instructional erasure codes through an HLS tool. Compared with the existing software implementation, this hardware acceleration solution significantly improves the speed and efficiency of encoding and decoding, and overcomes the limitation of the processing capability of traditional RAID cards.
[0048] By dividing the data into stripes based on super pages and implementing a left-symmetric strategy in each super block, the physical address organization can be optimized to reduce the frequent update of the check data due to the update of the data page in the stripe, thereby improving the overall storage efficiency. By regularly detecting the number of high-wear blocks in the super block, the fault tolerance of the RS erasure code used is dynamically adjusted based on the number of high-wear blocks. Especially in the later stage of storage media use, this strategy improves adaptability to potential failures by enhancing the fault tolerance of the erasure code. It can effectively handle errors that occur in storage media at different stages of their life, while reducing computational complexity and improving performance efficiency.
[0049] A write cache management strategy based on double linked list partitions is adopted, which triggers the erasure code encoder to generate verification data at the appropriate time, and synchronously organizes user data and verification data into a stripe to ensure data integrity and consistency. A passive data recovery mechanism is used to provide multiple reconstruction layout options for the recovered data, which can minimize data recovery time. BRIEF DESCRIPTION OF THE DRAWINGS
[0050] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the structures shown in these drawings without paying creative work.
[0051] Figure 1 It is a flow chart of a Raid card adaptive fault tolerance optimization method based on erasure code in an embodiment of the present invention;
[0052] Figure 2 This is a flowchart of a write cache based on double linked list partition management in an embodiment of the present invention.
[0053] Figure 3 It is a structural diagram of a Raid card adaptive fault-tolerant optimization system and a flash memory controller based on erasure codes in an embodiment of the present invention. DETAILED DESCRIPTION
[0054] The technical solution of the present invention will be further described in detail below in conjunction with the accompanying drawings and embodiments. It is obvious that the described embodiments are part of the embodiments of the present invention, not all of the embodiments, and the implementation of the present invention is not limited to this. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.
[0055] Embodiment 1:
[0056] like Figure 1 As shown, a general architecture diagram of a Raid card adaptive fault-tolerant optimization method based on erasure code, a Raid card adaptive fault-tolerant optimization method based on erasure code, comprising the following steps:
[0057] S1. Use hardware acceleration technology to optimize the encoding and decoding process of erasure codes, perform encoding operations on the original data to generate verification data, and use the remaining data for efficient decoding and recovery when data corruption occurs.
[0058] S11, construct a coding matrix, construct a coding matrix A based on the Vandermonde matrix form, in the Galois field (GF 8 ) and select a generating polynomial from the .
[0059]
[0060] The encoding matrix A is an m×n Vandermonde matrix, which is composed of n elements x0, x1,, x n-1 The Galois field (GF 8 ) is selected, and the selection of the generating polynomial is crucial for constructing the coding matrix. The coding matrix A can be used to convert the original data block into the encoded data, including the check data block, which is used to enhance the error detection and correction capabilities of the data and use the remaining data for efficient decoding and recovery when data corruption occurs.
[0061] In this embodiment, in order to represent such a coding matrix in a computer program, a two-dimensional array code_matrix is used to store the coding matrix of the RS (Reed-Solomon) code under different parameters. Specifically, for a certain RS (k, m) code, its coding matrix can be represented by the first k rows and the first m columns in the code_matrix array, where k is the number of original data blocks and m is the number of generated check data blocks.
[0062] S12, dividing the data to be encoded into multiple blocks, the size of each block is adapted to the requirements of RS encoding, encoding each data block based on the encoding matrix A in the Galois field (GF) domain, and realizing a multi-rate RS code encoder.
[0063] Specifically, the encoding process for each data block is performed on the GF field, and the encoding process for each data block includes: encoding k bytes of data each time, and using a method based on a logarithm / antilogarithm table to accelerate the multiplication operation of the finite field.
[0064] S13. Optimize the Vitis high-level synthesis (HLS) instructions, use the optimization instructions provided by the Xilinx HLS tool to optimize the encoding and decoding process of the erasure code, and optimize the storage method of the global array, the expansion and pipelining of the loop, the parallelism of the input / output interface, and the function call.
[0065] Specifically, the storage method of the global array is optimized in HLS, including specifying the global array as a dual-port ROM. The optimization of global array storage can significantly affect the access speed and hardware resource utilization. By specifying the global array as a dual-port ROM, the table lookup operation can be accelerated, which is very useful in applications that need to read fixed data frequently.
[0066] The parallelism of the input / output interface is optimized by partitioning the array into multiple independent parts through the array_PARTITION instruction to achieve parallel access. The partitioning method can be block, cyclic or complete to meet the needs of different data flow intensive designs.
[0067] S2, striping is performed based on super pages, and a left-symmetric strategy is implemented in each super block. This strategy optimizes the organization of physical addresses, reduces the frequent update of check data due to the update of data pages within the stripe, and thus improves the overall storage efficiency.
[0068] S21. Calculate the index of the decoding matrix in the ROM. When the erasure code applied to the strip is RS(k,1), there is no need to decode the decoding matrix. The lost data block can be obtained by directly performing an XOR operation on the surviving block. When the RS(k,m) code that can tolerate m errors is applied in a strip of width n (i.e., m>=2), the calculation formula for the ROM index of the RS(k,m) decoding matrix can be derived:
[0069]
[0070] Where i and j are the positions of the two errors in the stripe, n is the width of the stripe, and f(i,j,m) is the index of the decoding matrix corresponding to RS(k,m) in the ROM.
[0071] S22. Define and organize stripes, organize one or more pages with fixed physical addresses into a physical stripe, and arrange the pages in order of physical addresses to form a basic unit for storing data and verification information.
[0072] Specifically, a page with a fixed physical address is a super page, and each physical stripe includes one or more super pages. The number of super pages of each physical stripe is configured according to actual storage requirements and the architecture of the SSD.
[0073] S23, for the stripe data update process, when a data page in the stripe needs to be updated, the original verification data is not directly updated. Instead, the updated data page is organized into a new physical stripe together with the subsequent write data.
[0074] S24, invalid data recovery, the garbage collection process is performed based on the super block as the granularity. When the data in a physical stripe needs to be erased or reorganized, the entire super block will participate in the garbage collection process.
[0075] S25. Check layout: adopt left-symmetric check layout in all stripes in each super block. Distribute check pages evenly in all planes, and organize the layout of check pages in super blocks across chips and planes.
[0076] Specifically, after determining the redundant coding used in the super block, in order to maximize the parallelism of the flash memory, a left-symmetric check layout similar to RAID5 is adopted in all stripes within each super block, that is, the check pages are evenly distributed in all planes, and the layout of the check pages in the super block is organized across chips and planes.
[0077] S3. Regularly detect the number of high-wear blocks in the super block, and dynamically adjust the fault tolerance of the RS (Reed-Solomon) erasure code based on the number of high-wear blocks. That is, dynamically adjust the ratio of the number of data blocks k to the number of check blocks m. By enhancing the fault tolerance of the erasure code, the adaptability to potential faults can be improved.
[0078] S31. Construct a wear block table, and record the number of high-wear blocks in each super block through the wear block table; define a wear threshold W to distinguish between normal use blocks and high-wear blocks. When the wear degree of a storage block is lower than the threshold W, the block is considered a normal block; otherwise, it is considered a high-wear block. The number of high-wear blocks in each super block is recorded through the wear block table, which provides a basis for subsequent wear management and erasure code strategy adjustment, and can finely manage the wear situation inside the RAID.
[0079] S32. Select an erasure code, choose a suitable erasure code encoding scheme, and use a reasonable distribution strategy to evenly distribute data blocks and parity blocks to different storage nodes or devices to achieve consistency in data volume on each node, thereby optimizing data recovery efficiency and storage space utilization.
[0080] S33, wear detection, the frequency of wear detection should be dynamically adjusted based on the difference in bit error rate between the initial and final use of the SSD flash memory block. In the early life of the RAID system, due to the low bit error rate, a lower frequency wear detection strategy can be adopted (for example, once every 1000 write / erase (P / E) cycles). As the system enters the later life, the bit error rate increases, and the frequency of wear detection should be increased (for example, once every 10 P / E cycles) to more accurately monitor the wear condition of the storage medium.
[0081] S34. Dynamically adjust the erasure code. According to the number of high-wear blocks recorded in the wear block table, dynamically adjust the fault tolerance of the RS (k, m) erasure code used by each super block.
[0082] Specifically, the ratio of the parameters k (number of data blocks) and m (number of check blocks) in the erasure code is adjusted to adapt to the change in the number of high-wear blocks in the super block. This adjustment is usually performed after the garbage collection process to ensure the integrity and reliability of the data and prevent data loss caused by errors in multiple high-wear blocks at the same time.
[0083] S4. Adopt a write cache management strategy based on double linked list partitions, trigger the erasure code encoder to generate verification data under preset conditions, and synchronously organize user data and verification data into a stripe to ensure data integrity and consistency.
[0084] like Figure 2 As shown in the figure, the write cache flow chart based on the double linked list partition management, the write cache management strategy based on the double linked list partition, triggers the erasure code encoder to generate verification data under preset conditions, and synchronously organizes the user data and the verification data into one stripe, specifically including:
[0085] S41. Divide the write request sent by the host into multiple write sub-requests, each sub-request corresponds to a logical page number (lpn), and each sub-request covers a number of sectors, each sector corresponds to a logical sector number (lsn).
[0086] S42, receiving a write sub-request, and checking whether the corresponding write sub-request is hit in the data cache area. Specifically, firstly, a write sub-request is received, and a search is performed in the cache node of the data cache area. If the search is hit, the write sub-request hit processing is performed in step S43; if it is not hit, the write sub-request not hit processing is performed in step S44.
[0087] S43, write sub-request hit processing, when the write sub-request hits in the data cache area, further check whether the sectors inside the data cache area request are also hit in the cache node; for the hit sectors, directly update in the cache node, and adjust the cache node to the head of the least recently used (LRU) queue of the data cache area; for the missed sectors, determine whether these sectors can be fully accommodated by the data cache area. If these sectors can be fully accommodated by the data cache area, these sectors are added to the cache node, and the node is also moved to the head of the LRU queue. If the data cache area cannot fully accommodate these sectors, it indicates that the cache area is full, and step S45 is executed at this time to perform a cache replacement operation.
[0088] S44, processing of missed write sub-requests, when a write sub-request misses in the data cache area, determine whether the write sub-request can be completely cached by the data cache area. If it can be completely cached, then create a new cache node to store the write sub-request, and place the newly created cache node at the top of the least recently used (LRU) queue of the data cache area. If the data cache area cannot completely cache the write sub-request, this indicates that the cache area has reached its capacity limit, and step S45 is executed at this time, cache replacement operation.
[0089] S45, cache replacement operation, obtain the EC mode (RS code applied to the super block) corresponding to the super block to be written by querying the wear block table, and replace the k nodes at the tail of the LRU queue of the data cache area with the data verification cache area (k is the number of data blocks in RS). The replacement process is a simple pointer operation. Generate verification data, start the encoder of the RS erasure code, and cache the generated verification page to the data verification cache area, that is, organize it into the same stripe with the data page. Create a write flash request, create a write flash sub-request corresponding to the data page and the verification page, and hang it in the corresponding channel write sub-request queue. If all sub-requests of the write request are processed, the cache management of the request is terminated, otherwise go to step (a) to continue processing.
[0090] S5. Create a recovery node and read flash memory operation, obtain all read sub-requests and execute corresponding read flash memory operations, start the RS code decoder to recover the data of the error page to obtain the recovered data, and re-layout the recovered data.
[0091] S51, create recovery node and read flash memory operation. Create recovery node rec_node, and set the flag bit rec_node->recovery_flag of the flash memory page in the stripe required for recovery; create the read flash memory operation required for recovery. Create all read sub-requests required for recovery, set the read sub-request type to RECOVERY_SUB, add the read sub-request to the corresponding channel read sub-request queue, and add the recovery node rec_node to the end of the recovery queue;
[0092] S52, obtaining a read sub-request from the channel read sub-request queue and executing a corresponding flash memory read operation;
[0093] S53 sets the flag bit of the flash memory read operation. If the flash memory read operation is a flash memory read operation required for passive recovery, poll the recovery node, find the corresponding recovery operation rec, set the read operation completion flag rec->complete_flag, and set the flag bit corresponding to the read operation in the read operation completion flag rec->complete_flag to 1; otherwise, go to step S52 to execute other read sub-requests in the channel.
[0094] S54, judging the completion status of the flash memory read operation, when all the flash memory read operations required for the recovery operation are completed, proceed to step S55; otherwise, go to step S52 to process other read sub-requests;
[0095] Specifically, determine the completion status of the flash memory read operation, determine whether the complete_flag field of the recovery operation completion flag and the recovery_flag field of the mark bit of the flash memory page in the stripe are equal. If the two are equal, all read operations required for the recovery operation are completed; otherwise, go to step S52 to process other read sub-requests.
[0096] S55, start the RS code decoder to recover the data of the error page, and re-layout the recovered data.
[0097] Specifically, the RS code decoder is started to recover the data of the error page, the recovered data is obtained, the recovered flash page data is cached in the data cache area, and the recovered data and subsequent write data are organized into a new stripe and written into the flash array, and the recovery node is deleted from the recovery operation queue to complete the recovery operation.
[0098] By designing a passive data recovery mechanism, a variety of reconstruction layout options are provided for the recovered data. This flexible recovery strategy aims to minimize the data recovery time.
[0099] In summary, the adaptive fault-tolerant optimization method for a Raid card based on erasure code provided in this embodiment generates verification data by performing encoding operations on the original data, and the encoding and decoding process of the optimized instruction-based erasure code provided by the HLS tool. Compared with the existing software implementation, this hardware acceleration solution significantly improves the speed and efficiency of encoding and decoding, and overcomes the limitations of the processing capabilities of traditional RAID cards. Striping is performed based on super pages, and a left-symmetric strategy is implemented in each super block. By optimizing the organization of physical addresses, the frequent update of verification data due to the update of data pages in the stripe can be reduced, thereby improving the overall storage efficiency. By regularly detecting the number of high-wear blocks in the super block, the fault tolerance of the RS erasure code used is dynamically adjusted based on the number of high-wear blocks. Especially in the later stage of storage medium use, this strategy enhances the adaptability to potential faults by enhancing the fault tolerance of the erasure code. It can effectively handle errors that occur in the storage medium at different stages of its life, while reducing the computational complexity and improving performance efficiency. A write cache management strategy based on double linked list partitions is adopted, which triggers the erasure code encoder to generate verification data at the appropriate time, and synchronously organizes user data and verification data into a stripe to ensure data integrity and consistency. A passive data recovery mechanism is used to provide multiple reconstruction layout options for the recovered data, which can minimize data recovery time.
[0100] Embodiment 2:
[0101] Based on the above-mentioned Raid card adaptive fault-tolerant optimization method based on erasure code, this embodiment provides a Raid card adaptive fault-tolerant optimization system based on erasure code, such as Figure 3 The figure shows a schematic diagram of the structure of a Raid card adaptive fault-tolerant optimization system and a flash memory controller based on erasure code. A Raid card adaptive fault-tolerant optimization system based on erasure code includes an erasure code encoding / decoding acceleration module, a stripe organization module, an adaptive fault-tolerant module, a write cache module managed by a double linked list partition, a write cache module managed by a double linked list partition, and a data recovery and reconstruction module, wherein:
[0102] A Raid card adaptive fault-tolerant optimization system based on erasure code is implemented based on the above-mentioned Raid card adaptive fault-tolerant optimization method based on erasure code, including:
[0103] The erasure code encoding / decoding acceleration module is used to construct a coding matrix based on the Vandermonde matrix, perform encoding operations on the original data to generate check data, and perform erasure code encoding and decoding processes through the optimization instructions provided by the HLS tool;
[0104] The stripe organization module is used to perform stripe division based on super pages and implement a left-symmetric strategy in each super block.
[0105] The adaptive fault-tolerance module is used to periodically detect the number of high-wear blocks in the super block and dynamically adjust the fault-tolerance capability of the RS erasure code used based on the number of high-wear blocks.
[0106] The write cache module of the double-linked list partition management is used to adopt the write cache management strategy based on the double-linked list partition, trigger the erasure code encoder to generate verification data under preset conditions, and synchronously organize the user data and the verification data into one stripe;
[0107] The data recovery and reconstruction module is used to create recovery nodes and read flash memory operations, obtain all read sub-requests and execute corresponding read flash memory operations, start the RS code decoder to recover the data of the error page to obtain the recovered data, and re-layout the recovered data.
[0108] The above embodiments are preferred implementation modes of the present invention, but the implementation modes of the present invention are not limited to the above embodiments. Any other changes, modifications, substitutions, combinations, and simplifications that do not deviate from the spirit and principles of the present invention should be equivalent replacement methods and are included in the protection scope of the present invention.
Claims
1. A Raid card adaptive fault tolerance optimization method based on erasure code, characterized in that: The following steps are involved: S1. Construct a coding matrix based on the Vandermonde matrix, perform coding operations on the original data to generate check data, and optimize the encoding and decoding process of the erasure code through the optimization instructions provided by the HLS tool; S2, striping is performed based on super pages, and a left-symmetric strategy is implemented in each super block; S3. Regularly detect the number of high-wear blocks in the super block, and dynamically adjust the fault tolerance of the erasure code used based on the number of high-wear blocks; S4. Adopt a write cache management strategy based on double linked list partitions, trigger the erasure code encoder to generate verification data under preset conditions, and synchronously organize the user data and verification data into one stripe; S5. Create a recovery node and read flash memory operation, obtain all read sub-requests and execute corresponding read flash memory operations, recover the data of the error page through the erasure code decoder to obtain recovered data, and re-layout the recovered data.
2. According to the method of claim 1, the method is characterized in that: The step S1 comprises: Construct a coding matrix based on the Vandermonde matrix form and select a generator polynomial in the Galois field; Divide the data to be encoded into multiple blocks, the size of each block is adapted to the requirements of erasure coding, and encode each data block on the Galois field based on the coding matrix; The optimization instructions provided by the HLS tool are used to optimize the encoding and decoding process of erasure codes.
3. According to claim 2, a Raid card adaptive fault tolerance optimization method based on erasure code is characterized in that: The optimization instructions provided by the HLS tool are used to optimize the encoding and decoding process of the erasure code, including: using the optimization instructions provided by the HLS tool to optimize the storage method of the global array, the expansion and pipelining of the loop, the parallelism of the input / output interface, and the function call; The optimization instruction provided by the HLS tool is used to optimize the storage mode of the global array, including: specifying the global array as a dual-end ROM; The optimization of the parallelism of the input / output interface by using the optimization instructions provided by the HLS tool includes: dividing the array into multiple independent parts through instructions to achieve parallel access, and the division method includes block, loop or complete method.
4. According to claim 3, a Raid card adaptive fault tolerance optimization method based on erasure code is characterized in that: The step S2 comprises: Define and organize stripes, organize one or more pages with fixed physical addresses into a physical stripe, and arrange the pages in order of physical addresses to form a basic unit for storing data and check information; For stripe data update processing, when a data page in a stripe needs to be updated, the updated data page and the subsequent write data are organized into a new physical stripe; The garbage collection process is performed based on the super block granularity. When the data in a physical stripe needs to be erased or reorganized, the entire super block will participate in the garbage collection process; A left-symmetric parity layout is used in all stripes within each superblock.
5. The method for optimizing the adaptive fault tolerance of a Raid card based on erasure codes according to claim 1, characterized in that: The step S3 comprises: Construct a wear block table to record the number of high-wear blocks in each super block; define a wear threshold W to distinguish between normal use blocks and high-wear blocks. When the wear degree of a storage block is lower than the threshold W, the storage block is considered a normal block; otherwise, the storage block is considered a high-wear block. Select a suitable erasure coding scheme and use a reasonable distribution strategy to evenly distribute data blocks and parity blocks to different storage nodes or devices; According to the number of high-wear blocks recorded in the wear block table, the fault tolerance capability of the erasure code used in each super block is dynamically adjusted.
6. The method for optimizing the adaptive fault tolerance of a Raid card based on erasure codes according to claim 5 is characterized in that: The step S4 comprises: S41, dividing the write request sent by the host into multiple write sub-requests; S42, receiving a write sub-request, and checking whether the corresponding write sub-request is hit in the data cache area; S43, when the write sub-request hits in the data cache area, further check whether each sector in the data cache area request also hits in the cache node; for the hit sectors, directly update in the cache node, and adjust the cache node to the head of the least recently used LRU queue of the data cache area; for the missed sectors, determine whether these sectors can be completely accommodated by the data cache area; if these sectors can be completely accommodated by the data cache area, add these sectors to the cache node, and also move the node to the head of the LRU queue; if the data cache area cannot completely accommodate these sectors, execute step S45; S44, when the write sub-request does not hit in the data cache area, determine whether the write sub-request can be completely cached by the data cache area; if it can be completely cached, then create a new cache node to store the write sub-request, and place the newly created cache node at the top of the least recently used LRU queue of the data cache area; if the data cache area cannot completely cache the write sub-request, execute step S45; S45. Obtain the erasure code applied to the super block to be written by querying the wear block table, replace the k nodes at the tail of the LRU queue of the data cache area with the data verification cache area, cache the generated verification page to the data verification cache area, create a write flash memory sub-request corresponding to the data page and the verification page, and hang it in the corresponding channel write sub-request queue.
7. The method for optimizing the adaptive fault tolerance of a Raid card based on erasure codes according to claim 6 is characterized in that: The step S5 comprises: S51, create a recovery node, and set the flag bit of the flash memory page in the stripe required for recovery; create the flash memory read operation required for recovery; create all read sub-requests required for recovery, set the read sub-request type, add the read sub-request to the corresponding channel read sub-request queue, and add the recovery node to the tail of the recovery queue; S52, obtaining a read sub-request from the channel read sub-request queue and executing a corresponding flash memory read operation; S53 sets the flag bit of the flash memory read operation. If the flash memory read operation is a flash memory read operation required for passive recovery, poll the recovery node to find the corresponding recovery operation, set the read operation completion flag and set the flag bit corresponding to the read operation in the read operation completion flag to 1; otherwise, go to step S52 to execute other read sub-requests in the channel; S54, judging the completion status of the flash memory read operation, when all the flash memory read operations required for the recovery operation are completed, proceed to step S55; otherwise, go to step S52 to process other read sub-requests; S55, start the erasure code decoder to recover the data of the error page, and re-layout the recovered data.
8. The method for optimizing the adaptive fault tolerance of a Raid card based on erasure codes according to claim 7 is characterized in that: The flag bit of the flash memory page in the stripe is set to: rec_node->recovery_flag; the read operation completion flag is set to: rec->complete_flag; The step S54 includes: determining whether the complete_flag field of the recovery read operation completion flag and the recovery_flag field of the mark bit of the flash memory page in the stripe are equal. If the two are equal, all the read operations required for the recovery operation are completed, and step S55 is performed; otherwise, go to step S52 to process other read sub-requests.
9. The method for optimizing the adaptive fault tolerance of a Raid card based on erasure codes according to claim 7, characterized in that: The step S55 includes: starting the erasure code decoder to recover the data of the error page, obtaining the recovered flash memory page data, caching the recovered flash memory page data into the data cache area, organizing the recovered data and subsequent write data into a new stripe and writing it into the flash memory array, and deleting the recovery node from the recovery operation queue.
10. The adaptive fault-tolerant optimization system for Raid cards based on erasure codes according to claim 1 is implemented based on the adaptive fault-tolerant optimization method for Raid cards based on erasure codes according to any one of claims 1 to 9, characterized in that: include: The erasure code encoding / decoding acceleration module is used to construct a coding matrix based on the Vandermonde matrix, perform encoding operations on the original data to generate check data, and optimize the erasure code encoding and decoding process through the optimization instructions provided by the HLS tool; The stripe organization module is used to perform stripe division based on super pages and implement a left-symmetric strategy in each super block. An adaptive fault-tolerance module is used to periodically detect the number of high-wear blocks in a super block and dynamically adjust the fault-tolerance capability of the erasure code used based on the number of high-wear blocks. The write cache module of the double-linked list partition management is used to adopt the write cache management strategy based on the double-linked list partition, trigger the erasure code encoder to generate verification data under preset conditions, and synchronously organize the user data and the verification data into one stripe; The data recovery and reconstruction module is used to create a recovery node and read flash memory operations, obtain all read sub-requests and execute corresponding read flash memory operations, start the erasure code decoder to recover the data of the error page to obtain the recovered data, and re-layout the recovered data.
Citation Information
Patent Citations
Data storage method and device, electronic equipment and storage medium
CN116312725A
Adaptive, proactive raid rebuild
US20230057271A1
Cited By
Two-dimensional RS code coding and decoding method for streaming media data transmission
CN120979605A
A two-dimensional RS code encoding and decoding method for streaming media data transmission
CN120979605B
Data recovery method and device for AI accelerator card cluster and AI accelerator card
CN122614633A
Erasure code data layout method, device, equipment and product
CN122816984A
