Data decoding method, data encoding method, codec device, and storage medium
By employing lateral and cross-segment encoding methods in solid-state drives, generating multiple check codes, and combining lateral and cross-segment decoding, the problem of insufficient error correction capability in 3D NAND flash memory is solved, improving the system's error correction performance and data recovery reliability.
Patent Information
- Application Number
- CN202511215824.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-28
- Publication Date
- 2025-12-05
- Estimated Expiration
- 2045-08-28
Smart Images

Figure CN120723535B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of solid state storage hard disk, in particular to a data decoding method, a data encoding method, an encoding and decoding device and a storage medium. BACKGROUND
[0002] In a solid state drive (SSD) system, the error correction performance is usually realized by a low-density parity-check code (LDPC). Considering the 4KB read-write operation characteristics of mainstream SSDs, 4KB LDPC is generally used as the basic error correction mechanism in the related art.
[0003] The non-volatile storage medium used in the solid state drive, especially the 3D NAND flash, achieves higher storage density by continuously increasing the number of stacked layers. However, as the number of layers increases, the interference during the read-write process also increases, resulting in a significant increase in the raw bit error rate. As the raw error rate rises, the traditional 4KB LDPC gradually fails to meet the demand for high reliability, and a way with stronger error correction capability is needed to realize the read-write of user data.
[0004] Therefore, how to improve the error correction performance of the solid state drive system has become a key technical problem to be solved in the current solid state drive design. SUMMARY
[0005] To solve the above technical problems, the present application provides a data decoding method, a data encoding method, a data encoding and decoding device and a computer storage medium.
[0006] To solve the above technical problems, the present application provides a data decoding method, the data decoding method comprising:
[0007] transversely decoding original user data in a to-be-processed codeword based on a first check code in the to-be-processed codeword, and in the case of transversely decoding failure, obtaining other codewords in a flash page corresponding to the to-be-processed codeword;
[0008] transversely decoding original user data in each of the other codewords based on a first check code in each of the other codewords, and obtaining transversely decoded user data corresponding to the other codewords that transversely decode successfully;
[0009] determining target decoded user data of the to-be-processed codeword based on the transversely decoded user data and at least one second check code, wherein the decoding object of each first check code is the user data corresponding to the corresponding codeword, and the decoding object of each second check code includes part of the user data corresponding to all codewords in the flash page.
[0010] The target decoding user data of the to-be-processed code word is determined based on the transversely decoded user data and the at least one second check code, and the target decoding user data comprises:
[0011] The decoding object corresponding to each second check code is cross-region decoded based on the at least one second check code, and decoding data is obtained;
[0012] The decoding data corresponding to the to-be-processed code word is selected from the decoding data;
[0013] The target decoding user data is determined based on the decoding data corresponding to the to-be-processed code word.
[0014] The decoding object corresponding to each second check code is cross-region decoded based on the at least one second check code, and decoding data is obtained, and the method comprises:
[0015] A current decoding object corresponding to a current second check code is obtained, wherein the current decoding object comprises part of original user data in the to-be-processed code word, part of transversely decoded user data corresponding to other code words that have successfully undergone transverse decoding, and part of original user data in other code words that have failed to undergo transverse decoding;
[0016] The current decoding object is cross-region decoded based on the current second check code;
[0017] Data obtained after successful cross-region decoding is determined as the decoding data.
[0018] The target decoding user data is determined based on the decoding data corresponding to the to-be-processed code word, and the method comprises:
[0019] Original user data in the to-be-processed code word is updated using the decoding data corresponding to the to-be-processed code word, and first updated data is obtained;
[0020] The first updated data is transversely decoded based on a first check code in the to-be-processed code word;
[0021] Data obtained when the first updated data is successfully transversely decoded is determined as the target decoding user data.
[0022] The data decoding method further comprises:
[0023] When the first updated data fails to be transversely decoded, a plurality of third check codes are obtained, wherein the decoding object of each third check code comprises part of user data corresponding to all code words in the flash memory page, and the decoding object corresponding to any third check code is different from the decoding object corresponding to any second check code;
[0024] determine the target decoding user data of the to-be-processed codeword based on the transversely decoded user data and at least one second check code.
[0025] The flash memory page includes N codewords, and the data amount of the original user data or the transversely decoded user data corresponding to each codeword is a preset data amount.
[0026] Before determining the target decoding user data of the to-be-processed codeword based on the transversely decoded user data and at least one second check code, the method further includes:
[0027] The original user data in the to-be-processed codeword, the original user data in the other codewords that fail in transverse decoding, and the transversely decoded user data in the other codewords that succeed in transverse decoding are respectively split according to the same splitting rule, to obtain N segmented data sets, wherein each segmented data set includes N segmented data.
[0028] Each second check code corresponds to a decoding object determined according to the N segmented data sets, and the data amount of the decoding object corresponding to different second check codes is the preset data amount.
[0029] The data decoding method further includes:
[0030] The number of erasures of a storage block corresponding to the flash memory page is obtained.
[0031] The target statistical table is queried according to the number of erasures, to determine the splitting rule, wherein the splitting rule includes the data length of each segmented data in the splitting process, and the target statistical table records the mapping relationship between the number of erasures and the splitting rule.
[0032] To solve the above technical problem, the application further provides a data encoding method, which includes:
[0033] Each user data in to-be-written data is transversely encoded, to obtain a plurality of first check codes corresponding to a plurality of user data.
[0034] The plurality of user data is regrouped, to obtain a plurality of encoding objects, wherein each encoding object includes part of data of each user data in the plurality of user data.
[0035] Each encoding object is cross-zone encoded, to obtain a plurality of second check codes corresponding to the plurality of encoding objects.
[0036] The plurality of user data, the plurality of first check codes, and the plurality of second check codes are assembled into a plurality of codewords, and the plurality of codewords are written into a flash memory page.
[0037] To solve the above technical problems, the application further provides a data coding device, comprising a memory and a processor coupled with the memory; wherein the memory is used to store program data, and the processor is used to execute the program data to realize the data decoding method and / or the data encoding method as described above.
[0038] To solve the above technical problems, the application further provides a computer storage medium, which is used to store program data, and the program data is used to realize the data decoding method and / or the data encoding method as described above when executed by a computer.
[0039] Compared with the prior art, the application has the beneficial effects that: through the data decoding method in the embodiments of the application, when the transverse decoding of the to-be-processed code word fails, the system will call the transverse decoding user data of other code words in the same flash page, perform cross-zone decoding through the second check code of the cross-code associated data of the transverse user data of the other code words which have been successfully transversely decoded, realize the user data relationship across the code words, and use the check relationship of the user data between different code words to derive the correct user data in the to-be-processed code word, that is, the target decoding user data, thereby significantly improving the error correction capability of the solid state disk system. BRIEF DESCRIPTION OF DRAWINGS
[0040] In order to more clearly illustrate the technical solutions in the embodiments of the application, the drawings needed in the embodiment description will be briefly introduced. Obviously, the drawings in the following description are only some embodiments of the application, and other drawings can be obtained by those skilled in the art without creative labor. Among them:
[0041] Figure 1 is a schematic diagram of encoding using 4KB LDPC in a related technology flash page;
[0042] Figure 2 is a flowchart of an embodiment of the data encoding method provided by the application;
[0043] Figure 3 is a schematic diagram of encoding the to-be-written data in the first embodiment provided by the application;
[0044] Figure 4 is a schematic diagram of assembling code words in the first embodiment provided by the application;
[0045] Figure 5 is a schematic diagram of a target statistical table in an embodiment provided by the application;
[0046] Figure 6 is a schematic diagram of left diagonal encoding in the second embodiment provided by the application;
[0047] Figure 7 is a schematic diagram of right diagonal encoding according to a third embodiment provided by the present application;
[0048] Figure 8 is a schematic diagram of assembling a codeword according to a fourth embodiment provided by the present application;
[0049] Figure 9 is a flowchart of an embodiment of a data decoding method provided by the present application;
[0050] Figure 10 is a schematic diagram of a decoding object of a second check code in embodiment one provided by the present application;
[0051] Figure 11 is a schematic diagram of a decoding object of a second check code in embodiment three provided by the present application;
[0052] Figure 12 is a schematic diagram of a decoding object of a second check code in embodiment four provided by the present application;
[0053] Figure 13 is a flowchart of a data decoding method in embodiment six provided by the present application;
[0054] Figure 14 is a structural schematic diagram of an embodiment of a data decoding apparatus provided by the present application;
[0055] Figure 15 is a structural schematic diagram of an embodiment of a data encoding apparatus provided by the present application;
[0056] Figure 16 is a structural schematic diagram of an embodiment of a data coding and decoding device provided by the present application;
[0057] Figure 17 is a structural schematic diagram of an embodiment of a computer storage medium provided by the present application. DETAILED DESCRIPTION
[0058] The technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments of the present application. Based on the embodiments in the present application, all the other embodiments obtained by those skilled in the art without creative work fall within the scope of protection of the present application.
[0059] The terms "first", "second", "third", "fourth", and the like in the description and in the claims of the present application, and also above-mentioned drawings (if any), are used to distinguish similar objects and are not necessarily used to describe a specific sequential or chronological order. It is to be understood that the use of the terms so-termed, data can be interchanged, where appropriate, to the embodiments of the present application described herein, for example, can be implemented in an order other than those illustrated or described herein. In addition, the terms "comprising" and "having" and any variations thereof are intended to cover non-exclusive inclusion, for example, a process, method, system, product, or apparatus including a series of steps or units does not necessarily have to be limited to those steps or units clearly listed, but can include other steps or units not clearly listed or inherent to these processes, methods, products, or apparatuses.
[0060] To facilitate understanding of the embodiments of the present application, first, the technical terms in the specific embodiments of the present application are explained and described:
[0061] LDPC (Low-Density Parity-Check Code, Low-Density Parity-Check Code) is a high-performance error correction coding technology. When writing user data, the code is generated. When reading data, the parity code is used to check whether the user data is correct, and the error data is repaired based on the parity code.
[0062] Code word (Code Word, CW) is the smallest unit of data protected by LDPC algorithm. A code word is composed of fixed size user data and corresponding LDPC parity. For example, 4KB user data generates about 512 bytes of parity code through LDPC encoding, which together form a 4.5KB code word.
[0063] Flash page: Physically divided into main data space and spare space. The main data area is used to store the actual user data space. In the embodiments of the present application, the spare space is used to store the parity code corresponding to the user data.
[0064] The common 4KB read-write operation characteristics of mainstream SSDs, and the 4KB LDPC is commonly used as an error correction mechanism in related technologies. Please refer to Figure 1 , Figure 1 is a schematic diagram of using 4KB LDPC for encoding in the flash page of the related art. As shown in Figure 1 , taking the main data space of the flash page as 16KB for example, the user data written into the main data space of the flash page is divided into four segments of data, A, B, C, and D. The data amount of each segment of data is 4KB. When writing each segment of data, the parity code corresponding to each segment of data is generated based on the 4KB LDPC algorithm, which is P1, P2, P3, and P4, respectively.
[0065] Taking the case of reading the original data A, the user data A' corresponding to the position and the corresponding check code P1 are extracted, the read data A' is decoded using the corresponding check code, the decoding stage includes inputting the user data A' and the check code P1 into the decoding algorithm, verifying whether the user data A' and the check code P1 match through the check matrix, if they match, it means that the user data A' has no error, and the user data A' is determined as the data A and output; if they do not match, the user data A' needs to be corrected using the check code P1, and the corrected user data A'' is obtained, and the corrected user data A'' is determined as the data A and output.
[0066] However, as the number of layers in the 3D NAND flash increases, the physical distance of the data storage unit is greatly compressed, the charge leakage and crosstalk interference are significantly enhanced, which directly leads to the increase of the original bit error rate, and after a single read and write, the number of error bits of 4KB data may increase from tens to hundreds, which exceeds the error correction threshold of the basic 4KB LDPC, and the accurate user data cannot be read.
[0067] Therefore, how to improve the error correction performance of the solid state disk system is a key technical problem to be solved.
[0068] In the related art, in order to improve the error correction performance of the solid state disk system, a longer code length LDPC is selected as the error correction mechanism, and the longer code length LDPC (such as 16KB LDPC) has stronger error correction capability when processing the same error distribution, and can theoretically significantly improve the reliability of data recovery. However, under the frequent 4KB random read operation, the application of the longer code length LDPC still faces many challenges. Taking the example of the SSD using 16KB LDPC, the data amount of each read is 4KB, which is much smaller than the data amount of 16KB LDPC encoding and decoding, and additional address conversion operation and data splicing operation are required, for example, when reading data, four times of reading are required to reach the data amount of 16KB LDPC encoding and decoding, and when reading 4KB data each time, four times of reading are required, and after the data of four times of reading is cached and spliced, the LDPC decoding can be performed. These additional operations will increase the read delay and reduce the overall performance of the SSD system. How to improve the error correction performance of the solid state disk system without significantly increasing the delay of the solid state disk system has become a key technical problem to be solved in the current solid state disk design.
[0069] For details, please continue to refer to Figure 2 , Figure 2 is a flowchart of an embodiment of the data encoding method provided by the present application.
[0070] The data coding method of the present application is applied to a data coding device. The data coding device of the present application can be a server, a terminal device, or a system comprising a server and a terminal device. Accordingly, each part of the data coding device, such as each unit, subunit, module, and sub-module, can be provided in the server, the terminal device, or both.
[0071] Further, the server can be hardware or software. When the server is hardware, it can be implemented as a distributed server cluster comprising multiple servers, or as a single server. When the server is software, it can be implemented as multiple software or software modules, such as software or software modules for providing a distributed server, or as a single software or software module, without being specifically limited.
[0072] As shown in Figure 2 , the specific steps are as follows:
[0073] Step S11: Transversely encode each user data in the to-be-written data to obtain a plurality of first check codes corresponding to the plurality of user data.
[0074] In the embodiment of the present application, the data amount of the to-be-written data is the same as the space size of the main data space in a single flash page. The to-be-written data comprises a plurality of user data of a preset data amount, and the preset data amount is a basic unit of user read and write. The data amount of the user data corresponding to each write command sent by the user is the preset data amount. The user continuously initiates write commands, and the SSD continuously receives user data. The SSD caches the data, and when the space size of the main data space is full, the cached data (to-be-written data) is encoded and written into the flash page at one time.
[0075] Taking 4KB as the preset data amount and 16KB as the space size of the main data space of the flash page as an example, the user continuously initiates write commands, and the SSD continuously receives user data according to the write commands. Each time 4KB of user data is received, when the received user data is full of 16KB, i.e., the four times of 4KB of user data are determined as to-be-written data, the to-be-written data is encoded and written into the flash page.
[0076] When the to-be-written data is encoded, transverse encoding is first performed, i.e., a plurality of user data are encoded separately to generate corresponding first check codes. Each user data corresponds to a first check code, and a plurality of first check codes are obtained in total.
[0077] Please refer to Figure 3 , Figure 3 is a schematic diagram of encoding the to-be-written data in the first embodiment provided in the present application, as shown in Figure 3As shown, multiple user data are A, B, C, and D. The first checksums corresponding to each user data are generated as P1-1, P2-1, P3-1, and P4-1 based on the 4KB LDPC algorithm.
[0078] Step S12: Regroup the multiple user data to obtain multiple encoded objects, wherein each encoded object includes a portion of the data from each user data in the multiple user data.
[0079] Step S13: Perform cross-regional encoding on each encoded object to obtain multiple second check codes corresponding to multiple encoded objects.
[0080] In this embodiment of the application, each user data is divided into smaller sub-blocks, and then all sub-blocks of all user data are recombined to obtain multiple sets of data, i.e. multiple sets of encoded objects.
[0081] like Figure 3 As shown, taking multiple user data as examples: A, B, C, and D, each user data is split into 4 smaller sub-blocks. Data A is split into: A-1, A-2, A-3, A-4; data B is split into: B-1, B-2, B-3, B-4; data C is split into: C-1, C-2, C-3, C-4; and data D is split into: D-1, D-2, D-3, D-4.
[0082] The 16 sub-blocks mentioned above are recombined. For example, sub-blocks at the same split position in each user data are merged to form multiple new user data, i.e., multiple encoded objects. Specifically, the multiple encoded objects are represented as encoded object G1={A-1, B-1, C-1, D-1}, encoded object G2={A-2, B-2, C-2, D-2}, encoded object G3={A-3, B-3, C-3, D-3}, and encoded object G4={A-4, B-4, C-4, D-4}.
[0083] Encoding multiple objects separately yields multiple second check codes, denoted as P1-2, P2-2, P3-2, and P4-2, respectively.
[0084] Step S14: Assemble the multiple user data, multiple first check codes, and multiple second check codes into multiple codewords, and write the multiple codewords into a flash memory page.
[0085] In this embodiment, multiple user data, multiple first check codes, and multiple second check codes are assembled into multiple codewords. The multiple codewords are written into a flash memory page. The user data in the codewords is written into the main data space of the flash memory page, and the check codes (first check code and second check code) in the codewords are written into the spare space of the flash memory page.
[0086] The plurality of user data, the plurality of first check codes, the plurality of second check codes, each code word including one user data, one first check code and one second check code, can obtain a plurality of code words, please refer to Figure 4 , Figure 4 is a schematic diagram of assembling code words in the first embodiment provided by the present application, as shown in Figure 4 , the plurality of assembled code words CW-1, CW-2, CW-3, CW-4, respectively, CW-1 is composed of A, P1-1, P1-2, CW-2 is composed of B, P2-1, P2-2, CW-3 is composed of C, P3-1, P3-2, and CW-4 is composed of D, P4-1, P4-2.
[0087] When the plurality of user data is regrouped, each user data needs to be split into smaller sub-blocks, and the number of sub-blocks split from each user data is the same as the number of user data in the data to be written, for example, the data to be processed includes 4 user data of 4KB, then each user data is split into 4 smaller sub-blocks when split, and the length of each code word is ensured to be consistent when assembling code words subsequently.
[0088] In an embodiment, when the user data is split, each user data can be split into a plurality of sub-blocks evenly.
[0089] In another embodiment, the split rule is determined before the user data is split, and each user data is split according to the split rule, and the split rules corresponding to all user data in the data to be written are the same, that is, the data lengths of the sub-blocks corresponding to the same split position of different user data are the same.
[0090] Specifically, the split rule is determined according to the erase count of the storage block corresponding to the flash page, and the erase count reflects the aging degree or wear degree of the storage block, and with the increase of the erase count, the reliability of the flash block decreases and the bit error rate rises.
[0091] The split rule includes the data length of each sub-block split, and the mapping relationship between the erase count and the split rule is recorded in the target statistical table, please refer to Figure 5 , Figure 5 is a schematic diagram of the target statistical table in an embodiment provided by the present application, as shown in Figure 5As shown, the user data is set in four smaller sub-blocks, each user data is sequentially split into N1, N2, N3, N4 four sub-blocks in front and back order, the erasure number of the storage block forms a mapping relationship with the data length of each sub-block, in the case of erasure number PE less than threshold TH1, the data length of the four sub-blocks is respectively: L1-1, L1-2, L1-3, L1-4, in the case of erasure number PE less than first threshold TH2 and greater than or equal to threshold TH1, the data length of the four sub-blocks is respectively: L2-1, L2-2, L2-3, L2-4, …, in the case of erasure number PE less than first threshold THn and greater than or equal to threshold THn-1, the data length of the four sub-blocks is respectively: Ln-1, Ln-2, Ln-3, Ln-4.
[0092] The above target statistical table is obtained by pre-characterizing the flash memory particles, as the erasure number increases, the probabilities of errors of each bit in the 4KB user data are different, and the data length of each sub-block is determined according to the probabilities. The data lengths of different sub-blocks can be the same or different.
[0093] After each user data is split into multiple sub-blocks according to the splitting rule, when the multiple user data are regrouped, the data length of a single encoding object obtained after regrouping needs to be consistent with the data length of the user data, so that the transverse encoding and cross-zone encoding can use the same code length LDPC for encoding, for example, the data length of the user data and the encoding object is 4KB, then the transverse encoding and cross-zone encoding both use 4KB LDPC algorithm, avoiding using different code length LDPC algorithms in the encoding process, without switching LDPC algorithm, reducing the complexity of encoding.
[0094] According to the same splitting rule, the multiple user data are split respectively, and each user data is split into four sub-blocks, therefore, the data lengths of the sub-blocks in the same position in different user data are the same, for example, the data length of sub-block A1 in user data A and sub-block B1 in user data B is the same.
[0095] The sub-blocks of the user data are shifted, and the sub-blocks in the same column after shifting all belong to different positions, the sub-blocks in the same column are combined into an encoding object, that is, cross-zone encoding. It should be noted that cross-zone encoding refers to encoding data (encoding object) formed by combining part of data in different user data.
[0096] All the split sub-blocks are shown in Figure 3 As shown, reorganization is performed in a left oblique manner, and the encoding object after reorganization is shown in Figure 6 , Figure 6 is a schematic diagram of left oblique encoding in the second embodiment provided by the present application, as shown in Figure 6As shown, the data in each column is combined into a single encoded object. In this case, the cross-regional encoding is a left-diagonal encoding, meaning that each column of data is encoded. Specifically, the multiple encoded objects are represented as follows: encoded object G1={A-4, B-3, C-2, D-1}, encoded object G2={A-1, B-4, C-3, D-2}, encoded object G3={A-2, B-1, C-4, D-3}, and encoded object G4={A-3, B-2, C-1, D-4}. Encoding these multiple encoded objects yields multiple check codes, denoted as P1-2, P2-2, P3-2, and P4-2, respectively.
[0097] In one embodiment, the multiple check codes obtained by left diagonal encoding are determined as multiple second check codes, which are subsequently assembled into codewords.
[0098] Please see Figure 7 , Figure 7 This is a schematic diagram of right-diagonal encoding provided in the third embodiment of this application, which is different from... Figure 6 The middle section was reorganized in a left-leaning manner. Figure 7 The recombination is performed using a right-skewed approach, and the recombined encoded object is as follows: Figure 7 As shown, the data in each column is combined into a single encoded object. In this case, the cross-region encoding is a right-diagonal encoding, meaning that each column of data is encoded. Specifically, the multiple encoded objects are represented as follows: encoded object G1={A-1, B-2, C-3, D-4}, encoded object G2={A-2, B-3, C-4, D-1}, encoded object G3={A-3, B-4, C-1, D-2}, and encoded object G4={A-4, B-1, C-2, D-3}. Encoding these multiple encoded objects yields multiple check codes, denoted as P1-3, P2-3, P3-3, and P4-3, respectively.
[0099] In one embodiment, the multiple check codes obtained by right-diagonal encoding are determined as multiple second check codes, which are subsequently assembled into codewords.
[0100] Please see Figure 8 , Figure 8 Based on the schematic diagram of assembling codewords in the fourth embodiment provided in this application, in another embodiment, in one embodiment, multiple check codes obtained by left diagonal encoding are determined as multiple second check codes (or third check codes), and subsequently assembled into codewords; multiple check codes obtained by right diagonal encoding are determined as multiple third check codes (or second check codes), and subsequently assembled into codewords, the assembled codewords being as follows: Figure 8As shown, CW-1, CW-2, CW-3, CW-4 are respectively composed of A, P1-1, P1-2, P1-3, CW-2 is composed of B, P2-1, P2-2, P2-3, CW-3 is composed of C, P3-1, P3-2, P3-3, and CW-4 is composed of D, P4-1, P4-2, P4-3.
[0101] In the above embodiments, when encoding the data to be written, the data to be written is transversely encoded and cross-zone encoded. The transverse encoding is to encode each user data separately, and the cross-zone encoding is to encode the encoding object composed of different user data. Therefore, in the decoding process, if the bit error rate of a certain user data is too high to cause the transverse decoding to fail, the decoding can be performed in combination with other user data, thereby improving the error correction performance of the solid state disk system.
[0102] For details, please continue to refer to Figure 9 , Figure 9 is a flowchart of an embodiment of the data decoding method provided by the present application.
[0103] The data decoding method of the present application is applied to a data decoding device. The data decoding device of the present application can be a server, a terminal device, or a system in which the server and the terminal device cooperate with each other. Accordingly, each part of the data decoding device, such as each unit, subunit, module, and sub-module, can be provided in the server, the terminal device, or both.
[0104] Further, the server can be hardware or software. When the server is hardware, it can be implemented as a distributed server cluster composed of multiple servers, or as a single server. When the server is software, it can be implemented as multiple software or software modules, such as software or software modules for providing a distributed server, or as a single software or software module, which is not limited here.
[0105] As Figure 9 shown, the specific steps are as follows:
[0106] Step S91: transversely decoding the original user data in the to-be-processed codeword based on the first check code in the to-be-processed codeword, and in the case of transverse decoding failure, obtaining other codewords in the flash page corresponding to the to-be-processed codeword;
[0107] In the embodiments of the present application, a user initiates a read request to request reading of certain user data in a flash page, the system locates and reads the user data (original user data) and its corresponding check code (at least including a first check code and a second check code) in the corresponding flash page according to the request content, to form a to-be-processed code word, decodes the to-be-processed code word to obtain the user data (target decoded user data) after error correction processing, and returns the target decoded user data to the user as the response result of the read request.
[0108] The read user data is the original user data in the to-be-processed code word, and the check code in the to-be-processed code word at least includes a first check code and a second check code.
[0109] The to-be-processed code word is any one of the plurality of code words shown in the following table. Figure 4 In the process of decoding the to-be-processed code word to obtain the target decoded user data, the to-be-processed code word is first horizontally decoded, if the horizontal decoding is successful, the horizontal decoded user data corresponding to the to-be-processed code word obtained by the horizontal decoding is determined as the target decoded user data.
[0110] The user initiates a read request to read the user data in the first row shown in the following table. Figure 4 For example, the to-be-processed code word CW-1 read out by the system is {A', P1-1, P1-2}, wherein A' is the original user data, P1-1 is the first check code, and P1-2 is the second check code.
[0111] The original user data A' is decoded based on the first check code P1-1 using the LDPC algorithm, that is, the original user data is horizontally decoded, if the horizontal decoding is successful, the decoded user data A'' is obtained, A'' is taken as the target decoded user data, and is returned to the user.
[0112] Step S92: horizontally decoding the original user data in each of the other code words based on the first check code in each of the other code words, and obtaining the horizontal decoded user data corresponding to the other code word whose horizontal decoding is successful;
[0113] In the embodiments of the present application, if the original user is decoded using the first check code fails, the decoded user data cannot be obtained, then the other code words in the flash page are further read, corresponding to CW-2, CW-3, CW-4 in the following table, the read other code words are horizontally decoded, and the process of horizontally decoding the other code words is similar to that of horizontally decoding the to-be-processed code word, which will not be described here. Figure 4
[0114] The read other codewords are: CW-2 represented as {B', P2-1, P2-2}, CW-3 represented as {C', P3-1, P3-2}, and CW-4 represented as {D', P4-1, P4-2}. The original user data in the other codewords is decoded using the first check code in the other codewords, and the transverse decoding in each other codeword can also fail.
[0115] Specifically, if the transverse decoding of all the other codewords fails, the target decoding user data of the to-be-processed codeword cannot be successfully decoded, and a decoding failure instruction is returned to the user.
[0116] If at least part of the transverse decoding of the plurality of other codewords succeeds, the transverse decoding user data corresponding to the decoding-successful other codeword is obtained.
[0117] Step S93: determining the target decoding user data of the to-be-processed codeword based on the transverse decoding user data and at least one second check code, wherein the decoding object of each first check code is the user data corresponding to the corresponding codeword, and the decoding object of each second check code includes part of the user data corresponding to all the codewords in the flash memory page.
[0118] In this embodiment, when at least part of the transverse decoding of the other codewords succeeds, the target decoding user data of the to-be-processed codeword is determined according to the transverse user data of the other codewords and at least one second check code.
[0119] Each codeword includes a first check code and a second check code, the decoding object of each first check code is the original user data in the corresponding codeword, and the decoding object of each second check code is part of the user data in each codeword. Figure 3 The encoding object of the second check code P1-2 in FIG. 1 is {A-1, B-1, C-1, D-1}, and the decoding object of the second check code P1-2 in FIG. 1 is the user data {A-1', B-1', C-1', D-1'} read from the storage location of the data {A-1, B-1, C-1, D-1}, and the corresponding cross-zone decoding data is {A-1'', B-1'', C-1'', D-1''}. Figure 4 The encoding object of the second check code P1-2 in FIG. 1 is {A-1, B-1, C-1, D-1}, and the decoding object of the second check code P1-2 in FIG. 1 is the user data {A-1', B-1', C-1', D-1'} read from the storage location of the data {A-1, B-1, C-1, D-1}, and the corresponding cross-zone decoding data is {A-1'', B-1'', C-1'', D-1''}.
[0120] In an optional embodiment, determining the target decoding user data of the to-be-processed codeword based on the decoding user data and at least one second check code includes: performing cross-zone decoding on the decoding object corresponding to each second check code based on at least one second check code to obtain decoding data; selecting the decoding data corresponding to the to-be-processed codeword from the decoding data; and determining the target decoding user data based on the decoding data corresponding to the to-be-processed codeword.
[0121] The cross-zone decoding is performed on the decoding object corresponding to each second check code based on the at least one second check code, that is, each second check code in the at least one second check code decodes the decoding object corresponding to the second check code, and the decoding data corresponding to the to-be-processed code word is selected from the decoding data obtained by each cross-zone decoding, and the target decoding user data is determined based on the decoding data corresponding to the to-be-processed code word.
[0122] The at least one second check code can be a plurality of second check codes corresponding to all code words in the flash memory page, or can be one second check code in the plurality of check codes.
[0123] The cross-zone decoding is performed on the decoding object corresponding to each second check code based on the at least one second check code, that is, each second check code in the at least one second check code decodes the decoding object corresponding to the second check code, and the decoding data corresponding to the to-be-processed code word is selected from the decoding data obtained by each cross-zone decoding, and the target decoding user data is determined based on the decoding data corresponding to the to-be-processed code word.
[0124] In the embodiment, when the cross-zone decoding is performed using the current second check code in the at least one second check code, the decoding object corresponding to the current second check code, that is, the current decoding object, is obtained, the current decoding object is decoded based on the current second check code, and the data obtained by the decoding is determined as the decoding data.
[0125] The user data of each code word included in the current decoding object is the partial original user data or the partial transverse decoding user data of the code word, if the code word is successfully transverse decoded, the current decoding object includes the partial original user data of the code word, and if the code word is unsuccessfully decoded, the current decoding object includes the partial transverse decoding user data of the code word.
[0126] Therefore, the current decoding object includes the partial original user data corresponding to the to-be-processed code word. In addition, the other code words are divided into code words successfully transverse decoded and code words unsuccessfully transverse decoded, and the current decoding object includes the partial decoding user data of the other code words successfully transverse decoded and the partial original user data of the other code words unsuccessfully transverse decoded.
[0127] After obtaining the decoding data corresponding to the to-be-processed codeword, the original user data in the to-be-processed codeword is updated using the decoding data corresponding to the to-be-processed codeword to obtain first updated data, the first updated data is transversely decoded based on the first check code in the to-be-processed codeword, and the data obtained when the first updated data is successfully transversely decoded is determined as the target decoding user data.
[0128] In this embodiment, when all the second check codes are successfully decoded across the zones, the decoding data corresponding to the to-be-processed codeword has the same data amount as the original user data corresponding to the to-be-processed codeword, the original user data of the to-be-processed codeword is directly replaced by the decoding data corresponding to the to-be-processed codeword, and the decoding data corresponding to the to-be-processed codeword can be directly determined as the target decoding user data, or the decoding data corresponding to the to-be-processed codeword (i.e., the first updated data) can be transversely decoded using the first check code of the to-be-processed codeword to verify the first updated data and further correct the first updated data, thereby further improving the reading accuracy.
[0129] When only part of the second check codes are successfully decoded across the zones, the decoding data corresponding to the to-be-processed codeword has a data amount smaller than that of the original user data corresponding to the to-be-processed codeword, the original user data in the corresponding position is replaced by the decoding data corresponding to the to-be-processed codeword to obtain first updated data, the first updated data is transversely decoded using the first check code of the to-be-processed codeword, and the data obtained when the transverse decoding is successful is determined as the target decoding user data.
[0130] Based on this, if the first updated data fails to be transversely decoded, a plurality of third check codes are obtained, and the target decoding user data is determined based on the third check codes and the transversely decoded user data corresponding to other codewords.
[0131] It should be noted that the target decoding user data is determined based on the third check code and the second check code in a similar manner, that is, the decoding object corresponding to the third check code and the second check code is obtained to be decoded across the zones to obtain the decoding data corresponding to the to-be-processed codeword, the original user data of the to-be-processed codeword is updated, and the updated data is transversely decoded to obtain the target decoding user data, which will not be described herein.
[0132] The third check code and the second check code both include part of the user data corresponding to all the codewords in a flash page, and the difference lies in that the decoding object corresponding to any third check code is different from that corresponding to any second check code, for example, referring to Figure 6 and Figure 7The two check codes generated in the cross-zone encoding process (one is a second check code and the other is a third check code) are shown, wherein the encoding in the two cross-zone encoding processes corresponds to different, different check codes are obtained, and therefore, in the decoding process, the decoding objects of the two decoding objects are different.
[0133] In an optional embodiment, before determining the target decoding user data of the to-be-processed code word based on the decoding user data and the plurality of second check codes, the original user data in the to-be-processed code word, the original user data in the other code words whose transverse decoding fails, and the decoding user data in the other code words whose transverse decoding succeeds are respectively split according to the same splitting rule, to obtain N segmented data sets, wherein each segmented data set includes N segmented data; and the decoding object corresponding to each second check code is determined according to the N segmented data sets, wherein the data amount of the decoding object corresponding to different second check codes is the preset data amount, and N is an integer greater than 1.
[0134] Wherein, the determination process of the splitting rule in each decoding is determined as follows: obtaining the erase times of the storage block corresponding to the flash page; determining the splitting rule according to the erase times, wherein the splitting rule includes the data length of each segmented data in the splitting process, and the target statistical table records the mapping relationship between the erase times and the splitting rule.
[0135] In this embodiment, the decoding user data or the original user data corresponding to each code word is split, that is, a user data set is split into smaller sub-blocks, each code word corresponds to a segmented data set, and each segmented data set includes a plurality of corresponding sub-block sets, that is, N segmented data.
[0136] The splitting rule is based on Figure 5 The splitting rule corresponds to a target statistical table, and the splitting process and the determination of the splitting rule are the same as in the encoding process, which will not be repeated here.
[0137] In a specific embodiment, the above data decoding method is illustrated by way of example.
[0138] Embodiment one:
[0139] As shown in Figure 4As shown, the code words in the flash page include CW-1, CW-2, CW-3, CW-4, when the user data A in CW-1 is requested to be read, the code word CW-1 is read out, CW-1 is a code word to be processed, and is represented as {A', P1-1, P1-2}, other code words CW-2, CW-3, CW-4 in the flash page are read out when transverse encoding is performed and transverse encoding fails, and are respectively represented as {B', P2-1, P2-2}, {C', P3-1, P3-2}, {D', P4-1, P4-2}, the other code words are transversely encoded based on the first check code of the other code words, and all the other code words are successfully transversely decoded, and the transversely decoded user data obtained is: B'', C'', D'', the transversely decoded data B'', C'', D'' and the original user data A' are split according to the same splitting rule, and are split into a plurality of sub-blocks, each sub-block is a segmented data, at this time, N = 4, the flash page includes 4 code words, the data amount of the original user data and the decoded user data of each code word is 4 KB, the user data of each code word is split into 4 segmented data, i.e., sub-blocks, each code word corresponds to a segmented data set, and each data set has 4 segmented data.
[0140] The original user data A' is split into A-1', A-2', A-3', A-4', the transversely decoded data B'' is split into: B-1'', B-2'', B-3'', B-4'', the transversely decoded data C'' is split into: C-1'', C-2'', C-3'', C-4'', and the transversely decoded data D'' is split into: D-1'', D-2'', D-3'', D-4''. Please refer to Figure 10 , Figure 10 is a schematic diagram of the decoding object of the second check code in Embodiment I provided by the present application, as Figure 10 shown, the decoding object corresponding to each code word of the second check code is a plurality of segmented data (sub-blocks) in the corresponding column.
[0141] Each second check code decodes the decoding object corresponding to each second check code to obtain decoded data: the decoding object {A-1', B-1'', C-1'', D-1''} is decoded based on the second check code P1-2 to obtain decoded data {A-1'', B-1'', C-1'', D-1''}, wherein the decoding data A-1'' corresponding to the code word to be processed is selected, and the decoding data corresponding to the code word to be processed is represented as B-1'', C-1'', D-1'' based on the cross-zone decoding of the decoding data based on the second check codes P2-2, P3-2, P4-2.
[0142] The decoding data A-1'', B-1'', C-1'', D-1'' corresponding to all the code words to be processed are determined as the target decoded user data.
[0143] Alternatively, the decoded data A-1'', B-1'', C-1'', and D-1'' corresponding to all codewords to be processed are determined as the first updated user data. Horizontal decoding is performed based on the first checksum P1-1 of the codewords to be processed, and the data obtained when horizontal decoding is successful is determined as the target decoded user data.
[0144] Example 2:
[0145] Example 2 obtains the same horizontally decoded data as Example 1, but the methods for decoding user data based on horizontally decoded user data and at least one second checksum target are different. In Example 1, cross-region decoding is performed simultaneously based on all second checksums, while in Example 2, cross-region decoding is not performed simultaneously on different second checksums. Specifically:
[0146] The decoding object of the second check code is as follows Figure 10 As shown, a second check code, such as P1-2, is selected for cross-region decoding to obtain the decoded data A-1'' corresponding to the codeword to be processed. The method of obtaining the decoded data A-1'' is similar to that in Embodiment 1, and will not be described again here.
[0147] After obtaining the decoded data A-1'' corresponding to the codeword to be processed, the original user data A'={A-1'、A-2'、A-3'、A-4'} is updated using A-1'', and the first updated data is {A-1''、A-2'、A-3'、A-4'}. Based on the first check code P1-1, the first updated data is horizontally decoded. If the horizontal decoding is successful, the data {A-1''、A-2''、A-3''、A-4''} is determined as the target decoded user data.
[0148] If the first check code P1-1 fails to perform lateral decoding on the first updated data, the next second check code, such as P2-2, is used for cross-region decoding to obtain the decoded data A-2'' corresponding to the codeword to be processed. Based on the second check code, the second updated data is obtained, represented as {A-1'', A-2'', A-3', A-4'}. Based on the first check code P1-1, the second updated data is then laterally decoded. If the lateral decoding is successful, the obtained data is determined as the target decoded user data.
[0149] Similarly, if the first check code P1-1 fails to perform horizontal decoding on the second updated data, the next second check code is used to perform cross-region decoding, update the user data, and perform horizontal decoding again based on the first check code, until all second check codes have completed cross-region decoding or the target decoded user data is obtained.
[0150] Example 3:
[0151] The steps of embodiment three are basically the same as those of embodiment two / embodiment one, except that the decoding objects of the second check code in each word code in the flash page are different. In embodiment three, the word codes in the flash page use left diagonal encoding to obtain the second check code in the encoding process, and therefore, the left diagonal decoding is used in the cross-zone decoding in the decoding process. Please refer to Figure 11 , Figure 11 is a schematic diagram of the decoding objects of the second check code in embodiment three provided by the present application. As shown in Figure 11 , the decoding object corresponding to the second check code of each word code is a set of multiple segmented data (sub-blocks) in the corresponding column. The decoding object of the second check code P1-2 is {A-4', B-3'', C-2'', D-1''}, the decoding object of the second check code P2-2 is {A-1', B-4'', C-3', D-2'}, the decoding object of the second check code P3-2 is {A-2', B-1'', C-4'', D-3''}, and the decoding object of the second check code P4-2 is {A-3', B-2'', C-1'', D-4''}.
[0152] Embodiment four:
[0153] The steps of embodiment four are basically the same as those of embodiment two / embodiment one, except that the decoding objects of the second check code in each word code in the flash page are different. In embodiment four, the word codes in the flash page use right diagonal encoding to obtain the second check code in the encoding process, and therefore, the right diagonal decoding is used in the cross-zone decoding in the decoding process. Please refer to Figure 12 , Figure 12 is a schematic diagram of the decoding objects of the second check code in embodiment four provided by the present application. As shown in Figure 12 , the decoding object corresponding to the second check code of each word code is a set of multiple segmented data (sub-blocks) in the corresponding column. The decoding object of the second check code P1-3 is {A-1', B-2'', C-3'', D-4''}, the decoding object of the second check code P2-3 is {A-2', B-3'', C-4', D-1'}, the decoding object of the second check code P3-3 is {A-3', B-4'', C-1'', D-2''}, and the decoding object of the second check code P4-3 is {A-4', B-1'', C-2'', D-3''}.
[0154] Embodiment five:
[0155] The steps of embodiment five are basically the same as those of embodiment one / embodiment two / embodiment three / embodiment four, except that in embodiment five, only part of the transverse decoding of the other codewords is successful, for example, the transverse decoding of codewords CW-2 and CW-3 is successful, and the transverse decoding of codeword CW-4 fails, at which time the corresponding transverse decoding user data D'' of CW-4 cannot be obtained, the original user data D' in CW-4 is split to obtain D-1', D-2', D-3', and D-4', and each decoding object of the second check code includes one segment of data in D-1', D-2', D-3', and D-4'.
[0156] Embodiment six
[0157] As shown in Figure 8 , each codeword includes original user data, a first check code, a second check code, and a third check code, the codewords in the flash page include CW-1, CW-2, CW-3, and CW-4, when user data A in CW-1 is requested to be read, the codeword CW-1 is read out, CW-1 is a to-be-processed codeword, and is represented as {A', P1-1, P1-2, P1-3}, when transverse encoding is performed and transverse encoding fails, other codewords CW-2, CW-3, and CW-4 in the flash page are read out, and are respectively represented as {B', P2-1, P2-2, P2-3}, {C', P3-1, P3-2, P3-3}, and {D', P4-1, P4-2, P4-3}.
[0158] P1-1, P2-1, P3-1, and P4-1 are first check codes, P1-2, P2-2, P3-2, and P4-2 are second check codes, and P1-3, P2-3, P3-3, and P4-3 are third check codes.
[0159] Please refer to Figure 13 , Figure 13 is a flowchart of the data decoding method in embodiment six provided by the present application, as shown in Figure 13 , the method comprises the following steps:
[0160] Transversely decoding the to-be-processed codeword, and in the case of successful transverse decoding, determining the obtained data as target decoding user data;
[0161] In the case of failed transverse decoding, other codewords are obtained, and each other codeword is transversely decoded;
[0162] The original user data of the codeword with failed transverse decoding and the transverse decoding user data of the codeword with successful transverse decoding are written into a cache page;
[0163] Based on at least one second check code, the data in the cache page is left oblique decoded, and the left oblique decoding step is described in embodiment three;
[0164] update the data in the cache page with the data decoded successfully in the left diagonal direction;
[0165] re-perform horizontal encoding on the user data corresponding to the to-be-processed code word in the cache page based on the first check code of the to-be-processed code word;
[0166] determine the data obtained through the re-performed horizontal decoding as the target decoding user data if the re-performed horizontal decoding is successful;
[0167] if the re-performed horizontal decoding is unsuccessful, perform right diagonal decoding on the data in the cache page based on at least one third check code, and the right diagonal decoding step is described in Embodiment Four;
[0168] update the data in the cache page with the data decoded successfully in the right diagonal direction;
[0169] re-perform horizontal encoding on the user data corresponding to the to-be-processed code word in the cache page based on the first check code of the to-be-processed code word;
[0170] determine the data obtained through the re-performed horizontal decoding as the target decoding user data if the re-performed horizontal decoding is successful.
[0171] By the data decoding method in the embodiments of the present application, when the horizontal decoding of the to-be-processed code word fails, the system can call the horizontal decoding user data of other code words in the same flash page, perform cross-zone decoding on the data of the second check code associated with the other code words whose horizontal decoding is successful, realize the cross-code user data relationship, and use the check relationship of the user data between different code words to derive the correct user data, i.e., the target decoding user data, in the to-be-processed code word, thereby significantly improving the error correction capability of the solid state disk system.
[0172] In the embodiments of the present application, when the data in the error-free set is successfully decoded in the horizontal direction, only the to-be-processed code word needs to be decoded in the horizontal direction, and all the code words in the flash page do not need to be read multiple times. After the data read multiple times is spliced, the LDPC decoding can be performed. The reading of the data does not significantly increase the delay of the solid state disk system.
[0173] To implement the above data decoding method, the present application further provides a data decoding device, which is specifically described in Embodiment One. Figure 14 , Figure 14 FIG. 1 is a structural schematic diagram of an embodiment of the data decoding device provided by the present application.
[0174] The data decoding device 500 in the embodiment includes:
[0175] The obtaining module 51 is configured to decode the original user data in the to-be-processed code word in the horizontal direction based on the first check code in the to-be-processed code word, and obtain other code words in the flash page corresponding to the to-be-processed code word in the case of unsuccessful horizontal decoding.
[0176] a transverse decoding module 52, configured to perform transverse decoding on the original user data in each of the other codewords based on the first check code in each of the other codewords, and obtain transverse decoded user data corresponding to the other codeword on which the transverse decoding succeeds;
[0177] a determination module 53, configured to determine target decoded user data of the to-be-processed codeword based on the transverse decoded user data and at least one second check code, wherein a decoding object of each of the first check codes is user data corresponding to a corresponding codeword, and a decoding object of each of the second check codes includes partial user data corresponding to all codewords in the flash memory page.
[0178] To implement the above data encoding method, the present application further provides a data encoding apparatus, and the data encoding apparatus is specifically shown as follows Figure 15 , Figure 15 is a structural schematic diagram of an embodiment of the data encoding apparatus provided by the present application.
[0179] The data encoding apparatus 700 in this embodiment includes:
[0180] a transverse encoding module 71, configured to perform transverse encoding on each user data in to-be-written data, to obtain a plurality of first check codes corresponding to a plurality of user data;
[0181] a grouping module 72, configured to regroup the plurality of user data, to obtain a plurality of encoding objects, wherein each encoding object includes partial data of each user data in the plurality of user data;
[0182] a cross-zone encoding module 73, configured to perform cross-zone encoding on each encoding object, to obtain a plurality of second check codes corresponding to the plurality of encoding objects;
[0183] an assembling module 74, configured to assemble the plurality of user data, the plurality of first check codes, and the plurality of second check codes into a plurality of codewords, and write the plurality of codewords into a flash memory page.
[0184] To implement the above data encoding method and / or data encoding method, the present application further provides a data encoding and decoding device, and the data encoding and decoding device is specifically shown as follows Figure 16 , Figure 16 is a structural schematic diagram of an embodiment of the data encoding and decoding device provided by the present application.
[0185] The data encoding and decoding device 400 in this embodiment includes a processor 41, a memory 42, an input and output device 43, and a bus 44.
[0186] The processor 41, the memory 42 and the input and output device 43 are connected to the bus 44 respectively, the memory 42 stores program data, and the processor 41 is used to execute the program data to realize the data decoding method and / or the data encoding method described in the above embodiments.
[0187] In the embodiments of the present application, the processor 41 can also be referred to as a CPU (Central Processing Unit). The processor 41 can be an integrated circuit chip with a processing capability of signals. The processor 41 can also be a general processor, a DSP (Digital Signal Process), an ASIC (Application Specific Integrated Circuit), an FPGA (Field Programmable Gate Array) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components. The general processor can be a microprocessor or the processor 41 can also be any conventional processor.
[0188] The present application also provides a computer storage medium, please continue to refer to Figure 17 , Figure 17 is a structural schematic diagram of an embodiment of the computer storage medium provided by the present application. The computer storage medium 600 stores a computer program 61. When the computer program 61 is executed by a processor, the data decoding method and / or the data encoding method of the above embodiments are realized.
[0189] When the embodiments of the present application are realized in the form of software functional units and sold or used as independent products, they can be stored in a computer readable storage medium. Based on this understanding, the technical solutions of the present application or the whole or part of the technical solutions that make essential contributions to the prior art can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes a plurality of instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) or a processor to execute all or part of the steps of the method described in the various embodiments of the present application. The aforementioned storage medium includes a U disk, a mobile hard disk, a ROM (Read-Only Memory), a RAM (Random Access Memory), a magnetic disk or an optical disk and various program code storage media.
[0190] The above merely describes the embodiments of the present application, and does not limit the patent scope of the present application. Any equivalent structure or equivalent process transformation, or direct or indirect application in other related technical fields, which is made according to the content of the present application specification and drawings, is also included in the patent protection scope of the present application.
Claims
1. A data decoding method characterized by, The data decoding method comprises: transversely decoding original user data in a to-be-processed code word based on a first check code in the to-be-processed code word, and obtaining other code words in a flash memory page corresponding to the to-be-processed code word in a case where the transverse decoding fails; transversely decoding original user data in each of the other code words based on a first check code in each of the other code words, and obtaining transversely decoded user data corresponding to the other code words in which the transverse decoding succeeds; determining target decoded user data of the to-be-processed code word based on the transversely decoded user data and at least one second check code, wherein a decoding object of each of the first check codes comprises partial user data corresponding to the corresponding code word, and a decoding object of each of the second check codes comprises partial user data corresponding to all code words in the flash memory page; wherein the determining of the target decoded user data of the to-be-processed code word based on the transversely decoded user data and the at least one second check code comprises: cross-zone decoding each decoding object corresponding to each second check code based on the at least one second check code to obtain decoded data; selecting decoded data corresponding to the to-be-processed code word from the decoded data; and determining the target decoded user data based on the decoded data corresponding to the to-be-processed code word; wherein the transverse decoding is a separate decoding of each user data, and the cross-zone decoding is a decoding of a decoding object composed of partial data from different user data.
2. The data decoding method according to claim 1, characterized by, The cross-zone decoding of each decoding object corresponding to each second check code based on the at least one second check code to obtain decoded data comprises: obtaining a current decoding object corresponding to a current second check code, wherein the current decoding object comprises partial original user data in the to-be-processed code word, partial transversely decoded user data corresponding to the other code words in which the transverse decoding succeeds, and partial original user data in the other code words in which the transverse decoding fails; cross-zone decoding the current decoding object based on the current second check code; determining data obtained after the cross-zone decoding succeeds as the decoded data.
3. The data decoding method of claim 1, wherein, The determining of the target decoded user data based on the decoded data corresponding to the to-be-processed code word comprises: updating original user data in the to-be-processed code word by using the decoded data corresponding to the to-be-processed code word to obtain first updated data; transversely decoding the first updated data based on the first check code in the to-be-processed code word; determining data obtained when the transverse decoding of the first updated data succeeds as the target decoded user data.
4. The data decoding method according to claim 3, characterized by, The data decoding method further comprises: obtaining a plurality of third check codes in a case where the transverse decoding of the first updated data fails, wherein a decoding object of each of the third check codes comprises partial user data corresponding to all code words in the flash memory page, and the decoding object corresponding to any third check code is different from the decoding object corresponding to any second check code; determining the target decoded user data based on the transversely decoded user data and the plurality of third check codes.
5. The data decoding method according to claim 1, wherein The flash page includes N codewords, and a data amount of original user data or transversely decoded user data corresponding to each codeword is a preset data amount; Before determining the target decoded user data of the to-be-processed codeword based on the transversely decoded user data and at least one second check code, the method further includes: The original user data in the to-be-processed codeword, the original user data in the other codewords that fail in transverse decoding, and the transversely decoded user data in the other codewords that succeed in transverse decoding are respectively split according to the same splitting rule to obtain N segmented data sets, wherein each segmented data set includes N segmented data. The decoding object corresponding to each second check code is determined according to the N segmented data sets, and a data amount of the decoding object corresponding to different second check codes is the preset data amount.
6. The data decoding method according to claim 5, characterized by, The data decoding method further includes: obtaining an erasing frequency of a storage block corresponding to the flash page; querying a target statistical table according to the erasing frequency to determine the splitting rule, wherein the splitting rule includes a data length of each segmented data in the splitting process, and the target statistical table records a mapping relationship between the erasing frequency and the splitting rule.
7. A data encoding method characterized by, The data encoding method includes: transversely encoding each user data in to-be-written data to obtain a plurality of first check codes corresponding to a plurality of user data; splitting each user data in the plurality of user data into a plurality of sub-blocks, and recombining all the sub-blocks to obtain a plurality of encoding objects, wherein each encoding object includes part of data of each user data in the plurality of user data, and a data length of a single encoding object is consistent with a data length of a single user data; cross-zone encoding each encoding object to obtain a plurality of second check codes corresponding to the plurality of encoding objects; assembling the plurality of user data, the plurality of first check codes, and the plurality of second check codes into a plurality of codewords, and writing the plurality of codewords into a flash page; wherein the transverse encoding is to encode each user data individually, and the cross-zone encoding is to encode an encoding object composed of part of data from different user data individually.
8. A data coding device, characterized by, The data encoding and decoding device includes a memory and a processor coupled with the memory; wherein the memory is configured to store program data, and the processor is configured to execute the program data to implement the data decoding method according to any one of claims 1 to 6, and / or the data encoding method according to claim 7.
9. A computer storage medium, characterized in that The computer storage medium is configured to store program data, and the program data, when executed by a computer, is configured to implement the data decoding method according to any one of claims 1 to 6, and / or the data encoding method according to claim 7.
Citation Information
Patent Citations
NAND flash memory as well as data checking method and device thereof
CN102110028A