KR20110070656A - Method and apparatus for processing data of flash memory - Google Patents

Method and apparatus for processing data of flash memory Download PDF

Info

Publication number
KR20110070656A
KR20110070656A KR1020100018141A KR20100018141A KR20110070656A KR 20110070656 A KR20110070656 A KR 20110070656A KR 1020100018141 A KR1020100018141 A KR 1020100018141A KR 20100018141 A KR20100018141 A KR 20100018141A KR 20110070656 A KR20110070656 A KR 20110070656A
Authority
KR
South Korea
Prior art keywords
block
flash memory
data
page
mapping table
Prior art date
Application number
KR1020100018141A
Other languages
Korean (ko)
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 한국전자통신연구원
Publication of KR20110070656A publication Critical patent/KR20110070656A/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F12/00Accessing, addressing or allocating within memory systems or architectures
    • G06F12/02Addressing or allocation; Relocation
    • G06F12/08Addressing or allocation; Relocation in hierarchically structured memory systems, e.g. virtual memory systems
    • G06F12/10Address translation
    • G06F12/1009Address translation using page tables, e.g. page table structures
    • 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

Abstract

PURPOSE: Data processing method and device are provided to shorten mount time by reducing the occupancy of a main memory space. CONSTITUTION: A mapping table processor(10) generates a mapping table corresponding to a saving space of a flash memory. A write buffer(20) performs data write operation of the flash memory. If the data is recorded by a page unit, a block selector(30) selects an empty table by searching a page table from the mapping table. The write buffer records the data of the corresponding page.

Description

플래시 메모리의 데이터 처리 방법 및 장치{Method and Apparatus for processing data of Flash memory}Method and device for processing data in flash memory {Method and Apparatus for processing data of Flash memory}

본 발명은 플래시 메모리의 데이터 처리 방법 및 장치에 관한 것으로, 특히, 임베디드 시스템의 주 저장장치로 사용되는 플래시 메모리에 데이터를 저장하기 위한 파일 시스템에서, 매핑 테이블 공간 소모를 줄여 소모되는 메모리 양을 줄이기 위한 플래시 메모리의 데이터 처리 방법 및 장치이다.The present invention relates to a data processing method and apparatus of a flash memory, and in particular, in a file system for storing data in a flash memory used as a main storage device of an embedded system, to reduce the amount of memory consumed by reducing the mapping table space consumption. A data processing method and apparatus for a flash memory.

본 발명은 지식경제부 및 정보통신연구진흥원의 기술개발사업의 일환으로 수행한 연구로부터 도출된 것이다[과제관리번호: 2009-S-029-01, 과제명: 정보 산업기기용 임베디드SW 공통 플랫폼 개발].The present invention is derived from the research conducted as part of the technology development project of the Ministry of Knowledge Economy and the Korea Institute of Information and Telecommunications Promotion. .

최근에는 휴대폰, MP3, 디지털 카메라, PMP(Portable Multimedia Player) 등과 같은 다양한 모바일 기기의 사용이 증가하여 대용량 플래시 메모리를 탑재한 임베디드 시스템이 증가하고 있다. 이런 임베디드 시스템에 리눅스와 플래시 메모리를 위한 전용 파일 시스템(Native Flash File System)의 조합을 사용하여 비용을 절감하려는 경우가 증가하고 있다.Recently, the use of various mobile devices such as mobile phones, MP3s, digital cameras, portable multimedia players (PMPs), and the like, has increased the number of embedded systems equipped with large-capacity flash memory. Increasingly, these embedded systems use a combination of Linux and the Native Flash File System for flash memory to reduce costs.

일반적으로, 플래시 메모리는 비휘발성, 저전력 소비, 빠른 접근속도 등의 특징이 있으며 메모리 셀을 구성하는 게이트의 종류에 따라 NAND형과 NOR형 플래시 메모리로 구분된다. 그 중에서 낸드(NAND) 플래시 메모리는 집적도가 높아 대용량 데이터를 저장하기 위한 대부분의 기기에 사용되고 있는 실정이다. In general, flash memory has characteristics such as nonvolatile, low power consumption, and fast access speed, and is classified into NAND type and NOR type flash memory according to the type of gate constituting the memory cell. Among them, NAND flash memory is used in most devices for storing large data due to its high density.

플래시 메모리 파일 시스템의 종류로는 MTD(memory technology device)를 사용하는 JFFS(journaling flash file system), YAFFS(yet another flash file system) 등이 있다. 이러한 파일 시스템은 플래시 메모리의 특성인 wear-out(지우는 횟수에 제한이 있는 특성)을 커버하기 위해 로그 구조 파일 시스템(log-structured File System) 방식을 채용하고, 효율적 메모리 사용을 위해 작은 크기 단위로(NAND 플래시 메모리의 경우 페이지) 메모리 공간을 나누어 관리하고, 이러한 단위로 구성된 매핑 테이블을 주메모리 상에서 관리하게 된다. Types of flash memory file systems include a journaling flash file system (JFFS) that uses a memory technology device (MTD), and another another flash file system (YAFFS). The file system adopts a log-structured file system to cover the wear-out characteristic of the flash memory, which has a limited number of erase times, and uses a small size unit for efficient memory usage. The memory space is divided and managed, and a mapping table composed of these units is managed in main memory.

이러한 플래시 메모리의 특성으로 인하여 하드디스크 등에 사용되는 기존 파일시스템을 플래시 메모리에 바로 적용할 수 없으므로 플래시 메모리용 파일 시스템에 대한 연구가 활발히 진행되어 오고 있다.Due to the characteristics of the flash memory, the existing file system used for the hard disk cannot be directly applied to the flash memory. Therefore, research on the file system for the flash memory has been actively conducted.

