WO2013078676A1 - Method and device for detecting nand flash page - Google Patents

Method and device for detecting nand flash page Download PDF

Info

Publication number
WO2013078676A1
WO2013078676A1 PCT/CN2011/083372 CN2011083372W WO2013078676A1 WO 2013078676 A1 WO2013078676 A1 WO 2013078676A1 CN 2011083372 W CN2011083372 W CN 2011083372W WO 2013078676 A1 WO2013078676 A1 WO 2013078676A1
Authority
WO
WIPO (PCT)
Prior art keywords
page
program
programming
state
data
Prior art date
Application number
PCT/CN2011/083372
Other languages
French (fr)
Chinese (zh)
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 PCT/CN2011/083372 priority Critical patent/WO2013078676A1/en
Priority to CN201180003231.2A priority patent/CN102511040B/en
Publication of WO2013078676A1 publication Critical patent/WO2013078676A1/en

Links

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/0223User address space allocation, e.g. contiguous or non contiguous base addressing
    • G06F12/023Free address space management
    • G06F12/0238Memory management in non-volatile memory, e.g. resistive RAM or ferroelectric memory
    • G06F12/0246Memory management in non-volatile memory, e.g. resistive RAM or ferroelectric memory in block erasable memory, e.g. flash memory
    • 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]
    • 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/0662Virtualisation aspects
    • G06F3/0664Virtualisation aspects at device level, e.g. emulation of a storage device or system

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)
  • Techniques For Improving Reliability Of Storages (AREA)
  • Read Only Memory (AREA)

Abstract

The present invention relates to data storage technologies. Specifically, disclosed is a method for detecting a Nand Flash page, comprising: programming a page that is in an idle state after erasure, and before writing data area data and reserve area data of the page, writing a first programming status flag into the page; reading the first programming status flag, so as to determine that the first programming status flag indicates a non-idle state; judging whether the first programming status flag indicates a programming start state, and if the first programming status flag indicates a non-programming start state, determining that the page is aborted. Also disclosed is a device for detecting a Nand Flash page.

Description

