KR20050011869A - Memory device using flash memory and error correction method the same - Google Patents

Memory device using flash memory and error correction method the same Download PDF

Info

Publication number
KR20050011869A
KR20050011869A KR1020030050923A KR20030050923A KR20050011869A KR 20050011869 A KR20050011869 A KR 20050011869A KR 1020030050923 A KR1020030050923 A KR 1020030050923A KR 20030050923 A KR20030050923 A KR 20030050923A KR 20050011869 A KR20050011869 A KR 20050011869A
Authority
KR
South Korea
Prior art keywords
block
data
flash memory
stored
logical
Prior art date
Application number
KR1020030050923A
Other languages
Korean (ko)
Other versions
KR100654344B1 (en
Inventor
남호진
Original Assignee
주식회사 레인콤
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 주식회사 레인콤 filed Critical 주식회사 레인콤
Priority to KR1020030050923A priority Critical patent/KR100654344B1/en
Publication of KR20050011869A publication Critical patent/KR20050011869A/en
Application granted granted Critical
Publication of KR100654344B1 publication Critical patent/KR100654344B1/en

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0638Organizing or formatting or addressing of data
    • G06F3/064Management of blocks
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/14Error detection or correction of the data by redundancy in operation
    • G06F11/1402Saving, restoring, recovering or retrying
    • G06F11/1415Saving, restoring, recovering or retrying at system level
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0629Configuration or reconfiguration of storage systems
    • G06F3/0631Configuration or reconfiguration of storage systems by allocating resources to storage systems
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0655Vertical data movement, i.e. input-output transfer; data movement between one or more hosts and one or more storage devices
    • G06F3/0656Data buffering arrangements
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0655Vertical data movement, i.e. input-output transfer; data movement between one or more hosts and one or more storage devices
    • G06F3/0658Controller construction arrangements
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0668Interfaces specially adapted for storage systems adopting a particular infrastructure
    • G06F3/0671In-line storage system
    • G06F3/0673Single storage device
    • G06F3/0679Non-volatile semiconductor memory device, e.g. flash memory, one time programmable memory [OTP]

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Human Computer Interaction (AREA)
  • Quality & Reliability (AREA)
  • Techniques For Improving Reliability Of Storages (AREA)

Abstract

PURPOSE: A memory device using a flash memory and its error recovery method are provided to recover an error of the system when there is an error during data updating as to a meta data area of the flash memory. CONSTITUTION: A buffer(24) stores data temporarily to be stored in a flash memory(22) and data to be output to the external. A block mapping table(26) stores mapping information of a logical block address of data to be stored in the flash memory and a physical block address of the flash memory. And a memory control unit(28) controls data read and write as to the flash memory according to the mapping information of the block mapping table, and writes data to be updated and a logical block number corresponding to the second block into the second block by allocating the second block while updating the first block of the flash memory.

Description

플래시 메모리를 이용한 기억장치 및 그 에러 복구 방법{Memory device using flash memory and error correction method the same}Memory device using flash memory and error correction method the same}

본 발명은 플래시 메모리(Flash Memory)에 관한 것으로서, 보다 상세하게는 플래시 메모리를 디스크 장치로 사용하는 시스템에서 플래시 메모리의 메타 데이터 영역에 대한 데이터 라이트시 발생되는 에러를 용이하게 복구할 수 있도록 해주는 기억장치 및 그 에러 복구 방법에 관한 것이다.BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a flash memory, and more particularly, to a memory for easily recovering an error generated when writing data to a metadata area of a flash memory in a system using the flash memory as a disk device. A device and an error recovery method thereof.

플래시 메모리는 EEPROM(Electrically erasable programmable read-onlymemory)의 변형된 형태로 일반적인 EEPROM과는 달리 블록단위로 데이터를 삭제하거나 수정한다. 이러한 플래시 메모리는 PC카드(PCMCIA)로서 하드디스크 대용으로 사용되기도 하는데, 하드디스크와 달리 기계적인 운동부분이 없어 하드디스크에 비해 전력소모가 매우 적어 노트북 컴퓨터과 같은 휴대형 정보기기들에 많이 이용되고 있다.Flash memory is a modified form of electrically erasable programmable read-only memory (EEPROM) that, unlike a typical EEPROM, erases or modifies data on a block basis. Such flash memory is also used as a PC card (PCMCIA) as a hard disk replacement. Unlike the hard disk, there is no mechanical movement part, so the power consumption of the flash memory is much lower than that of the hard disk, which is widely used in portable information devices such as notebook computers.

플래시 메모리에 데이터를 라이트하고자 할 때, 플래시 메모리의 특성상 라이트하고자 하는 영역에 이미 데이터가 저장되어 있으면 해당 영역이 포함된 블럭을 리라이트전에 삭제하여야 한다. 즉, 플래시 메모리에서는 일정 영역(블럭)에 한번 데이터를 저장하고 같은 영역에 새로운 데이터를 리라이트(갱신) 할 때, 먼저 해당 영역을 포함하는 블럭의 데이터를 삭제하고 나서 해당 블럭에 데이터를 라이트하게 된다.When writing data to a flash memory, if data is already stored in an area to be written due to the characteristics of the flash memory, a block including the area should be deleted before rewriting. In other words, in flash memory, when data is stored once in a certain area (block) and new data is rewritten (updated) in the same area, first delete the data of the block including the area and then write the data to the block. do.