그러나, 대용량 플래시 메모리를 사용하는 임베디드 시스템의 경우, 멀티미디어 데이터 같은 큰 파일들이 많게 되는데 이를 위해 굳이 매핑 테이블 엔트리를 사용하는 것은 불필요하다.However, in an embedded system using a large amount of flash memory, there are many large files such as multimedia data. For this, it is unnecessary to use a mapping table entry.

또한, 로그 구조 파일 시스템(LFS)은 플래시 메모리 전역을 읽어 마운트(mount)함으로써 마운트 시간이 길게 소요되며, 더 큰 문제는 그 시간이 플래시의 용량에 비례하여 증가한다는 점이다. 물론, 임베디드 시스템을 사용하는 사용자들도 대용량 저장 공간은 원하지만 쓸데없이 매핑 테이블에 소요되는 주메모리 공간과 느려진 부팅 시간은 원치 않는다. In addition, the log structure file system (LFS) takes a long mount time by reading and mounting the entire flash memory, and a bigger problem is that the time increases in proportion to the capacity of the flash. Of course, users of embedded systems also want a lot of storage, but they don't want the main memory space that is unnecessarily spent on the mapping tables and the slow boot time.

따라서, 종래의 LFS 스타일의 파일 시스템(JFFS, YAFFS)을 플래시 메모리를 위한 파일 시스템으로 사용할 경우, 매핑 테이블이 주메모리에서 차지하는 공간이 크고 이를 주메모리에 구성하기 위한 마운트 시간이 길어지는 문제점이 있었다.Therefore, when using a conventional LFS-style file system (JFFS, YAFFS) as a file system for flash memory, there is a problem that the mapping table occupies a large amount of space in main memory and a mount time for configuring it in main memory is long. .

본 발명은 상술한 문제점을 해결하기 위해 안출한 것으로, 본 발명의 목적은플래쉬 메모리의 로그 구조 파일 시스템에서, 큰 파일에 소요되는 매핑 테이블의 크기를 줄여 주메모리 공간 소모를 줄이고, 이를 통해 마운트 시간을 단축시키도록 하는 플래시 메모리의 데이터 처리 방법 및 장치를 제공한다.SUMMARY OF THE INVENTION The present invention has been made to solve the above-described problem, and an object of the present invention is to reduce the size of the mapping table required for a large file in a log structure file system of a flash memory, thereby reducing the main memory space consumption, and thereby mounting time. Provided are a method and an apparatus for processing data in a flash memory to shorten the time required.

상기와 같은 목적을 달성하기 위하여 본 발명의 바람직한 실시 예에 따른 플래시 메모리의 데이터 처리 방법은 복수의 페이지를 포함하는 블록들에 대응하여 구성된 매핑 테이블을 갖는 플래시 메모리의 데이터 처리 방법에 있어서, 기 블록들 중 페이지 단위로 데이터가 저장된 블록은 페이지 별로 매핑 테이블을 구성하고, 블록들 중 블록 단위로 데이터가 저장된 블록은 블록 별로 매핑 테이블을 구성하는 것을 특징으로 한다.In order to achieve the above object, a data processing method of a flash memory according to an embodiment of the present invention is a data processing method of a flash memory having a mapping table configured to correspond to blocks including a plurality of pages. Among them, a block in which data is stored in page units constitutes a mapping table for each page, and a block in which data is stored in blocks per block constitutes a mapping table for each block.

본 발명의 구성을 따르면 큰 파일에 소요되는 매핑 테이블의 크기를 줄여 주메모리 공간 소모를 줄이고 이를 통해 마운트 시간을 단축하는 데이터 처리 방법을 제공하여 결과적으로 사용자가 사용하는 플래쉬 메모리의 자원 소모가 적고 부팅 시간을 단축시켜 사용자의 대기 시간을 줄이는 이점이 있다.According to the configuration of the present invention, by reducing the size of the mapping table required for large files to reduce the main memory space consumption, thereby providing a data processing method for reducing the mount time, as a result, the use of less flash memory resources used by the user and booting There is an advantage in reducing the waiting time of the user by reducing the time.

도 1 및 도 2는 본 발명의 실시예에 따른 플래쉬 메모리의 저장구조를 설명하기 위한 도면,
도 3은 본 발명에 따른 플래쉬 메모리의 데이터 처리 장치의 구성을 도시한 도면,
도 4은 본 발명에 따른 플래쉬 메모리의 데이터 쓰기 방식을 예시한 도면,
도 5는 본 발명에 따른 마운팅 방식을 예시한 도면.
1 and 2 are views for explaining a storage structure of a flash memory according to an embodiment of the present invention;
3 is a diagram showing the configuration of a data processing apparatus of a flash memory according to the present invention;
4 is a diagram illustrating a data writing method of a flash memory according to the present invention;
5 illustrates a mounting scheme in accordance with the present invention.

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

본 발명에 따른 플래시 메모리의 데이터 처리 방법은 복수의 페이지를 포함하는 블록들에 대응하여 구성된 매핑 테이블을 갖는 플래시 메모리에 적용된다. 본 발명에 따른 플래시 메모리의 데이터 처리 방법은 플래쉬 메모리의 블록들 중 페이지 단위로 데이터가 저장된 블록은 페이지 별로 매핑 테이블을 구성하고, 블록들 중 블록 단위로 데이터가 저장된 블록은 블록 별로 매핑 테이블을 구성하는 특징을 포함한다.
The data processing method of a flash memory according to the present invention is applied to a flash memory having a mapping table configured to correspond to blocks including a plurality of pages. In the data processing method of the flash memory according to the present invention, a block in which data is stored in page units among the blocks of the flash memory constitutes a mapping table for each page, and a block in which data is stored in block units among the blocks constitutes a mapping table for each block. Includes features to

