SSD storage optimization method and device, computer equipment and storage medium
By dynamically allocating super blocks and initializing Volatile_Parity RAID Buffer in SSDs, and adopting the strategy of separating storage from Parity and Data, the problem that existing SSDs are difficult to optimize the use of RAID Buffer resources and improve the physical storage of user data while ensuring user data reliability, achieving the effect of improving write and read performance, reducing latency and enhancing data reliability.
Patent Information
- Application Number
- CN202510177128.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-18
- Publication Date
- 2025-05-13
AI Technical Summary
While ensuring the reliability of user data, existing SSDs are difficult to optimize the use of RAID Buffer resources and improve the physical storage method of user data, resulting in a decrease in writing performance and a decrease in read concurrency.
When the SSD receives the write command, it determines whether the current super block is full, and dynamically allocates a new free super block and initializes the Volatile_Parity RAID Buffer. When writing user data, the Volatile_Parity RAID Buffer is used to perform real-time Parity calculations, and the XOR result is temporarily stored in the Buffer. When the User Region of the superblock is full, the Non Volatile Parity is generated and written to the Parity Region. In addition, a strategy of separate storage between Parity and Data is adopted to avoid interleaving storage between user data and Parity data.
It significantly reduces the immediate resource requirements for RAID Parity Buffer, improves write performance and read performance, reduces write latency due to Parity computing, and enhances data reliability and storage system stability.
Smart Images