하지만, 데이터 라이트 중 전원의 공급이 갑자기 끊어지거나 기타 충격으로 인해 섹터 또는 블럭 단위의 에러가 발생하는 경우 이에 대한 에러 복구에 어려움이 있었다. 특히, 실제 사용자 데이터를 저장하는 일반 데이터 영역이 아닌 파일정보를 저장하는 메타 데이터 영역에 대한 라이트(데이터 갱신) 중에 이러한 에러가 발생하게 되면, 디스크를 인식하지 못하게 되어 시스템이 제대로 부팅되지 않는 상황이 발생할 수 도 있다. 더욱이, 이러한 문제가 발생되면 디스크를 다시 포맷해서 사용해야 되는데 그렇게 되면 기존에 저장되어 있던 다른 데이터들도 삭제되므로 중요한 데이터가 사라질 수 있는 심각한 상황이 발생할 수 도 있게 된다.However, when an error in a sector or a block occurs due to a sudden power failure or other impact during data write, there is a difficulty in recovering an error. In particular, if such an error occurs during a write (data update) to the metadata area that stores file information rather than the general data area that stores the actual user data, the disk may not be recognized and the system may not boot properly. May occur. Moreover, when this problem occurs, the disk must be reformatted and used again, which deletes other previously stored data, which can lead to a serious situation where important data can be lost.

따라서, 상술된 문제를 해결하기 위한 본 발명의 목적은 플래시 메모리에 대한 데이터 라이트 방법을 개선하여 플래시 메모리의 메타 데이터 영역에 대한 데이터 갱신 중 에러가 발생하더라도 용이하게 시스템을 원래대로 복구할 수 있도록 하는데 있다.Accordingly, an object of the present invention to solve the above-described problem is to improve the data writing method for the flash memory so that the system can be easily restored even if an error occurs during data update for the metadata area of the flash memory. have.

도 1은 본 발명에 따른 기억장치의 구성을 나타내는 구성도.1 is a configuration diagram showing a configuration of a memory device according to the present invention.

도 2는 본 발명에 따른 에러 복구를 위한 전처리 과정으로서 플래시 메모리에 데이터를 라이트하는 과정을 설명하기 위한 순서도.2 is a flowchart illustrating a process of writing data to a flash memory as a preprocessing process for error recovery according to the present invention.

도 3은 새로 할당받은 블럭에 데이터를 라이트 하는 원리를 설명하기 위한 개념도.3 is a conceptual diagram illustrating a principle of writing data to a newly allocated block.

도 4는 도 2의 데이터 라이트 과정 중 에러가 발생하는 경우 이를 복구하는 과정을 설명하기 위한 순서도.4 is a flowchart illustrating a process of recovering an error when an error occurs during the data write process of FIG. 2.

위와 같은 목적을 달성하기 위한 본 발명의 플래시 메모리를 이용한 기억장치는 상기 플래시 메모리에 저장될 데이터 및 외부로 출력될 데이터를 임시 저장하는 버퍼; 상기 플래시 메모리에 저장될 데이터의 논리적 블럭주소(Logical Block Address)와 이에 대응되는 상기 플래시 메모리의 물리적 블럭주소(Physical Block Address)의 매핑정보를 저장하는 블럭매핑테이블; 및 상기 블럭매핑테이블의 매핑정보에 따라 상기 플래시 메모리에 대한 데이터 리드 및 라이트를 제어하며, 상기 버퍼의 데이터로 상기 플래시 메모리의 제 1 블럭을 갱신시 제 2 블럭을 할당받아 갱신할 데이터와 상기 제 2 블럭에 대응되는 논리적 블럭번호를 라이트하는 메모리 제어부를 구비한다.The memory device using the flash memory of the present invention for achieving the above object includes a buffer for temporarily storing data to be stored in the flash memory and data to be output to the outside; A block mapping table that stores mapping information of a logical block address of data to be stored in the flash memory and a physical block address of the flash memory corresponding thereto; And controlling data reads and writes to the flash memory according to mapping information of the block mapping table, and data to be updated by receiving a second block when updating a first block of the flash memory with data of the buffer. And a memory control unit for writing logical block numbers corresponding to the two blocks.

본 발명의 플래시 메모리를 이용한 기억장치의 에러 복구 방법은 상기 플래시 메모리의 제 1 블럭에 대한 데이터 갱신시 제 2 블럭을 할당받아 상기 제 2 블럭에 데이터를 라이트하는 제 1 단계; 상기 제 2 블럭에 대한 데이터 라이트 완료시, 상기 제 2 블럭 내 모든 스페어 영역에 상기 제 2 블럭에 대응되는 논리적 블럭번호를 저장하는 제 2 단계; 및 상기 논리적 블럭번호가 상기 모든 스페어 영역에 기재되었는지 여부에 따라 상기 제 2 블럭의 정상 여부를 판단하여 비 정상 블럭에 대한 에러 복구를 수행하는 제 3 단계를 포함한다.An error recovery method of a storage device using a flash memory of the present invention may include: a first step of receiving a second block when data is updated for a first block of the flash memory, and writing data to the second block; A second step of storing a logical block number corresponding to the second block in all spare areas in the second block when data writing to the second block is completed; And a third step of determining whether the second block is normal or not according to whether the logical block number is written in all of the spare areas, and performing error recovery on an abnormal block.