우선, 본 발명이 적용되는 플래시 메모리는 전기적으로 쓰기/지우기가 가능한 비휘발성 소자이며, NOR 플래시 메모리 또는 NAND 플래시 메모리 등이 있다. 예컨데, 플래쉬 메모리는 플로팅 게이트 트랜지스터인 EEPROM(Electrically Eraseable and Programmable Read Only Memory) 등을 채용하게 된다. 그리고, NAND 플래시 메모리는 셀이 직렬로 배치된 데이터 저장형 플래시 메모리로서, 읽기/쓰기 단위가 비교적 큰 페이지단위이며, 용량이 크기 때문에 NOR 플래시 메모리보다 대용량화가 용이하다. First, a flash memory to which the present invention is applied is a nonvolatile device capable of electrically writing / erasing, such as a NOR flash memory or a NAND flash memory. For example, the flash memory adopts EEPROM (Electrically Eraseable and Programmable Read Only Memory), which is a floating gate transistor. The NAND flash memory is a data storage flash memory in which cells are arranged in series. The NAND flash memory has a relatively large page unit with a read / write unit and a large capacity, making it easier to increase the capacity of the NAND flash memory.

그러나, 플래시 메모리는 기존의 하드디스크 등과 같은 저장매체에 비하여 다음과 같은 단점이 있다. 첫째, 플래시 메모리는 데이터 수정 시 본래 주소에 덮어쓰기가 불가능하다. 플래시 메모리의 각 비트가 단방향으로만 토글링(toggling)되기 때문에 쓰기 연산 시 초기화 연산을 선행해야 한다. 즉, 쓰기 연산 전에 해당 메모리 공간이 초기화되어 있어야 한다. 둘째, 플래시 메모리의 각 블럭은 초기화 연산의 횟수가 제한되어 있기 때문에 플래시 메모리의 전체 공간이 균등하게 사용되지 못하는 경우에 사용 가능한 메모리 공간이 급격히 줄어들게 된다. 이러한 플래시 메모리의 단점을 극복하고 효과적으로 사용하기 위해 다양한 지움 정책(cleaning policy)과 균등 사용(wear-leveling) 기법이 필요하다. 또한, 낸드 플래시 메모리는 바이트 단위가 아닌 페이지 단위의 접근만 허용되는 단점이 존재한다.However, flash memory has the following disadvantages as compared to a storage medium such as a conventional hard disk. First, flash memory cannot overwrite its original address when data is modified. Since each bit of flash memory is only toggled in one direction, the write operation must be preceded by an initialization operation. That is, the memory space must be initialized before the write operation. Second, since each block of the flash memory has a limited number of initialization operations, the usable memory space is drastically reduced when the total space of the flash memory is not evenly used. Various cleaning policies and wear-leveling techniques are needed to overcome and effectively use the disadvantages of flash memory. In addition, the NAND flash memory has a disadvantage that only the page unit access is allowed, not the byte unit.

그래서, 본 발명에 따른 플래시 메모리의 데이터 처리 방법은, 이러한 플래쉬 메모리의 특성을 감안하여, 기본적으로 플래시 메모리(예컨데, NAND 플래쉬 메모리등)를 하나의 로그(Log)로 정의하고, 이를 처음부터 끝까지 로깅하는 방식의 로그-구조(Log-Structure) 파일 방식을 이용한다. 이러한 구조는 플래시 메모리의 새로운 영역에 데이터 쓰기를 하는 방식이므로, 쓰기 연산이 수행되기 전에 지우기 연산의 제약을 피할 수 있도록 이루어진다.
Therefore, in the data processing method of the flash memory according to the present invention, in consideration of the characteristics of the flash memory, the flash memory (for example, NAND flash memory, etc.) is basically defined as one log, and this is from the beginning to the end. Log-Structure file method of logging is used. Since this structure is a method of writing data to a new area of the flash memory, it is possible to avoid the limitation of the erase operation before the write operation is performed.

도 1 및 도 2는 본 발명에 따른 플래쉬 메모리의 저장구조를 설명하기 위한 도면이다.
1 and 2 are views for explaining a storage structure of a flash memory according to the present invention.

도 1을 참조하면, 플래쉬 메모리의 저장구조는 복수의 페이지들(2i page)을 갖는 복수의 블록들(2j block)로 나뉜다. 그리고 플래쉬 메모리에는 구성된 페이지와 블록을 기본단위로 하여 데이터를 저장/삭제하게 된다. 예를 들어, 플래쉬 메모리의 블록을 m개의 블록으로 나누고, 각 블록을 n개의 페이지로 나눌 경우, 플래시 메모리 공간은 m x n 개의 페이지를 갖게 된다.Referring to FIG. 1, a storage structure of a flash memory is divided into a plurality of blocks 2j blocks having a plurality of pages 2i pages. The flash memory stores and deletes data based on the configured pages and blocks. For example, if a block of flash memory is divided into m blocks, and each block is divided into n pages, the flash memory space has m x n pages.

