Error correction method, device, equipment and computer program product
By adjusting the error correction mode and storage location according to the stability level of the NandFlash data page, the problem of large differences in data storage stability between different pages is solved, and the stability of data storage is improved.
Patent Information
- Application Number
- CN202111213030.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-10-18
- Publication Date
- 2025-09-16
- Estimated Expiration
- 2041-10-18
AI Technical Summary
The data storage stability of different pages in existing NandFlash varies greatly, and the existing error correction algorithm cannot achieve the optimal error correction requirements for each page, resulting in low data storage stability.
According to the stability level of the data page, the corresponding error correction mode is determined, and the mixed information of the information code and the error correction code is generated through the LDPC error correction algorithm, and the storage position of the error correction code is adjusted to improve the error correction capability.
By adjusting the storage location of the error correction information, the error correction capability of the error correction code is improved, thereby improving the stability of data storage.
Smart Images

Figure CN114048062B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of storage devices, and in particular to an error correction method, apparatus, device and computer program product. Background Art
[0002] With the rapid development of technology, people's requirements for storage devices are becoming increasingly higher. Due to the high read and write performance of solid-state storage devices, NandFlash is becoming increasingly widely used. Currently, the data storage stability of different pages within a WL (WordLine) in NandFlash varies greatly. However, existing firmware (firmware) uses the LDPC (Low Density Parity Check Code) error correction algorithm, and the ECC (Error Checking and Correction) error correction capability of all pages within the WL is the same. Therefore, since the error correction capability of each page is the same, a page with low stability may not be able to achieve the optimal error correction requirements required by itself, resulting in low data storage stability. Summary of the Invention
[0003] The main purpose of the present invention is to provide an error correction method, device, equipment and computer program product, aiming to improve the error correction capability of error correction coding and thereby improve the stability of data storage.
[0004] To achieve the above object, the present invention provides an error correction method applied to a storage device using NandFlash as a storage device, the error correction method comprising the following steps:
[0005] Determining a stability level of the data page to be stored, and determining a corresponding error correction mode according to the stability level;
[0006] Acquiring data to be stored, and performing error correction coding on the data to be stored based on the error correction mode to obtain mixed information of an information code and an error correction code;
[0007] According to the stability level, a page for storing the hybrid information is determined.
[0008] Optionally, the step of performing error correction coding on the data to be stored to obtain mixed information of an information code and an error correction code includes:
[0009] A low-density parity check (LDPC) error correction algorithm is used to perform error correction coding on the data to be stored to obtain mixed information of an information code and an error correction code.
[0010] Optionally, the step of determining a corresponding error correction mode according to the stability level includes:
[0011] If the stability level is medium, an error correction mechanism with medium error correction capability is adopted;
[0012] If the stability level is high, an error correction mechanism with a low error correction capability is adopted;
[0013] If the stability level is low, an error correction mechanism with a high level of error correction capability is adopted.
[0014] Optionally, the step of determining the page for storing the hybrid information according to the stability level includes:
[0015] If the stability level is medium, storing the mixed information in the data page to be stored;
[0016] If the stability level is high, storing the mixed information in the data page to be stored, wherein the data page to be stored has unused space after storing the mixed information;
[0017] If the stability level is low, the mixed information is stored in the data page to be stored, and target information that exceeds the size of the data page to be stored in the mixed information is obtained, and the target information is stored in the unused space in the data page to be stored with a high stability level.
[0018] Optionally, the data pages to be stored with a high stability level are pages of different chip selects CE.
[0019] Optionally, the error correction method further includes:
[0020] When decoding the information code, determining the stability level of the data page stored in the information code;
[0021] The page where the mixed information is stored is determined according to the stability level, so that the mixed information is decoded based on the error correction code stored in the page to obtain original data corresponding to the data to be stored.
[0022] Optionally, the step of determining the page for storing the hybrid information according to the stability level includes:
[0023] If the stability level is medium, determining the page where the hybrid information is stored as the data page to be stored;
[0024] If the stability level is high, determining that the page storing the mixed information is the data page to be stored, wherein the data page to be stored also includes mixed information of other page data;
[0025] If the stability level is low, it is determined that the page where the mixed information is stored is one of the data page to be stored and the data page with a high stability level.
[0026] In addition, to achieve the above-mentioned purpose, an error correction device is deployed in a storage device using NandFlash as a storage device, and the error correction device includes:
[0027] a determination module, configured to determine a stability level of a data page to be stored, and determine a corresponding error correction mode according to the stability level;
[0028] an acquisition module, configured to acquire data to be stored, and perform error correction coding on the data to be stored based on the error correction mode to obtain mixed information of an information code and an error correction code;
[0029] A storage module is used to determine a page for storing the hybrid information according to the stability level.
[0030] In addition, to achieve the above-mentioned purpose, the present invention also provides an error correction coding device, which includes: a memory, a processor, and an error correction program stored on the memory and runnable on the processor, and when the error correction program is executed by the processor, the steps of the error correction method described above are implemented.
[0031] In addition, to achieve the above-mentioned purpose, the present invention further provides a computer-readable storage medium, on which an error correction program is stored. When the error correction program is executed by a processor, the steps of the error correction method described above are implemented.
[0032] In addition, to achieve the above-mentioned object, the present invention further provides a computer program product, which includes a computer program. When the computer program is executed by a processor, the steps of the error correction method described above are implemented.
[0033] The present invention provides an error correction method, apparatus, device, and computer program product, which are applied to a NandFlash storage device. The method determines the stability level of a data page to be stored and, based on the stability level, determines a corresponding error correction mode. The method obtains the data to be stored and, based on the error correction mode, performs error correction encoding on the data to be stored to obtain a mixture of information code and error correction code. The method then determines the page in which the mixed information is stored based on the stability level. By adjusting the storage location of the error correction information based on the stability level of the data page, the method improves the error correction capability of the error correction code and, consequently, improves the stability of data storage. BRIEF DESCRIPTION OF THE DRAWINGS
[0034] Figure 1 A schematic diagram of the terminal structure of the hardware operating environment involved in the embodiment of the present invention;
[0035] Figure 2 Schematic diagram of the flow of the first embodiment of the error correction method of the present invention;
[0036] Figure 3 FIG. 1 is a schematic diagram of the functional modules of the first embodiment of the error correction device of the present invention.
[0037] The purpose, features and advantages of the present invention will be further described with reference to the accompanying drawings and in conjunction with the embodiments. DETAILED DESCRIPTION
[0038] It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention.
[0039] The main solution of the embodiment of the present invention is to: determine the stability level of the data page to be stored, and determine the corresponding error correction mode based on the stability level; obtain the data to be stored, and perform error correction encoding on the data to be stored based on the error correction mode to obtain mixed information of information code and error correction code; and determine the page for storing the mixed information based on the stability level. In this way, according to the stability level of the data page to be stored, the corresponding error correction mode is determined to encode the data to be stored, thereby determining the page for storing the encoded mixed information, ensuring that the error correction code is stored in a page with high stability, thereby improving the error correction capability of the error correction code, and thus improving the stability of data storage.
[0040] The present invention addresses the fact that, in existing solutions, data storage stability varies significantly across different pages within a WordLine (WL). However, existing firmware (FW) uses an LDPC (Low Density Parity Check Code) error correction algorithm, ensuring that all pages within a WL have the same ECC (Error Checking and Correction) capability. Consequently, pages with low stability may not be able to meet their required error correction requirements due to the uniformity of the error correction capability across all pages, resulting in low data storage stability.
[0041] Technical terms involved in the embodiments of the present invention:
[0042] An SSD (Solid State Disk or Solid State Drive), also known as a solid-state drive (SSD), is a hard drive made with an array of solid-state electronic memory chips. SSDs use two types of storage media: flash memory (FLASH chips) and DRAM. The latest technology also includes Intel's XPoint chip technology. Flash-based SSDs use FLASH chips as their storage medium and can be manufactured in a variety of forms, such as laptop hard drives, microdrives, memory cards, and USB flash drives. The biggest advantage of this type of SSD is its portability and data protection against power outages, making it adaptable to various environments and suitable for individual users. Its lifespan varies depending on the flash memory medium. SLC flash memory generally reaches over 10,000 cycles of read / write (PE), MLC can reach over 3,000, and TLC reaches around 1,000. The latest QLC flash memory also guarantees a lifespan of 300 cycles. The average user's annual write volume does not exceed 50 times the hard drive's capacity. Even the cheapest QLC flash memory offers a six-year write lifespan. The reliability is very high, and high-quality home solid-state drives can easily achieve a failure rate that is one-tenth of that of ordinary home mechanical hard drives.
[0043] Reference Figure 1 , Figure 1 This is a schematic diagram of the terminal structure of the hardware operating environment involved in the embodiment of the present invention.
[0044] The terminal in the embodiment of the present invention is an error correction device (modified error correction device or error correction coding and decoding device). The error correction coding device can be a terminal device with processing function such as a PC (personal computer), a microcomputer, a laptop computer, a server, etc.
[0045] like Figure 1 As shown, the terminal may include: a processor 1001, such as a CPU (Central Processing Unit), a communication bus 1002, a user interface 1003, a network interface 1004, and a memory 1005. Among them, the communication bus 1002 is used to realize the connection and communication between these components. The user interface 1003 may include a display screen (Display), an input unit such as a keyboard (Keyboard), and the user interface 1003 may optionally include a standard wired interface and a wireless interface. The network interface 1004 may optionally include a standard wired interface and a wireless interface (such as a WI-FI interface). The memory 1005 may be a high-speed RAM memory or a stable memory (non-volatile memory), such as a disk memory. The memory 1005 may optionally be a storage device independent of the aforementioned processor 1001.
[0046] Those skilled in the art will understand that Figure 1 The terminal structure shown in the figure does not constitute a limitation to the terminal, and may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently.
[0047] like Figure 1 As shown, the memory 1005 as a computer storage medium may include an operating system, a network communication module, a user interface module, and an error correction program.
[0048] exist Figure 1 In the terminal shown, NandFlash is used as a storage device, and the processor 1001 can be used to call the error correction program stored in the memory 1005 and perform the following operations:
[0049] Determining a stability level of the data page to be stored, and determining a corresponding error correction mode according to the stability level;
[0050] Acquiring data to be stored, and performing error correction coding on the data to be stored based on the error correction mode to obtain mixed information of an information code and an error correction code;
[0051] According to the stability level, a page for storing the hybrid information is determined.
[0052] Furthermore, the processor 1001 may be configured to call the error correction program stored in the memory 1005 and perform the following operations:
[0053] A low-density parity check (LDPC) error correction algorithm is used to perform error correction coding on the data to be stored to obtain mixed information of an information code and an error correction code.
[0054] Furthermore, the processor 1001 may be configured to call the error correction program stored in the memory 1005 and perform the following operations:
[0055] If the stability level is medium, an error correction mechanism with medium error correction capability is adopted;
[0056] If the stability level is high, an error correction mechanism with a low error correction capability is adopted;
[0057] If the stability level is low, an error correction mechanism with a high level of error correction capability is adopted.
[0058] Furthermore, the processor 1001 may be configured to call the error correction program stored in the memory 1005 and perform the following operations:
[0059] If the stability level is medium, storing the mixed information in the data page to be stored;
[0060] If the stability level is high, storing the mixed information in the data page to be stored, wherein the data page to be stored has unused space after storing the mixed information;
[0061] If the stability level is low, the mixed information is stored in the data page to be stored, and target information that exceeds the size of the data page to be stored in the mixed information is obtained, and the target information is stored in the unused space in the data page to be stored with a high stability level.
[0062] Furthermore, the data pages to be stored with a high stability level are pages of different chip selects CE.
[0063] Furthermore, the processor 1001 may be configured to call the error correction program stored in the memory 1005 and perform the following operations:
[0064] When decoding the information code, determining the stability level of the data page stored in the information code;
[0065] The page where the error correction code is stored is determined according to the stability level, so that the information code is decoded based on the error correction code stored in the page to obtain original data corresponding to the data to be stored.
[0066] Furthermore, the processor 1001 may be configured to call the error correction program stored in the memory 1005 and perform the following operations:
[0067] If the stability level is medium, determining that the page storing the error correction code is the data page to be stored;
[0068] If the stability level is high, determining that the page in which the error correction code is stored is the data page to be stored, wherein the data page to be stored also includes error correction codes for other page data;
[0069] If the stability level is low, it is determined that the page where the error correction code is stored is one of the data page to be stored and the data page with a high stability level.
[0070] Based on the above hardware structure, various embodiments of the error correction method of the present invention are proposed.
[0071] The present invention provides an error correction method.
[0072] Reference Figure 2 , Figure 2 FIG. 1 is a flow chart of the first embodiment of the error correction method of the present invention.
[0073] In this embodiment, the error correction method is applied to a storage device using NandFlash as a storage device, and the error correction method includes:
[0074] Step S10, determining the stability level of the data page to be stored, and determining a corresponding error correction mode according to the stability level;
[0075] In this embodiment, the data page to be stored is a page in a Flash memory. The data page to be stored is a page where data is to be stored.
[0076] It should be noted that the data storage stability of different Pages in WL varies greatly. Therefore, it is necessary to determine the stability level of the data page to be stored in order to allocate the corresponding error correction capability based on the stability level, that is, to determine the corresponding error correction mode.
[0077] In this embodiment and the following embodiments, the storage device is described by taking an SSD as an example.
[0078] In addition, it should be noted that an SSD includes several channels, that is, an SSD includes one or more channels (channel), therefore, each data page to be stored may be a data page in a different channel. An SSD includes several chip select CEs, that is, an SSD includes one or more CEs, therefore, each data page to be stored may be a data page in a different CE. A channel includes several LUNs (Logical Unit Numbers), that is, a channel includes one or more LUNs. Among them, LUN may be flash, the flash may be NandFlash or NorFlash, LUN may also be a page (page) or Block (block) of flash, or other execution units, which are not specifically limited here, therefore, the data pages to be stored may be data pages in different LUNs.
[0079] In one embodiment, the step S10 includes:
[0080] Determine a channel to be stored; determine a data page to be stored based on the channel to be stored; determine a stability level of the data page to be stored, and determine a corresponding error correction mode based on the stability level. Wherein, the data page to be stored is a page in the channel.
[0081] In another embodiment, the step S10 includes:
[0082] Determine a CE to be stored; determine a data page to be stored based on the CE to be stored; determine a stability level of the data page to be stored, and determine a corresponding error correction mode based on the stability level. Wherein, the data page to be stored is a page in the CE.
[0083] In another embodiment, the step S10 includes:
[0084] Determine a LUN to be stored; determine a data page to be stored based on the LUN to be stored; determine a stability level of the data page to be stored, and determine a corresponding error correction mode based on the stability level, wherein the data page to be stored is a page in the LUN.
[0085] In another embodiment, the step S10 includes:
[0086] Determine a channel to be stored; determine a CE to be stored based on the channel to be stored; determine a data page to be stored based on the CE to be stored; determine a stability level of the data page to be stored, and determine a corresponding error correction mode based on the stability level. Wherein, the data page to be stored is a page in a CE in the channel.
[0087] In another embodiment, the step S10 includes:
[0088] Determine a channel to be stored; determine a LUN to be stored based on the channel to be stored; determine a data page to be stored based on the LUN to be stored; determine a stability level of the data page to be stored, and determine a corresponding error correction mode based on the stability level. The data page to be stored is a page in a LUN in the channel.
[0089] In addition, it should be noted that the number of stability levels of the data page can be set according to actual needs, for example, three levels, high level, medium level and low level. Of course, more or fewer levels can be included, which is not limited here.
[0090] Specifically, in the above step S10, determining the corresponding error correction mode according to the stability level includes:
[0091] Step A11: If the stability level is medium, adopt an error correction mechanism with medium error correction capability;
[0092] Step A12: If the stability level is high, adopt an error correction mechanism with a low error correction capability;
[0093] Step A13: If the stability level is low, an error correction mechanism with a high error correction capability is adopted.
[0094] In this embodiment, if the stability level is medium, an error correction mechanism with medium error correction capability is adopted; if the stability level is high, an error correction mechanism with low error correction capability is adopted; if the stability level is low, an error correction mechanism with high error correction capability is adopted; so as to provide for subsequent error correction coding based on error correction mechanisms with different levels of error correction capability.
[0095] It should be noted that the error correction mechanism with a low level of error correction capability generates an error correction code with a shorter length; the error correction mechanism with a high level of error correction capability generates an error correction code with a longer length.
[0096] Step S20, obtaining the data to be stored, and performing error correction coding on the data to be stored based on the error correction mode to obtain mixed information of the information code and the error correction code;
[0097] In this embodiment, data to be stored is obtained, and error correction coding is performed on the data to be stored based on an error correction mode to obtain mixed information of an information code and an error correction code. The data to be stored is data that needs to be stored in a flash memory of a solid-state drive (SSD), and specifically, the data to be stored is data that needs to be stored in a page of the flash memory.
[0098] It should be noted that in order to prevent errors in the transmission or storage of the data to be stored, such as data loss and data tampering, error correction coding needs to be performed on the data to be stored to ensure that the data to be stored is accurately decoded in the end.
[0099] In addition, it should be noted that the data to be stored can be data sent by the host that needs to be stored in the SSD, or it can be data sent by the master control or other devices in the SSD, that is, data that needs to be stored in the flash.
[0100] The error correction coding algorithm can be set according to actual needs, for example, LDPC (Low Density Parity Check Code) and BCH coding, etc. In addition, the information code is a coded code element containing the data to be stored, and the error correction code is used to decode the information code to obtain the original data to be stored.
[0101] In one embodiment, in step S20, error correction coding is performed on the data to be stored to obtain mixed information of an information code and an error correction code, including:
[0102] A low-density parity check (LDPC) error correction algorithm is used to perform error correction coding on the data to be stored, obtaining a mixture of information code and error correction code. In this embodiment, the LDPC error correction algorithm is a commonly used ECC (Error Checking and Correction) algorithm for SSDs and is not described in detail here.
[0103] In another embodiment, in the above step S20, error correction coding is performed on the data to be stored to obtain mixed information of the information code and the error correction code, including:
[0104] Step A11: adopting a low-density parity check code LDPC error correction algorithm to perform error correction coding on the data to be stored to obtain mixed information of an information code and an error correction code.
[0105] In this embodiment, a low-density parity-check code LDPC error correction algorithm is used to perform error correction coding on the data to be stored to obtain mixed information of an information code and an error correction code.
[0106] In another embodiment, in the above step S20, error correction coding is performed on the data to be stored to obtain mixed information of the information code and the error correction code, including:
[0107] The BCH error correction algorithm is used to perform error correction coding on the data to be stored to obtain mixed information of an information code and an error correction code.
[0108] In another embodiment, in the above step S20, error correction coding is performed on the data to be stored to obtain mixed information of the information code and the error correction code, including:
[0109] The FW uses a BCH error correction algorithm to perform error correction coding on the data to be stored to obtain mixed information of an information code and an error correction code.
[0110] Step S30: determining a page for storing the error correction code according to the stability level.
[0111] In this embodiment, the page where the error correction code is stored is determined based on the stability level of the data page, so that the mixed information is stored in the page. The page where the error correction code is stored can be one or more pages. If there are more than one page, the error correction code is stored in a dispersed manner.
[0112] It should be noted that distributing the error correction codes means storing the error correction codes as much as possible in the data page to be stored, and then storing the remaining error correction codes in pages with higher stability levels, so that the data stored in the data page is more stable.
[0113] In one embodiment, the step S30 includes:
[0114] If the stability level is less than the preset level, the page where the error correction code is stored is determined to be a page with higher stability than the data page to be stored and the data page to be stored, so that the error correction code is dispersedly stored in the page with higher stability than the data page to be stored and the data page to be stored; if the stability level is less than or equal to the preset level, the page where the error correction code is stored is determined to be the data page to be stored, so that the error correction code is stored in the data page to be stored. The preset level can be set according to actual needs and is not limited here. It should be noted that dispersing the error correction code means storing the error correction code as much as possible in the data page to be stored, and then storing the remaining error correction code in a page with a higher stability level, so that the data stored in the data page to be stored is more stable. In addition, the page with higher stability than the data page to be stored may include one page or multiple pages, that is, the error correction code can be dispersedly stored in two or more pages.
[0115] In another embodiment, the stability level includes a high level, a medium level, and a low level. If the stability level is less than a preset level, determining that the page stored in the error correction code has a higher stability than the page of data to be stored and the page of data to be stored includes:
[0116] If the stability level is lower than the preset level, the page in which the error correction code is stored is determined to be the page corresponding to the high level and the data page to be stored. The preset level can be set to any of the aforementioned high, medium, and low levels. Furthermore, the page with higher stability than the data page to be stored can include one or more pages, meaning that the error correction code can be stored dispersed across two or more pages.
[0117] In another embodiment, the stability level includes a high level, a medium level, and a low level, the preset level is a medium level, and if the stability level is less than the preset level, the step of determining that the page stored in the error correction code has a higher stability than the page of data to be stored and the page of data to be stored includes:
[0118] If the stability level is lower than the medium level, the page where the error correction code is stored is determined to be the page corresponding to the high level and the data page to be stored. The preset level is set to medium so that the error correction code corresponding to the medium or high level is stored in the data page to be stored. Error correction codes corresponding to low levels are not only stored in the data page to be stored, but also distributed across other pages of higher levels, thereby improving data storage stability. Furthermore, the page with higher stability than the data page to be stored may include one or more pages, meaning that the error correction code may be distributed across two or more pages.
[0119] Furthermore, the page with higher stability than the data page to be stored is a page of a different chip select CE. It should be noted that the dispersed stored pages can be pages of different CEs, that is, the data page to be stored and the page with higher stability than the data page to be stored can be pages under different CEs.
[0120] Furthermore, the page with higher stability than the data page to be stored is a page in a different channel. It should be noted that the dispersedly stored pages can be pages in different channels, that is, the data page to be stored and the page with higher stability than the data page to be stored can be pages in different channels.
[0121] Furthermore, the page with higher stability than the data page to be stored is a page of a different LUN. It should be noted that the dispersed stored pages can be pages of different LUNs, that is, the data page to be stored and the page with higher stability than the data page to be stored can be pages of different LUNs.
[0122] In this embodiment, if the stability level is less than a preset level, the page in which the error correction code is stored is determined to be a page with higher stability than the data page and the data page, so that the error correction code is dispersedly stored in the page with higher stability than the data page and the data page. If the stability level is less than or equal to the preset level, the page in which the error correction code is stored is determined to be the data page, so that the error correction code is stored in the data page. In this manner, the page in which the error correction code is stored is determined based on the stability level of the data page, so that the error correction code can be dispersedly stored in the pages with higher stability, thereby improving the error correction capability of the error correction code and thus improving the stability of data storage.
[0123] Correspondingly, after error correction coding, decoding is required. Specifically, the error correction method further includes:
[0124] When decoding the information code stored in the data page to be stored, the stability level of the data page to be stored is determined; based on the stability level, the page where the error correction code is stored is determined, so that the information code can be decoded based on the error correction code stored in the page to obtain the original data corresponding to the data to be stored. It should be noted that the number of stability levels of the data page to be stored can be set according to actual needs, such as three levels, high level, medium level and low level. Of course, more or fewer levels can be included, which is not limited here.
[0125] The page where the error correction code is stored may be one or more pages. If there are more than one page, the partial error correction codes stored in each page are merged into a complete error correction code.
[0126] In one embodiment, the step of determining, based on the stability level, the page in which the error correction code is stored, so as to decode the information code based on the error correction code stored in the page to obtain the original data corresponding to the data to be stored includes:
[0127] If the stability level is less than the preset level, the page where the error correction code is stored is determined to be a page with higher stability than the data page to be stored and the data page to be stored; the partial error correction code stored in the page with higher stability than the data page to be stored and the partial error correction code stored in the data page to be stored are merged to obtain the error correction code, so as to decode the information code based on the error correction code and obtain the original data corresponding to the data to be stored; if the stability level is greater than or equal to the preset level, the page where the error correction code is stored is determined to be the data page to be stored, so as to decode the information code based on the error correction code stored in the data page to be stored and obtain the original data corresponding to the data to be stored. The preset level can be set according to actual needs and is not limited here. It should be noted that the page with higher stability than the data page to be stored may include one page or multiple pages, that is, the error correction code can be stored in two or more pages in a dispersed manner.
[0128] In another embodiment, the stability level includes a high level, a medium level, and a low level. The step of determining, based on the stability level, a page in which the error correction code is stored, so as to decode the information code based on the error correction code stored in the page to obtain the original data corresponding to the data to be stored includes:
[0129] If the stability level is less than the preset level, the page in which the error correction code is stored is determined to be a page with higher stability than the data page to be stored and the data page to be stored; the partial error correction code stored in the page with higher stability than the data page to be stored and the partial error correction code stored in the data page to be stored are merged to obtain the error correction code, so as to decode the information code based on the error correction code and obtain the original data corresponding to the data to be stored; if the stability level is greater than or equal to the preset level, the page in which the error correction code is stored is determined to be the data page to be stored, so as to decode the information code based on the error correction code stored in the data page to be stored and obtain the original data corresponding to the data to be stored. The preset level can be set to any one of the above-mentioned high level, medium level and low level. In addition, the page with higher stability than the data page to be stored can include one page or multiple pages, that is, the error correction code can be stored in two or more pages in a dispersed manner.
[0130] In another embodiment, the stability level includes a high level, a medium level, and a low level, the preset level is a medium level, and the step of determining, based on the stability level, a page in which the error correction code is stored, so as to decode the information code based on the error correction code stored in the page to obtain the original data corresponding to the data to be stored includes:
[0131] If the stability level is less than the preset level, the page in which the error correction code is stored is determined to be a page with higher stability than the data page to be stored and the data page to be stored; the partial error correction code stored in the page with higher stability than the data page to be stored and the partial error correction code stored in the data page to be stored are merged to obtain the error correction code, so as to decode the information code based on the error correction code to obtain the original data corresponding to the data to be stored; if the stability level is greater than or equal to the preset level, the page in which the error correction code is stored is determined to be the data page to be stored, so as to decode the information code based on the error correction code stored in the data page to be stored to obtain the original data corresponding to the data to be stored. The preset level is set to a medium level so that the error correction code corresponding to the medium or high level can be stored in its own data page to be stored, while the error correction code corresponding to the low level is not only stored in its own data page to be stored, but also dispersedly stored in other higher-level pages to improve the stability of data storage. In addition, the page with higher stability than the data page to be stored may include one page or multiple pages, that is, the error correction code may be stored in two or more pages in a dispersed manner.
[0132] Furthermore, the page with higher stability than the data page to be stored is a page of a different chip select CE. It should be noted that the dispersed stored pages can be pages of different CEs, that is, the data page to be stored and the page with higher stability than the data page to be stored can be pages under different CEs.
[0133] Furthermore, the page with higher stability than the data page to be stored is a page in a different channel. It should be noted that the dispersedly stored pages can be pages in different channels, that is, the data page to be stored and the page with higher stability than the data page to be stored can be pages in different channels.
[0134] Furthermore, the page with higher stability than the data page to be stored is a page of a different LUN. It should be noted that the dispersed stored pages can be pages of different LUNs, that is, the data page to be stored and the page with higher stability than the data page to be stored can be pages of different LUNs.
[0135] An embodiment of the present invention provides an error correction method for a storage device using NandFlash as a memory device. The method determines the stability level of a data page to be stored and, based on the stability level, determines a corresponding error correction mode. The method then obtains the data to be stored and, based on the error correction mode, performs error correction encoding on the data to obtain a mixture of information code and error correction code. The method then determines the page in which the mixed information is stored based on the stability level. Through this method, the embodiment of the present invention adjusts the storage location of the error correction information by referencing the stability level of the data page, thereby improving the error correction capability of the error correction encoding and, consequently, the stability of data storage.
[0136] Furthermore, based on the above-mentioned first embodiment, a second embodiment of the error correction method of the present invention is proposed.
[0137] In this embodiment, the above step S30 includes:
[0138] Step A31: if the stability level is medium, storing the mixed information in the data page to be stored;
[0139] In this embodiment, if the stability level is medium, that is, the stability level is equal to the preset level, and the preset level is medium, the mixed information is stored in the data page to be stored, that is, the page where the error correction code is stored is determined to be the data page to be stored, so that the error correction code is stored in the data page to be stored.
[0140] Step A32: If the stability level is high, storing the mixed information in the data page to be stored, wherein the data page to be stored has unused space after storing the mixed information;
[0141] In this embodiment, if the stability level is high, that is, the stability level is greater than the preset level, the mixed information is stored in the data page to be stored, that is, the page where the error correction code is stored is determined to be the data page to be stored, so that the error correction code is stored in the data page to be stored.
[0142] It should be noted that because the stability level of the data page to be stored is high, the length of the error correction code generated by the corresponding error correction mechanism is relatively small. Therefore, after storing the mixed information, there is still unused space in the data page to be stored for storing the error correction code corresponding to the low stability level.
[0143] Step A33: If the stability level is low, the mixed information is stored in the data page to be stored, and the target information in the mixed information that exceeds the size of the data page to be stored is obtained, and the target information is stored in the unused space in the data page to be stored with a high stability level.
[0144] In this embodiment, if the stability level is low, i.e., the stability level is less than medium, then the mixed information is stored in the data page to be stored, and target information that exceeds the size of the data page to be stored in the mixed information is obtained. The target information is stored in the unused space of the data page to be stored with a high stability level. In other words, the page where the error correction code is stored is determined to be the page corresponding to the high level and the data page to be stored, i.e., distributed storage. The preset level is set to medium so that the error correction code corresponding to the medium or high level is stored in the data page to be stored, while the error correction code corresponding to the low level is not only stored in the data page itself, but also distributedly stored in other pages of higher levels to improve the stability of data storage. In addition, the page with higher stability than the data page can include one or more pages, i.e., the error correction code can be distributedly stored in two or more pages.
[0145] Furthermore, the data pages to be stored with a higher stability level are pages of different chip select CEs. It should be noted that the dispersed stored pages can be pages of different CEs, that is, the data pages to be stored and the pages with higher stability than the data pages to be stored can be pages of different CEs.
[0146] Furthermore, the data pages to be stored with a higher stability level are pages of different channels. It should be noted that the dispersedly stored pages can be pages of different channels, that is, the data pages to be stored and the pages with higher stability than the data pages to be stored can be pages of different channels.
[0147] Furthermore, the data pages to be stored with a higher stability level are pages of different LUNs. It should be noted that the dispersed stored pages can be pages of different LUNs, that is, the data pages to be stored and the pages with higher stability than the data pages to be stored can be pages of different LUNs.
[0148] In this embodiment, if the stability level is medium, the mixed information is stored in the data page to be stored; if the stability level is high, the mixed information is stored in the data page to be stored, wherein the data page to be stored after storing the mixed information still has unused space; if the stability level is low, the mixed information is stored in the data page to be stored, and target information that exceeds the size of the data page to be stored in the mixed information is obtained, and the target information is stored in the unused space of the data page to be stored with the high stability level. In this way, the page where the error correction code is stored is determined according to the stability level of the data page, so that the error correction code can be distributed and stored in the page with higher stability, thereby improving the error correction capability of the error correction code and thus improving the stability of data storage.
[0149] Furthermore, based on the above-mentioned first embodiment or second embodiment, a third embodiment of the error correction method of the present invention is proposed.
[0150] In this embodiment, the error correction method further includes:
[0151] Step A40, when decoding the information code, determining the stability level of the data page stored in the information code;
[0152] Step A50 : determining a page where the mixed information is stored according to the stability level, so as to decode the mixed information stored in the page and obtain original data corresponding to the data to be stored.
[0153] In one embodiment, if only the error correction code is stored in a dispersed manner during the error correction coding stage, the stability level of the data page to be stored is determined when the information code stored in the data page to be stored is decoded; based on the stability level, the page where the error correction code is stored is determined for decoding based on the error correction code and the information code stored in the page to obtain the original data corresponding to the data to be stored.
[0154] It should be noted that the number of stability levels of the data page can be set according to actual needs, for example, three levels, high level, medium level and low level. Of course, more or fewer levels can be included, which is not limited here.
[0155] In one embodiment, the step of determining the page for storing the hybrid information according to the stability level includes:
[0156] Step A51: If the stability level is medium, determining the page of the hybrid information storage as the data page to be stored;
[0157] Step A52: If the stability level is high, determining that the page storing the mixed information is the data page to be stored, wherein the data page to be stored also includes mixed information of other page data;
[0158] Step A53: If the stability level is low, determine that the page where the mixed information is stored is one of the data page to be stored and the data page with a high stability level.
[0159] In this embodiment, if the stability level is low, that is, if the stability level is less than a preset level, the page in which the error correction code is stored is determined to be a page with higher stability than the data page to be stored and the data page to be stored; the partial error correction code stored in the page with higher stability than the data page to be stored and the partial error correction code stored in the data page to be stored are merged to obtain the error correction code, so as to decode the information code based on the error correction code and obtain the original data corresponding to the data to be stored. If the stability level is less than or equal to the preset level, the page in which the error correction code is stored is determined to be the data page to be stored, so as to decode the information code based on the error correction code stored in the data page to be stored and obtain the original data corresponding to the data to be stored. The preset level can be set according to actual needs and is not limited here. It should be noted that the page with higher stability than the data page can include one page or multiple pages, that is, the error correction code can be stored in two or more pages.
[0160] In another embodiment, the stability level includes a high level, a medium level, and a low level. The step of determining, based on the stability level, a page in which the error correction code is stored, so as to decode the information code based on the error correction code stored in the page to obtain the original data corresponding to the data to be stored includes:
[0161] If the stability level is less than the preset level, the page in which the error correction code is stored is determined to be a page with higher stability than the data page and the data page to be stored; the partial error correction code stored in the page with higher stability than the data page to be stored and the partial error correction code stored in the data page to be stored are merged to obtain the error correction code, so as to decode the information code based on the error correction code and obtain the original data corresponding to the data to be stored; if the stability level is greater than or equal to the preset level, the page in which the error correction code is stored is determined to be the data page to be stored, so as to decode the information code based on the error correction code stored in the data page to be stored and obtain the original data corresponding to the data to be stored. The preset level can be set to any one of the above-mentioned high level, medium level and low level. In addition, the page with higher stability than the data page to be stored can include one page or multiple pages, that is, the error correction code can be stored in two or more pages in a dispersed manner.
[0162] In another embodiment, the stability level includes a high level, a medium level, and a low level, the preset level is a medium level, and the step of determining, based on the stability level, a page in which the error correction code is stored, so as to decode the information code based on the error correction code stored in the page to obtain the original data corresponding to the data to be stored includes:
[0163] If the stability level is less than the preset level, the page in which the error correction code is stored is determined to be a page with higher stability than the data page to be stored and the data page to be stored; the partial error correction code stored in the page with higher stability than the data page to be stored and the partial error correction code stored in the data page to be stored are merged to obtain the error correction code, so as to decode the information code based on the error correction code to obtain the original data corresponding to the data to be stored; if the stability level is greater than or equal to the preset level, the page in which the error correction code is stored is determined to be the data page to be stored, so as to decode the information code based on the error correction code stored in the data page to be stored to obtain the original data corresponding to the data to be stored. The preset level is set to a medium level so that the error correction code corresponding to the medium or high level can be stored in its own data page to be stored, while the error correction code corresponding to the low level is not only stored in its own data page to be stored, but also dispersedly stored in other higher-level pages to improve the stability of data storage. In addition, the page with higher stability than the data page to be stored may include one page or multiple pages, that is, the error correction code may be stored in two or more pages in a dispersed manner.
[0164] Furthermore, the page with higher stability than the data page to be stored is a page of a different chip select CE. It should be noted that the dispersed stored pages can be pages of different CEs, that is, the data page to be stored and the page with higher stability than the data page to be stored can be pages under different CEs.
[0165] Furthermore, the page with higher stability than the data page to be stored is a page in a different channel. It should be noted that the dispersedly stored pages can be pages in different channels, that is, the data page to be stored and the page with higher stability than the data page to be stored can be pages in different channels.
[0166] Furthermore, the page with higher stability than the data page to be stored is a page of a different LUN. It should be noted that the dispersed stored pages can be pages of different LUNs, that is, the data page to be stored and the page with higher stability than the data page to be stored can be pages of different LUNs.
[0167] In this embodiment, the page where the error correction code is stored is determined based on the stability level of the data page to be stored, so as to merge the partial error correction codes to obtain a complete error correction code. Compared with the shorter error correction codes in the prior art, this embodiment can improve the error correction capability of the error correction code, thereby improving the stability of data storage.
[0168] The invention also provides an error correction device.
[0169] Reference Figure 3 , Figure 3 FIG. 1 is a schematic diagram of the functional modules of the first embodiment of the error correction device of the present invention.
[0170] In this embodiment, the error correction device is deployed in a storage device using NandFlash as a storage device, and the error correction device includes:
[0171] A determination module 10 is configured to determine a stability level of a data page to be stored, and determine a corresponding error correction mode according to the stability level;
[0172] An acquisition module 20 is configured to acquire data to be stored, and perform error correction coding on the data to be stored based on the error correction mode to obtain mixed information of an information code and an error correction code;
[0173] The storage module 30 is configured to determine a page for storing the hybrid information according to the stability level.
[0174] Among them, each virtual function module of the above error correction device is stored in Figure 1 The memory 1005 of the error correction coding device shown is used to implement all functions of the error correction program; when each module is executed by the processor 1001, the error correction coding function can be implemented.
[0175] Among them, the functional implementation of each module in the above-mentioned error correction device corresponds to the various steps in the above-mentioned error correction method embodiment, and its functions and implementation processes will not be repeated here one by one.
[0176] The present invention also provides a computer-readable storage medium having an error correction program stored thereon. When the error correction program is executed by a processor, the steps of the error correction method described in any one of the above embodiments are implemented.
[0177] The specific embodiments of the computer-readable storage medium of the present invention are substantially the same as the embodiments of the above-mentioned error correction method, and are not described in detail here.
[0178] The present invention also provides a computer program product, which includes a computer program. When the computer program product is executed by a processor, it implements the steps of the error correction method described in any one of the above embodiments.
[0179] The specific embodiments of the computer program product of the present invention are basically the same as the embodiments of the above-mentioned error correction method, and will not be described in detail here.
[0180] It should be noted that, in this document, the terms "comprises," "includes," or any other variations thereof are intended to encompass non-exclusive inclusion, such that a process, method, article, or system comprising a series of elements includes not only those elements but also other elements not explicitly listed, or elements inherent to such process, method, article, or system. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of other identical elements in the process, method, article, or system comprising the element.
[0181] The serial numbers of the above embodiments of the present invention are for description only and do not represent the advantages or disadvantages of the embodiments.
[0182] Through the description of the above embodiments, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus the necessary general hardware platform, and of course can also be implemented by hardware, but in many cases the former is a better embodiment. Based on this understanding, the technical solution of the present invention is essentially or the part that contributes to the prior art can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) as described above, and includes a number of instructions for enabling a terminal device (which can be a mobile phone, computer, server, or network device, etc.) to execute the methods described in each embodiment of the present invention.
[0183] The above are only preferred embodiments of the present invention and are not intended to limit the patent scope of the present invention. Any equivalent structure or equivalent process transformation made using the contents of the present invention description 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. An error correction method, characterized in that: Applied to a storage device using NandFlash as a storage device, the error correction method includes the following steps: Determining a stability level of the data page to be stored, and determining a corresponding error correction mode based on the stability level, wherein the stability levels include low, medium, and high levels, and the higher the stability level, the smaller the error correction code length generated by the corresponding error correction mode; Acquire data to be stored, and perform error correction coding on the data to be stored based on the error correction mode to obtain mixed information of an information code and an error correction code, wherein the information code is a coding symbol containing information of the data to be stored, and the error correction code is used to decode the information code to obtain the data to be stored; If the stability level is the medium level, storing the mixed information in the data page to be stored; If the stability level is the high level, storing the mixed information in the data page to be stored, wherein the data page to be stored has unused space after storing the mixed information; If the stability level is the low level, the mixed information is stored in the data page to be stored, and target information that exceeds the size of the data page to be stored in the mixed information is obtained, and the target information is stored in the unused space in the data page to be stored whose stability level is the high level.
2. The error correction method according to claim 1, wherein: The step of performing error correction coding on the data to be stored to obtain mixed information of the information code and the error correction code includes: A low-density parity check (LDPC) error correction algorithm is used to perform error correction coding on the data to be stored to obtain mixed information of an information code and an error correction code.
3. The error correction method according to claim 1, wherein: The step of determining a corresponding error correction mode according to the stability level includes: If the stability level is the medium level, an error correction mechanism with medium error correction capability is adopted; If the stability level is the high level, an error correction mechanism with a low level of error correction capability is adopted; If the stability level is the low level, an error correction mechanism with a high level of error correction capability is adopted.
4. The error correction method according to claim 1, wherein: The data pages to be stored with a high stability level are pages of different chip selects CE.
5. The error correction method according to claim 1, wherein: The error correction method further comprises: When decoding the information code, determining the stability level of the data page stored in the information code; According to the stability level, a page where the mixed information is stored is determined, so as to decode the mixed information stored in the page to obtain original data corresponding to the data to be stored.
6. The error correction method according to claim 5, wherein: The step of determining the page for storing the hybrid information according to the stability level includes: If the stability level is medium, determining the page where the hybrid information is stored as the data page to be stored; If the stability level is high, determining that the page storing the mixed information is the data page to be stored, wherein the data page to be stored also includes mixed information of other page data; If the stability level is low, it is determined that the page where the mixed information is stored is one of the data page to be stored and the data page with a high stability level.
7. An error correction device, characterized in that: Deployed in a storage device using NandFlash as a storage device, the error correction device includes: a determination module, configured to determine a stability level of a data page to be stored, and determine a corresponding error correction mode based on the stability level, wherein the stability levels include low, medium, and high levels, and the higher the stability level, the smaller the error correction code length generated by the corresponding error correction mode; an acquisition module, configured to acquire data to be stored, and perform error correction coding on the data to be stored based on the error correction mode to obtain mixed information of an information code and an error correction code, wherein the information code is a coding symbol containing information of the data to be stored, and the error correction code is used to decode the information code to obtain the data to be stored; A storage module is configured to store the mixed information in the data page to be stored if the stability level is medium; store the mixed information in the data page to be stored if the stability level is high, wherein the data page to be stored still has unused space after storing the mixed information; and store the mixed information in the data page to be stored if the stability level is low, obtain target information in the mixed information that exceeds the size of the data page to be stored, and store the target information in the unused space of the data page to be stored with the high stability level.
8. An error correction coding device, characterized in that The error correction coding device includes: a memory, a processor, and an error correction program stored in the memory and executable on the processor. When the error correction program is executed by the processor, the steps of the error correction method according to any one of claims 1 to 6 are implemented.
9. A computer program product, characterized in that The computer program product comprises a computer program, and when the computer program is executed by a processor, the steps of the error correction method according to any one of claims 1 to 6 are implemented.
Citation Information
Patent Citations
Fault-tolerant system and method for adjusting error correcting codes adaptively
CN103269230A
Solid-state disk error correction method combining error detection code with error correction code
CN106601305A