이하, 첨부된 도면들을 참조하여 본 발명의 바람직한 실시예를 상세하게 설명한다.Hereinafter, exemplary embodiments of the present invention will be described in detail with reference to the accompanying drawings.

도 1은 본 발명에 따른 기억장치의 구성을 나타내는 구성도이다.1 is a configuration diagram showing the configuration of a memory device according to the present invention.

파일 시스템(10)은 어플리케이션으로부터 요청 받은 파일 관련 작업들을 기억장치(20)로 전달한다.The file system 10 transfers the file related operations requested from the application to the storage device 20.

본 발명의 기억장치(20)는 플래시 메모리(22), 버퍼(24), 블럭매핑테이블(26) 및 메모리 제어부(28)를 구비한다.The storage device 20 of the present invention includes a flash memory 22, a buffer 24, a block mapping table 26, and a memory control unit 28.

플래시 메모리(22)는 리드/라이트가 자유로우며, 전원이 꺼져도 저장된 데이터가 지워지지 않는 비휘발성 메모리로, 통상의 플래시 메모리와 동일하다. 도 1에서는 하나의 블럭(BK 0, BK 1, BK 2, …)이 32 섹터들(SECTOR 1 ∼ SECTOR 32)로 이루어진 플래시 메모리를 예시하고 있다. 이러한 플래시 메모리 내에는 파일정보가 저장되는 메타 데이터 영역과 실제 사용자 데이터가 저장되는 일반 데이터 영역이 구비되며, 각 블럭에는 데이터 저장 영역과 해당 블럭에 대응되는 논리적 블럭주소와, ECC(Error Correction Code) 데이터와, 블럭의 상태 등의 정보가 저장되는 스페어 영역이 구비된다. 더욱이, 본 발명에서는 블럭 내 각 섹터의 스페어 영역에 해당 물리적 블럭에 대응되는 논리적 블럭의 번호를 저장하기 위한 공간(필드)을 구비한다.The flash memory 22 is a nonvolatile memory in which read / write is free and stored data is not erased even when the power is turned off. The flash memory 22 is the same as a normal flash memory. 1 illustrates a flash memory in which one block BK 0, BK 1, BK 2,..., Is composed of 32 sectors SECTOR 1 to SECTOR 32. The flash memory includes a metadata area for storing file information and a general data area for storing real user data. Each block includes a data storage area, a logical block address corresponding to the block, and an error correction code (ECC). A spare area is provided for storing data and information such as a block state. Furthermore, the present invention includes a space (field) for storing the number of the logical block corresponding to the physical block in the spare area of each sector in the block.

버퍼(24)는 파일 시스템(10)과 기억장치(20) 사이에서 송·수신 되는 데이터들을 임시 저장한다.The buffer 24 temporarily stores data transmitted and received between the file system 10 and the storage device 20.

블럭매핑테이블(26)은 데이터의 리드/라이트를 위해 파일 시스템(10)에서 요구한 논리적 블럭주소(Logical Block Address)와 이에 대응되어 플래시 메모리(22)에서 실제 사용되는 물리적 블럭주소(Physical Block Address)에 대한 매핑정보를 저장한다.The block mapping table 26 is a logical block address required by the file system 10 for reading / writing data and a physical block address actually used in the flash memory 22 corresponding thereto. Save mapping information for).

메모리 제어부(28)는 시스템 부팅시 플래시 메모리(22)내 각 블럭들(BK 0, BK 1, BK 2, …)의 스페어 영역에 저장된 블럭 정보를 스캔하여 플래시 메모리(22)에 대한 블럭매핑테이블(26)을 작성하고, 이를 참조하여 플래시 메모리(22)에 대한 리드/라이트를 제어한다. 이때, 메모리 제어부(28)는 파일 시스템(10)으로부터 버퍼(24)로 전송된 데이터를 플래시 메모리(22)의 특정 영역에 라이트시 해당 특정 영역이 포함된 블럭(이하, 제 1 블럭이라 함)에 이미 데이터가 저장되어 있는 경우, 즉 제 1 블럭의 데이터를 갱신하고자 하는 경우, 해당 데이터를 제 1 블럭에 라이트하지 않고 새로운 블럭(이하, 제 2 블럭이라 함)을 할당받아 그곳에 데이터를 라이트한다. 그리고, 메모리 제어부(28)는 데이터 라이트 도중 전원차단이나 충격 등으로 에러가 발생하는 경우 이를 원래의 상태대로 복원하기 위해 제 2 블럭내 각 섹터들(SECTOR1 ∼ SECTOR32)의 스페어 영역에 제 2 블럭에 대응되는 논리적 블럭번호를 저장한다. 메모리 제어부(28)는 제 2 블럭에 대한 데이터 라이트가 정상적으로 완료되면, 블럭매핑테이블(26)을 제 2 블럭으로 매핑한 후 제 1 블럭(BK 0)의 데이터를 삭제한다.The memory controller 28 scans the block information stored in the spare area of each of the blocks BK 0, BK 1, BK 2,... In the flash memory 22 at the time of system booting, and the block mapping table for the flash memory 22. (26) is written and the read / write to the flash memory 22 is controlled with reference to this. At this time, the memory controller 28 writes the data transferred from the file system 10 to the buffer 24 in a specific area of the flash memory 22 (hereinafter, referred to as a first block). If data is already stored in the data, that is, if the data of the first block is to be updated, a new block (hereinafter referred to as a second block) is allocated without writing the data to the first block and the data is written there. . When an error occurs due to a power cut or an impact during data writing, the memory controller 28 restores a second block in the spare area of each sector SECTOR1 to SECTOR32 in the second block. Stores the corresponding logical block number. When the data write for the second block is normally completed, the memory controller 28 maps the block mapping table 26 to the second block and then deletes the data of the first block BK 0.