여기서, 페이지의 크기는 작은 크기의 데이터를 기록할 때 효율적일 정도로 작게 하고, 블록의 크기는 큰 크기의 데이터를 기록할 때 효율적일 정도로 크게 잡는다. 도 1에 도시된 NAND 플래시 메모리의 경우, 512 바이트의 페이지 단위로 읽기/쓰기 접근이 가능하고, 32개의 페이지로 모인 블록 단위로 데이터 지우기를 접근할 수 있는데 바로 이 512 바이트의 페이지와, 16KB의 블록이 각각 페이지와 블록에 대응될 수 있다. 예를 들어, 플래시 메모리의 종류에 따라 하나의 블럭 크기가 128KB인 경우에는 블럭당 64개의 2KB 크기의 페이지가 구성되며, 하나의 블럭 크기가 16KB인 경우에는 블럭당 32개의 512B 크기의 페이지가 구성된다.Here, the size of the page is made small enough to be efficient when recording small sized data, and the size of the block is made large enough to be efficient when writing large sized data. In the case of the NAND flash memory shown in FIG. 1, read / write access is possible in units of 512 bytes, and data erasing can be accessed in blocks of 32 pages. Blocks may correspond to pages and blocks, respectively. For example, if a block size is 128KB, 64 2KB pages per block are configured according to the type of flash memory. If a block size is 16KB, 32 512B pages are configured per block. do.

또, 플래쉬 메모리의 페이지는 헤더를 포함하고, 헤더 이외의 공간에는 실제 데이터(이하, chunk라고 통칭한다.)가 저장된다. NAND 플래시 메모리의 경우, 페이지마다 16 바이트의 spare area에 헤더가 기록되고, 페이지 전체를 데이터 공간으로 사용할 수 있다.
The page of the flash memory includes a header, and actual data (hereinafter referred to as chunk) is stored in a space other than the header. In the case of NAND flash memory, a header is written to a spare area of 16 bytes per page, and the entire page can be used as a data space.

도 2를 참조하면, 헤더는 타입(type), inode number, chunk number, version 필드를 포함한다. inode number는 플래쉬 메모리에 저장된 파일마다 갖는 고유한 아이디이다. 플래쉬 메모리에 저장된 하나의 파일에 대한 아이노드 페이지와 데이터 페이지는 동일한 inode number를 갖는다. chunk number는 플래쉬 메모리에 저장된 하나의 파일을 고정된 단일 chunk로 나누어 각각의 chunk에 부여된 번호이다. chunk number는 하나의 파일 내에서의 chunk 크기로 나눈 후 각각의 chunk에 순번을 달아 저장한다. Chunk number는 파일의 크기가 비교적 작거나 큰 경우에 유효한 필드이다. version 필드는 데이터가 저장된 페이지로 다른 데이터의 덮어쓰기 요청이 들어오면 데이터를 다른 페이지에 기록하고, version 필드를 데이터가 저장된 페이지와 다르게 부여한다. 이러한 version 필드는 어느 페이지가 유효한 것인지 판별하기 위한 필드이다. Referring to FIG. 2, the header includes a type, inode number, chunk number, and version fields. The inode number is a unique ID for each file stored in flash memory. The inode and data pages for a file stored in flash memory have the same inode number. A chunk number is a number assigned to each chunk by dividing a file stored in flash memory into a single fixed chunk. The chunk number is divided by the chunk size in a file and stored in order for each chunk. Chunk number is a valid field when the file size is relatively small or large. The version field is a page where data is stored. When a request for overwriting other data is received, the version field is written to another page. The version field is different from the page where the data is stored. This version field is a field for determining which pages are valid.

그리고 type은 아이노드, 데이터 페이지, 데이터 블록을 포함한다. 아이노드 타입은 통상 아이노드라고 부르는 파일 메타 데이터로 읽기/쓰기 권한, 변경시간 등 파일의 실제 데이터 외에 그 파일을 기술하는 모든 정보를 담는다. 단, 아이노드에 해당하는 데이터는 페이지/블록들의 위치에 대한 정보는 포함하지 않는다. 데이터 블록 타입은 해당 페이지를 갖는 블록 전체가 단 하나의 파일에 속한 연속적인 데이터를 갖는다는 의미이다. 즉, 데이터 블록 타입은 블록을 구성하는 모든 페이지에 저장된 데이터가 한 파일에 속한다는 것이다. 그래서, 데이터 블록 타입은 블록의 각 페이지가 각자 헤더를 가질 필요 없이 그 블록의 첫 페이지만 헤더를 갖고, 그 헤더에 데이터 블록이라고 표시한다. 데이터 페이지 타입은 페이지에 저장된 데이터는 특정 파일의 데이터라는 의미를 갖는다.
The type includes an inode, a data page, and a data block. An inode type is file metadata, commonly called an inode, that contains all information describing the file in addition to the actual data of the file, such as read / write permissions and modification time. However, the data corresponding to the inode does not include information about the location of the page / blocks. The data block type means that the entire block having the corresponding page has contiguous data belonging to only one file. In other words, the data block type means that the data stored in all pages constituting the block belongs to one file. Thus, the data block type indicates that only the first page of the block has a header, and that the data block is indicated in the header, without each page of the block having its own header. The data page type means that data stored in a page is data of a specific file.

도 3을 참조하면, 본 발명에 따른 플래쉬 메모리의 데이터 처리 방법이 적용된 플래쉬 메모리의 데이터 처리 장치는 매핑 테이블 처리부(10), 쓰기 버퍼부(20), 블록 선택부(30), 페이지 선택부(40)를 포함하여 구성된다. Referring to FIG. 3, the data processing apparatus of the flash memory to which the data processing method of the flash memory according to the present invention is applied may include a mapping table processor 10, a write buffer unit 20, a block selector 30, and a page selector ( 40).

매핑 테이블 처리부(10)는 플래쉬 메모리의 저장공간에 대응되는 매핑 테이블을 생성한다. 예를 들어, 플래시 메모리의 저장공간이 m x n 개의 페이지를 포함할 경우, 매핑 테이블 처리부(10)는 포함되는 저장공간에 대응하여 매핑 테이블을 생성한다. 그리고, 본 발명에서 플래쉬 메모리의 저장/읽기 동작시 매핑 테이블이 이용되게 된다. The mapping table processor 10 generates a mapping table corresponding to the storage space of the flash memory. For example, when the storage space of the flash memory includes m x n pages, the mapping table processor 10 generates a mapping table corresponding to the included storage space. In the present invention, the mapping table is used during the storage / read operation of the flash memory.

