WO2010102566A1 - Method for programming flash memory medium - Google Patents

Method for programming flash memory medium Download PDF

Info

Publication number
WO2010102566A1
WO2010102566A1 PCT/CN2010/070967 CN2010070967W WO2010102566A1 WO 2010102566 A1 WO2010102566 A1 WO 2010102566A1 CN 2010070967 W CN2010070967 W CN 2010070967W WO 2010102566 A1 WO2010102566 A1 WO 2010102566A1
Authority
WO
WIPO (PCT)
Prior art keywords
page
data
lost
programming
target
Prior art date
Application number
PCT/CN2010/070967
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 深圳市朗科科技股份有限公司
Publication of WO2010102566A1 publication Critical patent/WO2010102566A1/en

Links

Classifications

    • GPHYSICS
    • G11INFORMATION STORAGE
    • G11CSTATIC STORES
    • G11C16/00Erasable programmable read-only memories
    • G11C16/02Erasable programmable read-only memories electrically programmable
    • G11C16/06Auxiliary circuits, e.g. for writing into memory
    • G11C16/10Programming or data input circuits
    • G11C16/102External programming circuits, e.g. EPROM programmers; In-circuit programming or reprogramming; EPROM emulators

Definitions

  • the present application relates to the field of semiconductor memory, and in particular to a method of programming a flash memory medium. Background technique
  • flash media is widely used in a variety of storage devices.
  • a page is programmed (ie, a write operation)
  • each page of the flash media is associated with a particular page, if a write to a page is in error, the page associated with that page may also be in error. If useful data is stored in the associated page, it will result in data loss.
  • the present application is directed to the above disadvantages existing in the prior art.
  • the programming method of the flash medium according to the present application includes:
  • the data in the associated page may not be lost.
  • the page number of the target page is larger than the page number of the associated page, the data in the associated page may not be lost.
  • the step includes: determining whether the target page associated with the target page is the page pointed to by the received command, and if not, the data in the associated page cannot be lost. The above method can make the existing data not be protected even if the page programming error does not result in the loss of the existing data in the flash medium.
  • FIG. 1 is a flow chart of flash memory programming in accordance with an embodiment of the present disclosure
  • FIG. 2 is a flow diagram of flash memory programming in accordance with another embodiment of the present disclosure. detailed description
  • the program processing 100 of the flash medium starts from step S11.
  • step S11 a command to program the flash medium is received.
  • the page associated with the page may also be in error. If useful data is stored in the associated page, it will result in the loss of data.
  • step S12 the first page pointed to by the received command is taken as the page to be currently programmed.
  • step S13 an associated page associated with the target page currently being programmed is determined based on a predetermined association relationship between pages in the flash media.
  • the relationship between pages in the flash medium may be recorded by one or more association tables, and an example of the contents of the association table is shown in Table 1:
  • association table may be stored in a flash memory medium.
  • association table may also be stored in other locations, as long as it can be read when needed, for example, stored in ROM, PROM, OTPROM. , EEPROM, etc.
  • step S14 it is determined whether the data in the associated page determined in step S13 is not lost. To judge. Specifically, if the page is associated with its logical address in the storage medium, the data of the page cannot be lost; otherwise, the data of the page can be lost.
  • the execution of the multi-page programming may be performed in the order of the page number (for example, programming the 0 page and then programming the 1 page), and therefore, in step S14, the associated target page may be associated with it.
  • the page number size relationship of the associated page is used to determine whether the data in the associated page is not lost. Specifically, if the page number of the determined target page is greater than the page number of the associated page, the data in the associated page cannot be lost. For example, from the 0th page, continuous multi-page programming is started. When the target page is 3 pages, the data in the 0th page, 1st page, and 2nd pages of the related page before the 3rd page cannot be lost.
  • step S14 If the result of the judgment in step S14 is that the data in the associated page can be lost, the target page is programmed in step S15. Otherwise, another page is selected as the target page to be programmed in step S16.
  • step S15 when step S15 is performed, the write command and the data to be written are first sent to the flash medium, and the data is written to the corresponding target page according to the write command.
  • the programming state of the flash media is also read after the data write operation (program states include "successful write” and "write error”). If the programming state is "successful write”, subsequent programming is performed; if the programming state is "write error”, subsequent programming is stopped, and the programming error is reported to the host through the communication line (such as the USB interface) of the host associated with the flash media. .
  • the specific report programming error is based on the standard definition of the communication line protocol, such as the flash disk following the USB/SCSI protocol to report programming errors to the host.
  • the page with the page number 0 indicated by the command is first used as the target page, and the associated page of the 0th page is found as the fourth page. It is judged that the fourth page does not have a correspondence with any logical address, that is, the data of the fourth page can be lost, and the page 0 is programmed. After that, the next page referred to by the command is the first page, and the related page of the first page is searched for the fifth page. After the data of the fifth page is judged to be lost, one page is programmed. Repeat the above process until the 4th page of the command is the target page. At this time, the related page of the 4th page is found as page 0.
  • a processing method 200 for programming a flash medium In order to avoid wasting flash media, another method disclosed in accordance with the present application proposes a processing method 200 for programming a flash medium.
  • this method when all the pages indicated by a command complete the write operation, the command is successfully executed, and the result of the successful execution of the command is returned to the host. If any of the pages fails to write, the command fails to execute, and the host associated with the storage medium is processed for error (such as reporting an error to the host issuing the command, etc.), in which case the page has been successfully written.
  • the data is also considered to be lossable, and the associated pages of these pages can be written. The specific operation thereof will be described below with reference to Fig. 2 .
  • step S21 a command to request writing of at least one page in the flash medium is received from the host.
  • step S22 the first page indicated by the command is used as the target page for which data is to be written.
  • step S23 the associated page of the target page is found according to the association relationship between the pre-established pages.
  • step S24 it is judged whether the associated page and the target page are the pages pointed to by the same command, and if so, the data is written to the target page in step S27, otherwise step S25 is performed.
  • step S25 it is judged whether the data in the associated page is not lost, and if the data can be lost, the data is written in the target page, otherwise step S26 is performed.
  • step S26 another page in the flash medium is selected as the target page, and the process returns to step S23, and step S23-26 is sequentially executed.
  • step S28 When the target page is programmed in step S27, it is determined in step S28 whether the programming is in error, if the error occurs, step S210 is performed, otherwise step S29 is performed;
  • step S29 it is determined whether the page pointed to by the command has been completely executed. If the execution has been completed, the flow of programming for a plurality of consecutive pages is ended, and the execution of the command is reported to the host; if it has not been completed, the process returns to step S22.
  • step S210 error processing is performed. For example, aborting a program command and reporting an error to the host. Specifically, the above steps are further explained by taking a case of programming ten consecutive pages as an example.
  • step S22 step 13 and subsequent steps shown in Fig. 2 are executed from the first page indicated by the command as the target page.
  • step S29 it is determined that the command has not been executed yet, then return to the next page (ie, page 2) indicated by the sequential acquisition command in step 22 as the target page, and then perform step 23 and subsequent steps, .. .
  • step S29 By analogy, until the 10th page indicated by the command is also programmed, it is determined in step S29 that all the pages indicated by the command have been programmed, and the command execution is completed.
  • the embodiment may use the associated page table RelatedPage to record the relationship between the pages.
  • the data structure of the associated page table RelatedPage is as follows:
  • variable FirstFreePage records the first empty page in the storage medium that can be programmed, and sets the variable FirstRiskPage to record which page in the storage medium is not lost in the page, that is, the page number of the page before the FirstRiskPage is It cannot be lost.
  • the variables FirstFreePage and FirstRiskPage such as, but not limited to, are set in the controller memory for programming the flash media, all of which are integers and initialized to a value of zero.
  • step S22 If a command is required to program the storage medium, when the above step S22 is performed, the value of reading FirstFreePage is 0, that is, the 0th page is used as the target page; in step S23, the associated page table is found, and the 0th page is found.
  • the associated page is page 4; in step S24, it is determined whether the 4th page and the 0th page are pages pointed to by the same command according to the programming length specified by the command and the length of each page of the flash medium. Specifically, the command specifies that the programming length is 100 sectors, and the length of each page of the flash media is 2k or 4 sectors.
  • the command specifies the programming length divided by the length of each page of the flash media, and the number of pages required to execute the command is 25, that is, the pages from 0 to 25 are the pages pointed to by the same command, so , judged that page 4 and page 0 are the same command.
  • pages 25 and 26 are not the pages pointed to by the same command.
  • step S25 the page number of the page of the associated page is compared with the value of the FirstRiskPage, and the page number of the associated page is greater than the value of the firstRiskPage. Therefore, it is determined that the data of the fourth page can be lost, and step S27 is performed. Page programming.
  • step S29 When it is determined in step S29 that it is determined that the command has not been executed, the process returns to step S22, and the value of FirstFreePage is incremented by one, and the value of FirstRiskPage is set to the same value as FirstFreePage, that is, 1, and the above process is re-executed. Receive the next command.
  • step S22 When another command is required to program the four pages of the current block, according to the above procedure, when the step S22 is performed, the value of the first FreePage is 1; in step S23, the page associated with the first page is the 5th page. The page number 5 of the associated page is larger than the value of FirstRiskPage, so the first page can be programmed. Because the data of these four pages is a continuous and complete data, any page of data can be lost during the programming process, so it is not necessary to increment the value of FirstRiskPage during continuous multi-page programming. A total addition can be done after the continuous programming process. That is, every time you finish programming a page, FirstFreePage takes 1 and FirstRiskPage does not change until all four pages are programmed. At this time, FirstFreePage may be equal to 6, and FirstRiskPage is also set to the same value as FirstFreePage, and then received. One order.
  • step S27 after the page is programmed in step S27, the program state of the page is read to confirm whether the page is programmed incorrectly. If programming errors occur, report to the host that the command execution failed, asking the host to resend the data, or write the data in the cache to other blocks or other pages.
  • the range of association between the general pages is limited to six pages, that is, the page number difference between the page and its associated page does not exceed 6, so the present embodiment can find the associated page only in the first six pages of the target page. To improve the efficiency of the search.
  • the above embodiment is also applicable to the case where the range of association between pages is not limited to six pages.
  • the above embodiment can find the associated page only within the association range of the target page.
  • the above embodiments may also not use variables.
  • FirstRiskPage records the page whose data cannot be lost, but records the information of the page whose data cannot be lost in the reserved area of the flash medium. Finding the record can determine whether the associated page data can be lost.