결국, 메모리 제어부(28)는 라이트 하고자 하는 제 1 블럭에 데이터가 저장되어 있는 경우, 제 1 블럭의 데이터를 먼저 삭제하지 않고 제 1 블럭의 데이터가그대로 저장되어 있는 상태에서 새로운 제 2 블럭을 할당받아 그곳에 데이터를 라이트한다. 그리고, 제 2 블럭에 대한 데이터 라이트가 정상적으로 완료된 후에 비로서 제 1 블럭의 데이터를 삭제하게 된다. 따라서, 제 2 블럭에 대한 데이터 라이트가 정상적으로 완료되지 않으면, 메모리 제어부(28)는 시스템 부팅시 이를 확인하여 에러가 발생된 제 2 블럭의 데이터를 모두 삭제하고 제 1 블럭을 유효블럭으로하여 시스템을 구동시킴으로써 데이터 갱신 이전 상태로 시스템을 복원하게 된다.As a result, when data is stored in the first block to be written, the memory controller 28 allocates a new second block while the data of the first block is stored as it is without first deleting the data of the first block. Receive and write data to it. After the data write to the second block is normally completed, the data of the first block is deleted. Therefore, if the data write to the second block is not completed normally, the memory controller 28 checks this when the system is booted, deletes all the data of the second block in which an error occurs, and sets the system as the effective block. This will restore the system to the state before the data update.

도 2는 본 발명에 따른 플래시 메모리의 에러 복구를 위한 전처리 과정으로서 플래시 메모리(22)에 데이터를 라이트하는 과정을 설명하기 위한 순서도이다.2 is a flowchart illustrating a process of writing data to the flash memory 22 as a preprocessing process for error recovery of the flash memory according to the present invention.

플래시 메모리(22)의 제 1 블럭(BK 0)의 데이터를 갱신하기 위해 파일 시스템(10)으로부터 버퍼(24)로 데이터가 전송되면, 메모리 제어부(28)는 제 1 블럭(BK 0)의 데이터를 삭제하지 않고 플래시 메모리(22)에서 데이터가 저장되어 있지 않은 제 2 블럭을 검색하여 제 2 블럭(BK 2)을 제 1 블럭(BK 0)의 데이터를 갱신하기 위한 블럭으로 새로 할당한다(단계 201).When data is transferred from the file system 10 to the buffer 24 to update the data of the first block BK 0 of the flash memory 22, the memory controller 28 stores the data of the first block BK 0. The second block BK 2 is newly allocated as a block for updating the data of the first block BK 0 by retrieving the second block in which data is not stored in the flash memory 22 without deleting the data. 201).

다음에, 메모리 제어부(28)는 새로 할당된 제 2 블럭(BK 2)의 데이터 영역에 데이터를 라이트한다(단계 202).Next, the memory controller 28 writes data to the data area of the newly allocated second block BK 2 (step 202).

도 3은 이처럼 메모리 제어부(28)에서 새로 할당받은 제 2 블럭(BK 2)에 데이터를 갱신하는 방법을 설명하기 위한 개념도이다.3 is a conceptual view illustrating a method of updating data in a second block BK 2 newly allocated by the memory controller 28 as described above.

플래시 메모리(22)에서는 블럭 단위로 데이터를 삭제하기 때문에 블럭 중 어느 한 섹터의 내용만 갱신하려 하더라도 해당 섹터가 포함된 블럭 전체를 삭제해야한다. 따라서, 메모리 제어부(28)는 제 1 블럭(BK 0) 중 일부 섹터 예컨대, 제 3 섹터(SECTOR 3)의 데이터 만을 갱신하고자 하는 경우, 우선 제 1 블럭(BK 0)에서 제 3 섹터(SECTOR 3)를 제외한 나머지 섹터들(SECTOR 1, SECTOR 2, SECTOR 4 ∼ SECTOR 32)을 제 2 블럭(BK 2)의 대응되는 섹터들로 이동시킨다. 다음에, 메모리 제어부(18)는 제 2 블럭(BK 2)의 제 3 섹터(SECTOR 3)에는 버퍼(24)에 저장된 갱신하고자 하는 새로운 데이터를 라이트한다.Since the flash memory 22 deletes data in units of blocks, even if only the contents of one sector of a block are to be updated, the entire block including the sector must be deleted. Therefore, when the memory controller 28 attempts to update only the data of some sectors of the first block BK 0, for example, the third sector SECTOR 3, the memory controller 28 first performs the third sector SEC 3 at the first block BK 0. The remaining sectors (SECTOR 1, SECTOR 2, SECTOR 4 ~ SECTOR 32), except for) are moved to the corresponding sectors of the second block (BK 2). Next, the memory controller 18 writes new data to be updated stored in the buffer 24 to the third sector SECTOR 3 of the second block BK 2.