一种 Nand Flash页的检测方法和装置  Method and device for detecting Nand Flash page
技术领域 Technical field
本发明涉及数据存储技术, 尤其涉及一种 Nand Flash页的检测方法和装 置。 背景技术  The present invention relates to data storage technologies, and more particularly to a method and apparatus for detecting Nand Flash pages. Background technique
随着信息技术和半导体技术的发展, 电信设备对数据存储的容量、 性能 要求越来越高。 Nand Flash因其具有容量大、 擦写速度快、 体积小、 成本低等 特点, 逐渐被广泛应用于电信设备的数据存储。  With the development of information technology and semiconductor technology, telecommunications equipment is increasingly demanding the capacity and performance of data storage. Nand Flash is widely used in data storage of telecommunication equipment due to its large capacity, fast erasing speed, small size and low cost.
根据 Nand Flash器件的特点,编程过程中,数据从页( Page )的数据( Data ) 区的前端开始顺序写入, 直到页的备用 (Spare ) 区的末端。 如果在编程过程 中发生异常中止, 如掉电、 复位等, 则当前页的数据可能无法写完或者当前 比特的状态无法保证, 极有可能对当前编程数据造成破坏。 若当前编程数据 为文件系统的关键数据, 如 FAT ( File Allocation Table, 文件分配表)、 重要目 录等, 则会对文件系统造成非常严重的影响。  According to the characteristics of the Nand Flash device, during programming, data is sequentially written from the front end of the Data area of the page (Page) until the end of the Spare area of the page. If an abort occurs during programming, such as power-down, reset, etc., the current page data may not be written or the current bit status is not guaranteed, which is likely to cause damage to the current programming data. If the current programming data is critical data of the file system, such as FAT (File Allocation Table), important directory, etc., it will have a very serious impact on the file system.
现有技术中, 若编程过程中发生异常中止, 系统重新上电后, 在应用层 采用 ECC ( Error Correction Code, 纠错码 )对 Nand Flash页进行校验, 检测 出受影响的页, 以便对受影响的页所在的文件或者目录采取适当的恢复措施, 降低对文件系统的影响。 但如果 Nand Flash页的错误比特数超过 ECC检错能 力, 应用层无法检测出受影响的页以及数据损坏的文件或者目录。 因此, 受 检错能力的限制, 应用层的校验不能准确地检测出受异常中止影响的 Nand Flash页, 无法有效地消除异常中止对文件系统造成的影响。 发明内容  In the prior art, if an abnormal abort occurs during the programming process, after the system is powered on again, the NCF page is checked by the ECC (Error Correction Code) at the application layer, and the affected page is detected, so that The files or directories where the affected pages are located take appropriate recovery measures to reduce the impact on the file system. However, if the number of error bits in the Nand Flash page exceeds the ECC error detection capability, the application layer cannot detect the affected page and the corrupted file or directory. Therefore, due to the limitation of the error detection capability, the application layer verification cannot accurately detect the Nand Flash page affected by the abort, and cannot effectively eliminate the impact of the abnormal suspension on the file system. Summary of the invention
本发明的实施例提供了一种 Nand Flash页的检测方法和装置, 解决现有 技术不能准确地检测出受异常中止影响的 Nand Flash页的问题。 Embodiments of the present invention provide a method and apparatus for detecting a Nand Flash page, which solves the existing The technology cannot accurately detect the Nand Flash page affected by the abort.
本发明的实施例采用如下技术方案:  Embodiments of the present invention adopt the following technical solutions:
本发明一方面提供了一种 Nand Flash页的检测方法, 包括:  An aspect of the present invention provides a method for detecting a Nand Flash page, including:
对擦除后编程状态为空闲的页编程, 在写入所述页的数据区数据和备用 区数据之前将第一编程状态标志写入所述页;  Programming a page that is idle after the erase programming state, writing a first program state flag to the page before writing the data area data and the spare area data of the page;
读取所述第一编程状态标志, 确定所述第一编程状态标志指示非空闲状 态;  Reading the first programming state flag, determining that the first programming state flag indicates a non-idle state;
判断所述第一编程状态标志是否指示编程开始状态: 如果所述第一编程 状态标志指示非编程开始状态, 确认所述页受异常中止的影响。 本发明另一方面提供了一种 Nand Flash页的检测方法, 包括:  Determining whether the first program state flag indicates a program start state: if the first program state flag indicates a non-program start state, confirming that the page is affected by an abort. Another aspect of the present invention provides a method for detecting a Nand Flash page, including:
对擦除后编程状态为空闲的页编程, 在写入所述页的数据区数据和备用 区数据之前和之后将第三编程状态标志写入所述页;  Programming a page that is idle after the erase programming state, writing a third program state flag to the page before and after writing data area data and spare area data of the page;
读取所述第三编程状态标志, 确定所述第三编程状态标志指示非空闲状 态;  Reading the third programming status flag, determining that the third programming status flag indicates a non-idle state;
判断所述第三编程状态标志是否指示编程完成状态: 如果所述第三编程 状态标志指示非编程完成状态, 确认所述页受异常中止的影响。 本发明一方面提供了一种 Nand Flash页的检测装置, 包括:  Determining whether the third program status flag indicates a program completion status: if the third program status flag indicates a non-program completion status, confirm that the page is affected by an abort. An aspect of the present invention provides a Nand Flash page detecting apparatus, including:
写入模块, 用于对擦除后编程状态为空闲的页编程, 在写入所述页的数 据区数据和备用区数据之前将第一编程状态标志写入所述页;  a writing module, configured to program a page whose erasing programming state is idle, and write a first programming status flag to the page before writing the data area data of the page and the spare area data;
读取模块, 用于读取所述第一编程状态标志;  a reading module, configured to read the first programming state flag;
确定模块, 用于确定所述第一编程状态标志指示非空闲状态;  a determining module, configured to determine that the first programming state flag indicates a non-idle state;
判断模块, 用于判断所述第一编程状态标志是否指示编程开始状态: 如 果所述第一编程状态标志指示非编程开始状态, 确认所述页受异常中止的影 响。 本发明另一方面提供了一种 Nand Flash页的检测装置, 包括: 写入模块, 用于对擦除后编程状态为空闲的页编程, 在写入所述页的数 据区数据和备用区数据之前和之后将第三编程状态标志写入所述页; And a determining module, configured to determine whether the first programming status flag indicates a programming start state: if the first programming status flag indicates a non-programming start state, confirming that the page is affected by an abort. Another aspect of the present invention provides a Nand Flash page detecting apparatus, including: a writing module, configured to program a page that is idle after a program state is erased, and write data area data and spare area data of the page. Writing a third program status flag to the page before and after;
读取模块, 用于读取所述第三编程状态标志;  a reading module, configured to read the third programming state flag;
确定模块, 用于确定所述第三编程状态标志指示非空闲状态;  a determining module, configured to determine that the third programming status flag indicates a non-idle state;
判断模块, 用于判断所述第三编程状态标志是否指示编程完成状态: 如 果所述第三编程状态标志指示非编程完成状态, 确认所述页受异常中止的影 响。 本发明实施例提供的一种 Nand Flash页的检测方法和装置, 能够准确地 检测出受异常中止影响的页, 以有效地消除异常中止对文件系统造成的影响。 附图说明  The determining module is configured to determine whether the third programming status flag indicates a programming completion state: if the third programming status flag indicates a non-programming completion status, confirm that the page is affected by an abort. The method and device for detecting a Nand Flash page provided by the embodiment of the present invention can accurately detect a page affected by an abort, so as to effectively eliminate the impact of the abnormal suspension on the file system. DRAWINGS
为了更清楚地说明本发明实施例的技术方案, 下面将对实施例中所需要 使用的附图作筒单地介绍, 显而易见地, 下面描述中的附图仅仅是本发明的 一些实施例, 对于本领域普通技术人员来讲, 在不付出创造性劳动性的前提 下, 还可以根据这些附图获得其它的附图。  In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings used in the embodiments will be briefly described below. It is obvious that the drawings in the following description are only some embodiments of the present invention. Those skilled in the art can also obtain other drawings based on these drawings without paying creative labor.
图 1为本发明的实施例提供的 Nand Flash页的结构示意图;  FIG. 1 is a schematic structural diagram of a Nand Flash page according to an embodiment of the present invention;
图 2为本发明的实施例提供的 Nand Flash页的编程状态示意图; 图 3为本发明的一实施例提供的一种 Nand Flash页的检测方法的流程图; 图 4为本发明的另一实施例提供的一种 Nand Flash页的检测方法的流程 图;  2 is a schematic diagram of a programming state of a Nand Flash page according to an embodiment of the present invention; FIG. 3 is a flowchart of a method for detecting a Nand Flash page according to an embodiment of the present invention; FIG. 4 is another embodiment of the present invention. A flowchart of a method for detecting a Nand Flash page provided by the example;
图 5a为本发明的一实施例提供的编程状态标志的位置示意图;  FIG. 5a is a schematic diagram of a location of a program status flag according to an embodiment of the present invention; FIG.
图 5b为本发明的一实施例提供的空闲状态页的编程示意图;  FIG. 5b is a schematic diagram of programming of an idle status page according to an embodiment of the present invention; FIG.
图 6a为本发明的另一实施例提供的编程状态标志的位置示意图; 图 6b为本发明的另一实施例提供的空闲状态页的编程示意图; 图 7为本发明的再一实施例提供的一种 Nand Flash页的检测方法的流程 图; FIG. 6a is a schematic diagram of a location of a program status flag according to another embodiment of the present invention; FIG. 6b is a schematic diagram of programming of an idle status page according to another embodiment of the present invention; FIG. 7 is a flowchart of a method for detecting a Nand Flash page according to still another embodiment of the present invention;
图 8a为本发明的再一实施例提供的编程状态标志的位置示意图; 图 8b为本发明的再一实施例提供的空闲状态页的编程示意图;  FIG. 8 is a schematic diagram of a location of a program status flag according to still another embodiment of the present invention; FIG. 8b is a schematic diagram of programming of an idle status page according to still another embodiment of the present invention;
图 9a为本发明的一实施例提供的一种 Nand Flash页的检测装置的结构框 图;  FIG. 9a is a structural block diagram of a Nand Flash page detecting apparatus according to an embodiment of the present invention;
图 9b为本发明的一实施例提供的另一种 Nand Flash页的检测装置的结构 框图;  FIG. 9b is a structural block diagram of another Nand Flash page detecting apparatus according to an embodiment of the present invention; FIG.
图 10a为本发明的另一实施例提供的一种 Nand Flash页的检测装置的结 构框图;  FIG. 10a is a structural block diagram of a Nand Flash page detecting apparatus according to another embodiment of the present invention; FIG.
图 10b为本发明的另一实施例提供的另一种 Nand Flash页的检测装置的 结构框图;  FIG. 10b is a structural block diagram of another Nand Flash page detecting apparatus according to another embodiment of the present invention; FIG.
图 11a为本发明的再一实施例提供的一种 Nand Flash页的检测装置的结 构框图;  FIG. 11a is a structural block diagram of a Nand Flash page detecting apparatus according to still another embodiment of the present invention; FIG.
图 lib为本发明的再一实施例提供的另一种 Nand Flash页的检测装置的 结构框图。 具体实施方式  Figure lib is a block diagram showing the structure of another Nand Flash page detecting apparatus according to still another embodiment of the present invention. detailed description
本发明实施例提供了一种 Nand Flash页的检测方法和装置。 为了更好的 理解本发明的技术方案, 下面结合附图对本发明实施例进行详细描述。  Embodiments of the present invention provide a method and apparatus for detecting a Nand Flash page. For a better understanding of the technical solutions of the present invention, the embodiments of the present invention will be described in detail below with reference to the accompanying drawings.
应当明确, 所描述的实施例仅仅是本发明一部分实施例, 而不是全部的 实施例。 基于本发明中的实施例, 本领域普通技术人员在没有作出创造性劳 动前提下所获得的所有其它实施例, 都属于本发明保护的范围。  It should be understood that the described embodiments are only a part of the embodiments of the invention, and not all of the embodiments. All other embodiments obtained by a person of ordinary skill in the art based on the embodiments of the present invention without creative efforts are within the scope of the present invention.
Nand Rash由多个块( Block )组成, 一个块由多个页( Page )组成。 Nand Flash最小擦除单位是块, 最小编程单位是页, 写一个文件(包括新写入或者 更新)对应一个或者多个页的编程操作。 如图 1所示, Nand Flash的每个页内 包含一个数据区 (Data Area )和一个扩展的备用区 (Spare Area )。 Nand Rash consists of multiple blocks, one block consisting of multiple pages ( Page ). Nand Flash minimum erase unit is block, the minimum programming unit is page, write a file (including new write or Update) A programming operation corresponding to one or more pages. As shown in Figure 1, each page of Nand Flash contains a data area (Data Area) and an extended spare area (Spare Area).
下述实施例中, 将一个页的编程状态划分为空闲、 编程开始和编程完成 三种状态, 如图 2所示。 对于一个已擦除的块(Block ), 该块的所有页的编程 状态为空闲, 每个页的所有比特值均为 1 ; 编程过程中, 即数据开始写入至数 据完成写入之前, 页的编程状态为编程开始; 编程结束, 即数据写入完成之 后, 页的编程状态为编程完成。 实施例一, 本发明实施例提供了一种 Nand Flash页的检测方法, 其流程 如图 3所示, 该方法具体包括如下步骤:  In the following embodiments, the programming state of one page is divided into three states of idle, program start, and program completion, as shown in FIG. For an erased block (Block), the programming status of all pages of the block is idle, and all bit values of each page are 1; during programming, that is, data begins to be written until the data is written to the page. The programming state is the start of programming; the programming ends, that is, after the data writing is completed, the programming state of the page is programmed. The first embodiment of the present invention provides a method for detecting a Nand Flash page. The process is as shown in FIG. 3, and the method specifically includes the following steps:
步骤 S101 , 对擦除后编程状态为空闲的页编程, 在写入该页的数据区数 据和备用区数据之前将第一编程状态标志写入该页。  Step S101, program the page whose idle programming state is idle, and write the first programming state flag to the page before writing the data area data of the page and the spare area data.
对于擦除后的块, 该块包含的所有页的编程状态为空闲, 每个页的所有 比特值(包括每个页的第一编程状态标志的所有比特值) 均为 1。  For an erased block, the programmed state of all pages contained in the block is idle, and all bit values for each page (including all bit values for the first program state flag for each page) are one.
本实施例中, 第一编程状态标志可以位于页的数据区的前端。  In this embodiment, the first program status flag may be located at the front end of the data area of the page.
对擦除后编程状态为空闲的页进行编程, 将第一编程状态标志设置为指 示编程开始状态, 从该页的数据区的前端开始直到该页的备用区的末端, 顺 序写入指示编程开始状态的第一编程状态标志、 正常的数据区数据、 正常的 备用区数据。  Programming a page that is idle after the erase programming state, setting the first program state flag to indicate a program start state, starting from the front end of the data area of the page until the end of the spare area of the page, the sequential write indication programming begins The first programming status flag of the status, normal data area data, normal spare area data.
可以将第一编程状态标志随数据一起, 填充到页緩存(Page Buffer ) 中, 组成待写入该页的内容, 再从该页的数据区的前端开始直到该页的备用区的 末端, 将页緩存中指示编程开始状态的第一编程状态标志、 正常的数据区数 据、 正常的备用区数据顺序写入该 Nand Flash页中。  The first programming state flag can be filled into the page buffer (Page Buffer) along with the data to form the content to be written to the page, and then from the front end of the data area of the page to the end of the spare area of the page, The first program status flag indicating the start state of the program in the page buffer, the normal data area data, and the normal spare area data are sequentially written in the Nand Flash page.
本实施例中, 第一编程状态标志也可以位于页的备用区的前端。  In this embodiment, the first programming state flag may also be located at the front end of the spare area of the page.
对擦除后编程状态为空闲的页进行编程, 将第一编程状态标志设置为指 示编程开始状态, 从该页的数据区的前端开始直到该页的备用区的末端, 顺 序写入比特值均为 1的数据区数据、 指示编程开始状态的第一编程状态标志、 比特值均为 1 的备用区数据, 再顺序写入正常的数据区数据、 指示编程开始 状态的第一编程状态标志、 正常的备用区数据。 Program the page whose idle programming state is idle, and set the first programming state flag to indicate the programming start state, from the front end of the data area of the page to the end of the spare area of the page, The data area data having the bit value of 1 is written, the first program status flag indicating the start state of the program, the spare area data having the bit value of 1, and the normal data area data is sequentially written, indicating the start state of the programming. A programming status flag, normal spare area data.
可以先将第一编程状态标志填充到页緩存中, 页緩存的其它部分比特值 置 1 , 组成待写入该页的内容,从该页的数据区的前端开始直到该页的备用区 的末端, 将页緩存中比特值均为 1 的数据区数据、 指示编程开始状态的第一 编程状态标志、 比特值均为 1的备用区数据顺序写入该 Nand Flash页中; 再 将第一编程状态标志随数据一起, 填充到页緩存中, 组成待写入该页的内容, 从该页的数据区的前端开始直到该页的备用区的末端, 将页緩存中正常的数 据区数据、 指示编程开始状态的第一编程状态标志、 正常的备用区数据顺序 写入该 Nand Rash页中。  The first programming state flag may be first filled into the page buffer, and the other portion of the page buffer is set to 1 to form the content to be written to the page, from the front end of the data area of the page to the end of the spare area of the page. And writing the data area data with the bit value of 1 in the page buffer, the first programming status flag indicating the start state of the program, and the spare area data with the bit value of 1 in the Nand Flash page; and then the first programming state The flag is filled with the data into the page cache to form the content to be written to the page. From the front end of the data area of the page to the end of the spare area of the page, the normal data area data and instructions in the page buffer are programmed. The first programming status flag of the start state, the normal spare area data is sequentially written to the Nand Rash page.
步骤 S102, 读取第一编程状态标志, 确定第一编程状态标志指示非空闲 状态。  Step S102: Read the first programming status flag, and determine that the first programming status flag indicates a non-idle state.
本实施例中, 如果第一编程状态标志位于页的数据区的前端, 第一编程 状态标志可以直接从页的内容中读取; 如果第一编程状态标志位于页的备用 区的前端, 第一编程状态标志可以直接从页的内容中读取, 也可以读取备份 区的内容, 继而从备份区的内容中提取第一编程状态标志。  In this embodiment, if the first program state flag is located at the front end of the data area of the page, the first program state flag may be directly read from the content of the page; if the first program state flag is located at the front end of the spare area of the page, the first The programming status flag can be read directly from the contents of the page, or the contents of the backup area can be read, and then the first programming status flag can be extracted from the contents of the backup area.
本实施例中, 第一编程状态标志取值为所有比特值均为 1 时, 指示空闲 状态。 即擦除后编程状态为空闲的页中的第一编程状态标志指示空闲状态。  In this embodiment, when the value of the first programming state flag is all bits, the idle state is indicated. That is, the first program status flag in the page in which the program state is idle after erasing indicates the idle state.
读取页的第一编程状态标志, 第一编程状态标志的取值非所有比特值均 为 1 , 则确定第一编程状态标志指示非空闲状态; 第一编程状态标志取值为所 有比特值均为 1 ,则确定第一编程状态标志指示空闲状态,结束对该页的检测。  Reading a first program status flag of the page, the value of the first program status flag is not all bits, and determining that the first program status flag indicates a non-idle state; the first program status flag is a value of all bit values If 1, it is determined that the first program status flag indicates an idle state, and the detection of the page is ended.
步骤 S103 , 判断第一编程状态标志是否指示编程开始状态: 如果第一编 程状态标志指示非编程开始状态, 则确认该页受异常中止的影响。  Step S103, determining whether the first program status flag indicates a program start state: if the first program status flag indicates a non-program start state, it is confirmed that the page is affected by the abnormal suspension.
Nand Flash 页编程过程中, 如果在写入第一编程状态标志时发生异常中 止, 可以通过实施例一提供的方法检测出受异常中止影响的 Nand Flash页。 实施例二, 本发明实施例提供了一种 Nand Flash页的检测方法, 其流程 如图 4所示, 该方法具体包括如下步骤: During the Nand Flash page programming process, if an abort occurs when the first program state flag is written, the Nand Flash page affected by the abort can be detected by the method provided in the first embodiment. The second embodiment of the present invention provides a method for detecting a Nand Flash page. The process is as shown in FIG. 4, and the method specifically includes the following steps:
本实施例中, 通过第一编程状态标志和第二编程状态标志, 共同标识页 的空闲、 编程开始和编程完成三种状态。  In this embodiment, the first program status flag and the second program status flag jointly identify three states of page idle, program start, and program completion.
步骤 S201 , 对擦除后编程状态为空闲的页编程, 在写入该页的数据区数 据和备用区数据之前将第一编程状态标志写入该页, 在写入该页的数据区数 据和备用区数据之后将第二编程状态标志写入该页。  Step S201: program the page whose idle programming state is idle, write the first programming state flag to the page before writing the data area data and the spare area data of the page, and write the data area data of the page and The second program status flag is written to the page after the spare area data.
对于擦除后的块, 该块包含的所有页的编程状态为空闲, 每个页的所有 比特值(包括每个页的第一编程状态标志的所有比特值) 均为 1。  For an erased block, the programmed state of all pages contained in the block is idle, and all bit values for each page (including all bit values for the first program state flag for each page) are one.
本实施例中, 第一编程状态标志的位置和第二编程状态标志的位置, 可 以是: 第一编程状态标志位于数据区的前端, 第二编程状态标志位于备用区 的末端, 如图 5a所示。  In this embodiment, the location of the first programming state flag and the location of the second programming state flag may be: the first programming state flag is located at the front end of the data area, and the second programming state flag is located at the end of the spare area, as shown in FIG. 5a. Show.
对擦除后编程状态为空闲的页进行编程, 如图 5b所示, 将第一编程状态 标志设置为指示编程开始状态, 将第二编程状态标志设置为指示编程完成状 态。 从该页的数据区的前端开始直到该页的备用区的末端, 顺序写入指示编 程开始状态的第一编程状态标志、 正常的数据区数据、 正常的备用区数据、 指示编程完成状态的第二编程状态标志。  The page in which the programming state is idle after erasing is programmed, as shown in Fig. 5b, the first programming state flag is set to indicate the programming start state, and the second programming state flag is set to indicate the programming completion state. From the front end of the data area of the page to the end of the spare area of the page, the first program status flag indicating the program start state, the normal data area data, the normal spare area data, and the instruction completion status are sequentially written. Two programming status flags.
可以将第一编程状态标志和第二编程状态标志随数据一起, 填充到页緩 存中, 组成待写入该页的内容, 再从该页的数据区的前端开始直到该页的备 用区的末端, 将页緩存中指示编程开始状态的第一编程状态标志、 正常数据 区数据、 正常备用区数据、 指示编程完成状态的第二编程状态标志顺序写入 该 Nand Flash页中。  The first program state flag and the second program state flag may be padded with the data into the page buffer to form the content to be written to the page, and then from the front end of the data area of the page to the end of the spare area of the page. The first programming status flag indicating the programming start state, the normal data area data, the normal spare area data, and the second programming status flag indicating the programming completion status in the page buffer are sequentially written into the Nand Flash page.
本实施例中, 第一编程状态标志的位置和第二编程状态标志的位置, 也 可以是: 第一编程状态标志位于页的备用区的前端, 第二编程状态标志位于 页的备用区的末端, 如图 6a所示。 对擦除后编程状态为空闲的页进行编程, 如图 6b所示, 将第一编程状态 标志设置为指示编程开始状态, 从该页的数据区的前端开始直到该页的备用 区的末端, 顺序写入比特值均为 1 的数据区数据、 指示编程开始状态的第一 编程状态标志、 比特值均为 1的备用区数据、 比特值均为 1的第二编程状态 标志; 将第二编程状态标志设置为指示编程完成状态, 再顺序写入正常的数 据区数据、 指示编程开始状态的第一编程状态标志、 正常的备用区数据、 指 示编程完成状态的第二编程状态标志。 In this embodiment, the location of the first programming state flag and the location of the second programming state flag may also be: the first programming state flag is located at the front end of the spare area of the page, and the second programming state flag is located at the end of the spare area of the page. , as shown in Figure 6a. Programming the page whose idle programming state is idle, as shown in FIG. 6b, setting the first programming state flag to indicate the programming start state, from the front end of the data area of the page to the end of the spare area of the page, Sequentially writing data area data having a bit value of 1, a first program status flag indicating a start state of programming, spare area data having a bit value of 1, and a second program status flag having a bit value of 1: a second programming The status flag is set to indicate a program completion status, and then sequentially writes normal data area data, a first program status flag indicating a program start state, normal spare area data, and a second program status flag indicating a program completion status.
可以将第一编程状态标志填充到页緩存中, 页緩存的其它部分比特值置 1 , 组成待写入该页的内容, 再从该页的数据区的前端开始直到该页的备用区 的末端, 将页緩存中比特值均为 1 的数据区数据、 指示编程开始状态的第一 编程状态标志、 比特值均为 1的备用区数据、 比特值均为 1的第二编程状态 标志顺序写人该 Nand Flash页中; 再将第一编程状态标志和第二编程状态标 志随数据一起, 填充到页緩存中, 组成待写入该页的内容, 从该页的数据区 的前端开始直到该页的备用区的末端, 将页緩存中正常的数据区数据、 指示 编程开始状态的第一编程状态标志、 正常的备用区数据、 指示编程完成状态 的第二编程状态标志顺序写人该 Nand Flash页中。  The first program state flag can be filled into the page buffer, and the other portion of the page buffer is set to 1 to form the content to be written to the page, and then from the front end of the data area of the page to the end of the spare area of the page. , the data area data with the bit value of 1 in the page buffer, the first program status flag indicating the start state of the program, the spare area data with the bit value of 1, and the second program status flag with the bit value of 1 are sequentially written. The Nand Flash page; and the first program state flag and the second program state flag are filled with the data into the page buffer to form the content to be written to the page, starting from the front end of the data area of the page until the page The end of the spare area, the normal data area data in the page buffer, the first program status flag indicating the start state of the program, the normal spare area data, and the second program status flag indicating the programming completion status are sequentially written to the Nand Flash page. in.
步骤 S202, 读取第一编程状态标志, 确定第一编程状态标志指示非空闲 状态。  Step S202: Read the first programming status flag, and determine that the first programming status flag indicates a non-idle state.
本实施例中步骤 S202与实施例一中步骤 S 102的实施方法相类似, 此处 不再赘述。  Step S202 in this embodiment is similar to the implementation method of step S102 in the first embodiment, and details are not described herein again.
步骤 S203, 判断所述第一编程状态标志是否指示编程开始状态: 如果第一编程状态标志指示非编程开始状态, 则确认该页受异常中止的 影响;  Step S203, determining whether the first programming status flag indicates a programming start state: if the first programming status flag indicates a non-programming start state, confirming that the page is affected by the abnormal suspension;
如果第一编程状态标志指示编程开始状态, 则读取该页的第二编程状态 标志, 判断第二编程状态标志是否指示编程完成状态: 如果第二编程状态标 志指示非编程完成状态, 则确认该页受异常中止的影响; 如果第二编程状态 标志指示编程完成状态, 则确认该页未受异常中止的影响。 If the first program status flag indicates a program start state, reading a second program status flag of the page, determining whether the second program status flag indicates a program completion status: if the second program status flag indicates a non-program completion status, confirming the Page affected by abort; if second programming state The flag indicates the programming completion status, and it is confirmed that the page is not affected by the abort.
本实施例中, 第二编程状态指示的取值为所有比特值均为 1 时, 指示空 闲状态。 即擦除后编程状态为空闲的页中的第二编程状态标志指示空闲状态。  In this embodiment, the value of the second programming state indication is that when all the bit values are 1, the idle state is indicated. That is, the second program status flag in the page in which the program state is idle after erasing indicates the idle state.
第二编程状态标志位于页的备用区的末端, 可以直接从页的内容中读取, 也可以读取备份区的内容, 继而从备份区的内容中提取第二编程状态标志。  The second program status flag is located at the end of the spare area of the page, can be read directly from the contents of the page, or can read the contents of the backup area, and then extract the second program status flag from the contents of the backup area.
Nand Flash页编程过程中, 在写入页的内容(包括写入数据区数据、 写入 备用区数据、 写入第一编程状态标志、 或者写入第二编程状态标志) 时发生 异常中止, 实施例二提供的方法均可以检测出受异常中止影响的 Nand Flash 页。 实施例三, 本发明实施例提供了一种 Nand Flash页的检测方法, 其流程 如图 7所示, 该方法具体包括如下步骤:  During the Nand Flash page programming process, an abort occurs when writing the contents of the page (including writing data area data, writing spare area data, writing the first program status flag, or writing the second program status flag). The method provided in Example 2 can detect the Nand Flash page affected by the abort. The third embodiment of the present invention provides a method for detecting a Nand Flash page, and the process thereof is as shown in FIG. 7. The method specifically includes the following steps:
本实施例中, 通过第三编程状态标志, 标识页的空闲、 编程开始和编程 完成三种状态。  In this embodiment, the three states of the page are identified by the third program status flag, idle, program start, and program completion.
步骤 S301 , 对擦除后编程状态为空闲的页编程, 在写入该页的数据区数 据和备用区数据之前和之后将第三编程状态标志写入该页。  Step S301: program the page whose idle programming state is idle, and write the third programming state flag to the page before and after writing the data area data of the page and the spare area data.
对于擦除后的块, 该块包含的所有页的编程状态为空闲, 每个页的所有 比特值(包括每个页的第一编程状态标志的所有比特值) 均为 1。  For an erased block, the programmed state of all pages contained in the block is idle, and all bit values for each page (including all bit values for the first program state flag for each page) are one.
本实施例中, 第三编程状态标志可以位于页的备用区的末端, 如图 8a所 示。  In this embodiment, the third programming status flag can be located at the end of the spare area of the page, as shown in Figure 8a.
对擦除后编程状态为空闲的页进行编程, 如图 8b所示, 将第三编程状态 标志设置为指示编程开始状态, 从该页的数据区的前端开始直到该页的备用 区的末端, 顺序写入比特值均为 1的数据区数据、 比特值均为 1的备用区数 据、 指示编程开始状态的第三编程状态标志; 将第三编程状态标志设置为指 示编程完成状态, 再顺序写入正常的数据区数据、 正常的备用区数据、 指示 编程完成状态的第三编程状态标志。 可以将第三编程状态标志填充到页緩存中, 页緩存的其它部分比特值置Programming the page whose idle programming state is idle, as shown in FIG. 8b, setting the third programming state flag to indicate the programming start state, from the front end of the data area of the page to the end of the spare area of the page, Sequentially writing data area data having a bit value of 1, a spare area data having a bit value of 1, a third program status flag indicating a program start state; setting a third program status flag to indicate a program completion status, and sequentially writing The normal data area data, the normal spare area data, and the third program status flag indicating the programming completion status are entered. The third program state flag can be filled into the page cache, and the other bits of the page buffer are set.
1 , 组成待写入该页的内容, 再从该页的数据区的前端开始直到该页的备用区 的末端, 将页緩存中比特值均为 1的数据区数据、 比特值均为 1的备用区数 据、 指示编程开始状态的第三编程状态标志顺序写人该 Nand Flash页中; 再 将第三编程状态标志随数据一起, 填充到页緩存中, 组成完整的待写入该页 的内容, 从该页的数据区的前端开始直到该页的备用区的末端, 将页緩存中 正常的数据区数据、 正常的备用区数据、 指示编程完成状态的第三编程状态 标志顺序写人该 Nand Flash页中。 1 . constituting the content to be written to the page, and starting from the front end of the data area of the page to the end of the spare area of the page, the data area data having the bit value of 1 in the page buffer and the bit value are all 1 The spare area data, the third programming status flag indicating the programming start state is sequentially written in the Nand Flash page; and the third programming status flag is filled with the data into the page buffer to form a complete content to be written to the page. From the front end of the data area of the page to the end of the spare area of the page, the normal data area data in the page buffer, the normal spare area data, and the third programming status flag indicating the programming completion status are sequentially written to the Nand In the Flash page.
步骤 S302, 读取第三编程状态标志, 确定第三编程状态标志指示非空闲 状态。  Step S302, reading a third programming status flag, determining that the third programming status flag indicates a non-idle state.
本实施例中, 第三编程状态标志位于页的备用区的末端, 可以直接从页 的内容中读取, 也可以读取备份区的内容, 继而从备份区的内容中提取第三 编程^ 态标志。  In this embodiment, the third programming state flag is located at the end of the spare area of the page, and can be directly read from the content of the page, or the content of the backup area can be read, and then the third programming state is extracted from the content of the backup area. Sign.
本实施例中, 第三编程状态标志取值为所有比特值均为 1 时, 指示空闲 状态。 即擦除后编程状态为空闲的页的第三编程状态标志指示空闲状态。  In this embodiment, the third programming state flag takes a value indicating that all bit values are 1, indicating an idle state. That is, the third program status flag of the page whose program state is idle after erasing indicates the idle state.
读取页的第三编程状态标志, 第三编程状态标志的取值非所有比特值均 为 1 , 则确定第三编程状态标志指示非空闲状态; 第三编程状态标志取值为所 有比特值均为 1 ,则确定第一编程状态标志指示空闲状态,结束对该页的检测。  Reading a third program status flag of the page, the value of the third program status flag is not all bits, and determining that the third program status flag indicates a non-idle state; the third program status flag is a value of all bit values. If 1, it is determined that the first program status flag indicates an idle state, and the detection of the page is ended.
步骤 S303 , 判断第三编程状态标志是否指示编程完成状态:  Step S303, determining whether the third programming status flag indicates a programming completion status:
如果第三编程状态标志指示非编程完成状态, 则确认该页受异常中止的 影响;  If the third program status flag indicates a non-program completion status, it is confirmed that the page is affected by the abort;
如果第三编程状态标志指示编程完成状态, 则确认该页未受异常中止的 影响。  If the third program status flag indicates a program completion status, it is confirmed that the page is not affected by the abort.
Nand Flash页编程过程中, 在写入页的内容(包括写入数据、 写入第一编 程状态标志、 或者写入第二编程状态标志) 时发生异常中止, 实施例三提供 的方法均可以检测出受异常中止影响的 Nand Flash页。 上述实施例一、 二、 三中, 进一步地, 可以从 Nand Flash的第一个块的 第一个页开始, 遍历 Nand Flash的所有块的所有页, 检测出受异常中止影响 的 Nand Flash页。 继而可以查找到这些页所在的文件或者目录, 记录这些数 据损坏的文件或者目录的信息, 并且隔离这些文件或者目录, 对数据损坏的 文件或者目录采取适当的恢复措施, 以有效地消除异常中止对文件系统造成 的影响。 During the Nand Flash page programming process, an abnormal abort occurs when the content of the page is written (including writing data, writing the first program state flag, or writing the second program state flag), and the method provided in the third embodiment can detect A Nand Flash page that is affected by an abort. In the first, second and third embodiments, further, all the pages of all the blocks of the Nand Flash can be traversed from the first page of the first block of the Nand Flash, and the Nand Flash page affected by the abort is detected. Then you can find the files or directories where these pages are located, record the files or directories that are corrupted by the data, and isolate the files or directories, and take appropriate recovery measures against the corrupted files or directories to effectively eliminate the abnormal suspension. The impact of the file system.
上述实施例一、 二、 三提供的方法中, 第一编程状态标志、 第二编程状 态标志、 第三编程状态标志可以指示: 空闲状态、 编程开始状态、 编程完成 状态。 其中, 编程状态标志指示空闲状态时, 取值为所有比特值均为 1。  In the methods provided in the first embodiment, the second programming mode, the first programming state flag, the second programming state flag, and the third programming state flag may indicate: an idle state, a programming start state, and a programming completion state. Wherein, when the programming status flag indicates an idle state, the value is that all bit values are 1.
编程状态标志指示编程开始状态、 编程完成状态时, 不同情况下可选取 的值有所不同:  When the programming status flag indicates the programming start status and the programming completion status, the values that can be selected in different cases are different:
实施例一中, 第一编程状态标志位于页的数据区的前端, 第一编程状态 标志可以取除所有比特值均为 1 以外的任意两个数值或者两个区段数值, 指 示编程开始状态和编程完成状态。  In the first embodiment, the first program state flag is located at the front end of the data area of the page, and the first program state flag can remove any two values or two sector values except the bit value, indicating the programming start state and Programming completion status.
实施例二中, 第一编程状态标志位于数据区的前端, 第二编程状态标志 位于备用区的末端, 第一编程状态标志和第二编程状态标志均可以取除所有 比特值均为 1 以外的任意两个数值或者两个区段数值, 指示编程开始状态和 编程完成^ 态。  In the second embodiment, the first program state flag is located at the front end of the data area, and the second program state flag is located at the end of the spare area. The first program state flag and the second program state flag can all be removed except that all bit values are 1. Any two values or two segment values indicate the programming start state and programming completion state.
下述三种情况下实施例提供的方法对页进行了两次重复编程, 编程状态 标志指示编程开始状态和编程完成状态时的取值有一定限制:  In the following three cases, the method provided by the embodiment performs two repeated programming of the page, and the programming status flag indicates that the value of the programming start state and the programming completion state is limited:
实施例一中, 第一编程状态标志位于页的备用区的前端;  In the first embodiment, the first programming state flag is located at the front end of the spare area of the page;
实施例二中, 第一编程状态标志位于页的备用区的前端, 第二编程状态 标志位于页的备用区的末端;  In the second embodiment, the first programming status flag is located at the front end of the spare area of the page, and the second programming status flag is located at the end of the spare area of the page;
实施例三中, 第三编程状态标志位于页的备用区的末端。  In the third embodiment, the third program status flag is located at the end of the spare area of the page.
利用 Flash的编程和擦除操作具有的特点, 即擦除的过程实质上是将所有 存储单元的值变为 "1" , 而编程是将某些存储单元的值由 "Γ 变为 "0"。 将 原编程状态标志的取值中某些比特值由 "Γ 变为 "0" , 作为编程时刷新的编 程状态标志的取值。 由此实现在不擦除页所在的块的情况下, 再次对该页进 行编程。 The use of Flash programming and erase operations has the feature that the erase process is essentially all The value of the memory cell becomes "1", and programming is to change the value of some memory cells from "Γ to "0". Some bits in the value of the original program status flag are changed from "Γ to "0". , as the value of the programming status flag that is refreshed during programming. This makes it possible to program the page again without erasing the block in which the page is located.
例如: 实施例一中, 第一编程状态标志位于页的备用区的前端。  For example: In the first embodiment, the first programming status flag is located at the front end of the spare area of the page.
第一编程状态标志: 编程前设置为指示空闲状态, 取值为所有比特值均 为 1; 第一次编程时刷新为指示编程开始状态, 则指示编程开始状态时所取的 值为指示空闲状态时所取的值中某些比特由 "Γ 变为 "0"。  The first programming status flag is set to indicate the idle state before programming, and the value is all 1s; when the first programming is refreshed to indicate the programming start state, the value taken when the programming start state is indicated indicates the idle state. Some bits in the value taken are changed from "Γ to "0".
例如: 实施例二中, 第一编程状态标志位于页的备用区的前端, 第二编 程状态标志位于页的备用区的末端。  For example, in the second embodiment, the first programming status flag is located at the front end of the spare area of the page, and the second programming status flag is located at the end of the spare area of the page.
第一编程状态标志: 编程前设置为指示空闲状态, 取值为所有比特值均 为 1; 第一次编程时刷新为指示编程开始状态, 则指示编程开始状态时所取的 值为指示空闲状态时所取的值中某些比特由 "Γ 变为 "0"。  The first programming status flag is set to indicate the idle state before programming, and the value is all 1s; when the first programming is refreshed to indicate the programming start state, the value taken when the programming start state is indicated indicates the idle state. Some bits in the value taken are changed from "Γ to "0".
第二编程状态标志: 编程前设置为指示空闲状态, 取值为所有比特值均 为 1; 第二次编程时刷新为指示编程完成状态, 则指示编程完成状态时所取的 值为指示空闲状态时所取的值中某些比特由 "Γ 变为 "0"。  The second programming status flag is set to indicate the idle state before programming, and the value is all 1s; the second programming time is refreshed to indicate the programming completion state, and the value taken when indicating the programming completion state indicates the idle state. Some bits in the value taken are changed from "Γ to "0".
例如: 实施例三, 第三编程状态标志位于页的备用区的末端。  For example: In the third embodiment, the third programming status flag is located at the end of the spare area of the page.
第三编程状态标志: 编程前设置为指示空闲状态, 取值为所有比特值均 为 1; 第一次编程时刷新为指示编程开始状态, 则指示编程开始状态时所取的 值为指示空闲状态时所取的值中某些比特由 "1" 变为 "0" ; 第二次编程时 刷新为指示编程完成状态, 则指示编程完成状态时所取的值为指示编程开始 状态时所取的值中某些比特由 "Γ 变为 "0"。 则第三编程状态标志指示空闲 状态、 编程开始状态和编程完成状态时的取值可以如下表所示: 编程状态指示 十六进制值 二进制值 The third programming status flag is set to indicate the idle state before programming, and the value is that all the bit values are 1; when the first programming is refreshed to indicate the programming start state, the value taken when the programming start state is indicated indicates the idle state. Some of the values taken from the time are changed from "1" to "0"; when the second programming is refreshed to indicate the programming completion state, the value taken when the programming completion state is indicated is the value that is taken when the programming start state is indicated. Some bits in the value are changed from "Γ to "0". The value of the third program status flag indicating the idle state, the programming start state, and the programming completion state can be as follows: Programming status indicates hexadecimal value binary value
空闲 Oxffff 11111111 11111111 编程开始 Oxafaf 10101111 10101111 编程: ¾成 0xa5a5 10100101 10100101  Idle Oxffff 11111111 11111111 Programming Start Oxafaf 10101111 10101111 Programming: 3⁄4成 0xa5a5 10100101 10100101
Nand Rash页编程过程中如果发生异常中止, Nand Flash页受异常中止的 影响至少包括下述的一种情况: 导致 Nand Flash页的数据无法写完、 比特状 态无法保证。 本发明实施例提供的一种 Nand Flash页的检测方法, 编程状态 的写入严格设计在数据写入之前和数据写入完成之后, 能够准确地检测出受 到上述异常中止影响的 Nand Flash页, 查找到这些页所在的文件或者目录, 记录数据损坏的文件或者目录信息, 并且隔离这些文件或者目录, 以便系统 和上层应用进行故障定位和故障恢复, 消除异常中止对文件系统造成的影响。 实施例四, 本发明实施例提供了一种 Nand Flash页的检测装置, 如图 9a 所示, 包括写入模块 910、 读取模块 920、 确定模块 930和判断模块 940: 写入模块 910, 用于对擦除后编程状态为空闲的页编程, 在写入该页的数 据区数据和备用区数据之前将第一编程状态标志写入该页。  If an abnormal abort occurs during Nand Rash page programming, the Nand Flash page is affected by the abort, including at least one of the following cases: The data of the Nand Flash page cannot be written, and the bit status cannot be guaranteed. A method for detecting a Nand Flash page provided by an embodiment of the present invention, the programming state is written strictly before the data is written and after the data is written, and the Nand Flash page affected by the abnormal abort can be accurately detected and searched. Go to the file or directory where these pages are located, record the corrupted files or directory information, and isolate the files or directories so that the system and upper-layer applications can locate faults and recover from failures, and eliminate the impact of abnormal aborts on the file system. Embodiment 4 of the present invention provides a Nand Flash page detecting apparatus, as shown in FIG. 9a, including a writing module 910, a reading module 920, a determining module 930, and a determining module 940: a writing module 910, To program a page that is idle after the erase programming state, the first program state flag is written to the page before the data area data and spare area data of the page are written.
读取模块 920, 用于读取第一编程状态标志。  The reading module 920 is configured to read the first programming status flag.
如果第一编程状态标志位于页的数据区的前端, 第一编程状态标志可以 直接从页的内容中读取; 如果第一编程状态标志位于页的备用区的前端, 第 一编程状态标志可以直接从页的内容中读取, 也可以读取备份区的内容, 继 而从备份区的内容中提取第一编程状态标志。  If the first program status flag is located at the front end of the data area of the page, the first program status flag can be directly read from the content of the page; if the first program status flag is located at the front end of the spare area of the page, the first program status flag can be directly Reading from the contents of the page, the contents of the backup area can also be read, and then the first programming status flag is extracted from the contents of the backup area.
确定模块 930, 用于确定第一编程状态标志指示非空闲状态。  The determining module 930 is configured to determine that the first programming status flag indicates a non-idle state.
本实施例中, 第一编程状态标志取值为所有比特值均为 1 时, 指示空闲 状态。 即擦除后编程状态为空闲的页中的第一编程状态标志指示空闲状态。  In this embodiment, when the value of the first programming state flag is all bits, the idle state is indicated. That is, the first program status flag in the page in which the program state is idle after erasing indicates the idle state.
第一编程状态标志的取值非所有比特值均为 1 ,则确定第一编程状态标志 指示非空闲状态; 第一编程状态标志取值为所有比特值均为 1 , 则确定第一编 程状态标志指示空闲状态, 结束对该页的检测。 The value of the first programming state flag is not all bits, and the first programming state flag is determined. The non-idle state is indicated; the first program state flag takes a value of all bits, and then the first program state flag is determined to indicate an idle state, and the detection of the page is ended.
判断模块 940, 用于判断第一编程状态标志是否指示编程开始状态: 如果 第一编程状态标志指示非编程开始状态, 确认该页受异常中止的影响。  The determining module 940 is configured to determine whether the first programming status flag indicates a programming start state: if the first programming status flag indicates a non-programming start state, confirm that the page is affected by the abnormal abort.
可选地, 第一编程状态标志位于该页的数据区的前端, 如图 9b所示, 写 入模块 910可以包括:  Optionally, the first programming status flag is located at a front end of the data area of the page. As shown in FIG. 9b, the writing module 910 may include:
第一写入子模块 911 , 用于对擦除后编程状态为空闲的该页进行编程, 将 第一编程状态标志设置为指示编程开始状态, 从该页的数据区的前端开始直 到该页的备用区的末端, 顺序写入指示编程开始状态的第一编程状态标志、 正常的数据区数据、 正常的备用区数据。  a first write sub-module 911, configured to program the page whose erased program state is idle, and set a first program state flag to indicate a program start state, starting from a front end of the data area of the page to the page At the end of the spare area, the first program status flag indicating the start state of the program, the normal data area data, and the normal spare area data are sequentially written.
可选地, 第一编程状态标志位于该页的备用区的前端, 如图 9b所示, 写 入模块 910可以包括:  Optionally, the first programming status flag is located at a front end of the spare area of the page. As shown in FIG. 9b, the writing module 910 may include:
第二写入子模块 912, 用于对擦除后编程状态为空闲的该页进行编程, 将 第一编程状态标志设置为指示编程开始状态, 从该页的数据区的前端开始直 到该页的备用区的末端, 顺序写入比特值均为 1 的数据区数据、 指示编程开 始状态的第一编程状态标志、 比特值均为 1 的备用区数据, 再顺序写入正常 的数据区数据、 指示编程开始状态的第一编程状态标志、 正常的备用区数据。 实施例五, 本发明实施例提供了一种 Nand Flash页的检测装置, 如图 10a 所示, 包括写入模块 1010、 读取模块 1020、 确定模块 1030和判断模块 1040: 写入模块 1010, 用于对擦除后编程状态为空闲的页编程, 在写入该页的 数据区数据和备用区数据之前将第一编程状态标志写入该页, 在写入该页的 数据区数据和备用区数据之后将第二编程状态标志写入该页。  a second write sub-module 912, configured to program the page after the erased program state is idle, and set the first program state flag to indicate a program start state, starting from a front end of the data area of the page to the page At the end of the spare area, the data area data having the bit value of 1 is sequentially written, the first program status flag indicating the start state of the program, the spare area data having the bit value of 1, and the normal data area data and the indication are sequentially written. The first programming status flag of the programming start state, normal spare area data. Embodiment 5 of the present invention provides a Nand Flash page detecting apparatus, as shown in FIG. 10a, including a writing module 1010, a reading module 1020, a determining module 1030, and a determining module 1040: a writing module 1010, After programming the page in which the programming state is idle after erasing, writing the first program status flag to the page before writing the data area data and the spare area data of the page, writing the data area data of the page and the spare area The second programming status flag is written to the page after the data.
读取模块 1020, 用于读取第一编程状态标志; 还用于读取第二编程状态 标志。  The reading module 1020 is configured to read the first programming status flag; and is further configured to read the second programming status flag.
如果第一编程状态标志位于页的数据区的前端, 第一编程状态标志可以 直接从页的内容中读取; 如果第一编程状态标志位于页的备用区的前端, 第 一编程状态标志可以直接从页的内容中读取, 也可以读取备份区的内容, 继 而从备份区的内容中提取第一编程状态标志。 If the first program status flag is located at the front end of the data area of the page, the first program status flag may Reading directly from the content of the page; if the first programming status flag is located at the front end of the spare area of the page, the first programming status flag can be read directly from the content of the page, and the content of the backup area can also be read, and then backed up from the backup The first program status flag is extracted from the contents of the area.
第二编程状态标志位于页的备用区的末端, 可以直接从页的内容中读取, 也可以读取备份区的内容, 继而从备份区的内容中提取第二编程状态标志。  The second program status flag is located at the end of the spare area of the page, can be read directly from the contents of the page, or can read the contents of the backup area, and then extract the second program status flag from the contents of the backup area.
确定模块 1030, 用于确定第一编程状态标志指示非空闲状态。  The determining module 1030 is configured to determine that the first programming status flag indicates a non-idle state.
本实施例中, 第一编程状态标志取值为所有比特值均为 1 时, 指示空闲 状态。 即擦除后编程状态为空闲的页中的第一编程状态标志指示空闲状态。  In this embodiment, when the value of the first programming state flag is all bits, the idle state is indicated. That is, the first program status flag in the page in which the program state is idle after erasing indicates the idle state.
第一编程状态标志的取值非所有比特值均为 1 ,则确定第一编程状态标志 指示非空闲状态; 第一编程状态标志取值为所有比特值均为 1 , 则确定第一编 程状态标志指示空闲状态, 结束对该页的检测。  The value of the first program status flag is not all bits, and it is determined that the first program status flag indicates a non-idle state; the first program status flag takes a value of all bits, and the first program status flag is determined. Indicates the idle state and ends the detection of the page.
判断模块 1040,用于判断所述第一编程状态标志是否指示编程开始状态: 如果第一编程状态标志指示非编程开始状态, 则确认该页受异常中止的影响; 如果第一编程状态标志指示编程开始状态, 则判断第二编程状态标志是否指 示编程完成状态: 如果第二编程状态标志指示非编程完成状态, 则确认该页 受异常中止的影响; 如果第二编程状态标志指示编程完成状态, 则确认该页 未受异常中止的影响。  The determining module 1040 is configured to determine whether the first programming status flag indicates a programming start state: if the first programming status flag indicates a non-programming start state, confirming that the page is affected by the abnormal suspension; if the first programming status flag indicates programming a start state, determining whether the second program status flag indicates a program completion status: if the second program status flag indicates a non-program completion status, confirming that the page is affected by the abort; if the second program status flag indicates a program completion status, Confirm that the page is not affected by an abort.
本实施例中, 第二编程状态指示的取值为所有比特值均为 1 时, 指示空 闲状态。 即擦除后编程状态为空闲的页中的第二编程状态标志指示空闲状态。  In this embodiment, the value of the second programming state indication is that when all the bit values are 1, the idle state is indicated. That is, the second program status flag in the page in which the program state is idle after erasing indicates the idle state.
可选地, 第一编程状态标志位于该页的数据区的前端, 第二编程状态标 志位于该页的备用区的末端, 如图 10b所示, 写入模块 1010可以包括:  Optionally, the first programming state flag is located at a front end of the data area of the page, and the second programming state flag is located at an end of the spare area of the page. As shown in FIG. 10b, the writing module 1010 may include:
第三写入子模块 1011 , 用于对擦除后编程状态为空闲的该页进行编程, 将第一编程状态标志设置为指示编程开始状态, 第二编程状态标志设置为指 示编程完成状态。 从该页的数据区的前端开始直到该页的备用区的末端, 顺 序写入指示编程开始状态的第一编程状态标志、 正常的数据区数据、 正常的 备用区数据、 指示编程完成状态的第二编程状态标志。 可选地, 第一编程状态标志位于该页的备用区的前端, 第二编程状态标 志位于该页的备用区的末端, 如图 10b所示, 写入模块 1010可以包括: The third write sub-module 1011 is configured to program the page after the erased program state is idle, set the first program state flag to indicate a program start state, and the second program state flag is set to indicate a program completion state. From the front end of the data area of the page to the end of the spare area of the page, the first program status flag indicating the program start state, the normal data area data, the normal spare area data, and the instruction completion status are sequentially written. Two programming status flags. Optionally, the first programming state flag is located at a front end of the spare area of the page, and the second programming state flag is located at an end of the spare area of the page. As shown in FIG. 10b, the writing module 1010 may include:
第四写入子模块 1012, 用于对擦除后编程状态为空闲的该页进行编程, 将第一编程状态标志设置为指示编程开始状态, 从该页的数据区的前端开始 直到该页的备用区的末端, 顺序写入比特值均为 1 的数据区数据、 指示编程 开始状态的第一编程状态标志、 比特值均为 1 的备用区数据、 比特值均为 1 的第二编程状态标志; 将第二编程状态标志设置为指示编程完成状态, 再顺 序写入正常的数据区数据、 指示编程开始状态的第一编程状态标志、 正常的 备用区数据、 指示编程完成状态的第二编程状态标志。 实施例六, 本发明实施例提供了一种 Nand Flash页的检测装置, 如图 11a 所示, 包括写入模块 1110、 读取模块 1120、 确定模块 1130和判断模块 1140: 写入模块 1110, 用于对擦除后编程状态为空闲的页编程, 在写入该页的 数据区数据和备用区数据之前和之后将第三编程状态标志写入该页。  a fourth writing sub-module 1012, configured to program the page whose erasing programming state is idle, and set the first programming status flag to indicate a programming start state, starting from a front end of the data area of the page to the page At the end of the spare area, sequentially write data area data having a bit value of 1, a first program status flag indicating a start state of programming, spare area data having a bit value of 1, and a second program status flag having a bit value of 1 Setting the second program status flag to indicate the program completion status, sequentially writing the normal data area data, the first program status flag indicating the program start state, the normal spare area data, and the second program status indicating the program completion status. Sign. Embodiment 6 of the present invention provides a Nand Flash page detecting apparatus, as shown in FIG. 11a, including a writing module 1110, a reading module 1120, a determining module 1130, and a determining module 1140: a writing module 1110, To program a page that is idle after the erase programming state, a third program state flag is written to the page before and after the data area data and spare area data of the page are written.
读取模块 1120, 用于读取第三编程状态标志。  The reading module 1120 is configured to read the third programming status flag.
第三编程状态标志位于页的备用区的末端, 可以直接从页的内容中读取, 也可以读取备份区的内容, 继而从备份区的内容中提取第三编程状态标志。  The third program status flag is located at the end of the spare area of the page, can be read directly from the contents of the page, or can read the contents of the backup area, and then extract the third program status flag from the contents of the backup area.
确定模块 1130, 用于确定第三编程状态标志指示非空闲状态。  The determining module 1130 is configured to determine that the third programming status flag indicates a non-idle state.
本实施例中, 第三编程状态标志取值为所有比特值均为 1 时, 指示空闲 状态。 即擦除后编程状态为空闲的页的第三编程状态标志指示空闲状态。  In this embodiment, the third programming state flag takes a value indicating that all bit values are 1, indicating an idle state. That is, the third program status flag of the page whose program state is idle after erasing indicates the idle state.
第三编程状态标志的取值非所有比特值均为 1 ,则确定第三编程状态标志 指示非空闲状态; 第三编程状态标志取值为所有比特值均为 1 , 则确定第一编 程状态标志指示空闲状态, 结束对该页的检测。  The value of the third program status flag is not all bits, and it is determined that the third program status flag indicates a non-idle state; the third program status flag takes a value of all bits, and the first program status flag is determined. Indicates the idle state and ends the detection of the page.
判断模块 1140, 用于判断第三编程状态标志是否指示编程完成状态: 如 果第三编程状态标志指示非编程完成状态, 确认该页受异常中止的影响; 如 果所述第三编程状态标志指示编程完成状态, 则确认该页未受异常中止的影 响。 The determining module 1140 is configured to determine whether the third programming status flag indicates a programming completion state: if the third programming status flag indicates a non-program completion status, confirming that the page is affected by the abnormal suspension; if the third programming status flag indicates that the programming is completed Status, confirm that the page is not affected by the abort ring.
可选地, 第三编程状态标志位于页的备用区的末端, 如图 lib所示, 写 入模块 1110可以包括:  Optionally, the third programming state flag is located at an end of the spare area of the page. As shown in FIG. lib, the writing module 1110 may include:
第五写入子模块 1111 , 用于对擦除后编程状态为空闲的该页进行编程, 将第三编程状态标志设置为指示编程开始状态, 从该页的数据区的前端开始 直到该页的备用区的末端, 顺序写入比特值均为 1 的数据区数据、 比特值均 为 1 的备用区数据、 指示编程开始状态的第三编程状态标志; 将第三编程状 态标志设置为指示编程完成状态, 再顺序写入正常的数据区数据、 正常的备 用区数据、 指示编程完成状态的第三编程状态标志。 上述实施例四至六装置内的各模块之间的信息交互、 执行过程等内容 , 由于与本发明方法实施例基于同一构思, 具体内容可参见本发明方法实施例 中的叙述, 此处不再赞述。 采用本发明实施例提供的技术方案, 能够准确地检测出受异常中止影响 的 Nand Flash页, 以有效地消除异常中止对文件系统造成的影响。  a fifth writing sub-module 1111, configured to program the page whose erasing programming state is idle, and set a third programming status flag to indicate a programming start state, starting from a front end of the data area of the page to the page At the end of the spare area, sequentially write data area data having a bit value of 1, a spare area data having a bit value of 1, a third program status flag indicating a start state of programming, and setting a third program status flag to indicate that programming is completed. The status, and then sequentially writes the normal data area data, the normal spare area data, and the third program status flag indicating the programming completion status. The content of the information exchange, the execution process, and the like between the modules in the foregoing embodiments of the present invention are based on the same concept as the method embodiment of the present invention. For details, refer to the description in the method embodiment of the present invention. Said. The technical solution provided by the embodiment of the present invention can accurately detect the Nand Flash page affected by the abnormal suspension, so as to effectively eliminate the impact of the abnormal suspension on the file system.
本领域普通技术人员可以理解实现上述实施例方法中的全部或部分步 骤, 是可以通过计算机程序来指令相关的硬件来完成, 所述的程序可存储于 一计算机可读取存储介质中, 该程序在执行时, 可包括如上述各方法的实施 例的流程。其中,所述的存储介质可为磁碟、光盘、只读存储记忆体( Read-Only Memory, ROM )或随机存者 i己忆体 ( Random Access Memory, RAM )等。  A person skilled in the art can understand that all or part of the steps of the foregoing embodiment can be implemented by a computer program to instruct related hardware, and the program can be stored in a computer readable storage medium. In execution, the flow of an embodiment of the methods as described above may be included. The storage medium may be a magnetic disk, an optical disk, a read-only memory (ROM), or a random access memory (RAM).
以上所述, 仅为本发明的具体实施方式, 但本发明的保护范围并不局限 于此, 任何熟悉本技术领域的技术人员在本发明揭露的技术范围内, 可轻易 想到的变化或替换, 都应涵盖在本发明的保护范围之内。 因此, 本发明的保 护范围应以权利要求的保护范围为准。  The above is only the specific embodiment of the present invention, but the scope of the present invention is not limited thereto, and any change or replacement that can be easily conceived by those skilled in the art within the technical scope of the present invention is All should be covered by the scope of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.