여기서, 매핑 테이블 처리부(10)는 매핑 테이블 생성시 플래쉬 메모리의 페이지 단위로 데이터를 저장하도록 사용된 블록에 대해서만 페이지 별로 매핑 테이블을 만들고, 대용량 데이터에 대해서는 블록 별로 매핑 테이블을 생성하여 불필요하게 많은 공간이 사용되지 않도록 한다.
Here, the mapping table processing unit 10 creates a mapping table for each page only for blocks used to store data in units of pages of flash memory when generating the mapping table, and generates a mapping table for each large block of data to create unnecessary space. This should not be used.

또, 매핑 테이블 처리부(10)는 플래쉬 메모리의 타입(type)을 근거로 블록 단위 또는 페이지 단위를 판별하고, 그에 따라 매핑 테이블을 생성한다. 즉, 매핑 테이블 처리부(10)는 플래쉬 메모리의 마운트 시에는 주 메모리(미도시) 상에 각 블록에 대한 매핑 테이블을 블록 단위로 만든다. 그리고, 각 블록의 첫 페이지의 헤더(NAND 플래시 메모리라면 spare area에 저장된)를 읽어서 먼저 타입을 확인한다. 매핑 테이블 처리부(10)는 확인된 블록의 타입이 데이터 블록 타입이라면 해당 블록 모두가 한 파일에 속하므로 나머지 페이지의 헤더는 전혀 읽을 필요가 없는 것으로 판단한다. 그리고, 매핑 테이블 처리부(10)는 읽은 정보만을 가지고 해당 블록에 대한 매핑 테이블의 블록 테이블 엔트리를 채운다. In addition, the mapping table processor 10 determines a block unit or a page unit based on the type of the flash memory, and generates a mapping table accordingly. That is, the mapping table processor 10 creates a mapping table for each block in units of blocks on the main memory (not shown) when the flash memory is mounted. It then checks the type first by reading the header of the first page of each block (stored in spare area for NAND flash memory). If the type of the checked block is a data block type, the mapping table processor 10 determines that the headers of the remaining pages do not need to be read at all because all of the blocks belong to one file. Then, the mapping table processing unit 10 fills the block table entry of the mapping table for the corresponding block with only the read information.

여기서, 매핑 테이블 처리부(10)는 확인된 블록의 타입이 데이터 페이지 타입이나 아이노드 타입이라면 해당 블록은 블록 단위로 사용되는 것이 아니라 페이지 단위로 사용되는 것으로 판단한다. 매핑 테이블 처리부(10)는 판단된 블록에 대응되는 매핑 테이블의 페이지 테이블 엔트리를 만든다. 그리고 매핑 테이블 처리부(10)는 그 블록 안의 각 페이지에 대한 헤더를 읽어 페이지 테이블 엔트리를 채운다. 이런 식으로 매핑 테이블 처리부(10)는 블록 단위가 아닌 페이지 단위로 사용되는 블록에 대해서만 매핑 테이블의 페이지 테이블 엔트리를 만들어서, 대용량 데이터에 대해서는 불필요하게 많은 페이지 테이블 공간이 사용되지 않도록 한다.
Here, if the type of the identified block is a data page type or an inode type, the mapping table processor 10 determines that the corresponding block is used in units of pages rather than units of blocks. The mapping table processor 10 creates a page table entry of the mapping table corresponding to the determined block. The mapping table processing unit 10 then reads the header for each page in the block and fills in the page table entry. In this way, the mapping table processing unit 10 makes a page table entry of the mapping table only for blocks used in page units, not block units, so that a large amount of page table space is not unnecessarily used.

쓰기 버퍼부(20)는 플래쉬 메모리의 데이터 쓰기 동작을 수행한다. 쓰기 버퍼부(20)는 상술한 매핑 테이블을 이용하여 플래쉬 메모리에 데이터 쓰기 동작을 수행한다. 즉, 본 발명에서는 플래쉬 메모리로의 쓰기 요청시 기본적으로 JFFS나 YAFFS 같은 log-structured 파일 저장 방식으로 기록하게 된다. 쓰기 버퍼부(20)는 내부에 각 파일별로 쓰기 버퍼를 포함하고, 플레쉬 메모리로의 쓰기 요청된 데이터를 버퍼에 임시로 모으게 된다. 그리고, 쓰기 버퍼부(20)는 주기적으로 버퍼를 체크하여 모아진 데이터가 블록 크기를 넘겼다면 블록 쓰기를 하고, 그렇지 않다면 페이지 쓰기를 한다. The write buffer unit 20 performs a data write operation of the flash memory. The write buffer unit 20 performs a data write operation to the flash memory using the above-described mapping table. That is, in the present invention, the write request to the flash memory is basically recorded in a log-structured file storage method such as JFFS or YAFFS. The write buffer unit 20 includes a write buffer for each file therein, and temporarily collects data requested for writing to the flash memory in the buffer. Then, the write buffer unit 20 periodically checks the buffer and writes a block if the collected data exceeds a block size, and otherwise writes a page.

여기서, 쓰기 버퍼부(20)가 블록 쓰기를 하는 경우 블록 선택부(30)를 통해 마지막으로 기록한 블록 다음의 빈 블록을 찾아서 해당 블록에 기록한다. 즉, 블록 선택부(30)는 데이터를 블록 단위로 기록할 경우 매핑 테이블에서 블록 테이블을 검색하여 빈 블록을 선택한다. 그러면 쓰기 버퍼부(20)는 해당 블록에 데이터를 기록하게 된다.
Here, when the write buffer unit 20 writes a block, the block selection unit 30 searches for an empty block next to the last recorded block and writes the block. That is, when recording data in block units, the block selector 30 searches for a block table in the mapping table and selects an empty block. The write buffer unit 20 then writes data in the corresponding block.