그리고, 제 2 블럭(BK 2)에 대한 데이터 라이트가 정상적으로 완료되면, 메모리 제어부(28)는 제 2 블럭(BK 2)의 첫번째 섹터부터 시작하여 블럭내 모든 섹터들의 스페어 영역에 제 2 블럭(BK 2)에 대응되는 논리적 블럭번호를 저장한다(단계 203). 즉, 메모리 제어부(28)는 제 2 블럭(BK 2)에 대한 데이터 라이트가 완료되면, 제 2 블럭 내 모든 스페어 영역에 논리적 블럭번호를 저장하게 된다.When the data write to the second block BK 2 is normally completed, the memory controller 28 starts the first sector of the second block BK 2 and starts the second block BK in the spare area of all sectors in the block. The logical block number corresponding to 2) is stored (step 203). That is, when the data write for the second block BK 2 is completed, the memory controller 28 stores the logical block numbers in all spare areas in the second block.

따라서, 전원차단이나 충격발생 등으로 제 2 블럭(BK 2)에 대한 데이터 라이트 도중에 에러가 발생하여 데이터 라이트가 정상적으로 완료되지 못하게 되면, 제 2 블럭(BK 2)의 일부 스페어 영역에는 논리적 블럭번호가 저장되지 못하게 된다. 즉, 가장 마지막 섹터(SECTOR 32)의 스페어 영역에 까지 논리적 블럭번호가 저장되어야만 메모리 제어부(28)는 제 2 블럭(BK 2)을 유효 블럭으로 인식하게 된다.Therefore, if an error occurs during the data write to the second block BK 2 due to a power cut or an impact, the data write is not completed normally, and a logical block number is assigned to some spare areas of the second block BK 2. It will not be saved. That is, the memory controller 28 recognizes the second block BK 2 as a valid block only when the logical block number is stored up to the spare area of the last sector SECTOR 32.

제 2 블럭(BK 2)의 가장 마지막 스페어 영역에 까지 논리적 블럭번호가 정상적으로 저장되면 제 1 블럭(BK 0)의 데이터는 더 이상 필요치 않게 된다. 따라서, 메모리 제어부(28)는 제 1 블럭(BK 0)을 다른 데이터의 저장을 위한 공간으로 재 사용할 수 있도록 제 1 블럭의(BK 0) 데이터를 바로 삭제하거나 제 1 블럭(BK 0)의스페어 영역에 삭제 대상 플래그를 세팅하여 향후 삭제될 다른 블럭들과 같이 삭제될 수 있도록 한다(단계 204).If the logical block number is normally stored in the last spare area of the second block BK 2, the data of the first block BK 0 is no longer needed. Therefore, the memory controller 28 directly deletes the data of the first block BK 0 or reuses the spare of the first block BK 0 so that the first block BK 0 can be reused as a space for storing other data. A delete target flag is set in the area so that the block can be deleted like other blocks to be deleted in the future (step 204).

도 4는 도 2의 데이터 라이트 과정 중 에러가 발생하는 경우 이를 복구하는 과정을 설명하기 위한 순서도이다.4 is a flowchart illustrating a process of recovering an error when an error occurs during the data write process of FIG. 2.

시스템 전원이 온(ON)되면, 메모리 제어부(28)는 플래시 메모리(22)의 각 블럭들(BK 0, BK 1, ¨ )을 스캔하여 블럭 정보를 수집하게 된다. 이때, 메모리 제어부(28)는 각 블럭들(BK 0, BK 1, ¨ )의 첫번째 섹터(SECTOR 1)의 스페어 영역에 저장된 논리적 블럭번호와 마지막 섹터(SECTOR 32)의 스페어 영역에 저장된 논리적 블럭번호를 비교한다(단계 301).When the system power is ON, the memory controller 28 scans each block BK 0, BK 1, ¨ of the flash memory 22 to collect block information. At this time, the memory controller 28 stores the logical block number stored in the spare area of the first sector SECTOR 1 of each of the blocks BK 0, BK 1, ¨ and the logical block number stored in the spare area of the last sector SEC 32. Are compared (step 301).

이때, 두 논리적 블럭번호가 일치하게 되면 제 2 블럭(BK 2)에 대한 라이트가 정상적으로 완료된 것을 의미하며, 두 논리적 블럭번호가 일치하지 않게 되면 제 2 블럭(BK 2)에 대한 라이트가 정상적으로 완료되지 못했다는 것을 의미한다.At this time, if the two logical block numbers match, it means that the writing for the second block BK 2 is completed normally. If the two logical block numbers do not match, the writing for the second block BK 2 is not completed normally. It means no.

