[go: up one dir, main page]

CN1612119A - Solid state storage unit safety storage system and method - Google Patents

Solid state storage unit safety storage system and method Download PDF

Info

Publication number
CN1612119A
CN1612119A CN 200310111996 CN200310111996A CN1612119A CN 1612119 A CN1612119 A CN 1612119A CN 200310111996 CN200310111996 CN 200310111996 CN 200310111996 A CN200310111996 A CN 200310111996A CN 1612119 A CN1612119 A CN 1612119A
Authority
CN
China
Prior art keywords
data
solid
state memory
redundancy check
page
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN 200310111996
Other languages
Chinese (zh)
Other versions
CN100468367C (en
Inventor
赵国胜
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hongfujin Precision Industry Shenzhen Co Ltd
Hon Hai Precision Industry Co Ltd
Original Assignee
Hongfujin Precision Industry Shenzhen Co Ltd
Hon Hai Precision Industry Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Hongfujin Precision Industry Shenzhen Co Ltd, Hon Hai Precision Industry Co Ltd filed Critical Hongfujin Precision Industry Shenzhen Co Ltd
Priority to CNB2003101119965A priority Critical patent/CN100468367C/en
Publication of CN1612119A publication Critical patent/CN1612119A/en
Application granted granted Critical
Publication of CN100468367C publication Critical patent/CN100468367C/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Landscapes

  • Detection And Correction Of Errors (AREA)
  • Techniques For Improving Reliability Of Storages (AREA)

Abstract

一种固态存储器的安全存储系统及方法,该系统包括一固态存储器、一中央处理器及一总线。该固态存储器包括多个数据块,每一数据块包括多张数据页及一错误校验页。该数据页包括多个数据字节、一冗余校验字节及一冗余校验互补字节。该方法可针对一数据页的数据生成一冗余校验码及一冗余校验互补码,用于对该数据页的数据进行冗余校验;同时对一数据块的数据进行奇偶校验;并对错误数据位进行修正;进而将被覆盖的正确数据恢复存储。利用上述的系统及方法,可避免文件数据不正确写入固态存储器时将原先正确数据覆盖所造成无可挽救的状况,并将被覆盖的正确数据恢复存储,确保了数据的正确完整性。

Figure 200310111996

A safe storage system and method of a solid-state memory, the system includes a solid-state memory, a central processing unit and a bus. The solid-state memory includes multiple data blocks, and each data block includes multiple data pages and an error checking page. The data page includes a plurality of data bytes, a redundancy check byte and a redundancy check complement byte. The method can generate a redundancy check code and a redundancy check complementary code for the data of a data page, which are used to perform redundancy check on the data of the data page; and perform parity check on the data of a data block at the same time ; and correct the wrong data bit; and then recover and store the overwritten correct data. The above-mentioned system and method can avoid the irreparable situation caused by overwriting the original correct data when the file data is incorrectly written into the solid-state memory, and restore the overwritten correct data to ensure the correct integrity of the data.

Figure 200310111996

Description

固态存储器的安全存储系统及方法Safe storage system and method for solid-state memory

【技术领域】【Technical field】

本发明涉及一种固态存储器的安全存储系统及方法,尤其是涉及一种安全的且可以将被覆盖的正确数据恢复的存储方法。The invention relates to a safe storage system and method of a solid-state memory, in particular to a safe storage method capable of recovering overwritten correct data.

【背景技术】【Background technique】

对于一存储系统而言,有两个重要因素:快速读写数据的能力及可靠存取数据的能力。目前一种被广泛用于确保数据存取可靠性的方法是:对被存储数据进行冗余校验码(CRC)校验,每次向存储系统写入数据时,按特定方法生成相关数据的冗余校验码。上述存储系统可以是使用半导体、磁、光作为存储介质的存储器产品,例如可擦写半导体只读存储器,包括闪存(Flash Read Only Memory)、EEPROM(Electrically Erasable Programmable Read Only Memory)等。闪存是一种固态的可覆写的存储器,其运作方式就像随机存取存储器与硬盘的混合体,适合于在各种设备中存储数据。虽然这些存储器都能在中途发生断电或操作方式不当等状况下保存数据,但是存入存储器中的数据很可能会不完整,使正确数据被覆盖,不能保证被存储数据的正确完整性。For a storage system, there are two important factors: the ability to read and write data quickly and the ability to access data reliably. At present, a method that is widely used to ensure the reliability of data access is to perform a redundancy check code (CRC) check on the stored data, and generate relevant data by a specific method each time data is written to the storage system. Redundancy check code. The above-mentioned storage system can be a memory product using semiconductor, magnetism, and light as a storage medium, such as an erasable semiconductor read-only memory, including flash memory (Flash Read Only Memory), EEPROM (Electrically Erasable Programmable Read Only Memory) and the like. Flash memory is a solid-state rewritable memory that operates like a hybrid of random access memory and hard disk, suitable for storing data in various devices. Although these memories can save data in the event of a power failure or improper operation, the data stored in the memory may be incomplete, causing the correct data to be overwritten, and the correct integrity of the stored data cannot be guaranteed.

目前关于存储数据的技术很多,例如美国专利商标局于1998年3月19日公告的第5,754,566号专利,名称为“Method And Apparatus ForCorrecting A Multilevel Cell Memory By Using Interleaving”,该发明提供一种可以在多级存储器单元中生成错误纠错码(ECC)的装置及方法,该错误纠错码分别存储于多个数据字节中,将为每一数据字节生成一错误纠错码并存储于具有N个字节的存储器单元中。这种方法对于一些存储成本较高的存储器如闪存(FLASH ROM)而言,其存储代价很高,并且对数据的错误进行检查及修正的能力也不强。因此实在有必要提出一种新的能对存储数据正确恢复的解决方法,本发明正是为了适应上述存储系统的不足而提供的一套新的解决方法,该方法提供了一个既安全且可以将被覆盖的正确数据恢复的可靠的存储方式。At present, there are many technologies for storing data, such as the No. 5,754,566 patent announced by the United States Patent and Trademark Office on March 19, 1998, named "Method And Apparatus ForCorrecting A Multilevel Cell Memory By Using Interleaving", which provides a method that can be used in A device and method for generating an error correction code (ECC) in a multi-level memory unit, the error correction code is respectively stored in a plurality of data bytes, an error correction code will be generated for each data byte and stored in a in memory cells of N bytes. This method has a high storage cost for some memory with higher storage cost such as flash memory (FLASH ROM), and the ability to check and correct data errors is not strong. Therefore, it is really necessary to propose a new solution that can correctly recover stored data. The present invention provides a set of new solutions to meet the above-mentioned deficiencies in the storage system. This method provides a safe and Reliable storage for overwritten correct data recovery.

【发明内容】【Content of invention】

针对先前技术所存在的不足,本发明的主要目的在于提供一种固态存储器的安全存储系统及方法。存储系统一般都会有一些设定或记录数据,甚至是系统软件,存储于存储器里,但是在中途断电或操作方式不当等状况下,数据有可能会不完整的存入存储器中,使正确数据被抹除。本发明即用于避免上述的状况,提供一种将被覆盖的正确数据恢复的可靠的存储方式,以确保数据的正确完整性。Aiming at the shortcomings of the prior art, the main purpose of the present invention is to provide a secure storage system and method for solid-state memory. Storage systems generally have some settings or recorded data, even system software, stored in the memory, but in the event of a power outage or improper operation, the data may be incompletely stored in the memory, making the correct data was erased. The present invention is used to avoid the above-mentioned situation, and provides a reliable storage method for recovering overwritten correct data, so as to ensure the correct integrity of the data.

为达成上述发明的目的,本发明提供一种固态存储器的安全存储系统,该系统包括:一固态存储器(MEMORY)、一中央处理器(CPU)及一总线(BUS),其中该固态存储器包括多个数据块,每一存储器区块具有1MByte容量的存储空间,用于存储相应数据,该数据块包括多张数据页(DATA PAGE)及一错误校验页(PARITY CHECK PAGE)。每一数据页具有4KByte容量的存储空间,该数据页包括多个数据字节、一冗余校验字节及一冗余校验互补字节。该冗余校验字节存储有一冗余校验码(CRC)。该冗余校验互补字节存储有一冗余校验互补码(CRC′)。该错误校验页包括一奇偶校验字节存储有一奇偶校验码(PARITY CODE);该中央处理器通过总线对固态存储器可进行读写与控制操作,生成被存储数据的冗余校验码并将其存储于相应校验码区,并能够对相应的数据进行错误检查及修正。其中,中央处理器利用错误校验页对该存储器区块的数据做奇偶校验,利用冗余校验为每一数据页的数据做错误检查与修正,进行正确数据的恢复,确保数据的正确完整性;该总线,用于配合中央处理器对固态存储器的数据进行相应的读写与控制操作。In order to achieve the purpose of the above invention, the present invention provides a safe storage system for solid-state memory, the system includes: a solid-state memory (MEMORY), a central processing unit (CPU) and a bus (BUS), wherein the solid-state memory includes multiple Each memory block has a storage space of 1MByte capacity for storing corresponding data. The data block includes multiple data pages (DATA PAGE) and an error checking page (PARITY CHECK PAGE). Each data page has a storage space of 4KByte capacity, and the data page includes a plurality of data bytes, a redundancy check byte and a redundancy check complementary byte. The redundancy check byte stores a redundancy check code (CRC). The redundancy check complement byte stores a redundancy check complement code (CRC'). The error check page includes a parity byte to store a parity code (PARITY CODE); the central processor can read, write and control the solid-state memory through the bus to generate a redundancy check code for the stored data And store it in the corresponding check code area, and can perform error checking and correction on the corresponding data. Among them, the central processing unit uses the error check page to perform parity check on the data of the memory block, uses the redundancy check to perform error check and correction on the data of each data page, and restores the correct data to ensure the correctness of the data. Integrity: This bus is used to cooperate with the central processing unit to perform corresponding read, write and control operations on the data of the solid-state memory.

本发明还提供一种固态存储器的安全存储方法。其通过一中央处理器来生成冗余校验码、冗余校验互补码及奇偶校验码,对相应数据进行错误检查及修正后再进行存储操作,以确保数据的正确完整性,该方法包括如下步骤:(a)中央处理器将一数据页的各数据字节的数据值加总后,再与一冗余附加数求和得一冗余校验码CRC的值,可运用相应的算法:CRC=(D[001]+D[002]+D[003]+...+D[FFE])+0X94,使CRC的值恒等于“0XFF”;(b)中央处理器计算所述的冗余校验码CRC的十六进制补数CRC′的值;(c)中央处理器读取一存储器区块的数据字节的数据,生成一奇偶校验码存储于一错误校验页的相应的奇偶校验字节中,并设定奇偶校验方式;(d)中央处理器利用冗余校验方式与奇偶校验方式同时对一横向数据与一纵向数据交错进行错误检查;(e)当中央处理器检查到一数据错误时,其即可对相应错误数据位进行修正,利用所述的错误校验页做正确数据恢复。The invention also provides a safe storage method of the solid-state memory. It uses a central processing unit to generate redundant check codes, redundant check complementary codes and parity check codes, performs error checks and corrections on the corresponding data, and then performs storage operations to ensure the correct integrity of the data. Comprise the following steps: (a) the central processing unit sums up the data values of each data byte of a data page, and then sums with a redundant additional number to obtain the value of a redundancy check code CRC, and can use the corresponding Algorithm: CRC=(D[001]+D[002]+D[003]+...+D[FFE])+0X94, so that the value of CRC is always equal to "0XFF"; (b) central processing unit computing institute The value of the hexadecimal complement number CRC' of the redundant check code CRC'; (c) the central processing unit reads the data of the data byte of a memory block, generates a parity check code and stores it in an error check In the corresponding parity check byte of the check page, and set the parity check mode; (d) the central processing unit utilizes the redundancy check mode and the parity check mode to simultaneously perform error checking on a horizontal data and a vertical data interleaving ; (e) When the central processing unit detects a data error, it can correct the corresponding erroneous data bit, and use the error checking page to restore the correct data.

通过上述的系统及方法,能够利用奇偶校验和冗余校验的检查方式同时对固态存储器中的数据进行横向与纵向交错的错误检查,并对错误数据位进行修正。因此,可避免文件数据不正确写入固态存储器时(如写入中途发生断电或操作方式不当等状况)将原先正确数据覆盖所造成无可挽救的状况,并将被覆盖的正确数据恢复存储,确保了数据的正确完整性。Through the above-mentioned system and method, it is possible to perform horizontal and vertical interleaved error checking on the data in the solid-state memory at the same time by using the check methods of parity check and redundancy check, and correct erroneous data bits. Therefore, when the file data is incorrectly written into the solid-state memory (such as power failure or improper operation during writing), the irreparable situation caused by overwriting the original correct data can be avoided, and the overwritten correct data can be restored and stored. , ensuring the correct integrity of the data.

【附图说明】【Description of drawings】

图1是本发明固态存储器的安全存储系统硬件架构图。FIG. 1 is a hardware architecture diagram of a secure storage system of a solid-state memory according to the present invention.

图2是本发明固态存储器的安全存储系统的固态存储器存储空间示意图。Fig. 2 is a schematic diagram of the storage space of the solid-state memory of the secure storage system of the solid-state memory of the present invention.

图3是本发明固态存储器的安全存储系统的固态存储器的存储器区块存储空间示意图。FIG. 3 is a schematic diagram of the memory block storage space of the solid-state memory in the secure storage system of the solid-state memory of the present invention.

图4是本发明固态存储器的安全存储系统的存储器区块的数据页存储空间示意图。4 is a schematic diagram of the data page storage space of the memory block of the secure storage system of the solid state memory of the present invention.

图5是本发明固态存储器的安全存储系统的数据错误检查及修正示意图。FIG. 5 is a schematic diagram of data error checking and correction of the secure storage system of the solid-state memory of the present invention.

图6是本发明固态存储器的安全存储方法流程图。Fig. 6 is a flow chart of the safe storage method of the solid-state memory according to the present invention.

【具体实施方式】【Detailed ways】

如图1所示,是本发明固态存储器的安全存储系统硬件架构图。该安全固态存储器存储系统包括一固态存储器(MEMORY)1、一中央处理器(CPU)2及一总线(BUS)3。其中,固态存储器1可为一闪存(FLASH ROM),用于存储数据。中央处理器2可通过总线3对固态存储器1中的数据进行读写与控制操作,或通过总线3从外部数据源(图中未画出)接收数据并将其存储于固态存储器1中,生成被存储数据的冗余校验码并将其存储于相应校验码区,并能够对相应数据进行错误检查及修正,且能够对数据按每一位进行加法运算、求补数运算及按位比对运算。该总线3,用于配合中央处理器2对固态存储器1中的数据进行相应的读写与控制操作。As shown in FIG. 1 , it is a hardware architecture diagram of the secure storage system of the solid-state memory of the present invention. The secure solid-state memory storage system includes a solid-state memory (MEMORY) 1 , a central processing unit (CPU) 2 and a bus (BUS) 3 . Wherein, solid-state memory 1 can be a flash memory (FLASH ROM), is used for storing data. The central processing unit 2 can read, write and control the data in the solid-state memory 1 through the bus 3, or receive data from an external data source (not shown in the figure) through the bus 3 and store it in the solid-state memory 1 to generate The redundant check code of the stored data is stored in the corresponding check code area, and the corresponding data can be checked and corrected for errors, and the data can be added, complemented, and bit by bit comparison operation. The bus 3 is used to cooperate with the central processing unit 2 to perform corresponding read, write and control operations on the data in the solid-state memory 1 .

如图2所示,是本发明固态存储器的安全存储系统的固态存储器存储空间示意图。一固态存储器1,其在逻辑上被划分为多个存储器区块(MEMORY BLOCK)10,每一存储器区块10具有1MByte容量的存储空间,用于存储相应数据。As shown in FIG. 2 , it is a schematic diagram of the storage space of the solid-state memory of the secure storage system of the solid-state memory of the present invention. A solid-state memory 1 is logically divided into a plurality of memory blocks (MEMORY BLOCK) 10, and each memory block 10 has a storage space with a capacity of 1MByte for storing corresponding data.

如图3所示,是本发明固态存储器的安全存储系统的固态存储器的存储器区块存储空间示意图。一固态存储器1的存储器区块10,该存储器区块10具有1MByte容量的存储空间,其在逻辑上被划分为多张数据页(DATA PAGE)101及一错误校验页(PARITY CHECK PAGE)102。每一数据页101和错误校验页102均具有4KByte容量的存储空间,数据页101用于存储多笔数据、冗余校验码及冗余校验互补码;错误校验页102用于存储奇偶校验码,其用于完成1Mbyte数据的奇偶校验,该奇偶校验可选用奇(ODD PARITY)校验或偶(EVENPARITY)校验,该错误校验页102还可用于正确数据的恢复。As shown in FIG. 3 , it is a schematic diagram of the memory block storage space of the solid-state memory of the secure storage system of the solid-state memory of the present invention. A memory block 10 of a solid-state memory 1, the memory block 10 has a storage space of 1MByte capacity, which is logically divided into a plurality of data pages (DATA PAGE) 101 and an error checking page (PARITY CHECK PAGE) 102 . Each data page 101 and error check page 102 has a storage space of 4KByte capacity, the data page 101 is used to store multiple data, redundancy check code and redundancy check complementary code; the error check page 102 is used to store Parity check code, which is used to complete the parity check of 1Mbyte data, the parity check can be selected odd (ODD PARITY) check or even (EVENPARITY) check, the error check page 102 can also be used for the recovery of correct data .

如图4所示,是本发明固态存储器的安全存储系统的存储器区块的数据页存储空间示意图。一存储器区块10的4KByte存储容量的数据页101,其字节地址分别在逻辑上被划分为001、002、003...FFE、FFF,该地址所存储的数据分别为:D[001]、D[002]、D[003]...冗余校验互补字节1012、冗余校验字节1011。该冗余校验字节1011,用于存储一冗余校验码(CRC);该冗余校验互补字节1012,用于存储一冗余校验互补码(CRC′)。计算该冗余校验码CRC可采用相应的算法:CRC=(D[001]+D[002]+D[003]+...+D[FFE])+0X94,且使CRC的值恒等于“0XFF”。其中D[001]、D[002]、D[003]...D[FFE]分别为第001、第002、第003...第FFE个存储地址中的数据,“0X94”为一冗余附加数,表示十六进制数94。该冗余校验互补字节1012是中央处理器2计算出的冗余校验码CRC的十六进制补数CRC′的值,例如CRC的值为“0XFF”,则CRC′的值为“0X00”。因此,中央处理器2根据冗余校验码与冗余校验互补码的互补关系的正确与否来检查数据的正确性,并对错误数据位进行修正。一个字节(BYTE)由八个位(BIT)组成:B1、B2、B3...B8,该位的地址存储空间用于存储相应位“0”或“1”,以组成相应数据。As shown in FIG. 4 , it is a schematic diagram of the data page storage space of the memory block of the secure storage system of the solid state memory of the present invention. A data page 101 with a 4KByte storage capacity of a memory block 10 is logically divided into byte addresses 001, 002, 003...FFE, FFF, and the data stored in the addresses are respectively: D[001] , D[002], D[003]... redundancy check complementary byte 1012, redundancy check byte 1011. The redundancy check byte 1011 is used to store a redundancy check code (CRC); the redundancy check complement byte 1012 is used to store a redundancy check complement code (CRC′). Calculate this redundant check code CRC and can adopt corresponding algorithm: CRC=(D[001]+D[002]+D[003]+...+D[FFE])+0X94, and make the value of CRC constant Equal to "0XFF". Among them, D[001], D[002], D[003]...D[FFE] are the data in the storage address 001, 002, 003...FFE respectively, and "0X94" is a redundant Additional digits, representing the hexadecimal number 94. This redundancy check complementary byte 1012 is the value of the hexadecimal complement number CRC' of the redundancy check code CRC calculated by the central processing unit 2, for example, the value of CRC is "0XFF", and the value of CRC' is "0X00". Therefore, the central processing unit 2 checks the correctness of the data according to whether the complementary relationship between the redundancy check code and the redundancy check complementary code is correct or not, and corrects the erroneous data bits. A byte (BYTE) is composed of eight bits (BIT): B1, B2, B3...B8. The address storage space of this bit is used to store the corresponding bit "0" or "1" to form the corresponding data.

如图5所示,是本发明安全固态存储器的安全存储系统的数据错误检查及修正示意图。中央处理器2根据固态存储器1的存储器区块10的错误校验页102进行奇偶(PARITY)校验,该奇偶校验可选用奇(ODD PARITY)校验或偶(EVEN PARITY)校验。本实施例采用偶校验来描述:当相对应数据的字节中含有奇数个的“1”时,同位位为“1”;当相对应数据的字节中含有偶数个的“1”时,同位位为“0”。在数据被送至中央处理器2前通过奇偶校验,同位位及对应8位数据同时被写入固态存储器1中。如果奇偶校验检测到偶数个的“1”,数据被视为有效,同位位被去除,此后8位数据被送至中央处理器2处理;如果与位检查检测到奇数个的“1”,数据被视为无效并产生PARITY错误。如图5所示,如果其中一存储器区块10的多张数据页101的纵向数据(B1、B2、B3...B8)按每一位(BIT)加总后得奇数个“1”,而错误校验页102中对应的同位却为“0”,则对应数据页101中数据被视为无效并产生PARITY错误。中央处理器2根据数据页101中的冗余校验码和冗余校验互补码的互补关系的正确与否来确定相应数据页101中的横向数据(D[001]、D[002]、D[003]...D[FFE])是否有错误。因此,完成了奇偶(PARITY)校验和冗余校验同时对固态存储器1的纵向数据与横向数据交错的错误检查,并对相应错误的数据进行修正。该横向数据错误检查是指中央处理器2利用数据页101的冗余校验码和冗余校验互补码对数据页101中的横向数据进行冗余校验;该纵向数据错误检查是指中央处理器2利用错误校验页102中的奇偶校验码对数据块10中的纵向数据进行奇偶校验。在本实施例中的错误位“EEROR BIT”为“1”即为被检查出的错误位,其将被改写为“0”,并用存储器区块10中的错误校验页102进行正确数据的恢复,以达到对数据进行错误检查及修正的目的,从而保证了数据的正确完整性。As shown in FIG. 5 , it is a schematic diagram of data error checking and correction of the secure storage system of the secure solid-state memory of the present invention. The central processing unit 2 performs a parity check according to the error check page 102 of the memory block 10 of the solid-state memory 1, and the parity check can be an odd (ODD PARITY) check or an even (EVEN PARITY) check. This embodiment uses even parity to describe: when the corresponding data byte contains an odd number of "1", the parity bit is "1"; when the corresponding data byte contains an even number of "1" , the parity bit is "0". Before the data is sent to the central processing unit 2, the parity bit and the corresponding 8-bit data are written into the solid-state memory 1 at the same time. If the parity check detects an even number of "1", the data is considered valid, and the parity bit is removed, and then the 8-bit data is sent to the central processing unit 2 for processing; if the AND bit check detects an odd number of "1", Data is considered invalid and generates a PARITY error. As shown in FIG. 5, if the vertical data (B1, B2, B3...B8) of multiple data pages 101 of one of the memory blocks 10 is summed to obtain an odd number of "1"s per bit (BIT), However, the corresponding bit in the error check page 102 is "0", and the data in the corresponding data page 101 is considered invalid and a PARITY error occurs. Central processing unit 2 determines whether the horizontal data (D[001], D[002], D[002], D[003]...D[FFE]) whether there is an error. Therefore, the parity (PARITY) check and the redundancy check are completed, and the error check of the interleaving of the vertical data and the horizontal data of the solid-state memory 1 is completed, and the corresponding erroneous data is corrected. This horizontal data error check refers to that the central processing unit 2 utilizes the redundancy check code and the redundancy check complementary code of the data page 101 to carry out redundancy check to the horizontal data in the data page 101; The processor 2 performs a parity check on the vertical data in the data block 10 using the parity code in the error check page 102 . In the present embodiment, the error bit "EEROR BIT" is "1", which is the detected error bit, which will be rewritten as "0", and the error check page 102 in the memory block 10 is used to write the correct data. Recovery, in order to achieve the purpose of error checking and correction of data, so as to ensure the correct integrity of data.

如图6所示,是本发明固态存储器的安全存储方法流程图。首先对本图所用的助记符说明如下:As shown in FIG. 6 , it is a flow chart of the safe storage method of the solid-state memory of the present invention. First, the mnemonics used in this figure are explained as follows:

SUM,代表一存储器区块10的数据按每一位相加的和;SUM represents the sum of the data of a memory block 10 added by each bit;

CRC,代表一数据页101的冗余校验码,可采用的算法为:CRC=(D[001]+D[002]+D[003]+...+D[FFE])+0x94,其存储于数据页101的冗余校验字节1011的地址FFF中;CRC, representing the redundancy check code of a data page 101, the algorithm that can be adopted is: CRC=(D[001]+D[002]+D[003]+...+D[FFE])+0x94, It is stored in the address FFF of the redundancy check byte 1011 of the data page 101;

CRC′,代表CRC的十六进制补数,作为一数据页101的冗余校验互补码,其存储于数据页101的冗余校验互补字节1012的地址FFE中;CRC' represents the hexadecimal complement of CRC, which is stored in the address FFE of the redundancy check complement byte 1012 of the data page 101 as a redundancy check complement code of a data page 101;

D[4K-2],代表一数据页101的第4K-2个数据字节地址的数据,其中K=1,2,...,n,n为自然数。D[4K-2] represents the data of the 4K-2th data byte address of a data page 101, wherein K=1, 2, . . . , n, n is a natural number.

首先,中央处理器2将固态存储器1的存储器区块10中数据页101的各数据值加总,再与一冗余附加数“0X94”求和后得CRC的值,并计算其十六进制补数得CRC′的值(步骤S1)。例如CRC的值为“0XFF”,而CRC′的值是否为“0X00”,接着中央处理器2判断CRC′的值与D[4K-2]的值是否相等(步骤S2),若CRC′值与D[4K-2]值不相等,则程序转向由中央处理器2将固态存储器1的存储器区块10中的各数据按每一位加总得SUM值,并设定错误校验页102的奇偶校验方式为偶校(本发明采用偶校来描述,步骤S3)。接着判断SUM值是否为偶数个“1”(步骤S4)。若SUM值是奇数个“1”,则在错误校验页102的相应位的地址中写入“1”,即中央处理器2做SUM=SUM+1运算后(步骤S5),接着将固态存储器1中数据页101中的错误数据位做错误修正并存储(步骤S7),最后程序结束;在步骤S3中,若SUM值是偶数个“1”,则在错误校验页102的相应位的地址中写入“0”,即中央处理器2做SUM=SUM+0运算(步骤S6)后,程序转向步骤S7。在步骤S2中,若CRC′与A[4K-2]相等,则中央处理器2将固态存储器1的存储器区块10中的各数据按每一位加总得SUM值,并设定错误校验页102的奇偶校验方式为偶校验(步骤S8)。接着判断SUM值是否为偶数个“1”(步骤S9),若SUM值是奇数个“1”,则在错误校验页102的相应位的地址中写入“1”,即中央处理器2做SUM=SUM+1运算后(步骤S10),接着程序转向判断SUM值是否等于“0”(步骤S12),如SUM值不等于“0”,则中央处理器2将固态存储器1中错误校验页102中的错误数据位做错误修正并存储(步骤S13),最后程序才结束;如SUM值等于“0”,说明存储于错误校验页102中的错误数据位没有错误数据,无需作正确数据的恢复,则程序直接转向结束。在步骤S9中,若SUM值是偶数个“1”,则在错误校验页102的相应位的地址中写入“0”,即中央处理器2做SUM=SUM+0运算(步骤S11)后,接着程序转向步骤判断SUM值是否等于“0”(步骤S12),如SUM值不等于“0”,则程序转向步骤S13;如SUM值等于“0”,则程序直接结束。通过上述方法,可完成冗余校验和奇偶校验分别对存储于固态存储器1中的一横向数据与一纵向数据进行交错的错误检查,并对错误数据位进行修正,从而完成了把被覆盖的正确数据恢复的存储过程,确保了数据的正确完整性。First, the central processing unit 2 sums each data value of the data page 101 in the memory block 10 of the solid-state memory 1, and then adds a redundant additional number "0X94" to obtain the value of the CRC, and calculates its hexadecimal value. Complement the number to obtain the value of CRC' (step S1). For example, the value of CRC is "0XFF", and whether the value of CRC' is "0X00", then central processing unit 2 judges whether the value of CRC' is equal to the value of D[4K-2] (step S2), if CRC' value Not equal to the D[4K-2] value, then the program turns to each data in the storage block 10 of the solid-state memory 1 by the central processing unit 2 to obtain the SUM value by each bit, and sets the error check page 102 The parity check mode is even check (the present invention adopts even check to describe, step S3). Then judge whether the SUM value is an even number of "1" (step S4). If the SUM value is an odd number of "1", then write "1" in the address of the corresponding bit of the error check page 102, that is, after the central processing unit 2 does the SUM=SUM+1 operation (step S5), then the solid state The wrong data bit in the data page 101 in the memory 1 is corrected and stored (step S7), and the program ends at last; Write "0" in the address, after central processing unit 2 does SUM=SUM+0 operation (step S6), program turns to step S7. In step S2, if CRC' is equal to A[4K-2], the central processing unit 2 sums up the data in the memory block 10 of the solid-state memory 1 to obtain a SUM value for each bit, and sets the error check The parity check method of the page 102 is even check (step S8). Then judge whether the SUM value is an even number "1" (step S9), if the SUM value is an odd number "1", then write "1" in the address of the corresponding bit of the error checking page 102, that is, the central processing unit 2 After doing the SUM=SUM+1 operation (step S10), then the program turns to judge whether the SUM value is equal to "0" (step S12), if the SUM value is not equal to "0", then the central processing unit 2 corrects errors in the solid-state memory 1 The error data bit in the error checking page 102 is corrected and stored (step S13), and the program ends at last; if the SUM value is equal to "0", it means that the error data bit stored in the error checking page 102 has no error data, and there is no need to do it. If correct data is restored, the program goes directly to the end. In step S9, if the SUM value is an even number of "1", then write "0" in the address of the corresponding bit of the error checking page 102, that is, central processing unit 2 does SUM=SUM+0 operation (step S11) Afterwards, then the program turns to the step to judge whether the SUM value is equal to "0" (step S12), and if the SUM value is not equal to "0", then the program turns to the step S13; if the SUM value equals "0", then the program directly ends. Through the above method, the redundancy check and the parity check can be completed to respectively interleave the error check of a horizontal data and a vertical data stored in the solid-state memory 1, and correct the error data bit, thereby completing the covered The correct data recovery storage process ensures the correct integrity of the data.

Claims (13)

1. the safe storage system of a solid-state memory is used to recover covered correct data, it is characterized in that, this system comprises:
One solid-state memory, this solid-state memory is connected in a central processing unit, and it logically is divided into a plurality of memory blocks, and this memory block comprises:
Many data pages, this data page comprise the complementary byte of a plurality of data bytes, a redundancy check byte and a redundancy check; And
One error-checking page or leaf, this error-checking page or leaf comprises a parity byte.
2. the safe storage system of solid-state memory as claimed in claim 1 is characterized in that, the storage space volume of described memory block is a fixed value.
3. the safe storage system of solid-state memory as claimed in claim 1 is characterized in that, the storage space volume of described data page and described error-checking page or leaf is a fixed value.
4. the safe storage system of solid-state memory as claimed in claim 1 is characterized in that, described parity byte is used to store a parity check code.
5. the safe storage system of solid-state memory as claimed in claim 1 is characterized in that, described redundancy check byte is used to store a redundancy check code, and the complementary byte of described redundancy check, is used to store a redundancy check mutual-complementing code.
6. the safe storage system of solid-state memory as claimed in claim 5 is characterized in that, described redundancy check code and described redundancy check mutual-complementing code possess complementary relationship, and it is used for the data of described data page are carried out bug check and correction.
7. the method for secure storing of a solid-state memory is used to recover covered correct data, its feature with, this method may further comprise the steps:
Central processing unit adds the General Logistics Department with the data of each data byte of a data page by each, again with a redundant additional number sue for peace a redundancy check code CRC;
Central processing unit calculates the value of the sexadecimal complement CRC ' of described redundancy check code CRC;
One central processing unit reads the data of the data byte of a memory block, generates in the corresponding parity byte address that a parity check code is stored in an error-checking page or leaf, and sets parity check system;
Central processing unit utilizes redundancy check mode and parity check system to check horizontal data and a longitudinal data are staggered respectively; And
When being checked through an error in data, this central processing unit is promptly revised the corresponding error data bit, utilizes described error-checking page or leaf to carry out the recovery of correct data.
8. the method for secure storing of solid-state memory as claimed in claim 7 is characterized in that, described redundant additional number is sexadecimal number " 0X94 ".
9. the method for secure storing of solid-state memory as claimed in claim 7, it is characterized in that, calculate the value of described redundancy check code CRC, make it be constantly equal to " 0XFF ", respective algorithms can adopt: CRC=(D[001]+D[002]+D[003]+... + D[FFE])+0X94, wherein D[001], D[002], D[003] ... D[FFE] be respectively the 001st, the 002nd, the 003rd ... data in FFE address.
10. the method for secure storing of solid-state memory as claimed in claim 7 is characterized in that, described CRC ' expression redundancy check mutual-complementing code is carried out the redundancy check of the horizontal data of described data page jointly with described redundancy check code.
11. the method for secure storing of solid-state memory as claimed in claim 7 is characterized in that, described correction is meant and changes the numerical value of misdata position " 1 " into " 0 ", or the numerical value " 0 " of misdata position is rewritten as " 1 ".
12. the method for secure storing of solid-state memory as claimed in claim 7 is characterized in that, described error-checking page or leaf is used to finish the parity checking of the longitudinal data of described memory block.
13. the method for secure storing of solid-state memory as claimed in claim 12 is characterized in that, described parity checking can be selected odd or even parity check for use.
CNB2003101119965A 2003-10-29 2003-10-29 Safe storage system and method for solid-state memory Expired - Fee Related CN100468367C (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CNB2003101119965A CN100468367C (en) 2003-10-29 2003-10-29 Safe storage system and method for solid-state memory

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CNB2003101119965A CN100468367C (en) 2003-10-29 2003-10-29 Safe storage system and method for solid-state memory

Publications (2)

Publication Number Publication Date
CN1612119A true CN1612119A (en) 2005-05-04
CN100468367C CN100468367C (en) 2009-03-11

Family

ID=34759555

Family Applications (1)

Application Number Title Priority Date Filing Date
CNB2003101119965A Expired - Fee Related CN100468367C (en) 2003-10-29 2003-10-29 Safe storage system and method for solid-state memory

Country Status (1)

Country Link
CN (1) CN100468367C (en)

Cited By (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101183565B (en) * 2007-12-12 2011-02-16 深圳市硅格半导体有限公司 Data verification method for storage medium
CN1983266B (en) * 2005-07-01 2011-05-11 Qnx软件操作系统德国有限公司 File system storing transaction records in flash-like media
CN103034594A (en) * 2011-09-30 2013-04-10 群联电子股份有限公司 Memory storage device, its memory controller, and password verification method
CN101510448B (en) * 2008-02-14 2013-05-08 爱特梅尔卢梭公司 Error detecting/correcting scheme for memories
WO2013166917A1 (en) * 2012-05-09 2013-11-14 腾讯科技(深圳)有限公司 Bad disk block self-detection method, device and computer storage medium
CN103631671A (en) * 2013-11-19 2014-03-12 无锡众志和达数据计算股份有限公司 Data protection method and controller for SSD storage
WO2014101375A1 (en) * 2012-12-31 2014-07-03 记忆科技(深圳)有限公司 Solid-state storage system, apparatus and data writing method
CN107704338A (en) * 2017-08-22 2018-02-16 深圳市硅格半导体股份有限公司 A kind of data reconstruction method and device of data storage type flash
CN109358981A (en) * 2018-09-25 2019-02-19 珠海市杰理科技股份有限公司 Memory read error correction method, system, computer device and storage medium
CN109427401A (en) * 2017-08-29 2019-03-05 华邦电子股份有限公司 Encoding method and memory storage device using the same
CN111506178A (en) * 2020-06-16 2020-08-07 深圳市芯天下技术有限公司 Chip power-on reset method and chip

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102880567B (en) 2011-07-11 2016-02-10 澜起科技(上海)有限公司 data read-write system

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5734815A (en) * 1996-08-22 1998-03-31 Emc Corporation Method and apparatus for efficient cyclical redundancy check (CRC) maintenance for sub-sector writes
US5754566A (en) * 1996-09-06 1998-05-19 Intel Corporation Method and apparatus for correcting a multilevel cell memory by using interleaving
MXPA04003642A (en) * 2001-10-17 2004-07-30 Gen Electric Signal error detection in railroad communication system.
CN1397950A (en) * 2002-08-30 2003-02-19 交大铭泰(北京)软件有限公司 Method for strong holographic data on magnetic disc and method for restoring its lost data

Cited By (16)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1983266B (en) * 2005-07-01 2011-05-11 Qnx软件操作系统德国有限公司 File system storing transaction records in flash-like media
CN101183565B (en) * 2007-12-12 2011-02-16 深圳市硅格半导体有限公司 Data verification method for storage medium
CN101510448B (en) * 2008-02-14 2013-05-08 爱特梅尔卢梭公司 Error detecting/correcting scheme for memories
CN103034594A (en) * 2011-09-30 2013-04-10 群联电子股份有限公司 Memory storage device, its memory controller, and password verification method
WO2013166917A1 (en) * 2012-05-09 2013-11-14 腾讯科技(深圳)有限公司 Bad disk block self-detection method, device and computer storage medium
US9639441B2 (en) 2012-12-31 2017-05-02 Ramaxel Technology (Shenzhen) Limited Solid-state storage system, apparatus and method of writing data
WO2014101375A1 (en) * 2012-12-31 2014-07-03 记忆科技(深圳)有限公司 Solid-state storage system, apparatus and data writing method
CN103631671B (en) * 2013-11-19 2016-05-04 无锡众志和达数据计算股份有限公司 A kind of data guard method of SSD memory and controller
CN103631671A (en) * 2013-11-19 2014-03-12 无锡众志和达数据计算股份有限公司 Data protection method and controller for SSD storage
CN107704338A (en) * 2017-08-22 2018-02-16 深圳市硅格半导体股份有限公司 A kind of data reconstruction method and device of data storage type flash
CN109427401A (en) * 2017-08-29 2019-03-05 华邦电子股份有限公司 Encoding method and memory storage device using the same
CN109427401B (en) * 2017-08-29 2023-08-29 华邦电子股份有限公司 Encoding method and memory storage device using same
CN109358981A (en) * 2018-09-25 2019-02-19 珠海市杰理科技股份有限公司 Memory read error correction method, system, computer device and storage medium
CN109358981B (en) * 2018-09-25 2022-07-05 珠海市杰理科技股份有限公司 Memory read error correction method, system, computer device and storage medium
CN111506178A (en) * 2020-06-16 2020-08-07 深圳市芯天下技术有限公司 Chip power-on reset method and chip
CN111506178B (en) * 2020-06-16 2020-10-23 深圳市芯天下技术有限公司 Chip power-on reset method and chip

Also Published As

Publication number Publication date
CN100468367C (en) 2009-03-11

Similar Documents

Publication Publication Date Title
US10740175B2 (en) Pool-level solid state drive error correction
US9377960B2 (en) System and method of using stripes for recovering data in a flash storage system
US8010873B2 (en) Systems and methods for efficient uncorrectable error detection in flash memory
US8707135B2 (en) Method and system of dynamic data storage for error correction in a memory device
US8635510B2 (en) Non-systematic coded error correction
CN105051700B (en) Select redundant storage configuration based on available storage space
US20110029716A1 (en) System and method of recovering data in a flash storage system
US20100251074A1 (en) Decoding/encoding method for booting from a nand flash and system thereof
JP2014515536A (en) Apparatus and method for providing data integrity
CN112214346B (en) Method and apparatus for error detection during data modification in a memory subsystem
TW201331946A (en) Using ECC encoding to verify an ECC decode operation
CN1612119A (en) Solid state storage unit safety storage system and method
US10756764B2 (en) Memory system and control method
CN103229243A (en) Memory controller and system for storing blocks of data in non-olatile memory devices in redundant manner
JP2011060217A (en) Data storage apparatus, and data writing/reading method
CN113220221B (en) Memory controller and data processing method
US7213191B2 (en) System and method for securely storing data in a memory
CN113721832B (en) Data storage device and data processing method
US11010245B2 (en) Memory storage apparatus with dynamic data repair mechanism and method of dynamic data repair thereof
US10922025B2 (en) Nonvolatile memory bad row management
CN115220967A (en) Method, device and computer equipment for improving memory fault tolerance of solid state disk
CN112114888B (en) A method for generating a universal client boot program for an electric vehicle electronic control system
CN108762975B (en) ECC data storage method, system and storage medium
US6654288B2 (en) Method and device for backing up data in a memory module and memory module
US20250021427A1 (en) Storage controller for recovering data using bit combinations and method of operating the same

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20090311

Termination date: 20141029

EXPY Termination of patent right or utility model