KR20110070656A - Method and apparatus for processing data of flash memory - Google Patents
Method and apparatus for processing data of flash memory Download PDFInfo
- 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
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F12/00—Accessing, addressing or allocating within memory systems or architectures
- G06F12/02—Addressing or allocation; Relocation
- G06F12/08—Addressing or allocation; Relocation in hierarchically structured memory systems, e.g. virtual memory systems
- G06F12/10—Address translation
- G06F12/1009—Address translation using page tables, e.g. page table structures
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input 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/06—Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
- G06F3/0601—Interfaces specially adapted for storage systems
- G06F3/0628—Interfaces specially adapted for storage systems making use of a particular technique
- G06F3/0638—Organizing or formatting or addressing of data
- G06F3/064—Management of blocks
Abstract
Description
본 발명은 플래시 메모리의 데이터 처리 방법 및 장치에 관한 것으로, 특히, 임베디드 시스템의 주 저장장치로 사용되는 플래시 메모리에 데이터를 저장하기 위한 파일 시스템에서, 매핑 테이블 공간 소모를 줄여 소모되는 메모리 양을 줄이기 위한 플래시 메모리의 데이터 처리 방법 및 장치이다.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
여기서, 페이지의 크기는 작은 크기의 데이터를 기록할 때 효율적일 정도로 작게 하고, 블록의 크기는 큰 크기의 데이터를 기록할 때 효율적일 정도로 크게 잡는다. 도 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
매핑 테이블 처리부(10)는 플래쉬 메모리의 저장공간에 대응되는 매핑 테이블을 생성한다. 예를 들어, 플래시 메모리의 저장공간이 m x n 개의 페이지를 포함할 경우, 매핑 테이블 처리부(10)는 포함되는 저장공간에 대응하여 매핑 테이블을 생성한다. 그리고, 본 발명에서 플래쉬 메모리의 저장/읽기 동작시 매핑 테이블이 이용되게 된다. The
여기서, 매핑 테이블 처리부(10)는 매핑 테이블 생성시 플래쉬 메모리의 페이지 단위로 데이터를 저장하도록 사용된 블록에 대해서만 페이지 별로 매핑 테이블을 만들고, 대용량 데이터에 대해서는 블록 별로 매핑 테이블을 생성하여 불필요하게 많은 공간이 사용되지 않도록 한다.
Here, the mapping
또, 매핑 테이블 처리부(10)는 플래쉬 메모리의 타입(type)을 근거로 블록 단위 또는 페이지 단위를 판별하고, 그에 따라 매핑 테이블을 생성한다. 즉, 매핑 테이블 처리부(10)는 플래쉬 메모리의 마운트 시에는 주 메모리(미도시) 상에 각 블록에 대한 매핑 테이블을 블록 단위로 만든다. 그리고, 각 블록의 첫 페이지의 헤더(NAND 플래시 메모리라면 spare area에 저장된)를 읽어서 먼저 타입을 확인한다. 매핑 테이블 처리부(10)는 확인된 블록의 타입이 데이터 블록 타입이라면 해당 블록 모두가 한 파일에 속하므로 나머지 페이지의 헤더는 전혀 읽을 필요가 없는 것으로 판단한다. 그리고, 매핑 테이블 처리부(10)는 읽은 정보만을 가지고 해당 블록에 대한 매핑 테이블의 블록 테이블 엔트리를 채운다. In addition, the
여기서, 매핑 테이블 처리부(10)는 확인된 블록의 타입이 데이터 페이지 타입이나 아이노드 타입이라면 해당 블록은 블록 단위로 사용되는 것이 아니라 페이지 단위로 사용되는 것으로 판단한다. 매핑 테이블 처리부(10)는 판단된 블록에 대응되는 매핑 테이블의 페이지 테이블 엔트리를 만든다. 그리고 매핑 테이블 처리부(10)는 그 블록 안의 각 페이지에 대한 헤더를 읽어 페이지 테이블 엔트리를 채운다. 이런 식으로 매핑 테이블 처리부(10)는 블록 단위가 아닌 페이지 단위로 사용되는 블록에 대해서만 매핑 테이블의 페이지 테이블 엔트리를 만들어서, 대용량 데이터에 대해서는 불필요하게 많은 페이지 테이블 공간이 사용되지 않도록 한다.
Here, if the type of the identified block is a data page type or an inode type, the
쓰기 버퍼부(20)는 플래쉬 메모리의 데이터 쓰기 동작을 수행한다. 쓰기 버퍼부(20)는 상술한 매핑 테이블을 이용하여 플래쉬 메모리에 데이터 쓰기 동작을 수행한다. 즉, 본 발명에서는 플래쉬 메모리로의 쓰기 요청시 기본적으로 JFFS나 YAFFS 같은 log-structured 파일 저장 방식으로 기록하게 된다. 쓰기 버퍼부(20)는 내부에 각 파일별로 쓰기 버퍼를 포함하고, 플레쉬 메모리로의 쓰기 요청된 데이터를 버퍼에 임시로 모으게 된다. 그리고, 쓰기 버퍼부(20)는 주기적으로 버퍼를 체크하여 모아진 데이터가 블록 크기를 넘겼다면 블록 쓰기를 하고, 그렇지 않다면 페이지 쓰기를 한다. The
여기서, 쓰기 버퍼부(20)가 블록 쓰기를 하는 경우 블록 선택부(30)를 통해 마지막으로 기록한 블록 다음의 빈 블록을 찾아서 해당 블록에 기록한다. 즉, 블록 선택부(30)는 데이터를 블록 단위로 기록할 경우 매핑 테이블에서 블록 테이블을 검색하여 빈 블록을 선택한다. 그러면 쓰기 버퍼부(20)는 해당 블록에 데이터를 기록하게 된다.
Here, when the
또, 쓰기 버퍼부(20)는 페이지 쓰기를 하는 경우, 페이지 선택부(40)를 통해 빈 페이지를 찾아서 데이터를 해당 페이지에 기록한다. 즉, 블록 선택부(30)는 데이터를 페이지 단위로 기록할 경우 매핑 테이블에서 페이지 테이블을 검색하여 빈 테이블을 선택한다. 그러면 쓰기 버퍼부(20)는 해당 페이지에 데이터를 기록하게 된다. When writing a page, the
여기서, 쓰기 버퍼부(20)는 페이지 쓰기를 하는 경우, 마지막으로 기록한 블록 다음의 빈 블록을 선택하는 것이 아니라, 이미 사용된 블록 중에 일부 페이지만 사용된 블록을 먼저 찾는다. 예를 들어, 쓰기 버퍼부(20)는 블록 크기를 넘기지 않는 쓰기라고 판별된 경우로(예를 들어 일정 시간 동안에 버퍼에 블록 크기 이상의 데이터가 쌓이지 않거나 쌓이기 전에 파일을 닫는 경우 등) 빈 블록이 아닌 빈 페이지를 필요하게 된다. 쓰기 버퍼부(20)는 해당되는 블록이 있다면 그 블록 안의 빈 페이지에 기록하면 된다. 즉, 쓰기 버퍼부(20)는 블록 단위가 아니라 페이지 단위로 사용되는 블록 중에 대상을 찾는 것이다. 또한, 쓰기 버퍼부(20)는 페이지 단위로 사용한 블록이 다 차서 없다면, 블록 쓰기를 할 때처럼 다음 빈 블록을 선택하면 된다.
Here, when writing a page, the
도 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
다음, 쓰기 버퍼부(20)는 주기적으로 내부 버퍼를 체크하여 모아진 데이터가 블록 크기를 넘겼는지 여부를 판단한다(S20).Next, the
단계 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
한편, 단계 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
여기서, 단계 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
만약, 단계 S30 에서 쓰기 버퍼부(20)는 판단결과 페이지 단위로 사용한 블록이 다 차서 없다면(S30 ; No), 블록 쓰기를 할 때처럼 다음 빈 블록을 선택하여 블록 쓰기를 하게 된다(S50).
If, in step S30, the
도 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
다음, 매핑 테이블 처리부(10)는 플래쉬 메모리의 타입(type)을 확인한다(S70). 즉, 매핑 테이블 처리부(10)는 각 블록의 첫 페이지의 헤더(NAND 플래시 메모리라면 spare area에 저장된)를 읽어서 먼저 타입을 확인한다. Next, the mapping
이어, 매핑 테이블 처리부(10)는 확인된 블록의 타입이 데이터 블록 타입이라면(S80 : Yes), 해당 블록 모두가 한 파일에 속하므로 나머지 페이지의 헤더는 전혀 읽을 필요가 없는 것으로 판단한다(S100). Subsequently, if the type of the checked block is a data block type (S80: Yes), the
그리고, 매핑 테이블 처리부(10)는 읽은 정보만을 가지고 해당 블록에 대한 매핑 테이블의 블록 테이블 엔트리를 채운다(S120). Then, the mapping
단계 S80 에서 매핑 테이블 처리부(10)는 테이블 블록 타입이 아니고(S80; No), 매팅 테이블 처리부(10)는 확인된 블록의 타입이 데이터 페이지 타입이나 아이노드 타입이라면(S90 ; Yes), 해당 블록은 블록 단위로 사용되는 것이 아니라 페이지 단위로 사용되는 것으로 판단한다(S110). 그리고 매핑 테이블 처리부(10)는 판단된 블록에 대응되는 매핑 테이블의 페이지 테이블 엔트리를 만든다. 매핑 테이블 처리부(10)는 그 블록 안의 각 페이지에 대한 헤더를 읽어 페이지 테이블 엔트리를 채운다(S120). 단계 S80 에서 매핑 테이블 처리부(10)는 테이블 블록 타입이 아니고(S80; No), In step S80, the mapping
또, 매팅 테이블 처리부(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
상술한 바와 같이, 본 발명에서는 블록 단위가 아닌 페이지 단위로 사용되는 블록에 대해서만 매핑 테이블의 페이지 테이블 엔트리를 만들어서, 대용량 데이터에 대해서는 불필요하게 많은 페이지 테이블 공간이 사용되지 않도록 한다.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.
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)
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 |
-
2010
- 2010-02-26 KR KR1020100018141A patent/KR20110070656A/en not_active Application Discontinuation
Cited By (4)
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 |