따라서, 첫번째 스페어 영역의 논리적 블럭번호와 마지막 스페어 영역의 논리적 블럭번호가 일치하면 제 2 블럭(BK 2)을 정상 블럭으로 간주하여 제 2 블럭의 데이터를 이용하여 시스템을 동작시키고, 두 논리적 블럭번호가 일치하지 않으면 제 2 블럭(BK 2)을 비 정상 블럭으로 간주하여 이에 대한 에러 복구를 수행한다(단계 302).Therefore, if the logical block number of the first spare area and the logical block number of the last spare area match, the system is operated by using the data of the second block, considering the second block BK 2 as a normal block, and the two logical block numbers. If does not match, the second block BK 2 is regarded as an abnormal block and error recovery is performed (step 302).

즉, 도 2의 데이터 라이트 과정에서, 제 2 블럭(BK 2)에 데이터가 정상적으로 라이트되지 않은 경우에는 제 1 블럭(BK 0)의 데이터가 삭제되지 않고 그대로 남아 있게 되며, 매핑테이블(26)에도 아직 제 1 블럭(BK 0)으로 매핑되어 있는 상태로 남아 있게 된다. 따라서, 메모리 제어부(28)는 정상적으로 라이트되지 않은 제 2 블럭(BK 2)의 데이터를 모두 삭제함으로써 간단하게 에러가 발생되기 이전의 상태로 시스템을 복원할 수 있게 된다(단계 303).That is, in the data writing process of FIG. 2, when data is not normally written to the second block BK 2, the data of the first block BK 0 is not deleted and remains as it is. It still remains mapped to the first block BK 0. Therefore, the memory controller 28 can simply restore the system to the state before the error occurred by deleting all the data of the second block BK 2 that was not normally written (step 303).

이에 따라, 메모리 제어부(28)는 데이터 갱신 이전 블럭인 제 1 블럭(BK 0)의 데이터를 이용하여 시스템을 동작시키게 된다.Accordingly, the memory controller 28 operates the system by using data of the first block BK 0, which is a block before data update.

상술한 바와 같이, 본 발명의 에러 복구 방법은 플래시 메모리의 특정 블럭에 대한 데이터 갱신시 해당 특정 블럭의 데이터를 삭제하지 않은 상태에서 새로운 블럭을 할당받아 그 곳에 데이터를 저장한 후, 새로 할당받은 블럭에 대한 데이터 저장이 정상적으로 완료된 경우에만 이전 블럭(특정 블럭)의 데이터를 삭제함으로써, 플래시 메모리에서 메타 데이터 영역에 대한 데이터 갱신시 에러가 발생하여도 이전의 데이터를 용이하게 복원할 수 있으므로 시스템을 안정적으로 동작시킬 수 있게 된다.As described above, in the error recovery method of the present invention, when a data is updated for a specific block of the flash memory, a new block is allocated without storing the data of the specific block, the data is stored there, and then newly allocated block. By deleting the data of the previous block (specific block) only when the data storage for the data has been completed normally, even if an error occurs during the data update of the metadata area in the flash memory, the previous data can be easily restored, thus making the system stable. Can be operated.

Claims (9)

