SSD data protection method and device, computer equipment and storage medium

By judging the XOR result of Word Line RAID in the SSD and converting it into Block RAID writing to NAND, the data write failure caused by insufficient RAM within the SSD master control is solved, and data security and write performance are improved.

CN119065889APending Publication Date: 2024-12-03SUZHOU UNIONMEMORY INFORMATION SYST LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411113159.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-14
Publication Date
2024-12-03

AI Technical Summary

Technical Problem

In the case of insufficient internal RAM of the SSD master, the unwritten striped XOR result of Word Line RAID cannot be saved, resulting in the failure to write data and the data cannot be effectively protected.

Method used

By judging whether the XOR result of the data written by Word Line RAID has passed the check. If the check fails, the subsequent written data will be converted into Block RAID and written to NAND to ensure the security of the data.

Benefits of technology

In the case of insufficient internal RAM of the SSD master, the risk of data loss is reduced, and data security and write performance are improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119065889A_ABST
    Figure CN119065889A_ABST
Patent Text Reader

Abstract

The invention relates to an SSD data protection method and device, computer equipment and a storage medium, and the method comprises the following steps: obtaining a write command issued by a host, and preparing to-be-written data; writing the data into a Word Line RAID (Redundant Array of Independent Disks); judging whether the XOR result of the written data of the Word Line RAID passes the check or not; and if the XOR result of the data written into the Word Line RAID does not pass the check, converting the data subsequently written into the Word Line RAID into a Block RAID, and writing the Block RAID into an NAND. According to the method, whether the XOR result of the data written into the Word Line RAID passes the check or not is judged, and if the XOR result of the data written into the Word Line RAID does not pass the check, the data subsequently written into the Word Line RAID is converted into the Block RAID, so that the data is protected under the condition that an internal RAM (Random Access Memory) of an SSD (Solid State Disk) master control is insufficient, the risk of data loss is reduced, and the security of the data is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of solid-state storage devices, and in particular to SSD data protection methods, devices, computer equipment and storage media. Background Art

[0002] As a new type of storage medium, SSD (Solid State Drive) uses NAND particles as data storage and has been widely used in mainstream application products in various fields such as PCs, notebooks, and servers. In order to strengthen the protection of user data, SSD usually organizes RAID (Redundant Array of Independent Disk) internally. The two commonly used ways to organize RAID are Block RAID and Word Line RAID. The characteristic of Word Line RAID is that multiple stripes are in an unfinished state at the same time. When the internal RAM of the SSD master controller is insufficient, the XOR result of the written data of some unfinished stripes cannot be saved to the internal RAM of the SSD master controller, resulting in the need to restore the XOR result of the unfinished stripe when the stripe starts to be written again. The XOR result fails to be restored due to the NAND read failure, resulting in the corresponding stripe being unable to write the correct Pari ty, so that the data cannot be protected by Word Line RAID. Summary of the invention

[0003] The purpose of the present invention is to overcome the deficiencies of the prior art and provide an SSD data protection method, device, computer equipment and storage medium.

[0004] In order to solve the above technical problems, the present invention adopts the following technical solutions:

[0005] The present invention is achieved through the following technical solutions:

[0006] In the first aspect, this embodiment provides a

[0007] The SSD data protection method includes the following steps:

[0008] Get the write command sent by the host and prepare the data to be written;

[0009] Writing the data into the Word Line RAID;

[0010] Determine whether the XOR result of the data written to the Word Line RAID passes the inspection;

[0011] If the XOR result of the data written into the Word Line RAID fails the check, the data subsequently written into the Word Line RAID is converted into Block RAID and written into NAND.

[0012] Further, the step of determining whether the XOR result of the data written into the Word Line RAID passes the inspection includes:

[0013] Based on the status mark of the Word Line RAID, determining whether the Word Line RAID has completed data writing;

[0014] If the Word Line RAID has not completed data writing, reading the data written into the Word Line RAID to obtain a data block;

[0015] The XOR check value calculated for the data block is used as a first XOR check value;

[0016] Reading the XOR check value stored in the Word Line RAID as a second XOR check value;

[0017] Matching the first XOR check value and the second XOR check value;

[0018] If the first XOR check value does not match the second XOR check value, the XOR result of the data written into the Word LineRAID fails the check.

[0019] Furthermore, the step of converting the data subsequently written into the Word Line RAID into Block RAID and writing the data into NAND includes:

[0020] Identify data to be written;