또, 쓰기 버퍼부(20)는 페이지 쓰기를 하는 경우, 페이지 선택부(40)를 통해 빈 페이지를 찾아서 데이터를 해당 페이지에 기록한다. 즉, 블록 선택부(30)는 데이터를 페이지 단위로 기록할 경우 매핑 테이블에서 페이지 테이블을 검색하여 빈 테이블을 선택한다. 그러면 쓰기 버퍼부(20)는 해당 페이지에 데이터를 기록하게 된다. When writing a page, the write buffer unit 20 finds a blank page through the page selector 40 and writes data to the corresponding page. That is, when recording data in units of pages, the block selector 30 searches for a page table in the mapping table and selects an empty table. The write buffer unit 20 then writes data to the corresponding page.

여기서, 쓰기 버퍼부(20)는 페이지 쓰기를 하는 경우, 마지막으로 기록한 블록 다음의 빈 블록을 선택하는 것이 아니라, 이미 사용된 블록 중에 일부 페이지만 사용된 블록을 먼저 찾는다. 예를 들어, 쓰기 버퍼부(20)는 블록 크기를 넘기지 않는 쓰기라고 판별된 경우로(예를 들어 일정 시간 동안에 버퍼에 블록 크기 이상의 데이터가 쌓이지 않거나 쌓이기 전에 파일을 닫는 경우 등) 빈 블록이 아닌 빈 페이지를 필요하게 된다. 쓰기 버퍼부(20)는 해당되는 블록이 있다면 그 블록 안의 빈 페이지에 기록하면 된다. 즉, 쓰기 버퍼부(20)는 블록 단위가 아니라 페이지 단위로 사용되는 블록 중에 대상을 찾는 것이다. 또한, 쓰기 버퍼부(20)는 페이지 단위로 사용한 블록이 다 차서 없다면, 블록 쓰기를 할 때처럼 다음 빈 블록을 선택하면 된다.
Here, when writing a page, the write buffer unit 20 does not select an empty block after the last written block, but finds a block in which only some pages are used among blocks already used. For example, the write buffer unit 20 is a case in which it is determined that the write does not exceed the block size (for example, when the data of more than the block size does not accumulate in the buffer for a predetermined time or the file is closed before stacking). You will need a blank page. If there is a corresponding block, the write buffer unit 20 may write a blank page in the block. That is, the write buffer unit 20 searches for a target among blocks used in page units instead of block units. In addition, if the block used in the page unit is not full, the write buffer unit 20 may select the next empty block as in the case of writing a block.

도 4는 본 발명에 따른 플래쉬 메모리의 파일 쓰기 방식을 예시한 도면이다. 4 is a diagram illustrating a file writing method of a flash memory according to the present invention.

도 4를 참조하면, 쓰기 버퍼부(20)는 플래쉬 매모리로의 쓰기 요청을 받게 된다(S10) 그러면, 쓰기 버퍼부(20)는 내부 버퍼에 쓰기 요청된 데이터를 임시로 모으게 된다. Referring to FIG. 4, the write buffer unit 20 receives a write request to flash memory (S10). Then, the write buffer unit 20 temporarily collects data requested for writing to the internal buffer.

다음, 쓰기 버퍼부(20)는 주기적으로 내부 버퍼를 체크하여 모아진 데이터가 블록 크기를 넘겼는지 여부를 판단한다(S20).Next, the write buffer unit 20 periodically checks the internal buffer to determine whether the collected data has exceeded the block size (S20).

단계 S10에서 쓰기 버퍼부(20)는 판단 결과 버퍼에 모아진 데이터가 하나의 블록 크기를 초과한 경우(S20; Yes), 블록 쓰기를 수행한다. 블록 쓰기를 하는 경우 블록 선택부(30)는 데이터를 블록 단위로 기록할 경우 매핑 테이블에서 블록 테이블을 검색하여 빈 블록을 선택한다. 그러면, 쓰기 버퍼부(20)는 마지막으로 기록한 블록 다음의 빈 블록을 찾아서 해당 블록에 쓰기 요청된 데이터를 기록하게 된다. In operation S10, when the data collected in the buffer exceeds one block size as a result of the determination, the write buffer unit 20 performs block writing. When writing a block, when writing data in block units, the block selector 30 selects an empty block by searching the block table in the mapping table. Then, the write buffer unit 20 finds an empty block next to the last written block and writes data requested to be written to the corresponding block.

한편, 단계 S20에서 쓰기 버퍼부(20)는 판단 결과 버퍼에 모아진 데이터가 하나의 블록 크기를 초과하지 않은 경우(S20 ; No), 쓰기 버퍼부(20)는 마지막으로 기록한 블록 다음의 빈 블록을 선택하는 것이 아니라, 이미 사용된 블록 중에 일부 페이지만 사용된 블록을 먼저 찾는다(S30). 즉, 쓰기 버퍼부(20)는 블록 크기를 넘기지 않는 쓰기라고 판별된 경우, 빈 블록이 아닌 빈 페이지를 필요하게 된다. On the other hand, if the data collected in the buffer does not exceed one block size as a result of the determination in step S20 (S20; No), the write buffer unit 20 writes an empty block after the last written block. Rather than selecting, a block in which only some pages are used among the blocks already used is first found (S30). That is, if it is determined that the write buffer unit 20 does not exceed the block size, the write buffer unit 20 needs a blank page instead of an empty block.