Abstract

A method for programming a flash memory medium is disclosed. It comprises: receiving a command for programming at least one page of the flash memory medium, selecting a target page to be currently programmed from at least one page, determining an associated page which is associated with the target page to be currently programmed based on the pre-determined associated relationships between every page of the flash memory medium, and judging whether the data in the associated page which has been determined can not be lost, wherein, if the data in the associated page can be lost, then the target page is programmed. The method will not result in the loss of the existing data in the flash memory medium even if an error occurs in programming a page, thereby protecting the existing data.

Description

闪存介盾的编程方法  Flash media shield programming method
技术领域 Technical field
本申请涉及半导体存储领域, 特别涉及闪存介质的编程方法。 背景技术  The present application relates to the field of semiconductor memory, and in particular to a method of programming a flash memory medium. Background technique
目前闪存介质广泛应用于多种存储设备。 然而, 闪存介质因其结构的固 有缺陷, 当对其中的某一页进行编程(即, 写操作) 的时候, 有可能出现写 入失败的情况。 由于闪存介质的每一页都与特定的页相关联, 因此, 如果对 某一页的写入出错, 则与该页关联的页也可能出错。 如果关联页里存储了有 用数据, 就会造成数据的丟失。 发明内容  Currently, flash media is widely used in a variety of storage devices. However, due to the inherent defects of its flash memory, when a page is programmed (ie, a write operation), there is a possibility of a write failure. Since each page of the flash media is associated with a particular page, if a write to a page is in error, the page associated with that page may also be in error. If useful data is stored in the associated page, it will result in data loss. Summary of the invention
本申请针对现有技术中存在的上述缺点而提出。  The present application is directed to the above disadvantages existing in the prior art.
根据本申请的闪存介质的编程方法, 包括:  The programming method of the flash medium according to the present application includes:
接收用来对所述闪存介质的至少一个页面进行编程的命令;  Receiving a command to program at least one page of the flash media;
从所述至少一个页面中选择出当前要编程的目标页; 程的目标页相关联的关联页; 以及  Selecting, from the at least one page, a target page to be currently programmed; an associated page associated with the target page of the program;
判断所确定出的关联页中的数据是否不可丢失, 其中, 如果所述关联页 中的数据可丟失则对所述目标页编程。  It is judged whether the data in the determined associated page is not lost, wherein the target page is programmed if the data in the associated page can be lost.
此外, 如果所述判断步骤判断的结果是所述关联页中的数据不可丟失, 则从所述至少一个页面中选择其它的页面作为当前要编程的目标页。  Furthermore, if the result of the determining step is that the data in the associated page is not lost, then another page is selected from the at least one page as the target page to be currently programmed.
根据本发明的一个实施例, 如果所述关联页与其在所述闪存介质中的逻 辑地址之间已经建立了对应关系, 则所述关联页中的数据不可丟失。 根据本 发明的另一个实施例, 如果所述目标页的页号大于所述关联页的页号, 则所 述关联页中的数据不可丟失。 步包括: 判断所述目标页与其关联的关联页是否都为所述接收的命令所指向 的页面, 如果不是, 则所述关联页中的数据不可丢失。 上述方法可以使得即使对页编程出错也不会导致闪存介质中已有数据的 丢失, 从而可以保护已有数据。 附图说明 According to an embodiment of the invention, if a correspondence has been established between the associated page and its logical address in the flash medium, the data in the associated page may not be lost. According to another embodiment of the present invention, if the page number of the target page is larger than the page number of the associated page, the data in the associated page may not be lost. The step includes: determining whether the target page associated with the target page is the page pointed to by the received command, and if not, the data in the associated page cannot be lost. The above method can make the existing data not be protected even if the page programming error does not result in the loss of the existing data in the flash medium. DRAWINGS
图 1是本申请公开的一个实施方式的闪存介质编程的流程图; 以及 图 2是本申请公开的另一个实施方式的闪存介质编程的流程图。 具体实施方式  1 is a flow chart of flash memory programming in accordance with an embodiment of the present disclosure; and FIG. 2 is a flow diagram of flash memory programming in accordance with another embodiment of the present disclosure. detailed description
下面参照附图对本申请公开的具体实施方式进行描述。 实施方式 1  The specific embodiments disclosed in the present application are described below with reference to the accompanying drawings. Embodiment 1
参照图 1, 才艮据本申请公开的一个实施方式的闪存介质的编程处理 100从 步骤 S 1 1开始操作。 在步骤 S 11 , 接收对闪存介质编程的命令。 如背景技术部 分所述, 由于闪存介质的每一页都与另一页具有关联关系, 如果对某一页的 写入操作出错, 则与该页关联的页也可能出错。 如果关联页里存储了有用数 据, 就会造成数据的丢失。  Referring to Fig. 1, the program processing 100 of the flash medium according to an embodiment disclosed in the present application starts from step S11. At step S11, a command to program the flash medium is received. As described in the background section, since each page of the flash medium has an association with another page, if a write operation to a page is in error, the page associated with the page may also be in error. If useful data is stored in the associated page, it will result in the loss of data.
在步骤 S 12, 将接收到的命令所指向的第一页作为当前要编程的页面。 在步骤 S 13, 根据闪存介质中各页面之间的预定关联关系, 确定与当前要 编程的目标页相关联的关联页。 具体地, 根据一个实施例, 闪存介质中各页 面之间的关系可以用一个或多个关联表来记录, 关联表内容的示例见表 1 :
Figure imgf000004_0002
In step S12, the first page pointed to by the received command is taken as the page to be currently programmed. In step S13, an associated page associated with the target page currently being programmed is determined based on a predetermined association relationship between pages in the flash media. Specifically, according to an embodiment, the relationship between pages in the flash medium may be recorded by one or more association tables, and an example of the contents of the association table is shown in Table 1:
Figure imgf000004_0002
Figure imgf000004_0001
Figure imgf000004_0001
其中, 上述关联表可存储在闪存介质中, 然而, 本领域技术人员应该理 解, 上述关联表还可以存储在其它位置, 只要在需要的时候能读取即可, 例 如存储在 ROM, PROM, OTPROM, EEPROM等中。  Wherein, the association table may be stored in a flash memory medium. However, those skilled in the art should understand that the association table may also be stored in other locations, as long as it can be read when needed, for example, stored in ROM, PROM, OTPROM. , EEPROM, etc.
以表 1为例, 假设在步骤 S 12中确定出页号为 "0" 的页面为当前要写入的 页面, 则在步骤 S 13中将根据表 1确定出其关联页面的页号为 "4"。  Taking Table 1 as an example, assuming that the page whose page number is "0" is determined to be the page currently to be written in step S12, the page number of the associated page is determined according to Table 1 in step S13. 4".
在步骤 S 14, 确定在步骤 S 13中确定的关联页中的数据是否不可丢失。 系来判断。 具体地, 如果该页与其在存储介质中的逻辑地址建立了对应关系, 则该页的数据不可丢失; 否则, 该页的数据可丟失。 At step S14, it is determined whether the data in the associated page determined in step S13 is not lost. To judge. Specifically, if the page is associated with its logical address in the storage medium, the data of the page cannot be lost; otherwise, the data of the page can be lost.
作为一种选择, 执行对多页编程可以是按照页号顺序向后进行的 (例如 对 0页编程后再对 1页编程), 因此, 在步骤 S14中, 可以依据确定的目标页 与其关联的关联页的页号大小关系来判断关联页中的数据是否不可丟失。 具 体地, 如果确定的目标页的页号大于关联页的页号, 则关联页中的数据不可 丢失。 例如, 从 0页开始对连续多页编程, 当目标页为 3 页时, 认为第 3 页 之前的关联页 0页、 1 页和 2页中的数据都不可丢失。  Alternatively, the execution of the multi-page programming may be performed in the order of the page number (for example, programming the 0 page and then programming the 1 page), and therefore, in step S14, the associated target page may be associated with it. The page number size relationship of the associated page is used to determine whether the data in the associated page is not lost. Specifically, if the page number of the determined target page is greater than the page number of the associated page, the data in the associated page cannot be lost. For example, from the 0th page, continuous multi-page programming is started. When the target page is 3 pages, the data in the 0th page, 1st page, and 2nd pages of the related page before the 3rd page cannot be lost.
如果在步骤 S14中判断的结果是关联页中的数据可丟失, 则在步骤 S15 中对目标页进行编程。 否则在步骤 S16中选择另一页面作为要编程的目标页。  If the result of the judgment in step S14 is that the data in the associated page can be lost, the target page is programmed in step S15. Otherwise, another page is selected as the target page to be programmed in step S16.
具体地, 在执行步骤 S15时, 首先将写入命令和待要写入的数据发送到 闪存介质, 并根据写入命令将数据写入到相应的目标页中。 在一个实施方式 中, 在数据写入操作之后, 还读取闪存介质的编程状态 (编程状态包括 "成 功写入" 和 "写入出错 ")。 如果编程状态为 "成功写入", 则进行后续编程; 如果编程状态为 "写入出错" 则停止后续编程, 并通过与闪存介质关联的主 机的通信线路(如 USB接口 ) 向主机报告编程出错。 具体报告编程出错的做 法采用通信线路协议的标准定义,如闪存盘遵循 USB/SCSI协议向主机报告编 程出错等。  Specifically, when step S15 is performed, the write command and the data to be written are first sent to the flash medium, and the data is written to the corresponding target page according to the write command. In one embodiment, the programming state of the flash media is also read after the data write operation (program states include "successful write" and "write error"). If the programming state is "successful write", subsequent programming is performed; if the programming state is "write error", subsequent programming is stopped, and the programming error is reported to the host through the communication line (such as the USB interface) of the host associated with the flash media. . The specific report programming error is based on the standard definition of the communication line protocol, such as the flash disk following the USB/SCSI protocol to report programming errors to the host.
下面, 以表 1为例描述根据逻辑地址判断关联页中的数据是否可丟失的、 连续多页编程的具体处理过程。 为了简洁, 下面的描述省略了步骤标号 Sl l -S16„  In the following, the specific processing procedure of continuous multi-page programming for judging whether data in the associated page can be lost according to the logical address is described by taking Table 1 as an example. For the sake of brevity, the following description omits the step number Sl l -S16 „
假设接收到对闪存介质中的多页编程的命令, 则先将命令所指的页号为 0 的页作为目标页, 并查找到第 0页的关联页为第 4页。 经判断第 4页未与任何逻 辑地址建立对应关系, 即第 4页的数据可丟失, 则对第 0页编程。 之后, 将命 令所指的下一页即第 1页作为目标页, 并查找第 1页的关联页为第 5页, 经判断 第 5页的数据可丢失, 则对 1页编程。 重复执行上述流程, 直到命令所指的第 4 页为目标页, 这时查找到第 4页的关联页为第 0页。 因为第 0页已存储了数据, 所以第 0页的数据不可丟失, 这时选取闪存介质中的另一页例如第 5页作为目 标页。 由于第 5页的关联页为第 1页, 而第 1页也已存储了数据, 因此选取闪存 介质中的另一页如第 6页作为目标页。 第 6页的关联页为第 12页, 经判断第 12 页的数据可丟失, 因此可以对第 12页编程。 在这里, 选取闪存介质中的下一 页的操作可以选取闪存介质中命令所指页的下一页, 也可选取其他空页。 实施方式 2 Assuming that a command to program multiple pages in the flash medium is received, the page with the page number 0 indicated by the command is first used as the target page, and the associated page of the 0th page is found as the fourth page. It is judged that the fourth page does not have a correspondence with any logical address, that is, the data of the fourth page can be lost, and the page 0 is programmed. After that, the next page referred to by the command is the first page, and the related page of the first page is searched for the fifth page. After the data of the fifth page is judged to be lost, one page is programmed. Repeat the above process until the 4th page of the command is the target page. At this time, the related page of the 4th page is found as page 0. Since the data has been stored on page 0, the data on page 0 cannot be lost. In this case, another page in the flash medium, for example, page 5 is selected as the target page. Since the related page on page 5 is the first page, and the first page has also stored the data, another page in the flash medium is selected as the target page. The related page on page 6 is page 12, judged by the 12th The page data can be lost, so page 12 can be programmed. Here, the operation of selecting the next page in the flash media can select the next page of the page pointed by the command in the flash media, or select other empty pages. Embodiment 2
以上参照图 1 所示的方法虽然可根据命令依次对存储介质中的多页进行 编程, 但若一页中的数据不可丟失则不对其关联页进行编程, 这样, 虽能保 证有用数据不会因编程出错而丟失, 但可能造成大量页闲置浪费。  Referring to the method shown in FIG. 1 above, although multiple pages in the storage medium can be sequentially programmed according to the command, if the data in one page cannot be lost, the associated page is not programmed, so that the useful data is not guaranteed. Programming errors are lost, but can cause a lot of pages to be wasted.
为避免闲置浪费闪存介质, 根据本申请公开的另一实施方式提出了另夕 1' 一种对闪存介质编程的处理方法 200。 根据该方法, 当某一命令所指的所有页 都完成写入操作后, 该命令才成功执行, 并向主机返回命令成功执行的结果。 若其中任一页写入失败, 则该命令执行失败, 向与存储介质关联的主机进行 出错处理(如向发出命令的主机报告出错等), 在这种情况下, 已写入成功的 页中的数据也认为是可丢失的, 可以对这些页的关联页进行写入操作。 下面 将参照图 2描述其具体操作。  In order to avoid wasting flash media, another method disclosed in accordance with the present application proposes a processing method 200 for programming a flash medium. According to this method, when all the pages indicated by a command complete the write operation, the command is successfully executed, and the result of the successful execution of the command is returned to the host. If any of the pages fails to write, the command fails to execute, and the host associated with the storage medium is processed for error (such as reporting an error to the host issuing the command, etc.), in which case the page has been successfully written. The data is also considered to be lossable, and the associated pages of these pages can be written. The specific operation thereof will be described below with reference to Fig. 2 .
在步骤 S21 , 从主机接收请求对闪存介质中的至少一页进行写入的命令。 在步骤 S22 , 从命令所指的第一页作为待要写入数据的目标页。 在步骤 S23 , 根据预先建立的页面之间的关联关系查找目标页的关联页。 在步骤 S24 , 判断 关联页与目标页是否为同一命令所指向的页面, 如果是, 则在步骤 S27中将数 据写入目标页, 否则进行步骤 S25。  At step S21, a command to request writing of at least one page in the flash medium is received from the host. At step S22, the first page indicated by the command is used as the target page for which data is to be written. In step S23, the associated page of the target page is found according to the association relationship between the pre-established pages. In step S24, it is judged whether the associated page and the target page are the pages pointed to by the same command, and if so, the data is written to the target page in step S27, otherwise step S25 is performed.
在步骤 S25, 判断关联页中的数据是否不可丟失, 如果数据可丢失, 则在 目标页中写入数据, 否则执行步骤 S26。  In step S25, it is judged whether the data in the associated page is not lost, and if the data can be lost, the data is written in the target page, otherwise step S26 is performed.
在步骤 S26 , 选取闪存介质中的另一页作为目标页, 并返回到步骤 S23 , 依次执行步骤 S23-26。  In step S26, another page in the flash medium is selected as the target page, and the process returns to step S23, and step S23-26 is sequentially executed.
当在步骤 S27中对目标页编程结束后, 在步骤 S28中判断编程是否出错, 如果出错, 则进行步骤 S210, 否则进行步骤 S29;  When the target page is programmed in step S27, it is determined in step S28 whether the programming is in error, if the error occurs, step S210 is performed, otherwise step S29 is performed;
在步骤 S29, 判断该命令所指向的页面是否已全部执行完毕。 如果已执行 完毕, 则对连续多页进行编程的流程结束, 并向主机报告命令执行完毕; 如 果尚未执行完毕, 则返回步骤 S22。  In step S29, it is determined whether the page pointed to by the command has been completely executed. If the execution has been completed, the flow of programming for a plurality of consecutive pages is ended, and the execution of the command is reported to the host; if it has not been completed, the process returns to step S22.
在步骤 S210, 进行出错处理。 例如, 中止执行编程命令, 并向主机报告 出错等。 具体地, 以对连续十个页进行编程为例来对上述步骤进行进一步的说明。 在步骤 S22中, 先从命令所指的第 1页作为目标页, 执行如图 2所示的步骤 23及 后续步骤。 当执行到步骤 S29时, 判断出命令尚未执行完毕, 则回到步骤 22中 顺序获取命令所指的下一页 (即第 2页)作为目标页, 并接着执行步骤 23及后 续步骤, ......。 如此类推, 直到命令所指的第 10页也编程完毕, 则在步骤 S29 判断出命令所指的所有页都执行了编程, 则命令执行完毕。 In step S210, error processing is performed. For example, aborting a program command and reporting an error to the host. Specifically, the above steps are further explained by taking a case of programming ten consecutive pages as an example. In step S22, step 13 and subsequent steps shown in Fig. 2 are executed from the first page indicated by the command as the target page. When it is determined to step S29, it is determined that the command has not been executed yet, then return to the next page (ie, page 2) indicated by the sequential acquisition command in step 22 as the target page, and then perform step 23 and subsequent steps, .. ..... By analogy, until the 10th page indicated by the command is also programmed, it is determined in step S29 that all the pages indicated by the command have been programmed, and the command execution is completed.
为便于实现上述流程, 本实施方式可用关联页表 RelatedPage记录页之间 的关联关系。 沿用上述表 1 , 关联页表 RelatedPage的数据结构如下:  In order to facilitate the implementation of the above process, the embodiment may use the associated page table RelatedPage to record the relationship between the pages. Following the above Table 1, the data structure of the associated page table RelatedPage is as follows:
const BYTE RelatedPage[128] = Const BYTE RelatedPage[128] =
4,〃 Page 0 4, 〃 Page 0
5,// Page 1  5,// Page 1
8,// Page 2  8,// Page 2
9,11 Page 3  9,11 Page 3
0,// Page 4  0,// Page 4
1 J I Page 5  1 J I Page 5
12, // Page 6  12, // Page 6
13, // Page 7  13, // Page 7
2JI Page 8  2JI Page 8
3,〃 Page 9  3, 〃 Page 9
}。 }.
本实施方式设置变量 FirstFreePage记录存储介质中的第一个可以进行编 程的空页, 设置变量 FirstRiskPage记录存储介质中哪一页之前的页中数据不 可丢失, 即页号在 FirstRiskPage之前的页的数据都是不可丢失的。 根据一个 实施例, 变量 FirstFreePage和 FirstRiskPage, 例如但不限于, 设置在对闪存 介质进行编程的控制器内存中, 取值均为整数, 初始化取值均为 0。  In this embodiment, the variable FirstFreePage records the first empty page in the storage medium that can be programmed, and sets the variable FirstRiskPage to record which page in the storage medium is not lost in the page, that is, the page number of the page before the FirstRiskPage is It cannot be lost. According to one embodiment, the variables FirstFreePage and FirstRiskPage, such as, but not limited to, are set in the controller memory for programming the flash media, all of which are integers and initialized to a value of zero.
设某一命令要求对存储介质进行编程, 则在执行上述步骤 S22时, 读 FirstFreePage的取值为 0, 即将第 0页作为目标页; 在步骤 S23 , 查找关联页 表, 找出第 0页的关联页是第 4页; 在步骤 S24, 根据命令指定的编程长度和 闪存介质每页的长度判断第 4页与第 0页是否为同一命令所指向的页面。 具 体来说,设命令指定编程长度为 100扇区, 闪存介质每页长度为 2k即 4扇区, 且当前目标页为第 0页, 则用命令指定编程长度除以闪存介质每页长度, 得 到执行该命令需要的页数为 25, 即 0页到 25页都为同一命令所指向的页面, 因此, 判断得第 4页与第 0页为同一命令所指。 相应地, 第 25页与第 26页 就不是同一命令所指向的页面。 If a command is required to program the storage medium, when the above step S22 is performed, the value of reading FirstFreePage is 0, that is, the 0th page is used as the target page; in step S23, the associated page table is found, and the 0th page is found. The associated page is page 4; in step S24, it is determined whether the 4th page and the 0th page are pages pointed to by the same command according to the programming length specified by the command and the length of each page of the flash medium. Specifically, the command specifies that the programming length is 100 sectors, and the length of each page of the flash media is 2k or 4 sectors. And the current target page is page 0, the command specifies the programming length divided by the length of each page of the flash media, and the number of pages required to execute the command is 25, that is, the pages from 0 to 25 are the pages pointed to by the same command, so , judged that page 4 and page 0 are the same command. Correspondingly, pages 25 and 26 are not the pages pointed to by the same command.
在步骤 S25 , 将关联页的页号为 4的页面与 FirstRiskPage取值比较, 得 到关联页页号大于 FirstRiskPage取值 0, 因此, 判断出第 4页的数据可丟失, 执行步骤 S27, 对第 0页编程。  In step S25, the page number of the page of the associated page is compared with the value of the FirstRiskPage, and the page number of the associated page is greater than the value of the firstRiskPage. Therefore, it is determined that the data of the fourth page can be lost, and step S27 is performed. Page programming.
当执行到步骤 S29中时,判断出尚未执行完毕命令,则返回执行步骤 S22, 将 FirstFreePage取值加 1 , FirstRiskPage的取值置为与 FirstFreePage相同的取 值, 即 1, 并重新执行上述流程, 接收下一命令。  When it is determined in step S29 that it is determined that the command has not been executed, the process returns to step S22, and the value of FirstFreePage is incremented by one, and the value of FirstRiskPage is set to the same value as FirstFreePage, that is, 1, and the above process is re-executed. Receive the next command.
设另一命令要求对当前块的四个页面编程时, 按照上述流程, 在执行步 骤 S22时, 读出 FirstFreePage的取值为 1 ; 在步骤 S23 中找出第 1 页的关联 页是第 5 页, 该关联页的页号 5 比 FirstRiskPage的取值大, 因此可以对第 1 页编程。 因为这四个页的数据是一段连续完整的数据, 在编程过程中, 任何 一页的数据都可丢失, 因此不必在连续对多页编程过程中对 FirstRiskPage取 值进行递加, 而只需在连续编程过程结束后进行一次总的加法即可。 即每完 成对一页的编程, FirstFreePage取值加 1 , FirstRiskPage不变, 直到四个页都 完成编程, 此时 FirstFreePage 可能等于 6, 将 FirstRiskPage 也置为与 FirstFreePage相同的取值 6, 再接收下一命令。  When another command is required to program the four pages of the current block, according to the above procedure, when the step S22 is performed, the value of the first FreePage is 1; in step S23, the page associated with the first page is the 5th page. The page number 5 of the associated page is larger than the value of FirstRiskPage, so the first page can be programmed. Because the data of these four pages is a continuous and complete data, any page of data can be lost during the programming process, so it is not necessary to increment the value of FirstRiskPage during continuous multi-page programming. A total addition can be done after the continuous programming process. That is, every time you finish programming a page, FirstFreePage takes 1 and FirstRiskPage does not change until all four pages are programmed. At this time, FirstFreePage may be equal to 6, and FirstRiskPage is also set to the same value as FirstFreePage, and then received. One order.
根据本发明的一个实施例, 在上述流程中, 每次执行步骤 S27对页面进 行编程后, 都要读取该页的编程状态, 确认对该页编程是否出错。 如果编程 出错则向主机报告命令执行失败, 要求主机重发数据, 或把緩存中的数据写 入到其他块或其他页里。  According to an embodiment of the present invention, in the above flow, after the page is programmed in step S27, the program state of the page is read to confirm whether the page is programmed incorrectly. If programming errors occur, report to the host that the command execution failed, asking the host to resend the data, or write the data in the cache to other blocks or other pages.
根据闪存介质特性, 一般页之间的关联范围限于六个页内, 即页与其关 联页之间的页号差不超过 6, 因此本实施方式可仅在目标页的前六页内查找关 联页, 以提高查找效率。 当然, 本领域技术人员应该理解, 上述实施方式还 有可能适用于页之间的关联范围不限于六个页的情况。 上述实施方式可以仅 在目标页的关联范围内查找关联页。 此外, 上述实施方式也可不使用变量 According to the characteristics of the flash media, the range of association between the general pages is limited to six pages, that is, the page number difference between the page and its associated page does not exceed 6, so the present embodiment can find the associated page only in the first six pages of the target page. To improve the efficiency of the search. Of course, those skilled in the art should understand that the above embodiment is also applicable to the case where the range of association between pages is not limited to six pages. The above embodiment can find the associated page only within the association range of the target page. In addition, the above embodiments may also not use variables.
FirstRiskPage记录数据不可丢失的页, 而是将所有数据不可丟失的页的信息记 录在闪存介质的预留区, 查找该记录即可判断关联页数据是否可丟失。 以上所述仅为本发明的优选实施方式, 并非因此限制本发明的专利范围, 几是利用本发明说明书及附图内容所作的等效结构或等效流程变换, 或直接 或间接运用在其他相关的技术领域, 均同理包括在本发明的专利保护范围内。 FirstRiskPage records the page whose data cannot be lost, but records the information of the page whose data cannot be lost in the reserved area of the flash medium. Finding the record can determine whether the associated page data can be lost. The above description is only a preferred embodiment of the present invention, and is not intended to limit the scope of the invention, and is equivalent to the equivalent structure or equivalent process transformation of the present specification and the drawings, or directly or indirectly The technical field is equally included in the scope of patent protection of the present invention.