[0021] Using the XOR check value of the data to be written as a third XOR check value;

[0022] Based on the third XOR check value, determining whether the data to be written into the Word Line RAID can be directly written into the NAND;

[0023] If the data to be written cannot be directly written into NAND;

[0024] The String corresponding to the third XOR check value is converted into Block RAID and written into NAND.

[0025] Further, the step of judging whether the data to be written into the Word LineRAID can be directly written into the NAND based on the third XOR check value includes:

[0026] Reading the XOR check value stored in the Word Line RAID, that is, the fourth XOR check value;

[0027] Matching the third XOR check value and the fourth XOR check value;

[0028] If the third XOR check value matches the fourth XOR check value, the data to be written into the WordLine RAID can be directly written into the NAND.

[0029] Furthermore, the step of converting the String corresponding to the third XOR check value into Block RAID and writing it into NAND includes:

[0030] Divide the String corresponding to the third XOR check value into multiple Planes;

[0031] Calculate the XOR check value of each Plane;

[0032] Write the XOR check value of each Plane into the last Plane of the String;

[0033] Integrate all Planes into Block RAID;

[0034] The Block RAID is written to NAND.

[0035] Furthermore, after converting the String corresponding to the third XOR check value into Block RAID and writing it into NAND, the following steps are also included:

[0036] Reading the data written into the NAND and verifying it;

[0037] If the verification passes, the data written to the NAND is marked as new.

[0038] Further, after determining whether the XOR result of the data written into the Word Line RAID passes the inspection, the method further includes:

[0039] If the XOR result of the data written to the Word Line RAID passes the check, then continue to write data to the Word Line RAID.

[0040] In a second aspect, this embodiment provides an SSD data protection device, including: an acquisition unit, a writing unit, a judgment unit, and an execution unit;

[0041] The acquisition unit is used to acquire a write command sent by the host and prepare data to be written;

[0042] The writing unit is used to write the data into the Word Line RAID;

[0043] The judging unit is used to judge whether the XOR result of the data written into the Word Line RAID passes the inspection;

[0044] The execution unit is used to convert the data subsequently written into the Word Line RAID into BlockRAID and write the data into NAND.

[0045] In a third aspect, this embodiment provides a computer device, which includes a memory and a processor, wherein a computer program is stored on the processor, and when the processor executes the computer program, the SSD data protection method as described above is implemented.

[0046] In a fourth aspect, the present embodiment provides a storage medium, wherein the storage medium stores a computer program, wherein the computer program includes program instructions, and when the program instructions are executed by a processor, the SSD data protection method as described above can be implemented.

[0047] Compared with the prior art, the beneficial effect of the present invention is as follows: by judging whether the XOR result of the data written to the Word Line RAID passes the check, if the XOR result of the data written to the Word Line RAID fails the check, the data subsequently written to the Word Line RAID is converted into the Block RAID, so that the data can be protected when the internal RAM of the SSD master controller is insufficient, the risk of data loss is reduced, and the security of the data is improved.

[0048] The above description is only an overview of the technical solution of the present invention. In order to more clearly understand the technical means of the present invention, it can be implemented in accordance with the contents of the specification. In order to make the above and other purposes, features and advantages of the present invention more obvious and easy to understand, the following preferred embodiments are specifically cited and described in detail as follows. BRIEF DESCRIPTION OF THE DRAWINGS

[0049] Figure 1 A schematic diagram of a flow chart of an SSD data protection method provided by an embodiment of the present invention;

[0050] Figure 2 A schematic diagram of a flow chart of executing step S3 in the SSD data protection method provided in an embodiment of the present invention;

[0051] Figure 3 A schematic diagram of a flow chart of executing step S5 in the SSD data protection method provided in an embodiment of the present invention;

[0052] Figure 4 A schematic diagram of a flow chart of executing step S53 in the SSD data protection method provided in an embodiment of the present invention;

[0053] Figure 5 A schematic diagram of a flow chart of executing step S54 in the SSD data protection method provided in an embodiment of the present invention;

[0054] Figure 6 A schematic block diagram of an SSD data protection device provided by an embodiment of the present invention;

[0055] Figure 7 A schematic block diagram of a computer device provided in an embodiment of the present invention. DETAILED DESCRIPTION

[0056] 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.

[0057] 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.

[0058] 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.

[0059] 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.

[0060] See also Figure 1 In the specific embodiment shown, the present invention discloses a SSD data protection method, comprising the following steps:

[0061] Step S1, obtaining a write command issued by the host and preparing data to be written;