플래시 메모리에 저장될 데이터 및 외부로 출력될 데이터를 임시 저장하는 버퍼;A buffer for temporarily storing data to be stored in the flash memory and data to be output to the outside; 상기 플래시 메모리에 저장될 데이터의 논리적 블럭주소(Logical Block Address)와 이에 대응되는 상기 플래시 메모리의 물리적 블럭주소(Physical Block Address)의 매핑정보를 저장하는 블럭매핑테이블; 및A block mapping table that stores mapping information of a logical block address of data to be stored in the flash memory and a physical block address of the flash memory corresponding thereto; And 상기 블럭매핑테이블의 매핑정보에 따라 상기 플래시 메모리에 대한 데이터 리드 및 라이트를 제어하며, 상기 버퍼의 데이터로 상기 플래시 메모리의 제 1 블럭을 갱신시 제 2 블럭을 할당받아 상기 제 2 블럭에 갱신할 데이터 및 상기 제 2 블럭에 대응되는 논리적 블럭번호를 라이트하는 메모리 제어부를 구비하는 플래시 메모리를 이용하는 기억장치.The data read and write of the flash memory is controlled according to the mapping information of the block mapping table, and when the first block of the flash memory is updated with the data of the buffer, a second block is allocated and updated in the second block. And a memory controller for writing data and a logical block number corresponding to the second block. 제 1항에 있어서, 상기 제 1 블럭 및 상기 제 2 블럭은The method of claim 1, wherein the first block and the second block is 복수의 섹터들을 구비하며, 상기 섹터들의 스페어 영역에 상기 논리적 블럭번호가 저장되는 것을 특징으로 하는 플래시 메모리를 이용하는 기억장치.And a plurality of sectors, wherein the logical block number is stored in a spare area of the sectors. 제 2항에 있어서, 상기 메모리 제어부는The memory controller of claim 2, wherein the memory controller comprises: 상기 제 2 블럭 내 모든 섹터들의 스페어 영역에 상기 논리적 블럭번호가 저장되는 경우에 상기 제 1 블럭의 데이터를 삭제하는 것을 특징으로 하는 플래시 메모리를 이용하는 기억장치.And erasing data of the first block when the logical block number is stored in the spare area of all sectors in the second block. 제 3항에 있어서, 상기 메모리 제어부는The method of claim 3, wherein the memory control unit 시스템 부팅시, 상기 제 2 블럭 내 첫번째 섹터의 스페어 영역에 저장된 상기 논리적 블럭번호와 마지막 섹터의 스페어 영역에 저장된 상기 논리적 블럭번호가 서로 동일한 경우에 상기 제 2 블럭을 유효 블럭으로 인식하는 것을 특징으로 하는 플래시 메모리를 이용하는 기억장치.Recognizing the second block as a valid block when the logical block number stored in the spare area of the first sector and the logical block number stored in the spare area of the last sector are the same when the system is booted. Memory using flash memory. 플래시 메모리의 제 1 블럭에 대한 데이터 갱신시 제 2 블럭을 할당받아 상기 제 2 블럭에 데이터를 라이트하는 제 1 단계;A first step of allocating a second block when writing data to a first block of a flash memory and writing data to the second block; 상기 제 2 블럭에 대한 데이터 라이트 완료시, 상기 제 2 블럭 내 모든 스페어 영역에 상기 제 2 블럭에 대응되는 논리적 블럭번호를 저장하는 제 2 단계; 및A second step of storing a logical block number corresponding to the second block in all spare areas in the second block when data writing to the second block is completed; And 상기 논리적 블럭번호가 상기 모든 스페어 영역에 기재되었는지 여부에 따라 상기 제 2 블럭의 정상 여부를 판단하여 비 정상 블럭에 대한 에러 복구를 수행하는 제 3 단계를 포함하는 플래시 메모리를 이용한 기억장치의 에러 복구 방법.Determining whether the second block is normal or not according to whether the logical block number has been written in all of the spare areas, and performing error recovery on an abnormal block. Way. 제 5항에 있어서, 상기 제 1 단계는The method of claim 5, wherein the first step 상기 제 1 블럭의 특정 섹터의 데이터 갱신시, 상기 제 1 블럭에서 상기 특정 섹터를 제외한 나머지 섹터들을 상기 제 2 블럭으로 이동시켜 저장하고, 상기 특정 섹터에 대응되는 제 2 블럭의 섹터에 상기 갱신될 데이터를 라이트하는 것을특징으로 하는 플래시 메모리를 이용한 기억장치의 에러 복구 방법.When updating data of a specific sector of the first block, the remaining sectors other than the specific sector in the first block are moved to the second block and stored, and the sectors of the second block corresponding to the specific sector are updated. Error recovery method of a storage device using flash memory characterized by writing data. 제 5항 또는 제 6항에 있어서, 상기 제 2 단계는The method of claim 5 or 6, wherein the second step 상기 모든 스페어 영역에 상기 논리적 블럭번호가 정상적으로 저장된 후 상기 제 1 블럭의 데이터를 삭제하는 것을 특징으로 하는 플래시 메모리를 이용한 기억장치의 에러 복구 방법.And deleting the data of the first block after the logical block number is normally stored in all of the spare areas. 제 7에 있어서, 상기 제 3 단계는The method of claim 7, wherein the third step is 상기 제 2 블럭 내 첫번째 스페어 영역과 마지막 스페어 영역에 저장된 상기 논리적 블럭번호의 동일성 여부를 이용하여 상기 제 2 블럭의 정상 여부를 판단하는 것을 특징으로 하는 플래시 메모리를 이용한 기억장치의 에러 복구 방법.And determining whether the second block is normal by using the sameness of the logical block number stored in the first spare area and the last spare area in the second block. 제 9항에 있어서, 상기 제 3 단계는10. The method of claim 9, wherein the third step is 상기 첫번째 스페어 영역과 마지막 스페어 영역에 저장된 상기 논리적 블럭번호가 상이한 경우, 상기 제 2 블럭의 데이터를 삭제하는 것을 특징으로 하는 기억장치의 에러 복구 방법.And when the logical block numbers stored in the first spare area and the last spare area are different, deleting the data of the second block.
KR1020030050923A 2003-07-24 2003-07-24 Memory device using flash memory and error correction method the same KR100654344B1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
KR1020030050923A KR100654344B1 (en) 2003-07-24 2003-07-24 Memory device using flash memory and error correction method the same

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
KR1020030050923A KR100654344B1 (en) 2003-07-24 2003-07-24 Memory device using flash memory and error correction method the same

Publications (2)

Publication Number Publication Date
KR20050011869A true KR20050011869A (en) 2005-01-31
KR100654344B1 KR100654344B1 (en) 2006-12-05

Family

ID=37223797

Family Applications (1)

Application Number Title Priority Date Filing Date
KR1020030050923A KR100654344B1 (en) 2003-07-24 2003-07-24 Memory device using flash memory and error correction method the same

Country Status (1)