Claims

1、 一种 Nand Flash页的检测方法, 其特征在于, 包括:  A method for detecting a Nand Flash page, comprising:
对擦除后编程状态为空闲的页编程, 在写入所述页的数据区数据和备用区 数据之前将第一编程状态标志写入所述页;  For page programming after the erase programming state is idle, the first program state flag is written to the page before the data area data and the spare area data of the page are written;
读取所述第一编程状态标志, 确定所述第一编程状态标志指示非空闲状态; 判断所述第一编程状态标志是否指示编程开始状态: 如果所述第一编程状 态标志指示非编程开始状态, 确认所述页受异常中止的影响。  Reading the first program state flag, determining that the first program state flag indicates a non-idle state; determining whether the first program state flag indicates a program start state: if the first program state flag indicates a non-program start state , confirm that the page is affected by an abort.
2、 根据权利要求 1所述的方法, 其特征在于, 所述方法还包括:  2. The method according to claim 1, wherein the method further comprises:
在写入所述页的数据区数据和备用区数据之后将第二编程状态标志写入所 述页;  Writing a second program status flag to the page after writing data area data and spare area data of the page;
如果所述第一编程状态标志指示编程开始状态, 读取所述第二编程状态标 志, 判断所述第二编程状态标志是否指示编程完成状态: 如果所述第二编程状 态标志指示非编程完成状态, 确认所述页受异常中止的影响。  If the first program status flag indicates a program start state, reading the second program status flag, determining whether the second program status flag indicates a program completion status: if the second program status flag indicates a non-program completion status , confirm that the page is affected by an abort.
3、 根据权利要求 1所述的方法, 其特征在于, 所述第一编程状态标志位于 所述页的数据区的前端;  3. The method according to claim 1, wherein the first programming state flag is located at a front end of a data area of the page;
第一编程状态标志写 入所述页, 具体包括:  The first programming status flag is written to the page, and specifically includes:
从所述页的数据区的前端开始直到所述页的备用区的末端, 顺序写入指示 编程开始状态的所述第一编程状态标志、 正常的数据区数据、 正常的备用区数 据。  The first program state flag indicating the program start state, the normal data area data, and the normal spare area data are sequentially written from the front end of the data area of the page to the end of the spare area of the page.
4、 根据权利要求 1所述的方法, 其特征在于, 所述第一编程状态标志位于 所述页的备用区的前端;  4. The method according to claim 1, wherein the first programming state flag is located at a front end of a spare area of the page;
第一编程状态标志写 入所述页, 具体包括:  The first programming status flag is written to the page, and specifically includes:
从所述页的数据区的前端开始直到所述页的备用区的末端, 顺序写入比特 值均为 1 的数据区数据、 指示编程开始状态的所述第一编程状态标志、 比特值 均为 1 的备用区数据; 再顺序写入正常的数据区数据、 指示编程开始状态的所 述第一编程状态标志、 正常的备用区数据。 Data area data having a bit value of 1, the first program status flag indicating a program start state, and a bit value are sequentially written from the front end of the data area of the page to the end of the spare area of the page. The spare area data is 1; the normal data area data is sequentially written, the first program status flag indicating the programming start state, and the normal spare area data.
5、 根据权利要求 2所述的方法, 其特征在于, 所述第一编程状态标志位于 所述页的数据区的前端, 所述第二编程状态标志位于所述页的备用区的末端;  5. The method according to claim 2, wherein the first program state flag is located at a front end of a data area of the page, and the second program state flag is located at an end of a spare area of the page;
标志写入所述页, 具体包括: The flag is written to the page, specifically including:
从所述页的数据区的前端开始直到所述页的备用区的末端, 顺序写入指示 编程开始状态的所述第一编程状态标志、 正常的数据区数据、 正常的备用区数 据、 指示编程完成状态的所述第二编程状态标志。  The first program state flag indicating the program start state, the normal data area data, the normal spare area data, the instruction programming are sequentially written from the front end of the data area of the page to the end of the spare area of the page. The second programming state flag of the completion state.
6、 根据权利要求 2所述的方法, 其特征在于, 所述第一编程状态标志位于 所述页的备用区的前端, 所述第二编程状态标志位于所述页的备用区的末端;  6. The method according to claim 2, wherein: the first programming state flag is located at a front end of a spare area of the page, and the second programming state flag is located at an end of a spare area of the page;
标志写入所述页, 具体包括: The flag is written to the page, specifically including:
从所述页的数据区的前端开始直到所述页的备用区的末端, 顺序写入比特 值均为 1 的数据区数据、 指示编程开始状态的所述第一编程状态标志、 比特值 均为 1的备用区数据、 比特值均为 1的所述第二编程状态标志; 再顺序写入正 常的数据区数据、 指示编程开始状态的所述第一编程状态标志、 正常的备用区 数据、 指示编程完成状态的所述第二编程状态标志。  From the front end of the data area of the page to the end of the spare area of the page, the data area data having the bit value of 1 is sequentially written, the first program status flag indicating the start state of the program, and the bit value are all The spare area data of 1 and the second program status flag having a bit value of 1; sequentially writing normal data area data, the first program status flag indicating a programming start state, normal spare area data, indication The second programming state flag of the programming completion state.
7、 一种 Nand Flash页的检测方法, 其特征在于, 包括:  7. A method for detecting a Nand Flash page, comprising:
对擦除后编程状态为空闲的页编程, 在写入所述页的数据区数据和备用区 数据之前和之后将第三编程状态标志写入所述页;  For page programming after the erase programming state is idle, writing a third program state flag to the page before and after writing data area data and spare area data of the page;
读取所述第三编程状态标志, 确定所述第三编程状态标志指示非空闲状态; 判断所述第三编程状态标志是否指示编程完成状态: 如果所述第三编程状 态标志指示非编程完成状态, 确认所述页受异常中止的影响。 Reading the third program status flag, determining that the third program status flag indicates a non-idle state; determining whether the third program status flag indicates a program completion status: if the third program status flag indicates a non-program completion status , confirm that the page is affected by an abort.
8、 根据权利要求 7所述的方法, 其特征在于, 所述第三编程状态标志位于 所述页的备用区的末端; 标志写入所述页, 具体包括: The method according to claim 7, wherein the third programming status flag is located at an end of the spare area of the page;
从所述页的数据区的前端开始直到所述页的备用区的末端, 顺序写入比特 值均为 1的数据区数据、 比特值均为 1的备用区数据、 指示编程开始状态的所 述第三编程状态标志; 再顺序写入正常的数据区数据、 正常的备用区数据、 指 示编程完成状态的所述第三编程状态标志。  Data area data having a bit value of 1 and spare area data having a bit value of 1 are sequentially written from the front end of the data area of the page to the end of the spare area of the page, and the instruction indicating the start state of the program is described. The third program status flag; the normal data area data, the normal spare area data, and the third program status flag indicating the programming completion status are sequentially written.
9、 一种 Nand Flash页的检测装置, 其特征在于, 包括:  9. A Nand Flash page detecting device, comprising:
写入模块, 用于对擦除后编程状态为空闲的页编程, 在写入所述页的数据 区数据和备用区数据之前将第一编程状态标志写入所述页;  a writing module, configured to program a page whose idle programming state is idle, and write a first programming state flag to the page before writing data area data and spare area data of the page;
读取模块, 用于读取所述第一编程状态标志;  a reading module, configured to read the first programming state flag;
确定模块, 用于确定所述第一编程状态标志指示非空闲状态;  a determining module, configured to determine that the first programming state flag indicates a non-idle state;
判断模块, 用于判断所述第一编程状态标志是否指示编程开始状态: 如果 所述第一编程状态标志指示非编程开始状态, 确认所述页受异常中止的影响。  And a determining module, configured to determine whether the first programming status flag indicates a programming start state: if the first programming status flag indicates a non-programming start state, confirming that the page is affected by an abnormal suspension.
10、 根据权利要求 9所述的装置, 其特征在于, 所述装置还包括: 编程状态标志写入所述页;  10. The apparatus according to claim 9, wherein the apparatus further comprises: writing a program status flag to the page;
所述读取模块还用于读取所述第二编程状态标志;  The reading module is further configured to read the second programming state flag;
所述判断模块还用于如果所述第一编程状态标志指示编程开始状态, 判断 所述第二编程状态标志是否指示编程完成状态: 如果所述第二编程状态标志指 示非编程完成状态, 确认所述页受异常中止的影响。  The determining module is further configured to: if the first programming status flag indicates a programming start state, determine whether the second programming status flag indicates a programming completion state: if the second programming status flag indicates a non-programming completion status, confirming The page is affected by an abort.
11、 根据权利要求 9所述的装置, 其特征在于, 所述第一编程状态标志位 于所述页的数据区的前端;  11. The apparatus according to claim 9, wherein the first program state flag is located at a front end of a data area of the page;
所述写入模块包括:  The writing module includes:
第一写入子模块, 用于对擦除后编程状态为空闲的所述页编程, 从所述页 的数据区的前端开始直到所述页的备用区的末端, 顺序写入指示编程开始状态 的所述第一编程状态标志、 正常的数据区数据、 正常的备用区数据。 a first write submodule, configured to program the page that is idle after the erased programming state, from the page The front end of the data area starts to the end of the spare area of the page, and the first program status flag indicating the program start state, the normal data area data, and the normal spare area data are sequentially written.
12、 根据权利要求 9所述的装置, 其特征在于, 所述第一编程状态标志位 于所述页的备用区的前端;  12. The apparatus according to claim 9, wherein the first program state flag is located at a front end of a spare area of the page;
所述写入模块包括:  The writing module includes:
第二写入子模块, 用于对擦除后编程状态为空闲的所述页编程, 从所述页 的数据区的前端开始直到所述页的备用区的末端, 顺序写入比特值均为 1 的数 据区数据、 指示编程开始状态的所述第一编程状态标志、 比特值均为 1 的备用 区数据; 再顺序写入正常的数据区数据、 指示编程开始状态的所述第一编程状 态标志、 正常的备用区数据。  a second write sub-module, configured to program the page in which the program state after the erase is idle, from the front end of the data area of the page to the end of the spare area of the page, the sequential write bit values are Data area data of 1, a first program status flag indicating a program start state, spare area data having a bit value of 1; and sequentially writing normal data area data, the first program state indicating a program start state Flag, normal spare area data.
13、 根据权利要求 10所述的装置, 其特征在于, 所述第一编程状态标志位 于所述页的数据区的前端, 所述第二编程状态标志位于所述页的备用区的末端; 所述写入模块包括:  13. The apparatus according to claim 10, wherein: the first program state flag is located at a front end of a data area of the page, and the second program state flag is located at an end of a spare area of the page; The writing module includes:
第三写入子模块, 用于对擦除后编程状态为空闲的所述页编程, 从所述页 的数据区的前端开始直到所述页的备用区的末端, 顺序写入指示编程开始状态 的所述第一编程状态标志、 正常的数据区数据、 正常的备用区数据、 指示编程 完成状态的所述第二编程状态标志。  a third write submodule, configured to program the page in which the program state after the erase is idle, from the front end of the data area of the page to the end of the spare area of the page, sequentially writing the instruction start state The first program state flag, normal data area data, normal spare area data, the second program status flag indicating a program completion status.
14、 根据权利要求 10所述的装置, 其特征在于, 所述第一编程状态标志位 于所述页的备用区的前端, 所述第二编程状态标志位于所述页的备用区的末端; 所述写入模块包括:  14. The apparatus according to claim 10, wherein: the first program state flag is located at a front end of a spare area of the page, and the second program state flag is located at an end of a spare area of the page; The writing module includes:
第四写入子模块, 用于对擦除后编程状态为空闲的所述页编程, 从所述页 的数据区的前端开始直到所述页的备用区的末端, 顺序写入比特值均为 1 的数 据区数据、 指示编程开始状态的所述第一编程状态标志、 比特值均为 1 的备用 区数据、 比特值均为 1 的所述第二编程状态标志; 再顺序写入正常的数据区数 据、 指示编程开始状态的所述第一编程状态标志、 正常的备用区数据、 指示编 程完成状态的所述第二编程状态标志。 a fourth write sub-module, configured to program the page in which the program state is idle after erasing, from the front end of the data area of the page to the end of the spare area of the page, sequentially writing bit values Data area data of 1, a first program state flag indicating a program start state, spare area data having a bit value of 1, and the second program status flag having a bit value of 1; and sequentially writing normal data The area data, the first program status flag indicating a program start state, normal spare area data, and the second program status flag indicating a program completion status.
15、 一种 Nand Flash页的检测装置, 其特征在于, 包括: 15. A Nand Flash page detecting apparatus, comprising:
写入模块, 用于对擦除后编程状态为空闲的页编程, 在写入所述页的数据 区数据和备用区数据之前和之后将第三编程状态标志写入所述页;  a writing module, configured to program a page whose idle programming state is idle, and write a third programming status flag to the page before and after writing data area data and spare area data of the page;
读取模块, 用于读取所述第三编程状态标志;  a reading module, configured to read the third programming state flag;
确定模块, 用于确定所述第三编程状态标志指示非空闲状态;  a determining module, configured to determine that the third programming status flag indicates a non-idle state;
判断模块, 用于判断所述第三编程状态标志是否指示编程完成状态: 如果 所述第三编程状态标志指示非编程完成状态, 确认所述页受异常中止的影响。  The determining module is configured to determine whether the third programming status flag indicates a programming completion state: if the third programming status flag indicates a non-programming completion status, confirm that the page is affected by the abnormal suspension.
16、 根据权利要求 15所述的装置, 其特征在于, 所述第三编程状态标志位 于所述页的备用区的末端;  16. The apparatus of claim 15, wherein the third programming state flag is located at an end of a spare area of the page;
所述写入模块包括:  The writing module includes:
第五写入子模块, 用于对擦除后编程状态为空闲的所述页编程, 从所述页 的数据区的前端开始直到所述页的备用区的末端, 顺序写入比特值均为 1 的数 据区数据、 比特值均为 1 的备用区数据、 指示编程开始状态的所述第三编程状 态标志; 再顺序写入正常的数据区数据、 正常的备用区数据、 指示编程完成状 态的所述第三编程状态标志。  a fifth writing sub-module, configured to program the page in which the programming state is idle after erasing, from the front end of the data area of the page to the end of the spare area of the page, sequentially writing bit values Data area data of 1, data of spare area with bit value of 1, third program status flag indicating a start state of programming; sequential writing of normal data area data, normal spare area data, indicating completion status of programming The third programming state flag.
PCT/CN2011/083372 2011-12-02 2011-12-02 Method and device for detecting nand flash page WO2013078676A1 (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
PCT/CN2011/083372 WO2013078676A1 (en) 2011-12-02 2011-12-02 Method and device for detecting nand flash page
CN201180003231.2A CN102511040B (en) 2011-12-02 2011-12-02 Method for detecting Nand Flash page and device thereof

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2011/083372 WO2013078676A1 (en) 2011-12-02 2011-12-02 Method and device for detecting nand flash page

Publications (1)

Publication Number Publication Date
WO2013078676A1 true WO2013078676A1 (en) 2013-06-06

Family

ID=46222771

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2011/083372 WO2013078676A1 (en) 2011-12-02 2011-12-02 Method and device for detecting nand flash page

Country Status (2)

Country Link
CN (1) CN102511040B (en)
WO (1) WO2013078676A1 (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110750467B (en) * 2019-10-22 2021-11-02 深圳芯邦科技股份有限公司 Method and system for detecting interference page in Nand Flash
CN111782142B (en) * 2020-06-19 2024-04-05 科大智能电气技术有限公司 Flash storage method based on time-sharing processing

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5966720A (en) * 1992-02-20 1999-10-12 Fujitsu Limited Flash memory accessed using only the logical address
CN1518000A (en) * 2003-01-26 2004-08-04 深圳市朗科科技有限公司 Method for managing data in flash storage medium
CN1725180A (en) * 2005-07-18 2006-01-25 杭州华为三康技术有限公司 Method and device for on-line upgrading of programmable logic device
CN1937077A (en) * 2005-09-22 2007-03-28 康佳集团股份有限公司 Multi-state management method for data in flash-memory medium

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5966720A (en) * 1992-02-20 1999-10-12 Fujitsu Limited Flash memory accessed using only the logical address
CN1518000A (en) * 2003-01-26 2004-08-04 深圳市朗科科技有限公司 Method for managing data in flash storage medium
CN1725180A (en) * 2005-07-18 2006-01-25 杭州华为三康技术有限公司 Method and device for on-line upgrading of programmable logic device
CN1937077A (en) * 2005-09-22 2007-03-28 康佳集团股份有限公司 Multi-state management method for data in flash-memory medium

Also Published As

Publication number Publication date
CN102511040B (en) 2014-03-12
CN102511040A (en) 2012-06-20

Similar Documents

Publication Publication Date Title
US8046645B2 (en) Bad block identifying method for flash memory, storage system, and controller thereof
US8769232B2 (en) Non-volatile semiconductor memory module enabling out of order host command chunk media access
JP5675954B2 (en) Detection of irregular parity distribution via metadata tag
US8046528B2 (en) Data writing method for flash memory, and flash memory controller and storage device thereof
US8055834B2 (en) Method for preventing read-disturb happened in non-volatile memory and controller thereof
CN102541676B (en) Method for detecting and mapping states of NAND FLASH
TWI633428B (en) Data storage device and methods for processing data in the data storage device
TWI512742B (en) Non-volatile memory flash memory erase-abnormal block repair method and device applying the same
TWI436369B (en) Methods for measuring usable lifespan and replacing an in-system programming code of a memory device, and data storage system using the same
EP3489956A1 (en) Erase management in memory systems
US9524212B2 (en) Method, device and operating system for processing and using burn data of NAND flash
US9785438B1 (en) Media cache cleaning based on workload
TWI479505B (en) Data management method, memory controller and memory storage apparatus
CN106227625A (en) The restoration methods of a kind of flash data damaged because of power down and system
US20090259796A1 (en) Data writing method for non-volatile memory and storage system and controller using the same
US20100005229A1 (en) Flash memory apparatus and method for securing a flash memory from data damage
JP2010086009A (en) Storage device and memory control method
CN109445982A (en) Realize the data storage device of data reliable read write
WO2018041151A1 (en) Data storage method and apparatus, and nonvolatile memory
WO2013078676A1 (en) Method and device for detecting nand flash page
US9286936B1 (en) Zone based band mapping
JP2006338083A (en) Memory controller
CN109284201A (en) Temperature equalization data reconstruction method and system, storage medium
CN109358984A (en) The storage device of data recovery is carried out using temperature equalization data reconstruction method
CN111258498B (en) FLASH memory management method

Legal Events

Date Code Title Description
WWE Wipo information: entry into national phase

Ref document number: 201180003231.2

Country of ref document: CN

121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 11876532

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 11876532

Country of ref document: EP

Kind code of ref document: A1