[0062] Specifically, the host sends a write command to the SSD through the storage interface. After receiving the command, the SSD master controller processes the command to determine the starting address, write length, and other related parameters of the data to be written. Based on the relevant parameters of the write command, the SSD master controller allocates the data to be written to a specific NAND Flash chip and a specific storage block.

[0063] It should be noted that after the SSD master receives the write command, it will cache the data sent by the host into the DRAM or internal cache of the master chip to ensure that the data is ready before executing the write command. When preparing to write data, the SSD master will perform error detection and XOR check value calculation to ensure that errors can be corrected in time when data is written to the NAND memory.

[0064] Through the above steps, the SSD master controller can prepare the data to be written according to the write command issued by the host, ensuring that the data can be stored in the NAND memory.

[0065] Step S2, writing the data into Word Line RAID;

[0066] Specifically, before writing data to the Word Line RAID, the SSD master controller will first divide the data to be written into multiple data blocks (chunks) and allocate each data block to a corresponding Word Line. The size of each data block usually matches the page size of the NAND Flash.

[0067] It should be noted that before writing the data block to the Word Line, the SSD master will perform XOR calculation to generate a check block, which is written into the Word Line together with the data block. The Word Line RAID uses the parallel characteristics of multiple NAND Flash chips to write the data block to the Word Line of multiple chips at the same time, and the written data is distributed to different stripes. Each stripe contains several data blocks and one or more check blocks (Parity Block), and the check block is used for data protection.

[0068] Through the above steps, the SSD master controller can write data into the Word Line RAID and generate a check block through XOR calculation to ensure the integrity and consistency of the data, improve the data writing efficiency, and provide data protection through the check block.

[0069] Step S3, determining whether the XOR result of the data written into the Word Line RAID passes the inspection;

[0070] Specifically, multiple written data blocks and corresponding check blocks are read, an exclusive OR (XOR) operation is performed on all the read data blocks, a new calculation check block is generated according to the XOR result obtained for the read data blocks, and the generated calculation check block is compared with the actual check block read from the NAND Flash.

[0071] It should be noted that the XOR operation is a bit operation that adds the bits of multiple data blocks one by one (without carry) to generate a new check value.

[0072] Through the above steps, the SSD master controller checks the XOR result of the data written to the Word Line RAID to ensure the integrity and consistency of the data and ensure the security of the data during the writing process.

[0073] Step S4: if the XOR result of the data written into the Word Line RAID fails the check, the data subsequently written into the Word Line RAID is converted into Block RAID and written into NAND.

[0074] Specifically, when the SSD master performs XOR verification on data, if the XOR result is inconsistent with the actual verification block, an error occurs during data writing, triggering the mode switching mechanism to switch subsequent data from Word LineRAID mode to Block RAID mode to write to NAND.

[0075] Through the above steps, when the Word Line RAID data XOR result SSD master control fails to pass the inspection, it switches to Block RAID mode and reallocates and writes subsequent data according to the Block RAID structure, thereby enhancing the security and integrity of data storage.

[0076] Through steps S1 to S4, it is determined whether the XOR result of the data written to the Word Line RAID passes the check. If the XOR result of the data written to the Word Line RAID fails the check, the data subsequently written to the Word Line RAID is converted into Block RAID, so that data can be protected when the internal RAM of the SSD master controller is insufficient, the risk of data loss is reduced, and the security of data is improved.

[0077] In one embodiment, see Figure 1 , after determining whether the XOR result of the data written to the Word Line RAID passes the inspection, it also includes:

[0078] Step S5: If the XOR result of the data written into the Word Line RAID passes the check, continue to write data into the Word Line RAID.

[0079] Through step S5, when the data verification of the Word Line RAID passes, data can continue to be written in the Word Line RAID mode to maintain data integrity and consistency. The SSD master control can improve the write performance of the SSD while ensuring data reliability, avoiding data loss or damage during the storage process.

[0080] In one embodiment, see Figure 1 After converting the String corresponding to the third XOR check value into Block RAID and writing it into NAND, the following steps are also included:

[0081] Step S6, reading the data written into the NAND and verifying it;

[0082] Step S7: if the verification passes, the data written into the NAND is marked as new.

[0083] Through step S4, step S6 and step S7, the SSD master controller can maximize the writing performance while ensuring data reliability, and ensure the integrity and consistency of the data in the entire writing process through a multi-level verification mechanism.