Country Link
KR (1) KR100654344B1 (en)

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR100704618B1 (en) * 2004-01-19 2007-04-10 삼성전자주식회사 Data recovery device and method thereof
KR100764052B1 (en) * 2006-08-03 2007-10-08 삼성전자주식회사 Flash memory device with flexible address boundary and program method thereof
KR100801072B1 (en) * 2005-09-30 2008-02-11 삼성전자주식회사 Flash memory device, mapping apparatus and method for the same
KR100809320B1 (en) * 2006-09-27 2008-03-05 삼성전자주식회사 Apparatus and method for managing mapping information of non-volatile memory supporting separated cell type
JP2008074777A (en) * 2006-09-22 2008-04-03 Maruzen Pharmaceut Co Ltd Melanocyte activation inhibitor and skin preparation for external use
KR100872186B1 (en) * 2007-01-04 2008-12-09 삼성전자주식회사 Hybrid flash memory device with different error control scheme and memory system includign the same
KR100950281B1 (en) * 2008-02-28 2010-03-31 아주대학교산학협력단 Flash memory system and method for data operation of flash memory
WO2013019043A2 (en) * 2011-07-29 2013-02-07 Taejin Info Tech Co., Ltd. Disk input/output (i/o) layer architecture having block level device driver

Cited By (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR100704618B1 (en) * 2004-01-19 2007-04-10 삼성전자주식회사 Data recovery device and method thereof
KR100801072B1 (en) * 2005-09-30 2008-02-11 삼성전자주식회사 Flash memory device, mapping apparatus and method for the same
KR100764052B1 (en) * 2006-08-03 2007-10-08 삼성전자주식회사 Flash memory device with flexible address boundary and program method thereof
US7539077B2 (en) 2006-08-03 2009-05-26 Samsung Electronics Co., Ltd. Flash memory device having a data buffer and programming method of the same
JP2008074777A (en) * 2006-09-22 2008-04-03 Maruzen Pharmaceut Co Ltd Melanocyte activation inhibitor and skin preparation for external use
KR100809320B1 (en) * 2006-09-27 2008-03-05 삼성전자주식회사 Apparatus and method for managing mapping information of non-volatile memory supporting separated cell type
KR100872186B1 (en) * 2007-01-04 2008-12-09 삼성전자주식회사 Hybrid flash memory device with different error control scheme and memory system includign the same
KR100950281B1 (en) * 2008-02-28 2010-03-31 아주대학교산학협력단 Flash memory system and method for data operation of flash memory
WO2013019043A2 (en) * 2011-07-29 2013-02-07 Taejin Info Tech Co., Ltd. Disk input/output (i/o) layer architecture having block level device driver
WO2013019043A3 (en) * 2011-07-29 2013-04-04 Taejin Info Tech Co., Ltd. Disk input/output (i/o) layer architecture having block level device driver
KR101316917B1 (en) * 2011-07-29 2013-10-11 주식회사 태진인포텍 Disk input/output(i/o) layer architecture having block level device driver

Also Published As

Publication number Publication date
KR100654344B1 (en) 2006-12-05

Similar Documents

Publication Publication Date Title
CN109933545B (en) Data storage device and data processing method of memory device
JP5035636B2 (en) Moving sectors in blocks in flash memory
KR100531192B1 (en) Non-volatile memory control method
US8041878B2 (en) Flash file system
EP1036364B1 (en) Alignment of cluster address to block addresses within a semiconductor non-volatile mass storage memory
US6978342B1 (en) Moving sectors within a block of information in a flash memory mass storage architecture
JP4588431B2 (en) Faster write operations to non-volatile memory due to the operation of frequently accessed sectors
EP2955633B1 (en) Data erasing method and device for flash memory
US20150186224A1 (en) Data storage device and flash memory control method
US20110099323A1 (en) Non-volatile semiconductor memory segregating sequential, random, and system data to reduce garbage collection for page based mapping
US20020085433A1 (en) Data management system and data management method
JP2005242897A (en) Flash disk drive
JP3942612B2 (en) Storage device, memory management method, and program
JPH08137634A (en) Flash disk card
KR20090117929A (en) Memory system
JPWO2009004674A1 (en) Storage device, disk device, write determination method, control device
US10248526B2 (en) Data storage device and data maintenance method thereof
JP2009205689A (en) Flash disk device
KR100654344B1 (en) Memory device using flash memory and error correction method the same
CN113885808A (en) Mapping information recording method, memory control circuit unit and memory device
JP2005222202A (en) Data protection method for nonvolatile storage device
KR100654343B1 (en) Memory device and error correction method using flash memory
CN111338562A (en) Data storage device and data processing method
CN112988076B (en) Flash memory control method, storage device and controller
JP3826115B2 (en) Storage device, memory management method, and program

Legal Events

Date Code Title Description
A201 Request for examination
E902 Notification of reason for refusal
E902 Notification of reason for refusal
E701 Decision to grant or registration of patent right
GRNT Written decision to grant
FPAY Annual fee payment

Payment date: 20121130

Year of fee payment: 7

FPAY Annual fee payment

Payment date: 20131030

Year of fee payment: 8

FPAY Annual fee payment

Payment date: 20141020

Year of fee payment: 9

FPAY Annual fee payment

Payment date: 20150914

Year of fee payment: 10

FPAY Annual fee payment

Payment date: 20161011

Year of fee payment: 11

FPAY Annual fee payment

Payment date: 20171020

Year of fee payment: 12

FPAY Annual fee payment

Payment date: 20180921

Year of fee payment: 13