여기서, 단계 S30에서 쓰기 버퍼부(20)는 판단 결과 빈페이지를 갖는 블록이 있다면(S30; Yes), 그 블록 안의 빈 페이지에 데이터를 기록하게 된다(S40). 즉, 페이지 쓰기를 하는 경우, 블록 선택부(30)는 매핑 테이블에서 페이지 테이블을 검색하여 빈 페이지 테이블을 선택한다. 그러면, 쓰기 버퍼부(20)는 빈 페이지를 찾아서 데이터를 해당 페이지에 기록한다.Here, in step S30, if there is a block having a blank page as a result of the determination (S30; Yes), the write buffer unit 20 writes data to the blank page in the block (S40). That is, when writing a page, the block selector 30 searches a page table in the mapping table and selects an empty page table. Then, the write buffer unit 20 finds a blank page and writes data to the page.

만약, 단계 S30 에서 쓰기 버퍼부(20)는 판단결과 페이지 단위로 사용한 블록이 다 차서 없다면(S30 ; No), 블록 쓰기를 할 때처럼 다음 빈 블록을 선택하여 블록 쓰기를 하게 된다(S50).
If, in step S30, the write buffer unit 20 determines that the blocks used in units of pages are not full (S30; No), the write buffer unit 20 selects the next empty block and writes the blocks as in the case of block writing (S50).

도 5는 본 발명에 따른 파일 마운팅 방식을 예시한 도면이다.
5 is a diagram illustrating a file mounting method according to the present invention.

도 5를 참조하면, 먼저, 매핑 테이블 처리부(10)는 플래쉬 메모리의 마운트 시에는 주 메모리(미도시) 상에 각 블록에 대한 매핑 테이블을 블록 단위로 만든다(S60). Referring to FIG. 5, first, the mapping table processing unit 10 creates a mapping table for each block in units of blocks on a main memory (not shown) when the flash memory is mounted (S60).

다음, 매핑 테이블 처리부(10)는 플래쉬 메모리의 타입(type)을 확인한다(S70). 즉, 매핑 테이블 처리부(10)는 각 블록의 첫 페이지의 헤더(NAND 플래시 메모리라면 spare area에 저장된)를 읽어서 먼저 타입을 확인한다. Next, the mapping table processing unit 10 checks the type of the flash memory (S70). That is, the mapping table processing unit 10 first checks the type by reading the header of the first page of each block (stored in the spare area if the NAND flash memory).

이어, 매핑 테이블 처리부(10)는 확인된 블록의 타입이 데이터 블록 타입이라면(S80 : Yes), 해당 블록 모두가 한 파일에 속하므로 나머지 페이지의 헤더는 전혀 읽을 필요가 없는 것으로 판단한다(S100). Subsequently, if the type of the checked block is a data block type (S80: Yes), the mapping table processor 10 determines that the headers of the remaining pages do not need to be read at all because all of the blocks belong to one file (S100).

그리고, 매핑 테이블 처리부(10)는 읽은 정보만을 가지고 해당 블록에 대한 매핑 테이블의 블록 테이블 엔트리를 채운다(S120). Then, the mapping table processing unit 10 fills the block table entry of the mapping table for the corresponding block with only the read information (S120).

단계 S80 에서 매핑 테이블 처리부(10)는 테이블 블록 타입이 아니고(S80; No), 매팅 테이블 처리부(10)는 확인된 블록의 타입이 데이터 페이지 타입이나 아이노드 타입이라면(S90 ; Yes), 해당 블록은 블록 단위로 사용되는 것이 아니라 페이지 단위로 사용되는 것으로 판단한다(S110). 그리고 매핑 테이블 처리부(10)는 판단된 블록에 대응되는 매핑 테이블의 페이지 테이블 엔트리를 만든다. 매핑 테이블 처리부(10)는 그 블록 안의 각 페이지에 대한 헤더를 읽어 페이지 테이블 엔트리를 채운다(S120). 단계 S80 에서 매핑 테이블 처리부(10)는 테이블 블록 타입이 아니고(S80; No), In step S80, the mapping table processing unit 10 is not a table block type (S80; No), and the mating table processing unit 10 determines that the type of the checked block is a data page type or an inode type (S90; Yes). Is determined not to be used in units of blocks but in units of pages (S110). The mapping table processor 10 creates a page table entry of the mapping table corresponding to the determined block. The mapping table processing unit 10 reads the header for each page in the block and fills the page table entry (S120). In step S80, the mapping table processing unit 10 is not a table block type (S80; No),

또, 매팅 테이블 처리부(10)는 확인된 블록의 타입이 데이터 페이지 타입이나 아이노드 타입도 아니라면(S90 ; No), 매핑 테이블 처리부(10)는 디폴트 값에 따라 블록 방식 또는 페이지 방식으로 매핑 테이블을 채운다(S120). 여기서 디폴트 값은 미리 설정한 값으로 한다. In addition, if the type of the checked block is not a data page type or an inode type (S90; No), the mapping table processing unit 10 performs the mapping table in a block method or a page method according to a default value. Fill (S120). The default value is a preset value.

상술한 바와 같이, 본 발명에서는 블록 단위가 아닌 페이지 단위로 사용되는 블록에 대해서만 매핑 테이블의 페이지 테이블 엔트리를 만들어서, 대용량 데이터에 대해서는 불필요하게 많은 페이지 테이블 공간이 사용되지 않도록 한다.As described above, in the present invention, the page table entry of the mapping table is made only for blocks used in page units, not block units, so that unnecessarily large page table spaces are not used for large data.