Claims

权利要求书: Claims:
1. 一种闪存介质的编程方法, 包括: 1. A method of programming a flash medium, comprising:
接收用来对所述闪存介质的至少一个页面进行编程的命令;  Receiving a command to program at least one page of the flash media;
从所述至少一个页面中选择出当前要编程的目标页;  Selecting a target page to be programmed from the at least one page;
基于所述闪存介质中各页面之间的预定关联关系, 确定与所述当前要编 程的目标页相关联的关联页; 以及  Determining an associated page associated with the target page currently being programmed based on a predetermined association relationship between pages in the flash media;
判断所确定出的关联页中的数据是否不可丟失, 其中, 如果所述关联页 中的数据可丟失则对所述目标页编程。  It is judged whether the data in the determined associated page is not lost, wherein the target page is programmed if the data in the associated page can be lost.
2. 如权利要求 1所述的方法, 还包括: 2. The method of claim 1 further comprising:
如果所述判断步骤判断的结杲是所述关联页中的数据不可丟失, 则从所 述至少一个页面中选择其它的页面作为当前要编程的目标页。  If the result of the determining step is that the data in the associated page is not lost, then another page is selected from the at least one page as the target page to be currently programmed.
3.如权利要求 1所述的方法, 判断所确定出的关联页中的数据是否不可丢 失的步骤进一步包括: 页中的数据是否不可丟失, 如果所述关联页与其在所述闪存介质中的逻辑地 址之间已经建立了对应关系, 则所述关联页中的数据不可丢失。 3. The method of claim 1, the step of determining whether the determined data in the associated page is not lossable further comprises: whether the data in the page is not lost, if the associated page is in the flash medium A correspondence has been established between the logical addresses, and the data in the associated page cannot be lost.
4. 如权利要求 1所述的方法,判断所确定出的关联页中的数据是否不可丢 失的步骤进一步包括: 4. The method of claim 1, the step of determining whether the determined data in the associated page is not lost further comprises:
依据所述选择出的目标页与其关联的关联页的页号大小关系, 判断该关 联页中的数据是否不可丟失, 如果所述目标页的页号大于所述关联页的页号, 则所述关联页中的数据不可丢失。  Determining, according to the page number size relationship of the selected target page and its associated associated page, whether the data in the associated page is not lost, if the page number of the target page is greater than the page number of the associated page, The data in the associated page cannot be lost.
5.如权利要求 1所述的方法 , 判断所确定出的关联页中的数据是否不可丢 失的步骤进一步包括: 面, 如果不是, 则所述关联页中的数据不可丟失。 5. The method of claim 1, the step of determining whether the determined data in the associated page is not lossable further comprises: a face, if not, the data in the associated page is not lost.
6. 如权利要求 1所述的方法, 还包括: 6. The method of claim 1 further comprising:
如果对所述目标页进行编程的过程中发生错误, 则向与所述存储介质关 联的主机发送出错报告。  If an error occurs during programming of the target page, an error report is sent to the host associated with the storage medium.
S  S
7. 如权利要求 1所述的方法,其中,所述预定关联关系记录在关联表格中  7. The method of claim 1, wherein the predetermined association relationship is recorded in an association table
8.如权利要求 7所述的方法, 其中, 所述关联表格存储于所述存储介质中。 0 9.如权利要求 至 8中任意一项所述的方法, 其中, 对所述目标页编程包括 向所述目标页写入数据。 The method of claim 7, wherein the association table is stored in the storage medium. The method of any one of claims 8 to 8, wherein programming the target page comprises writing data to the target page.
PCT/CN2010/070967 2009-03-11 2010-03-10 Method for programming flash memory medium WO2010102566A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN200910127109.0A CN101833995B (en) 2009-03-11 2009-03-11 The programmed method of flash media
CN200910127109.0 2009-03-11

