JP3646679B2 - Non-volatile memory data rewrite method - Google Patents

Non-volatile memory data rewrite method Download PDF

Info

Publication number
JP3646679B2
JP3646679B2 JP2001236928A JP2001236928A JP3646679B2 JP 3646679 B2 JP3646679 B2 JP 3646679B2 JP 2001236928 A JP2001236928 A JP 2001236928A JP 2001236928 A JP2001236928 A JP 2001236928A JP 3646679 B2 JP3646679 B2 JP 3646679B2
Authority
JP
Japan
Prior art keywords
block
empty
physical
physical block
blocks
Prior art date
Legal status (The legal status 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 status listed.)
Expired - Fee Related
Application number
JP2001236928A
Other languages
Japanese (ja)
Other versions
JP2003050747A (en
Inventor
充 中田
光彦 富田
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Sony Corp
Original Assignee
Sony Corp
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 Sony Corp filed Critical Sony Corp
Priority to JP2001236928A priority Critical patent/JP3646679B2/en
Priority to KR1020047000158A priority patent/KR100877030B1/en
Priority to PCT/JP2002/007356 priority patent/WO2003010671A1/en
Priority to US10/484,322 priority patent/US7240178B2/en
Priority to CNB028147979A priority patent/CN1255733C/en
Publication of JP2003050747A publication Critical patent/JP2003050747A/en
Application granted granted Critical
Publication of JP3646679B2 publication Critical patent/JP3646679B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Images

Landscapes

  • Memory System (AREA)
  • Read Only Memory (AREA)
  • Techniques For Improving Reliability Of Storages (AREA)

Description

【0001】
【発明の属する技術分野】
この発明は、メモリカード等の電子機器に設けられた例えばNAND型フラッシュメモリ等の不揮発性メモリにおいてデータ書き換えが同一の物理ブロックに集中すること等に起因して生じるフラッシュメモリの寿命の短命化を防止するための不揮発性メモリのデータ書き換え方法に係り、特に簡単な処理方式を用いて各物理ブロックに係る書き換え回数を平均化することを可能とする不揮発性メモリのデータ書き換え方法に関するものである。
【0002】
【従来の技術】
近年、大量のデータを記憶するのに適した低コストのNAND型フラッシュメモリ等の不揮発性メモリが、家電機器、携帯電子機器、メモリカード等の電子機器に幅広く使用されている。図3は、不揮発性メモリの記憶領域に係る論理ブロックと物理ブロックとの関係を示す図である。NAND型フラッシュメモリで代表される書き換え可能なフラッシュメモリの記憶領域は、ブロック単位で管理され、データの消去(通常は全ビットに対してバイナリデータ“1”を書き込む動作)、データの書き込み等のデータ処理については物理ブロック毎に実施される。
【0003】
フラッシュメモリをアクセスする際には、例えばCPUに接続されたRAM内に格納されるアドレス変換テーブルを参照することで、図3に示されるようにデータ処理対象となっている論理ブロックの論理ブロックアドレスを物理ブロックアドレスに変換し、データの消去、書き込み、読み出し等を実施する物理ブロックを特定する。このように論理ブロックアドレスによりアクセスする方式をとることで、欠陥のある物理ブロックが発生した場合に当該欠陥のある物理ブロックに対する処理動作を代替用の別の消去状態にある書き込み可能な物理ブロック(以下、空きブロックと称する)に対して実施しても、アプリケーションプログラム等を実行するCPU側ではブロック代替の有無に関係なく同一の論理ブロックアドレスを用いてアクセスすることが可能となる。
【0004】
図4は、従来のフラッシュメモリの物理ブロック内に格納される管理情報に係るデータ構造を示す図である。図4において、11は通常のデータが記憶されるデータ領域、12は当該物理ブロックについての管理情報等に係るデータが記憶される冗長領域であり、データ領域11と冗長領域12とから物理ブロックが構成される。また、13は当該冗長領域を有する物理ブロックに対応する論理ブロックのアドレスを記憶する論理ブロックアドレス記憶領域、14は当該冗長領域を有する物理ブロックに対して消去状態からのデータ書き込みが実施された回数(書き換え回数)を記憶する書き換え回数記憶領域である。なお、論理ブロックアドレス記憶領域13については、当該物理ブロックについて対応付けられている論理ブロックがない場合には、論理ブロックのアドレスとして使用されることのない所定の値を書き込んでおいて、空きブロックであることを識別可能とするものとする。
【0005】
図5は、フラッシュメモリを備える従来の電子機器において、例えばCPU内に接続されるRAM内に構成されるアドレス変換テーブルの一例を示す図である。図5において、(a)はアドレスLを有する論理ブロックに対してデータの書き換えを実施するに際してデータ書き換え前のアドレス変換テーブルを示し、(b)はデータ書き換え後のアドレス変換テーブルを示す。なお、このようなデータの書き換えに伴うアドレス変換テーブルの更新については後述する。図5(a)に示されるように、例えばアドレスL−1,L,L+1,L+2により特定される論理ブロックには、それぞれ対応する物理ブロックのアドレスA,B,C,Dが記憶されている。図5(a)に示されるようなアドレス変換テーブルを参照することで、データ処理対象の論理ブロックに当初対応付けられている物理ブロックを特定することができる。
【0006】
次に、従来のフラッシュメモリに対して実行されるデータの書き換え動作について説明する。まず、所定の論理ブロックに記憶されたデータに係る書き換え動作の概略的な手順について説明する。なお、ここでは説明を簡単にするために、図3に示されるように、書き換え対象の論理ブロックのアドレスをL、当該論理ブロックに対して当初対応付けられていてデータ書き換えに伴って消去対象となる物理ブロック(このように、データ書き換え前に論理ブロックに対して対応付けられていた物理ブロックを、以降の説明において前使用物理ブロックと称するものとする)のアドレスをB、また当該論理ブロックに対して新たに対応付けられてデータ書き換えに伴ってデータの書き込み対象となる物理ブロックのアドレスをPとする。また、以降の説明においては、アドレスnによりアクセスされる論理ブロックおよび物理ブロックをそれぞれ論理ブロックnおよび物理ブロックnとそれぞれ適宜称するものとする。
【0007】
図6は、所定の論理ブロックに記憶されるデータに係る書き換え方法を示すフローチャートである。第1に、書き換え対象となる論理ブロックLを特定する(ステップS1)。次に、図5(a)に示されるように、アドレス変換テーブルを参照して、その時点において論理ブロックLに対応付けられている前使用物理ブロックのアドレスBを特定する(ステップS2)。次に、フラッシュメモリの各物理ブロックを検索して、空きブロックを検出し当該空きブロックのアドレスPを特定する(ステップS3)。なお、複数の物理ブロックのなかから適切な空きブロックを検出する方法については後述する。このように、書き込み対象の物理ブロックPおよび消去対象の物理ブロックBが特定されれば、まず書き込み対象となる物理ブロックPに対してデータの書き込みを実施する(ステップS4)。次に、前使用物理ブロックBのデータを消去する(ステップS5)。そして、図5(b)に示されるように、アドレス変換テーブルにおいて、論理ブロックLに対応付けられている物理ブロックを物理ブロックBから物理ブロックPに変更する(ステップS6)ことで、データ書き換え動作を完了する。
【0008】
次に、複数の物理ブロックのなかから適切な空きブロックを検出する方法について説明する。図7は、適切な空きブロックを検出する方法を示すフローチャートである。まず、書き換え回数最小値に係る初期値の設定を実施する(ステップS11)。この初期値としては、例えば書き換え回数記憶領域14に記憶することができる最大の数値を設定することが考えられる。次に、概念的には図3に示されるように順次配列された複数の物理ブロックから成る記憶領域について、例えばアドレスについて昇順または降順に一つずつ物理ブロックを取り出して検索対象となる物理ブロックを特定する(ステップS12)。検索対象となる物理ブロックが特定されれば、当該物理ブロックの論理ブロックアドレス記憶領域13を参照して、当該物理ブロックが既に論理ブロックに対応付けられているか否かすなわち当該物理ブロックが空きブロックであるか否かを判定する(ステップS13)。検索対象となっている物理ブロックが空きブロックである場合には、当該物理ブロックの書き換え回数記憶領域14を参照して、当該物理ブロックの書き換え回数が書き換え回数最小値より小さいか否かを判定する(ステップS14)。当該物理ブロックの書き換え回数が書き換え回数最小値より小さい場合には、検索対象となっている物理ブロックを書き込み対象の物理ブロックして設定する(ステップS15)とともに、書き換え回数最小値として当該物理ブロックの書き換え回数を設定する(ステップS16)。
【0009】
ステップS16の処理を終了した後、ステップS13において検索対象となっている物理ブロックが空きブロックでない場合、並びにステップS14において検索対象となっている物理ブロックの書き換え回数が書き換え回数最小値以上である場合には、全ての物理ブロックについて検索が完了したか否かを判定する(ステップS17)。全ての物理ブロックについて検索が完了していない場合には、ステップS12に戻って同様の処理を次の物理ブロックに対して実施する。また、全ての物理ブロックについて検索が完了した場合には、書き込み対象の物理ブロックとして最終的に設定された物理ブロックについて、当該物理ブロックに係る書き換え回数を1つ増分して書き換え回数記憶領域14に書き込む(ステップS18)。
【0010】
NAND型フラッシュメモリ等のフラッシュメモリについては同一の物理ブロックへの書き込みが集中すると素子が劣化するために、上記のような処理を実施することで、各物理ブロックについての書き換え回数を平均化することができて、フラッシュメモリ自体の寿命を延ばすことが可能となる。
【0011】
【発明が解決しようとする課題】
物理ブロックの書き換え回数を平均化するための従来の空きブロックの検出方法は上記のように構成されているので、各物理ブロック毎に書き換え回数記憶領域を具備させる必要があるとともに、書き換え回数が大きくなった場合にはラップアラウンドに係る処理等を実施する必要が生じるために、メモリの制御システムが複雑になるという課題があった。
【0012】
この発明は上記のような課題を解決するためになされたもので、NAND型フラッシュメモリ等の不揮発性メモリを構成する各物理ブロック毎の書き換え回数を簡単な方式を用いて平均化させることができる不揮発性メモリのデータ書き換え方法を得ることを目的とする。
【0013】
【課題を解決するための手段】
この発明に係る不揮発性メモリのデータ書き換え方法は、消去状態にあって書き込み可能な物理ブロックである空きブロックの数を確認する第1のステップと、乱数を発生させて、複数の空きブロックのなかから1つの空きブロックを選定し、当該空きブロックを書き込み対象となる物理ブロックとして特定する第2のステップとを有するようにしたものである。
【0014】
この発明に係る不揮発性メモリのデータ書き換え方法は、空きブロックの数だけ順次配列された複数の記憶部から成りそれぞれの記憶部には空きブロックを特定する情報が記憶されている空きブロック登録テーブルを設けて、発生された乱数に応じて、空きブロック登録テーブル内のいずれかの記憶部を選定することで書き込み対象となる空きブロックを特定するようにしたものである。
【0015】
【発明の実施の形態】
以下、添付の図面を参照して本願発明に係る実施の形態を説明する。なお、以下の説明においては、本願発明の実施の形態に記載された各手段および各工程と、特許請求の範囲に記載された発明の各手段および各工程との対応関係を明らかにするために、実施の形態に記載された各手段および各工程にそれぞれ対応する特許請求の範囲に記載された発明の各手段および各工程を適宜かっこ書きにより示すものとする。
【0016】
実施の形態1.
この発明の実施の形態1においては、フラッシュメモリ(不揮発性メモリ)の記憶領域に係る論理ブロックと物理ブロックとの関係については、従来技術と同様に図3に示されるような関係を有するものとし、フラッシュメモリに記憶されたデータに係る処理を実施するに際しては、CPU側からは論理ブロックアドレスによりアクセスする方式をとる。但し、この実施の形態1は、従来技術と比較して、例えば空きブロックのアドレス等として与えられる空きブロック特定情報を順次登録する空きブロック登録テーブルを有する点で差異を有する。図1は、空きブロック登録テーブル等を示す図である。図1において、1は空きブロックの数を記録する空きブロック数カウンタ、2はそれぞれが順次配列された複数の記憶部から構成される空きブロック登録テーブルである。空きブロック数カウンタ1および空きブロック登録テーブル2は、ともに例えばCPUに接続されたRAM内のワークエリアにおいて構成することが可能である。図1に示されるように、空きブロック数カウンタ1に記憶された空きブロックの数がNである場合には、空きブロック登録テーブル2におけるアドレス0からアドレス(N−1)によりアクセス可能な各記憶部にそれぞれ空きブロックのアドレスが記憶される。
【0017】
次に、この実施の形態1によるメモリ制御方法について説明する。所定の論理ブロックに記憶されたデータに係る書き換え動作は、基本的には図6に示されたフローチャートによる書き換え動作と同様であるので、その説明を省略する。従来技術と本願発明とでは、適切な空きブロックを検出する方法において差異を有している。図2は、この発明の実施の形態1による適切な空きブロックの検出方法を示すフローチャートである。まず、空きブロック数カウンタ1を参照して、その時点においてデータ書き込み可能となっている空きブロックの数を確認する(ステップS21(第1のステップ))。空きブロック数をNとすると、N個の空きブロックのなかから適切な空きブロックを選定するように、0から(N−1)の範囲で乱数を発生させて、空きブロック登録テーブル2において、アクセスするアドレスMを決定する(ステップS22)。次に、空きブロック登録テーブルのアドレスMに登録されている物理ブロックのアドレスPを読み出して、この物理ブロックPを書き込み対象の物理ブロックとして特定する(ステップS23(第2のステップ))。書き込み対象の物理ブロックPが特定されれば、空きブロック登録テーブル2におけるアドレスMの記憶部に、図3に示されるようにこの書き込み動作に伴って消去対象となる物理ブロックのアドレスBをアドレスPに代えて書き込む(ステップS24)。なお、書き込み対象の物理ブロックPが特定された後の処理については、図6に示されるように、書き込み対象の物理ブロックPにデータを書き込み、前使用物理ブロックBのデータを消去し、アドレス変換テーブルを更新することでデータの書き換えを完了する。
【0018】
以上のように、この実施の形態1によれば、空きブロックの数を確認するステップS21と、乱数を発生させて、当該乱数に応じて複数の空きブロックのなかから1つの空きブロックを選定し、選定された空きブロックを書き込み対象となる物理ブロックとして特定するステップS23とを有するように構成したので、フラッシュメモリへのデータの書き換え回数が多くなれば各物理ブロックの書き換え回数も統計的に平均化されることが予測され、書き換え回数記憶領域14等を必要としない簡単な構成、並びに書き換え回数のカウント処理やラップアラウンド処理等の処理を必要としない簡単な方式によって、各物理ブロックの書き換え回数を平均化させてフラッシュメモリの寿命を延ばすことができるという効果を奏する。
【0019】
また、空きブロックの数だけ順次配列された記憶部にそれぞれ空きブロックのアドレスを記憶した空きブロック登録テーブル2を設けて、発生された乱数に応じて空きブロック登録テーブル2内のいずれかの記憶部を選定することで書き込み対象となる1つの空きブロックを特定するように構成したので、空きブロックの管理を容易にするとともに、空きブロック数に応じた所定の数値範囲において発生させた乱数を順次配列された記憶部のアドレスに対応付けることで、おおよそ同じ確率での各空きブロックの選定を可能とするシステムを容易に構築することができるという効果を奏する。
【0020】
なお、上記の実施の形態1による不揮発性メモリのデータ書き換え方法は、本願発明を限定するものではなく、例示することを意図して開示されているものである。本願発明の技術的範囲は特許請求の範囲の記載により定められるものであり、特許請求の範囲に記載された技術的範囲内において種々の設計的変更が可能である。例えば、空きブロック登録テーブルを必ずしも設ける必要はなく、フラッシュメモリの記憶領域を構成する全物理ブロックのアドレス範囲に対応する数値範囲において乱数を発生させて、当該乱数に基づいて得られたアドレスを中心とした近傍領域の物理ブロックを検索して、得られたアドレスに最も近い空きブロックを書き込み対象の物理ブロックとして特定するような方法をとることも可能である。
【0021】
【発明の効果】
以上のように、この発明によれば、空きブロックの数を確認する第1のステップと、乱数を発生させて、複数の空きブロックのなかから1つの空きブロックを選定し、当該空きブロックを書き込み対象となる物理ブロックとして特定する第2のステップとを有するように構成したので、不揮発性メモリへのデータの書き換え回数が多くなれば各物理ブロックの書き換え回数も統計的に平均化されることが予測され、書き換え回数記憶領域等を必要としない簡単な構成、並びに書き換え回数のカウント処理やラップアラウンド処理等の処理を必要としない簡単な方式によって、各物理ブロックの書き換え回数を平均化させて不揮発性メモリの寿命を延ばすことができるという効果を奏する。
【0022】
この発明によれば、空きブロックの数だけ順次配列された複数の記憶部から成りそれぞれの記憶部には空きブロックを特定する情報が記憶されている空きブロック登録テーブルを設けて、発生された乱数に応じて、空きブロック登録テーブル内のいずれかの記憶部を選定することで書き込み対象となる空きブロックを特定するように構成したので、空きブロックの管理を容易にするとともに、空きブロック数に応じた所定の数値範囲において発生させた乱数を順次配列された記憶部のアドレスに対応付けることで、おおよそ同じ確率での各空きブロックの選定を可能とするシステムを容易に構築することができるという効果を奏する。
【図面の簡単な説明】
【図1】 この発明の実施の形態1による空きブロック登録テーブル等を示す図である。
【図2】 この発明の実施の形態1による適切な空きブロックの検出方法を示すフローチャートである。
【図3】 不揮発性メモリの記憶領域に係る論理ブロックと物理ブロックとの関係を示す図である。
【図4】 従来の適切な空きブロックの検出方法において用いられる物理ブロック内に格納される管理情報に係るデータ構造を示す図である。
【図5】 アドレス変換テーブルの構造を示す図である。
【図6】 不揮発性メモリで用いられるデータ書き換え方法の概略を示すフローチャートである。
【図7】 適切な空きブロックを検出する従来の方法を示すフローチャートである。
【符号の説明】
1 空きブロック数カウンタ、2 空きブロック登録テーブル、11 データ領域、12 冗長領域、13 論理ブロックアドレス記憶領域、14 書き換え回数記憶領域
[0001]
BACKGROUND OF THE INVENTION
The present invention shortens the life of a flash memory caused by data rewriting concentrated on the same physical block in a nonvolatile memory such as a NAND flash memory provided in an electronic device such as a memory card. The present invention relates to a data rewriting method for a nonvolatile memory to prevent, and particularly relates to a data rewriting method for a nonvolatile memory which can average the number of times of rewriting related to each physical block using a simple processing method.
[0002]
[Prior art]
In recent years, non-volatile memories such as low-cost NAND flash memory suitable for storing large amounts of data have been widely used in electronic devices such as home appliances, portable electronic devices, and memory cards. FIG. 3 is a diagram illustrating a relationship between a logical block and a physical block related to a storage area of the nonvolatile memory. The storage area of a rewritable flash memory represented by a NAND flash memory is managed in units of blocks, such as erasing data (usually writing binary data “1” to all bits), writing data, etc. Data processing is performed for each physical block.
[0003]
When accessing the flash memory, for example, by referring to an address conversion table stored in a RAM connected to the CPU, the logical block address of the logical block that is the data processing target as shown in FIG. Is converted into a physical block address, and a physical block on which data is erased, written, read, etc. is specified. By adopting a method of accessing by the logical block address in this way, when a defective physical block is generated, the processing operation for the defective physical block is changed to a writable physical block in another erased state for replacement ( Even if it is executed for the empty block (hereinafter referred to as “empty block”), the CPU executing the application program can access using the same logical block address regardless of the presence or absence of block substitution.
[0004]
FIG. 4 is a diagram showing a data structure related to management information stored in a physical block of a conventional flash memory. In FIG. 4, 11 is a data area in which normal data is stored, 12 is a redundant area in which data relating to management information about the physical block is stored, and physical blocks are divided from the data area 11 and the redundant area 12. Composed. Reference numeral 13 denotes a logical block address storage area for storing the address of the logical block corresponding to the physical block having the redundant area, and reference numeral 14 denotes the number of times data is written from the erased state to the physical block having the redundant area. This is a rewrite count storage area for storing (rewrite count). In the logical block address storage area 13, if there is no logical block associated with the physical block, a predetermined value that is not used as the logical block address is written and an empty block is written. It is possible to identify that
[0005]
FIG. 5 is a diagram illustrating an example of an address conversion table configured in a RAM connected to, for example, a CPU in a conventional electronic device including a flash memory. 5A shows an address conversion table before data rewriting when data is rewritten to a logical block having an address L, and FIG. 5B shows an address conversion table after data rewriting. The update of the address conversion table accompanying such data rewriting will be described later. As shown in FIG. 5A, for example, addresses A, B, C, and D of the corresponding physical blocks are stored in the logical blocks specified by the addresses L-1, L, L + 1, and L + 2, respectively. . By referring to the address conversion table as shown in FIG. 5A, the physical block initially associated with the logical block to be processed can be specified.
[0006]
Next, a data rewriting operation performed on a conventional flash memory will be described. First, a schematic procedure of a rewrite operation related to data stored in a predetermined logical block will be described. In order to simplify the description here, as shown in FIG. 3, the address of the logical block to be rewritten is L, which is initially associated with the logical block, and is to be erased along with data rewriting. The address of the physical block (in this way, the physical block associated with the logical block before data rewriting will be referred to as the previously used physical block in the following description) is assigned to B and the logical block. On the other hand, P is the address of a physical block that is newly associated with the data to be written along with data rewriting. In the following description, a logical block and a physical block accessed by an address n are appropriately referred to as a logical block n and a physical block n, respectively.
[0007]
FIG. 6 is a flowchart showing a rewriting method related to data stored in a predetermined logical block. First, the logical block L to be rewritten is specified (step S1). Next, as shown in FIG. 5A, the address B of the previous used physical block associated with the logical block L at that time is specified with reference to the address conversion table (step S2). Next, each physical block in the flash memory is searched to detect a free block and specify the address P of the free block (step S3). Note that a method for detecting an appropriate empty block from a plurality of physical blocks will be described later. As described above, when the physical block P to be written and the physical block B to be erased are specified, data is first written to the physical block P to be written (step S4). Next, the data of the previously used physical block B is erased (step S5). Then, as shown in FIG. 5B, the data rewrite operation is performed by changing the physical block associated with the logical block L from the physical block B to the physical block P in the address translation table (step S6). To complete.
[0008]
Next, a method for detecting an appropriate empty block from a plurality of physical blocks will be described. FIG. 7 is a flowchart showing a method for detecting an appropriate empty block. First, an initial value relating to the minimum number of rewrites is set (step S11). As this initial value, for example, it is conceivable to set the maximum numerical value that can be stored in the rewrite count storage area 14. Next, conceptually, as shown in FIG. 3, with respect to a storage area composed of a plurality of physical blocks arranged sequentially, for example, the physical blocks to be retrieved are retrieved one by one in ascending or descending order with respect to addresses. Specify (step S12). If the physical block to be searched is specified, the logical block address storage area 13 of the physical block is referred to and whether or not the physical block is already associated with the logical block, that is, the physical block is an empty block. It is determined whether or not there is (step S13). When the physical block to be searched is an empty block, it is determined by referring to the rewrite count storage area 14 of the physical block whether the rewrite count of the physical block is smaller than the minimum rewrite count value. (Step S14). If the physical block rewrite count is smaller than the rewrite count minimum value, the search target physical block is set as the write target physical block (step S15), and the rewrite count minimum value of the physical block is set. The number of rewrites is set (step S16).
[0009]
After the process of step S16 is completed, when the physical block that is the search target in step S13 is not an empty block, and when the number of rewrites of the physical block that is the search target in step S14 is greater than or equal to the minimum number of rewrites In step S17, it is determined whether or not the search has been completed for all physical blocks. If the search has not been completed for all physical blocks, the process returns to step S12 and the same processing is performed for the next physical block. When the search is completed for all physical blocks, the number of rewrites related to the physical block is incremented by one in the rewrite count storage area 14 for the physical block finally set as the physical block to be written. Write (step S18).
[0010]
For flash memory such as NAND flash memory, the elements deteriorate when concentration of writing to the same physical block is concentrated. By performing the above processing, the number of rewrites for each physical block is averaged. Thus, the lifetime of the flash memory itself can be extended.
[0011]
[Problems to be solved by the invention]
The conventional free block detection method for averaging the number of physical block rewrites is configured as described above. Therefore, it is necessary to provide a rewrite number storage area for each physical block, and the number of rewrites is large. In such a case, there is a problem that the memory control system becomes complicated because it becomes necessary to perform processing related to wraparound.
[0012]
The present invention has been made to solve the above-described problems, and the number of rewrites for each physical block constituting a nonvolatile memory such as a NAND flash memory can be averaged using a simple method. An object is to obtain a data rewriting method for a nonvolatile memory.
[0013]
[Means for Solving the Problems]
The nonvolatile memory data rewriting method according to the present invention includes a first step of confirming the number of empty blocks that are writable physical blocks in an erased state, and generating a random number to generate a random number of empty blocks. And a second step of selecting one empty block as a physical block to be written.
[0014]
A data rewriting method for a nonvolatile memory according to the present invention comprises a plurality of storage units sequentially arranged by the number of empty blocks, and each storage unit has an empty block registration table in which information for specifying an empty block is stored. A free block to be written is specified by selecting any storage unit in the free block registration table according to the generated random number.
[0015]
DETAILED DESCRIPTION OF THE INVENTION
Embodiments according to the present invention will be described below with reference to the accompanying drawings. In the following description, in order to clarify the correspondence between each means and each step described in the embodiment of the present invention and each means and each step of the invention described in the claims. Each means and each process of the invention described in the claims corresponding to each means and each process described in the embodiment are indicated by parentheses as appropriate.
[0016]
Embodiment 1 FIG.
In the first embodiment of the present invention, the relationship between the logical block and the physical block related to the storage area of the flash memory (nonvolatile memory) has the relationship shown in FIG. 3 as in the prior art. When executing processing related to the data stored in the flash memory, the CPU side accesses by the logical block address. However, the first embodiment is different from the prior art in that it has an empty block registration table for sequentially registering empty block specifying information given as, for example, an address of an empty block. FIG. 1 is a diagram showing an empty block registration table and the like. In FIG. 1, 1 is a free block number counter for recording the number of free blocks, and 2 is a free block registration table composed of a plurality of storage units arranged in sequence. Both the empty block counter 1 and the empty block registration table 2 can be configured in a work area in a RAM connected to the CPU, for example. As shown in FIG. 1, when the number of empty blocks stored in the empty block counter 1 is N, each storage accessible from address 0 to address (N−1) in the empty block registration table 2 Each block stores the address of an empty block.
[0017]
Next, a memory control method according to the first embodiment will be described. A rewrite operation related to data stored in a predetermined logical block is basically the same as the rewrite operation according to the flowchart shown in FIG. The prior art and the present invention have a difference in a method for detecting an appropriate empty block. FIG. 2 is a flowchart showing an appropriate empty block detection method according to the first embodiment of the present invention. First, with reference to the free block number counter 1, the number of free blocks in which data can be written at that time is confirmed (step S21 (first step)). Assuming that the number of empty blocks is N, random numbers are generated in the range of 0 to (N−1) so that an appropriate empty block is selected from the N empty blocks. The address M to be determined is determined (step S22). Next, the address P of the physical block registered in the address M of the free block registration table is read, and this physical block P is specified as the physical block to be written (step S23 (second step)). If the physical block P to be written is specified, the address B of the physical block to be erased along with this write operation is stored in the storage unit of the address M in the free block registration table 2 as shown in FIG. Instead of writing (step S24). As shown in FIG. 6, the processing after the physical block P to be written is specified writes data to the physical block P to be written, erases the data of the previously used physical block B, and converts the address. Data rewriting is completed by updating the table.
[0018]
As described above, according to the first embodiment, step S21 for confirming the number of empty blocks and a random number are generated, and one empty block is selected from a plurality of empty blocks according to the random number. The step S23 for specifying the selected empty block as a physical block to be written is included. Therefore, if the number of times data is rewritten to the flash memory increases, the number of times the physical block is rewritten is also statistically averaged. The number of times each physical block is rewritten by a simple configuration that does not require the rewrite count storage area 14 or the like and a simple method that does not require rewrite count processing, wraparound processing, or the like. As a result, it is possible to extend the life of the flash memory.
[0019]
Also, a free block registration table 2 that stores the addresses of the free blocks is provided in the storage units that are sequentially arranged by the number of free blocks, and any of the storage units in the free block registration table 2 according to the generated random number. Since one empty block to be written is specified by selecting the number of random blocks generated in a predetermined numerical range according to the number of free blocks By associating with the address of the stored storage unit, it is possible to easily construct a system that enables selection of each empty block with approximately the same probability.
[0020]
The data rewriting method for the nonvolatile memory according to the first embodiment is not intended to limit the present invention, but is disclosed for the purpose of illustration. The technical scope of the present invention is defined by the description of the scope of claims, and various design changes can be made within the technical scope described in the scope of claims. For example, it is not always necessary to provide an empty block registration table. Random numbers are generated in a numerical range corresponding to the address range of all physical blocks constituting the storage area of the flash memory, and an address obtained based on the random number is centered. It is also possible to search for physical blocks in the neighboring area and specify a free block closest to the obtained address as a physical block to be written.
[0021]
【The invention's effect】
As described above, according to the present invention, the first step of checking the number of empty blocks and the generation of a random number to select one empty block from a plurality of empty blocks and write the empty block Since the second step of specifying as a target physical block is included, if the number of data rewrites to the nonvolatile memory increases, the number of rewrites of each physical block may be statistically averaged. Non-volatile by averaging the number of rewrites of each physical block with a simple configuration that does not require a rewrite count storage area, etc., and a simple method that does not require rewrite count processing or wraparound processing. This has the effect of extending the life of the memory.
[0022]
According to the present invention, a random number generated by providing a free block registration table that includes a plurality of storage units sequentially arranged by the number of free blocks and in which each storage unit stores information specifying a free block. Depending on the number of free blocks, it is easy to manage the free blocks and to select the storage block in the free block registration table. By associating random numbers generated in a predetermined numerical range with the addresses of the storage units sequentially arranged, it is possible to easily construct a system that allows selection of each empty block with approximately the same probability. Play.
[Brief description of the drawings]
FIG. 1 is a diagram showing an empty block registration table and the like according to Embodiment 1 of the present invention.
FIG. 2 is a flowchart showing an appropriate empty block detection method according to Embodiment 1 of the present invention;
FIG. 3 is a diagram illustrating a relationship between a logical block and a physical block related to a storage area of a nonvolatile memory.
FIG. 4 is a diagram showing a data structure relating to management information stored in a physical block used in a conventional appropriate free block detection method;
FIG. 5 is a diagram illustrating a structure of an address conversion table.
FIG. 6 is a flowchart showing an outline of a data rewriting method used in a nonvolatile memory.
FIG. 7 is a flowchart illustrating a conventional method for detecting an appropriate empty block.
[Explanation of symbols]
1 free block counter, 2 free block registration table, 11 data area, 12 redundant area, 13 logical block address storage area, 14 rewrite count storage area

Claims (2)

書き換え対象となる論理ブロックを特定するステップと、アドレス変換テーブルにおいて当該論理ブロックに対して当初対応付けられていて消去対象となる物理ブロックを特定するステップと、書き込み対象となる物理ブロックを特定するステップと、書き込み対象となる物理ブロックに対してデータを書き込むステップと、消去対象の物理ブロックのデータを消去するステップと、アドレス変換テーブルにおいて当該論理ブロックに対して書き込み対象となる物理ブロックを対応付けるステップとを有する不揮発性メモリのデータ書き換え方法において、
消去状態にあって書き込み可能な物理ブロックである空きブロックの数を確認する第1のステップと、
乱数を発生させて、複数の空きブロックのなかから1つの空きブロックを選定し、当該空きブロックを書き込み対象となる物理ブロックとして特定する第2のステップとを有することを特徴とする不揮発性メモリのデータ書き換え方法。
A step of specifying a logical block to be rewritten, a step of specifying a physical block to be erased that is initially associated with the logical block in the address translation table, and a step of specifying a physical block to be written Writing data to a physical block to be written, erasing data of a physical block to be erased, and associating a physical block to be written to the logical block in the address conversion table In a data rewriting method of a nonvolatile memory having
A first step of confirming the number of empty blocks that are erasable and writable physical blocks;
A second step of generating a random number, selecting one empty block from a plurality of empty blocks, and specifying the empty block as a physical block to be written, Data rewriting method.
空きブロックの数だけ順次配列された複数の記憶部から成りそれぞれの記憶部には空きブロックを特定する情報が記憶されている空きブロック登録テーブルを設けて、
発生された乱数に応じて、空きブロック登録テーブル内のいずれかの記憶部を選定することで書き込み対象となる空きブロックを特定することを特徴とする請求項1記載の不揮発性メモリのデータ書き換え方法。
A plurality of storage units sequentially arranged as many as the number of empty blocks is provided, and each storage unit is provided with an empty block registration table in which information for specifying an empty block is stored,
2. The data rewriting method for a non-volatile memory according to claim 1, wherein an empty block to be written is specified by selecting one of the storage units in the empty block registration table according to the generated random number. .
JP2001236928A 2001-07-25 2001-08-03 Non-volatile memory data rewrite method Expired - Fee Related JP3646679B2 (en)

Priority Applications (5)

Application Number Priority Date Filing Date Title
JP2001236928A JP3646679B2 (en) 2001-08-03 2001-08-03 Non-volatile memory data rewrite method
KR1020047000158A KR100877030B1 (en) 2001-07-25 2002-07-19 Non-volatile memory and non-volatile memory data rewriting method
PCT/JP2002/007356 WO2003010671A1 (en) 2001-07-25 2002-07-19 Non-volatile memory and non-volatile memory data rewriting method
US10/484,322 US7240178B2 (en) 2001-07-25 2002-07-19 Non-volatile memory and non-volatile memory data rewriting method
CNB028147979A CN1255733C (en) 2001-07-25 2002-07-19 Non-volatile memory and non-volatile memory data rewriting method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2001236928A JP3646679B2 (en) 2001-08-03 2001-08-03 Non-volatile memory data rewrite method

Publications (2)

Publication Number Publication Date
JP2003050747A JP2003050747A (en) 2003-02-21
JP3646679B2 true JP3646679B2 (en) 2005-05-11

Family

ID=19068103

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2001236928A Expired - Fee Related JP3646679B2 (en) 2001-07-25 2001-08-03 Non-volatile memory data rewrite method

Country Status (1)

Country Link
JP (1) JP3646679B2 (en)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2004310650A (en) 2003-04-10 2004-11-04 Renesas Technology Corp Memory device
JP5617873B2 (en) * 2005-06-06 2014-11-05 ソニー株式会社 Storage device
KR100735024B1 (en) * 2005-12-29 2007-07-03 삼성전자주식회사 An address converter of a semiconductor device and semiconductor memory device
JP2008123314A (en) * 2006-11-14 2008-05-29 Nec Electronics Corp Information recording method and information recording system to semiconductor storage device
CN112631522A (en) * 2020-12-25 2021-04-09 上海威固信息技术股份有限公司 Method for quickly clearing particle data of flash memory of solid state disk

Family Cites Families (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH02310896A (en) * 1989-05-25 1990-12-26 Canon Inc Method for writing to memory element
JPH05265874A (en) * 1992-03-24 1993-10-15 Oki Electric Ind Co Ltd Method for preserving data in memory
JPH05274219A (en) * 1992-03-27 1993-10-22 Alps Electric Co Ltd Storage device
JP3390482B2 (en) * 1992-06-12 2003-03-24 株式会社リコー Facsimile machine
JPH06139138A (en) * 1992-10-29 1994-05-20 Toshiba Corp Memory card device
JPH09293386A (en) * 1996-04-30 1997-11-11 Matsushita Electric Ind Co Ltd Storage device
JPH11249968A (en) * 1998-03-05 1999-09-17 Sanyo Electric Co Ltd File recording method and file system
JP3242890B2 (en) * 1998-12-16 2001-12-25 株式会社ハギワラシスコム Storage device

Also Published As

Publication number Publication date
JP2003050747A (en) 2003-02-21

Similar Documents

Publication Publication Date Title
US6879528B2 (en) Control method of nonvolatile memory
US7240178B2 (en) Non-volatile memory and non-volatile memory data rewriting method
US7571362B2 (en) Method of managing fails in a non-volatile memory device and relative memory device
TWI470429B (en) Memory device and memory access method
JP4948793B2 (en) Flash memory system including bad block manager
US20080120488A1 (en) Apparatus and method of managing nonvolatile memory
US20070016719A1 (en) Memory device including nonvolatile memory and memory controller
US7287117B2 (en) Flash memory and mapping control apparatus and method for flash memory
US8200891B2 (en) Memory controller, memory system with memory controller, and method of controlling flash memory
US20070150645A1 (en) Method, system and apparatus for power loss recovery to enable fast erase time
US6839798B1 (en) Flash memory capable of storing frequently rewritten data
CN112596668A (en) Bad block processing method and system for memory
US20070005929A1 (en) Method, system, and article of manufacture for sector mapping in a flash device
JP3646679B2 (en) Non-volatile memory data rewrite method
JP2003058417A (en) Storage device
JP4488048B2 (en) MEMORY CONTROLLER, FLASH MEMORY SYSTEM HAVING MEMORY CONTROLLER, AND FLASH MEMORY CONTROL METHOD
US6646917B1 (en) Storage device managing nonvolatile memory by converting logical address to physical address of nonvolatile memory
US8200919B2 (en) Storage device with self-condition inspection and inspection method thereof
US10559359B2 (en) Method for rewriting data in nonvolatile memory and semiconductor device
JP2004326523A (en) Storage device with rewritable nonvolatile memory, and control method of nonvolatile memory for storage device
JP2005316793A (en) Flash memory system and control method of flash memory
JP2009053950A (en) Memory controller, flash memory system provided with memory controller, and method for controlling flash memory
JPH09134312A (en) Flash memory device
JP2014026511A (en) Write control method of nonvolatile semiconductor memory device and microcomputer
JP4580724B2 (en) Nonvolatile memory control method

Legal Events

Date Code Title Description
TRDD Decision of grant or rejection written
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20050118

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20050131

LAPS Cancellation because of no payment of annual fees