따라서, 본 발명의 구성을 따르면 큰 파일에 소요되는 매핑 테이블의 크기를 줄여 주메모리 공간 소모를 줄이고 이를 통해 마운트 시간을 단축하는 데이터 처리 방법을 제공하여 결과적으로 사용자가 사용하는 플래쉬 메모리의 자원 소모가 적고 부팅 시간을 단축시켜 사용자의 대기 시간을 줄이는 이점이 있다.Therefore, according to the configuration of the present invention, by reducing the size of the mapping table required for large files to reduce the main memory space consumption, thereby providing a data processing method for reducing the mount time, as a result of the resource consumption of the flash memory used by the user It has the advantage of reducing the user's wait time by reducing boot time.

이상에서 본 발명에 따른 바람직한 실시 예에 대해 설명하였으나, 다양한 형태로 변형이 가능하며, 본 기술분야에서 통상의 지식을 가진자라면 본 발명의 특허청구범위를 벗어남이 없이 다양한 변형예 및 수정예를 실시할 수 있을 것으로 이해된다.Although a preferred embodiment according to the present invention has been described above, it can be modified in various forms, and those skilled in the art can make various modifications and modifications without departing from the claims of the present invention. It is understood that it may be practiced.

10 : 매핑 테이블 처리부 20 : 쓰기 버퍼부
30 : 블록 선택부 40 : 블록 선택부
10: mapping table processing unit 20: write buffer unit
30: block selector 40: block selector

Claims (1)

복수의 페이지를 포함하는 블록들에 대응하여 구성된 매핑 테이블을 갖는 플래시 메모리의 데이터 처리 방법에 있어서,
상기 블록들 중 페이지 단위로 데이터가 저장된 블록은 페이지 별로 매핑 테이블을 구성하고, 상기 블록들 중 블록 단위로 데이터가 저장된 블록은 블록 별로 매핑 테이블을 구성하는 것을 특징으로 하는 플래시 메모리의 데이터 처리 방법.
A data processing method of a flash memory having a mapping table configured to correspond to blocks including a plurality of pages, the method comprising:
The block in which data is stored in page units among the blocks constitutes a mapping table for each page, and the block in which data is stored in block units among the blocks constitutes a mapping table for each block.
KR1020100018141A 2009-12-18 2010-02-26 Method and apparatus for processing data of flash memory KR20110070656A (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
KR1020090126728 2009-12-18
KR20090126728 2009-12-18

Publications (1)

Publication Number Publication Date
KR20110070656A true KR20110070656A (en) 2011-06-24

Family

ID=44402134

Family Applications (1)

Application Number Title Priority Date Filing Date
KR1020100018141A KR20110070656A (en) 2009-12-18 2010-02-26 Method and apparatus for processing data of flash memory

Country Status (1)

Country Link
KR (1) KR20110070656A (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20150104434A (en) * 2014-03-05 2015-09-15 한국전자통신연구원 Method for storing metadata of log-structured file system for flash memory
WO2016204529A1 (en) * 2015-06-16 2016-12-22 한양대학교 산학협력단 Memory storage device and method for preventing data loss after power loss
US9690730B2 (en) 2012-11-22 2017-06-27 Samsung Electronics Co., Ltd. Register slicing circuit and system on chip including the same
US11726668B2 (en) 2020-11-18 2023-08-15 Electronics And Telecommunications Research Institute Device with flash memory and method for writing/erasing/updating data in flash memory thereof

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9690730B2 (en) 2012-11-22 2017-06-27 Samsung Electronics Co., Ltd. Register slicing circuit and system on chip including the same
KR20150104434A (en) * 2014-03-05 2015-09-15 한국전자통신연구원 Method for storing metadata of log-structured file system for flash memory
WO2016204529A1 (en) * 2015-06-16 2016-12-22 한양대학교 산학협력단 Memory storage device and method for preventing data loss after power loss
US11726668B2 (en) 2020-11-18 2023-08-15 Electronics And Telecommunications Research Institute Device with flash memory and method for writing/erasing/updating data in flash memory thereof

Similar Documents

Publication Publication Date Title
US10838859B2 (en) Recency based victim block selection for garbage collection in a solid state device (SSD)
US9652386B2 (en) Management of memory array with magnetic random access memory (MRAM)
JP5295778B2 (en) Flash memory management method
US8392662B2 (en) Methods of data management in non-volatile memory devices and related non-volatile memory systems
US8015346B2 (en) Memory system having hybrid density memory and methods for wear-leveling management and file distribution management thereof
US8386698B2 (en) Data accessing method for flash memory and storage system and controller using the same
KR100441587B1 (en) Semiconductor memory device having block alignment function
US7516295B2 (en) Method of remapping flash memory
US7395384B2 (en) Method and apparatus for maintaining data on non-volatile memory systems
US8966209B2 (en) Efficient allocation policies for a system having non-volatile memory
CN111033477A (en) Logical to physical mapping
US20120166709A1 (en) File system of flash memory
JP2011530133A (en) Cache content storage management
US20140181371A1 (en) Method and system for reducing mapping table size in a storage device
CN107817945B (en) Data reading method and system of hybrid memory structure
KR101204163B1 (en) Semiconductor memory device
KR100882740B1 (en) Method and storage device of mapping a nonvolatile memory based on map history
US20150058553A1 (en) Data writing method, hard disc module, and data writing system
WO2006046425A1 (en) Nonvolatile storage device and nonvolatile storage system
US20050169058A1 (en) Data management apparatus and method used for flash memory
KR20110070656A (en) Method and apparatus for processing data of flash memory
KR101191650B1 (en) Apparatus and method for mapping the data address in NAND flash memory
CN108376121B (en) Data storage method of Flash memory
EP2381354A2 (en) Data recording device
Lin et al. Flash-aware linux swap system for portable consumer electronics

Legal Events

Date Code Title Description
WITN Withdrawal due to no request for examination