Publications (1)

Publication Number Publication Date
WO2010102566A1 true WO2010102566A1 (en) 2010-09-16

Family

ID=42718035

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2010/070967 WO2010102566A1 (en) 2009-03-11 2010-03-10 Method for programming flash memory medium

Country Status (2)

Country Link
CN (1) CN101833995B (en)
WO (1) WO2010102566A1 (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1226709A (en) * 1997-11-17 1999-08-25 国际商业机器公司 Method and apparatus for interacting with hardware devices remotely
US20030177302A1 (en) * 2002-03-18 2003-09-18 Pasquale Pistilli Flash memory programming
US7280398B1 (en) * 2006-08-31 2007-10-09 Micron Technology, Inc. System and memory for sequential multi-plane page memory operations

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR100799688B1 (en) * 2007-01-03 2008-02-01 삼성전자주식회사 Memory system having back circuit and program method thereof

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1226709A (en) * 1997-11-17 1999-08-25 国际商业机器公司 Method and apparatus for interacting with hardware devices remotely
US20030177302A1 (en) * 2002-03-18 2003-09-18 Pasquale Pistilli Flash memory programming
US7280398B1 (en) * 2006-08-31 2007-10-09 Micron Technology, Inc. System and memory for sequential multi-plane page memory operations

Also Published As

Publication number Publication date
CN101833995A (en) 2010-09-15
CN101833995B (en) 2017-06-20

Similar Documents

Publication Publication Date Title
TWI387023B (en) Method of preventing data loss during a solder reflow process and memory device using the same
US20070170268A1 (en) Memory cards, nonvolatile memories and methods for copy-back operations thereof
US8732519B2 (en) Method for using bad blocks of flash memory
US8234466B2 (en) Flash memory storage system applying SLC NAND flash memory and MLC NAND flash memory and data writing method thereof
JP4711531B2 (en) Semiconductor memory device
US8046528B2 (en) Data writing method for flash memory, and flash memory controller and storage device thereof
US20100208385A1 (en) Storage device with read-ahead function
JP5983019B2 (en) Control device, storage device, and storage control method
US20070214309A1 (en) Nonvolatile storage device and data writing method thereof
US20090307537A1 (en) Flash storage device with data correction function
US20080016267A1 (en) Memory controller, flash memory system having memory controller, and method for controlling flash memory
JP5153884B2 (en) Information storage device
JP2008226245A (en) Memory system based on flash memory
TWI693518B (en) Data storage devices and methods for firmware failure prevention
JP4968342B2 (en) RAID controller and RAID system
US8074012B2 (en) Flash memory apparatus and method for securing a flash memory from data damage
JP4997798B2 (en) Nonvolatile semiconductor memory device and memory system
US8949491B1 (en) Buffer memory reservation techniques for use with a NAND flash memory
WO2018041151A1 (en) Data storage method and apparatus, and nonvolatile memory
JP2007293917A (en) Method for controlling memory system
US8489802B2 (en) Recordable memory device which writes data to reformatted user area of nonvolatile semiconductor memory
US8423819B2 (en) Data storage device, controller, and data access method for a downgrade memory
WO2010102566A1 (en) Method for programming flash memory medium
JP2013069171A (en) Memory system and control method thereof
JP2011118922A (en) Reading/writing method for semiconductor storage device

Legal Events

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

Ref document number: 10750362

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: 10750362

Country of ref document: EP

Kind code of ref document: A1