[0084] See also Figure 2 The step of judging whether the XOR result of the data written into the Word Line RAID passes the inspection comprises:

[0085] Step S31, judging whether the Word Line RAID has completed data writing based on the status mark of the Word Line RAID;

[0086] Specifically, the state mark of the Word Line RAID is checked to determine whether the data writing has been completed. The state mark is usually a flag bit or a state variable, which is used to indicate whether the current Word Line RAID is in a write completion state.

[0087] Step S32: if the Word Line RAID has not completed data writing, then read the data written into the Word Line RAID to obtain a data block;

[0088] Step S33, using the XOR check value calculated for the data block as a first XOR check value;

[0089] Step S34, reading the XOR check value stored in the Word Line RAID as a second XOR check value;

[0090] Step S35, matching the first XOR check value and the second XOR check value;

[0091] Step S36: If the first XOR check value does not match the second XOR check value, the XOR result of the data written to the WordLine RAID fails the check.

[0092] Through steps S31 to S36, a detailed multi-step check mechanism is used to perform an independent XOR check on each data block to ensure that the data maintains integrity during the writing process. By comparing the XOR check values, errors that occur during the data writing process can be detected, improving the reliability of data storage. When a mismatch in the XOR result is detected, the subsequent written data is converted from Word Line RAID to Block RAID and written to NAND, ensuring that timely measures can be taken to protect data when an error is found to avoid data loss or damage.

[0093] In one embodiment, see Figure 3 The step of converting the data subsequently written into the Word Line RAID into Block RAID and writing the data into NAND comprises:

[0094] Step S51, identifying data to be written;

[0095] Step S52, using the XOR check value of the data to be written as a third XOR check value;

[0096] Step S53, based on the third XOR check value, determining whether the data to be written into the Word Line RAID can be directly written into the NAND;

[0097] Step S54: if the data to be written cannot be directly written into NAND, convert the String corresponding to the third XOR check value into Block RAID and write it into NAND.

[0098] Through steps S51 to S54, the integrity and consistency of the data to be written before writing to NAND are ensured by matching and verifying the XOR check value, avoiding the phenomenon of erroneous data being directly written to NAND, and reducing the wear of NAND flash memory. If the check fails, the data is converted into Block RAID for processing, which improves the ability of the SSD master to deal with abnormal data writing.

[0099] In one embodiment, see Figure 4The step of judging whether the data to be written into the Word Line RAID can be directly written into the NAND based on the third XOR check value comprises:

[0100] Step S531, reading the XOR check value stored in the Word Line RAID, that is, the fourth XOR check value;

[0101] Step S532, matching the third XOR check value with the fourth XOR check value;

[0102] Step S533: If the third XOR check value matches the fourth XOR check value, the data to be written in the Word Line RAID can be directly written into the NAND.

[0103] Through step S531 to step S533, by matching the third XOR check value and the fourth XOR check value, the consistency of the data to be written can be quickly determined, thereby determining whether it can be directly written to NAND, thereby improving the overall data writing efficiency. The integrity and consistency of the data before and after writing are ensured by matching the third XOR check value and the fourth XOR check value. The data will be written to NAND only if the data verification passes, thereby reducing the risk of data damage or loss.

[0104] In one embodiment, see Figure 5 The step of converting the String corresponding to the third XOR check value into Block RAID and writing it into NAND includes:

[0105] Step S541, dividing the String corresponding to the third XOR check value into multiple Planes;

[0106] It should be noted that the String (data set) containing the third XOR check value is divided into multiple Planes. Plane is one of the basic units of data storage in NAND Flash. Usually, a Page can be divided into multiple Planes. Dividing the String into multiple Planes and calculating the XOR check value separately refines the data protection granularity, improves the accuracy and reliability of data verification, and can quickly correct the error when a data error occurs.

[0107] Step S542, calculating the XOR check value of each Plane;

[0108] Step S543, writing the XOR check value of each Plane into the last Plane of the String;

[0109] Step S544, integrating all Planes into Block RAID;

[0110] Step S545: write the Block RAID into NAND.

[0111] Through steps S541 to S545, data integrity and reliability are enhanced, data storage and verification efficiency is optimized, and the XOR check value of each divided Plane is calculated separately to ensure data integrity verification in a smaller storage unit, thereby improving data protection capabilities. The calculated XOR check value of each Plane is written into the last Plane of the String. Centrally store verification information to facilitate data verification and recovery. Block RAID data blocks are used for data distribution and redundancy protection to improve the reliability and consistency of data storage.

