Data management method, electronic equipment and storage medium
By preset codeword size arrangement for writing data, deletion of recoverable data and using blank space for data management, the problem of difficult adjustment of codeword data in storage devices is solved, and flexible response to storage requirements and data storage is achieved Improved reliability.
Patent Information
- Application Number
- CN202310991416.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-08-07
- Publication Date
- 2025-02-14
- Estimated Expiration
- 2043-08-07
AI Technical Summary
The storage of data to be written cannot achieve additional storage requirements, mainly because the codeword data with fixed structure is difficult to adjust.
By obtaining the data to be written, arranging based on the preset size of the codeword, deleting the recoverable data in each codeword data to expand the empty space, and using the empty space for data management, and finally writing the managed codeword data Enter the storage device.
By expanding the blank space, improving the adjustability of codeword data, flexible adjustment of storage requirements can be achieved, and the reliability and efficiency of data storage are improved.
Smart Images

Figure CN119440901A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of storage technology, and in particular to a data management method, electronic device and storage medium. Background Art
[0002] SSD (Solid State Disk or Solid State Drive) uses NAND flash media to store data.
[0003] When the data to be written needs to be stored in the NAND flash memory medium of the SSD solid state drive, the data to be written will be arranged in codewords based on the relevant rules of the SSD solid state drive, and the structure of the arranged codeword data is fixed. During the storage process of the data to be written, the data to be written will often be adjusted based on actual needs.
[0004] However, the codeword data with a fixed structure is difficult to adjust, making it impossible to meet the corresponding storage requirements. Summary of the invention
[0005] The main technical problem solved by the present application is to provide a data management method, an electronic device and a storage medium to solve the problem that the storage of data to be written cannot meet the additional storage requirements.
[0006] In order to solve the above problems, the present application provides a data management method, including acquiring data to be written, arranging the data to be written based on a preset size of a codeword, and obtaining codeword data of multiple preset sizes; deleting recoverable data in each codeword data to expand the blank space of each codeword data; using the blank space to manage data, and writing each codeword data after data management to a storage device.
[0007] Among them, the steps of using blank space for data management and writing each code word data after data management to a storage device include: verifying each code word data separately to obtain multiple verification information, storing each verification information in the blank space of the corresponding code word data respectively to obtain multiple verified code word data; and writing multiple verified code word data to a storage device.
[0008] Among them, each codeword data includes user data and metadata, and each metadata includes protection information; the step of deleting the recoverable data in each codeword data to expand the blank space of each codeword data includes: deleting the recoverable part of the protection data in each metadata to expand the blank space of each codeword data.
[0009] Among them, the step of obtaining the data to be written, arranging the data to be written based on the preset size of the codeword, and obtaining multiple codeword data of preset sizes also includes: determining the format type of recoverable data in the data to be written; deleting the recoverable partial protection data in each metadata to expand the blank space of each codeword data includes: deleting the recoverable partial protection data in each metadata based on the format type of the recoverable data to expand the blank space of each codeword data.
[0010] Among them, the step of deleting the recoverable part of the protection data in each metadata to expand the blank space of each code word data includes: verifying the metadata in each code word data; when the metadata verification is successful, deleting the recoverable part of the protection data in each metadata to expand the blank space of each code word data, and adjusting the positional relationship between the deleted metadata and the corresponding user data to unify the format of the code word data.
[0011] Among them, each protection information includes verification protection data, application data and reference data respectively; the step of deleting the recoverable part of the protection data in each metadata includes: in response to the logical block size of the data to be written being the same as the preset size, deleting the verification protection data of the protection information in each metadata; in response to the logical block size of the data to be written being different from the preset size, deleting the verification protection data of the protection information in each metadata and part of the reference data of the protection information in each metadata, so as to retain at least one reference data in multiple metadata.
[0012] Among them, the steps of verifying each code word data separately to obtain multiple verification information include: performing randomization processing and first verification processing on each code word data in turn to obtain a first verification code for each code word data; performing a second verification processing on each code word data to obtain a second verification code for each code word data; and determining the first verification code and the second verification code as verification information.
[0013] The data management method further includes: obtaining verified code word data from a storage device; completing the verified code word data to obtain each code word data, so as to read each code word data.
[0014] Among them, the check protection data of each code word data is obtained by performing a first check processing on the user data of the corresponding code word data; the steps of completing the checked code word data to obtain each code word data, and reading each code word data include: performing a first check processing on the user data of each code word data to obtain the check protection data of each code word data; and using at least one reference data among the retained multiple metadata to calculate each reference data in the multiple metadata to obtain the reference data of each metadata; completing each checked code word data using each check protection data and the reference data of each metadata to restore each code word data, so as to read each code word data.
[0015] To solve the above technical problems, the present invention further provides an electronic device, comprising a memory and a processor coupled to each other, wherein the processor is used to execute program instructions stored in the memory to implement any of the data management methods described above.
[0016] In order to solve the above technical problems, the present invention further provides a computer-readable storage medium on which program instructions are stored, and when the program instructions are executed by a processor, the data management method as described in any one of the above items is implemented.
[0017] The beneficial effects of the present invention are as follows: different from the prior art, the present application arranges the data to be written based on the preset size of the codeword to obtain codeword data of multiple preset sizes; deletes the recoverable data in each codeword data to expand the blank space of each codeword data, and then uses the blank space for data management, and writes each codeword data after data management to a storage device, thereby being able to utilize the expansion of the blank space to improve the adjustability of the codeword data, and facilitating the use of the blank space to adjust the codeword data based on storage requirements to achieve corresponding storage requirements. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] Figure 1 It is a flowchart of an embodiment of the method for managing application data;
[0019] Figure 2 It is a flowchart of another embodiment of the method for managing application data;
[0020] Figure 3 is a schematic diagram of data flow in an implementation method of data writing;
[0021] Figure 4 It is a structural schematic diagram of an implementation method of data to be written;
[0022] Figure 5 is a structural schematic diagram of another implementation method of data to be written;
[0023] Figure 6 is a schematic structural diagram of a first implementation method for protecting data;
[0024] Figure 7 is a schematic structural diagram of a second implementation method for protecting data;
[0025] Figure 8 is a schematic structural diagram of a third implementation method for protecting data;
[0026] Fig. 9 It is a structural schematic diagram of a codeword implementation method;
[0027] Fig.10 It is a specific structural schematic diagram of an implementation method of code word data;
[0028] Fig.11 is a schematic diagram of an implementation method of recoverable data deletion;
[0029] Fig.12 is a flow chart of an embodiment of reading codeword data;
[0030] Fig.13 is a schematic diagram of data trend in an implementation method of reading data;
[0031] Fig.14 It is a schematic diagram of the framework of an embodiment of the electronic device of the present application;
[0032] Fig.15 A schematic diagram of a framework of an embodiment of a computer-readable storage medium of the present application. DETAILED DESCRIPTION
[0033] The scheme of the embodiment of the present application is described in detail below in conjunction with the drawings of the specification.
[0034] In the following description, for the purpose of explanation rather than limitation, specific details such as specific system structures, interfaces, and technologies are provided to facilitate a thorough understanding of the present application.
[0035] The terms "system" and "network" are often used interchangeably in this article. The term "and / or" in this article is only a description of the association relationship of associated objects, indicating that there can be three relationships. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in this article generally indicates that the associated objects before and after are in an "or" relationship. In addition, "many" in this article means two or more than two.
[0036] See also Figure 1 , Figure 1 1 is a flow chart of an embodiment of a data management method of the present application. The data management method in this embodiment specifically includes the following steps:
[0037] Step S11: Acquire the data to be written, and arrange the data to be written based on the preset size of the codeword to obtain a plurality of codeword data of the preset size.
[0038] This embodiment can be applied to the process of writing the data to be written by the host into the storage device. The host may include a host device such as a PC, a camera, a game console, a video recorder or a mobile terminal. The storage device may include a solid state hard disk or other storage device with Nand Flash as the storage medium.
[0039] After the data to be written is obtained, the data to be written is arranged based on the preset size of the codeword to obtain codeword data of multiple preset sizes. The preset size of the codeword can be based on the specific storage device type and / or the type of verification algorithm. For example: the data in the storage device will be arranged according to the LDPC Code Word size to obtain codeword data of a preset size, so that it can be convenient for the verification algorithm to perform verification and for storage of the storage device.
[0040] In a specific application scenario, for 16KB page size NAND, the current common code word size is 4KB+. In another specific application scenario, there are also solid-state drives that can support 16KB+ code words. The preset size of the code word is not limited here, but the sizes of the multiple code word data after arrangement are the same and fixed, and are all preset sizes.
[0041] Step S12: deleting the recoverable data in each code word data to expand the blank space of each code word data.
[0042] In a code word data, when certain data can be calculated based on inherent rules, it means that these data can be recovered using the inherent rules, and these data are determined to be recoverable data. By deleting the recoverable data, the blank space of each code word data can be expanded.
[0043] After deleting the recoverable data in each code word data in this step, the blank space of each code word data can be expanded, and data loss in the code word data can be prevented. Since the size of each code word data is fixed to a preset size, the above deletion method can make more blank space available for storing subsequent verification information, and the more verification information used to store the verification algorithm in the code word data, the stronger the error correction capability of the corresponding verification algorithm.
[0044] Step S13: Use the blank space to perform data management, and write each codeword data after data management into the storage device.
[0045] After the blank space of each codeword data is expanded, the blank space can be used for data management, for example, storing related data in the blank space based on actual needs to meet the needs.
[0046] In a specific application scenario, attribute information such as the unit information, type information, and generation time information of the data to be written may be written into the blank space to facilitate subsequent storage of the codeword data based on the relevant attribute information.
[0047] In a specific application scenario, the verification information may also be stored in the blank space to improve the error determination capability of the codeword data and improve the reliability of data storage.
[0048] The specific utilization method of blank space can be set based on actual needs.
[0049] Through the above steps, the data management method of this embodiment arranges the data to be written based on the preset size of the codeword to obtain multiple codeword data of preset sizes; deletes the recoverable data in each codeword data to expand the blank space of each codeword data, and then uses the blank space for data management, and writes each codeword data after data management to a storage device, thereby being able to utilize the expansion of the blank space to improve the adjustability of the codeword data, and facilitating the use of the blank space to adjust the codeword data based on storage requirements to achieve corresponding storage requirements.
[0050] In other embodiments, the step of using blank space for data management may specifically include verifying each code word data separately to obtain multiple verification information, storing each verification information in the blank space of the corresponding code word data respectively to obtain multiple verified code word data; and writing the multiple verified code word data to a storage device.
[0051] After deleting the recoverable data in each code word data, each code word data is verified to obtain multiple verification information. Each code word data corresponds to a verification information, so that the error judgment and data recovery of the code word data can be performed through the verification information to improve the reliability of data storage.
[0052] In a specific application scenario, the verification algorithm of this step may include LDPC verification, and LDPC Parity verification information is obtained by performing LDPC verification on each codeword data. In another specific application scenario, the verification algorithm of this step may include CRC verification and LDPC verification, and CRC verification is first performed on each codeword data to obtain CRC verification information, and then LDPC verification is performed on each codeword data to obtain LDPC Parity verification information, and the CRC verification information and LDPC Parity verification information are combined to obtain the verification information corresponding to each codeword data. The specific steps of verifying each codeword data separately are not limited here.
[0053] Each verification information is stored in the blank space of the corresponding code word data to obtain a plurality of verified code word data.
[0054] Since the recoverable information is deleted from the aforementioned codeword data, a larger blank space is freed up, so that more blank space can be used to store the check information, and the more the codeword data is used to store the check information, the stronger its error correction capability is. Therefore, the above method improves the error correction capability of the check algorithm, thereby improving the reliability of the data.
[0055] The multiple verified code word data are written into the storage device to complete the writing of the data to be written.
[0056] After expanding the blank space of each code word data, each code word data is verified respectively to obtain multiple verification information, and each verification information is stored in the blank space of the corresponding code word data to obtain multiple verified code word data, and finally the multiple verified code word data are written to the storage device, thereby deleting the recoverable data in each code word data, so that subsequent verification information can have more blank space for storage, thereby utilizing the expansion of the blank space to increase the proportion of the verification information in the corresponding code word data, and realizing the improvement of the error correction capability of the verification algorithm, thereby improving the reliability of the data in the storage device. And deleting the recoverable data can not only expand the blank space of each code word data, but also prevent the loss of other data in the code word data, further ensuring the reliability of each code word data.
[0057] See also Figure 2 , Figure 2 1 is a flow chart of another embodiment of the data management method of the present application. The data management method in this embodiment specifically includes the following steps:
[0058] Step S21: Acquire the data to be written, and determine the format type of recoverable data in the data to be written.
[0059] This embodiment can be applied to the process of writing the data to be written by the host into the storage device. The host may include a host device such as a PC, a camera, a game console, a video recorder, a mobile terminal, etc. The storage device includes a solid state hard disk or other storage device with Nand Flash as the storage medium.
[0060] See also Figure 3 , Figure 3 The figure is a schematic diagram of data flow in an implementation method of data writing.
[0061] This embodiment writes the data to be written in the host 31 into the solid state drive 32. In the data writing process, the solid state drive 32 uses the front-end interface 33, the memory 34, the adjustment module 35, the LDPC engine 36 and the NAND array 37. The LDPC engine 36 uses a scrambler 361, a CRC check 364 and an encoder 362.
[0062] The host 31 is connected to the front-end interface 33, and the front-end interface 33, memory 34, adjustment module 35, scrambler 361, encoder 362 and NAND array 37 in the solid state drive 32 are connected in sequence. A controller (not shown) is also provided in the solid state drive 32, and the controller is respectively connected to the front-end interface 33, memory 34, adjustment module 35, LDPC engine 36 and NAND array 37 to specifically control the actions of the front-end interface 33, memory 34, adjustment module 35, LDPC engine 36 and NAND array 37. The memory 34 may include SRAM (static random access memory) or DRAM (dynamic random access memory).
[0063] When writing data, the data to be written is obtained from the host 31, the format type of the recoverable data in the data to be written is determined through the front-end interface 33, and the front-end protocol is parsed for the data to be written. After parsing, the data is stored in the memory 34, and the data to be written is arranged based on the preset size of the codeword to obtain a plurality of codeword data of preset sizes. Then, the adjustment module 35 is used to delete the check protection data and reference data in the metadata of each codeword data based on the format type of the recoverable data, so as to expand the blank space of each codeword data and improve the deletion accuracy of the check protection data and the reference data. Then, the LDPC engine 36 performs randomization processing, the first check processing of CRC and the second check processing of LDPC on each codeword data to obtain check information including the first check code and the second check code. Each check information is stored in the blank space of the corresponding codeword data to obtain a plurality of checked codeword data. Finally, the plurality of checked codeword data are written to the NAND array 37.
[0064] The front-end interface 33 also transmits the format type of the recoverable data to the controller, so that the controller controls the adjustment module 35 and the LDPC engine 36 to perform targeted processing on the codeword data based on the format type of the recoverable data.
[0065] In this step, the data to be written is obtained from the host 31, and the format type of the recoverable data in the data to be written is determined through the front-end interface 33. The front-end interface 33 is a Front End Inerface, which is used to parse the front-end protocol of the data to be written, such as the NVMe protocol or the Scsi protocol, to determine the format type of the recoverable data in the data to be written.
[0066] In a specific application scenario, in the definition of protocols such as the NVMe protocol or the Scsi protocol, the data to be written by the host consists of user data and metadata.
[0067] See also Figure 4 , Figure 4 It is a structural schematic diagram of an implementation method of data to be written.
[0068] The data to be written 40 includes user data 41 and metadata 42. In this embodiment, the user data 41 and metadata 42 are arranged alternately in sequence.
[0069] See also Figure 5 , Figure 5 It is a structural schematic diagram of another implementation method of data to be written.
[0070] The data to be written 50 includes user data 51 and metadata 52. In this embodiment, the user data 51 and metadata 52 are arranged separately.
[0071] According to different protocol specifications, metadata may be placed after user data, or may use independent memory space. The metadata part includes protection information, referred to as PI information, which may be located at the beginning or end of the metadata. The structure of the data to be written shown in this step is the structure of the data in the host 31. When it is written to the solid state drive 32, its structure may be adjusted and changed.
[0072] The protection information can exist in at least three formats according to the protocol specification. For example, under the NVMe2.0 protocol, there are three formats in total.
[0073] See also Figure 6 , Figure 6 It is a structural diagram of the first implementation method of protecting data.
[0074] The protection data 60 of this embodiment is in the 16-bit Guard Protection Information format, which is 8 bytes in total.
[0075] The protection data 60 includes a 2-byte Guard field, a 2-byte Application Tag field, and a 4-byte Reference Tag field. The Guard field is for checking the protection data, specifically the CRC (Cyclic Redundancy Check) check code of the user data corresponding to the protection data 60, which is used to ensure the integrity of the user data; the Application Tag field is the application data, which is used by the application software and is transparent to the storage controller; the Reference Tag field is the reference data, which is the LBA (Logical Block Address) logical block address value or other information, which is used to ensure that the user data is not disordered during out-of-order transmission or routing.
[0076] Among them, LSB stands for Least Significant Bit, which means the least significant bit in binary numbers. Generally speaking, MSB is located at the leftmost side of a binary number, and LSB is located at the rightmost side of a binary number. MSB stands for Most Significant Bit, which is the most significant bit in a binary number. MSB is the highest weighted bit, similar to the leftmost bit in a decimal number.
[0077] See also Figure 7 , Figure 7 It is a schematic structural diagram of the second implementation method of protecting data.
[0078] The protection data 70 of this embodiment is in the format of 32-byte Guard Protection Information, which is 16 bytes in total.
[0079] The protection data 70 includes a 4-byte Guard field, a 2-byte Application Tag field, and an 8-byte storage and Reference Space field. The Guard field is for checking the protection data, specifically the CRC (Cyclic Redundancy Check) check code of the user data corresponding to the protection data 60, which is used to ensure the integrity of the user data; the Application Tag field is the application data, which is used by the application software and is transparent to the storage controller; the storage and Reference Space field is the reference data, which is the LBA (Logical Block Address) logical block address value or other information, which is used to ensure that the user data is not disordered during out-of-order transmission or routing, and has an additional storage function than the Reference Tag field.
[0080] See also Figure 8 , Figure 8It is a structural diagram of the third implementation method of protecting data.
[0081] The protection data 80 of this embodiment is in the format of 64-byte Guard Protection Information, which is 16 bytes in total.
[0082] The protection data 80 includes an 8-byte Guard field, a 2-byte Application Tag field, and a 6-byte storage and Reference Space field. The Guard field is for checking the protection data, specifically the CRC (Cyclic Redundancy Check) check code of the user data corresponding to the protection data 60, which is used to ensure the integrity of the user data; the Application Tag field is the application data, which is used by the application software and is transparent to the storage controller; the storage and Reference Space field is the reference data, which is the LBA (Logical Block Address) logical block address value or other information, which is used to ensure that the user data is not disordered during out-of-order transmission or routing, and has an additional storage function than the Reference Tag field.
[0083] From the above three formats, it can be seen that the protection information may be 8Bytes or 16Bytes, of which 16Bytes is only applicable to scenarios where the logical block LBA logical block address size of the data to be written by the host 31 is greater than or equal to 4KB of codeword data. The Guard field of the verification protection data in the recoverable data may be 2Byte, 4Byte or 8Byte. That is, in various protocols, the specification of the protection information can define Guard fields and Reference Tag fields of different sizes in different applications, so when the recoverable data is deleted later, the size of the data to be deleted will also be different.
[0084] In a specific application scenario, the format type of recoverable data in the data to be written can be determined through the front-end interface 33 and then transmitted to the controller 38, so that the controller 38 controls the adjustment module 35 to delete based on the specific format of the protection information, so as to achieve accurate deletion and avoid deleting too little or too much.
[0085] In another specific application scenario, the namespace is partitioned and formatted according to the format of the protection information. That is to say, different data layout formats can be defined in different Namespaces, so as to provide different levels of data protection for user data. Therefore, in different Namespaces, the LDPC algorithm needs to use different code rates to design the error correction algorithm. The LDPC engine 36 needs to support multiple code rate encoding and decoding methods at the same time. The corresponding firmware must also be considered in a targeted manner to perform targeted and accurate deletion of protection information of various formats, improve the accuracy of deletion of recoverable data, and ensure the reliability of the improved error correction capability of the LDPC checksum algorithm.
[0086] Step S22: Arranging the data to be written based on the preset size of the codeword to obtain a plurality of codeword data of the preset size.
[0087] The data to be written is arranged based on the preset size of the codeword to obtain codeword data of multiple preset sizes. The preset size of the codeword can be based on the specific storage device type and the type of the verification algorithm. In this embodiment, the preset size of the codeword is a fixed unit length required for LDPC encoding.
[0088] See also Fig. 9 , Fig. 9 It is a schematic structural diagram of a codeword implementation method.
[0089] This embodiment takes 16KB page size NAND as an example, the size of code word 90 is 4KB+, and its data arrangement includes user data 91 and additional information 92. Among them, user data 91 is 4KB, and additional information 92 includes additional information such as metadata and verification information. The dummy part is invalid information that cannot be put into the code word 90. That is, the preset size of this embodiment is 4KB+.
[0090] In other implementations, the size of the code word 90 may be 16KB+, and the size of the user data 91 may also be 16KB, that is, the preset size of this implementation is 16KB+. The preset size may be determined based on the code word structure supported by the specific solid state drive, and is not limited here.
[0091] In this step, after the data to be written is arranged based on the preset size of the codeword, a plurality of codeword data of the preset size are obtained.
[0092] Step S23: deleting the recoverable part of the protection data in the metadata of each code word data based on the format type of the recoverable data, so as to expand the blank space of each code word data.
[0093] In a code word data, when certain data can be calculated based on the inherent rules, it means that the data can be recovered using the inherent rules, and the data is determined to be recoverable data, and the recoverable data is deleted.
[0094] Specifically, firmware metadata cannot be compressed any more, but some fields of host metadata can be recovered through certain calculations, such as the checksum protection data in the Guard field and the reference data in the Reference Tag field.
[0095] See also Fig.10 , Fig.10 It is a specific structural diagram of an implementation method of codeword data.
[0096] The data in NAND will be arranged according to the size of LDPC Code Word. Codeword data 100 includes user data 121 and metadata 120. Metadata 120 includes host metadata 122, firmware metadata 133, first check code position 134 (Seed & CRC) and second check code position 135 (LDPC Parity). Host metadata 122 includes protection information 130 and Meta information 131. Protection information 130 includes check protection data 141 (Guard), application data 142 (ApplicationTag) and reference data 143 (Reference Tag). Among them, the first check code position 134 (Seed & CRC) and the second check code position 135 (LDPC Parity) in this schematic diagram refer to the positions in the codeword data 100 for accommodating the corresponding check codes. When deleting recoverable data, the specific first check code and the second check code are not calculated. After the subsequent calculation, they are filled in the above positions accordingly.
[0097] In this step, the adjustment module 35 in the solid state drive 32 deletes the recoverable partial protection data in the metadata of each code word data 100. In a specific application scenario, the adjustment module 35 of the solid state drive 32 includes Pichk, Stripe and Shuffle. After each code word data 100 is stored in the memory 34, the metadata 120 in each code word data 100 is first verified by Pichk of the adjustment module 35; when the metadata 120 is successfully verified, the recoverable partial protection data in each metadata 120 is deleted by Stripe of the adjustment module 35. Then, the positional relationship between the deleted metadata 120 and the corresponding user data 121 is adjusted by Shuffle of the adjustment module 35 to unify the format of the fixed code word data 100. When the metadata 120 is successfully verified, the code word data 100 is not subsequently processed.
[0098] The recoverable part of the protection data in each metadata 120 is deleted based on the format type of the recoverable data. That is, the format of the protection information determined by the above steps is used to determine the specific deletion position and size of the deletion step for deletion, so as to perform targeted and accurate deletion for various formats of protection information, improve the accuracy of deleting the recoverable data, and ensure the reliability of the improved error correction capability of the LDPC check algorithm.
[0099] The step of deleting the recoverable partial protection data in each metadata 120 specifically includes: first determining whether the logical block size of the data to be written is the same as the preset size. The logical block size of the data to be written refers to the unit data from the host 31, which may be different from the preset size of the codeword data 100.
[0100] When the logical block size of the data to be written is the same as the preset size, it means that there is only one user data 121 in the arranged code data 100, and there is only one corresponding reference data 143. The user data address is stored in the reference data 143. In one code data 100, at least one user data address is required for recovery calculation. Therefore, in this case, only the verification protection data 141 (Guard) of the protection information 130 in each metadata 120 is deleted.
[0101] When the logical block size of the data to be written is different from the preset size, since the size of the unit data from the host 31 is the smallest, when the logical block size is different from the preset size, it means that the logical block size is smaller than the preset size, which means that there are multiple user data 121 in the arranged code word data 100, and the user data address in a code word data 100 is stored continuously, that is, it can be obtained by reverse deduction through the user data address in a reference data 143. Therefore, in this case, the verification protection data 141 of the protection information 130 in each metadata 120 and part of the reference data 143 of the protection information in each metadata 120 can be deleted to retain at least one reference data 143 in multiple metadata 120.
[0102] In a specific application scenario, any reference data 143 from the multiple metadata 120 can be retained, but preferably, the reference data 143 corresponding to the first user data 121 is retained so that when restoring the data, incremental calculation is sufficient, thereby improving the efficiency of restoring the data.
[0103] See also Fig.11 , Fig.11 It is a schematic diagram of an implementation method of recoverable data deletion.
[0104] See also Fig.11 (11a), this schematic diagram specifically reflects the specific data in the protection information (not marked in the figure) to improve the visualization of recoverable data deletion.
[0105] The codeword data 200 includes user data 210, check protection data 211, application data 212, reference data 213, Meta data 216, a second check code position 214, and other data 215. The second check code position 214 is located at the end of the codeword data 200. For ease of presentation, the firmware metadata and the first check code position are both included in the other data 215. One codeword data 200 corresponds to one copy of the other data 215 and one copy of the second check code position 214.
[0106] This diagram takes a codeword data 200 including two user data 210 as an example for deletion explanation, wherein one user data 210 corresponds to one protection information 230 and one Meta data 216. That is, this embodiment specifically deletes two verification protection data 211 and one reference data 213 to retain at least one reference data 213.
[0107] Please read further Fig.11 (11b) and (11c) respectively show two arrangement methods after deleting the recoverable data in the code word data 200. (11b) is to arrange in sequence according to each user data 210 and its corresponding data. (11c) is to arrange in sequence according to the type of various data. The above arrangement methods can be selected based on actual needs.
[0108] After deleting the check protection data 211 and part of the reference data 213 to retain at least one reference data 213, the blank space of each codeword data 200 is expanded, so that this part of the blank space can be used to store the second check code of the LDPC, thereby increasing the storage space of the second check code of the LDPC, and further improving the correction capability of the LDPC.
[0109] Among them, the reason why the verification protection data 211 and part of the reference data 213 can be deleted is that the verification protection data 211 and part of the reference data 213 can be restored by calculation based on rules. The verification protection data 211 is the CRC verification information of the user data, which can be recalculated by the corresponding user data 210 using the CRC verification engine, and the reference data 213 is the address information. Since the user data address in a Code Word is stored continuously, it can also be recalculated by a reference data 213. At the same time, there will be no routing error access path error in a Code Word. Therefore, deleting these two data will not weaken the protection capability of the user data 210. On the contrary, because the space for storing the verification information of LDPC can be increased, the error correction capability of LDPC is enhanced, thereby improving the reliability of user data.
[0110] Step S24: performing randomization processing and first verification processing on each code word data in turn to obtain a first verification code for each code word data; performing second verification processing on each code word data to obtain a second verification code for each code word data; determining the first verification code and the second verification code as verification information.
[0111] After the adjustment module 35 in the solid state drive 32 deletes the recoverable part of the protection data, the deleted codeword data is input into the LDPC engine 36 for verification processing. Specifically, the codeword data is first randomized by the scrambler 361, and then the codeword data is first verified by the CRC check 364 to obtain the first check code of the CRC of each codeword data. The CRC here protects the entire codeword data, while the Guard domain in the previous text only protects the user data, which is an inclusion relationship. Therefore, the first check code can also be used to ensure data error correction and data restoration of user data.
[0112] The encoder 362 then performs a second check process of the LDPC check algorithm on each codeword data to obtain a second check code of each codeword data, namely, LDPC Parity; the first check code and the second check code are determined as check information.
[0113] Among them, since in the LDPC engine 36, there are already the first check processing for CRC protection of the codeword data and the second check processing for LDPC protection, it is possible to provide sufficient error correction capability for the data, and thus the deletion of the check protection information will not affect the reliability of the user data. Moreover, since the check protection information contains the CRC check code of the user data, it is included in the CRC check code of the entire codeword data processed by the first check, therefore, the check protection information can be classified as duplicate data and can be deleted to expand the blank space. When the host reads the data subsequently, it needs to be restored, and can be transmitted back to the host together with the user data after restoration so that the host can verify the correctness of the data.
[0114] Step S25: storing each verification information into the blank space of the corresponding code word data respectively, to obtain a plurality of verified code word data.
[0115] After obtaining the verification information, each verification information is stored in the blank space of the corresponding code word data to obtain a plurality of verified code word data. Fig.10 For example, the first check code and the second check code are stored in the corresponding first check code position 134 and the second check code position 135 respectively to obtain a plurality of checked code word data.
[0116] Among them, since the above-mentioned steps delete the deletion check protection data and part of the reference data in each code word data, the blank space of each code word data is expanded, so that the second check code position 135 of the LDPC in this step can have a larger space for storage, thereby increasing the storage space of the second check code of the LDPC, and then improving the correction capability of the LDPC.
[0117] Step S26: writing the multiple verified code word data into a storage device.
[0118] The codeword data verified by the LDPC engine 36 is written into the NAND array 37, completing the writing of the data to be written.
[0119] Through the above steps, the data management method of this embodiment obtains the data to be written, determines the format type of recoverable data in the data to be written, arranges the data to be written based on the preset size of the codeword, obtains multiple codeword data of preset size, deletes the check protection data and reference data in the metadata of each codeword data based on the format type of the recoverable data, so as to expand the blank space of each codeword data and improve the accurate deletion of the check protection data and the reference data, and then performs randomization processing, first check processing and second check processing on each codeword data in turn to obtain check information including a first check code and a second check code, stores each check information in the blank space of the corresponding codeword data, obtains multiple checked codeword data, and writes the multiple checked codeword data to the storage device, so that by deleting the check protection data and reference data in each codeword data, the subsequent LDPC check information can have more blank space for storage, thereby increasing the proportion of the check information in the corresponding codeword data, improving the error correction capability of the LDPC check algorithm, and thus improving the reliability of the data in the storage device. Furthermore, deleting the recoverable check protection data and reference data can not only expand the blank space of each code word data, but also prevent data loss in the code word data, thereby further ensuring the reliability of each code word data.
[0120] See also Fig.12 , Fig.12 It is a flowchart of an embodiment of reading codeword data.
[0121] Step S31: Acquire verified codeword data from a storage device.
[0122] Step S32: Complement the verified code word data to obtain each code word data, so as to read each code word data.
[0123] The check protection data of each code word data is obtained by performing a first check process on the user data of the corresponding code word data.
[0124] Specifically, a first CRC check processing is performed on the user data of each code word data to obtain check protection data of each code word data; and each reference data in the multiple metadata is calculated and restored based on the continuity of at least one reference data in the retained multiple metadata to obtain the reference data of each metadata; finally, each checked code word data is completed using each check protection data and the reference data of each metadata to restore each code word data, so as to read each code word data.
[0125] See also Fig.13 , Fig.13 It is a schematic diagram of data flow in an implementation method of reading data.
[0126] This embodiment reads the codeword data in the solid state drive 32 into the host 31. In the data reading process, the solid state drive 32 uses the front-end interface 33, the memory 34, the adjustment module 35, the LDPC engine 36 and the NAND array 37. The LDPC engine 36 uses the CRC check 364, the descrambler 363 and the decoder 366.
[0127] The host 31 is connected to the front-end interface 33, and the front-end interface 33, memory 34, adjustment module 35, descrambler 363, CRC check 364, decoder 366 and NAND array 37 in the solid state drive 32 are connected in sequence. A controller (not shown) is also provided in the solid state drive 32, and the controller is respectively connected to the front-end interface 33, memory 34, adjustment module 35, LDPC engine 36 and NAND array 37 to specifically control the actions of the front-end interface 33, memory 34, adjustment module 35, CRC check 364, LDPC engine 36 and NAND array 37.
[0128] When reading data, the codeword data is obtained from the NAND array 37 and transmitted to the LDPC engine 36. The codeword data is first decoded by the decoder 366, and then the check protection information is recalculated by the CRC check 364. The codeword data is then descrambled by the descrambler 363, and the reference data is supplemented by the adjustment module 35. The check protection information and the reference data are shuffled to the back of the corresponding user data, the protection information is supplemented, and then the data is transmitted back to the host 31 through the memory 34 and the front-end interface 33 in sequence according to the protocol specification to complete the complete reading of the data.
[0129] Through the above steps, the data deleted when writing data can be completely restored during the data reading process, thereby ensuring the smooth reading of data. The data management method of this embodiment can not only increase the storage space of the LDPC check code by deleting the recoverable data to improve the error correction capability of the LDPC, but also prevent data deletion from affecting data reading, thereby improving data reliability.
[0130] See also Fig.14 , Fig.14 1 is a schematic diagram of a framework of an embodiment of an electronic device of the present application. The electronic device 1400 includes a memory 1401 and a processor 1402 coupled to each other, and the processor 1402 is used to execute program instructions stored in the memory 1401 to implement the steps of the above method embodiment. In a specific implementation scenario, the electronic device 1400 may include but is not limited to: a microcomputer, a server, and in addition, the electronic device 1400 may also include a laptop, a tablet computer, NandFlash, etc., which are not limited here.
[0131] Specifically, the processor 1402 is used to control itself and the memory 1401 to implement the steps of any of the above method embodiments. The processor 1402 can also be called a CPU (Central Processing Unit). The processor 1402 may be an integrated circuit chip with signal processing capabilities. The processor 1402 can also be a general-purpose processor, a digital signal processor (Digital Signal Processor, DSP), an application-specific integrated circuit (Application Specific Integrated Circuit, ASIC), a field-programmable gate array (Field-Programmable Gate Array, FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor, etc. In addition, the processor 1402 can be implemented by an integrated circuit chip.
[0132] The above solution can improve the error correction capability of the verification algorithm, thereby improving the reliability of data in the storage device.
[0133] See also Fig.15 , Fig.15 The schematic diagram of the framework of an embodiment of a computer-readable storage medium of the present application is as follows: The computer-readable storage medium 1500 stores program instructions 1501 that can be executed by a processor, and the program instructions 1501 are used to implement the steps of any of the above method embodiments.
[0134] In the several embodiments provided in the present application, it should be understood that the disclosed methods and devices can be implemented in other ways. For example, the device implementation described above is only schematic. For example, the division of modules or units is only a logical function division. There may be other division methods in actual implementation, such as units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, and the indirect coupling or communication connection of devices or units can be electrical, mechanical or other forms.
[0135] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.
[0136] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0137] 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 computer-readable storage medium. Based on this understanding, the technical solution of the present application 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 to enable a computer device (which can be a personal computer, server, or network device, etc.) or a processor (processor) to perform all or part of the steps of each implementation method of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program code.
[0138] The above description is only an implementation mode of the present invention, and does not limit the patent scope of the present invention. Any equivalent structure or equivalent process transformation made by using the contents of the present invention specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present invention.
Claims
1. A data management method, characterized in that: The data management method includes: Acquire the data to be written, and arrange the data to be written based on the preset size of the codeword to obtain codeword data of multiple preset sizes; Deleting recoverable data in each of the code word data to expand the blank space of each of the code word data; The blank space is used for data management, and each of the codeword data after data management is written into a storage device.
2. The data management method according to claim 1, characterized in that: Each of the codeword data includes user data and metadata, and each of the metadata includes protection information; The step of deleting the recoverable data in each of the code word data to expand the blank space of each of the code word data comprises: The recoverable part of the protection data in each metadata is deleted to expand the blank space of each codeword data.
3. The data management method according to claim 2, characterized in that: The step of acquiring the data to be written and arranging the data to be written based on the preset size of the codeword to obtain a plurality of codeword data of preset sizes also includes: Determining the format type of recoverable data in the data to be written; The step of deleting the recoverable part of the protection data in each metadata to expand the blank space of each codeword data comprises: The recoverable part of the protection data in each metadata is deleted based on the format type of the recoverable data to expand the blank space of each codeword data.
4. The data management method according to claim 2 or 3, characterized in that: The step of deleting the recoverable part of the protection data in each metadata to expand the blank space of each codeword data comprises: Verifying metadata in each of the codeword data; When the metadata verification succeeds, the recoverable partial protection data in each metadata is deleted to expand the blank space of each codeword data, and the positional relationship between the deleted metadata and the corresponding user data is adjusted to unify the format of the codeword data.
5. The data management method according to claim 4, characterized in that: Each of the protection information includes verification protection data, application data and reference data; The step of deleting the recoverable part of the protection data in each metadata comprises: In response to the logical block size of the data to be written being the same as the preset size, deleting the verification protection data of the protection information in each of the metadata; In response to the logical block size of the data to be written being different from the preset size, the verification protection data of the protection information in each metadata and part of the reference data of the protection information in each metadata are deleted to retain at least one reference data in the plurality of metadata.
6. The data management method according to claim 1, characterized in that: The step of using the blank space to manage data and writing each of the codeword data after data management into the storage device includes: Verifying each of the code word data respectively to obtain a plurality of verification information, and storing each of the verification information in a blank space of the corresponding code word data respectively to obtain a plurality of verified code word data; Writing a plurality of verified code word data into the storage device.
7. The data management method according to claim 6, characterized in that: The step of respectively verifying each of the code word data to obtain a plurality of verification information comprises: Performing randomization processing and first verification processing on each of the code word data in sequence to obtain a first verification code for each of the code word data; Performing a second check process on each of the code word data to obtain a second check code for each of the code word data; The first verification code and the second verification code are determined as the verification information.
8. The data management method according to claim 7, characterized in that: The data management method also includes: Acquire the verified codeword data from the storage device; The verified code word data are padded to obtain the code word data, so as to read the code word data.
9. An electronic device, characterized in that: It comprises a memory and a processor coupled to each other, wherein the processor is used to execute program instructions stored in the memory to implement the data management method according to any one of claims 1 to 8.
10. A computer-readable storage medium having program instructions stored thereon, characterized in that: When the program instructions are executed by a processor, the data management method according to any one of claims 1 to 8 is implemented.
Citation Information
Patent Citations
SSD data protection method and device, readable storage medium and electronic equipment
CN114625563A
Codeword rotation for zone grouping of media codewords
US20200364155A1
Adjusting code rates to mitigate cross-temperature effects in a non-volatile memory (NVM)
US20200409579A1
Methods for supporting mismatched transaction granularities
US20220027286A1