Figure CN119987679A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to solid state drive technology, and more specifically to a method, device, computer equipment and storage medium for SSD storage optimization. Background Art
[0002] With the rapid development of information technology, solid-state drives (SSDs) have gradually become mainstream products in the storage market due to their excellent read and write speeds and reliability. Especially in the field of personal computers (PCs), SSDs are gradually replacing traditional mechanical hard disks (HDDs). SSDs use NAND flash memory as storage media. With the continuous advancement of NAND technology, the amount of data that can be stored in a single storage cell (Cell) has gradually increased from the initial 1 bit (i.e., single-level cell SLC) to 2 bits (multi-level cell MLC) and even the latest 4 bits (quadruple-level cell QLC). This change has greatly increased the storage capacity of SSDs.
[0003] However, as the amount of data stored in a single storage unit increases, its physical stability also decreases accordingly, which poses a challenge to the reliability of data stored on NAND. To ensure the integrity of user data, SSD manufacturers have adopted a variety of data protection strategies, of which ECC (Error Correction Code) algorithm and RAID (Redundant Array of Independent Disks) algorithm are two typical protection methods. The ECC algorithm mainly protects data within a single physical page, while the RAID algorithm performs data redundancy across multiple physical pages to improve data fault tolerance.
[0004] Take the RAID N+1 algorithm as an example. This algorithm generates a parity check value by performing an XOR operation on N pieces of user data, and writes the check value into the NAND together with the user data. In this way, when an error occurs in any piece of user data in the stripe, it can be recovered using the other N-1 pieces of user data and the parity check value. However, in order to generate these RAID data, multiple RAID buffers need to be retained inside the SSD. However, as the cost of SSDs decreases, their internal memory resources become increasingly scarce, making it difficult to ensure a sufficient number of RAID buffers.
[0005] In addition, the existing RAID Parity and user data interleaving storage method also brings new problems. On the one hand, user data needs to be interleaved with Parity data when writing, which increases the complexity of writing and thus affects the writing performance. On the other hand, this interleaved storage method causes the distribution of user data on the physical NAND to become irregular, which not only reduces the read concurrency of the SSD, but may also have an adverse effect on the subsequent reading performance of user data.
[0006] Therefore, how to optimize the use of RAID Buffer resources and improve the physical storage method of user data while ensuring the reliability of user data has become a key technical issue that needs to be urgently solved in the current SSD design field. Summary of the invention
[0007] The purpose of the present invention is to overcome the deficiencies of the prior art and provide a method, device, equipment and medium for SSD storage optimization.
[0008] In order to solve the above technical problems, the present invention adopts the following technical solutions:
[0009] In a first aspect, a method for optimizing SSD storage is provided, including:
[0010] Get the read and write requests sent by the SSD;
[0011] Determine whether the read / write request is a write command;
[0012] If the read / write request is a write command, determine whether the current super block is in a full state;
[0013] If the current super block is full, a new free super block is allocated to form the current super block, and the Volatile_Parity RAID Buffer is initialized;
[0014] Assign a physical address and write user data to the target physical address;
[0015] Read the Volatile_Parity RAID Buffer and perform XOR with the currently written data to obtain the XOR result, and then write the XOR result to the Volatile Parity Buffer;
[0016] Determine whether the User Region of the current super block is full;
[0017] If the User Region of the current super block is full, the user data in the current super block is read in sequence according to the required RAID composition rules, and XOR is performed to generate Non Volatile Parity;
[0018] Write the corresponding Non Volatile Parity into the physical page corresponding to the Parity Region of the current super block in sequence.
[0019] In a second aspect, a device for optimizing SSD storage is provided, including:
[0020] An acquisition unit, used to acquire the read and write requests sent by the SSD;
[0021] A first judging unit, used to judge whether the read / write request is a write command;
[0022] A second judgment unit, configured to judge whether the current super block is in a full state if the read / write request is a write command;
[0023] An allocation initialization unit is used to allocate a new free super block to form the current super block and initialize the Volatile_Parity RAID Buffer if the current super block is in a full state;
[0024] An allocation and writing unit, used for allocating a physical address and writing user data into a target physical address;
[0025] The read XOR write unit is used to read the Volatile_Parity RAID Buffer and perform XOR with the currently written data to obtain the XOR result, and then write the XOR result to the Volatile Parity Buffer;
[0026] The third judgment unit is used to judge whether the User Region of the current super block is in a full state;
[0027] A read XOR unit is used to read the user data in the current super block in sequence and perform XOR on the user data if the User Region of the current super block is full according to the required RAID composition rules to generate NonVolatileParity;
[0028] The writing unit is used to write the corresponding NonVolatile Parity into the physical page corresponding to the ParityRegion of the current super block in sequence.
[0029] In a third aspect, a computer device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the above-mentioned SSD storage optimization method when executing the computer program.
[0030] In a fourth aspect, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the above-mentioned SSD storage optimization method are implemented.
[0031] The above-mentioned SSD storage optimization method, when the SSD receives a write command, first determines whether the current super block is full. If it is full, a new free super block is allocated and the Volatile_Parity RAID Buffer is initialized. This strategy ensures the dynamic allocation of the RAID Parity Buffer and avoids long-term occupation and waste of resources. In the process of writing user data, the Volatile_Parity RAID Buffer is used to perform real-time Parity calculation, and the XOR result is temporarily stored in the Buffer. When the UserRegion of the super block is full, Non Volatile Parity is uniformly generated and written to the Parity Region. This delayed writing of Parity significantly reduces the immediate resource demand for the RAID Parity Buffer. In addition, a strategy of separate storage of Parity and Data is adopted, that is, user data is stored in the User Region, and Parity data is stored in an independent Parity Region. This separate storage method avoids the interleaved storage of user data and Parity data, thereby simplifying the write process, reducing write conflicts, and significantly improving the write performance of user data. In addition, since the generation and writing of Parity data are in the User Region, the Parity data is stored in the User Region, and the Parity data is stored in the independent Parity Region. This separate storage method avoids the interleaving of user data and Parity data, thereby simplifying the write process, reducing write conflicts, and significantly improving the write performance of user data. In addition, since the generation and writing of Parity data are in the User Region, the Parity data is stored in the User Region. The write operation is performed only after the Region is full, thus reducing the write delay caused by Parity calculation and further improving the write efficiency and subsequent read performance.
[0032] The present invention is further described below in conjunction with the accompanying drawings and specific embodiments. BRIEF DESCRIPTION OF THE DRAWINGS
[0033] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying any creative work.
[0034] Figure 1 A schematic diagram of an application scenario of a typical existing NAND component;
[0035] Figure 2 The following is a schematic diagram of an application scenario of a typical existing SSD RAID configuration;
[0036] Figure 3A schematic diagram of a flow chart of a method for optimizing SSD storage provided by an embodiment of the present invention;
[0037] Figure 4 A schematic diagram of an application scenario of the method for SSD storage optimization provided by an embodiment of the present invention;
[0038] Figure 5 A schematic diagram of an application scenario of Non-Volatile Parity generation and writing provided by an embodiment of the present invention;
[0039] Figure 6 A schematic block diagram of an SSD storage optimization device provided by an embodiment of the present invention;
[0040] Figure 7 It is a schematic diagram of the structure of a computer device in an embodiment of the present invention. DETAILED DESCRIPTION
[0041] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0042] It should be understood that when used in this specification and the appended claims, the terms "include" and "comprises" indicate the presence of described features, integers, steps, operations, elements and / or components, but do not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or combinations thereof.
[0043] It should also be understood that the terms used in this specification of the present invention are only for the purpose of describing specific embodiments and are not intended to limit the present invention. As used in the specification of the present invention and the appended claims, unless the context clearly indicates otherwise, the singular forms "a", "an" and "the" are intended to include plural forms.
[0044] It should be further understood that the term "and / or" used in the present description and the appended claims refers to any and all possible combinations of one or more of the associated listed items, and includes these combinations.
[0045] See also Figure 1 The internal components of a typical SSD are shown below:
[0046] DIE, a unit that can operate independently and concurrently;
[0047] Block is an independently erasable unit. After the data in each physical location is written, the entire block must be erased before the next write;
[0048] Page, read and write unit, typically 16KB + Spare space;
[0049] Super Block, a physical block is given under each DIE to form a super block. For example, there are four DIEs in the SSD, and the physical block 0 of DIE 0 / 1 / 2 / 3 constitutes super block 0. The super block is the largest unit of concurrent reading and writing in the SSD.
[0050] See also Figure 2 The following is a typical RAID structure inside an SSD. For ease of explanation, four DIEs are used as an example:
[0051] Block X of DIE 0 / 1 / 2 / 3 constitutes super block X, which is used to write user data;
[0052] Page 0 / 8 of the super block constitutes Stripe 0; Page 1 / 9 of the super block constitutes Stripe 0, and so on;
[0053] Take Stripe 0 as an example, it contains user data D_0_0, D_0_1, D_0_2…D_0_6 and P0, forming a 7+1 RAID stripe;
[0054] During the writing process of D_0_0, D_0_1, D_0_2…D_0_6, their values need to be XORed. During this process, the intermediate results need to be temporarily stored in the RAID Parity Buffer (i.e., Parity Buffer 0).
[0055] Similarly, during the writing process of D_1_0, D_1_1, D_1_2…D_1_6, the intermediate results need to be temporarily stored in ParityBuffer 1;
[0056] Since NAND programming is done in page order, in the diagram, at most 8 stripes are in the open state, so 8 parity buffers are required;
[0057] Correspondingly, a RAID Buffer of 16KB*8=128KB is required, which is a huge overhead in cost-constrained SSDs. Furthermore, since the Parity data (P0 / P1...) in the stripe is interleaved with the user data, the distribution of the user data will be affected, resulting in the inability to achieve maximum concurrency during subsequent reading.
[0058] See also Figures 3 to 5 In the specific embodiment shown, the present invention discloses a method for optimizing SSD storage, comprising the following steps:
[0059] S1, obtains the read and write request sent by the SSD;
[0060] Specifically, the SSD has an integrated request capture module, which is responsible for monitoring and capturing read and write requests from the host system or other storage controllers. These requests usually contain key information such as the target address, data length, and operation type (read / write). The request capture module is connected to the SSD's main control chip through a hardware interface or software driver to ensure that all issued read and write requests can be received in real time and accurately. After capturing the read and write requests, the SSD's main control chip will parse them and identify the type of request (read or write), target address range, and data length. According to the type of request, the request is classified as a read request or a write request, and enters the corresponding processing flow respectively.
[0061] By implementing the above-mentioned acquisition of the read and write requests issued by the SSD, this technical feature brings the following technical effects:
[0062] Improve response speed: By capturing and parsing the read and write requests sent by the SSD in real time, the system can quickly identify the type and target of the request, thereby quickly starting the corresponding processing flow, which helps reduce the delay in request processing and improve the response speed of the SSD.
[0063] Optimize storage resource allocation: After accurately identifying the type of read and write requests, the SSD can make more reasonable resource allocation based on the current storage resource status and request characteristics. For example, when there are many write requests, the storage area with better write performance can be allocated first; when there are many read requests, the read path can be optimized to reduce read latency.
[0064] Enhance the flexibility of storage systems: By accurately capturing and parsing read and write requests, SSD systems can more flexibly respond to storage requirements in different application scenarios. For example, in applications that require high write performance, storage policies can be adjusted to prioritize write requirements; in applications that require high read performance, read paths and data layouts can be optimized.
[0065] S2, determining whether the read / write request is a write command;
[0066] Specifically, the request is first parsed by the request parsing module. This module is responsible for identifying key information in the request, including the operation type (read / write), target address, data length, etc. During the parsing process, the system pays special attention to the operation type field because it directly determines the subsequent processing flow. After parsing the operation type, the system compares it with the preset write command identifier. If the operation type matches the write command identifier, the request is determined to be a write command. The write command identifier is usually predefined in the SSD firmware or driver and is used to uniquely identify the write operation.
[0067] By implementing the above-mentioned determination of whether a read / write request is a write command, this technical feature brings the following technical effects:
[0068] Improve processing efficiency: By determining whether a read or write request is a write command, the system can quickly direct the request to the correct processing flow, avoiding unnecessary processing delays and resource waste. This helps improve the overall processing efficiency of the SSD and ensures that data can be written or read quickly and accurately.
[0069] Optimized storage management: For write commands, the system can adopt specific storage management strategies, such as wear leveling and garbage collection, to ensure data persistence and SSD life. These strategies are effectively implemented in the write operation process, thereby optimizing storage management and improving the reliability and stability of the SSD.
[0070] Enhanced system flexibility: By determining the type of read and write requests, the system can flexibly adjust storage strategies and processing flows according to different application scenarios and requirements. This helps enhance the flexibility of the system and enables it to better adapt to different storage environments and requirements.
[0071] S3, if the read / write request is a write command, determine whether the current super block is in a full state; if the current super block is not in a full state, jump to execute S5.
[0072] Specifically, when the SSD receives a write command, the system first parses the command to determine the target super block and the amount of data to be written. The write command usually contains information such as the target address (or super block identifier), the data length, and the data to be written. After determining the target super block, the system queries the current status of the super block, especially its write progress or used space, which is usually achieved by accessing the metadata table or status register inside the SSD. These data structures record the usage of each super block. The system compares the current write amount of the super block with the preset full threshold. If the current write amount has reached or exceeded the full threshold (for example, the available space of the super block is less than a certain percentage), it is determined that the super block is in a full state. The full threshold is usually set according to the capacity, performance requirements and storage policy of the SSD. If the super block is not full, the system will continue to perform the write operation and write the data to the target super block. If the super block is full, the system may take a series of measures, such as allocating a new free super block, performing garbage collection to free up space, or making other necessary adjustments according to the storage policy.
[0073] By implementing the above-mentioned determination of whether the current super block is in a full state, this technical feature brings the following technical effects:
[0074] Optimize storage space utilization: By determining whether the super block is full, the system can avoid writing data to a full super block, thereby preventing waste of storage space. This helps improve the storage space utilization of the SSD and ensure that data can be stored in an orderly and efficient manner.
[0075] Improve write operation efficiency: Timely super block status check can reduce the delay of write operation, because the system can take prompt countermeasures when the super block is full. This helps improve the write operation efficiency of SSD and ensure that data can be written to the storage device quickly and accurately.
[0076] Enhanced storage system stability: Through proper superblock management, the system can reduce the risk of write failure or data loss due to insufficient storage space. This helps enhance the stability of the storage system and ensure data integrity and reliability.
[0077] Support for advanced storage strategies: Determining whether a superblock is full is the basis for implementing advanced storage strategies such as wear leveling and garbage collection. These strategies can extend the life of the SSD, improve storage performance, and provide users with more reliable and efficient storage solutions.
[0078] S4, if the current super block is in a full state, a new free super block is allocated to form the current super block, and the Volatile_Parity RAID Buffer is initialized;
[0079] Specifically, once the current super block is detected to be full, the system allocates a new free super block from the free super block pool. The free super block pool is a set of unused super blocks reserved in the system for dynamic allocation when needed. When allocating a new super block, the system updates the metadata table or related data structure to record the location and status of the new super block. The newly allocated free super block is designated as the new current super block for subsequent write operations. The system updates internal pointers or references to ensure that subsequent write commands can be correctly directed to the new current super block. After allocating and specifying the new current super block, the system needs to initialize the Volatile_Parity RAID Buffer. The Volatile_Parity RAID Buffer is used to store parity information in the RAID level to improve data recovery and fault tolerance. The initialization process includes clearing the buffer, setting the initial parity value (if applicable), and configuring the mapping relationship between the buffer and the RAID array.
[0080] By implementing the above allocation of a new free super block to form the current super block and initialize the Volatile_Parity RAID Buffer, this technical feature brings the following technical effects:
[0081] Improve storage efficiency: By dynamically allocating new free superblocks, the system can continuously provide storage space and avoid storage bottlenecks caused by superblocks being full. This helps maintain high efficiency of the storage system and ensures timely writing and storage of data.
[0082] Enhanced data reliability: Initializing the Volatile_Parity RAID Buffer provides an additional data protection mechanism for the RAID array. In the RAID level, parity information is used to restore the original data when data is lost or damaged, thereby improving data reliability and integrity.
[0083] Optimized storage management: This technical feature implements dynamic management of super blocks and initialization of RAID buffers, optimizing the management strategy of the storage system. This helps reduce storage fragmentation, improve storage space utilization, and reduce the complexity of storage management.
[0084] Support for advanced storage functions: By dynamically allocating super blocks and initializing RAID buffers, this technical feature provides the basis for the storage system to support advanced storage functions. This includes advanced functions such as data compression, deduplication, encryption, and the implementation of more complex RAID levels and storage strategies.
[0085] S5, assign a physical address and write the user data to the target physical address;
[0086] Specifically, when user data is written to the SSD, the host provides a logical address, the FTL converts it into the corresponding physical address, and then the data is written to the physical address. The physical address allocation strategy may vary depending on different application scenarios and performance requirements. A common strategy is to dynamically adjust the allocation of physical addresses based on the read and write characteristics of the data. For example, for streams with a higher proportion of write operations, flash pages containing fewer channels can be selected for physical address allocation to quickly fill up a write unit and improve write efficiency. For streams with a higher proportion of read operations, flash pages containing more channels can be selected for allocation to utilize the concurrent reading capabilities of multiple channels and improve read efficiency. Once the physical address is allocated, the user data can be written to the target physical address. This process usually involves transferring data from the host's memory buffer to the SSD's controller, and then the controller writes the data to the specified flash page.
[0087] By implementing the above allocation of physical addresses and writing user data to the target physical address, this technical feature brings the following technical effects:
[0088] Improve performance: By dynamically adjusting the physical address allocation strategy, SSD can optimize data read and write efficiency according to different application scenarios and performance requirements. This helps reduce read and write latency and improve overall performance.
[0089] Enhanced reliability: FTL's garbage collection and flash block wear leveling functions help extend the life of the SSD and reduce the risk of performance degradation or data loss due to excessive wear of flash blocks. Data retention and bad block management functions help ensure data integrity and reliability.
[0090] S6, read the Volatile_Parity RAID Buffer, perform XOR with the currently written data to obtain an XOR result, and then write the XOR result to the Volatile Parity Buffer;
[0091] Specifically, the current parity data is read from the volatile parity buffer of the RAID system. The parity data is usually generated by an exclusive OR (XOR) operation, which represents the redundant information of the data on multiple disks in the RAID array. When writing data to a disk in the RAID array, the system will perform an exclusive OR operation on the data with the parity data read from the Volatile Parity Buffer. The purpose of this step is to update the parity data to reflect the newly written data. After the exclusive OR operation, the new parity data is written back to the Volatile Parity Buffer. In this way, when a disk in the RAID array fails, the system can use this parity data and the data on other disks to reconstruct the lost data.
[0092] By implementing the above-mentioned reading of the Volatile_Parity RAID Buffer and performing XOR with the currently written data to obtain the XOR result, and then writing the XOR result to the Volatile Parity Buffer, this technical feature brings the following technical effects:
[0093] Improve data reliability: By using a volatile check buffer and XOR check mechanism, the RAID system can provide data recovery capabilities when a disk fails. This greatly improves data reliability and reduces the risk of data loss due to disk failure.
[0094] Optimize performance: Storing parity data in a volatile buffer can reduce the number of disk accesses, thereby improving the overall performance of the system. In addition, the XOR operation is relatively simple and efficient, which enables the RAID system to maintain a high performance level when processing large amounts of data.
[0095] Support concurrent write: This technical feature supports multiple write operations at the same time without blocking each other due to the update of verification data. This helps to improve the concurrent processing capability and overall throughput of the RAID system.
[0096] Simplified management: The use of a volatile checksum buffer and XOR checksum mechanism simplifies the management of RAID systems. Administrators do not need to manually configure and manage complex checksum algorithms or additional redundant storage, as the system automatically handles these tasks.
[0097] S7, determine whether the User Region of the current super block is in a full state; if the User Region of the current super block is not in a full state, jump to execute S1;
[0098] Specifically, the system needs to be able to access and read the super block information of the current file system, which usually involves low-level access to the storage device to ensure that the super block data can be accurately read. After reading the super block, the system needs to parse the information in the super block, especially about the usage of the User Region. This may include checking the used space, remaining space, or specific status flags of the User Region. Based on the current usage of the User Region, the system can determine whether the area is full. This is usually achieved by comparing the size of the used space with the total space. If the used space is close to or equal to the total space, it can be considered that the User Region is full. The super block may contain a counter or bitmap for tracking the usage of the User Region. The counter can simply record the size of the used space, while the bitmap can provide more detailed information, indicating which blocks have been used and which blocks are still free. In order to warn of insufficient space in advance, the system may set a threshold. When the usage of the User Region reaches or exceeds this threshold, the system will issue a warning or trigger the corresponding processing mechanism.
[0099] By implementing the above-mentioned determination of whether the User Region of the current super block is in a full state, this technical feature brings the following technical effects:
[0100] Improve the accuracy of file system management: By accurately determining the full state of the User Region, the system can more effectively manage the space usage of the file system. This helps avoid write failures or data loss caused by insufficient space.
[0101] Optimizing storage performance: Knowing the usage of the User Region in a timely manner helps the system make reasonable storage decisions. For example, when the User Region is close to being full, the system can trigger garbage collection, data compression, or expand storage capacity to optimize storage performance.
[0102] Enhanced data reliability: By monitoring the status of the User Region, the system can promptly detect and handle potential storage issues. This helps reduce the risk of data corruption or loss due to insufficient storage space.
[0103] S8, if the User Region of the current super block is in a full state, the user data in the current super block is read in sequence according to the required RAID composition rule, and XOR is performed to generate Non Volatile Parity;
[0104] Specifically, if the User Region is full, the system will read the user data in the current super block in sequence according to the RAID composition rules. These data may be distributed in different parts of the super block or organized according to a specific data structure. After reading the user data, the system will process the data according to the RAID verification algorithm (such as XOR operation). XOR operation is a bit operation. For any two input values, if their corresponding bits are the same, the result is 0; if the corresponding bits are different, the result is 1. In this way, the system can generate a verification value, namely Non Volatile Parity. The generated Non Volatile Parity will be stored in non-volatile memory to ensure that the verification data is still available in the event of power outage or system failure, which helps to verify the integrity and correctness of the data during data recovery.
[0105] By implementing the above-mentioned RAID composition rules as required, the user data in the current super block is read in sequence and XORed to generate Non Volatile Parity. This technical feature brings the following technical effects:
[0106] Improve data reliability: By generating non-volatile parity, the system can use checksum data to verify the integrity and correctness of the data during data recovery. This helps reduce errors and failures caused by data corruption or loss.
[0107] Optimizing RAID performance: In a RAID system, using XOR operations to generate checksums is an efficient method. It not only has a fast calculation speed, but can also effectively detect data errors. This helps optimize the performance of the RAID system and improve the efficiency of data transmission and processing.
[0108] Enhanced data recovery capability: When a disk in a RAID system fails, the system can use the data on NonVolatile Parity and other disks to rebuild the lost data. This enhances the data recovery capability of the RAID system and improves data availability and reliability.
[0109] Support for advanced storage features: The technical features that generate Non Volatile Parity also support advanced storage features such as data compression, encryption, and deduplication. These features can further improve the performance and reliability of the storage system and meet more complex storage needs.
[0110] S9, write the corresponding Non Volatile Parity into the physical page corresponding to the Parity Region of the current super block in sequence.
[0111] Specifically, the system maps the logical address of the Parity Region to the corresponding physical page. This usually involves looking up a page table or similar data structure to determine the specific location of the Parity Region in the physical memory. Once the physical pages corresponding to the Parity Region are determined, the system writes the Non Volatile Parity data to these physical pages. This usually involves transferring data from the memory buffer to the physical memory and ensuring that the data is written correctly. After the write is completed, the system may update the relevant metadata or data structure to reflect the latest status and data content of the Parity Region. This helps to correctly identify and use the Parity Region during subsequent data reading and recovery.
[0112] By implementing the above-mentioned writing of the corresponding Non Volatile Parity into the physical page corresponding to the ParityRegion of the current super block in sequence, this technical feature brings the following technical effects:
[0113] Improve data reliability: Writing Non Volatile Parity to Parity Region can enhance data reliability. During data reading or recovery, the system can use the checksum information in the Parity Region to verify the integrity and correctness of the data, thereby reducing the risk of data corruption or loss.
[0114] Optimize performance: By separating the Parity Region from the User Region and storing the parity information in a dedicated physical page, the system can manage storage resources more efficiently. This helps optimize storage performance and improve the efficiency of data transmission and processing.
[0115] Support for fault tolerance and recovery: In a RAID system, the parity region's checksum information is crucial for data fault tolerance and recovery. When a disk fails, the system can use the parity region's checksum information and the data on other disks to rebuild the lost data. This enhances the system's fault tolerance and data recovery capabilities.
[0116] Simplified data management: Centrally storing non-volatile parity in the parity region helps simplify data management. The system can more easily track and manage the parity information, making it easier to perform operations such as data backup, recovery, and migration.
[0117] In one embodiment, the step of determining whether the read / write request is a write command further includes:
[0118] S10, if the read / write request is not a write command, the read / write request is a read command, and a NAND physical address storing user data is read according to the read command to obtain the user data;
[0119] Specifically, if the read / write request is not a write command, the system assumes that the request is a read command by default. This is because in actual applications, read / write requests are usually of only two types, write and read, and these two types are mutually exclusive. Therefore, once the possibility of a write command is ruled out, the only remaining one is a read command. The system parses the information in the read command, especially the identifier or address of the user data to be read, which usually involves parsing the parameters or data fields in the command to determine the specific data block or data item to be read. Based on the parsed user data identifier or address, the system maps it to a physical address in the NAND flash memory, which usually involves looking up an address mapping table or a similar data structure to determine the specific location of the user data in the NAND flash memory. Once the NAND physical address is determined, the system sends a read command to the NAND flash controller and specifies the address range to be read. The NAND flash controller then reads the user data from the specified physical address and transfers it to the system's memory buffer. After receiving the read user data, the system may perform further processing or verification. For example, the system may verify the integrity of the data or decode it into its original format for subsequent use.
[0120] By implementing the above-mentioned reading of the NAND physical address storing the user data according to the read command to obtain the user data, this technical feature brings the following technical effects:
[0121] Improve data reading efficiency: By clearly distinguishing between read and write request types and directly reading the NAND physical address where user data is stored according to the read command, the system can process read requests more efficiently. This reduces unnecessary processing steps and delays, and improves data reading efficiency.
[0122] Enhanced data reliability: When reading user data, the system may perform data integrity verification and error detection. This helps ensure that the data read is accurate and reliable, reducing errors and failures caused by data corruption or loss.
[0123] Simplified data management: By clearly distinguishing read and write requests into write commands and read commands and processing them separately, the system can more easily track and manage the status and content of data. This helps to simplify the data management process and reduce the complexity of data management.
[0124] S11, determine whether the user data is wrong; if the user data is not wrong, jump to S1;
[0125] Specifically, after reading the user data, the system will first perform a data integrity check. This usually involves using some form of checksum or checksum to verify the correctness of the data. For example, a CRC (cyclic redundancy check) or ECC (error detection and correction) code can be used to generate and verify the check value of the data. The system compares the check value of the read data with the original check value generated when it was stored. If the two are consistent, it means that there is no error in the data transmission or storage process; if the two are inconsistent, it indicates that the data may have an error.
[0126] By implementing the above-mentioned determination of whether user data is wrong, this technical feature brings the following technical effects:
[0127] Improve data reliability: By performing data integrity checks and error detection, the system can detect and correct data errors in a timely manner, thereby improving data reliability. This helps ensure the accuracy and consistency of user data.
[0128] Enhanced system stability: Timely detection and handling of data errors helps prevent errors from accumulating and spreading, thereby enhancing the overall stability of the system. This helps reduce system crashes or performance degradation caused by data errors.
[0129] S12, if the user data is wrong, determine whether the physical block where the user data is located is in a full state;
[0130] Specifically, once the data is confirmed to be erroneous, the system will try to locate the physical block where the erroneous data is located. This usually involves finding the physical location of the data on the storage device, such as the physical page or physical block of NAND flash memory. Next, the system checks the status of the physical block containing the erroneous data. This includes checking whether the physical block is full, whether it contains other erroneous data, and whether there is enough space to repair or rewrite the erroneous data. When checking the status of the physical block, the system pays special attention to whether the physical block is in a full state. This is usually achieved by reading the metadata or status information of the physical block to determine whether the physical block has remaining space for writing new data or repairing erroneous data.
[0131] By implementing the above-mentioned determination of whether the physical block where the user data is located is in a full state, this technical feature brings the following technical effects:
[0132] Improve the success rate of data recovery: By determining whether the physical block where the user data is located is full, the system can more accurately assess the possibility of data recovery. If the physical block is not full, the system may have enough space to repair or rewrite the erroneous data, thereby improving the success rate of data recovery.
[0133] Optimize storage resource management: Knowing the full status of physical blocks helps the system allocate and manage storage resources more reasonably. For example, if a physical block is full and contains erroneous data, the system may give priority to migrating the data to other free physical blocks to free up storage space and optimize storage performance.
[0134] Enhanced system reliability: By promptly detecting and handling user data errors and physical block full states, the system can reduce the risk of system crashes or performance degradation caused by data errors or storage device failures. This helps enhance the overall reliability and stability of the system.
[0135] S13, if the physical block where the user data is located is in a full state, the None Volatile Parity of the Parity Region in the super block is used to recover the data.
[0136] Specifically, when the system detects that the physical block where the user data is located is full and the data is erroneous, it will first further confirm the physical block status. This includes checking the fullness of the physical block, the severity of the data damage, and whether there are other available recovery methods. The system will locate the super block of the storage device, which is the metadata area of the storage device and contains important information about the layout, configuration, and status of the storage device. In the super block, the system will find the Parity Region, which is used to store the parity information of the data. Non-Volatile Parity refers to the parity information stored in the Parity Region, which can remain unchanged after power failure. The system will read this parity information for subsequent data recovery processes. Using the read Non-Volatile Parity information, the system will apply specific data recovery algorithms to try to recover the erroneous data. These algorithms may include parity algorithms, RAID reconstruction algorithms, or other data recovery technologies applicable to storage devices. After the data recovery is completed, the system will verify the recovered data. This usually involves recalculating a checksum of the data and comparing it to the original checksum to ensure that the recovered data is accurate and reliable.
[0137] By implementing the above-mentioned data recovery using the None Volatile Parity of the Parity Region in the super block, this technical feature brings the following technical effects:
[0138] Improve the success rate of data recovery: Using the non-volatile parity of the Parity Region in the super block for data recovery can significantly improve the success rate of data recovery. Parity information provides additional data redundancy, so that the system has more means to try to recover data when data errors occur.
[0139] Enhanced data reliability: By introducing non-volatile parity, the system can provide additional data protection when the physical block is full and the data is erroneous. This helps to enhance the overall data reliability of the storage device and reduce the risk of system crash or performance degradation caused by data loss or corruption.
[0140] Optimize storage resource management: During the data recovery process, the system can use storage resources more efficiently. By using parity information for data recovery, the system can avoid unnecessary data migration or storage device expansion operations, thereby optimizing the use and management of storage resources.
[0141] In one embodiment, after the step of determining whether the physical block where the user data is located is in a full state, the method further includes:
[0142] S14: If the physical block where the user data is located is not in a full state, the Volatile Parity in the current Parity Buffer is used to recover the data.
[0143] Specifically, if the physical block is not in a full state, the system will further check the current Parity Buffer state. Parity Buffer is an area in memory used to temporarily store data parity information. The system will check whether the Parity Buffer contains Volatile Parity information corresponding to the erroneous data. If the Parity Buffer contains Volatile Parity information corresponding to the erroneous data, the system will read this information. Since Volatile Parity is stored in memory, it may be lost after the system is powered off or restarted, so it needs to be used as soon as possible while the system is running. Using the read Volatile Parity information, the system will apply specific data recovery algorithms to try to recover the erroneous data. These algorithms may include parity-based error detection and correction algorithms, which can use parity information to detect and correct errors in data. After the data recovery is completed, the system will verify the recovered data. This usually involves recalculating the check value of the data and comparing it with the original check value in the Parity Buffer to ensure that the recovered data is accurate and reliable. If the verification fails, the system may try other recovery methods or notify the user that the data cannot be recovered.
[0144] By implementing the above-mentioned data recovery using the Volatile Parity in the current Parity Buffer, this technical feature brings the following technical effects:
[0145] Improve data recovery efficiency: Using the Volatile Parity in the current Parity Buffer for data recovery can significantly improve the efficiency of data recovery. Since Volatile Parity is stored in memory, it is read faster, which helps speed up the data recovery process.
[0146] Optimize resource utilization: When physical blocks are not full, using Volatile Parity for data recovery can avoid unnecessary disk I / O operations, thereby optimizing the utilization of storage resources. This helps reduce system performance degradation caused by data recovery.
[0147] Enhanced data protection: Although Volatile Parity is volatile, it can provide additional data protection when the system is running. When data errors occur, the system can quickly use the parity information in the Parity Buffer to recover data, reducing the risk of data loss.
[0148] In one embodiment, after executing S9, S13, or S14, the process jumps to execute S1 to implement a loop operation.
[0149] See also Figure 4 As shown, the super block is divided into two parts:
[0150] User Region, used to store user data writes;
[0151] Parity Region, used to store RAID Parity data;
[0152] The User Region and Parity Region in the super block are physically isolated, which will not affect the distribution of user data or the subsequent reading performance. Only one RAID Buffer (Parity Buffer 0, 16KB) is maintained. During the user data writing process, only XOR operation is performed and the result is cached in the RAID Buffer, but it does not need to be written to NAND.
[0153] That is to say, in the process of user data, only a single Parity Buffer is needed to store VolatileParity. When a single physical page data error occurs during the writing process (may be caused by a read error or a programming error), the Volatile Parity and other correct data in the super block can be used for data recovery.
[0154] See also Figure 5 As shown in the figure, after the User Region is full, the user data written in the super block is read in sequence according to the required RAID composition strategy requirements, and XOR is performed, and the intermediate results are temporarily stored in Parity Buffer 0; after all data in the stripe are read / XORed, Parity Buffer 0 is written to the physical pages of the Parity Region in sequence.
[0155] The required RAID composition rules may be as follows:
[0156] RAID composition 1: Read Page 0 / 8 of the super block in sequence, perform XOR on the data, and temporarily store the intermediate result in Parity Buffer 0; after completion, write the data of Parity Buffer 0 to the P_0 position of the Parity Region; read Page 1 / 9 of the super block in sequence, perform XOR on the data, and temporarily store the intermediate result in Parity Buffer 0; after completion, write the data of Parity Buffer 0 to the P_1 position of the Parity Region; and so on.
[0157] RAID composition 2: Read Page 0 of the super block in sequence, perform XOR on the data, and temporarily store the intermediate result in Parity Buffer 0; after completion, write the data of Parity Buffer 0 to the P_0 position of the Parity Region; read Page 1 of the super block in sequence, perform XOR on the data, and temporarily store the intermediate result in Parity Buffer 0; after completion, write the data of Parity Buffer 0 to the P_1 position of the Parity Region; and so on.
[0158] Based on this, when the super block completes writing user data, it can use a single parity buffer to generate the parity that needs to be written to provide protection for subsequent data storage; since the Non-Volatile Parity is generated later, different RAID Parities can be flexibly generated according to different RAID protection strategies (N+1, the choice of N can be customized).
[0159] That is to say, during the user data writing process, only limited RAID Buffer (such as 1x WL) is used for Parity calculation, but it is not written to NAND (recorded as Volatile_Parity) to recover when a user data programming error occurs. When the User Region in the super block is full, the corresponding user data is read according to the required stripe protection strategy, and Parity is generated in real time and written to NAND Parity_Region (recorded as Non_Volatile_Parity). When generating NonVolatile_Parity, limited RAID Buffer (such as 1x WL) can be reused for Parity generation, and limited RAID Buffer can be used for RAID operations, which reduces costs; and RAID Parity and User data are stored in partitions on NAND, which can flexibly implement different RAID protection strategies and reduce the performance loss risk caused by Parity interleaving during the user data writing process.
[0160] When the SSD receives a write command, the present invention first determines whether the current super block is full. If it is full, a new free super block is allocated and the Volatile_Parity RAID Buffer is initialized. This strategy ensures the dynamic allocation of the RAIDParity Buffer and avoids long-term occupation and waste of resources. In the process of writing user data, the Volatile_Parity RAID Buffer is used to perform real-time Parity calculation, and the XOR result is temporarily stored in the Buffer. When the User Region of the super block is full, Non Volatile Parity is uniformly generated and written into the ParityRegion. This delayed writing of Parity significantly reduces the immediate resource demand for the RAID Parity Buffer. In addition, the strategy of separate storage of Parity and Data is adopted, that is, user data is stored in the User Region, and Parity data is stored in an independent Parity Region. This separate storage method avoids the interleaving storage of user data and Parity data, thereby simplifying the writing process, reducing write conflicts, and significantly improving the writing performance of user data; in addition, since the generation and writing of Parity data is performed after the User Region is full, the write delay caused by Parity calculation is reduced, further improving the writing efficiency and subsequent reading performance. In addition, the separate storage of Parity and Data not only improves the writing performance, but also has a positive impact on the reading performance. When reading user data, there is no need to access Parity data at the same time, reducing the complexity and time overhead of the reading operation; when data recovery is required, the Parity Region can be quickly located to obtain the required Parity data, and the recovery operation is combined with the user data in the User Region, ensuring the efficiency and accuracy of data recovery. In addition, through strict RAID composition rules and Parity calculation, redundant storage and fault tolerance of data are ensured. Even if some storage units fail, Parity data can be used for data recovery, thereby enhancing the reliability and stability of the storage system.
[0161] Figure 6 is a schematic block diagram of an SSD storage optimization device 300 provided in an embodiment of the present invention. Figure 6 As shown, corresponding to the above SSD storage optimization method, the present invention also provides an SSD storage optimization device 300. The SSD storage optimization device 300 includes a unit for executing the above SSD storage optimization method, and the device can be configured in a server. Figure 6 , the SSD storage optimization device 300 includes:
[0162] An acquisition unit 301 is used to acquire a read / write request sent by the SSD;
[0163] A first judging unit 302, used to judge whether the read / write request is a write command;
[0164] The second judgment unit 303 is used to judge whether the current super block is in a full state if the read / write request is a write command;
[0165] The allocation initialization unit 304 is used to allocate a new free super block to form the current super block and initialize the Volatile_Parity RAID Buffer if the current super block is in a full state;
[0166] The allocation and writing unit 305 is used to allocate a physical address and write user data into a target physical address;
[0167] The read XOR write unit 306 is used to read the Volatile_Parity RAID Buffer, perform XOR with the currently written data to obtain an XOR result, and then write the XOR result into the Volatile Parity Buffer;
[0168] The third judgment unit 307 is used to judge whether the User Region of the current super block is in a full state;
[0169] The composition read XOR unit 308 is used to read the user data in the current super block in sequence and perform XOR to generate NonVolatileParity according to the required RAID composition rule if the User Region of the current super block is in a full state;
[0170] The writing unit 309 is used to write the corresponding Non Volatile Parity into the physical page corresponding to the Parity Region of the current super block in sequence.
[0171] In one embodiment, the device further comprises:
[0172] The reading unit 310 is used for reading the NAND physical address storing the user data according to the read command if the read / write request is not a write command, then the read / write request is a read command, so as to obtain the user data;
[0173] The fourth determination unit 311 is used to determine whether the user data is wrong;
[0174] A fifth determination unit 312 is used to determine whether the physical block where the user data is located is in a full state if the user data is erroneous;
[0175] The first recovery unit 313 is configured to recover the data using the None Volatile Parity of the Parity Region in the super block if the physical block where the user data is located is in a full state.
[0176] In one embodiment, the device further comprises:
[0177] The second recovery unit 314 is configured to recover the data using the Volatile Parity in the current Parity Buffer if the physical block where the user data is located is not in a full state.
[0178] In one embodiment, the device further comprises:
[0179] The jump unit is used for jumping to execute the allocated physical address and writing the user data to the target physical address if the current super block is not in a full state.
[0180] It should be noted that technicians in the relevant field can clearly understand that the specific implementation process of the above-mentioned SSD storage optimization device 300 and each unit can refer to the corresponding description in the aforementioned method embodiment, and for the convenience and brevity of description, it will not be repeated here.
[0181] In one embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as follows: Figure 7 As shown. The computer device includes a processor, a memory, a network interface and a database connected via a system bus. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile and / or volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The network interface of the computer device is used to communicate with an external client via a network connection. When the computer program is executed by the processor, the server-side functions or steps of a method for optimizing SSD storage are implemented.
[0182] In one embodiment, a computer device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the following steps when executing the computer program:
[0183] Get the read / write request sent by the SSD; determine whether the read / write request is a write command; if the read / write request is a write command, determine whether the current super block is in a full state; if the current super block is in a full state, allocate a new free super block to form the current super block, and initialize the Volatile_Parity RAID Buffer; allocate a physical address and write the user data to the target physical address; read the Volatile_Parity RAID Buffer, and perform an XOR with the currently written data to obtain the XOR result, and then write the XOR result to the Volatile Parity Buffer; determine whether the User Region of the current super block is in a full state; if the UserRegion of the current super block is in a full state, read the user data in the current super block in sequence according to the required RAID composition rules, and perform an XOR to generate a NonVolatileParity; write the corresponding NonVolatile Parity in sequence to the physical page corresponding to the Parity Region of the current super block.
[0184] In one embodiment, a computer readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented:
[0185] Get the read / write request sent by the SSD; determine whether the read / write request is a write command; if the read / write request is a write command, determine whether the current super block is in a full state; if the current super block is in a full state, allocate a new free super block to form the current super block, and initialize the Volatile_Parity RAID Buffer; allocate a physical address and write the user data to the target physical address; read the Volatile_Parity RAID Buffer, and perform an XOR with the currently written data to obtain the XOR result, and then write the XOR result to the Volatile Parity Buffer; determine whether the User Region of the current super block is in a full state; if the User Region of the current super block is in a full state, read the user data in the current super block in sequence according to the required RAID composition rules, and perform an XOR to generate Non VolatileParity; write the corresponding Non Volatile Parity in sequence to the physical page corresponding to the Parity Region of the current super block.
[0186] It should be noted that the above functions or steps that can be implemented by the computer-readable storage medium or computer device can refer to the relevant descriptions on the server side and the client side in the aforementioned method embodiment. To avoid repetition, they will not be described one by one here.
[0187] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
[0188] Those skilled in the art can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example. In actual applications, the above-mentioned functions can be distributed and completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above.
[0189] The embodiments described above are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. Such modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention, and should all be included in the protection scope of the present invention.
Claims
1. A method for optimizing SSD storage, characterized in that: include: Get the read and write requests sent by the SSD; Determine whether the read / write request is a write command; If the read / write request is a write command, determine whether the current super block is in a full state; If the current super block is full, a new free super block is allocated to form the current super block, and the Volatile_Parity RAID Buffer is initialized; Assign a physical address and write user data to the target physical address; Read the Volatile_Parity RAID Buffer and perform XOR with the currently written data to obtain the XOR result, and then write the XOR result to the Volatile ParityBuffer; Determine whether the User Region of the current super block is full; If the UserRegion of the current superblock is full, the user data in the current superblock is read in sequence according to the required RAID composition rules, and XOR is performed to generate NonVolatile Parity; Write the corresponding NonVolatile Parity into the physical page corresponding to the Parity Region of the current super block in sequence.
2. The method for optimizing SSD storage according to claim 1, characterized in that: The step of determining whether the read / write request is a write command also includes: If the read / write request is not a write command, the read / write request is a read command, and the NAND physical address storing the user data is read according to the read command to obtain the user data; Determine whether the user data is wrong; If the user data is wrong, it is determined whether the physical block where the user data is located is in a full state; If the physical block where the user data is located is full, the NoneVolatile Parity of the Parity Region in the super block is used to recover the data.
3. The method for optimizing SSD storage according to claim 2, characterized in that: After the step of determining whether the physical block where the user data is located is in a full state, the method further includes: If the physical block where the user data is located is not in a full state, the VolatileParity in the current Parity Buffer is used to recover the data.
4. The method for optimizing SSD storage according to claim 1, characterized in that: After the step of determining whether the current super block is in a full state, the method further includes: If the current super block is not in a full state, the process jumps to execute the allocated physical address and writes the user data into the target physical address.
5. An SSD storage optimization device, characterized in that: include: An acquisition unit, used to acquire the read and write requests sent by the SSD; A first judging unit, used to judge whether the read / write request is a write command; A second judgment unit, configured to judge whether the current super block is in a full state if the read / write request is a write command; An allocation initialization unit is used to allocate a new free super block to form the current super block and initialize the Volatile_Parity RAID Buffer if the current super block is in a full state; An allocation and writing unit, used for allocating a physical address and writing user data into a target physical address; The read XOR write unit is used to read the Volatile_Parity RAID Buffer and perform XOR with the currently written data to obtain the XOR result, and then write the XOR result to the Volatile Parity Buffer; The third judgment unit is used to judge whether the User Region of the current super block is in a full state; A read XOR unit is used to read the user data in the current super block in sequence and perform XOR to generate NonVolatile Parity if the User Region of the current super block is full according to the required RAID composition rules; The writing unit is used to write the corresponding NonVolatile Parity into the physical page corresponding to the ParityRegion of the current super block in sequence.
6. The SSD storage optimization device according to claim 5, characterized in that: The device also includes: A reading unit, used for, if the read / write request is not a write command, then the read / write request is a read command, and reading a NAND physical address storing user data according to the read command to obtain the user data; A fourth judgment unit, used to judge whether the user data is wrong; a fifth judgment unit, configured to judge whether the physical block where the user data is located is in a full state if the user data is erroneous; The first recovery unit is used to recover the data by using the None Volatile Parity of the ParityRegion in the super block if the physical block where the user data is located is in a full state.
7. The SSD storage optimization device according to claim 6, characterized in that: The device also includes: The second recovery unit is used to recover the data by using the Volatile Parity in the current ParityBuffer if the physical block where the user data is located is not in a full state.
8. The SSD storage optimization device according to claim 5, characterized in that: The device also includes: The jump unit is used for jumping to execute the allocated physical address and writing the user data to the target physical address if the current super block is not in a full state.
9. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of the method for optimizing SSD storage as described in any one of claims 1 to 4 are implemented.
10. A storage medium, wherein the computer-readable storage medium stores a computer program, characterized in that: When the computer program is executed by a processor, the steps of the method for optimizing SSD storage as claimed in any one of claims 1 to 4 are implemented.