[0112] Please refer to 6, the present invention also discloses an SSD data protection device, including: an acquisition unit 10, a writing unit 20, a judgment unit 30 and an execution unit 40;

[0113] The acquisition unit is used to acquire a write command sent by the host and prepare data to be written;

[0114] The writing unit is used to write the data into the Word Line RAID;

[0115] The judging unit is used to judge whether the XOR result of the data written into the Word Line RAID passes the inspection;

[0116] The execution unit is used to convert the data subsequently written into the Word Line RAID into BlockRAID and write the data into NAND.

[0117] It should be noted that those skilled in the art can clearly understand that the specific implementation process of the above-mentioned SSD data protection device and each unit can refer to the corresponding description in the above-mentioned method embodiment, and for the convenience and simplicity of description, it will not be repeated here.

[0118] The above can be implemented in the form of a computer program, which can be used in Figure 7 Runs on the computer device shown.

[0119] See also Figure 7 , Figure 7 is a schematic block diagram of a computer device provided in an embodiment of the present application; the computer device 500 may be a terminal or a server, wherein the terminal may be an electronic device with communication functions such as a smart phone, a tablet computer, a laptop computer, a desktop computer, a personal digital assistant, and a wearable device. The server may be an independent server or a server cluster composed of multiple servers.

[0120] See also Figure 7 The computer device 500 includes a processor 502 , a memory and a network interface 505 connected via a system bus 501 , wherein the memory may include a non-volatile storage medium 503 and an internal memory 504 .

[0121] The non-volatile storage medium 503 can store an operating system 5031 and a computer program 5032. The computer program 5032 includes program instructions, which, when executed, can cause the processor 502 to execute the SSD data protection method: obtain a write command issued by a host, prepare data to be written; write the data into the Word Line RAID; determine whether the XOR result of the data written into the Word Line RAID passes the check; if the XOR result of the data written into the Word Line RAID fails the check, convert the data subsequently written into the Word Line RAID into Block RAID and write it into NAND.

[0122] The processor 502 is used to provide computing and control capabilities to support the operation of the entire computer device 500 .

[0123] The internal memory 504 provides an environment for the operation of the computer program 5032 in the non-volatile storage medium 503. When the computer program 5032 is executed by the processor 502, the processor 502 can execute a method for optimizing the write performance of the solid state drive.

[0124] The network interface 505 is used to communicate with other devices over the network. Figure 7 The structure shown in the figure is merely a block diagram of a portion of the structure related to the solution of the present application, and does not constitute a limitation on the computer device 500 to which the solution of the present application is applied. The specific computer device 500 may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0125] The processor 502 is used to run the computer program 5032 stored in the memory to implement the following steps:

[0126] Step S1, obtaining a write command issued by the host and preparing data to be written;

[0127] Step S2, writing the data into Word Line RAID;

[0128] Step S3, determining whether the XOR result of the data written into the Word Line RAID passes the inspection;

[0129] Step S4: if the XOR result of the data written into the Word Line RAID fails the check, the data subsequently written into the Word Line RAID is converted into Block RAID and written into NAND.

[0130] It should be understood that in the embodiment of the present application, the processor 502 may be a central processing unit (CPU), and the processor 502 may also be other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. Among them, the general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.

[0131] It can be understood by those skilled in the art that all or part of the processes in the method for implementing the above embodiment can be completed by instructing the relevant hardware through a computer program. The computer program includes program instructions, and the computer program can be stored in a storage medium, which is a computer-readable storage medium. The program instructions are executed by at least one processor in the computer system to implement the process steps of the embodiment of the above method.

[0132] Therefore, the present invention also provides a storage medium. The storage medium may be a computer-readable storage medium. The storage medium stores a computer program, wherein the computer program includes program instructions, and the program instructions can implement the above-mentioned SSD data protection method when executed by a processor. The storage medium stores a computer program, wherein the computer program includes program instructions, and the program instructions can implement the above-mentioned method when executed by a processor. The program instructions include the following steps:

[0133] Step S1, obtaining a write command issued by the host and preparing data to be written;

[0134] Step S2, writing the data into Word Line RAID;

[0135] Step S3, determining whether the XOR result of the data written into the Word Line RAID passes the inspection;

[0136] Step S4: if the XOR result of the data written into the Word Line RAID fails the check, the data subsequently written into the Word Line RAID is converted into Block RAID and written into NAND.

[0137] The storage medium may be a USB flash drive, a mobile hard disk, a read-only memory (ROM), a magnetic disk, or an optical disk, etc., which are computer-readable storage media that can store program codes.

[0138] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in terms of function in the above description. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.

[0139] In the several embodiments provided by the present invention, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of each unit is only a logical function division, and there may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed.

[0140] The steps in the method of the embodiment of the present invention can be adjusted in order, combined and deleted according to actual needs. The units in the device of the embodiment of the present invention can be combined, divided and deleted according to actual needs. In addition, the functional units in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.

[0141] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a storage medium. Based on this understanding, the technical solution of the present invention is essentially or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, terminal, or network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention.

[0142] The above embodiments are preferred implementation schemes of the present invention. In addition, the present invention may also be implemented in other ways. Any obvious replacement without departing from the concept of the present technical solution is within the protection scope of the present invention.

Claims

1. A method for protecting SSD data, characterized in that: The following steps are involved: Get the write command sent by the host and prepare the data to be written; Writing the data into the Word Line RAID; Determine whether the XOR result of the data written to the Word Line RAID passes the inspection; If the XOR result of the data written into the Word Line RAID fails the check, the data subsequently written into the Word Line RAID is converted into Block RAID and written into NAND.

2. The SSD data protection method according to claim 1, characterized in that: The step of judging whether the XOR result of the data written into the Word LineRAID passes the inspection comprises: Based on the status mark of the Word Line RAID, determining whether the Word Line RAID has completed data writing; If the Word Line RAID has not completed data writing, reading the data written into the Word Line RAID to obtain a data block; The XOR check value calculated for the data block is used as a first XOR check value; Reading the XOR check value stored in the Word Line RAID as a second XOR check value; Matching the first XOR check value and the second XOR check value; If the first XOR check value does not match the second XOR check value, the XOR result of the data written to the Word Line RAID fails the check.

3. The SSD data protection method according to claim 1, characterized in that: The step of converting the data subsequently written into the WordLine RAID into Block RAID and writing the data into NAND comprises: Identify data to be written; Using the XOR check value of the data to be written as a third XOR check value; Based on the third XOR check value, determining whether the data to be written into the Word Line RAID can be directly written into the NAND; If the data to be written cannot be directly written into NAND, the String corresponding to the third XOR check value is converted into Block RAID and written into NAND.

4. The SSD data protection method according to claim 3, characterized in that: The step of judging whether the data to be written into the Word Line RAID can be directly written into the NAND based on the third XOR check value comprises: Reading the XOR check value stored in the Word Line RAID, that is, the fourth XOR check value; Matching the third XOR check value and the fourth XOR check value; If the third XOR check value matches the fourth XOR check value, the data to be written in the WordLine RAID can be directly written into the NAND.

5. The SSD data protection method according to claim 3, characterized in that: The step of converting the String corresponding to the third XOR check value into Block RAID and writing the String into NAND comprises: Divide the String corresponding to the third XOR check value into multiple Planes; Calculate the XOR check value of each Plane; Write the XOR check value of each Plane into the last Plane of the String; Integrate all Planes into Block RAID; The Block RAID is written to NAND.

6. The SSD data protection method according to claim 1, characterized in that: After converting the String corresponding to the third XOR check value into Block RAID and writing it into NAND, the following steps are also included: Reading the data written into the NAND and verifying it; If the verification passes, the data written to the NAND is marked as new.

7. The SSD data protection method according to claim 1, characterized in that: After determining whether the XOR result of the data written to the Word LineRAID passes the inspection, the method further includes: If the XOR result of the data written into the Word Line RAID passes the check, data continues to be written into the Word Line RAID.

8. The SSD data protection device is characterized by: include: An acquisition unit, a writing unit, a judgment unit and an execution unit; The acquisition unit is used to acquire a write command sent by the host and prepare data to be written; The writing unit is used to write the data into the Word Line RAID; The judging unit is used to judge whether the XOR result of the data written into the Word Line RAID passes the inspection; The execution unit is used to convert the data subsequently written into the Word Line RAID into Block RAID and write the data into NAND.

9. A computer device, characterized in that: The computer device includes a memory and a processor, a computer program is stored on the processor, and the processor implements the SSD data protection method according to any one of claims 1 to 7 when executing the computer program.

10. A storage medium, characterized in that: The storage medium stores a computer program, wherein the computer program includes program instructions, and when the program instructions are executed by a processor, the SSD data protection method according to any one of claims 1 to 7 can be implemented.